aarch64: error: Enable recoverable errors

For some kind of faults we want to be able to put in action some
corrective actions and keep executing the code.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
Carlo Caione 2020-11-09 16:03:35 +01:00 committed by Anas Nashif
parent a054e424e4
commit 2683a1ed97
5 changed files with 25 additions and 5 deletions

View file

@ -169,7 +169,18 @@ static void esf_dump(const z_arch_esf_t *esf)
esf->basic.regs[0], esf->basic.regs[1]);
}
void z_arm64_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
static bool is_recoverable(z_arch_esf_t *esf, uint64_t esr, uint64_t far,
uint64_t elr)
{
if (!esf)
return false;
/* Empty */
return false;
}
void z_arm64_fatal_error(unsigned int reason, z_arch_esf_t *esf)
{
uint64_t esr = 0;
uint64_t elr = 0;
@ -201,6 +212,9 @@ void z_arm64_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
if (dump_far)
LOG_ERR("FAR_ELn: 0x%016llx", far);
if (is_recoverable(esf, esr, far, elr))
return;
}
}

View file

@ -18,7 +18,7 @@
#include <sw_isr_table.h>
#include <drivers/interrupt_controller/gic.h>
void z_arm64_fatal_error(unsigned int reason, const z_arch_esf_t *esf);
void z_arm64_fatal_error(unsigned int reason, z_arch_esf_t *esf);
#if !defined(CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER)
/*

View file

@ -144,7 +144,10 @@ exit:
inv:
mov x0, #0 /* K_ERR_CPU_EXCEPTION */
mov x1, sp
b z_arm64_fatal_error
bl z_arm64_fatal_error
/* Return here only in case of recoverable error */
z_arm64_exit_exc x0, x1
GTEXT(z_arm64_call_svc)
SECTION_FUNC(TEXT, z_arm64_call_svc)

View file

@ -136,4 +136,7 @@ SECTION_FUNC(TEXT, z_arm64_serror)
mov x1, sp
mov x0, #0 /* K_ERR_CPU_EXCEPTION */
b z_arm64_fatal_error
bl z_arm64_fatal_error
/* Return here only in case of recoverable error */
z_arm64_exit_exc x0, x1

View file

@ -39,7 +39,7 @@ static inline void arch_switch(void *switch_to, void **switched_from)
return;
}
extern void z_arm64_fatal_error(const z_arch_esf_t *esf, unsigned int reason);
extern void z_arm64_fatal_error(z_arch_esf_t *esf, unsigned int reason);
#endif /* _ASMLANGUAGE */