blob: c36027d8a40c95d36f11d2effcb74138b1019ec7 [file] [log] [blame] [edit]
/*
* Copyright 2019, 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 BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(DATA61_BSD)
*/
#pragma once
#include <sel4vm/guest_vm.h>
#include <sel4vm/guest_memory.h>
/***
* @module guest_memory_helpers.h
* The libsel4vm guest memory helpers interface provides simple utilities for using the guest memory interface.
*/
/***
* @function default_error_fault_callback(vm, vcpu, fault_addr, fault_length, cookie)
* Default fault callback that throws a fault error.
* Useful to avoid having to re-define a fault callback on regions that should be mapped with all rights.
* @param {vm_t *} vm A handle to the VM
* @param {vm_vcpu_t *} vcpu A handle to the fault vcpu
* @param {uintptr_t} fault addr Faulting address
* @param {size_t} fault_length Length of faulted access
* @param {void *} cookie User cookie to pass onto callback
* @return Always returns FAULT_ERROR
*/
memory_fault_result_t default_error_fault_callback(vm_t *vm, vm_vcpu_t *vcpu, uintptr_t fault_addr,
size_t fault_length, void *cookie);