seL4/include/object/reply.h
Gerwin Klein 79da079239 Convert license tags to SPDX identifiers
This commit also converts our own copyright headers to directly use
SPDX, but leaves all other copyright header intact, only adding the
SPDX ident. As far as possible this commit also merges multiple
Data61 copyright statements/headers into one for consistency.
2020-03-09 13:21:49 +08:00

35 lines
1.1 KiB
C

/*
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
*
* SPDX-License-Identifier: GPL-2.0-only
*/
#ifndef __OBJECT_REPLY_H
#define __OBJECT_REPLY_H
#include <types.h>
#include <api/failures.h>
#include <object/structures.h>
/* Unlink a reply from its tcb */
static inline void reply_unlink(reply_t *reply)
{
/* check the tcb and reply are linked correctly */
assert(thread_state_get_replyObject(reply->replyTCB->tcbState) == REPLY_REF(reply));
tcb_t *tcb = reply->replyTCB;
thread_state_ptr_set_replyObject(&tcb->tcbState, REPLY_REF(0));
reply->replyTCB = NULL;
setThreadState(tcb, ThreadState_Inactive);
}
/* Push a reply object onto the call stack */
void reply_push(tcb_t *tcb_caller, tcb_t *tcb_callee, reply_t *reply, bool_t canDonate);
/* Pop the head reply from the call stack */
void reply_pop(reply_t *reply);
/* Remove a reply from the call stack - replyTCB must be in ThreadState_BlockedOnReply */
void reply_remove(reply_t *reply);
/* Remove a specific tcb, and the reply it is blocking on, from the call stack */
void reply_remove_tcb(tcb_t *tcb);
#endif /* __OBJECT_REPLY_H */