1/* 2 * Copyright 2014, General Dynamics C4 Systems 3 * 4 * SPDX-License-Identifier: GPL-2.0-only 5 */ 6 7#pragma once 8 9#include <types.h> 10#include <api/failures.h> 11#include <object/structures.h> 12 13struct slot_range { 14 cte_t *cnode; 15 word_t offset; 16 word_t length; 17}; 18typedef struct slot_range slot_range_t; 19 20exception_t decodeCNodeInvocation(word_t invLabel, word_t length, 21 cap_t cap, extra_caps_t excaps, 22 word_t *buffer); 23exception_t invokeCNodeRevoke(cte_t *destSlot); 24exception_t invokeCNodeDelete(cte_t *destSlot); 25exception_t invokeCNodeCancelBadgedSends(cap_t cap); 26exception_t invokeCNodeInsert(cap_t cap, cte_t *srcSlot, cte_t *destSlot); 27exception_t invokeCNodeMove(cap_t cap, cte_t *srcSlot, cte_t *destSlot); 28exception_t invokeCNodeRotate(cap_t cap1, cap_t cap2, cte_t *slot1, 29 cte_t *slot2, cte_t *slot3); 30void cteInsert(cap_t newCap, cte_t *srcSlot, cte_t *destSlot); 31void cteMove(cap_t newCap, cte_t *srcSlot, cte_t *destSlot); 32void capSwapForDelete(cte_t *slot1, cte_t *slot2); 33void cteSwap(cap_t cap1, cte_t *slot1, cap_t cap2, cte_t *slot2); 34exception_t cteRevoke(cte_t *slot); 35exception_t cteDelete(cte_t *slot, bool_t exposed); 36void cteDeleteOne(cte_t *slot); 37void insertNewCap(cte_t *parent, cte_t *slot, cap_t cap); 38bool_t PURE isMDBParentOf(cte_t *cte_a, cte_t *cte_b); 39exception_t ensureNoChildren(cte_t *slot); 40exception_t ensureEmptySlot(cte_t *slot); 41bool_t PURE isFinalCapability(cte_t *cte); 42bool_t PURE slotCapLongRunningDelete(cte_t *slot); 43cte_t *getReceiveSlots(tcb_t *thread, word_t *buffer); 44cap_transfer_t PURE loadCapTransfer(word_t *buffer); 45 46#ifndef CONFIG_KERNEL_MCS 47exception_t invokeCNodeSaveCaller(cte_t *destSlot); 48void setupReplyMaster(tcb_t *thread); 49#endif 50 51