1/*
2 * Copyright 2017, 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(DATA61_BSD)
11 */
12
13#ifndef __API_CONSTANTS_H
14#define __API_CONSTANTS_H
15
16#ifdef HAVE_AUTOCONF
17#include <autoconf.h>
18#endif
19
20#define LIBSEL4_BIT(n) (1ul<<(n))
21
22#ifdef CONFIG_HARDWARE_DEBUG_API
23/* API arg values for breakpoint API, "type" arguments. */
24typedef enum {
25    seL4_DataBreakpoint = 0,
26    seL4_InstructionBreakpoint,
27    seL4_SingleStep,
28    seL4_SoftwareBreakRequest,
29    SEL4_FORCE_LONG_ENUM(seL4_BreakpointType)
30} seL4_BreakpointType;
31
32/* API arg values for breakpoint API, "access" arguments. */
33typedef enum {
34    seL4_BreakOnRead = 0,
35    seL4_BreakOnWrite,
36    seL4_BreakOnReadWrite,
37    seL4_MaxBreakpointAccess,
38    SEL4_FORCE_LONG_ENUM(seL4_BreakpointAccess)
39} seL4_BreakpointAccess;
40
41/* Format of a debug-exception message. */
42enum {
43    seL4_DebugException_FaultIP,
44    seL4_DebugException_ExceptionReason,
45    seL4_DebugException_TriggerAddress,
46    seL4_DebugException_BreakpointNumber,
47    seL4_DebugException_Length,
48    SEL4_FORCE_LONG_ENUM(seL4_DebugException_Msg)
49} seL4_DebugException_Msg;
50#endif
51
52enum priorityConstants {
53    seL4_InvalidPrio = -1,
54    seL4_MinPrio = 0,
55    seL4_MaxPrio = CONFIG_NUM_PRIORITIES - 1
56};
57
58/* seL4_MessageInfo_t defined in api/shared_types.bf */
59
60enum seL4_MsgLimits {
61    seL4_MsgLengthBits = 7,
62    seL4_MsgExtraCapBits = 2
63};
64
65enum {
66    seL4_MsgMaxLength = 120,
67};
68#define seL4_MsgMaxExtraCaps (LIBSEL4_BIT(seL4_MsgExtraCapBits)-1)
69
70typedef enum {
71    seL4_NoFailure = 0,
72    seL4_InvalidRoot,
73    seL4_MissingCapability,
74    seL4_DepthMismatch,
75    seL4_GuardMismatch,
76    SEL4_FORCE_LONG_ENUM(seL4_LookupFailureType),
77} seL4_LookupFailureType;
78
79#endif /* __API_CONSTANTS_H */
80