Changes in uspace/srv/hid/fb/serial_console.c [7e752b2:4f14e1f8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/fb/serial_console.c
r7e752b2 r4f14e1f8 39 39 40 40 #include <stdio.h> 41 #include <ipc/ipc.h>42 41 #include <async.h> 43 42 #include <ipc/fb.h> … … 55 54 #define MAX_CONTROL 20 56 55 57 static ipcarg_t scr_width;58 static ipcarg_t scr_height;56 static sysarg_t scr_width; 57 static sysarg_t scr_height; 59 58 static bool color = true; /**< True if producing color output. */ 60 59 static bool utf8 = false; /**< True if producing UTF8 output. */ 61 60 static putc_function_t putc_function; 62 61 63 static ipcarg_t lastcol = 0;64 static ipcarg_t lastrow = 0;62 static sysarg_t lastcol = 0; 63 static sysarg_t lastrow = 0; 65 64 static attrs_t cur_attr = { 66 65 .t = at_style, … … 130 129 } 131 130 132 void serial_goto(const ipcarg_t col, const ipcarg_t row)131 void serial_goto(const sysarg_t col, const sysarg_t row) 133 132 { 134 133 if ((col > scr_width) || (row > scr_height)) … … 252 251 253 252 /** Set scrolling region. */ 254 void serial_set_scroll_region( ipcarg_t last_row)253 void serial_set_scroll_region(sysarg_t last_row) 255 254 { 256 255 char control[MAX_CONTROL]; … … 269 268 } 270 269 271 void serial_console_init(putc_function_t putc_fn, ipcarg_t w, ipcarg_t h)270 void serial_console_init(putc_function_t putc_fn, sysarg_t w, sysarg_t h) 272 271 { 273 272 scr_width = w; … … 286 285 * 287 286 */ 288 static void draw_text_data(keyfield_t *data, ipcarg_t x0, ipcarg_t y0,289 ipcarg_t width, ipcarg_t height)287 static void draw_text_data(keyfield_t *data, sysarg_t x0, sysarg_t y0, 288 sysarg_t width, sysarg_t height) 290 289 { 291 290 attrs_t *a0 = &data[0].attrs; 292 291 serial_set_attrs(a0); 293 292 294 ipcarg_t y;293 sysarg_t y; 295 294 for (y = 0; y < height; y++) { 296 295 serial_goto(x0, y0 + y); 297 296 298 ipcarg_t x;297 sysarg_t x; 299 298 for (x = 0; x < width; x++) { 300 299 attrs_t *attr = &data[y * width + x].attrs; … … 319 318 320 319 if (client_connected) { 321 ipc_answer_0(iid, ELIMIT);320 async_answer_0(iid, ELIMIT); 322 321 return; 323 322 } 324 323 325 324 client_connected = 1; 326 ipc_answer_0(iid, EOK);325 async_answer_0(iid, EOK); 327 326 328 327 /* Clear the terminal, set scrolling region … … 337 336 338 337 wchar_t c; 339 ipcarg_t col;340 ipcarg_t row;341 ipcarg_t w;342 ipcarg_t h;338 sysarg_t col; 339 sysarg_t row; 340 sysarg_t w; 341 sysarg_t h; 343 342 ssize_t rows; 344 343 345 344 int retval; 346 345 347 switch (IPC_GET_ METHOD(call)) {346 switch (IPC_GET_IMETHOD(call)) { 348 347 case IPC_M_PHONE_HUNGUP: 349 348 client_connected = 0; 350 ipc_answer_0(callid, EOK);349 async_answer_0(callid, EOK); 351 350 352 351 /* Exit thread */ … … 407 406 break; 408 407 case FB_GET_CSIZE: 409 ipc_answer_2(callid, EOK, scr_width, scr_height);408 async_answer_2(callid, EOK, scr_width, scr_height); 410 409 continue; 411 410 case FB_GET_COLOR_CAP: 412 ipc_answer_1(callid, EOK, color ? FB_CCAP_INDEXED :411 async_answer_1(callid, EOK, color ? FB_CCAP_INDEXED : 413 412 FB_CCAP_STYLE); 414 413 continue; … … 442 441 443 442 if (rows >= 0) { 444 if (( ipcarg_t) rows > scr_height) {443 if ((sysarg_t) rows > scr_height) { 445 444 retval = EINVAL; 446 445 break; 447 446 } 448 447 } else { 449 if (( ipcarg_t) (-rows) > scr_height) {448 if ((sysarg_t) (-rows) > scr_height) { 450 449 retval = EINVAL; 451 450 break; … … 478 477 retval = ENOENT; 479 478 } 480 ipc_answer_0(callid, retval);479 async_answer_0(callid, retval); 481 480 } 482 481 }
Note:
See TracChangeset
for help on using the changeset viewer.