summaryrefslogtreecommitdiff
path: root/nuttx/arch/sh/src
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/sh/src')
-rw-r--r--nuttx/arch/sh/src/common/up_doirq.c12
-rw-r--r--nuttx/arch/sh/src/common/up_internal.h2
-rw-r--r--nuttx/arch/sh/src/common/up_reprioritizertr.c2
-rw-r--r--nuttx/arch/sh/src/m16c/m16c_irq.c4
-rwxr-xr-xnuttx/arch/sh/src/sh1/sh1_dumpstate.c4
-rw-r--r--nuttx/arch/sh/src/sh1/sh1_irq.c4
6 files changed, 17 insertions, 11 deletions
diff --git a/nuttx/arch/sh/src/common/up_doirq.c b/nuttx/arch/sh/src/common/up_doirq.c
index 6e64a623c..0ec82b7d9 100644
--- a/nuttx/arch/sh/src/common/up_doirq.c
+++ b/nuttx/arch/sh/src/common/up_doirq.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/common/up_doirq.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -77,11 +77,14 @@ uint32_t *up_doirq(int irq, uint32_t* regs)
#else
if ((unsigned)irq < NR_IRQS)
{
+ uint32_t *savestate;
+
/* Current regs non-zero indicates that we are processing
* an interrupt; current_regs is also used to manage
* interrupt level context switches.
*/
+ savestate = (uint32_t*)current_regs;
current_regs = regs;
/* Mask and acknowledge the interrupt (if supported by the chip) */
@@ -100,9 +103,12 @@ uint32_t *up_doirq(int irq, uint32_t* regs)
regs = current_regs;
- /* Indicate that we are no longer 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;
/* Unmask the last interrupt (global interrupts are still
* disabled.
diff --git a/nuttx/arch/sh/src/common/up_internal.h b/nuttx/arch/sh/src/common/up_internal.h
index 7840caf66..7b1fb5f33 100644
--- a/nuttx/arch/sh/src/common/up_internal.h
+++ b/nuttx/arch/sh/src/common/up_internal.h
@@ -98,7 +98,7 @@ typedef void (*up_vector_t)(void);
* 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
diff --git a/nuttx/arch/sh/src/common/up_reprioritizertr.c b/nuttx/arch/sh/src/common/up_reprioritizertr.c
index cc9d0ff47..58a142563 100644
--- a/nuttx/arch/sh/src/common/up_reprioritizertr.c
+++ b/nuttx/arch/sh/src/common/up_reprioritizertr.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/common/up_reprioritizertr.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
diff --git a/nuttx/arch/sh/src/m16c/m16c_irq.c b/nuttx/arch/sh/src/m16c/m16c_irq.c
index 10e129412..5cfb43e8d 100644
--- a/nuttx/arch/sh/src/m16c/m16c_irq.c
+++ b/nuttx/arch/sh/src/m16c/m16c_irq.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/m16c/m16c_irq.c
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -57,7 +57,7 @@
* structure. If is non-NULL only during interrupt processing.
*/
-uint32_t *current_regs; /* Actually a pointer to the beginning of a uint8_t array */
+volatile uint32_t *current_regs; /* Actually a pointer to the beginning of a uint8_t array */
/****************************************************************************
* Private Data
diff --git a/nuttx/arch/sh/src/sh1/sh1_dumpstate.c b/nuttx/arch/sh/src/sh1/sh1_dumpstate.c
index cf6a16cbe..ddfa5e455 100755
--- a/nuttx/arch/sh/src/sh1/sh1_dumpstate.c
+++ b/nuttx/arch/sh/src/sh1/sh1_dumpstate.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/sh1/sh1_assert.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -113,7 +113,7 @@ static void sh1_stackdump(uint32_t sp, uint32_t stack_base)
static inline void sh1_registerdump(void)
{
- uint32_t *ptr = current_regs;
+ uint32_t *ptr = (uint32_t*)current_regs;
/* Are user registers available from interrupt processing? */
diff --git a/nuttx/arch/sh/src/sh1/sh1_irq.c b/nuttx/arch/sh/src/sh1/sh1_irq.c
index c5b33cc3e..d76d1d94c 100644
--- a/nuttx/arch/sh/src/sh1/sh1_irq.c
+++ b/nuttx/arch/sh/src/sh1/sh1_irq.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/sh1/sh1_irq.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -57,7 +57,7 @@
* Public Data
****************************************************************************/
-uint32_t *current_regs;
+volatile uint32_t *current_regs;
/****************************************************************************
* Private Data