/* Written by Wolfvak, specially sublicensed under the GPLv2 Read LICENSE for more details */ #include "common.h" #include "fsinit.h" #include "fsutil.h" #include "language.h" #include "qrcodegen.h" #include "power.h" #include "rtc.h" #include "hid.h" #include "ui.h" #include "memmap.h" #include #define PC_DUMPRAD (0x10) #define SP_DUMPLEN (0x80) extern u32 __text_s, __text_e; static bool sp_dumpable(u32 sp, u32 *sp_lower, u32 *sp_upper) { if ((sp >= __STACK_TOP) || (sp < (__STACK_TOP - __STACK_LEN))) return false; *sp_lower = sp; *sp_upper = min(sp + SP_DUMPLEN, __STACK_TOP); return true; } static bool pc_dumpable(u32 pc, u32 *pc_lower, u32 *pc_upper) { u32 code_start = (u32)(&__text_s), code_end = (u32)(&__text_e); if ((pc >= code_end) || (pc < code_start)) return false; *pc_lower = max(pc - PC_DUMPRAD, code_start); *pc_upper = min(pc + PC_DUMPRAD, code_end); return true; } #define XRQ_DUMPDATAFUNC(type, size) \ static unsigned XRQ_DumpData_##type(char *b, u32 s, u32 e) \ { \ char *c = b; \ while(s