Rev 3150 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3150 | Rev 3153 | ||
---|---|---|---|
Line 65... | Line 65... | ||
65 | if (async_req_0_2(console_phone, CONSOLE_GETCHAR, &r0, &r1) < 0) |
65 | if (async_req_0_2(console_phone, CONSOLE_GETCHAR, &r0, &r1) < 0) |
66 | return -1; |
66 | return -1; |
67 | ((char *) buf)[i++] = r0; |
67 | ((char *) buf)[i++] = r0; |
68 | } |
68 | } |
69 | return i; |
69 | return i; |
- | 70 | } else { |
|
- | 71 | return -1; |
|
70 | } |
72 | } |
71 | } |
73 | } |
72 | 74 | ||
73 | ssize_t write_stdout(const void *buf, size_t count) |
75 | ssize_t write_stdout(const void *buf, size_t count) |
74 | { |
76 | { |
Line 80... | Line 82... | ||
80 | async_msg_1(console_phone, CONSOLE_PUTCHAR, |
82 | async_msg_1(console_phone, CONSOLE_PUTCHAR, |
81 | ((const char *) buf)[i]); |
83 | ((const char *) buf)[i]); |
82 | 84 | ||
83 | return count; |
85 | return count; |
84 | } else |
86 | } else |
85 | return __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, count); |
87 | return __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, count); |
86 | } |
88 | } |
87 | 89 | ||
88 | void open_console(void) |
90 | void open_console(void) |
89 | { |
91 | { |
90 | if (console_phone < 0) { |
92 | if (console_phone < 0) { |
Line 92... | Line 94... | ||
92 | if (phone >= 0) |
94 | if (phone >= 0) |
93 | console_phone = phone; |
95 | console_phone = phone; |
94 | } |
96 | } |
95 | } |
97 | } |
96 | 98 | ||
- | 99 | void klog_update(void) |
|
- | 100 | { |
|
- | 101 | (void) __SYSCALL3(SYS_KLOG, 1, NULL, 0); |
|
- | 102 | } |
|
- | 103 | ||
97 | int get_cons_phone(void) |
104 | int get_cons_phone(void) |
98 | { |
105 | { |
99 | open_console(); |
106 | open_console(); |
100 | return console_phone; |
107 | return console_phone; |
101 | } |
108 | } |