HelenOS sources
This source file includes following definitions.
- istate_decode
- instruction_access_exception
- instruction_access_error
- illegal_instruction
- privileged_opcode
- unimplemented_LDD
- unimplemented_STD
- fp_disabled
- fp_exception_ieee_754
- fp_exception_other
- tag_overflow
- division_by_zero
- data_access_exception
- data_access_error
- mem_address_not_aligned
- LDDF_mem_address_not_aligned
- STDF_mem_address_not_aligned
- privileged_action
- LDQF_mem_address_not_aligned
- STQF_mem_address_not_aligned
#include <arch/trap/exception.h>
#include <arch/mm/tlb.h>
#include <arch/interrupt.h>
#include <interrupt.h>
#include <arch/asm.h>
#include <arch/register.h>
#include <debug.h>
#include <stdio.h>
#include <symtab.h>
void istate_decode(istate_t *istate)
{
const char *tpcs = symtab_fmt_name_lookup(istate->tpc);
const char *tnpcs = symtab_fmt_name_lookup(istate->tnpc);
printf("TSTATE=%#" PRIx64 "\n", istate->tstate);
printf("TPC=%#" PRIx64 " (%s)\n", istate->tpc, tpcs);
printf("TNPC=%#" PRIx64 " (%s)\n", istate->tnpc, tnpcs);
}
void instruction_access_exception(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void instruction_access_error(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void illegal_instruction(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void privileged_opcode(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void unimplemented_LDD(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void unimplemented_STD(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void fp_disabled(unsigned int n, istate_t *istate)
{
fprs_reg_t fprs;
fprs.value = fprs_read();
if (!fprs.fef) {
fprs.fef = true;
fprs_write(fprs.value);
return;
}
#ifdef CONFIG_FPU_LAZY
scheduler_fpu_lazy_request();
#else
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
#endif
}
void fp_exception_ieee_754(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void fp_exception_other(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void tag_overflow(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void division_by_zero(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void data_access_exception(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void data_access_error(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void mem_address_not_aligned(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void LDDF_mem_address_not_aligned(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void STDF_mem_address_not_aligned(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void privileged_action(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void LDQF_mem_address_not_aligned(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
void STQF_mem_address_not_aligned(unsigned int n, istate_t *istate)
{
fault_if_from_uspace(istate, "%s.", __func__);
panic_badtrap(istate, n, "%s.", __func__);
}
HelenOS homepage, sources at GitHub