Changeset 03e0beaf in mainline
- Timestamp:
- 2016-12-27T12:52:04Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ce5a0f1
- Parents:
- 1a2befb
- Location:
- uspace/srv/hid
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/input.c
r1a2befb r03e0beaf 43 43 #include <ipc/input.h> 44 44 #include <sysinfo.h> 45 #include <config.h> 45 46 #include <stdio.h> 46 47 #include <unistd.h> … … 903 904 } 904 905 905 char *boot_args; 906 size_t size; 907 908 boot_args = sysinfo_get_data("boot_args", &size); 909 if (boot_args && size) { 910 char *args = boot_args; 911 char *arg; 912 #define ARG_CONSOLE "console=" 913 while ((arg = str_tok(args, " ", &args)) != NULL) { 914 if (!str_lcmp(arg, ARG_CONSOLE, 915 str_length(ARG_CONSOLE))) { 916 serial_console = arg + str_length(ARG_CONSOLE); 917 break; 918 } 919 } 920 } 906 serial_console = config_get_value("console"); 921 907 922 908 /* Add legacy keyboard devices. */ -
uspace/srv/hid/output/port/chardev.c
r1a2befb r03e0beaf 39 39 #include <errno.h> 40 40 #include <str.h> 41 #include < sysinfo.h>41 #include <config.h> 42 42 #include "../ctl/serial.h" 43 43 #include "../output.h" … … 134 134 int chardev_init(void) 135 135 { 136 char *boot_args; 137 size_t size; 138 int rc; 139 140 boot_args = sysinfo_get_data("boot_args", &size); 141 if (!boot_args || !size) { 136 console = config_get_value("console"); 137 if (!console) { 142 138 /* 143 * Ok, there is nothing in the boot arguments. That means that 144 * the user did not specify a serial console device. 139 * The system is not configured to use serial console. 145 140 */ 146 141 return EOK; 147 142 } 148 143 149 char *args = boot_args; 150 char *arg; 151 #define ARG_CONSOLE "console=" 152 while ((arg = str_tok(args, " ", &args)) != NULL) { 153 if (!str_lcmp(arg, ARG_CONSOLE, str_length(ARG_CONSOLE))) { 154 console = arg + str_length(ARG_CONSOLE); 155 break; 156 } 157 } 158 159 if (!console) { 160 /* 161 * The user specified some boot arguments, but the serial 162 * console service was not among them. 163 */ 164 return EOK; 165 } 166 167 rc = loc_category_get_id("serial", &serial_cat_id, IPC_FLAG_BLOCKING); 144 int rc = loc_category_get_id("serial", &serial_cat_id, IPC_FLAG_BLOCKING); 168 145 if (rc != EOK) { 169 146 printf("%s: Failed to get \"serial\" category ID.\n", NAME);
Note:
See TracChangeset
for help on using the changeset viewer.