/trusty/user/base/app/crash-test/ |
D | crash-test.c | 34 static int crasher_connect(handle_t* chan) { in crasher_connect() argument 35 return tipc_connect(chan, CRASHER_PORT); in crasher_connect() 38 static int crasher_command(handle_t chan, enum crasher_command cmd) { in crasher_command() argument 45 ret = tipc_send1(chan, &msg, sizeof(msg)); in crasher_command() 49 ret = wait(chan, &evt, INFINITE_TIME); in crasher_command() 62 ret = tipc_recv1(chan, sizeof(msg), &msg, sizeof(msg)); in crasher_command() 76 handle_t chan = INVALID_IPC_HANDLE; in TEST() local 77 ASSERT_EQ(crasher_connect(&chan), 0); in TEST() 78 ASSERT_EQ(crasher_command(chan, CRASHER_NOP), 0); in TEST() 81 close(chan); in TEST() [all …]
|
/trusty/kernel/lib/ktipc/test/main/ |
D | main.c | 37 static void send_cmd(struct handle* chan, in send_cmd() argument 44 int rc = ktipc_send(chan, &req, sizeof(req), buf, len); in send_cmd() 51 static void wait_for_hup(struct handle* chan) { in wait_for_hup() argument 55 rc = handle_wait(chan, &event, TIMEOUT_MSEC); in wait_for_hup() 64 rc = handle_wait(chan, &event, TIMEOUT_MSEC); in wait_for_hup() 79 struct handle* chan = NULL; in TEST() local 83 &chan); in TEST() 86 wait_for_hup(chan); in TEST() 90 if (chan) { in TEST() 91 handle_decref(chan); in TEST() [all …]
|
/trusty/user/base/app/cfi-test/ |
D | cfi-test.c | 31 static int crasher_command(handle_t chan, enum crasher_command cmd) { in crasher_command() argument 37 ret = tipc_send1(chan, &msg, sizeof(msg)); in crasher_command() 54 static int crasher_wait(handle_t chan) { in crasher_wait() argument 57 ret = wait(chan, &evt, INFINITE_TIME); in crasher_wait() 75 ret = tipc_recv1(chan, sizeof(msg), &msg, sizeof(msg)); in crasher_wait() 94 handle_t chan; member 109 _state->chan = INVALID_IPC_HANDLE; in TEST_F_SETUP() 110 ASSERT_EQ(tipc_connect(&_state->chan, CFI_CRASHER_PORT), 0); in TEST_F_SETUP() 116 close(_state->chan); in TEST_F_TEARDOWN() 120 EXPECT_EQ(crasher_command(_state->chan, CRASHER_NOP), 0); in TEST_F() [all …]
|
/trusty/user/base/lib/secure_dpu/ |
D | secure_dpu.c | 40 handle_t* chan; member 56 static int handle_allocate_buffer_resp(handle_t chan, in handle_allocate_buffer_resp() argument 83 rc = wait(chan, &evt, INFINITE_TIME); in handle_allocate_buffer_resp() 90 rc = get_msg(chan, &msg_inf); in handle_allocate_buffer_resp() 100 rc = read_msg(chan, msg_inf.id, 0, &msg); in handle_allocate_buffer_resp() 101 put_msg(chan, msg_inf.id); in handle_allocate_buffer_resp() 133 int secure_dpu_allocate_buffer(handle_t chan, in secure_dpu_allocate_buffer() argument 144 if (chan == INVALID_IPC_HANDLE) { in secure_dpu_allocate_buffer() 152 rc = tipc_send2(chan, &hdr, sizeof(hdr), &args, sizeof(args)); in secure_dpu_allocate_buffer() 158 rc = handle_allocate_buffer_resp(chan, buffer_len, buf_info); in secure_dpu_allocate_buffer() [all …]
|
/trusty/user/base/lib/dlmalloc/test/ |
D | dlmalloc_test.c | 34 static void dlmalloc_srv_rpc_expect(handle_t chan, in dlmalloc_srv_rpc_expect() argument 42 ret = tipc_send1(chan, &msg, sizeof(msg)); in dlmalloc_srv_rpc_expect() 46 ret = wait(chan, &evt, INFINITE_TIME); in dlmalloc_srv_rpc_expect() 57 ret = tipc_recv1(chan, sizeof(msg), &msg, sizeof(msg)); in dlmalloc_srv_rpc_expect() 64 static void dlmalloc_srv_rpc(handle_t chan, enum dlmalloc_test_command cmd) { in dlmalloc_srv_rpc() argument 65 dlmalloc_srv_rpc_expect(chan, cmd, NO_ERROR); in dlmalloc_srv_rpc() 69 handle_t chan; member 73 _state->chan = INVALID_IPC_HANDLE; in TEST_F_SETUP() 74 ASSERT_EQ(tipc_connect(&_state->chan, DLMALLOC_TEST_SRV_PORT), 0); in TEST_F_SETUP() 80 close(_state->chan); in TEST_F_TEARDOWN() [all …]
|
/trusty/user/app/sample/memref-test/ |
D | memref-test.c | 43 static int lender_connect(handle_t* chan) { in lender_connect() argument 44 return tipc_connect(chan, LENDER_PORT); in lender_connect() 47 static int lender_command(handle_t chan, enum lender_command cmd) { in lender_command() argument 51 int rc = tipc_send1(chan, &msg, sizeof(msg)); in lender_command() 60 static int lender_recv_handle(handle_t chan, handle_t* out) { in lender_recv_handle() argument 62 int rc = wait(chan, &evt, INFINITE_TIME); in lender_recv_handle() 75 rc = get_msg(chan, &msg_inf); in lender_recv_handle() 80 rc = read_msg(chan, msg_inf.id, 0, &msg); in lender_recv_handle() 81 put_msg(chan, msg_inf.id); in lender_recv_handle() 85 static int lender_lend_bss(handle_t chan, handle_t* memref) { in lender_lend_bss() argument [all …]
|
/trusty/user/base/lib/scudo/test/ |
D | scudo_test.c | 37 int send_memref_msg(handle_t chan, in send_memref_msg() argument 51 return send_msg(chan, &msg); in send_memref_msg() 60 static int scudo_srv_rpc_memref(handle_t chan, in scudo_srv_rpc_memref() argument 68 ret = send_memref_msg(chan, &msg, sizeof(msg), memref); in scudo_srv_rpc_memref() 73 ret = wait(chan, &evt, INFINITE_TIME); in scudo_srv_rpc_memref() 85 ret = tipc_recv1(chan, sizeof(msg), &msg, sizeof(msg)); in scudo_srv_rpc_memref() 100 static int scudo_srv_rpc(handle_t chan, enum scudo_command cmd) { in scudo_srv_rpc() argument 101 return scudo_srv_rpc_memref(chan, cmd, -1); in scudo_srv_rpc() 105 handle_t chan; member 113 _state->chan = INVALID_IPC_HANDLE; in TEST_F_SETUP() [all …]
|
/trusty/user/base/lib/tipc/ |
D | tipc_srv.c | 86 static void tipc_chan_close(struct chan_ctx* chan) { in tipc_chan_close() argument 88 struct tipc_srv* srv = chan->port->srv; in tipc_chan_close() 89 void* user_ctx = chan->user_ctx; in tipc_chan_close() 92 rc = tipc_hset_remove_entry(srv->hset, chan->handle); in tipc_chan_close() 103 list_delete(&chan->chan_list_node); in tipc_chan_close() 117 close(chan->handle); in tipc_chan_close() 120 free(chan); in tipc_chan_close() 133 struct chan_ctx* chan = chan_ctx; in chan_event_handler_proc() local 134 struct tipc_srv* srv = chan->port->srv; in chan_event_handler_proc() 136 assert(ev->handle == chan->handle); in chan_event_handler_proc() [all …]
|
/trusty/kernel/lib/trusty/ |
D | ipc.c | 68 static void chan_shutdown(struct ipc_chan* chan); 95 struct ipc_chan* chan; in ipc_connection_waiting_for_port() local 98 list_for_every_entry(&waiting_for_port_chan_list, chan, struct ipc_chan, in ipc_connection_waiting_for_port() 100 if (!strncmp(path, chan->path, IPC_PORT_PATH_MAX) && in ipc_connection_waiting_for_port() 101 ipc_port_check_access(flags, chan->uuid) == NO_ERROR) { in ipc_connection_waiting_for_port() 112 struct ipc_chan *chan, *temp; in ipc_remove_connection_waiting_for_port() local 116 list_for_every_entry_safe(&waiting_for_port_chan_list, chan, temp, in ipc_remove_connection_waiting_for_port() 118 if (!strncmp(path, chan->path, IPC_PORT_PATH_MAX) && in ipc_remove_connection_waiting_for_port() 119 ipc_port_check_access(flags, chan->uuid) == NO_ERROR) { in ipc_remove_connection_waiting_for_port() 120 remove_from_waiting_for_port_list_locked(chan, &tmp_chan_ref); in ipc_remove_connection_waiting_for_port() [all …]
|
/trusty/kernel/lib/metrics/ |
D | metrics.c | 84 struct handle* chan; member 92 static int recv_resp(struct handle* chan, uint32_t cmd) { in recv_resp() argument 97 rc = ipc_get_msg(chan, &msg_info); in recv_resp() 113 rc = ipc_read_msg(chan, msg_info.id, 0, &ipc_msg); in recv_resp() 114 ipc_put_msg(chan, msg_info.id); in recv_resp() 139 static int send_req(struct handle* chan, in send_req() argument 142 int rc = ipc_send_msg(chan, ipc_msg); in send_req() 156 static int report_crash(struct handle* chan, in report_crash() argument 187 rc = send_req(chan, &ipc_msg, total_len); in report_crash() 196 static int report_exit(struct handle* chan, in report_exit() argument [all …]
|
/trusty/user/app/sample/hwcrypto/keybox/ |
D | srv.c | 37 handle_t chan; member 50 close(ctx->chan); in keybox_shutdown() 64 static int keybox_handle_unwrap(handle_t chan, in keybox_handle_unwrap() argument 95 return tipc_send2(chan, &rsp, sizeof(rsp), output, in keybox_handle_unwrap() 99 return tipc_send1(chan, &rsp, sizeof(rsp.header)); in keybox_handle_unwrap() 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() 143 assert(ev->handle == ctx->chan); in keybox_chan_handler() 164 handle_t chan; in keybox_port_handler() local [all …]
|
/trusty/user/base/lib/coverage/common/ |
D | ipc.c | 24 int coverage_send(handle_t chan, void* msg, size_t msg_len, handle_t* h) { in coverage_send() argument 37 rc = send_msg(chan, &ipc_msg); in coverage_send() 49 int coverage_recv(handle_t chan, void* msg, size_t msg_len, handle_t* h) { in coverage_recv() argument 53 rc = get_msg(chan, &msg_inf); in coverage_recv() 70 rc = read_msg(chan, msg_inf.id, 0, &ipc_msg); in coverage_recv() 81 put_msg(chan, msg_inf.id); in coverage_recv() 85 int coverage_rpc(handle_t chan, in coverage_rpc() argument 95 rc = coverage_send(chan, req, req_len, req_h); in coverage_rpc() 101 rc = wait(chan, &evt, INFINITE_TIME); in coverage_rpc() 107 rc = coverage_recv(chan, resp, resp_len, resp_h); in coverage_rpc() [all …]
|
/trusty/user/base/experimental/lib/tidl/ |
D | ipc.cpp | 36 int send(handle_t chan, in send() argument 51 return send_msg(chan, &msg); in send() 54 int recv(handle_t chan, in recv() argument 63 rc = get_msg(chan, &msg_inf); in recv() 81 rc = read_msg(chan, msg_inf.id, 0, &msg); in recv() 84 put_msg(chan, msg_inf.id); in recv() 88 int send(handle_t chan, in send() argument 111 return send_msg(chan, &msg); in send() 114 int recv(handle_t chan, in recv() argument 125 rc = get_msg(chan, &msg_inf); in recv() [all …]
|
D | ipc_ql_tipc.cpp | 162 struct trusty_ipc_chan* chan = tidl_get_channel(fd); in tidl_chan_close() local 163 assert(chan); in tidl_chan_close() 165 int rc = trusty_ipc_close(chan); in tidl_chan_close() 178 struct trusty_ipc_chan* chan = tidl_get_channel(INVALID_IPC_HANDLE); in connect() local 179 if (!chan) { in connect() 182 assert(chan->handle == INVALID_IPC_HANDLE); in connect() 185 int rc = trusty_ipc_connect(chan, path, true); in connect() 191 TLOGD("channel (%u)\n", chan->handle); in connect() 192 out_fd.reset(chan->handle); in connect() 202 struct trusty_ipc_chan* chan = tidl_get_channel(fd); in send_iovs() local [all …]
|
/trusty/user/base/lib/hwbcc/client/ |
D | hwbcc.c | 28 static int recv_resp(handle_t chan, in recv_resp() argument 39 int rc = wait(chan, &uevt, INFINITE_TIME); in recv_resp() 45 rc = tipc_recv2(chan, sizeof(resp), &resp, sizeof(resp), buf, buf_size); in recv_resp() 94 static int sign_data(handle_t chan, in sign_data() argument 164 rc = send_msg(chan, &msg); in sign_data() 175 return recv_resp(chan, &req.hdr, cose_sign1, cose_sign1_buf_size, in sign_data() 189 static int get_bcc(handle_t chan, in get_bcc() argument 204 rc = tipc_send1(chan, &hdr, sizeof(hdr)); in get_bcc() 215 return recv_resp(chan, &hdr, bcc, bcc_buf_size, bcc_size); in get_bcc() 231 handle_t chan; in hwbcc_get_protected_data() local [all …]
|
/trusty/kernel/lib/ktipc/include/lib/ktipc/ |
D | ktipc.h | 173 struct handle* chan, 178 struct handle* chan, 182 struct handle* chan, 188 struct handle* chan, 213 #define ktipc_internal_send(chan, arg_handles, arg_num_handles, buf0, sz0, \ argument 240 ipc_send_msg((chan), &msg); \ 258 #define ktipc_send_handles(chan, handles, num_handles, buffers...) \ argument 259 ktipc_internal_send(chan, handles, num_handles, buffers, NULL, 0, NULL, 0, \ 273 #define ktipc_send(chan, buffers...) ktipc_send_handles(chan, NULL, 0, buffers) argument 293 int ktipc_recv_iov(struct handle* chan, [all …]
|
/trusty/hardware/nxp/app/hwcrypto/ |
D | hwrng_srv.c | 41 handle_t chan; member 83 close(ctx->chan); in hwrng_close_chan() 116 int rc = tipc_send_single_buf(ctx->chan, rng_data, len); in hwrng_handle_req_queue() 159 rc = tipc_recv_single_buf(ctx->chan, &req, sizeof(req)); in hwrng_chan_handle_msg() 161 TLOGE("failed (%d) to receive msg for chan %d\n", rc, ctx->chan); in hwrng_chan_handle_msg() 185 assert(ev->handle == ctx->chan); in hwrng_chan_handler() 217 handle_t chan; in hwrng_port_handler() local 225 chan = (handle_t)rc; in hwrng_port_handler() 230 TLOGE("failed to alloc state for chan %d\n", chan); in hwrng_port_handler() 231 close(chan); in hwrng_port_handler() [all …]
|
D | main.c | 81 int tipc_send_single_buf(handle_t chan, const void* buf, size_t len) { in tipc_send_single_buf() argument 91 return send_msg(chan, &msg); in tipc_send_single_buf() 97 int tipc_recv_single_buf(handle_t chan, void* buf, size_t len) { in tipc_recv_single_buf() argument 101 rc = get_msg(chan, &msg_inf); in tipc_recv_single_buf() 117 rc = read_msg(chan, msg_inf.id, 0, &msg); in tipc_recv_single_buf() 120 put_msg(chan, msg_inf.id); in tipc_recv_single_buf() 127 int tipc_send_two_segments(handle_t chan, in tipc_send_two_segments() argument 146 return send_msg(chan, &msg); in tipc_send_two_segments() 152 int tipc_recv_two_segments(handle_t chan, in tipc_recv_two_segments() argument 160 rc = get_msg(chan, &msg_inf); in tipc_recv_two_segments() [all …]
|
/trusty/user/app/sample/hwcrypto/ |
D | hwrng_srv.c | 38 handle_t chan; member 80 close(ctx->chan); in hwrng_close_chan() 119 rc = tipc_send1(ctx->chan, rng_data, len); in hwrng_handle_req_queue() 162 rc = tipc_recv1(ctx->chan, sizeof(req), &req, sizeof(req)); in hwrng_chan_handle_msg() 164 TLOGE("failed (%d) to receive msg for chan %d\n", rc, ctx->chan); in hwrng_chan_handle_msg() 188 assert(ev->handle == ctx->chan); in hwrng_chan_handler() 220 handle_t chan; in hwrng_port_handler() local 228 chan = (handle_t)rc; in hwrng_port_handler() 233 TLOGE("failed to alloc state for chan %d\n", chan); in hwrng_port_handler() 234 close(chan); in hwrng_port_handler() [all …]
|
/trusty/user/base/lib/secure_dpu/include/lib/secure_dpu/ |
D | secure_dpu.h | 41 int add_secure_dpu_service(struct tipc_hset* hset, handle_t* chan); 51 int secure_dpu_allocate_buffer(handle_t chan, 69 int secure_dpu_start_secure_display(handle_t chan); 77 int secure_dpu_stop_secure_display(handle_t chan);
|
/trusty/user/app/sample/app-mgmt-test/client/ |
D | main.c | 108 static void chan_send_cmd(handle_t chan, uint8_t cmd) { in chan_send_cmd() argument 115 ASSERT_EQ(sizeof(cmd), tipc_send1(chan, &cmd, sizeof(cmd))); in chan_send_cmd() 116 ASSERT_EQ(NO_ERROR, wait(chan, &uevt, INFINITE_TIME)); in chan_send_cmd() 118 ASSERT_EQ(sizeof(rsp), tipc_recv1(chan, sizeof(rsp), &rsp, sizeof(rsp))); in chan_send_cmd() 158 handle_t chan = INVALID_IPC_HANDLE; in establish_unhandled_channel() local 167 chan = (handle_t)rc; in establish_unhandled_channel() 170 ASSERT_EQ(ERR_TIMED_OUT, wait(chan, &uevt, EXPECTED_TIMEOUT_MS)); in establish_unhandled_channel() 172 state->chans[idx] = chan; in establish_unhandled_channel() 298 handle_t chan = INVALID_IPC_HANDLE; in load_app() local 303 chan = (handle_t)rc; in load_app() [all …]
|
/trusty/user/base/lib/secure_fb/ |
D | secure_fb.c | 33 handle_t chan; member 45 s->chan = INVALID_IPC_HANDLE; in new_secure_fb_session() 83 rc = tipc_connect(&s->chan, port_name); in new_connected_session() 95 if (s->chan != INVALID_IPC_HANDLE) { in free_connected_session() 96 close(s->chan); in free_connected_session() 101 static int await_resp(handle_t chan, struct ipc_msg* msg) { in await_resp() argument 105 rc = wait(chan, &event, INFINITE_TIME); in await_resp() 112 rc = get_msg(chan, &msg_info); in await_resp() 118 rc = read_msg(chan, msg_info.id, 0, msg); in await_resp() 119 put_msg(chan, msg_info.id); in await_resp() [all …]
|
/trusty/user/base/app/line-coverage/ |
D | client.c | 42 static int handle_send_list(handle_t chan, in handle_send_list() argument 60 rc = coverage_send(chan, &resp, sizeof(resp), NULL); in handle_send_list() 66 rc = wait(chan, &evt, INFINITE_TIME); in handle_send_list() 67 rc = coverage_recv(chan, &req, sizeof(req), &memref); in handle_send_list() 78 rc = coverage_send(chan, &resp, sizeof(resp), NULL); in handle_send_list() 86 static int handle_open(handle_t chan, in handle_open() argument 106 rc = coverage_send(chan, &resp, sizeof(resp), NULL); in handle_open() 116 static int handle_share_record(handle_t chan, in handle_share_record() argument 130 rc = coverage_send(chan, &resp, sizeof(resp), NULL); in handle_share_record() 144 handle_t chan, in on_connect() argument [all …]
|
/trusty/user/app/sample/memref-test/lender/ |
D | lender.c | 89 static int lender_lend(handle_t chan, enum lender_command cmd) { in lender_lend() argument 115 return send_msg(chan, &msg); in lender_lend() 131 static int lender_read_bss(handle_t chan, struct lender_region* region) { in lender_read_bss() argument 136 int rc = tipc_send1(chan, &bss_page[region->offset], region->size); in lender_read_bss() 144 static int lender_write_bss(handle_t chan, in lender_write_bss() argument 153 return tipc_send1(chan, NULL, 0); in lender_write_bss() 157 handle_t chan, in lender_on_message() argument 164 int rc = tipc_recv2(chan, sizeof(msg), &msg, sizeof(msg), data, in lender_on_message() 174 rc = lender_lend(chan, msg.cmd); in lender_on_message() 183 rc = lender_read_bss(chan, &msg.region); in lender_on_message() [all …]
|
/trusty/user/app/gatekeeper/ipc/ |
D | gatekeeper_ipc.cpp | 121 static gatekeeper_error_t send_response(handle_t chan, in send_response() argument 133 long rc = send_msg(chan, &msg); in send_response() 137 TLOGE("failed (%ld) to send_msg for chan (%d)\n", rc, chan); in send_response() 144 static gatekeeper_error_t send_error_response(handle_t chan, in send_error_response() argument 155 gatekeeper_error_t rc = send_response(chan, cmd, out_buf, serialized_size); in send_error_response() 161 static gatekeeper_error_t handle_msg(handle_t chan) { in handle_msg() argument 165 long rc = get_msg(chan, &msg_inf); in handle_msg() 172 chan); in handle_msg() 185 rc = read_msg(chan, msg_inf.id, 0, &msg); in handle_msg() 188 put_msg(chan, msg_inf.id); in handle_msg() [all …]
|