Changeset 162ad53 in mainline for kernel/generic/include
- Timestamp:
- 2025-06-27T16:18:16Z (4 weeks ago)
- Parents:
- 5caad1d (diff), 455241b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2025-06-27 16:18:16)
- git-committer:
- GitHub <noreply@…> (2025-06-27 16:18:16)
- Location:
- kernel/generic/include
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/cap/cap.h
r5caad1d r162ad53 37 37 38 38 #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> 39 46 #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>46 47 47 48 typedef enum { … … 59 60 } kobject_type_t; 60 61 61 struct task; 62 63 struct call; 64 struct irq; 65 struct phone; 66 struct waitq; 62 struct kobject; 67 63 68 64 typedef struct kobject_ops { 69 void (*destroy)( void*);65 void (*destroy)(struct kobject *); 70 66 } kobject_ops_t; 71 67 … … 76 72 /* 77 73 * Everything in kobject_t except for the atomic reference count, the capability 78 * list and its lock is im utable.74 * list and its lock is immutable. 79 75 */ 80 76 typedef struct kobject { 81 77 kobject_type_t type; 82 atomic_ size_t refcnt;78 atomic_refcount_t refcnt; 83 79 84 80 /** Mutex protecting caps_list */ … … 86 82 /** List of published capabilities associated with the kobject */ 87 83 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 };96 84 } kobject_t; 97 85 … … 129 117 extern errno_t caps_task_alloc(struct task *); 130 118 extern void caps_task_free(struct task *); 131 extern void caps_task_init(struct task *); 119 extern void caps_task_clear(struct task *task); 120 extern errno_t caps_task_init(struct task *); 132 121 extern bool caps_apply_to_kobject_type(struct task *, kobject_type_t, 133 122 bool (*)(cap_t *, void *), void *); … … 139 128 extern void cap_free(struct task *, cap_handle_t); 140 129 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 *); 130 extern void kobject_initialize(kobject_t *, kobject_type_t); 144 131 extern kobject_t *kobject_get(struct task *, cap_handle_t, kobject_type_t); 145 132 extern void kobject_add_ref(kobject_t *); -
kernel/generic/include/ddi/irq.h
r5caad1d r162ad53 132 132 extern hash_table_t irq_uspace_hash_table; 133 133 134 extern slab_cache_t *irq_cache;135 136 134 extern inr_t last_inr; 137 135 -
kernel/generic/include/ipc/ipc.h
r5caad1d r162ad53 74 74 /** User-defined label */ 75 75 sysarg_t label; 76 kobject_t *kobject;76 kobject_t kobject; 77 77 } phone_t; 78 78 … … 108 108 109 109 typedef struct call { 110 kobject_t *kobject;110 kobject_t kobject; 111 111 112 112 /** … … 169 169 170 170 extern slab_cache_t *phone_cache; 171 extern slab_cache_t *irq_cache; 171 172 172 173 extern answerbox_t *ipc_box_0; 173 174 174 175 extern kobject_ops_t call_kobject_ops; 176 177 static inline phone_t *phone_from_kobject(kobject_t *kobject) 178 { 179 if (kobject) 180 return ((void *) kobject) - offsetof(phone_t, kobject); 181 else 182 return NULL; 183 } 184 185 static inline call_t *call_from_kobject(kobject_t *kobject) 186 { 187 if (kobject) 188 return ((void *) kobject) - offsetof(call_t, kobject); 189 else 190 return NULL; 191 } 175 192 176 193 extern void ipc_init(void); -
kernel/generic/include/ipc/irq.h
r5caad1d r162ad53 50 50 extern kobject_ops_t irq_kobject_ops; 51 51 52 typedef struct { 53 kobject_t kobject; 54 irq_t irq; 55 } irq_kobject_t; 56 57 static inline irq_t *irq_from_kobject(kobject_t *kobject) 58 { 59 if (kobject) { 60 return &((irq_kobject_t *) kobject)->irq; 61 } else { 62 return NULL; 63 } 64 } 65 52 66 extern irq_ownership_t ipc_irq_top_half_claim(irq_t *); 53 67 extern void ipc_irq_top_half_handler(irq_t *); -
kernel/generic/include/synch/syswaitq.h
r5caad1d r162ad53 44 44 extern void sys_waitq_init(void); 45 45 46 extern void sys_waitq_task_cleanup(void);47 48 46 extern sys_errno_t sys_waitq_create(uspace_ptr_cap_waitq_handle_t); 49 47 extern sys_errno_t sys_waitq_sleep(cap_waitq_handle_t, uint32_t, unsigned int);
Note:
See TracChangeset
for help on using the changeset viewer.