/* * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */#pragmaonce#include<stdint.h>#include<stdbool.h>#include"esp_macros.h"#include"soc/soc_caps.h"#include"sdkconfig.h"5 includes#ifdef__cplusplusextern"C"{#endifexternboolg_panic_abort;externchar*g_panic_abort_details;externvoid*g_exc_frames[SOC_CPU_CORES_NUM];// Function to print longer amounts of information such as the details// and backtrace field of panic_info_t. These functions should limit themselves// to printing to the console and should do other more involved processing,// and must be aware that the main logic in panic.c has a watchdog timer active.typedefvoid(*panic_info_dump_fn_t)(constvoid*frame);// Non architecture specific exceptions (generally valid for all targets).// Can be used to convey to the main logic what exception is being// dealt with to perform some actions, without knowing the underlying// architecture/chip-specific exception.typedefenum{PANIC_EXCEPTION_DEBUG,PANIC_EXCEPTION_IWDT,PANIC_EXCEPTION_TWDT,PANIC_EXCEPTION_ABORT,PANIC_EXCEPTION_FAULT,// catch-all for all types of faults}{ ... }panic_exception_t;typedefstruct{intcore;// core which triggered panicpanic_exception_texception;// non-architecture-specific exception codeconstchar*reason;// exception stringconstchar*description;// short description of the exceptionpanic_info_dump_fn_tdetails;// more details on the exceptionpanic_info_dump_fn_tstate;// processor state, usually the contents of the registersconstvoid*addr;// instruction address that triggered the exceptionconstvoid*frame;// reference to the frameboolpseudo_excause;// flag indicating that exception cause has special meaning}{ ... }panic_info_t;#definePANIC_INFO_DUMP(info,dump_fn){if((info)->dump_fn)(*(info)->dump_fn)((info->frame));}// Create own print functions, since printf might be broken, and can be silenced// when CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT#if!CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOTvoidpanic_print_char(charc);voidpanic_print_str(constchar*str);voidpanic_print_dec(intd);voidpanic_print_hex(inth);/* ... */#else#definepanic_print_char(c)ESP_UNUSED(c)#definepanic_print_str(str)ESP_UNUSED(str)#definepanic_print_dec(d)ESP_UNUSED(d)#definepanic_print_hex(h)ESP_UNUSED(h)/* ... */#endifvoid__attribute__((__noreturn__))panic_abort(constchar*details);voidpanic_arch_fill_info(void*frame,panic_info_t*info);voidpanic_soc_fill_info(void*frame,panic_info_t*info);boolpanic_soc_check_pseudo_cause(void*f,panic_info_t*info);voidpanic_print_registers(constvoid*frame,intcore);voidpanic_print_backtrace(constvoid*frame,intcore);uint32_tpanic_get_address(constvoid*frame);voidpanic_set_address(void*frame,uint32_taddr);uint32_tpanic_get_cause(constvoid*frame);voidpanic_prepare_frame_from_ctx(void*frame);#ifdef__cplusplus}{...}#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.