diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-11-11 00:41:22 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-11-11 00:41:22 +0000 |
commit | 733adb3c87afca8b4f50623aa3cad407cf203e88 (patch) | |
tree | 7d53d95b4f2b25b9b6f172595ba8cbc20be2ca78 /nuttx/arch/sh/include/sh1/irq.h | |
parent | fca8049832b607144e4b68d2ec3022eb0385ae86 (diff) | |
download | px4-nuttx-733adb3c87afca8b4f50623aa3cad407cf203e88.tar.gz px4-nuttx-733adb3c87afca8b4f50623aa3cad407cf203e88.tar.bz2 px4-nuttx-733adb3c87afca8b4f50623aa3cad407cf203e88.zip |
Fix several context switching bugs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1187 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/sh/include/sh1/irq.h')
-rw-r--r-- | nuttx/arch/sh/include/sh1/irq.h | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/nuttx/arch/sh/include/sh1/irq.h b/nuttx/arch/sh/include/sh1/irq.h index 3c169db57..186e6834b 100644 --- a/nuttx/arch/sh/include/sh1/irq.h +++ b/nuttx/arch/sh/include/sh1/irq.h @@ -349,38 +349,44 @@ /* Saved to the stacked by up_vector */ -#define REG_R0 (0) -#define REG_R1 (1) -#define REG_R2 (2) -#define REG_R3 (3) -#define REG_R5 (5) -#define REG_R6 (6) -#define REG_R7 (7) -#define REG_R8 (8) -#define REG_R9 (9) -#define REG_R10 (10) -#define REG_R11 (11) -#define REG_R12 (12) -#define REG_R13 (13) -#define REG_R14 (14) - -#define REG_PR (15) -#define REG_GBR (16) -#define REG_MACH (17) -#define REG_MACL (18) +#define REG_R8 (0) +#define REG_R9 (1) +#define REG_R10 (2) +#define REG_R11 (3) +#define REG_R12 (4) +#define REG_R13 (5) +#define REG_R14 (6) + +#define REG_PR (7) +#define REG_GBR (8) + +/* The value of the stack pointer *before* the interrupt occurred */ + +#define REG_R15 (9) +#define REG_SP REG_R15 + +/* These registers do not need to be preserved by up_saveusercontext */ + +#define REG_MACL (10) +#define REG_MACH (11) +#define REG_R0 (12) +#define REG_R1 (13) +#define REG_R2 (14) +#define REG_R3 (15) +#define REG_R5 (16) +#define REG_R6 (17) +#define REG_R7 (18) /* Saved to the stack by the trampoline logic */ #define REG_R4 (19) -#define REG_R15 (20) -#define REG_SP REG_R15 /* Pushed by hardware when the exception is taken */ -#define REG_PC (21) -#define REG_SR (22) +#define REG_PC (20) +#define REG_SR (21) -#define XCPTCONTEXT_REGS (23) +#define XCPTCONTEXT_REGS (22) #define XCPTCONTEXT_SIZE (4 * XCPTCONTEXT_REGS) /************************************************************************************ |