Lines Matching refs:t

83   static Lock *get_dummy(l4ullulock_t *t)  in get_dummy()  argument
84 { return reinterpret_cast<Lock *>(t->blocklistroot); } in get_dummy()
86 void enqueue(l4ullulock_t *t) in enqueue() argument
88 Lock *r = get_dummy(t); in enqueue()
106 static void shift(l4ullulock_t *t) in shift() argument
107 { t->blocklistroot = (void *)get_dummy(t)->_next; } in shift()
109 static void free_list(l4ullulock_t *t);
111 static Lock *find(l4ullulock_t *t, l4_utcb_t *u);
112 static void wakeup_others(l4ullulock_t *t, l4_utcb_t *u);
123 Lock *Lock::find(l4ullulock_t *t, l4_utcb_t *u) in find() argument
125 Lock *r = get_dummy(t)->_next; in find()
139 void Lock::wakeup_others(l4ullulock_t *t, l4_utcb_t *u) in wakeup_others() argument
141 Lock *r = get_dummy(t)->_next; in wakeup_others()
153 void Lock::free_list(l4ullulock_t *t) in free_list() argument
155 Lock *r = get_dummy(t)->_next; in free_list()
169 static Lock *create_new_thread_lock(l4ullulock_t *t, l4_utcb_t *u) in create_new_thread_lock() argument
173 void *p = t->mem_alloc(sizeof(Lock)); in create_new_thread_lock()
177 Lock *x = new (p) Lock(u, t); in create_new_thread_lock()
179 L4::Cap<L4::Semaphore> c = L4::Cap<L4::Semaphore>(t->cap_alloc()); in create_new_thread_lock()
183 f = L4::Cap<L4::Factory>(t->factory); in create_new_thread_lock()
193 t->cap_free(c.cap()); in create_new_thread_lock()
199 int l4ullulock_init(l4ullulock_t **t, in l4ullulock_init() argument
228 *t = _t; in l4ullulock_init()
232 int l4ullulock_deinit(l4ullulock_t *t) in l4ullulock_deinit() argument
234 Lock::free_list(t); in l4ullulock_deinit()
235 t->mem_free(t); in l4ullulock_deinit()
239 int l4ullulock_lock(l4ullulock_t *t, l4_utcb_t *u) in l4ullulock_lock() argument
241 while (add_atomic(&t->lock, 1) > 0) in l4ullulock_lock()
244 Lock *tl = Lock::find(t, u); in l4ullulock_lock()
247 tl = create_new_thread_lock(t, u); in l4ullulock_lock()
250 add_atomic(&t->lock, -1); in l4ullulock_lock()
254 tl->enqueue(t); in l4ullulock_lock()
256 add_atomic(&t->lock, -1); in l4ullulock_lock()
260 add_atomic(&t->lock, -1); in l4ullulock_lock()
262 add_atomic(&t->block_cnt, 1); in l4ullulock_lock()
268 add_atomic(&t->block_cnt, -1); in l4ullulock_lock()
274 int l4ullulock_unlock(l4ullulock_t *t, l4_utcb_t *u) in l4ullulock_unlock() argument
276 add_atomic(&t->lock, -1); in l4ullulock_unlock()
278 if (t->block_cnt > 0) in l4ullulock_unlock()
280 Lock::shift(t); in l4ullulock_unlock()
281 Lock::wakeup_others(t, u); in l4ullulock_unlock()