Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/cap/cap.h

    r455241b r31e15be  
    3737
    3838#include <abi/cap.h>
     39#include <typedefs.h>
     40#include <adt/list.h>
     41#include <adt/hash.h>
    3942#include <adt/hash_table.h>
    40 #include <adt/hash.h>
    41 #include <adt/list.h>
     43#include <lib/ra.h>
     44#include <synch/mutex.h>
    4245#include <atomic.h>
    43 #include <lib/ra.h>
    44 #include <lib/refcount.h>
    45 #include <synch/mutex.h>
    46 #include <typedefs.h>
    4746
    4847typedef enum {
     
    6059} kobject_type_t;
    6160
    62 struct kobject;
     61struct task;
     62
     63struct call;
     64struct irq;
     65struct phone;
     66struct waitq;
    6367
    6468typedef struct kobject_ops {
    65         void (*destroy)(struct kobject *);
     69        void (*destroy)(void *);
    6670} kobject_ops_t;
    6771
     
    7276/*
    7377 * Everything in kobject_t except for the atomic reference count, the capability
    74  * list and its lock is immutable.
     78 * list and its lock is imutable.
    7579 */
    7680typedef struct kobject {
    7781        kobject_type_t type;
    78         atomic_refcount_t refcnt;
     82        atomic_size_t refcnt;
    7983
    8084        /** Mutex protecting caps_list */
     
    8286        /** List of published capabilities associated with the kobject */
    8387        list_t caps_list;
     88
     89        union {
     90                void *raw;
     91                struct call *call;
     92                struct irq *irq;
     93                struct phone *phone;
     94                struct waitq *waitq;
     95        };
    8496} kobject_t;
    8597
     
    117129extern errno_t caps_task_alloc(struct task *);
    118130extern void caps_task_free(struct task *);
    119 extern void caps_task_clear(struct task *task);
    120 extern errno_t caps_task_init(struct task *);
     131extern void caps_task_init(struct task *);
    121132extern bool caps_apply_to_kobject_type(struct task *, kobject_type_t,
    122133    bool (*)(cap_t *, void *), void *);
     
    128139extern void cap_free(struct task *, cap_handle_t);
    129140
    130 extern void kobject_initialize(kobject_t *, kobject_type_t);
     141extern kobject_t *kobject_alloc(unsigned int);
     142extern void kobject_free(kobject_t *);
     143extern void kobject_initialize(kobject_t *, kobject_type_t, void *);
    131144extern kobject_t *kobject_get(struct task *, cap_handle_t, kobject_type_t);
    132145extern void kobject_add_ref(kobject_t *);
Note: See TracChangeset for help on using the changeset viewer.