1/*
2 * Copyright 2016, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
8 * See "LICENSE_BSD2.txt" for details.
9 *
10 * @TAG(D61_BSD)
11 */
12
13/*! @file
14    @brief Process server fault dispatcher which handles VM faults.
15
16    Handles faults which the kernel sends to the processs server IPC endpoint pretending to be the
17    faulting client, handling internal ram dataspace faults or delegating to the corresponding
18    pager / content initialiser accordingly.
19*/
20
21#ifndef _REFOS_PROCESS_SERVER_DISPATCHER_FAULT_HANDLER_H_
22#define _REFOS_PROCESS_SERVER_DISPATCHER_FAULT_HANDLER_H_
23
24#include "dispatcher.h"
25#include "../state.h"
26
27/*! @brief Check whether the given recieved message is a VM fault message.
28    @param m Struct containing info about the recieved message.
29    @param userptr Output user pointer. Pass this into the generated dispatcher function.
30    @return DISPATCH_SUCCESS if message is a VM fault syscall, DISPATCH_PASS otherwise.
31*/
32int check_dispatch_fault(struct procserv_msg *m, void **userptr);
33
34/*! \brief Dispatcher for client VM faults. */
35int dispatch_vm_fault(struct procserv_msg *m, void **userptr);
36
37#endif /* _REFOS_PROCESS_SERVER_DISPATCHER_FAULT_HANDLER_H_ */
38