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
This commit is contained in:
patacongo
2011-04-06 23:01:06 +00:00
parent f37cd2e046
commit 7bb3b4c8a1
53 changed files with 289 additions and 143 deletions
+9 -3
View File
@@ -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.
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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? */
+2 -2
View File
@@ -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