Changeset 416abec in mainline
- 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
- Location:
- uspace
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tetris/input.c
rdb90860 r416abec 116 116 again: 117 117 if (!getchar_inprog) { 118 cons_phone = console_phone_get( );118 cons_phone = console_phone_get(true); 119 119 getchar_inprog = async_send_2(cons_phone, 120 120 CONSOLE_GETKEY, 0, 0, &charcall); -
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 } -
uspace/lib/libc/generic/io/stream.c
rdb90860 r416abec 57 57 ssize_t read_stdin(void *buf, size_t count) 58 58 { 59 int cons_phone = console_phone_get( );59 int cons_phone = console_phone_get(false); 60 60 61 61 if (cons_phone >= 0) { … … 80 80 ssize_t write_stdout(const void *buf, size_t count) 81 81 { 82 int cons_phone = console_phone_get( );82 int cons_phone = console_phone_get(false); 83 83 84 84 if (cons_phone >= 0) { -
uspace/lib/libc/generic/kbd.c
rdb90860 r416abec 43 43 int kbd_get_event(kbd_event_t *ev) 44 44 { 45 int cons_phone = console_phone_get( );45 int cons_phone = console_phone_get(true); 46 46 ipcarg_t r0, r1, r2, r3; 47 47 int rc; 48 49 if (cons_phone < 0)50 return -1;51 48 52 49 rc = async_req_0_4(cons_phone, CONSOLE_GETKEY, &r0, &r1, &r2, &r3); -
uspace/lib/libc/include/console.h
rdb90860 r416abec 38 38 #include <console/style.h> 39 39 #include <console/color.h> 40 #include <bool.h> 40 41 41 extern void console_open( void);42 extern void console_open(bool); 42 43 extern void console_close(void); 43 44 44 extern int console_phone_get( void);45 extern int console_phone_get(bool); 45 46 extern void console_wait(void); 46 47
Note:
See TracChangeset
for help on using the changeset viewer.