Changes in uspace/lib/c/generic/io/visualizer.c [1c5c96d:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/visualizer.c
r1c5c96d rb7fd2a0 39 39 #include <io/visualizer.h> 40 40 41 int visualizer_claim(async_sess_t *sess, sysarg_t notif_callback_id)42 { 43 async_exch_t *exch = async_exchange_begin(sess); 44 int ret = async_req_1_0(exch, VISUALIZER_CLAIM, notif_callback_id);45 async_exchange_end(exch); 46 47 return ret; 48 } 49 50 int visualizer_yield(async_sess_t *sess)51 { 52 async_exch_t *exch = async_exchange_begin(sess); 53 int ret = async_req_0_0(exch, VISUALIZER_YIELD);54 async_exchange_end(exch); 55 56 return ret; 57 } 58 59 int visualizer_enumerate_modes(async_sess_t *sess, vslmode_t *mode, sysarg_t nth)41 errno_t visualizer_claim(async_sess_t *sess, sysarg_t notif_callback_id) 42 { 43 async_exch_t *exch = async_exchange_begin(sess); 44 errno_t ret = async_req_1_0(exch, VISUALIZER_CLAIM, notif_callback_id); 45 async_exchange_end(exch); 46 47 return ret; 48 } 49 50 errno_t visualizer_yield(async_sess_t *sess) 51 { 52 async_exch_t *exch = async_exchange_begin(sess); 53 errno_t ret = async_req_0_0(exch, VISUALIZER_YIELD); 54 async_exchange_end(exch); 55 56 return ret; 57 } 58 59 errno_t visualizer_enumerate_modes(async_sess_t *sess, vslmode_t *mode, sysarg_t nth) 60 60 { 61 61 async_exch_t *exch = async_exchange_begin(sess); … … 64 64 aid_t req = async_send_1(exch, VISUALIZER_ENUMERATE_MODES, nth, &answer); 65 65 66 int rc = async_data_read_start(exch, mode, sizeof(vslmode_t));67 68 async_exchange_end(exch); 69 70 sysarg_t ret;71 async_wait_for(req, &ret); 72 73 if (rc != EOK) { 74 return rc; 75 } else if (ret != EOK) { 76 return ret; 77 } else { 78 return EOK; 79 } 80 } 81 82 int visualizer_get_default_mode(async_sess_t *sess, vslmode_t *mode)66 errno_t rc = async_data_read_start(exch, mode, sizeof(vslmode_t)); 67 68 async_exchange_end(exch); 69 70 errno_t ret; 71 async_wait_for(req, &ret); 72 73 if (rc != EOK) { 74 return rc; 75 } else if (ret != EOK) { 76 return ret; 77 } else { 78 return EOK; 79 } 80 } 81 82 errno_t visualizer_get_default_mode(async_sess_t *sess, vslmode_t *mode) 83 83 { 84 84 async_exch_t *exch = async_exchange_begin(sess); … … 87 87 aid_t req = async_send_0(exch, VISUALIZER_GET_DEFAULT_MODE, &answer); 88 88 89 int rc = async_data_read_start(exch, mode, sizeof(vslmode_t));90 91 async_exchange_end(exch); 92 93 sysarg_t ret;94 async_wait_for(req, &ret); 95 96 if (rc != EOK) { 97 return rc; 98 } else if (ret != EOK) { 99 return ret; 100 } else { 101 return EOK; 102 } 103 } 104 105 int visualizer_get_current_mode(async_sess_t *sess, vslmode_t *mode)89 errno_t rc = async_data_read_start(exch, mode, sizeof(vslmode_t)); 90 91 async_exchange_end(exch); 92 93 errno_t ret; 94 async_wait_for(req, &ret); 95 96 if (rc != EOK) { 97 return rc; 98 } else if (ret != EOK) { 99 return ret; 100 } else { 101 return EOK; 102 } 103 } 104 105 errno_t visualizer_get_current_mode(async_sess_t *sess, vslmode_t *mode) 106 106 { 107 107 async_exch_t *exch = async_exchange_begin(sess); … … 110 110 aid_t req = async_send_0(exch, VISUALIZER_GET_CURRENT_MODE, &answer); 111 111 112 int rc = async_data_read_start(exch, mode, sizeof(vslmode_t));113 114 async_exchange_end(exch); 115 116 sysarg_t ret;117 async_wait_for(req, &ret); 118 119 if (rc != EOK) { 120 return rc; 121 } else if (ret != EOK) { 122 return ret; 123 } else { 124 return EOK; 125 } 126 } 127 128 int visualizer_get_mode(async_sess_t *sess, vslmode_t *mode, sysarg_t index)112 errno_t rc = async_data_read_start(exch, mode, sizeof(vslmode_t)); 113 114 async_exchange_end(exch); 115 116 errno_t ret; 117 async_wait_for(req, &ret); 118 119 if (rc != EOK) { 120 return rc; 121 } else if (ret != EOK) { 122 return ret; 123 } else { 124 return EOK; 125 } 126 } 127 128 errno_t visualizer_get_mode(async_sess_t *sess, vslmode_t *mode, sysarg_t index) 129 129 { 130 130 async_exch_t *exch = async_exchange_begin(sess); … … 133 133 aid_t req = async_send_1(exch, VISUALIZER_GET_MODE, index, &answer); 134 134 135 int rc = async_data_read_start(exch, mode, sizeof(vslmode_t));136 137 async_exchange_end(exch); 138 139 sysarg_t ret;140 async_wait_for(req, &ret); 141 142 if (rc != EOK) { 143 return rc; 144 } else if (ret != EOK) { 145 return ret; 146 } else { 147 return EOK; 148 } 149 } 150 151 int visualizer_set_mode(async_sess_t *sess, sysarg_t index, sysarg_t version, void *cells)135 errno_t rc = async_data_read_start(exch, mode, sizeof(vslmode_t)); 136 137 async_exchange_end(exch); 138 139 errno_t ret; 140 async_wait_for(req, &ret); 141 142 if (rc != EOK) { 143 return rc; 144 } else if (ret != EOK) { 145 return ret; 146 } else { 147 return EOK; 148 } 149 } 150 151 errno_t visualizer_set_mode(async_sess_t *sess, sysarg_t index, sysarg_t version, void *cells) 152 152 { 153 153 async_exch_t *exch = async_exchange_begin(sess); … … 156 156 aid_t req = async_send_2(exch, VISUALIZER_SET_MODE, index, version, &answer); 157 157 158 int rc = async_share_out_start(exch, cells, AS_AREA_READ | AS_AREA_CACHEABLE);159 160 async_exchange_end(exch); 161 162 sysarg_t ret;163 async_wait_for(req, &ret); 164 165 if (rc != EOK) { 166 return rc; 167 } else if (ret != EOK) { 168 return ret; 169 } else { 170 return EOK; 171 } 172 } 173 174 int visualizer_update_damaged_region(async_sess_t *sess,158 errno_t rc = async_share_out_start(exch, cells, AS_AREA_READ | AS_AREA_CACHEABLE); 159 160 async_exchange_end(exch); 161 162 errno_t ret; 163 async_wait_for(req, &ret); 164 165 if (rc != EOK) { 166 return rc; 167 } else if (ret != EOK) { 168 return ret; 169 } else { 170 return EOK; 171 } 172 } 173 174 errno_t visualizer_update_damaged_region(async_sess_t *sess, 175 175 sysarg_t x, sysarg_t y, sysarg_t width, sysarg_t height, 176 176 sysarg_t x_offset, sysarg_t y_offset) … … 182 182 183 183 async_exch_t *exch = async_exchange_begin(sess); 184 int ret = async_req_5_0(exch, VISUALIZER_UPDATE_DAMAGED_REGION,184 errno_t ret = async_req_5_0(exch, VISUALIZER_UPDATE_DAMAGED_REGION, 185 185 x, y, width, height, offsets); 186 186 async_exchange_end(exch); … … 189 189 } 190 190 191 int visualizer_suspend(async_sess_t *sess)192 { 193 async_exch_t *exch = async_exchange_begin(sess); 194 int ret = async_req_0_0(exch, VISUALIZER_SUSPEND);195 async_exchange_end(exch); 196 197 return ret; 198 } 199 200 int visualizer_wakeup(async_sess_t *sess)201 { 202 async_exch_t *exch = async_exchange_begin(sess); 203 int ret = async_req_0_0(exch, VISUALIZER_WAKE_UP);191 errno_t visualizer_suspend(async_sess_t *sess) 192 { 193 async_exch_t *exch = async_exchange_begin(sess); 194 errno_t ret = async_req_0_0(exch, VISUALIZER_SUSPEND); 195 async_exchange_end(exch); 196 197 return ret; 198 } 199 200 errno_t visualizer_wakeup(async_sess_t *sess) 201 { 202 async_exch_t *exch = async_exchange_begin(sess); 203 errno_t ret = async_req_0_0(exch, VISUALIZER_WAKE_UP); 204 204 async_exchange_end(exch); 205 205
Note:
See TracChangeset
for help on using the changeset viewer.