1/*
2 * \brief Client handling internals for the process manager.
3 *
4 * Copyright (c) 2017, ETH Zurich.
5 * All rights reserved.
6 *
7 * This file is distributed under the terms in the attached LICENSE file.
8 * If you do not find this file, copies can be found by writing to:
9 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
10 */
11
12#ifndef PENDING_CLIENTS_H
13#define PENDING_CLIENTS_H
14
15#include <barrelfish/barrelfish.h>
16#include <if/proc_mgmt_defs.h>
17#include <if/spawn_defs.h>
18
19#include "domain.h"
20
21#define HASH_INDEX_BUCKETS 6151
22
23enum ClientType {
24	ClientType_Spawn,
25	ClientType_SpawnWithCaps,
26	ClientType_Span,
27	ClientType_Kill,
28	ClientType_Exit,
29	ClientType_Cleanup
30};
31
32struct pending_spawn {
33    struct domain_cap_node *cap_node;
34
35	struct spawn_binding *b;
36	coreid_t core_id;
37
38	const char *path;
39
40	const char *argvbuf;
41	size_t argvbytes;
42	const char *envbuf;
43	size_t envbytes;
44
45	struct capref inheritcn_cap;
46	struct capref argcn_cap;
47
48	uint8_t flags;
49};
50
51struct pending_span {
52	struct capref domain_cap;
53    struct domain_entry *entry;
54
55	struct spawn_binding *b;
56
57	coreid_t core_id;
58	struct capref vroot;
59	struct capref dispframe;
60};
61
62struct pending_kill_cleanup {
63	struct capref domain_cap;
64    struct domain_entry *entry;
65	struct spawn_binding *b;
66};
67
68struct pending_client {
69	struct proc_mgmt_binding *b;
70	enum ClientType type;
71	void *st;
72};
73
74#endif  // PENDING_CLIENTS_H