diff options
author | Chris Zankel <chris@zankel.net> | 2008-02-12 16:17:07 -0500 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2008-02-13 20:41:43 -0500 |
commit | c658eac628aa8df040dfe614556d95e6da3a9ffb (patch) | |
tree | e2211e1d5c894c29e92d4c744f504b38410efe41 /include/asm-xtensa/ptrace.h | |
parent | 71d28e6c285548106f551fde13ca6d589433d843 (diff) |
[XTENSA] Add support for configurable registers and coprocessors
The Xtensa architecture allows to define custom instructions and
registers. Registers that are bound to a coprocessor are only
accessible if the corresponding enable bit is set, which allows
to implement a 'lazy' context switch mechanism. Other registers
needs to be saved and restore at the time of the context switch
or during interrupt handling.
This patch adds support for these additional states:
- save and restore registers that are used by the compiler upon
interrupt entry and exit.
- context switch additional registers unbound to any coprocessor
- 'lazy' context switch of registers bound to a coprocessor
- ptrace interface to provide access to additional registers
- update configuration files in include/asm-xtensa/variant-fsf
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'include/asm-xtensa/ptrace.h')
-rw-r--r-- | include/asm-xtensa/ptrace.h | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h index 77ff02d307bb..422c73e26937 100644 --- a/include/asm-xtensa/ptrace.h +++ b/include/asm-xtensa/ptrace.h | |||
@@ -53,33 +53,30 @@ | |||
53 | 53 | ||
54 | /* Registers used by strace */ | 54 | /* Registers used by strace */ |
55 | 55 | ||
56 | #define REG_A_BASE 0xfc000000 | 56 | #define REG_A_BASE 0x0000 |
57 | #define REG_AR_BASE 0x04000000 | 57 | #define REG_AR_BASE 0x0100 |
58 | #define REG_PC 0x14000000 | 58 | #define REG_PC 0x0020 |
59 | #define REG_PS 0x080000e6 | 59 | #define REG_PS 0x02e6 |
60 | #define REG_WB 0x08000048 | 60 | #define REG_WB 0x0248 |
61 | #define REG_WS 0x08000049 | 61 | #define REG_WS 0x0249 |
62 | #define REG_LBEG 0x08000000 | 62 | #define REG_LBEG 0x0200 |
63 | #define REG_LEND 0x08000001 | 63 | #define REG_LEND 0x0201 |
64 | #define REG_LCOUNT 0x08000002 | 64 | #define REG_LCOUNT 0x0202 |
65 | #define REG_SAR 0x08000003 | 65 | #define REG_SAR 0x0203 |
66 | #define REG_DEPC 0x080000c0 | 66 | |
67 | #define REG_EXCCAUSE 0x080000e8 | 67 | #define SYSCALL_NR 0x00ff |
68 | #define REG_EXCVADDR 0x080000ee | ||
69 | #define SYSCALL_NR 0x1 | ||
70 | |||
71 | #define AR_REGNO_TO_A_REGNO(ar, wb) (ar - wb*4) & ~(XCHAL_NUM_AREGS - 1) | ||
72 | 68 | ||
73 | /* Other PTRACE_ values defined in <linux/ptrace.h> using values 0-9,16,17,24 */ | 69 | /* Other PTRACE_ values defined in <linux/ptrace.h> using values 0-9,16,17,24 */ |
74 | 70 | ||
75 | #define PTRACE_GETREGS 12 | 71 | #define PTRACE_GETREGS 12 |
76 | #define PTRACE_SETREGS 13 | 72 | #define PTRACE_SETREGS 13 |
77 | #define PTRACE_GETFPREGS 14 | 73 | #define PTRACE_GETXTREGS 18 |
78 | #define PTRACE_SETFPREGS 15 | 74 | #define PTRACE_SETXTREGS 19 |
79 | #define PTRACE_GETFPREGSIZE 18 | ||
80 | 75 | ||
81 | #ifndef __ASSEMBLY__ | 76 | #ifndef __ASSEMBLY__ |
82 | 77 | ||
78 | #ifdef __KERNEL__ | ||
79 | |||
83 | /* | 80 | /* |
84 | * This struct defines the way the registers are stored on the | 81 | * This struct defines the way the registers are stored on the |
85 | * kernel stack during a system call or other kernel entry. | 82 | * kernel stack during a system call or other kernel entry. |
@@ -102,6 +99,9 @@ struct pt_regs { | |||
102 | unsigned long icountlevel; /* 60 */ | 99 | unsigned long icountlevel; /* 60 */ |
103 | int reserved[1]; /* 64 */ | 100 | int reserved[1]; /* 64 */ |
104 | 101 | ||
102 | /* Additional configurable registers that are used by the compiler. */ | ||
103 | xtregs_opt_t xtregs_opt; | ||
104 | |||
105 | /* Make sure the areg field is 16 bytes aligned. */ | 105 | /* Make sure the areg field is 16 bytes aligned. */ |
106 | int align[0] __attribute__ ((aligned(16))); | 106 | int align[0] __attribute__ ((aligned(16))); |
107 | 107 | ||
@@ -111,8 +111,6 @@ struct pt_regs { | |||
111 | unsigned long areg[16]; /* 128 (64) */ | 111 | unsigned long areg[16]; /* 128 (64) */ |
112 | }; | 112 | }; |
113 | 113 | ||
114 | #ifdef __KERNEL__ | ||
115 | |||
116 | #include <asm/variant/core.h> | 114 | #include <asm/variant/core.h> |
117 | 115 | ||
118 | # define task_pt_regs(tsk) ((struct pt_regs*) \ | 116 | # define task_pt_regs(tsk) ((struct pt_regs*) \ |