Merge branch 'feature/add_noreturn_to_save_iram' into 'master'

Add "noreturn" to save IRAM

See merge request sdk/ESP8266_RTOS_SDK!585
This commit is contained in:
Dong Heng
2018-10-25 18:48:44 +08:00
3 changed files with 9 additions and 8 deletions

View File

@ -131,7 +131,7 @@ static void panic_stack(StackType_t *start_stk, StackType_t *end_stk)
*
* @return none
*/
static void panic_info(void *frame, int wdt)
static __attribute__((noreturn)) void panic_info(void *frame, int wdt)
{
extern int _chip_nmi_cnt;
@ -210,7 +210,7 @@ static void panic_info(void *frame, int wdt)
while (1);
}
void IRAM_ATTR panicHandler(void *frame, int wdt)
void __attribute__((noreturn)) panicHandler(void *frame, int wdt)
{
int cnt = 10;
@ -220,13 +220,10 @@ void IRAM_ATTR panicHandler(void *frame, int wdt)
REG_WRITE(INT_ENA_WDEV, 0);
}
// for panic the function that disable cache
Cache_Read_Enable_New();
panic_info(frame, wdt);
}
void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression)
void __attribute__((noreturn)) _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression)
{
printf("ESP_ERROR_CHECK failed: esp_err_t 0x%x at %p\n", rc, __builtin_return_address(0));
printf("file: \"%s\" line %d\nfunc: %s\nexpression: %s\n", file, line, function, expression);

View File

@ -315,7 +315,7 @@ int xPortInIsrContext(void)
return _xt_isr_status != 0;
}
void __attribute__((weak)) vApplicationStackOverflowHook(xTaskHandle xTask, const char *pcTaskName)
void __attribute__((weak, noreturn)) vApplicationStackOverflowHook(xTaskHandle xTask, const char *pcTaskName)
{
int *p = NULL;

View File

@ -1421,6 +1421,7 @@ nmi_rfi:
#endif
#endif /* NMI */
.global Cache_Read_Enable_New
.global _xt_ext_panic
.type _xt_ext_panic, @function
.align 4
@ -1477,7 +1478,10 @@ _panic_dump_reg:
s32i a0, sp, XT_STK_A0
call0 Cache_Read_Enable_New
//Call panic handler
mov a2, sp
movi a3, 0
call0 panicHandler
movi a0, panicHandler
callx0 a0