feat(esp_tee): ASM routine fixes and improvements

- Fix incorrect setting in the edge interrupt acknowledgement API
- Avoid executing the service call dispatcher in the U-mode ecall,
  rather execute `mret` to jump it
- Avoid `t1` register corruption when processing `ecall`
- Switch back to the bootloader stack from TEE stack after the
  execution of the entire TEE initialization routine
This commit is contained in:
Laukik Hase
2025-08-26 17:06:17 +05:30
parent 8b812d4192
commit d8edbc8acf
8 changed files with 97 additions and 120 deletions

View File

@@ -12,7 +12,7 @@ extern int _tee_interrupt_handler(void);
/* U-to-M mode switch */
extern uint32_t _u2m_switch(int argc, va_list ap);
/* REE IRAM end */
extern uint32_t _iram_end;
extern uint32_t _iram_text_end;
/* REE IROM end */
extern uint32_t _instruction_reserved_end;
/* REE DROM start */
@@ -31,7 +31,7 @@ esp_tee_config_t esp_tee_app_config __attribute__((section(".esp_tee_app_cfg")))
.ns_int_handler = &_tee_interrupt_handler,
.ns_entry_addr = &_u2m_switch,
.ns_iram_end = &_iram_end,
.ns_iram_end = &_iram_text_end,
.ns_irom_end = &_instruction_reserved_end,
.ns_drom_start = &_rodata_reserved_start,
.ns_drom_end = &_rodata_reserved_end,