kernel: rebuild object ref-counting using atomic types
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef KERNEL_OBJECT_H_
|
||||
#define KERNEL_OBJECT_H_
|
||||
|
||||
#include <kernel/atomic.h>
|
||||
#include <kernel/flags.h>
|
||||
#include <kernel/locks.h>
|
||||
#include <kernel/vm.h>
|
||||
@@ -79,10 +80,7 @@ enum object_type_flags {
|
||||
};
|
||||
|
||||
struct object_ops {
|
||||
kern_status_t (*destroy)(struct object *obj, struct queue *q);
|
||||
kern_status_t (*destroy_recurse)(
|
||||
struct queue_entry *entry,
|
||||
struct object **out);
|
||||
kern_status_t (*destroy)(struct object *obj);
|
||||
};
|
||||
|
||||
struct object_type {
|
||||
@@ -101,8 +99,7 @@ struct object {
|
||||
struct object_type *ob_type;
|
||||
spin_lock_t ob_lock;
|
||||
uint32_t ob_signals;
|
||||
unsigned int ob_refcount;
|
||||
unsigned int ob_handles;
|
||||
atomic_t ob_refcount;
|
||||
struct queue_entry ob_list;
|
||||
struct waitqueue ob_wq;
|
||||
} __aligned(sizeof(long));
|
||||
@@ -114,8 +111,6 @@ extern kern_status_t object_type_unregister(struct object_type *p);
|
||||
extern struct object *object_create(struct object_type *type);
|
||||
extern struct object *object_ref(struct object *obj);
|
||||
extern void object_unref(struct object *obj);
|
||||
extern void object_add_handle(struct object *obj);
|
||||
extern void object_remove_handle(struct object *obj);
|
||||
extern void object_lock(struct object *obj);
|
||||
extern void object_unlock(struct object *obj);
|
||||
extern void object_lock_irqsave(struct object *obj, unsigned long *flags);
|
||||
|
||||
Reference in New Issue
Block a user