Changeset 392f0e7 in mainline
- Timestamp:
- 2018-11-23T14:50:24Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2519349
- Parents:
- ca21f1e2
- git-author:
- Jiri Svoboda <jiri@…> (2018-11-22 17:48:21)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-11-23 14:50:24)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/console.c
rca21f1e2 r392f0e7 209 209 void grab_console(void) 210 210 { 211 sysinfo_set_item_val("kconsole", NULL, true); 211 212 event_notify_1(EVENT_KCONSOLE, false, true); 212 213 bool prev = console_override; … … 226 227 void release_console(void) 227 228 { 229 sysinfo_set_item_val("kconsole", NULL, false); 228 230 console_override = false; 229 231 event_notify_1(EVENT_KCONSOLE, false, false); -
uspace/drv/char/ski-con/ski-con.c
rca21f1e2 r392f0e7 1 1 /* 2 2 * Copyright (c) 2005 Jakub Jermar 3 * Copyright (c) 201 7Jiri Svoboda3 * Copyright (c) 2018 Jiri Svoboda 4 4 * All rights reserved. 5 5 * … … 40 40 #include <stdlib.h> 41 41 #include <stdbool.h> 42 #include <sysinfo.h> 42 43 43 44 #include "ski-con.h" … … 127 128 } 128 129 130 /** Detect if SKI console is in use by the kernel. 131 * 132 * This is needed since the kernel has no way of fencing off the user-space 133 * driver. 134 * 135 * @return @c true if in use by the kernel. 136 */ 137 static bool ski_con_disabled(void) 138 { 139 sysarg_t kconsole; 140 141 /* 142 * XXX Ideally we should get information from our kernel counterpart 143 * driver. But there needs to be a mechanism for the kernel console 144 * to inform the kernel driver. 145 */ 146 if (sysinfo_get_value("kconsole", &kconsole) != EOK) 147 return false; 148 149 return kconsole != false; 150 } 151 129 152 /** Poll Ski for keypresses. */ 130 153 static errno_t ski_con_fibril(void *arg) … … 135 158 136 159 while (true) { 137 while ( true) {160 while (!ski_con_disabled()) { 138 161 c = ski_con_getchar(); 139 162 if (c == 0) … … 246 269 uint8_t *dp = (uint8_t *) data; 247 270 248 for (i = 0; i < size; i++) 249 ski_con_putchar(con, dp[i]); 271 for (i = 0; i < size; i++) { 272 if (!ski_con_disabled()) 273 ski_con_putchar(con, dp[i]); 274 } 250 275 251 276 *nwr = size;
Note:
See TracChangeset
for help on using the changeset viewer.