diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-02-15 19:09:28 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-02-15 19:09:28 +0000 |
commit | a22e98a5e881cc217f56da8a2582e54177cca8c5 (patch) | |
tree | ca1b2f531d1ee742760851a29d569765b6cc9379 /nuttx/arch/sh/src/m16c | |
parent | 7dec1c70ecb7e1430322b96193de262159e37827 (diff) | |
download | px4-nuttx-a22e98a5e881cc217f56da8a2582e54177cca8c5.tar.gz px4-nuttx-a22e98a5e881cc217f56da8a2582e54177cca8c5.tar.bz2 px4-nuttx-a22e98a5e881cc217f56da8a2582e54177cca8c5.zip |
Add support for nestable interrupts
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1506 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/sh/src/m16c')
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_initialstate.c | 5 | ||||
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_timerisr.c | 2 | ||||
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_vectors.S | 11 |
3 files changed, 16 insertions, 2 deletions
diff --git a/nuttx/arch/sh/src/m16c/m16c_initialstate.c b/nuttx/arch/sh/src/m16c/m16c_initialstate.c index e4c556788..189367279 100644 --- a/nuttx/arch/sh/src/m16c/m16c_initialstate.c +++ b/nuttx/arch/sh/src/m16c/m16c_initialstate.c @@ -40,7 +40,10 @@ #include <nuttx/config.h> #include <sys/types.h> #include <string.h> + #include <nuttx/arch.h> +#include <arch/board/board.h> + #include "up_internal.h" #include "up_arch.h" @@ -48,8 +51,6 @@ * Preprocessor Definitions ****************************************************************************/ -#define M16C_DEFAULT_IPL 0 /* Default M16C Interrupt priority level */ - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/nuttx/arch/sh/src/m16c/m16c_timerisr.c b/nuttx/arch/sh/src/m16c/m16c_timerisr.c index 962166071..3cc632719 100644 --- a/nuttx/arch/sh/src/m16c/m16c_timerisr.c +++ b/nuttx/arch/sh/src/m16c/m16c_timerisr.c @@ -41,7 +41,9 @@ #include <sys/types.h> #include <time.h> #include <debug.h> + #include <nuttx/arch.h> +#include <arch/board/board.h> #include "clock_internal.h" #include "up_internal.h" diff --git a/nuttx/arch/sh/src/m16c/m16c_vectors.S b/nuttx/arch/sh/src/m16c/m16c_vectors.S index 2ffa50154..17f47f560 100644 --- a/nuttx/arch/sh/src/m16c/m16c_vectors.S +++ b/nuttx/arch/sh/src/m16c/m16c_vectors.S @@ -346,6 +346,13 @@ _m16c_commonvector: fclr u /* Back to interrupt stack */ push.w r0 /* Save user sp on isp */ +/* Allow nested interrupts */ + +#ifdef M16C_INTERRUPT_IPL + fset i /* Enable interrupts */ + ldipl #M16C_INTERRUPT_IPL /* Set interrupt level */ +#endif + /* Then call _up_doirq with r1=IRQ number, r2=address of context info. At this * point, the interrupt stack holds the address of the last byte of the context * info array @@ -354,6 +361,10 @@ _m16c_commonvector: stc isp, r2 /* R2 = address of base of context info */ jsr.a _up_doirq +#ifdef M16C_INTERRUPT_IPL + fclr i /* Disable interrupts */ +#endif + /* Upon return, r0 will hold address of the base of the new context info structure * use for return. Most of the time this will be the same as the address passed to * to _up_doirg above, but will differ if a context switch occurs during interrupt |