diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-05-17 17:18:19 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-05-17 17:18:19 +0000 |
commit | 0fa834d4332608374852575437d2714f820868c4 (patch) | |
tree | 4e57188abe5ff32b2639ca69314fec94378bed8d /nuttx/arch/arm/src/common/up_internal.h | |
parent | 0368c4fac2539f3a8812f9471e9be74fb7aeb303 (diff) | |
download | px4-nuttx-0fa834d4332608374852575437d2714f820868c4.tar.gz px4-nuttx-0fa834d4332608374852575437d2714f820868c4.tar.bz2 px4-nuttx-0fa834d4332608374852575437d2714f820868c4.zip |
Debug Cortex-M3 interrupts
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1787 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/common/up_internal.h')
-rw-r--r-- | nuttx/arch/arm/src/common/up_internal.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h index 430631853..34a7918e1 100644 --- a/nuttx/arch/arm/src/common/up_internal.h +++ b/nuttx/arch/arm/src/common/up_internal.h @@ -71,6 +71,20 @@ # define CONFIG_ARCH_INTERRUPTSTACK 0 #endif +/* Macros to handle saving and restore interrupt state. In the current ARM + * model, the state is always copied to and from the stack and TCB. In the + * Cortex-M3 model, the state is copied from the stack to the TCB, but only + * a referenced is passed to get the the state from the TCB. + */ + +#ifdef __thumb2__ +# define up_savestate(regs) up_copystate(regs, current_regs) +# define up_restorestate(regs) (current_regs = regs) +#else +# define up_savestate(regs) up_copystate(regs, current_regs) +# define up_restorestate(regs) up_copystate(current_regs, regs) +#endif + /**************************************************************************** * Public Types ****************************************************************************/ @@ -122,7 +136,11 @@ extern void up_boot(void); extern void up_copystate(uint32 *dest, uint32 *src); extern void up_dataabort(uint32 *regs); extern void up_decodeirq(uint32 *regs); +#ifdef __thumb2__ extern uint32 *up_doirq(int irq, uint32 *regs); +#else +extern void up_doirq(int irq, uint32 *regs); +#endif extern void up_fullcontextrestore(uint32 *regs) __attribute__ ((noreturn)); extern void up_irqinitialize(void); extern void up_prefetchabort(uint32 *regs); |