seL4/include/api/failures.h
Anna Lyons b827ad37ba SELFOUR-413: refactor libsel4 fault API
This is a *breaking API change*

This commit:

* makes seL4_Fault_tag_t common between the kernel and libsel4
* deprecates the existing functions from sel4/messages.h includes
* introduces a new fault API in sel4/faults.h and
* sel4/sel4_arch/faults.h
* deprecates seL4_GetTag(), as the function did not work without
  the user calling seL4_SetTag() first (seL4_MessageInfo is passed
  in registers and not set in the IPC buffer)
* removes previously deprecated functions (deprecated prior to 3.0.0)
* updates the seL4 manual to reflect the changes
2016-11-25 12:29:07 +11:00

47 lines
1.1 KiB
C

/*
* Copyright 2014, General Dynamics C4 Systems
*
* 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(GD_GPL)
*/
#ifndef __FAILURES_H
#define __FAILURES_H
#include <types.h>
#include <api/errors.h>
/* These datatypes differ markedly from haskell, due to the
* different implementation of the various fault monads */
enum exception {
EXCEPTION_NONE,
EXCEPTION_FAULT,
EXCEPTION_LOOKUP_FAULT,
EXCEPTION_SYSCALL_ERROR,
EXCEPTION_PREEMPTED
};
typedef word_t exception_t;
typedef word_t syscall_error_type_t;
struct syscall_error {
word_t invalidArgumentNumber;
word_t invalidCapNumber;
word_t rangeErrorMin;
word_t rangeErrorMax;
word_t memoryLeft;
bool_t failedLookupWasSource;
syscall_error_type_t type;
};
typedef struct syscall_error syscall_error_t;
extern lookup_fault_t current_lookup_fault;
extern seL4_Fault_t current_fault;
extern syscall_error_t current_syscall_error;
#endif