Lines Matching refs:idx
142 static void send_cmd(AppMgrPortStart_t* state, chan_idx_t idx, uint8_t cmd) { in send_cmd() argument
143 assert(idx < CHAN_COUNT); in send_cmd()
148 chan_send_cmd(state->chans[idx], cmd); in send_cmd()
155 chan_idx_t idx) { in establish_unhandled_channel() argument
160 assert(idx < CHAN_COUNT); in establish_unhandled_channel()
172 state->chans[idx] = chan; in establish_unhandled_channel()
178 static void close_channel(AppMgrPortStart_t* state, chan_idx_t idx) { in close_channel() argument
179 assert(idx < CHAN_COUNT); in close_channel()
184 close(state->chans[idx]); in close_channel()
185 state->chans[idx] = INVALID_IPC_HANDLE; in close_channel()
188 static void send_exit(AppMgrPortStart_t* state, chan_idx_t idx) { in send_exit() argument
189 assert(idx < CHAN_COUNT); in send_exit()
194 send_cmd(state, idx, CMD_EXIT); in send_exit()
195 close_channel(state, idx); in send_exit()
198 static void wait_and_exit(AppMgrPortStart_t* state, chan_idx_t idx) { in wait_and_exit() argument
201 assert(idx < CHAN_COUNT); in wait_and_exit()
206 ASSERT_EQ(NO_ERROR, wait(state->chans[idx], &uevt, INFINITE_TIME)); in wait_and_exit()
209 send_exit(state, idx); in wait_and_exit()