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 __LIBSEL4_SHARED_TYPES_H 14#define __LIBSEL4_SHARED_TYPES_H 15 16/* this file is shared between the kernel and libsel4 */ 17 18typedef struct seL4_IPCBuffer_ { 19 seL4_MessageInfo_t tag; 20 seL4_Word msg[seL4_MsgMaxLength]; 21 seL4_Word userData; 22 seL4_Word caps_or_badges[seL4_MsgMaxExtraCaps]; 23 seL4_CPtr receiveCNode; 24 seL4_CPtr receiveIndex; 25 seL4_Word receiveDepth; 26} seL4_IPCBuffer __attribute__ ((__aligned__ (sizeof(struct seL4_IPCBuffer_)))); 27 28enum { 29 seL4_CapFault_IP, 30 seL4_CapFault_Addr, 31 seL4_CapFault_InRecvPhase, 32 seL4_CapFault_LookupFailureType, 33 seL4_CapFault_BitsLeft, 34 seL4_CapFault_DepthMismatch_BitsFound, 35 seL4_CapFault_GuardMismatch_GuardFound = seL4_CapFault_DepthMismatch_BitsFound, 36 seL4_CapFault_GuardMismatch_BitsFound, 37 SEL4_FORCE_LONG_ENUM(seL4_CapFault_Msg), 38} seL4_CapFault_Msg; 39 40#define seL4_ReadWrite seL4_CapRights_new(0, 1, 1) 41#define seL4_AllRights seL4_CapRights_new(1, 1, 1) 42#define seL4_CanRead seL4_CapRights_new(0, 1, 0) 43#define seL4_CanWrite seL4_CapRights_new(0, 0, 1) 44#define seL4_CanGrant seL4_CapRights_new(1, 0, 0) 45#define seL4_NoWrite seL4_CapRights_new(1, 1, 0) 46#define seL4_NoRead seL4_CapRights_new(1, 0, 1) 47#define seL4_NoRights seL4_CapRights_new(0, 0, 0) 48 49#endif 50