mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
This commit removes CONFIG_ARCH_INT_DISABLEALL. In the normal course of things, interrupts must occasionally be disabled using the up_irq_save() inline function to prevent contention in use of resources that may be shared between interrupt level and non-interrupt level logic. Now the question arises, if we are using BASEPRI to disable interrupts and have high priority interrupts enabled (CONFIG_ARCH_HIPRI_INTERRUPT=y), do we disable all interrupts except SVCall (we cannot disable SVCall interrupts). Or do we only disable the "normal" interrupts?
If we are using the BASEPRI register to disable interrupts, then the answer is that we must disable ONLY the "normal interrupts". That is because we cannot disable SVCALL interrupts and we cannot permit SVCAll interrupts running at a higher priority than the high priority interrupts (otherwise, they will introduce jitter in the high priority interrupt response time.) Hence, if you need to disable the high priority interrupt, you will have to disable the interrupt either at the peripheral that generates the interrupt or at the NVIC. Disabling global interrupts via the BASEPRI register cannot effect high priority interrupts.
This commit is contained in:
@@ -898,44 +898,6 @@ config ARCH_HIPRI_INTERRUPT
|
||||
the nested interrupt, the interrupt stack if no privileged task has
|
||||
run
|
||||
|
||||
config ARCH_INT_DISABLEALL
|
||||
bool "Disable high priority interrupts"
|
||||
default y
|
||||
depends on ARCH_HIPRI_INTERRUPT && EXPERIMENTAL
|
||||
---help---
|
||||
If ARCH_HIPRI_INTERRUPT is defined, then special high priority
|
||||
interrupts are supported. These are not "nested" in the normal
|
||||
sense of the word. These high priority interrupts can interrupt
|
||||
normal processing but execute outside of OS (although they can "get
|
||||
back into the game" via a PendSV interrupt).
|
||||
|
||||
In the normal course of things, interrupts must occasionally be
|
||||
disabled using the up_irq_save() inline function to prevent contention
|
||||
in use of resources that may be shared between interrupt level and
|
||||
non-interrupt level logic. Now the question arises, if
|
||||
ARCH_HIPRI_INTERRUPT, do we disable all interrupts (except SVCall),
|
||||
or do we only disable the "normal" interrupts. Since the high
|
||||
priority interrupts cannot interact with the OS, you may want to
|
||||
permit the high priority interrupts even if interrupts are
|
||||
disabled. The setting ARCH_INT_DISABLEALL can be used to select
|
||||
either behavior:
|
||||
|
||||
----------------------------+--------------+----------------------------
|
||||
CONFIG_ARCH_HIPRI_INTERRUPT | NO | YES
|
||||
----------------------------+--------------+--------------+-------------
|
||||
CONFIG_ARCH_INT_DISABLEALL | N/A | YES | NO
|
||||
----------------------------+--------------+--------------+-------------
|
||||
| | | SVCall
|
||||
| SVCall | SVCall | HIGH
|
||||
Disable here and below --------> MAXNORMAL ---> HIGH --------> MAXNORMAL
|
||||
| | MAXNORMAL |
|
||||
----------------------------+--------------+--------------+-------------
|
||||
|
||||
NOTE: This does not work now because interrupts get disabled in the
|
||||
standard interrupt handling, prohibiting nesting. Fix is simple: Need
|
||||
to used more priority levels so that we can make a cleaner distinction
|
||||
with the standard interrupt handler.
|
||||
|
||||
comment "Boot options"
|
||||
|
||||
choice
|
||||
|
||||
Reference in New Issue
Block a user