/trusty/user/app/sample/hwcrypto/ |
D | hwrng_srv.c | 79 static void hwrng_close_chan(struct hwrng_chan_ctx* ctx) { in hwrng_close_chan() argument 80 close(ctx->chan); in hwrng_close_chan() 82 if (list_in_list(&ctx->node)) in hwrng_close_chan() 83 list_delete(&ctx->node); in hwrng_close_chan() 85 free(ctx); in hwrng_close_chan() 93 struct hwrng_chan_ctx* ctx; in hwrng_handle_req_queue() local 100 list_for_every_entry_safe(&hwrng_req_list, ctx, temp, struct hwrng_chan_ctx, in hwrng_handle_req_queue() 102 if (ctx->send_blocked) in hwrng_handle_req_queue() 105 size_t len = ctx->req_size; in hwrng_handle_req_queue() 114 hwrng_close_chan(ctx); in hwrng_handle_req_queue() [all …]
|
D | hwkey_srv.c | 99 static void hwkey_ctx_close(struct hwkey_chan_ctx* ctx) { in hwkey_ctx_close() argument 104 if (entry->owner == ctx) { in hwkey_ctx_close() 108 close(ctx->chan); in hwkey_ctx_close() 109 free(ctx); in hwkey_ctx_close() 115 static int hwkey_send_rsp(struct hwkey_chan_ctx* ctx, in hwkey_send_rsp() argument 120 return tipc_send2(ctx->chan, rsp_hdr, sizeof(*rsp_hdr), rsp_data, in hwkey_send_rsp() 155 static uint32_t insert_handle_node(struct hwkey_chan_ctx* ctx, in insert_handle_node() argument 166 entry->owner = ctx; in insert_handle_node() 174 static uint32_t _handle_slots(struct hwkey_chan_ctx* ctx, in _handle_slots() argument 190 if (memcmp(&ctx->uuid, slots->uuid, sizeof(uuid_t)) == 0) { in _handle_slots() [all …]
|
/trusty/hardware/nxp/app/hwcrypto/ |
D | hwrng_srv.c | 82 static void hwrng_close_chan(struct hwrng_chan_ctx* ctx) { in hwrng_close_chan() argument 83 close(ctx->chan); in hwrng_close_chan() 85 if (list_in_list(&ctx->node)) in hwrng_close_chan() 86 list_delete(&ctx->node); in hwrng_close_chan() 88 free(ctx); in hwrng_close_chan() 95 struct hwrng_chan_ctx* ctx; in hwrng_handle_req_queue() local 102 list_for_every_entry_safe(&hwrng_req_list, ctx, temp, struct hwrng_chan_ctx, in hwrng_handle_req_queue() 104 if (ctx->send_blocked) in hwrng_handle_req_queue() 107 size_t len = ctx->req_size; in hwrng_handle_req_queue() 116 int rc = tipc_send_single_buf(ctx->chan, rng_data, len); in hwrng_handle_req_queue() [all …]
|
D | hwkey_srv.c | 100 static void hwkey_ctx_close(struct hwkey_chan_ctx* ctx) { in hwkey_ctx_close() argument 101 close(ctx->chan); in hwkey_ctx_close() 102 free(ctx); in hwkey_ctx_close() 108 static int hwkey_send_rsp(struct hwkey_chan_ctx* ctx, in hwkey_send_rsp() argument 113 return tipc_send_two_segments(ctx->chan, rsp_msg, sizeof(*rsp_msg), in hwkey_send_rsp() 117 static uint32_t _handle_slots(struct hwkey_chan_ctx* ctx, in _handle_slots() argument 133 if (memcmp(&ctx->uuid, slots->uuid, sizeof(uuid_t)) == 0) { in _handle_slots() 145 static int hwkey_handle_get_keyslot_cmd(struct hwkey_chan_ctx* ctx, in hwkey_handle_get_keyslot_cmd() argument 151 msg->header.status = _handle_slots(ctx, slot_id, key_slots, key_slot_cnt, in hwkey_handle_get_keyslot_cmd() 157 msg->header.status = _handle_slots(ctx, slot_id, test_key_slots, in hwkey_handle_get_keyslot_cmd() [all …]
|
/trusty/kernel/services/hwrng/ |
D | hwrng_service.c | 63 struct hwrng_chan_ctx* ctx; in hwrng_handle_req_queue() local 70 list_for_every_entry_safe(&hwrng_req_list, ctx, temp, in hwrng_handle_req_queue() 72 if (ctx->error || ctx->send_blocked) in hwrng_handle_req_queue() 79 size_t len = MIN(ctx->req_size, MAX_HWRNG_MSG_SIZE); in hwrng_handle_req_queue() 91 rc = ktipc_send(ctx->chan, rng_data + rng_data_avail_pos, len); in hwrng_handle_req_queue() 95 ctx->send_blocked = true; in hwrng_handle_req_queue() 98 ctx->error = rc; in hwrng_handle_req_queue() 105 ctx->req_size -= len; in hwrng_handle_req_queue() 107 if (!ctx->req_size) { in hwrng_handle_req_queue() 109 list_delete(&ctx->node); in hwrng_handle_req_queue() [all …]
|
/trusty/user/app/confirmationui/examples/devices/emulator/ |
D | device_parameters.cpp | 34 context<ConUIParameters> ctx(6.45211, 400.0 / 412.0); in getDisplayContext() local 36 ctx.setParam<RightEdgeOfScreen>(400_px); in getDisplayContext() 37 ctx.setParam<BottomOfScreen>(800_px); in getDisplayContext() 38 ctx.setParam<PowerButtonTop>(20.26_mm); in getDisplayContext() 39 ctx.setParam<PowerButtonBottom>(30.26_mm); in getDisplayContext() 40 ctx.setParam<VolUpButtonTop>(40.26_mm); in getDisplayContext() 41 ctx.setParam<VolUpButtonBottom>(50.26_mm); in getDisplayContext() 44 ctx.setParam<DefaultFontSize>(18_dp); in getDisplayContext() 45 ctx.setParam<BodyFontSize>(20_dp); in getDisplayContext() 47 ctx.setParam<DefaultFontSize>(14_dp); in getDisplayContext() [all …]
|
/trusty/user/app/storage/ |
D | aidl_service.h | 45 #define STORAGE_SERVICE_AIDL_CONTEXT_INITIAL_VALUE(ctx) \ argument 57 int storage_aidl_create_service(struct storage_service_aidl_context* ctx, 66 void storage_aidl_delete_service(struct storage_service_aidl_context* ctx); 77 void storage_aidl_enable_filesystem(struct storage_service_aidl_context* ctx, 90 void storage_aidl_disable_filesystem(struct storage_service_aidl_context* ctx, 97 #define STORAGE_SERVICE_AIDL_CONTEXT_INITIAL_VALUE(ctx) \ 101 struct storage_service_aidl_context* ctx, 103 *ctx = STORAGE_SERVICE_AIDL_CONTEXT_INITIAL_VALUE(*ctx); 108 struct storage_service_aidl_context* ctx) {} 111 struct storage_service_aidl_context* ctx, [all …]
|
D | crypt.c | 31 static void EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX* ctx) { in EVP_CIPHER_CTX_reset() argument 32 EVP_CIPHER_CTX_cleanup(ctx); in EVP_CIPHER_CTX_reset() 33 EVP_CIPHER_CTX_init(ctx); in EVP_CIPHER_CTX_reset() 37 HMAC_CTX* ctx = malloc(sizeof(HMAC_CTX)); in HMAC_CTX_new() local 38 if (ctx) { in HMAC_CTX_new() 39 HMAC_CTX_init(ctx); in HMAC_CTX_new() 41 return ctx; in HMAC_CTX_new() 44 static void HMAC_CTX_reset(HMAC_CTX* ctx) { in HMAC_CTX_reset() argument 45 HMAC_CTX_cleanup(ctx); in HMAC_CTX_reset() 46 HMAC_CTX_init(ctx); in HMAC_CTX_reset() [all …]
|
D | main.c | 37 struct proxy_connect_context ctx = { in main() local 52 int rc = storage_aidl_create_service(&ctx.aidl_ctx, hset); in main() 58 rc = ipc_port_create(hset, &ctx.tipc_ctx, STORAGE_DISK_PROXY_PORT, 1, in main() 72 storage_aidl_delete_service(&ctx.aidl_ctx); in main() 73 ipc_port_destroy(&ctx.tipc_ctx); in main()
|
/trusty/kernel/lib/trusty/ |
D | uctx.c | 140 static int _check_handle_id(struct uctx* ctx, handle_id_t handle_id) { in _check_handle_id() argument 143 DEBUG_ASSERT(ctx); in _check_handle_id() 152 if (unlikely(handle_id < ctx->handle_id_base)) { in _check_handle_id() 157 idx = handle_id - ctx->handle_id_base; in _check_handle_id() 163 if (!bitmap_test(ctx->inuse, idx)) { in _check_handle_id() 169 ASSERT(&ctx->htbl[idx].handle); in _check_handle_id() 174 static struct handle* remove_handle(struct uctx* ctx, int idx) { in remove_handle() argument 179 h = ctx->htbl[idx].handle; in remove_handle() 184 list_for_every_entry_safe(&ctx->htbl[idx].ref_list, ref, tmp, in remove_handle() 193 ctx->htbl[idx].handle = NULL; in remove_handle() [all …]
|
/trusty/user/base/lib/sancov/ |
D | sancov.c | 96 static int init(struct sancov_ctx* ctx, size_t num_counters) { in init() argument 118 rc = cov_shm_mmap(&ctx->mailbox, memref, resp.register_args.mailbox_len); in init() 124 ctx->num_counters = num_counters; in init() 125 ctx->record_len = record_len(num_counters); in init() 126 ctx->coverage_srv = chan; in init() 127 ctx->idx = resp.register_args.idx; in init() 139 static int get_record(struct sancov_ctx* ctx) { in get_record() argument 146 if (cov_shm_is_mapped(&ctx->data)) { in get_record() 147 cov_shm_munmap(&ctx->data); in get_record() 149 ctx->counters = NULL; in get_record() [all …]
|
/trusty/kernel/app/dpctest/ |
D | dpctest.c | 44 struct dpc_test_ctx* ctx = arg; in dpc_test_timer_callback() local 46 ctx->in_atomic_requeue_cnt++; in dpc_test_timer_callback() 47 dpc_enqueue_work(NULL, &ctx->work, false); in dpc_test_timer_callback() 52 struct dpc_test_ctx* ctx = containerof(work, struct dpc_test_ctx, work); in dpc_test_callback() local 54 if (ctx->count > TEST_REQUEUE_CNT / 2) { in dpc_test_callback() 56 ctx->count--; in dpc_test_callback() 57 timer_set_oneshot_ns(&ctx->tmr, 10 * 1000 * 1000, in dpc_test_callback() 58 dpc_test_timer_callback, ctx); in dpc_test_callback() 59 } else if (ctx->count) { in dpc_test_callback() 61 ctx->count--; in dpc_test_callback() [all …]
|
/trusty/user/base/lib/spi/srv/tipc/ |
D | tipc.c | 43 static inline bool shm_is_mapped(struct chan_ctx* ctx) { in shm_is_mapped() argument 44 return ctx->shm.buf && ctx->shm_handle != INVALID_IPC_HANDLE; in shm_is_mapped() 47 static inline void shm_unmap(struct chan_ctx* ctx) { in shm_unmap() argument 48 if (shm_is_mapped(ctx)) { in shm_unmap() 49 munmap(ctx->shm.buf, ctx->shm.capacity); in shm_unmap() 50 mb_destroy(&ctx->shm); in shm_unmap() 51 close(ctx->shm_handle); in shm_unmap() 52 ctx->shm_handle = INVALID_IPC_HANDLE; in shm_unmap() 117 struct chan_ctx* ctx, in handle_msg_shm_map_req() argument 123 shm_unmap(ctx); in handle_msg_shm_map_req() [all …]
|
/trusty/user/base/lib/line-coverage/ |
D | shm.c | 38 static struct cov_ctx ctx; variable 56 if (!cov_shm_is_mapped(&ctx.data)) { in dump_shm() 59 struct control *control = (struct control *)ctx.data.base; in dump_shm() 78 if(ctx.mailbox.base == NULL) { in setup_shm() 81 if(!ctx.skip_mailbox) { in setup_shm() 87 int* app_mailbox = (int*)(ctx.mailbox.base) + ctx.idx; in setup_shm() 94 if (cov_shm_is_mapped(&ctx.data)) { in setup_shm() 102 rc = coverage_aggregator_rpc(ctx.coverage_srv, &cov_req, NULL, &cov_resp, &memref); in setup_shm() 109 if (shm_len < ctx.record_len) { in setup_shm() 111 shm_len, ctx.record_len); in setup_shm() [all …]
|
/trusty/user/app/sample/hwcrypto/keybox/ |
D | srv.c | 49 static void keybox_shutdown(struct keybox_chan_ctx* ctx) { in keybox_shutdown() argument 50 close(ctx->chan); in keybox_shutdown() 51 free(ctx); in keybox_shutdown() 109 static int keybox_handle_msg(struct keybox_chan_ctx* ctx) { in keybox_handle_msg() argument 113 rc = tipc_recv1(ctx->chan, sizeof(req.header), &req, sizeof(req)); in keybox_handle_msg() 122 rc = keybox_handle_unwrap(ctx->chan, &req.cmd_header.unwrap, in keybox_handle_msg() 130 rc = tipc_send1(ctx->chan, &rsp, sizeof(rsp)); in keybox_handle_msg() 141 struct keybox_chan_ctx* ctx = (struct keybox_chan_ctx*)priv; in keybox_chan_handler() local 142 assert(ctx); in keybox_chan_handler() 143 assert(ev->handle == ctx->chan); in keybox_chan_handler() [all …]
|
/trusty/kernel/lib/metrics/ |
D | metrics.c | 89 static struct metrics_ctx ctx; variable 268 if (ctx.chan_state != CHAN_STATE_IDLE) { in on_ta_crash() 271 ctx.event_dropped = true; in on_ta_crash() 275 if (!ctx.chan) { in on_ta_crash() 281 rc = report_crash(ctx.chan, app, reason); in on_ta_crash() 282 ctx.chan_state = CHAN_STATE_WAITING_CRASH_RESP; in on_ta_crash() 285 rc = report_exit(ctx.chan, app, reason); in on_ta_crash() 286 ctx.chan_state = CHAN_STATE_WAITING_EXIT_RESP; in on_ta_crash() 296 handle_close(ctx.chan); in on_ta_crash() 297 ctx.chan = NULL; in on_ta_crash() [all …]
|
/trusty/user/app/confirmationui/src/ |
D | main.cpp | 42 static inline bool is_inited(struct chan_ctx* ctx) { in is_inited() argument 43 return ctx->shm_base; in is_inited() 126 struct chan_ctx* ctx) { in handle_init() argument 130 if (is_inited(ctx)) { in handle_init() 168 ctx->shm_base = shm_base; in handle_init() 169 ctx->shm_len = shm_len; in handle_init() 177 static int handle_msg(handle_t chan, uint32_t req_len, struct chan_ctx* ctx) { in handle_msg() argument 180 uint32_t resp_len = ctx->shm_len; in handle_msg() 184 if (!is_inited(ctx)) { in handle_msg() 189 if (req_len > ctx->shm_len) { in handle_msg() [all …]
|
D | trusty_confirmation_ui.cpp | 36 static void updateColorScheme(Context* ctx, bool inverted) { in updateColorScheme() argument 41 ctx->template setParam<ShieldColor>(kColorShieldInv); in updateColorScheme() 42 ctx->template setParam<ColorText>(kColorBackground); in updateColorScheme() 43 ctx->template setParam<ColorBG>(kColorBackgroundInv); in updateColorScheme() 44 ctx->template setParam<ColorButton>(kColorButtonInv); in updateColorScheme() 45 ctx->template setParam<ColorButtonBG>(kColorEnabled); in updateColorScheme() 46 ctx->template setParam<ColorTextHint>(kColorHintInv); in updateColorScheme() 48 ctx->template setParam<ShieldColor>(kColorShield); in updateColorScheme() 49 ctx->template setParam<ColorText>(kColorEnabled); in updateColorScheme() 50 ctx->template setParam<ColorBG>(kColorBackground); in updateColorScheme() [all …]
|
/trusty/user/base/lib/secure_fb/srv/ |
D | secure_fb_server.c | 75 struct secure_fb_ctx* ctx = malloc(sizeof(*ctx)); in secure_fb_on_connect() local 76 if (ctx == NULL) { in secure_fb_on_connect() 81 ctx->ops = (const struct secure_fb_impl_ops*)port->priv; in secure_fb_on_connect() 82 assert(ctx->ops); in secure_fb_on_connect() 83 ctx->session = ctx->ops->init(); in secure_fb_on_connect() 84 if (ctx->session == NULL) { in secure_fb_on_connect() 86 free(ctx); in secure_fb_on_connect() 90 *ctx_p = ctx; in secure_fb_on_connect() 95 struct secure_fb_ctx* ctx = (struct secure_fb_ctx*)_ctx; in secure_fb_on_channel_cleanup() local 96 if (ctx->session != NULL) { in secure_fb_on_channel_cleanup() [all …]
|
/trusty/kernel/lib/trusty/include/lib/trusty/ |
D | uctx.h | 39 int uctx_create(void* priv, struct uctx** ctx); 40 void uctx_destroy(struct uctx* ctx); 41 void* uctx_get_priv(struct uctx* ctx); 44 int uctx_handle_install(struct uctx* ctx, 47 int uctx_handle_remove(struct uctx* ctx, 50 int uctx_handle_get(struct uctx* ctx,
|
/trusty/user/base/app/line-coverage/ |
D | client.c | 45 struct chan_ctx* ctx) { in handle_send_list() argument 53 struct list_node* cur_node = list_next(coverage_record_list, ctx->last_sent_node); in handle_send_list() 72 ctx->last_sent_node = cur_node; in handle_send_list() 89 struct chan_ctx* ctx) { in handle_open() argument 112 ctx->record = record; in handle_open() 147 struct chan_ctx* ctx = calloc(1, sizeof(*ctx)); in on_connect() local 148 if (!ctx) { in on_connect() 154 ctx->record = NULL; in on_connect() 155 ctx->last_sent_node = &state->coverage_record_list; in on_connect() 156 *ctx_p = ctx; in on_connect() [all …]
|
/trusty/user/base/app/coverage/ |
D | client.c | 43 struct chan_ctx* ctx) { in handle_open() argument 64 ctx->record = record; in handle_open() 99 struct chan_ctx* ctx = malloc(sizeof(*ctx)); in on_connect() local 100 if (!ctx) { in on_connect() 105 ctx->record = NULL; in on_connect() 106 *ctx_p = ctx; in on_connect() 114 struct chan_ctx* ctx = (struct chan_ctx*)_ctx; in on_message() local 125 return handle_open(chan, &req, &state->coverage_record_list, ctx); in on_message() 128 return handle_share_record(chan, &req, ctx->record, memref, in on_message() 138 struct chan_ctx* ctx = (struct chan_ctx*)_ctx; in on_channel_cleanup() local [all …]
|
/trusty/kernel/lib/ktipc/test/srv/ |
D | srv.c | 48 static int queue_buffer(struct chan_ctx* ctx, const uint8_t* buf, size_t len) { in queue_buffer() argument 59 list_add_tail(&ctx->queued_msgs, &qmsg->node); in queue_buffer() 68 struct chan_ctx* ctx = ctx_v; in test_handle_msg() local 83 if (list_is_empty(&ctx->queued_msgs)) { in test_handle_msg() 94 return queue_buffer(ctx, req->payload, len); in test_handle_msg() 127 struct chan_ctx* ctx = calloc(1, sizeof(*ctx)); in test_handle_connect() local 128 if (!ctx) { in test_handle_connect() 133 list_initialize(&ctx->queued_msgs); in test_handle_connect() 134 *ctx_p = ctx; in test_handle_connect() 140 struct chan_ctx* ctx = ctx_v; in test_handle_channel_cleanup() local [all …]
|
/trusty/user/base/lib/tipc/include/lib/tipc/ |
D | tipc_srv.h | 150 int (*on_message)(const struct tipc_port* port, handle_t chan, void* ctx); 154 void* ctx); 156 void (*on_channel_cleanup)(void* ctx); 160 void* ctx);
|
/trusty/user/app/keymaster/ipc/ |
D | keymaster_ipc.cpp | 39 typedef void (*event_handler_proc_t)(const uevent_t* ev, void* ctx); 326 static long keymaster_dispatch_secure(keymaster_chan_ctx* ctx, in keymaster_dispatch_secure() argument 332 !keymaster_check_secure_target_access_policy_provisioning(&ctx->uuid)) { in keymaster_dispatch_secure() 392 static long keymaster_dispatch_non_secure(keymaster_chan_ctx* ctx, in keymaster_dispatch_non_secure() argument 694 keymaster_chan_ctx* ctx = new (std::nothrow) keymaster_chan_ctx; in keymaster_ctx_open() local 695 if (ctx == NULL) { in keymaster_ctx_open() 696 return ctx; in keymaster_ctx_open() 699 ctx->handler.proc = &keymaster_chan_handler; in keymaster_ctx_open() 700 ctx->handler.priv = ctx; in keymaster_ctx_open() 701 ctx->uuid = *uuid; in keymaster_ctx_open() [all …]
|