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