Home
last modified time | relevance | path

Searched refs:ref (Results 1 – 24 of 24) sorted by relevance

/trusty/kernel/lib/trusty/
Dhandle_set.c91 struct handle_ref* ref) { in hset_detach_ref_locked() argument
94 DEBUG_ASSERT(ref->parent == &hset->handle); in hset_detach_ref_locked()
97 handle_del_waiter(ref->handle, &ref->waiter); in hset_detach_ref_locked()
101 if (list_in_list(&ref->ready_node)) in hset_detach_ref_locked()
102 list_delete(&ref->ready_node); in hset_detach_ref_locked()
106 list_delete(&ref->set_node); in hset_detach_ref_locked()
107 ref->parent = NULL; in hset_detach_ref_locked()
142 struct handle_ref* ref = containerof(w, struct handle_ref, waiter); in hset_waiter_notify() local
144 ASSERT(ref->parent); in hset_waiter_notify()
145 spin_lock(&ref->parent->slock); in hset_waiter_notify()
[all …]
Ductx.c176 struct handle_ref* ref; in remove_handle() local
184 list_for_every_entry_safe(&ctx->htbl[idx].ref_list, ref, tmp, in remove_handle()
186 list_delete(&ref->uctx_node); in remove_handle()
187 if (list_in_list(&ref->set_node)) in remove_handle()
188 handle_set_detach_ref(ref); in remove_handle()
189 handle_decref(ref->handle); in remove_handle()
190 free(ref); in remove_handle()
210 struct handle_ref* ref; in _hset_add_handle() local
216 ref = calloc(1, sizeof(*ref)); in _hset_add_handle()
217 if (!ref) in _hset_add_handle()
[all …]
Dtrusty_virtio.c118 struct obj_ref* ref) { in release_bus_ref_locked() argument
120 DEBUG_ASSERT(ref); in release_bus_ref_locked()
121 obj_del_ref(&vb->refobj, ref, signal_client_bus_free); in release_bus_ref_locked()
124 static void release_bus_ref(struct trusty_virtio_bus* vb, struct obj_ref* ref) { in release_bus_ref() argument
125 DEBUG_ASSERT(ref); in release_bus_ref()
130 release_bus_ref_locked(vb, ref); in release_bus_ref()
136 struct obj_ref* ref) { in alloc_new_bus() argument
137 DEBUG_ASSERT(ref); in alloc_new_bus()
153 obj_init(&new_bus->refobj, ref); in alloc_new_bus()
160 struct obj_ref* ref) { in create_new_bus() argument
[all …]
Dtipc_dev_ql.c67 struct handle_ref* ref; member
312 handle_set_detach_ref(ept->ref); in dev_shutdown()
314 free(ept->ref); in dev_shutdown()
315 ept->ref = NULL; in dev_shutdown()
340 struct handle_ref* ref; in dev_connect() local
377 ref = calloc(1, sizeof(*ref)); in dev_connect()
378 if (!ref) { in dev_connect()
384 ref->handle = chan; in dev_connect()
385 ref->emask = ~0U; in dev_connect()
386 ref->cookie = ept_lookup(dev, local); in dev_connect()
[all …]
Dipc.c69 static void chan_add_ref(struct ipc_chan* conn, struct obj_ref* ref);
70 static void chan_del_ref(struct ipc_chan* conn, struct obj_ref* ref);
73 struct obj_ref* ref);
230 struct obj_ref* ref) { in remove_from_waiting_for_port_list_locked() argument
238 chan_add_ref(client, ref); /* add local ref */ in remove_from_waiting_for_port_list_locked()
498 static inline void __chan_destroy_refobj(struct obj* ref) { in __chan_destroy_refobj() argument
499 struct ipc_chan* chan = containerof(ref, struct ipc_chan, refobj); in __chan_destroy_refobj()
517 static inline void chan_add_ref(struct ipc_chan* chan, struct obj_ref* ref) { in chan_add_ref() argument
521 obj_add_ref(&chan->refobj, ref); in chan_add_ref()
525 static inline void chan_del_ref(struct ipc_chan* chan, struct obj_ref* ref) { in chan_del_ref() argument
[all …]
Dhandle.c60 static void __handle_destroy_ref(struct refcount* ref) { in __handle_destroy_ref() argument
61 DEBUG_ASSERT(ref); in __handle_destroy_ref()
63 struct handle* handle = containerof(ref, struct handle, refcnt); in __handle_destroy_ref()
Devent.c273 struct obj_ref* ref) { in event_source_lookup_locked() argument
294 obj_add_ref(&es->refobj, ref); in event_source_lookup_locked()
301 obj_add_ref(&es->refobj, ref); in event_source_lookup_locked()
Dtipc_virtio_dev.c254 struct obj_ref* ref) { in tipc_ext_mem_initialize() argument
259 obj_init(&tem->vmm_obj.obj, ref); in tipc_ext_mem_initialize()
/trusty/kernel/include/shared/lk/
Dreflist.h44 static inline __ALWAYS_INLINE void obj_ref_init(struct obj_ref* ref) { in obj_ref_init() argument
45 *ref = (struct obj_ref)OBJ_REF_INITIAL_VALUE(*ref); in obj_ref_init()
48 static inline __ALWAYS_INLINE bool obj_ref_active(struct obj_ref* ref) { in obj_ref_active() argument
49 return list_in_list(&ref->ref_node); in obj_ref_active()
53 struct obj_ref* ref) { in obj_init() argument
55 list_add_tail(&obj->ref_list, &ref->ref_node); in obj_init()
63 struct obj_ref* ref) { in obj_has_only_ref() argument
65 assert(list_in_list(&ref->ref_node)); in obj_has_only_ref()
69 assert(head == &ref->ref_node); in obj_has_only_ref()
70 return head == &ref->ref_node; in obj_has_only_ref()
[all …]
/trusty/kernel/lib/trusty/include/lib/trusty/
Drefcount.h36 typedef void (*refcount_destroy_func)(struct refcount* ref);
38 static inline __ALWAYS_INLINE void refcount_init(struct refcount* ref) { in refcount_init() argument
41 atomic_and(&ref->cnt, 0); in refcount_init()
42 atomic_add(&ref->cnt, 1); in refcount_init()
45 static inline __ALWAYS_INLINE void refcount_inc(struct refcount* ref) { in refcount_inc() argument
46 if (atomic_add(&ref->cnt, 1) == INT_MAX) { in refcount_inc()
51 static inline __ALWAYS_INLINE void refcount_dec(struct refcount* ref, in refcount_dec() argument
54 if (atomic_add(&ref->cnt, -1) == 1) in refcount_dec()
55 destroy(ref); in refcount_dec()
Dhandle_set.h37 int handle_set_attach(struct handle* h, struct handle_ref* ref);
39 void handle_set_detach_ref(struct handle_ref* ref);
41 void handle_set_update_ref(struct handle_ref* ref,
/trusty/user/base/lib/scudo/test/
Dscudo_test.c184 int ref = -1; in TEST_F() local
188 ref = memref_create( in TEST_F()
191 ASSERT_GT(ref, 0); in TEST_F()
192 printf("created memref %d for %p\n", ref, mem); in TEST_F()
193 int rc = scudo_srv_rpc_memref(_state->chan, SCUDO_TAGGED_MEMREF_SMALL, ref); in TEST_F()
197 close(ref); in TEST_F()
206 int ref = -1; in TEST_F() local
210 ref = memref_create( in TEST_F()
213 ASSERT_GT(ref, 0); in TEST_F()
214 printf("created memref %d for %p\n", ref, mem); in TEST_F()
[all …]
/trusty/user/app/storage/
Dblock_cache.h62 struct obj_ref* ref);
66 struct obj_ref* ref);
71 struct obj_ref* ref);
76 struct obj_ref* ref);
101 struct obj_ref* ref);
107 struct obj_ref* ref);
112 struct obj_ref* ref);
116 struct obj_ref* ref,
130 void block_put(const void* data, struct obj_ref* ref);
Dfile.h74 struct obj_ref* ref);
79 struct obj_ref* ref);
89 struct obj_ref* ref);
Dblock_cache.c823 struct obj_ref* ref, in block_cache_get() argument
858 obj_add_ref_allow_unreferenced_obj(&entry->obj, ref); in block_cache_get()
887 struct obj_ref* ref, in block_cache_get_data() argument
890 entry = block_cache_get(fs, dev, block, load, mac, mac_size, ref, in block_cache_get_data()
952 struct obj_ref ref; in block_cache_init() local
972 obj_init(&block_cache_entries[i].obj, &ref); in block_cache_init()
975 obj_del_ref(&block_cache_entries[i].obj, &ref, in block_cache_init()
1139 struct obj_ref* ref) { in block_get_no_read() argument
1143 return block_cache_get_data(tr->fs, tr->fs->dev, block, false, NULL, 0, ref, in block_get_no_read()
1157 struct obj_ref* ref) { in block_get_super() argument
[all …]
Dfile.c376 struct obj_ref* ref) { in file_get_block_etc() argument
401 data = block_get(tr, &block_mac, NULL, ref); /* TODO: pass iv? */ in file_get_block_etc()
404 ref); in file_get_block_etc()
427 data = block_get_cleared(tr, new_block, false, ref); in file_get_block_etc()
430 data = block_get_no_read(tr, new_block, ref); in file_get_block_etc()
456 block_put_dirty_discard((void*)data, ref); in file_get_block_etc()
458 block_put(data, ref); in file_get_block_etc()
476 struct obj_ref* ref) { in file_get_block() argument
477 return file_get_block_etc(tr, file, file_block, true, false, ref); in file_get_block()
494 struct obj_ref* ref) { in file_get_block_write() argument
[all …]
Dblock_tree.c881 struct obj_ref ref = OBJ_REF_INITIAL_VALUE(ref); in block_tree_check_sub_tree() local
895 node_ro = block_get_no_tr_fail(tr, block_mac, NULL, &ref); in block_tree_check_sub_tree()
972 block_put(node_ro, &ref); in block_tree_check_sub_tree()
976 node_ro = block_get_no_tr_fail(tr, block_mac, NULL, &ref); in block_tree_check_sub_tree()
1008 block_put(node_ro, &ref); in block_tree_check_sub_tree()
1012 node_ro = block_get_no_tr_fail(tr, block_mac, NULL, &ref); in block_tree_check_sub_tree()
1045 block_put(node_ro, &ref); in block_tree_check_sub_tree()
1050 block_put(node_ro, &ref); in block_tree_check_sub_tree()
1293 struct obj_ref ref[2] = { in block_tree_walk() local
1294 OBJ_REF_INITIAL_VALUE(ref[0]), in block_tree_walk()
[all …]
Dclient.c420 struct obj_ref ref = OBJ_REF_INITIAL_VALUE(ref); in storage_file_check_name() local
422 file_info = file_get_info(tr, &file->block_mac, &ref); in storage_file_check_name()
430 file_info_put(file_info, &ref); in storage_file_check_name()
906 struct obj_ref ref = OBJ_REF_INITIAL_VALUE(ref); in storage_file_list_iter() local
908 file_info = file_get_info(tr, block_mac, &ref); in storage_file_list_iter()
923 file_info_put(file_info, &ref); in storage_file_list_iter()
/trusty/kernel/app/uirqtest/
Duevt_test.c216 struct handle_ref ref; in TEST_F() local
279 rc = handle_set_wait(_state->hset, &ref, in TEST_F()
283 if (ref.handle) { in TEST_F()
285 handle_decref(ref.handle); in TEST_F()
288 if (ref.handle == _state->hevt1) { in TEST_F()
292 } else if (ref.handle == _state->hevts) { in TEST_F()
306 struct handle_ref ref; in TEST_F() local
361 rc = handle_set_wait(_state->hset, &ref, in TEST_F()
365 if (ref.handle) { in TEST_F()
367 handle_decref(ref.handle); in TEST_F()
[all …]
/trusty/user/app/storage/test/block_host_test/
Dblock_test.c1075 struct obj_ref ref = OBJ_REF_INITIAL_VALUE(ref); in file_allocate_all_test() local
1096 file_get_block_write(&tr[i], &file[i], j, true, &ref); in file_allocate_all_test()
1102 file_block_put_dirty(&tr[i], &file[i], j, block_data_rw, &ref); in file_allocate_all_test()
1174 struct obj_ref ref = OBJ_REF_INITIAL_VALUE(ref); in file_test_open() local
1180 block_data_rw = file_get_block_write(tr, file, i, true, &ref); in file_test_open()
1195 &ref); in file_test_open()
1209 block_data_ro = file_get_block(tr, file, i, &ref); in file_test_open()
1222 file_block_put((void*)block_data_ro - sizeof(struct iv), &ref); in file_test_open()
1231 block_data_ro = file_get_block(tr, file, i, &ref); in file_test_open()
1233 file_block_put(block_data_ro, &ref); in file_test_open()
[all …]
/trusty/user/app/storage/test/storage_host_test/
Dstorage_host_test.c96 struct obj_ref ref = OBJ_REF_INITIAL_VALUE(ref); in file_test_open() local
102 block_data_rw = file_get_block_write(tr, file, i, true, &ref); in file_test_open()
120 &ref); in file_test_open()
134 block_data_ro = file_get_block(tr, file, i, &ref); in file_test_open()
147 file_block_put((void*)block_data_ro - sizeof(struct iv), &ref); in file_test_open()
156 block_data_ro = file_get_block(tr, file, i, &ref); in file_test_open()
158 file_block_put(block_data_ro, &ref); in file_test_open()
/trusty/kernel/lib/extmem/
Dexternal_memory.c49 struct obj_ref* ref, in ext_mem_obj_initialize() argument
61 obj_init(&obj->vmm_obj.obj, ref); in ext_mem_obj_initialize()
/trusty/kernel/lib/extmem/include/lib/extmem/
Dextmem.h116 struct obj_ref* ref,
/trusty/user/base/sdk/
DREADME.md7 …API reference is available on [our website](https://source.android.com/security/trusty/trusty-ref).