mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:04:17 +08:00
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:
@@ -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.
|
||||
|
||||
@@ -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,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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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? */
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user