Changeset 416abec in mainline for uspace/lib/libc/generic/console.c
- Timestamp:
- 2009-03-20T20:58:21Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e622f0a8
- Parents:
- db90860
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/console.c
rdb90860 r416abec 43 43 static int console_phone = -1; 44 44 45 void console_open( void)45 void console_open(bool blocking) 46 46 { 47 47 if (console_phone < 0) { 48 int phone = ipc_connect_me_to(PHONE_NS, SERVICE_CONSOLE, 0, 0); 48 int phone; 49 if (blocking) { 50 phone = ipc_connect_me_to_blocking(PHONE_NS, 51 SERVICE_CONSOLE, 0, 0); 52 } else { 53 phone = ipc_connect_me_to(PHONE_NS, SERVICE_CONSOLE, 0, 54 0); 55 } 49 56 if (phone >= 0) 50 57 console_phone = phone; … … 61 68 } 62 69 63 int console_phone_get( void)70 int console_phone_get(bool blocking) 64 71 { 65 72 if (console_phone < 0) 66 console_open( );73 console_open(blocking); 67 74 68 75 return console_phone; … … 72 79 { 73 80 while (console_phone < 0) 74 console_open( );81 console_open(true); 75 82 } 76 83 77 84 void console_clear(void) 78 85 { 79 int cons_phone = console_phone_get( );86 int cons_phone = console_phone_get(true); 80 87 async_msg_0(cons_phone, CONSOLE_CLEAR); 81 88 } … … 83 90 void console_goto(int row, int col) 84 91 { 85 int cons_phone = console_phone_get( );92 int cons_phone = console_phone_get(true); 86 93 async_msg_2(cons_phone, CONSOLE_GOTO, row, col); 87 94 } … … 89 96 void console_putchar(int c) 90 97 { 91 int cons_phone = console_phone_get( );98 int cons_phone = console_phone_get(true); 92 99 async_msg_1(cons_phone, CONSOLE_PUTCHAR, c); 93 100 } … … 95 102 void console_flush(void) 96 103 { 97 int cons_phone = console_phone_get( );104 int cons_phone = console_phone_get(true); 98 105 async_msg_0(cons_phone, CONSOLE_FLUSH); 99 106 } … … 101 108 int console_get_size(int *rows, int *cols) 102 109 { 103 int cons_phone = console_phone_get( );110 int cons_phone = console_phone_get(true); 104 111 ipcarg_t r, c; 105 112 int rc; … … 115 122 void console_set_style(int style) 116 123 { 117 int cons_phone = console_phone_get( );124 int cons_phone = console_phone_get(true); 118 125 async_msg_1(cons_phone, CONSOLE_SET_STYLE, style); 119 126 } … … 121 128 void console_set_color(int fg_color, int bg_color, int flags) 122 129 { 123 int cons_phone = console_phone_get( );130 int cons_phone = console_phone_get(true); 124 131 async_msg_3(cons_phone, CONSOLE_SET_COLOR, fg_color, bg_color, flags); 125 132 } … … 127 134 void console_set_rgb_color(int fg_color, int bg_color) 128 135 { 129 int cons_phone = console_phone_get( );136 int cons_phone = console_phone_get(true); 130 137 async_msg_2(cons_phone, CONSOLE_SET_RGB_COLOR, fg_color, bg_color); 131 138 } … … 133 140 void console_cursor_visibility(int show) 134 141 { 135 int cons_phone = console_phone_get( );142 int cons_phone = console_phone_get(true); 136 143 async_msg_1(cons_phone, CONSOLE_CURSOR_VISIBILITY, show != 0); 137 144 }
Note:
See TracChangeset
for help on using the changeset viewer.