MCPcopy Create free account
hub / github.com/F-Stack/f-stack / abort_align

Function abort_align

freebsd/arm/arm/trap-v6.c:634–655  ·  view source on GitHub ↗

* abort_align() handles the following data abort: * * FAULT_ALIGN - Alignment fault * * Everything should be aligned in kernel with exception of user to kernel * and vice versa data copying, so if pcb_onfault is not set, it's fatal. * We generate signal in case of abort from user mode. */

Source from the content-addressed store, hash-verified

632 * We generate signal in case of abort from user mode.
633 */
634static int
635abort_align(struct trapframe *tf, u_int idx, u_int fsr, u_int far,
636 u_int prefetch, struct thread *td, struct ksig *ksig)
637{
638 bool usermode;
639
640 usermode = TRAPF_USERMODE(tf);
641 if (!usermode) {
642 if (td->td_intr_nesting_level == 0 && td != NULL &&
643 td->td_pcb->pcb_onfault != NULL) {
644 tf->tf_r0 = EFAULT;
645 tf->tf_pc = (int)td->td_pcb->pcb_onfault;
646 return (0);
647 }
648 abort_fatal(tf, idx, fsr, far, prefetch, td, ksig);
649 }
650 /* Deliver a bus error signal to the process */
651 ksig->code = BUS_ADRALN;
652 ksig->sig = SIGBUS;
653 ksig->addr = far;
654 return (1);
655}
656
657/*
658 * abort_icache() handles the following data abort:

Callers

nothing calls this directly

Calls 1

abort_fatalFunction · 0.85

Tested by

no test coverage detected