vdso
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <zinnia/rights.h>
|
||||
#include <zinnia/status.h>
|
||||
#include <kernel/alloc.h>
|
||||
#include <kernel/mutex.h>
|
||||
#include <kernel/namespace.h>
|
||||
#include <stdatomic.h>
|
||||
|
||||
@@ -26,6 +27,7 @@ zn_status_t namespace_add_desc(struct namespace* namespace, struct namespace_des
|
||||
return ZN_ERR_INTERNAL;
|
||||
|
||||
// Skip over handles that are already in use (e.g. hard-coded handles).
|
||||
// mutex_lock(&namespace->mutex);
|
||||
zn_handle_t handle;
|
||||
do {
|
||||
handle = atomic_fetch_add_explicit(&namespace->next_handle, 1, memory_order_acq_rel);
|
||||
@@ -35,6 +37,8 @@ zn_status_t namespace_add_desc(struct namespace* namespace, struct namespace_des
|
||||
|
||||
zn_status_t status =
|
||||
hashmap_insert(&namespace->descriptors, handle, desc, hashmap_hash_default, hashmap_eq_default);
|
||||
// mutex_unlock(&namespace->mutex);
|
||||
|
||||
if (status != ZN_OK)
|
||||
return status;
|
||||
|
||||
@@ -45,6 +49,8 @@ zn_status_t namespace_add_desc(struct namespace* namespace, struct namespace_des
|
||||
zn_status_t namespace_add_desc_at(struct namespace* namespace, struct namespace_desc desc, zn_handle_t handle) {
|
||||
if (!namespace)
|
||||
return ZN_ERR_INTERNAL;
|
||||
|
||||
// Skip Invalid or reserved handles.
|
||||
if (handle <= ZN_HANDLE_INVALID)
|
||||
return ZN_ERR_BAD_HANDLE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user