/* * Copyright 2018, Data61 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) * ABN 41 687 119 230. * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(DATA61_GPL) */ /* * * Copyright 2016, 2017 Hesham Almatary, Data61/CSIRO * Copyright 2015, 2016 Hesham Almatary */ #include #include #include #include #include #include #include #include #include #include bool_t Arch_handleFaultReply(tcb_t *receiver, tcb_t *sender, word_t faultType) { switch (faultType) { case seL4_Fault_VMFault: return true; default: fail("Invalid fault"); } } word_t Arch_setMRs_fault(tcb_t *sender, tcb_t* receiver, word_t *receiveIPCBuffer, word_t faultType) { switch (faultType) { case seL4_Fault_VMFault: { setMR(receiver, receiveIPCBuffer, seL4_VMFault_IP, getRestartPC(sender)); setMR(receiver, receiveIPCBuffer, seL4_VMFault_PrefetchFault, seL4_Fault_VMFault_get_instructionFault(sender->tcbFault)); setMR(receiver, receiveIPCBuffer, seL4_VMFault_Addr, seL4_Fault_VMFault_get_address(sender->tcbFault)); return setMR(receiver, receiveIPCBuffer, seL4_VMFault_FSR, seL4_Fault_VMFault_get_FSR(sender->tcbFault)); } default: fail("Invalid fault"); } }