Ignore:
File:
1 edited

Legend:

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

    r31e15be r455241b  
    3737
    3838#include <abi/cap.h>
     39#include <adt/hash_table.h>
     40#include <adt/hash.h>
     41#include <adt/list.h>
     42#include <atomic.h>
     43#include <lib/ra.h>
     44#include <lib/refcount.h>
     45#include <synch/mutex.h>
    3946#include <typedefs.h>
    40 #include <adt/list.h>
    41 #include <adt/hash.h>
    42 #include <adt/hash_table.h>
    43 #include <lib/ra.h>
    44 #include <synch/mutex.h>
    45 #include <atomic.h>
    4647
    4748typedef enum {
     
    5960} kobject_type_t;
    6061
    61 struct task;
    62 
    63 struct call;
    64 struct irq;
    65 struct phone;
    66 struct waitq;
     62struct kobject;
    6763
    6864typedef struct kobject_ops {
    69         void (*destroy)(void *);
     65        void (*destroy)(struct kobject *);
    7066} kobject_ops_t;
    7167
     
    7672/*
    7773 * Everything in kobject_t except for the atomic reference count, the capability
    78  * list and its lock is imutable.
     74 * list and its lock is immutable.
    7975 */
    8076typedef struct kobject {
    8177        kobject_type_t type;
    82         atomic_size_t refcnt;
     78        atomic_refcount_t refcnt;
    8379
    8480        /** Mutex protecting caps_list */
     
    8682        /** List of published capabilities associated with the kobject */
    8783        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         };
    9684} kobject_t;
    9785
     
    129117extern errno_t caps_task_alloc(struct task *);
    130118extern void caps_task_free(struct task *);
    131 extern void caps_task_init(struct task *);
     119extern void caps_task_clear(struct task *task);
     120extern errno_t caps_task_init(struct task *);
    132121extern bool caps_apply_to_kobject_type(struct task *, kobject_type_t,
    133122    bool (*)(cap_t *, void *), void *);
     
    139128extern void cap_free(struct task *, cap_handle_t);
    140129
    141 extern kobject_t *kobject_alloc(unsigned int);
    142 extern void kobject_free(kobject_t *);
    143 extern void kobject_initialize(kobject_t *, kobject_type_t, void *);
     130extern void kobject_initialize(kobject_t *, kobject_type_t);
    144131extern kobject_t *kobject_get(struct task *, cap_handle_t, kobject_type_t);
    145132extern void kobject_add_ref(kobject_t *);
Note: See TracChangeset for help on using the changeset viewer.