1/**
2 * \file
3 * \brief Flounder support code for interconnects with indirect (via monitor)
4 *      cap transfer
5 */
6
7/*
8 * Copyright (c) 2010, ETH Zurich.
9 * All rights reserved.
10 *
11 * This file is distributed under the terms in the attached LICENSE file.
12 * If you do not find this file, copies can be found by writing to:
13 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
14 */
15
16#ifndef __FLOUNDER_SUPPORT_CAPS_H
17#define __FLOUNDER_SUPPORT_CAPS_H
18
19#include <sys/cdefs.h>
20
21__BEGIN_DECLS
22
23/// State for indirect (via monitor) cap tx/rx machinery
24struct flounder_cap_state {
25    bool tx_cap_ack;    ///< Waiting to send a cap ack (for current rx message)
26    bool rx_cap_ack;    ///< Have seen a cap ack (for current tx message)
27    bool monitor_mutex_held; ///< We hold the monitor binding mutex (for current tx message)
28    int tx_capnum;      ///< Number of capabilities transmitted
29    int rx_capnum;      ///< Number of capabilities received
30
31    /// Continuation for cap transmission
32    void (*cap_send_continuation)(void *binding);
33    void *binding;
34};
35
36errval_t flounder_stub_send_cap(struct flounder_cap_state *s,
37                                struct monitor_binding *mb,
38                                uintptr_t monitor_id,
39                                struct capref cap, bool give_away,
40                                void (*cont)(void *st));
41
42__END_DECLS
43
44#endif // __FLOUNDER_SUPPORT_CAPS_H
45