2017-10-27 21:43:34 +08:00
|
|
|
zephyr_cc_option(-mlongcalls)
|
|
|
|
zephyr_sources(
|
|
|
|
cpu_idle.c
|
|
|
|
fatal.c
|
2017-11-30 05:01:18 +08:00
|
|
|
window_vectors.S
|
xtensa: New asm layer to support SMP
SMP needs a new context switch primitive (to disentangle _swap() from
the scheduler) and new interrupt entry behavior (to be able to take a
global spinlock on behalf of legacy drivers). The existing code is
very obtuse, and working with it led me down a long path of "this
would be so much better if..." So this is a new context and entry
framework, intended to replace the code that exists now, at least on
SMP platforms.
New features:
* The new context switch primitive is xtensa_switch(), which takes a
"new" context handle as an argument instead of getting it from the
scheduler, returns an "old" context handle through a pointer
(e.g. to save it to the old thread context), and restores the lock
state(PS register) exactly as it is at entry instead of taking it as
an argument.
* The register spill code understands wrap-around register windows and
can avoid spilling A4-A15 registers when they are unused by the
interrupted function, saving as much as 48 bytes of stack space on
the interrupted stacks.
* The "spill register windows" routine is entirely different, using a
different mechanism, and is MUCH FASTER (to the tune of almost 200
cycles). See notes in comments.
* Even better, interrupt entry can be done via a clever "cross stack
call" I worked up, meaning that the interrupted thread's registers
do not need to be spilled at all until they are naturally pushed out
by the interrupt handler or until we return from the interrupt into
a different thread. This is a big efficiency win for tiny
interrupts (e.g. timers), and a big latency win for all interrupts.
* Interrupt entry is 100% symmetric with respect to medium/high
interrupts, avoiding the problems seen with hooking high priority
interrupts with the current code (e.g. ESP-32's watchdog driver).
* Much smaller code size. No cut and paste assembly. No use of HAL
calls.
* Assumes "XEA2" interrupt architecture, the register window extension
(i.e. no CALL0 ABI), and the "high priority interrupts" extension.
Does not support the legacy processor variants for which we have no
targets. The old code has some stuff in there to support this, but
it seems bitrotten, untestable, and I'm all but certain it doesn't
work.
Note that this simply adds the primitives to the existing tree in a
form where they can be unit tested. It does not replace the existing
interrupt/exception handling or _Swap() implementation.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-12-08 07:01:33 +08:00
|
|
|
xtensa-asm2-util.S
|
|
|
|
xtensa-asm2.c
|
2017-10-27 21:43:34 +08:00
|
|
|
)
|
|
|
|
|
2017-12-11 04:43:12 +08:00
|
|
|
zephyr_sources_ifndef(CONFIG_XTENSA_ASM2
|
|
|
|
xtensa_intr.c
|
|
|
|
irq_manage.c
|
|
|
|
swap.S
|
|
|
|
thread.c
|
|
|
|
xtensa_context.S
|
|
|
|
xtensa_intr_asm.S
|
|
|
|
xtensa_vectors.S
|
|
|
|
xt_zephyr.S
|
|
|
|
)
|
|
|
|
|
2017-10-27 21:43:34 +08:00
|
|
|
zephyr_sources_ifndef(CONFIG_ATOMIC_OPERATIONS_C atomic.S)
|
|
|
|
zephyr_sources_ifdef(CONFIG_XTENSA_USE_CORE_CRT1
|
|
|
|
crt1.S
|
|
|
|
)
|
|
|
|
zephyr_sources_ifdef(CONFIG_IRQ_OFFLOAD
|
|
|
|
irq_offload.c
|
|
|
|
)
|
|
|
|
add_subdirectory(startup)
|