1 /*
2  * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
3  *
4  * SPDX-License-Identifier: BSD-2-Clause
5  */
6 
7 #pragma once
8 
9 /* this file is shared between the kernel and libsel4 */
10 
11 typedef struct seL4_IPCBuffer_ {
12     seL4_MessageInfo_t tag;
13     seL4_Word msg[seL4_MsgMaxLength];
14     seL4_Word userData;
15     seL4_Word caps_or_badges[seL4_MsgMaxExtraCaps];
16     seL4_CPtr receiveCNode;
17     seL4_CPtr receiveIndex;
18     seL4_Word receiveDepth;
19 } seL4_IPCBuffer __attribute__((__aligned__(sizeof(struct seL4_IPCBuffer_))));
20 
21 typedef enum {
22     seL4_CapFault_IP,
23     seL4_CapFault_Addr,
24     seL4_CapFault_InRecvPhase,
25     seL4_CapFault_LookupFailureType,
26     seL4_CapFault_BitsLeft,
27     seL4_CapFault_DepthMismatch_BitsFound,
28     seL4_CapFault_GuardMismatch_GuardFound = seL4_CapFault_DepthMismatch_BitsFound,
29     seL4_CapFault_GuardMismatch_BitsFound,
30     SEL4_FORCE_LONG_ENUM(seL4_CapFault_Msg),
31 } seL4_CapFault_Msg;
32 
33 #define seL4_ReadWrite     seL4_CapRights_new(0, 0, 1, 1)
34 #define seL4_AllRights     seL4_CapRights_new(1, 1, 1, 1)
35 #define seL4_CanRead       seL4_CapRights_new(0, 0, 1, 0)
36 #define seL4_CanWrite      seL4_CapRights_new(0, 0, 0, 1)
37 #define seL4_CanGrant      seL4_CapRights_new(0, 1, 0, 0)
38 #define seL4_CanGrantReply seL4_CapRights_new(1, 0, 0, 0)
39 #define seL4_NoWrite       seL4_CapRights_new(1, 1, 1, 0)
40 #define seL4_NoRead        seL4_CapRights_new(1, 1, 0, 1)
41 #define seL4_NoRights      seL4_CapRights_new(0, 0, 0, 0)
42 
43