diff options
Diffstat (limited to 'include/asm-frv')
-rw-r--r-- | include/asm-frv/elf.h | 6 | ||||
-rw-r--r-- | include/asm-frv/gdb-stub.h | 22 | ||||
-rw-r--r-- | include/asm-frv/processor.h | 3 | ||||
-rw-r--r-- | include/asm-frv/ptrace.h | 12 | ||||
-rw-r--r-- | include/asm-frv/registers.h | 97 | ||||
-rw-r--r-- | include/asm-frv/system.h | 1 | ||||
-rw-r--r-- | include/asm-frv/thread_info.h | 24 |
7 files changed, 69 insertions, 96 deletions
diff --git a/include/asm-frv/elf.h b/include/asm-frv/elf.h index 38656da00e4..7df58a3e6e4 100644 --- a/include/asm-frv/elf.h +++ b/include/asm-frv/elf.h @@ -64,7 +64,7 @@ typedef unsigned long elf_greg_t; #define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; -typedef struct fpmedia_struct elf_fpregset_t; +typedef struct user_fpmedia_regs elf_fpregset_t; /* * This is used to ensure we don't load something for the wrong architecture. @@ -116,6 +116,7 @@ do { \ } while(0) #define USE_ELF_CORE_DUMP +#define ELF_FDPIC_CORE_EFLAGS EF_FRV_FDPIC #define ELF_EXEC_PAGESIZE 16384 /* This is the location that an ET_DYN program is loaded if exec'ed. Typical @@ -125,9 +126,6 @@ do { \ #define ELF_ET_DYN_BASE 0x08000000UL -#define ELF_CORE_COPY_REGS(pr_reg, regs) \ - memcpy(&pr_reg[0], ®s->sp, 31 * sizeof(uint32_t)); - /* This yields a mask that user programs can use to figure out what instruction set this cpu supports. */ diff --git a/include/asm-frv/gdb-stub.h b/include/asm-frv/gdb-stub.h index c58479a4be9..24f9738670b 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); extern asmlinkage void __debug_stub_init_break(void); extern asmlinkage void __break_hijack_kernel_event(void); +extern asmlinkage void __break_hijack_kernel_event_breaks_here(void); extern asmlinkage void start_kernel(void); extern asmlinkage void gdbstub_rx_handler(void); @@ -114,5 +115,26 @@ extern void console_set_baud(unsigned baud); #define gdbstub_proto(FMT,...) ({ 0; }) #endif +/* + * we dedicate GR31 to keeping a pointer to the gdbstub exception frame + * - gr31 is destroyed on entry to the gdbstub if !MMU + * - gr31 is saved in scr3 on entry to the gdbstub if in !MMU + */ +register struct frv_frame0 *__debug_frame0 asm("gr31"); + +#define __debug_frame (&__debug_frame0->regs) +#define __debug_user_context (&__debug_frame0->uc) +#define __debug_regs (&__debug_frame0->debug) +#define __debug_reg(X) ((unsigned long *) ((unsigned long) &__debug_frame0 + (X))) + +struct frv_debug_status { + unsigned long bpsr; + unsigned long dcr; + unsigned long brr; + unsigned long nmar; +}; + +extern struct frv_debug_status __debug_status; + #endif /* _LANGUAGE_ASSEMBLY */ #endif /* __ASM_GDB_STUB_H */ diff --git a/include/asm-frv/processor.h b/include/asm-frv/processor.h index 1c4dba1c5f5..3744f2e47f4 100644 --- a/include/asm-frv/processor.h +++ b/include/asm-frv/processor.h @@ -21,6 +21,7 @@ */ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) +#include <linux/compiler.h> #include <linux/linkage.h> #include <asm/sections.h> #include <asm/segment.h> @@ -139,7 +140,7 @@ unsigned long get_wchan(struct task_struct *p); extern struct task_struct *alloc_task_struct(void); extern void free_task_struct(struct task_struct *p); -#define cpu_relax() do { } while (0) +#define cpu_relax() barrier() /* data cache prefetch */ #define ARCH_HAS_PREFETCH diff --git a/include/asm-frv/ptrace.h b/include/asm-frv/ptrace.h index b2cce0718e5..7ff525162a7 100644 --- a/include/asm-frv/ptrace.h +++ b/include/asm-frv/ptrace.h @@ -62,18 +62,10 @@ #ifndef __ASSEMBLY__ /* - * dedicate GR28; to keeping the a pointer to the current exception frame + * we dedicate GR28 to keeping a pointer to the current exception frame + * - gr28 is destroyed on entry to the kernel from userspace */ register struct pt_regs *__frame asm("gr28"); -register struct pt_regs *__debug_frame asm("gr31"); - -#ifndef container_of -#define container_of(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) -#endif - -#define __debug_regs container_of(__debug_frame, struct pt_debug_regs, normal_regs) #define user_mode(regs) (!((regs)->psr & PSR_S)) #define instruction_pointer(regs) ((regs)->pc) diff --git a/include/asm-frv/registers.h b/include/asm-frv/registers.h index fccfd95cff6..9666119fcf6 100644 --- a/include/asm-frv/registers.h +++ b/include/asm-frv/registers.h @@ -23,7 +23,13 @@ * * +0x2000 +---------------------- * | union { - * | struct user_context + * | struct frv_frame0 { + * | struct user_context { + * | struct user_int_regs + * | struct user_fpmedia_regs + * | } + * | struct frv_debug_regs + * | } * | struct pt_regs [user exception] * | } * +---------------------- <-- __kernel_frame0_ptr (maybe GR28) @@ -51,11 +57,11 @@ #define _ASM_REGISTERS_H #ifndef __ASSEMBLY__ -#define __OFFSET(X) (X) +#define __OFFSET(X,N) ((X)+(N)*4) #define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx #else -#define __OFFSET(X) ((X)*4) -#define __OFFSETC(X,N) ((X)*4+(N)) +#define __OFFSET(X,N) ((X)+(N)*4) +#define __OFFSETC(X,N) ((X)+(N)) #endif /*****************************************************************************/ @@ -117,30 +123,13 @@ struct pt_regs { #endif -#define REG_PSR __OFFSET( 0) /* Processor Status Register */ -#define REG_ISR __OFFSET( 1) /* Integer Status Register */ -#define REG_CCR __OFFSET( 2) /* Condition Code Register */ -#define REG_CCCR __OFFSET( 3) /* Condition Code for Conditional Insns Register */ -#define REG_LR __OFFSET( 4) /* Link Register */ -#define REG_LCR __OFFSET( 5) /* Loop Count Register */ -#define REG_PC __OFFSET( 6) /* Program Counter */ - -#define REG__STATUS __OFFSET( 7) /* exception status */ #define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */ #define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */ #define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */ #define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */ #define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */ -#define REG_SYSCALLNO __OFFSET( 8) /* syscall number or -1 */ -#define REG_ORIG_GR8 __OFFSET( 9) /* saved GR8 for signal handling */ -#define REG_GNER0 __OFFSET(10) -#define REG_GNER1 __OFFSET(11) -#define REG_IACC0 __OFFSET(12) - -#define REG_TBR __OFFSET(14) /* Trap Vector Register */ -#define REG_GR(R) __OFFSET((14+(R))) -#define REG__END REG_GR(32) +#define REG_GR(R) __OFFSET(REG_GR0, (R)) #define REG_SP REG_GR(1) #define REG_FP REG_GR(2) @@ -149,27 +138,21 @@ struct pt_regs { /*****************************************************************************/ /* - * extension tacked in front of the exception frame in debug mode + * debugging registers */ #ifndef __ASSEMBLY__ -struct pt_debug_regs +struct frv_debug_regs { - unsigned long bpsr; unsigned long dcr; - unsigned long brr; - unsigned long nmar; - struct pt_regs normal_regs; + unsigned long ibar[4] __attribute__((aligned(8))); + unsigned long dbar[4] __attribute__((aligned(8))); + unsigned long dbdr[4][4] __attribute__((aligned(8))); + unsigned long dbmr[4][4] __attribute__((aligned(8))); } __attribute__((aligned(8))); #endif -#define REG_NMAR __OFFSET(-1) -#define REG_BRR __OFFSET(-2) -#define REG_DCR __OFFSET(-3) -#define REG_BPSR __OFFSET(-4) -#define REG__DEBUG_XTRA __OFFSET(4) - /*****************************************************************************/ /* * userspace registers @@ -223,33 +206,27 @@ struct user_context void *extension; } __attribute__((aligned(8))); +struct frv_frame0 { + union { + struct pt_regs regs; + struct user_context uc; + }; + + struct frv_debug_regs debug; + +} __attribute__((aligned(32))); + #endif -#define NR_USER_INT_REGS (14 + 64) -#define NR_USER_FPMEDIA_REGS (64 + 2 + 2 + 8 + 8/4 + 1) -#define NR_USER_CONTEXT (NR_USER_INT_REGS + NR_USER_FPMEDIA_REGS + 1) - -#define USER_CONTEXT_SIZE (((NR_USER_CONTEXT + 1) & ~1) * 4) - -#define __THREAD_FRAME __OFFSET(0) -#define __THREAD_CURR __OFFSET(1) -#define __THREAD_SP __OFFSET(2) -#define __THREAD_FP __OFFSET(3) -#define __THREAD_LR __OFFSET(4) -#define __THREAD_PC __OFFSET(5) -#define __THREAD_GR(R) __OFFSET(6 + (R) - 16) -#define __THREAD_FRAME0 __OFFSET(19) -#define __THREAD_USER __OFFSET(19) - -#define __USER_INT __OFFSET(0) -#define __INT_GR(R) __OFFSET(14 + (R)) - -#define __USER_FPMEDIA __OFFSET(NR_USER_INT_REGS) -#define __FPMEDIA_FR(R) __OFFSET(NR_USER_INT_REGS + (R)) -#define __FPMEDIA_FNER(R) __OFFSET(NR_USER_INT_REGS + 64 + (R)) -#define __FPMEDIA_MSR(R) __OFFSET(NR_USER_INT_REGS + 66 + (R)) -#define __FPMEDIA_ACC(R) __OFFSET(NR_USER_INT_REGS + 68 + (R)) -#define __FPMEDIA_ACCG(R) __OFFSETC(NR_USER_INT_REGS + 76, (R)) -#define __FPMEDIA_FSR(R) __OFFSET(NR_USER_INT_REGS + 78 + (R)) +#define __INT_GR(R) __OFFSET(__INT_GR0, (R)) + +#define __FPMEDIA_FR(R) __OFFSET(__FPMEDIA_FR0, (R)) +#define __FPMEDIA_FNER(R) __OFFSET(__FPMEDIA_FNER0, (R)) +#define __FPMEDIA_MSR(R) __OFFSET(__FPMEDIA_MSR0, (R)) +#define __FPMEDIA_ACC(R) __OFFSET(__FPMEDIA_ACC0, (R)) +#define __FPMEDIA_ACCG(R) __OFFSETC(__FPMEDIA_ACCG0, (R)) +#define __FPMEDIA_FSR(R) __OFFSET(__FPMEDIA_FSR0, (R)) + +#define __THREAD_GR(R) __OFFSET(__THREAD_GR16, (R) - 16) #endif /* _ASM_REGISTERS_H */ diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index 351863dfd06..1166899317d 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h @@ -179,7 +179,6 @@ do { \ #define rmb() asm volatile ("membar" : : :"memory") #define wmb() asm volatile ("membar" : : :"memory") #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #define smp_mb() mb() #define smp_rmb() rmb() diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h index ea426abf01d..d66c48e6ef1 100644 --- a/include/asm-frv/thread_info.h +++ b/include/asm-frv/thread_info.h @@ -19,6 +19,8 @@ #include <asm/processor.h> #endif +#define THREAD_SIZE 8192 + /* * low level task data that entry.S needs immediate access to * - this struct should fit entirely inside of one cache line @@ -46,15 +48,7 @@ struct thread_info { #else /* !__ASSEMBLY__ */ -/* offsets into the thread_info struct for assembly code access */ -#define TI_TASK 0x00000000 -#define TI_EXEC_DOMAIN 0x00000004 -#define TI_FLAGS 0x00000008 -#define TI_STATUS 0x0000000C -#define TI_CPU 0x00000010 -#define TI_PRE_COUNT 0x00000014 -#define TI_ADDR_LIMIT 0x00000018 -#define TI_RESTART_BLOCK 0x0000001C +#include <asm/asm-offsets.h> #endif @@ -83,12 +77,6 @@ struct thread_info { #define init_thread_info (init_thread_union.thread_info) #define init_stack (init_thread_union.stack) -#ifdef CONFIG_SMALL_TASKS -#define THREAD_SIZE 4096 -#else -#define THREAD_SIZE 8192 -#endif - /* how to get the thread information struct from C */ register struct thread_info *__current_thread_info asm("gr15"); @@ -111,11 +99,7 @@ register struct thread_info *__current_thread_info asm("gr15"); #define free_thread_info(info) kfree(info) -#else /* !__ASSEMBLY__ */ - -#define THREAD_SIZE 8192 - -#endif +#endif /* __ASSEMBLY__ */ /* * thread information flags |