Commit 19861374 authored by Josh Kunz's avatar Josh Kunz

Add functions to manipulate cspace "owner" field

cspaces are opaque types to the user, but they provide an unused field
"owner" that can be used to keep reverse references. This commit just
adds functions for manipulating that reference.
parent b2a781f7
......@@ -123,6 +123,14 @@ void cap_delete(struct cspace *cspace, cptr_t c);
* Sets up cspace - initializes lock, root cnode table, etc.
int cap_init_cspace(struct cspace *cspace);
* Set the "owner" field of the given cspace
void cap_cspace_setowner(struct cspace *cspace, void * owner);
* Get the "owner" field of the given cspace
void* cap_cspace_getowner(struct cspace *cspace);
* Inserts object data into cspace at cnode pointed at by c.
......@@ -231,6 +231,11 @@ int cap_init_cspace(struct cspace *cspace)
return 0;
inline void cap_cspace_setowner(struct cspace *cspace, void * owner) {
cspace->owner = owner;
inline void* cap_cspace_getowner(struct cspace *cspace) { return cspace->owner; }
static int update_cnode_table(struct cspace *cspace,
struct cnode_table *old, unsigned long level_id,
bool alloc, struct cnode_table **new)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment