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 <object/structures.h>
11 
ep_ptr_get_queue(endpoint_t * epptr)12 static inline tcb_queue_t PURE ep_ptr_get_queue(endpoint_t *epptr)
13 {
14     tcb_queue_t queue;
15 
16     queue.head = (tcb_t *)endpoint_ptr_get_epQueue_head(epptr);
17     queue.end = (tcb_t *)endpoint_ptr_get_epQueue_tail(epptr);
18 
19     return queue;
20 }
21 
22 #ifdef CONFIG_KERNEL_MCS
23 void sendIPC(bool_t blocking, bool_t do_call, word_t badge,
24              bool_t canGrant, bool_t canGrantReply, bool_t canDonate, tcb_t *thread,
25              endpoint_t *epptr);
26 void receiveIPC(tcb_t *thread, cap_t cap, bool_t isBlocking, cap_t replyCPtr);
27 void reorderEP(endpoint_t *epptr, tcb_t *thread);
28 #else
29 void sendIPC(bool_t blocking, bool_t do_call, word_t badge,
30              bool_t canGrant, bool_t canGrantReply, tcb_t *thread,
31              endpoint_t *epptr);
32 void receiveIPC(tcb_t *thread, cap_t cap, bool_t isBlocking);
33 #endif
34 void cancelIPC(tcb_t *tptr);
35 void cancelAllIPC(endpoint_t *epptr);
36 void cancelBadgedSends(endpoint_t *epptr, word_t badge);
37 void replyFromKernel_error(tcb_t *thread);
38 void replyFromKernel_success_empty(tcb_t *thread);
39 
40