2 * \brief Spawnd state internals for the process manager.
4 * Copyright (c) 2017, ETH Zurich.
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, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
12 #include <barrelfish/barrelfish.h>
14 #include "spawnd_state.h"
16 static struct spawnd_state *spawnds[MAX_SPAWNDS];
18 errval_t spawnd_state_alloc(coreid_t core_id, struct spawn_binding *b)
20 spawnds[core_id] = (struct spawnd_state*) malloc(
21 sizeof(struct spawnd_state));
22 if (spawnds[core_id] == NULL) {
23 return LIB_ERR_MALLOC_FAIL;
26 spawnds[core_id]->b = b;
31 void spawnd_state_free(coreid_t core_id)
33 if (spawnds[core_id] != NULL) {
34 free(spawnds[core_id]);
38 inline bool spawnd_state_exists(coreid_t core_id)
40 return spawnds[core_id] != NULL;
43 inline struct spawn_binding *spawnd_state_get_binding(coreid_t core_id)
45 return spawnds[core_id]->b;