diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/cortex-m/ec.lds.S | 16 | ||||
-rw-r--r-- | core/cortex-m/irq_handler.h | 31 | ||||
-rw-r--r-- | core/cortex-m/panic.c | 3 |
3 files changed, 31 insertions, 19 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index b6dc1dd7df..b370d1acf0 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -389,6 +389,22 @@ SECTIONS #define INIT_ROM_LMA ORIGIN(ROM_RESIDENT_VMA) #endif + /* + * This SRAM section is not used by common/ or chip/stm32/, but + * available if particular boards want to move the vector table + * into SRAM for performance or mutability. + */ + .vtable : { + /* + * Vector table must be at the base of SRAM. The vector + * table section contains a RAM copy of the vector table used on + * STM chips for relocating the vector table. + */ + . = ALIGN(8); + *(.bss.vector_table) + . = ALIGN(8); + } > IRAM + #ifdef CONFIG_PRESERVE_LOGS .preserve_logs(NOLOAD) : { . = ALIGN(8); diff --git a/core/cortex-m/irq_handler.h b/core/cortex-m/irq_handler.h index eb23de7049..b510064652 100644 --- a/core/cortex-m/irq_handler.h +++ b/core/cortex-m/irq_handler.h @@ -23,20 +23,19 @@ * ensure it is enabled in the interrupt controller with the right priority. */ #define DECLARE_IRQ(irq, routine, priority) DECLARE_IRQ_(irq, routine, priority) -#define DECLARE_IRQ_(irq, routine, priority) \ - void IRQ_HANDLER(irq)(void); \ - typedef struct { \ - int fake[irq >= CONFIG_IRQ_COUNT ? -1 : 1]; \ - } irq_num_check_##irq; \ - static void __keep routine(void); \ - void IRQ_HANDLER(irq)(void) \ - { \ - void *ret = __builtin_return_address(0); \ - TASK_START_IRQ_HANDLER(ret); \ - routine(); \ - task_resched_if_needed(ret); \ - } \ - const struct irq_priority __keep IRQ_PRIORITY(irq) \ - __attribute__((section(".rodata.irqprio"))) = { irq, \ - priority } +#define DECLARE_IRQ_(irq, routine, priority) \ + void IRQ_HANDLER(irq)(void); \ + typedef struct { \ + int fake[irq >= CONFIG_IRQ_COUNT ? -1 : 1]; \ + } irq_num_check_##irq; \ + static void __keep routine(void); \ + void IRQ_HANDLER(irq)(void) \ + { \ + void *ret = __builtin_return_address(0); \ + TASK_START_IRQ_HANDLER(ret); \ + routine(); \ + task_resched_if_needed(ret); \ + } \ + const struct irq_priority __keep IRQ_PRIORITY(irq) __attribute__(( \ + weak, section(".rodata.irqprio"))) = { irq, priority } #endif /* __CROS_EC_IRQ_HANDLER_H */ diff --git a/core/cortex-m/panic.c b/core/cortex-m/panic.c index 7d364ec2a0..eefe068931 100644 --- a/core/cortex-m/panic.c +++ b/core/cortex-m/panic.c @@ -364,9 +364,6 @@ void __keep report_panic(void) if (IS_ENABLED(CONFIG_ARMV7M_CACHE)) cpu_clean_invalidate_dcache(); - if (IS_ENABLED(CONFIG_HOSTCMD_EVENTS)) - host_set_single_event(EC_HOST_EVENT_PANIC); - /* Start safe mode if possible */ if (IS_ENABLED(CONFIG_SYSTEM_SAFE_MODE)) { /* TODO: check for nested exceptions */ |