summaryrefslogtreecommitdiff
path: root/nuttx/arch/x86
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-06 23:01:06 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-06 23:01:06 +0000
commit8285ffad2245a53de14c65913b00dab5568f0afc (patch)
treea4707d8f1e51d31b1fc2866c63260bfbf99b1f34 /nuttx/arch/x86
parentdcea5f0360725d2c25b61eefe9db7b2474b26dd6 (diff)
downloadpx4-nuttx-8285ffad2245a53de14c65913b00dab5568f0afc.tar.gz
px4-nuttx-8285ffad2245a53de14c65913b00dab5568f0afc.tar.bz2
px4-nuttx-8285ffad2245a53de14c65913b00dab5568f0afc.zip
current_regs should be volatile; add support for nested interrupts; enable interrupts during syscall processing
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3475 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/x86')
-rw-r--r--nuttx/arch/x86/src/common/up_assert.c2
-rw-r--r--nuttx/arch/x86/src/common/up_internal.h2
-rwxr-xr-xnuttx/arch/x86/src/i486/up_irq.c2
-rw-r--r--nuttx/arch/x86/src/i486/up_savestate.c2
-rw-r--r--nuttx/arch/x86/src/qemu/qemu_handlers.c13
5 files changed, 13 insertions, 8 deletions
diff --git a/nuttx/arch/x86/src/common/up_assert.c b/nuttx/arch/x86/src/common/up_assert.c
index 55ba376b4..776784656 100644
--- a/nuttx/arch/x86/src/common/up_assert.c
+++ b/nuttx/arch/x86/src/common/up_assert.c
@@ -198,7 +198,7 @@ static void up_dumpstate(void)
if (current_regs != NULL)
{
- up_registerdump(current_regs);
+ up_registerdump((uint32_t*)current_regs);
}
}
#else
diff --git a/nuttx/arch/x86/src/common/up_internal.h b/nuttx/arch/x86/src/common/up_internal.h
index 51f79beb3..185d0afc0 100644
--- a/nuttx/arch/x86/src/common/up_internal.h
+++ b/nuttx/arch/x86/src/common/up_internal.h
@@ -99,7 +99,7 @@ typedef void (*up_vector_t)(void);
* structure. If is non-NULL only during interrupt processing.
*/
-extern uint32_t *current_regs;
+extern volatile uint32_t *current_regs;
/* This is the beginning of heap as provided from up_head.S. This is the first
* address in DRAM after the loaded program+bss+idle stack. The end of the
diff --git a/nuttx/arch/x86/src/i486/up_irq.c b/nuttx/arch/x86/src/i486/up_irq.c
index 627c727de..01da4962e 100755
--- a/nuttx/arch/x86/src/i486/up_irq.c
+++ b/nuttx/arch/x86/src/i486/up_irq.c
@@ -72,7 +72,7 @@ static inline void up_idtinit(void);
* Public Data
****************************************************************************/
-uint32_t *current_regs;
+volatile uint32_t *current_regs;
/****************************************************************************
* Private Data
diff --git a/nuttx/arch/x86/src/i486/up_savestate.c b/nuttx/arch/x86/src/i486/up_savestate.c
index d5f97fa85..1d35c62a9 100644
--- a/nuttx/arch/x86/src/i486/up_savestate.c
+++ b/nuttx/arch/x86/src/i486/up_savestate.c
@@ -80,7 +80,7 @@ void up_savestate(uint32_t *regs)
/* First, just copy all of the registers */
- up_copystate(regs, current_regs);
+ up_copystate(regs, (uint32_t*)current_regs);
/* The RES_SP and REG_SS values will not be saved by the interrupt handling
* logic if there is no change in privilege level. In that case, we will
diff --git a/nuttx/arch/x86/src/qemu/qemu_handlers.c b/nuttx/arch/x86/src/qemu/qemu_handlers.c
index fbcb327aa..a85370f76 100644
--- a/nuttx/arch/x86/src/qemu/qemu_handlers.c
+++ b/nuttx/arch/x86/src/qemu/qemu_handlers.c
@@ -86,6 +86,8 @@ static void idt_outb(uint8_t val, uint16_t addr)
#ifndef CONFIG_SUPPRESS_INTERRUPTS
static uint32_t *common_handler(int irq, uint32_t *regs)
{
+ uint32_t *savestate;
+
up_ledon(LED_INIRQ);
/* Nested interrupts are not supported in this implementation. If you want
@@ -98,7 +100,7 @@ static uint32_t *common_handler(int irq, uint32_t *regs)
* current_regs is also used to manage interrupt level context switches.
*/
- DEBUGASSERT(current_regs == NULL);
+ savestate = (uint32_t*)current_regs;
current_regs = regs;
/* Deliver the IRQ */
@@ -111,11 +113,14 @@ static uint32_t *common_handler(int irq, uint32_t *regs)
* switch occurred during interrupt processing.
*/
- regs = current_regs;
+ regs = (uint32_t*)current_regs;
- /* Indicate that we are no long in an interrupt handler */
+ /* Restore the previous value of current_regs. NULL would indicate that
+ * we are no longer in an interrupt handler. It will be non-NULL if we
+ * are returning from a nested interrupt.
+ */
- current_regs = NULL;
+ current_regs = savestate;
return regs;
}
#endif