Lines Matching refs:srv

15 void uservice_lock(uservice_t *srv)  in uservice_lock()  argument
17 aos_assert(srv); in uservice_lock()
18 if (srv->task) in uservice_lock()
19 TASK_LOCK(srv->task); in uservice_lock()
22 void uservice_unlock(uservice_t *srv) in uservice_unlock() argument
24 aos_assert(srv); in uservice_unlock()
25 if (srv->task) in uservice_unlock()
26 TASK_UNLOCK(srv->task); in uservice_unlock()
29 int uservice_call(uservice_t *srv, rpc_t *rpc) in uservice_call() argument
31 aos_assert(srv); in uservice_call()
32 aos_assert(srv->task); in uservice_call()
34 rpc->srv = srv; in uservice_call()
38 aos_assert(aos_task_self() != srv->task->task); in uservice_call()
44 if (aos_queue_send(&srv->task->queue, rpc, sizeof(rpc_t)) == 0) { in uservice_call()
48 …printf("uService %s queue full,send id:%d cur id: %d", srv->name,rpc->cmd_id, srv->task->current_r… in uservice_call()
58 int uservice_call_sync(uservice_t *srv, int cmd, void *param, void *resp, size_t size) in uservice_call_sync() argument
60 aos_assert(srv); in uservice_call_sync()
73 ret = uservice_call(srv, &rpc); in uservice_call_sync()
88 int uservice_call_async(uservice_t *srv, int cmd, void *param, size_t param_size) in uservice_call_async() argument
90 aos_assert(srv); in uservice_call_async()
101 ret = uservice_call(srv, &rpc); in uservice_call_async()
111 uservice_t *srv = aos_zalloc(sizeof(uservice_t)); in uservice_new() local
113 if (srv == NULL) in uservice_new()
116 srv->name = name; in uservice_new()
117 srv->context = context; in uservice_new()
118 srv->process_rpc = process_rpc; in uservice_new()
120 return srv; in uservice_new()
123 void uservice_destroy(uservice_t *srv) in uservice_destroy() argument
125 aos_assert(srv); in uservice_destroy()
127 aos_free(srv); in uservice_destroy()
145 uservice_t *srv = (uservice_t*)context; in uservice_event_process() local
148 aos_assert(srv); in uservice_event_process()
152 uservice_call(srv, &rpc); in uservice_event_process()
157 void uservice_subscribe(uservice_t *srv, uint32_t event_id) in uservice_subscribe() argument
159 aos_assert(srv); in uservice_subscribe()
160 event_subscribe(event_id, uservice_event_process, srv); in uservice_subscribe()