aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-frv
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-frv')
-rw-r--r--include/asm-frv/elf.h6
-rw-r--r--include/asm-frv/gdb-stub.h22
-rw-r--r--include/asm-frv/processor.h3
-rw-r--r--include/asm-frv/ptrace.h12
-rw-r--r--include/asm-frv/registers.h97
-rw-r--r--include/asm-frv/system.h1
-rw-r--r--include/asm-frv/thread_info.h24
7 files changed, 69 insertions, 96 deletions
diff --git a/include/asm-frv/elf.h b/include/asm-frv/elf.h
index 38656da00e40..7df58a3e6e4a 100644
--- a/include/asm-frv/elf.h
+++ b/include/asm-frv/elf.h
@@ -64,7 +64,7 @@ typedef unsigned long elf_greg_t;
64#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) 64#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))
65typedef elf_greg_t elf_gregset_t[ELF_NGREG]; 65typedef elf_greg_t elf_gregset_t[ELF_NGREG];
66 66
67typedef struct fpmedia_struct elf_fpregset_t; 67typedef struct user_fpmedia_regs elf_fpregset_t;
68 68
69/* 69/*
70 * This is used to ensure we don't load something for the wrong architecture. 70 * This is used to ensure we don't load something for the wrong architecture.
@@ -116,6 +116,7 @@ do { \
116} while(0) 116} while(0)
117 117
118#define USE_ELF_CORE_DUMP 118#define USE_ELF_CORE_DUMP
119#define ELF_FDPIC_CORE_EFLAGS EF_FRV_FDPIC
119#define ELF_EXEC_PAGESIZE 16384 120#define ELF_EXEC_PAGESIZE 16384
120 121
121/* This is the location that an ET_DYN program is loaded if exec'ed. Typical 122/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
@@ -125,9 +126,6 @@ do { \
125 126
126#define ELF_ET_DYN_BASE 0x08000000UL 127#define ELF_ET_DYN_BASE 0x08000000UL
127 128
128#define ELF_CORE_COPY_REGS(pr_reg, regs) \
129 memcpy(&pr_reg[0], &regs->sp, 31 * sizeof(uint32_t));
130
131/* This yields a mask that user programs can use to figure out what 129/* This yields a mask that user programs can use to figure out what
132 instruction set this cpu supports. */ 130 instruction set this cpu supports. */
133 131
diff --git a/include/asm-frv/gdb-stub.h b/include/asm-frv/gdb-stub.h
index c58479a4be99..24f9738670bd 100644
--- a/include/asm-frv/gdb-stub.h
+++ b/include/asm-frv/gdb-stub.h
@@ -89,6 +89,7 @@ extern void gdbstub_do_rx(void);
89 89
90extern asmlinkage void __debug_stub_init_break(void); 90extern asmlinkage void __debug_stub_init_break(void);
91extern asmlinkage void __break_hijack_kernel_event(void); 91extern asmlinkage void __break_hijack_kernel_event(void);
92extern asmlinkage void __break_hijack_kernel_event_breaks_here(void);
92extern asmlinkage void start_kernel(void); 93extern asmlinkage void start_kernel(void);
93 94
94extern asmlinkage void gdbstub_rx_handler(void); 95extern asmlinkage void gdbstub_rx_handler(void);
@@ -114,5 +115,26 @@ extern void console_set_baud(unsigned baud);
114#define gdbstub_proto(FMT,...) ({ 0; }) 115#define gdbstub_proto(FMT,...) ({ 0; })
115#endif 116#endif
116 117
118/*
119 * we dedicate GR31 to keeping a pointer to the gdbstub exception frame
120 * - gr31 is destroyed on entry to the gdbstub if !MMU
121 * - gr31 is saved in scr3 on entry to the gdbstub if in !MMU
122 */
123register struct frv_frame0 *__debug_frame0 asm("gr31");
124
125#define __debug_frame (&__debug_frame0->regs)
126#define __debug_user_context (&__debug_frame0->uc)
127#define __debug_regs (&__debug_frame0->debug)
128#define __debug_reg(X) ((unsigned long *) ((unsigned long) &__debug_frame0 + (X)))
129
130struct frv_debug_status {
131 unsigned long bpsr;
132 unsigned long dcr;
133 unsigned long brr;
134 unsigned long nmar;
135};
136
137extern struct frv_debug_status __debug_status;
138
117#endif /* _LANGUAGE_ASSEMBLY */ 139#endif /* _LANGUAGE_ASSEMBLY */
118#endif /* __ASM_GDB_STUB_H */ 140#endif /* __ASM_GDB_STUB_H */
diff --git a/include/asm-frv/processor.h b/include/asm-frv/processor.h
index 1c4dba1c5f57..3744f2e47f48 100644
--- a/include/asm-frv/processor.h
+++ b/include/asm-frv/processor.h
@@ -21,6 +21,7 @@
21 */ 21 */
22#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 22#define current_text_addr() ({ __label__ _l; _l: &&_l;})
23 23
24#include <linux/compiler.h>
24#include <linux/linkage.h> 25#include <linux/linkage.h>
25#include <asm/sections.h> 26#include <asm/sections.h>
26#include <asm/segment.h> 27#include <asm/segment.h>
@@ -139,7 +140,7 @@ unsigned long get_wchan(struct task_struct *p);
139extern struct task_struct *alloc_task_struct(void); 140extern struct task_struct *alloc_task_struct(void);
140extern void free_task_struct(struct task_struct *p); 141extern void free_task_struct(struct task_struct *p);
141 142
142#define cpu_relax() do { } while (0) 143#define cpu_relax() barrier()
143 144
144/* data cache prefetch */ 145/* data cache prefetch */
145#define ARCH_HAS_PREFETCH 146#define ARCH_HAS_PREFETCH
diff --git a/include/asm-frv/ptrace.h b/include/asm-frv/ptrace.h
index b2cce0718e57..7ff525162a72 100644
--- a/include/asm-frv/ptrace.h
+++ b/include/asm-frv/ptrace.h
@@ -62,18 +62,10 @@
62#ifndef __ASSEMBLY__ 62#ifndef __ASSEMBLY__
63 63
64/* 64/*
65 * dedicate GR28; to keeping the a pointer to the current exception frame 65 * we dedicate GR28 to keeping a pointer to the current exception frame
66 * - gr28 is destroyed on entry to the kernel from userspace
66 */ 67 */
67register struct pt_regs *__frame asm("gr28"); 68register struct pt_regs *__frame asm("gr28");
68register struct pt_regs *__debug_frame asm("gr31");
69
70#ifndef container_of
71#define container_of(ptr, type, member) ({ \
72 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
73 (type *)( (char *)__mptr - offsetof(type,member) );})
74#endif
75
76#define __debug_regs container_of(__debug_frame, struct pt_debug_regs, normal_regs)
77 69
78#define user_mode(regs) (!((regs)->psr & PSR_S)) 70#define user_mode(regs) (!((regs)->psr & PSR_S))
79#define instruction_pointer(regs) ((regs)->pc) 71#define instruction_pointer(regs) ((regs)->pc)
diff --git a/include/asm-frv/registers.h b/include/asm-frv/registers.h
index fccfd95cff68..9666119fcf6e 100644
--- a/include/asm-frv/registers.h
+++ b/include/asm-frv/registers.h
@@ -23,7 +23,13 @@
23 * 23 *
24 * +0x2000 +---------------------- 24 * +0x2000 +----------------------
25 * | union { 25 * | union {
26 * | struct user_context 26 * | struct frv_frame0 {
27 * | struct user_context {
28 * | struct user_int_regs
29 * | struct user_fpmedia_regs
30 * | }
31 * | struct frv_debug_regs
32 * | }
27 * | struct pt_regs [user exception] 33 * | struct pt_regs [user exception]
28 * | } 34 * | }
29 * +---------------------- <-- __kernel_frame0_ptr (maybe GR28) 35 * +---------------------- <-- __kernel_frame0_ptr (maybe GR28)
@@ -51,11 +57,11 @@
51#define _ASM_REGISTERS_H 57#define _ASM_REGISTERS_H
52 58
53#ifndef __ASSEMBLY__ 59#ifndef __ASSEMBLY__
54#define __OFFSET(X) (X) 60#define __OFFSET(X,N) ((X)+(N)*4)
55#define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx 61#define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx
56#else 62#else
57#define __OFFSET(X) ((X)*4) 63#define __OFFSET(X,N) ((X)+(N)*4)
58#define __OFFSETC(X,N) ((X)*4+(N)) 64#define __OFFSETC(X,N) ((X)+(N))
59#endif 65#endif
60 66
61/*****************************************************************************/ 67/*****************************************************************************/
@@ -117,30 +123,13 @@ struct pt_regs {
117 123
118#endif 124#endif
119 125
120#define REG_PSR __OFFSET( 0) /* Processor Status Register */
121#define REG_ISR __OFFSET( 1) /* Integer Status Register */
122#define REG_CCR __OFFSET( 2) /* Condition Code Register */
123#define REG_CCCR __OFFSET( 3) /* Condition Code for Conditional Insns Register */
124#define REG_LR __OFFSET( 4) /* Link Register */
125#define REG_LCR __OFFSET( 5) /* Loop Count Register */
126#define REG_PC __OFFSET( 6) /* Program Counter */
127
128#define REG__STATUS __OFFSET( 7) /* exception status */
129#define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */ 126#define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */
130#define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */ 127#define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */
131#define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */ 128#define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */
132#define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */ 129#define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */
133#define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */ 130#define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */
134 131
135#define REG_SYSCALLNO __OFFSET( 8) /* syscall number or -1 */ 132#define REG_GR(R) __OFFSET(REG_GR0, (R))
136#define REG_ORIG_GR8 __OFFSET( 9) /* saved GR8 for signal handling */
137#define REG_GNER0 __OFFSET(10)
138#define REG_GNER1 __OFFSET(11)
139#define REG_IACC0 __OFFSET(12)
140
141#define REG_TBR __OFFSET(14) /* Trap Vector Register */
142#define REG_GR(R) __OFFSET((14+(R)))
143#define REG__END REG_GR(32)
144 133
145#define REG_SP REG_GR(1) 134#define REG_SP REG_GR(1)
146#define REG_FP REG_GR(2) 135#define REG_FP REG_GR(2)
@@ -149,27 +138,21 @@ struct pt_regs {
149 138
150/*****************************************************************************/ 139/*****************************************************************************/
151/* 140/*
152 * extension tacked in front of the exception frame in debug mode 141 * debugging registers
153 */ 142 */
154#ifndef __ASSEMBLY__ 143#ifndef __ASSEMBLY__
155 144
156struct pt_debug_regs 145struct frv_debug_regs
157{ 146{
158 unsigned long bpsr;
159 unsigned long dcr; 147 unsigned long dcr;
160 unsigned long brr; 148 unsigned long ibar[4] __attribute__((aligned(8)));
161 unsigned long nmar; 149 unsigned long dbar[4] __attribute__((aligned(8)));
162 struct pt_regs normal_regs; 150 unsigned long dbdr[4][4] __attribute__((aligned(8)));
151 unsigned long dbmr[4][4] __attribute__((aligned(8)));
163} __attribute__((aligned(8))); 152} __attribute__((aligned(8)));
164 153
165#endif 154#endif
166 155
167#define REG_NMAR __OFFSET(-1)
168#define REG_BRR __OFFSET(-2)
169#define REG_DCR __OFFSET(-3)
170#define REG_BPSR __OFFSET(-4)
171#define REG__DEBUG_XTRA __OFFSET(4)
172
173/*****************************************************************************/ 156/*****************************************************************************/
174/* 157/*
175 * userspace registers 158 * userspace registers
@@ -223,33 +206,27 @@ struct user_context
223 void *extension; 206 void *extension;
224} __attribute__((aligned(8))); 207} __attribute__((aligned(8)));
225 208
209struct frv_frame0 {
210 union {
211 struct pt_regs regs;
212 struct user_context uc;
213 };
214
215 struct frv_debug_regs debug;
216
217} __attribute__((aligned(32)));
218
226#endif 219#endif
227 220
228#define NR_USER_INT_REGS (14 + 64) 221#define __INT_GR(R) __OFFSET(__INT_GR0, (R))
229#define NR_USER_FPMEDIA_REGS (64 + 2 + 2 + 8 + 8/4 + 1) 222
230#define NR_USER_CONTEXT (NR_USER_INT_REGS + NR_USER_FPMEDIA_REGS + 1) 223#define __FPMEDIA_FR(R) __OFFSET(__FPMEDIA_FR0, (R))
231 224#define __FPMEDIA_FNER(R) __OFFSET(__FPMEDIA_FNER0, (R))
232#define USER_CONTEXT_SIZE (((NR_USER_CONTEXT + 1) & ~1) * 4) 225#define __FPMEDIA_MSR(R) __OFFSET(__FPMEDIA_MSR0, (R))
233 226#define __FPMEDIA_ACC(R) __OFFSET(__FPMEDIA_ACC0, (R))
234#define __THREAD_FRAME __OFFSET(0) 227#define __FPMEDIA_ACCG(R) __OFFSETC(__FPMEDIA_ACCG0, (R))
235#define __THREAD_CURR __OFFSET(1) 228#define __FPMEDIA_FSR(R) __OFFSET(__FPMEDIA_FSR0, (R))
236#define __THREAD_SP __OFFSET(2) 229
237#define __THREAD_FP __OFFSET(3) 230#define __THREAD_GR(R) __OFFSET(__THREAD_GR16, (R) - 16)
238#define __THREAD_LR __OFFSET(4)
239#define __THREAD_PC __OFFSET(5)
240#define __THREAD_GR(R) __OFFSET(6 + (R) - 16)
241#define __THREAD_FRAME0 __OFFSET(19)
242#define __THREAD_USER __OFFSET(19)
243
244#define __USER_INT __OFFSET(0)
245#define __INT_GR(R) __OFFSET(14 + (R))
246
247#define __USER_FPMEDIA __OFFSET(NR_USER_INT_REGS)
248#define __FPMEDIA_FR(R) __OFFSET(NR_USER_INT_REGS + (R))
249#define __FPMEDIA_FNER(R) __OFFSET(NR_USER_INT_REGS + 64 + (R))
250#define __FPMEDIA_MSR(R) __OFFSET(NR_USER_INT_REGS + 66 + (R))
251#define __FPMEDIA_ACC(R) __OFFSET(NR_USER_INT_REGS + 68 + (R))
252#define __FPMEDIA_ACCG(R) __OFFSETC(NR_USER_INT_REGS + 76, (R))
253#define __FPMEDIA_FSR(R) __OFFSET(NR_USER_INT_REGS + 78 + (R))
254 231
255#endif /* _ASM_REGISTERS_H */ 232#endif /* _ASM_REGISTERS_H */
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index 351863dfd06e..1166899317d7 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -179,7 +179,6 @@ do { \
179#define rmb() asm volatile ("membar" : : :"memory") 179#define rmb() asm volatile ("membar" : : :"memory")
180#define wmb() asm volatile ("membar" : : :"memory") 180#define wmb() asm volatile ("membar" : : :"memory")
181#define set_mb(var, value) do { var = value; mb(); } while (0) 181#define set_mb(var, value) do { var = value; mb(); } while (0)
182#define set_wmb(var, value) do { var = value; wmb(); } while (0)
183 182
184#define smp_mb() mb() 183#define smp_mb() mb()
185#define smp_rmb() rmb() 184#define smp_rmb() rmb()
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h
index ea426abf01d3..d66c48e6ef14 100644
--- a/include/asm-frv/thread_info.h
+++ b/include/asm-frv/thread_info.h
@@ -19,6 +19,8 @@
19#include <asm/processor.h> 19#include <asm/processor.h>
20#endif 20#endif
21 21
22#define THREAD_SIZE 8192
23
22/* 24/*
23 * low level task data that entry.S needs immediate access to 25 * low level task data that entry.S needs immediate access to
24 * - this struct should fit entirely inside of one cache line 26 * - this struct should fit entirely inside of one cache line
@@ -46,15 +48,7 @@ struct thread_info {
46 48
47#else /* !__ASSEMBLY__ */ 49#else /* !__ASSEMBLY__ */
48 50
49/* offsets into the thread_info struct for assembly code access */ 51#include <asm/asm-offsets.h>
50#define TI_TASK 0x00000000
51#define TI_EXEC_DOMAIN 0x00000004
52#define TI_FLAGS 0x00000008
53#define TI_STATUS 0x0000000C
54#define TI_CPU 0x00000010
55#define TI_PRE_COUNT 0x00000014
56#define TI_ADDR_LIMIT 0x00000018
57#define TI_RESTART_BLOCK 0x0000001C
58 52
59#endif 53#endif
60 54
@@ -83,12 +77,6 @@ struct thread_info {
83#define init_thread_info (init_thread_union.thread_info) 77#define init_thread_info (init_thread_union.thread_info)
84#define init_stack (init_thread_union.stack) 78#define init_stack (init_thread_union.stack)
85 79
86#ifdef CONFIG_SMALL_TASKS
87#define THREAD_SIZE 4096
88#else
89#define THREAD_SIZE 8192
90#endif
91
92/* how to get the thread information struct from C */ 80/* how to get the thread information struct from C */
93register struct thread_info *__current_thread_info asm("gr15"); 81register struct thread_info *__current_thread_info asm("gr15");
94 82
@@ -111,11 +99,7 @@ register struct thread_info *__current_thread_info asm("gr15");
111 99
112#define free_thread_info(info) kfree(info) 100#define free_thread_info(info) kfree(info)
113 101
114#else /* !__ASSEMBLY__ */ 102#endif /* __ASSEMBLY__ */
115
116#define THREAD_SIZE 8192
117
118#endif
119 103
120/* 104/*
121 * thread information flags 105 * thread information flags