Changeset ed5367b in mainline for uspace/lib
- Timestamp:
- 2019-08-07T10:01:13Z (6 years ago)
- Children:
- a097c50
- Parents:
- 68ae40a
- git-author:
- Michal Koutný <xm.koutny+hos@…> (2015-11-05 01:52:07)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-08-07 10:01:13)
- Location:
- uspace/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/ipc/sysman.h
r68ae40a red5367b 44 44 SYSMAN_BROKER_EXP_ADDED, 45 45 SYSMAN_BROKER_EXP_REMOVED, 46 SYSMAN_CTL_UNIT_HANDLE, 46 47 SYSMAN_CTL_UNIT_START, 48 SYSMAN_CTL_UNIT_STOP, 47 49 SYSMAN_CTL_GET_UNITS, 48 50 SYSMAN_CTL_UNIT_GET_NAME, … … 71 73 STATE_STARTED, 72 74 STATE_STOPPED, 75 STATE_STOPPING, 73 76 STATE_FAILED 74 77 } unit_state_t; -
uspace/lib/sysman/include/sysman/ctl.h
r68ae40a red5367b 33 33 #include <sysman/unit.h> 34 34 35 int sysman_unit_handle(const char *, unit_handle_t *); 36 35 37 int sysman_unit_start(const char *, int); 38 int sysman_unit_stop(unit_handle_t, int); 36 39 37 40 int sysman_get_units(unit_handle_t **, size_t *); -
uspace/lib/sysman/src/ctl.c
r68ae40a red5367b 34 34 #include <sysman/sysman.h> 35 35 36 int sysman_unit_handle(const char *unit_name, unit_handle_t *handle_ptr) 37 { 38 async_exch_t *exch = sysman_exchange_begin(SYSMAN_PORT_CTL); 39 40 ipc_call_t call; 41 aid_t req = async_send_0(exch, SYSMAN_CTL_UNIT_HANDLE, &call); 42 sysarg_t rc = async_data_write_start(exch, unit_name, str_size(unit_name)); 43 sysman_exchange_end(exch); 44 45 if (rc != EOK) { 46 async_forget(req); 47 return rc; 48 } 49 50 async_wait_for(req, &rc); 51 if (rc == EOK) { 52 *handle_ptr = IPC_GET_ARG1(call); 53 } 54 return rc; 55 } 56 36 57 /* 37 58 * TODO … … 41 62 * broker knows when appropriate exposee is created and the request succeeded. 42 63 * Still though, it's necessary to centralize timeout into sysman. 64 * TODO convert to name->handle API 43 65 */ 44 66 int sysman_unit_start(const char *unit_name, int flags) … … 56 78 57 79 async_wait_for(req, &rc); 80 return rc; 81 } 82 83 int sysman_unit_stop(unit_handle_t handle, int flags) 84 { 85 async_exch_t *exch = sysman_exchange_begin(SYSMAN_PORT_CTL); 86 87 int rc = async_req_2_0(exch, SYSMAN_CTL_UNIT_STOP, handle, flags); 88 sysman_exchange_end(exch); 89 58 90 return rc; 59 91 }
Note:
See TracChangeset
for help on using the changeset viewer.