Changes in / [cd1e6b62:d70765d] in mainline
- Files:
-
- 3 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
rcd1e6b62 rd70765d 417 417 ! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=keyboard)&PLATFORM=ia64&MACHINE=i460GX] CONFIG_PC_KBD (y/n) 418 418 419 % PC keyboard support420 ! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=keyboard)&PLATFORM=arm32&MACHINE=integratorcp] CONFIG_PC_KBD (y/n)421 422 419 % Support for msim/GXemul keyboard 423 420 ! [CONFIG_HID_IN=generic&PLATFORM=mips32] CONFIG_MIPS_KBD (y/n) -
kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
rcd1e6b62 rd70765d 292 292 .y = 480, 293 293 .scan = 2560, 294 .visual = VISUAL_ RGB_8_8_8_0,294 .visual = VISUAL_BGR_0_8_8_8, 295 295 }; 296 296 -
kernel/arch/mips32/include/cp0.h
rcd1e6b62 rd70765d 70 70 { \ 71 71 uint32_t retval; \ 72 asm volatile("mfc0 %0, $" #reg : "=r"(retval)); \72 asm("mfc0 %0, $" #reg : "=r"(retval)); \ 73 73 return retval; \ 74 74 } … … 76 76 #define GEN_WRITE_CP0(nm,reg) static inline void cp0_ ##nm##_write(uint32_t val) \ 77 77 { \ 78 asm volatile("mtc0 %0, $" #reg : : "r"(val) ); \78 asm("mtc0 %0, $" #reg : : "r"(val) ); \ 79 79 } 80 80 -
kernel/arch/sparc64/src/smp/sun4v/smp.c
rcd1e6b62 rd70765d 1 1 /* 2 2 * Copyright (c) 2006 Jakub Jermar 3 * Copyright (c) 2009 Pavel Rimsky 3 * Copyright (c) 2009 Pavel Rimsky 4 4 * All rights reserved. 5 5 * … … 439 439 if (waitq_sleep_timeout(&ap_completion_wq, 10000000, SYNCH_FLAGS_NONE) == 440 440 ESYNCH_TIMEOUT) 441 printf("%s: waiting for processor (cpuid = %" PRIu 64") timed out\n",441 printf("%s: waiting for processor (cpuid = %" PRIu32 ") timed out\n", 442 442 __func__, cpuid); 443 443 -
kernel/arch/sparc64/src/sun4v/start.S
rcd1e6b62 rd70765d 296 296 * Create the first stack frame. 297 297 */ 298 save %sp, -(STACK_WIND OW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp298 save %sp, -(STACK_WINDWO_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp 299 299 flushw 300 300 add %g0, -STACK_BIAS, %fp -
kernel/arch/sparc64/src/trap/sun4v/interrupt.c
rcd1e6b62 rd70765d 111 111 ((void (*)(void)) data1)(); 112 112 } else { 113 printf("Spurious interrupt on % " PRIu64 ", data = %" PRIx64 ".\n",113 printf("Spurious interrupt on %d, data = %" PRIx64 ".\n", 114 114 CPU->arch.id, data1); 115 115 } -
kernel/genarch/Makefile.inc
rcd1e6b62 rd70765d 122 122 endif 123 123 124 ifeq ($(CONFIG_PL050),y) 125 GENARCH_SOURCES += \ 126 genarch/src/kbrd/kbrd_pl050.c \ 127 genarch/src/kbrd/scanc_pl050.c 128 endif 129 124 130 ifeq ($(CONFIG_MAC_KBD),y) 125 131 GENARCH_SOURCES += \ -
kernel/generic/src/console/console.c
rcd1e6b62 rd70765d 53 53 #include <str.h> 54 54 55 /*56 * devman produces a lot of output and by giving so many pages57 * we to allow /app/klog to catch-up.58 */59 #ifdef CONFIG_DEVMAN_EARLY_LAUNCH60 #define KLOG_PAGES 6461 #else62 55 #define KLOG_PAGES 4 63 #endif64 65 56 #define KLOG_LENGTH (KLOG_PAGES * PAGE_SIZE / sizeof(wchar_t)) 66 57 #define KLOG_LATENCY 8 -
uspace/app/bdsh/cmds/modules/cat/cat.c
rcd1e6b62 rd70765d 1 1 /* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> 2 * Copyright (c) 2011, Martin Sucha3 2 * All rights reserved. 4 3 * … … 36 35 #include <str.h> 37 36 #include <fcntl.h> 38 #include <io/console.h>39 #include <io/color.h>40 #include <io/style.h>41 #include <io/keycode.h>42 #include <errno.h>43 #include <vfs/vfs.h>44 #include <assert.h>45 37 46 38 #include "config.h" … … 56 48 57 49 static const char *cat_oops = "That option is not yet supported\n"; 58 static const char *hexchars = "0123456789abcdef";59 60 static bool paging_enabled = false;61 static size_t chars_remaining = 0;62 static size_t lines_remaining = 0;63 static sysarg_t console_cols = 0;64 static sysarg_t console_rows = 0;65 static bool should_quit = false;66 50 67 51 static struct option const long_options[] = { … … 72 56 { "buffer", required_argument, 0, 'b' }, 73 57 { "more", no_argument, 0, 'm' }, 74 { "hex", no_argument, 0, 'x' },75 58 { 0, 0, 0, 0 } 76 59 }; … … 92 75 " -b, --buffer ## Set the read buffer size to ##\n" 93 76 " -m, --more Pause after each screen full\n" 94 " -x, --hex Print bytes as hex values\n"95 77 "Currently, %s is under development, some options don't work.\n", 96 78 cmdname, cmdname); … … 100 82 } 101 83 102 static void waitprompt() 103 { 104 console_set_pos(fphone(stdout), 0, console_rows-1); 105 console_set_color(fphone(stdout), COLOR_BLUE, COLOR_WHITE, 0); 106 printf("ENTER/SPACE/PAGE DOWN - next page, " 107 "ESC/Q - quit, C - continue unpaged"); 108 fflush(stdout); 109 console_set_style(fphone(stdout), STYLE_NORMAL); 110 } 111 112 static void waitkey() 113 { 114 console_event_t ev; 115 116 while (true) { 117 if (!console_get_event(fphone(stdin), &ev)) { 118 return; 119 } 120 if (ev.type == KEY_PRESS) { 121 if (ev.key == KC_ESCAPE || ev.key == KC_Q) { 122 should_quit = true; 123 return; 124 } 125 if (ev.key == KC_C) { 126 paging_enabled = false; 127 return; 128 } 129 if (ev.key == KC_ENTER || ev.key == KC_SPACE || 130 ev.key == KC_PAGE_DOWN) { 131 return; 132 } 133 } 134 } 135 assert(false); 136 } 137 138 static void newpage() 139 { 140 console_clear(fphone(stdout)); 141 chars_remaining = console_cols; 142 lines_remaining = console_rows-1; 143 } 144 145 static void paged_char(wchar_t c) 146 { 147 putchar(c); 148 if (paging_enabled) { 149 chars_remaining--; 150 if (c == '\n' || chars_remaining == 0) { 151 chars_remaining = console_cols; 152 lines_remaining--; 153 } 154 if (lines_remaining == 0) { 155 fflush(stdout); 156 waitprompt(); 157 waitkey(); 158 newpage(); 159 } 160 } 161 } 162 163 static unsigned int cat_file(const char *fname, size_t blen, bool hex) 84 static unsigned int cat_file(const char *fname, size_t blen) 164 85 { 165 86 int fd, bytes = 0, count = 0, reads = 0; 166 87 off64_t total = 0; 167 88 char *buff = NULL; 168 int i;169 size_t offset = 0;170 89 171 90 fd = open(fname, O_RDONLY); … … 190 109 count += bytes; 191 110 buff[bytes] = '\0'; 192 offset = 0; 193 for (i = 0; i < bytes && !should_quit; i++) { 194 if (hex) { 195 paged_char(hexchars[((uint8_t)buff[i])/16]); 196 paged_char(hexchars[((uint8_t)buff[i])%16]); 197 } 198 else { 199 wchar_t c = str_decode(buff, &offset, bytes); 200 if (c == 0) { 201 // reached end of string 202 break; 203 } 204 paged_char(c); 205 } 206 207 } 111 printf("%s", buff); 208 112 reads++; 209 113 } 210 } while (bytes > 0 && !should_quit);114 } while (bytes > 0); 211 115 212 116 close(fd); … … 227 131 unsigned int argc, i, ret = 0, buffer = 0; 228 132 int c, opt_ind; 229 bool hex = false;230 bool more = false;231 sysarg_t rows, cols;232 int rc;233 234 // reset global state235 // TODO: move to structure?236 paging_enabled = false;237 chars_remaining = 0;238 lines_remaining = 0;239 console_cols = 0;240 console_rows = 0;241 should_quit = false;242 133 243 134 argc = cli_count_args(argv); 244 135 245 136 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 246 c = getopt_long(argc, argv, " xhvmH:t:b:", long_options, &opt_ind);137 c = getopt_long(argc, argv, "hvmH:t:b:", long_options, &opt_ind); 247 138 switch (c) { 248 139 case 'h': … … 262 153 break; 263 154 case 'm': 264 more = true; 265 break; 266 case 'x': 267 hex = true; 268 break; 155 printf("%s", cat_oops); 156 return CMD_FAILURE; 269 157 } 270 158 } … … 280 168 if (buffer <= 0) 281 169 buffer = CAT_DEFAULT_BUFLEN; 282 283 if (more) {284 rc = console_get_size(fphone(stdout), &cols, &rows);285 if (rc != EOK) {286 printf("%s - cannot get console size\n", cmdname);287 return CMD_FAILURE;288 }289 console_cols = cols;290 console_rows = rows;291 paging_enabled = true;292 newpage();293 }294 170 295 for (i = optind; argv[i] != NULL && !should_quit; i++)296 ret += cat_file(argv[i], buffer , hex);171 for (i = optind; argv[i] != NULL; i++) 172 ret += cat_file(argv[i], buffer); 297 173 298 174 if (ret) -
uspace/app/bdsh/cmds/modules/cat/cat.h
rcd1e6b62 rd70765d 4 4 /* Prototypes for the cat command, excluding entry points */ 5 5 6 static unsigned int cat_file(const char *, size_t , bool);6 static unsigned int cat_file(const char *, size_t); 7 7 8 8 #endif /* CAT_H */ -
uspace/app/bdsh/cmds/modules/cp/cp.c
rcd1e6b62 rd70765d 108 108 for (;;) { 109 109 ssize_t res; 110 size_t written = 0;111 110 112 111 bytes = read(fd1, buff, blen); … … 121 120 * returned less data than requested. 122 121 */ 123 bytes = write(fd2, buff + written, res);122 bytes = write(fd2, buff, res); 124 123 if (bytes < 0) 125 124 goto err; 126 written += bytes;127 125 res -= bytes; 128 126 } while (res > 0); -
uspace/app/bdsh/cmds/modules/rm/rm.c
rcd1e6b62 rd70765d 101 101 } 102 102 103 static unsigned int rm_recursive_not_empty_dirs(const char *path)104 {105 DIR *dirp;106 struct dirent *dp;107 char buff[PATH_MAX];108 unsigned int scope;109 unsigned int ret = 0;110 111 dirp = opendir(path);112 if (!dirp) {113 /* May have been deleted between scoping it and opening it */114 cli_error(CL_EFAIL, "Could not open %s", path);115 return ret;116 }117 118 memset(buff, 0, sizeof(buff));119 while ((dp = readdir(dirp))) {120 snprintf(buff, PATH_MAX - 1, "%s/%s", path, dp->d_name);121 scope = rm_scope(buff);122 switch (scope) {123 case RM_BOGUS:124 break;125 case RM_FILE:126 ret += rm_single(buff);127 break;128 case RM_DIR:129 ret += rm_recursive(buff);130 break;131 }132 }133 134 return ret;135 }136 137 103 static unsigned int rm_recursive(const char *path) 138 104 { 139 105 int rc; 140 unsigned int ret = 0;141 106 142 107 /* First see if it will just go away */ … … 146 111 147 112 /* Its not empty, recursively scan it */ 148 ret = rm_recursive_not_empty_dirs(path); 149 150 /* Delete directory */ 151 rc = rmdir(path); 152 if (rc == 0) 153 return ret; 154 155 cli_error(CL_ENOTSUP, "Can not remove %s", path); 156 157 return ret + 1; 113 cli_error(CL_ENOTSUP, 114 "Can not remove %s, directory not empty", path); 115 return 1; 158 116 } 159 117 -
uspace/app/init/init.c
rcd1e6b62 rd70765d 288 288 289 289 spawn("/srv/clip"); 290 291 #ifdef CONFIG_DEVMAN_EARLY_LAUNCH 292 spawn("/srv/devman"); 293 #endif 290 294 291 295 /* … … 314 318 getterm("term/vc6", "/app/klog", false); 315 319 316 #ifdef CONFIG_DEVMAN_EARLY_LAUNCH 317 spawn("/srv/devman"); 318 #else 320 #ifndef CONFIG_DEVMAN_EARLY_LAUNCH 319 321 getterm("term/vc7", "/srv/devman", false); 320 322 #endif -
uspace/drv/ohci/root_hub.c
rcd1e6b62 rd70765d 43 43 #include <usb/classes/hub.h> 44 44 45 /**46 * standart device descriptor for ohci root hub47 */48 45 static const usb_standard_device_descriptor_t ohci_rh_device_descriptor = 49 46 { … … 64 61 }; 65 62 66 /**67 * standart configuration descriptor with filled common values68 * for ohci root hubs69 */70 63 static const usb_standard_configuration_descriptor_t ohci_rh_conf_descriptor = 71 64 { … … 80 73 }; 81 74 82 /**83 * standart ohci root hub interface descriptor84 */85 75 static const usb_standard_interface_descriptor_t ohci_rh_iface_descriptor = 86 76 { … … 97 87 }; 98 88 99 /**100 * standart ohci root hub endpoint descriptor101 */102 89 static const usb_standard_endpoint_descriptor_t ohci_rh_ep_descriptor = 103 90 { … … 130 117 /*----------------------------------------------------------------------------*/ 131 118 132 /** 133 * create answer to port status_request 134 * 135 * Copy content of corresponding port status register to answer buffer. 136 * 137 * @param instance root hub instance 138 * @param port port number, counted from 1 139 * @param request structure containing both request and response information 140 * @return error code 141 */ 119 142 120 static int process_get_port_status_request(rh_t *instance, uint16_t port, 143 121 usb_transfer_batch_t * request){ … … 150 128 } 151 129 152 /**153 * create answer to port status_request154 *155 * Copy content of hub status register to answer buffer.156 *157 * @param instance root hub instance158 * @param request structure containing both request and response information159 * @return error code160 */161 130 static int process_get_hub_status_request(rh_t *instance, 162 131 usb_transfer_batch_t * request){ … … 170 139 } 171 140 172 /** 173 * Create hub descriptor used in hub-driver <-> hub communication 174 * 175 * This means creating byt array from data in root hub registers. For more 176 * info see usb hub specification. 177 * 178 * @param instance root hub instance 179 * @param@out out_result pointer to resultant serialized descriptor 180 * @param@out out_size size of serialized descriptor 181 */ 182 static void usb_create_serialized_hub_descriptor(rh_t *instance, 183 uint8_t ** out_result, 141 static void usb_create_serialized_hub_descriptor(rh_t *instance, uint8_t ** out_result, 184 142 size_t * out_size) { 185 143 //base size … … 221 179 222 180 223 /**224 * create answer to status request225 *226 * This might be either hub status or port status request. If neither,227 * ENOTSUP is returned.228 * @param instance root hub instance229 * @param request structure containing both request and response information230 * @return error code231 */232 181 static int process_get_status_request(rh_t *instance, 233 182 usb_transfer_batch_t * request) … … 252 201 } 253 202 254 /**255 * create answer to status interrupt consisting of change bitmap256 *257 * Result contains bitmap where bit 0 indicates change on hub and258 * bit i indicates change on i`th port (i>0). For more info see259 * Hub and Port status bitmap specification in USB specification.260 * @param instance root hub instance261 * @param@out buffer pointer to created interrupt mas262 * @param@out buffer_size size of created interrupt mask263 */264 203 static void create_interrupt_mask(rh_t *instance, void ** buffer, 265 204 size_t * buffer_size){ … … 285 224 } 286 225 287 /** 288 * create standart configuration descriptor for the root hub instance 289 * @param instance root hub instance 290 * @return newly allocated descriptor 291 */ 292 static usb_standard_configuration_descriptor_t * 293 usb_ohci_rh_create_standart_configuration_descriptor(rh_t *instance){ 294 usb_standard_configuration_descriptor_t * descriptor = 295 malloc(sizeof(usb_standard_configuration_descriptor_t)); 296 memcpy(descriptor, &ohci_rh_conf_descriptor, 297 sizeof(usb_standard_configuration_descriptor_t)); 298 /// \TODO should this include device descriptor? 299 const size_t hub_descriptor_size = 7 + 300 2* (instance->port_count / 8 + 301 ((instance->port_count % 8 > 0) ? 1 : 0)); 302 descriptor->total_length = 303 sizeof(usb_standard_configuration_descriptor_t)+ 304 sizeof(usb_standard_endpoint_descriptor_t)+ 305 sizeof(usb_standard_interface_descriptor_t)+ 306 hub_descriptor_size; 307 return descriptor; 308 } 309 310 /** 311 * create answer to a descriptor request 312 * 313 * This might be a request for standard (configuration, device, endpoint or 314 * interface) or device specific (hub) descriptor. 315 * @param instance root hub instance 316 * @param request structure containing both request and response information 317 * @return error code 318 */ 226 319 227 static int process_get_descriptor_request(rh_t *instance, 320 228 usb_transfer_batch_t *request){ 229 /// \TODO 321 230 usb_device_request_setup_packet_t * setup_request = 322 231 (usb_device_request_setup_packet_t*)request->setup_buffer; 323 232 size_t size; 324 const void * result_descriptor = NULL;233 const void * result_descriptor; 325 234 const uint16_t setup_request_value = setup_request->value_high; 326 235 //(setup_request->value_low << 8); 327 236 bool del = false; 237 328 238 switch (setup_request_value) 329 239 { 330 case USB_DESCTYPE_HUB: { 331 uint8_t * descriptor; 332 usb_create_serialized_hub_descriptor( 333 instance, &descriptor, &size); 334 result_descriptor = descriptor; 335 if(result_descriptor) del = true; 336 break; 337 } 338 case USB_DESCTYPE_DEVICE: { 339 usb_log_debug("USB_DESCTYPE_DEVICE\n"); 340 result_descriptor = &ohci_rh_device_descriptor; 341 size = sizeof(ohci_rh_device_descriptor); 342 break; 343 } 344 case USB_DESCTYPE_CONFIGURATION: { 345 usb_log_debug("USB_DESCTYPE_CONFIGURATION\n"); 346 usb_standard_configuration_descriptor_t * descriptor = 347 usb_ohci_rh_create_standart_configuration_descriptor( 348 instance); 349 result_descriptor = descriptor; 350 size = sizeof(usb_standard_configuration_descriptor_t); 351 del = true; 352 break; 353 } 354 case USB_DESCTYPE_INTERFACE: { 355 usb_log_debug("USB_DESCTYPE_INTERFACE\n"); 356 result_descriptor = &ohci_rh_iface_descriptor; 357 size = sizeof(ohci_rh_iface_descriptor); 358 break; 359 } 360 case USB_DESCTYPE_ENDPOINT: { 361 usb_log_debug("USB_DESCTYPE_ENDPOINT\n"); 362 result_descriptor = &ohci_rh_ep_descriptor; 363 size = sizeof(ohci_rh_ep_descriptor); 364 break; 365 } 366 default: { 367 usb_log_debug("USB_DESCTYPE_EINVAL %d \n",setup_request->value); 368 usb_log_debug("\ttype %d\n\trequest %d\n\tvalue %d\n\tindex %d\n\tlen %d\n ", 369 setup_request->request_type, 370 setup_request->request, 371 setup_request_value, 372 setup_request->index, 373 setup_request->length 374 ); 375 return EINVAL; 376 } 377 } 240 case USB_DESCTYPE_HUB: { 241 uint8_t * descriptor; 242 usb_create_serialized_hub_descriptor( 243 instance, &descriptor, &size); 244 result_descriptor = descriptor; 245 break; 246 } 247 case USB_DESCTYPE_DEVICE: { 248 usb_log_debug("USB_DESCTYPE_DEVICE\n"); 249 result_descriptor = &ohci_rh_device_descriptor; 250 size = sizeof(ohci_rh_device_descriptor); 251 break; 252 } 253 case USB_DESCTYPE_CONFIGURATION: { 254 usb_log_debug("USB_DESCTYPE_CONFIGURATION\n"); 255 usb_standard_configuration_descriptor_t * descriptor = 256 malloc(sizeof(usb_standard_configuration_descriptor_t)); 257 memcpy(descriptor, &ohci_rh_conf_descriptor, 258 sizeof(usb_standard_configuration_descriptor_t)); 259 /// \TODO should this include device descriptor? 260 const size_t hub_descriptor_size = 7 + 261 2* (instance->port_count / 8 + 262 ((instance->port_count % 8 > 0) ? 1 : 0)); 263 descriptor->total_length = 264 sizeof(usb_standard_configuration_descriptor_t)+ 265 sizeof(usb_standard_endpoint_descriptor_t)+ 266 sizeof(usb_standard_interface_descriptor_t)+ 267 hub_descriptor_size; 268 result_descriptor = descriptor; 269 size = sizeof(usb_standard_configuration_descriptor_t); 270 del = true; 271 break; 272 } 273 case USB_DESCTYPE_INTERFACE: { 274 usb_log_debug("USB_DESCTYPE_INTERFACE\n"); 275 result_descriptor = &ohci_rh_iface_descriptor; 276 size = sizeof(ohci_rh_iface_descriptor); 277 break; 278 } 279 case USB_DESCTYPE_ENDPOINT: { 280 usb_log_debug("USB_DESCTYPE_ENDPOINT\n"); 281 result_descriptor = &ohci_rh_ep_descriptor; 282 size = sizeof(ohci_rh_ep_descriptor); 283 break; 284 } 285 default: { 286 usb_log_debug("USB_DESCTYPE_EINVAL %d \n",setup_request->value); 287 usb_log_debug("\ttype %d\n\trequest %d\n\tvalue %d\n\tindex %d\n\tlen %d\n ", 288 setup_request->request_type, 289 setup_request->request, 290 setup_request_value, 291 setup_request->index, 292 setup_request->length 293 ); 294 return EINVAL; 295 } 296 } 297 #if 0 298 if(setup_request_value == USB_DESCTYPE_HUB){ 299 usb_log_debug("USB_DESCTYPE_HUB\n"); 300 //create hub descriptor 301 uint8_t * descriptor; 302 usb_create_serialized_hub_descriptor(instance, 303 &descriptor, &size); 304 result_descriptor = descriptor; 305 }else if(setup_request_value == USB_DESCTYPE_DEVICE){ 306 //create std device descriptor 307 usb_log_debug("USB_DESCTYPE_DEVICE\n"); 308 usb_standard_device_descriptor_t * descriptor = 309 (usb_standard_device_descriptor_t*) 310 malloc(sizeof(usb_standard_device_descriptor_t)); 311 descriptor->configuration_count = 1; 312 descriptor->descriptor_type = USB_DESCTYPE_DEVICE; 313 descriptor->device_class = USB_CLASS_HUB; 314 descriptor->device_protocol = 0; 315 descriptor->device_subclass = 0; 316 descriptor->device_version = 0; 317 descriptor->length = sizeof(usb_standard_device_descriptor_t); 318 /// \TODO this value is guessed 319 descriptor->max_packet_size = 8; 320 descriptor->product_id = 0x0001; 321 /// \TODO these values migt be different 322 descriptor->str_serial_number = 0; 323 descriptor->str_serial_number = 0; 324 descriptor->usb_spec_version = 0; 325 descriptor->vendor_id = 0x16db; 326 result_descriptor = descriptor; 327 size = sizeof(usb_standard_device_descriptor_t); 328 }else if(setup_request_value == USB_DESCTYPE_CONFIGURATION){ 329 usb_log_debug("USB_DESCTYPE_CONFIGURATION\n"); 330 usb_standard_configuration_descriptor_t * descriptor = 331 (usb_standard_configuration_descriptor_t*) 332 malloc(sizeof(usb_standard_configuration_descriptor_t)); 333 /// \TODO some values are default or guessed 334 descriptor->attributes = 1<<7; 335 descriptor->configuration_number = 1; 336 descriptor->descriptor_type = USB_DESCTYPE_CONFIGURATION; 337 descriptor->interface_count = 1; 338 descriptor->length = sizeof(usb_standard_configuration_descriptor_t); 339 descriptor->max_power = 100; 340 descriptor->str_configuration = 0; 341 /// \TODO should this include device descriptor? 342 size_t hub_descriptor_size = 7 + 343 2* (instance->port_count / 8 + 344 ((instance->port_count % 8 > 0) ? 1 : 0)); 345 descriptor->total_length = 346 sizeof(usb_standard_configuration_descriptor_t)+ 347 sizeof(usb_standard_endpoint_descriptor_t)+ 348 sizeof(usb_standard_interface_descriptor_t)+ 349 hub_descriptor_size; 350 result_descriptor = descriptor; 351 size = sizeof(usb_standard_configuration_descriptor_t); 352 353 }else if(setup_request_value == USB_DESCTYPE_INTERFACE){ 354 usb_log_debug("USB_DESCTYPE_INTERFACE\n"); 355 usb_standard_interface_descriptor_t * descriptor = 356 (usb_standard_interface_descriptor_t*) 357 malloc(sizeof(usb_standard_interface_descriptor_t)); 358 descriptor->alternate_setting = 0; 359 descriptor->descriptor_type = USB_DESCTYPE_INTERFACE; 360 descriptor->endpoint_count = 1; 361 descriptor->interface_class = USB_CLASS_HUB; 362 /// \TODO is this correct? 363 descriptor->interface_number = 1; 364 descriptor->interface_protocol = 0; 365 descriptor->interface_subclass = 0; 366 descriptor->length = sizeof(usb_standard_interface_descriptor_t); 367 descriptor->str_interface = 0; 368 result_descriptor = descriptor; 369 size = sizeof(usb_standard_interface_descriptor_t); 370 }else if(setup_request_value == USB_DESCTYPE_ENDPOINT){ 371 usb_log_debug("USB_DESCTYPE_ENDPOINT\n"); 372 usb_standard_endpoint_descriptor_t * descriptor = 373 (usb_standard_endpoint_descriptor_t*) 374 malloc(sizeof(usb_standard_endpoint_descriptor_t)); 375 descriptor->attributes = USB_TRANSFER_INTERRUPT; 376 descriptor->descriptor_type = USB_DESCTYPE_ENDPOINT; 377 descriptor->endpoint_address = 1 + (1<<7); 378 descriptor->length = sizeof(usb_standard_endpoint_descriptor_t); 379 descriptor->max_packet_size = 8; 380 descriptor->poll_interval = 255; 381 result_descriptor = descriptor; 382 size = sizeof(usb_standard_endpoint_descriptor_t); 383 }else{ 384 usb_log_debug("USB_DESCTYPE_EINVAL %d \n",setup_request->value); 385 usb_log_debug("\ttype %d\n\trequest %d\n\tvalue %d\n\tindex %d\n\tlen %d\n ", 386 setup_request->request_type, 387 setup_request->request, 388 setup_request_value, 389 setup_request->index, 390 setup_request->length 391 ); 392 return EINVAL; 393 } 394 #endif 378 395 if(request->buffer_size < size){ 379 396 size = request->buffer_size; … … 386 403 } 387 404 388 /**389 * answer to get configuration request390 *391 * Root hub works independently on the configuration.392 * @param instance root hub instance393 * @param request structure containing both request and response information394 * @return error code395 */396 405 static int process_get_configuration_request(rh_t *instance, 397 406 usb_transfer_batch_t *request){ … … 405 414 } 406 415 407 /**408 * process feature-enabling/disabling request on hub409 *410 * @param instance root hub instance411 * @param feature feature selector412 * @param enable enable or disable specified feature413 * @return error code414 */415 416 static int process_hub_feature_set_request(rh_t *instance, 416 417 uint16_t feature, bool enable){ … … 426 427 } 427 428 428 /**429 * process feature-enabling/disabling request on hub430 *431 * @param instance root hub instance432 * @param feature feature selector433 * @param port port number, counted from 1434 * @param enable enable or disable the specified feature435 * @return error code436 */437 429 static int process_port_feature_set_request(rh_t *instance, 438 430 uint16_t feature, uint16_t port, bool enable){ … … 450 442 } 451 443 452 /**453 * register address to this device454 *455 * @param instance root hub instance456 * @param address new address457 * @return error code458 */459 444 static int process_address_set_request(rh_t *instance, 460 445 uint16_t address){ … … 463 448 } 464 449 465 /**466 * process one of requests that requere output data467 *468 * Request can be one of USB_DEVREQ_GET_STATUS, USB_DEVREQ_GET_DESCRIPTOR or469 * USB_DEVREQ_GET_CONFIGURATION.470 * @param instance root hub instance471 * @param request structure containing both request and response information472 * @return error code473 */474 450 static int process_request_with_output(rh_t *instance, 475 451 usb_transfer_batch_t *request){ … … 491 467 } 492 468 493 /**494 * process one of requests that carry input data495 *496 * Request can be one of USB_DEVREQ_SET_DESCRIPTOR or497 * USB_DEVREQ_SET_CONFIGURATION.498 * @param instance root hub instance499 * @param request structure containing both request and response information500 * @return error code501 */502 469 static int process_request_with_input(rh_t *instance, 503 470 usb_transfer_batch_t *request){ … … 516 483 } 517 484 518 /** 519 * process one of requests that do not request nor carry additional data 520 * 521 * Request can be one of USB_DEVREQ_CLEAR_FEATURE, USB_DEVREQ_SET_FEATURE or 522 * USB_DEVREQ_SET_ADDRESS. 523 * @param instance root hub instance 524 * @param request structure containing both request and response information 525 * @return error code 526 */ 485 527 486 static int process_request_without_data(rh_t *instance, 528 487 usb_transfer_batch_t *request){ … … 554 513 } 555 514 515 556 516 /** 557 * process hub control request558 517 * 559 * If needed, writes answer into the request structure. 560 * Request can be one of 561 * USB_DEVREQ_GET_STATUS, 562 * USB_DEVREQ_GET_DESCRIPTOR, 563 * USB_DEVREQ_GET_CONFIGURATION, 564 * USB_DEVREQ_CLEAR_FEATURE, 565 * USB_DEVREQ_SET_FEATURE, 566 * USB_DEVREQ_SET_ADDRESS, 567 * USB_DEVREQ_SET_DESCRIPTOR or 568 * USB_DEVREQ_SET_CONFIGURATION. 569 * 570 * @param instance root hub instance 571 * @param request structure containing both request and response information 572 * @return error code 573 */ 574 static int process_ctrl_request(rh_t *instance, usb_transfer_batch_t *request){ 575 int opResult; 576 if (request->setup_buffer) { 577 if(sizeof(usb_device_request_setup_packet_t)>request->setup_size){ 578 usb_log_error("setup packet too small\n"); 579 return EINVAL; 580 } 581 usb_log_info("CTRL packet: %s.\n", 582 usb_debug_str_buffer((const uint8_t *)request->setup_buffer, 8, 8)); 583 usb_device_request_setup_packet_t * setup_request = 584 (usb_device_request_setup_packet_t*)request->setup_buffer; 585 if( 586 setup_request->request == USB_DEVREQ_GET_STATUS 587 || setup_request->request == USB_DEVREQ_GET_DESCRIPTOR 588 || setup_request->request == USB_DEVREQ_GET_CONFIGURATION 589 ){ 590 usb_log_debug("processing request with output\n"); 591 opResult = process_request_with_output(instance,request); 592 }else if( 593 setup_request->request == USB_DEVREQ_CLEAR_FEATURE 594 || setup_request->request == USB_DEVREQ_SET_FEATURE 595 || setup_request->request == USB_DEVREQ_SET_ADDRESS 596 ){ 597 usb_log_debug("processing request without additional data\n"); 598 opResult = process_request_without_data(instance,request); 599 }else if(setup_request->request == USB_DEVREQ_SET_DESCRIPTOR 600 || setup_request->request == USB_DEVREQ_SET_CONFIGURATION 601 ){ 602 usb_log_debug("processing request with input\n"); 603 opResult = process_request_with_input(instance,request); 604 }else{ 605 usb_log_warning("received unsuported request: %d\n", 606 setup_request->request 607 ); 608 opResult = ENOTSUP; 609 } 610 }else{ 611 usb_log_error("root hub received empty transaction?"); 612 opResult = EINVAL; 613 } 614 return opResult; 615 } 616 617 /** 618 * process root hub request 619 * 620 * @param instance root hub instance 621 * @param request structure containing both request and response information 622 * @return error code 518 * @param instance 519 * @param request 520 * @return 623 521 */ 624 522 int rh_request(rh_t *instance, usb_transfer_batch_t *request) … … 628 526 int opResult; 629 527 if(request->transfer_type == USB_TRANSFER_CONTROL){ 630 usb_log_info("Root hub got CONTROL packet\n"); 631 opResult = process_ctrl_request(instance,request); 528 if (request->setup_buffer) { 529 usb_log_info("Root hub got CTRL packet: %s.\n", 530 usb_debug_str_buffer((const uint8_t *)request->setup_buffer, 8, 8)); 531 if(sizeof(usb_device_request_setup_packet_t)>request->setup_size){ 532 usb_log_error("setup packet too small\n"); 533 return EINVAL; 534 } 535 usb_device_request_setup_packet_t * setup_request = 536 (usb_device_request_setup_packet_t*)request->setup_buffer; 537 if( 538 setup_request->request == USB_DEVREQ_GET_STATUS 539 || setup_request->request == USB_DEVREQ_GET_DESCRIPTOR 540 || setup_request->request == USB_DEVREQ_GET_CONFIGURATION 541 ){ 542 usb_log_debug("processing request with output\n"); 543 opResult = process_request_with_output(instance,request); 544 }else if( 545 setup_request->request == USB_DEVREQ_CLEAR_FEATURE 546 || setup_request->request == USB_DEVREQ_SET_FEATURE 547 || setup_request->request == USB_DEVREQ_SET_ADDRESS 548 ){ 549 usb_log_debug("processing request without additional data\n"); 550 opResult = process_request_without_data(instance,request); 551 }else if(setup_request->request == USB_DEVREQ_SET_DESCRIPTOR 552 || setup_request->request == USB_DEVREQ_SET_CONFIGURATION 553 ){ 554 usb_log_debug("processing request with input\n"); 555 opResult = process_request_with_input(instance,request); 556 }else{ 557 usb_log_warning("received unsuported request: %d\n", 558 setup_request->request 559 ); 560 opResult = ENOTSUP; 561 } 562 }else{ 563 usb_log_error("root hub received empty transaction?"); 564 opResult = EINVAL; 565 } 632 566 }else if(request->transfer_type == USB_TRANSFER_INTERRUPT){ 633 567 usb_log_info("Root hub got INTERRUPT packet\n"); … … 648 582 void rh_interrupt(rh_t *instance) 649 583 { 650 usb_log_ info("Whoa whoa wait, I`m not supposed to receive any interrupts, am I?\n");651 /* TODO: implement ?*/584 usb_log_error("Root hub interrupt not implemented.\n"); 585 /* TODO: implement */ 652 586 } 653 587 /** -
uspace/drv/ohci/root_hub.h
rcd1e6b62 rd70765d 41 41 #include "batch.h" 42 42 43 /**44 * ohci root hub representation45 */46 43 typedef struct rh { 47 /** pointer to ohci driver registers */48 44 ohci_regs_t *registers; 49 /** usb address of the root hub */50 45 usb_address_t address; 51 /** ddf device information */52 46 ddf_dev_t *device; 53 /** hub port count */54 47 int port_count; 55 48 } rh_t; -
uspace/drv/pciintel/pci.c
rcd1e6b62 rd70765d 95 95 sysarg_t i8259; 96 96 97 int irc_phone = ENOTSUP; 98 99 if (((sysinfo_get_value("apic", &apic) == EOK) && (apic)) 100 || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) { 101 irc_phone = service_connect_blocking(SERVICE_IRC, 0, 0); 102 } 103 97 int irc_phone = -1; 98 int irc_service = -1; 99 100 if ((sysinfo_get_value("apic", &apic) == EOK) && (apic)) { 101 irc_service = SERVICE_APIC; 102 } else if ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259)) { 103 irc_service = SERVICE_I8259; 104 } 105 106 if (irc_service == -1) { 107 return false; 108 } 109 110 irc_phone = service_connect_blocking(irc_service, 0, 0); 104 111 if (irc_phone < 0) { 105 112 return false; -
uspace/drv/usbhub/port_status.h
rcd1e6b62 rd70765d 79 79 80 80 /** 81 * set the device request to be a port feature enable request82 * @param request83 * @param port84 * @param feature_selector85 */86 static inline void usb_hub_set_enable_port_feature_request(87 usb_device_request_setup_packet_t * request, uint16_t port,88 uint16_t feature_selector89 ){90 request->index = port;91 request->request_type = USB_HUB_REQ_TYPE_SET_PORT_FEATURE;92 request->request = USB_HUB_REQUEST_SET_FEATURE;93 request->value = feature_selector;94 request->length = 0;95 }96 97 98 /**99 81 * set the device request to be a port enable request 100 82 * @param request … … 209 191 request->length = 0; 210 192 } 211 212 193 213 194 /** get i`th bit of port status */ -
uspace/drv/usbhub/usbhub.c
rcd1e6b62 rd70765d 53 53 #include "usb/classes/classes.h" 54 54 55 56 static void usb_hub_init_add_device(usb_hub_info_t * hub, uint16_t port,57 usb_speed_t speed);58 59 static int usb_hub_trigger_connecting_non_removable_devices(60 usb_hub_info_t * hub, usb_hub_descriptor_t * descriptor);61 62 /**63 * control loop running in hub`s fibril64 *65 * Hub`s fibril periodically asks for changes on hub and if needded calls66 * change handling routine.67 * @warning currently hub driver asks for changes once a second68 * @param hub_info_param hub representation pointer69 * @return zero70 */71 55 int usb_hub_control_loop(void * hub_info_param){ 72 56 usb_hub_info_t * hub_info = (usb_hub_info_t*)hub_info_param; … … 107 91 108 92 /** 109 * Load hub-specific information into hub_info structure and process if needed93 * Load hub-specific information into hub_info structure. 110 94 * 111 95 * Particularly read port count and initialize structure holding port 112 * information. If there are non-removable devices, start initializing them.96 * information. 113 97 * This function is hub-specific and should be run only after the hub is 114 98 * configured using usb_hub_set_configuration function. 115 * @param hub_info hub representation99 * @param hub_info pointer to structure with usb hub data 116 100 * @return error code 117 101 */ 118 static int usb_hub_ process_hub_specific_info(usb_hub_info_t * hub_info){102 static int usb_hub_get_hub_specific_info(usb_hub_info_t * hub_info){ 119 103 // get hub descriptor 120 104 usb_log_debug("creating serialized descriptor\n"); … … 123 107 124 108 /* this was one fix of some bug, should not be needed anymore 125 * these lines allow to reset hub once more, it can be used as126 * brute-force initialization for non-removable devices127 109 int opResult = usb_request_set_configuration(&result->endpoints.control, 1); 128 110 if(opResult!=EOK){ … … 159 141 hub_info->attached_devs[i].address=0; 160 142 } 161 //handle non-removable devices162 usb_hub_trigger_connecting_non_removable_devices(hub_info, descriptor);163 143 usb_log_debug2("freeing data\n"); 164 144 free(serialized_descriptor); … … 172 152 * Check whether there is at least one configuration and sets the first one. 173 153 * This function should be run prior to running any hub-specific action. 174 * @param hub_info hub representation175 * @return error code154 * @param hub_info 155 * @return 176 156 */ 177 157 static int usb_hub_set_configuration(usb_hub_info_t * hub_info){ … … 238 218 } 239 219 //get port count and create attached_devs 240 opResult = usb_hub_ process_hub_specific_info(hub_info);220 opResult = usb_hub_get_hub_specific_info(hub_info); 241 221 if(opResult!=EOK){ 242 222 usb_log_error("could not set hub configuration, errno %d\n",opResult); … … 276 256 //********************************************* 277 257 // 278 // hub driver code, main loop and port handling258 // hub driver code, main loop 279 259 // 280 260 //********************************************* 281 282 /**283 * triggers actions to connect non0removable devices284 *285 * This will trigger operations leading to activated non-removable device.286 * Control pipe of the hub must be open fo communication.287 * @param hub hub representation288 * @param descriptor usb hub descriptor289 * @return error code290 */291 static int usb_hub_trigger_connecting_non_removable_devices(usb_hub_info_t * hub,292 usb_hub_descriptor_t * descriptor)293 {294 usb_log_info("attaching non-removable devices(if any)\n");295 usb_device_request_setup_packet_t request;296 int opResult;297 size_t rcvd_size;298 usb_port_status_t status;299 uint8_t * non_removable_dev_bitmap = descriptor->devices_removable;300 int port;301 for(port=1;port<=descriptor->ports_count;++port){302 bool is_non_removable =303 ((non_removable_dev_bitmap[port/8]) >> (port%8)) %2;304 if(is_non_removable){305 usb_log_debug("non-removable device on port %d\n",port);306 usb_hub_set_port_status_request(&request, port);307 opResult = usb_pipe_control_read(308 hub->control_pipe,309 &request, sizeof(usb_device_request_setup_packet_t),310 &status, 4, &rcvd_size311 );312 if (opResult != EOK) {313 usb_log_error("could not get port status of port %d errno:%d\n",314 port, opResult);315 return opResult;316 }317 //set the status change bit, so it will be noticed in driver loop318 if(usb_port_dev_connected(&status)){319 usb_hub_set_enable_port_feature_request(&request, port,320 USB_HUB_FEATURE_C_PORT_CONNECTION);321 opResult = usb_pipe_control_read(322 hub->control_pipe,323 &request, sizeof(usb_device_request_setup_packet_t),324 &status, 4, &rcvd_size325 );326 if (opResult != EOK) {327 usb_log_warning(328 "could not set port change on port %d errno:%d\n",329 port, opResult);330 }331 }332 }333 }334 return EOK;335 }336 337 261 338 262 /** … … 356 280 /** 357 281 * Reset the port with new device and reserve the default address. 358 * @param h ub hub representation359 * @param port port number, starting from 1360 * @param speed transfer speed of attached device, one of low, full or high282 * @param hc 283 * @param port 284 * @param target 361 285 */ 362 286 static void usb_hub_init_add_device(usb_hub_info_t * hub, uint16_t port, … … 391 315 if (opResult != EOK) { 392 316 usb_log_error("something went wrong when reseting a port %d\n",opResult); 317 //usb_hub_release_default_address(hc); 393 318 usb_hub_release_default_address(hub); 394 319 } … … 398 323 /** 399 324 * Finalize adding new device after port reset 400 * 401 * Set device`s address and start it`s driver. 402 * @param hub hub representation 403 * @param port port number, starting from 1 404 * @param speed transfer speed of attached device, one of low, full or high 325 * @param hc 326 * @param port 327 * @param target 405 328 */ 406 329 static void usb_hub_finalize_add_device( usb_hub_info_t * hub, … … 452 375 } 453 376 377 454 378 //opResult = usb_hub_release_default_address(hc); 455 379 opResult = usb_hub_release_default_address(hub); … … 486 410 487 411 /** 488 * routine called when a device on port has been removed 489 * 490 * If the device on port had default address, it releases default address. 491 * Otherwise does not do anything, because DDF does not allow to remove device 492 * from it`s device tree. 493 * @param hub hub representation 494 * @param port port number, starting from 1 412 * Unregister device address in hc 413 * @param hc 414 * @param port 415 * @param target 495 416 */ 496 417 static void usb_hub_removed_device( … … 531 452 * Turn off the power on the port. 532 453 * 533 * @param hub hub representation534 * @param port port number, starting from 1454 * @param hub 455 * @param port 535 456 */ 536 457 static void usb_hub_over_current( usb_hub_info_t * hub, … … 547 468 /** 548 469 * Process interrupts on given hub port 549 * 550 * Accepts connection, over current and port reset change. 551 * @param hub hub representation 552 * @param port port number, starting from 1 470 * @param hc 471 * @param port 472 * @param target 553 473 */ 554 474 static void usb_hub_process_interrupt(usb_hub_info_t * hub, … … 621 541 622 542 /** 623 * check changes on hub 624 * 625 * Handles changes on each port with a status change. 626 * @param hub_info hub representation 627 * @return error code 543 * Check changes on particular hub 544 * @param hub_info_param pointer to usb_hub_info_t structure 545 * @return error code if there is problem when initializing communication with 546 * hub, EOK otherwise 628 547 */ 629 548 int usb_hub_check_hub_changes(usb_hub_info_t * hub_info){ -
uspace/lib/c/include/ipc/services.h
rcd1e6b62 rd70765d 47 47 SERVICE_DEVMAP, 48 48 SERVICE_DEVMAN, 49 SERVICE_IRC, 49 SERVICE_FHC, 50 SERVICE_OBIO, 51 SERVICE_APIC, 52 SERVICE_I8259, 50 53 SERVICE_CLIPBOARD, 51 54 SERVICE_NETWORKING, -
uspace/lib/fs/libfs.c
rcd1e6b62 rd70765d 391 391 if (lflag & L_CREATE) 392 392 (void) ops->destroy(fn); 393 else394 (void) ops->node_put(fn);395 393 async_answer_0(rid, rc); 396 394 } else { … … 475 473 if (lflag & L_CREATE) 476 474 (void) ops->destroy(fn); 477 else478 (void) ops->node_put(fn);479 475 async_answer_0(rid, rc); 480 476 } else { -
uspace/srv/hid/kbd/Makefile
rcd1e6b62 rd70765d 78 78 SOURCES += \ 79 79 port/pl050.c \ 80 ctl/p c.c80 ctl/pl050.c 81 81 endif 82 82 endif -
uspace/srv/hid/kbd/generic/kbd.c
rcd1e6b62 rd70765d 67 67 static unsigned lock_keys; 68 68 69 bool irc_service = false;70 int irc_phone = -1;69 int cir_service = 0; 70 int cir_phone = -1; 71 71 72 72 #define NUM_LAYOUTS 3 … … 216 216 sysarg_t obio; 217 217 218 if (((sysinfo_get_value("kbd.cir.fhc", &fhc) == EOK) && (fhc)) 219 || ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio))) 220 irc_service = true; 221 222 if (irc_service) { 223 while (irc_phone < 0) 224 irc_phone = service_connect_blocking(SERVICE_IRC, 0, 0); 218 if ((sysinfo_get_value("kbd.cir.fhc", &fhc) == EOK) && (fhc)) 219 cir_service = SERVICE_FHC; 220 else if ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio)) 221 cir_service = SERVICE_OBIO; 222 223 if (cir_service) { 224 while (cir_phone < 0) 225 cir_phone = service_connect_blocking(cir_service, 0, 0); 225 226 } 226 227 -
uspace/srv/hid/kbd/include/kbd.h
rcd1e6b62 rd70765d 38 38 #define KBD_KBD_H_ 39 39 40 #include <bool.h> 41 42 extern bool irc_service; 43 extern int irc_phone; 40 extern int cir_service; 41 extern int cir_phone; 44 42 45 43 extern void kbd_push_scancode(int); -
uspace/srv/hid/kbd/port/ns16550.c
rcd1e6b62 rd70765d 120 120 kbd_push_scancode(scan_code); 121 121 122 if ( irc_service)123 async_msg_1( irc_phone, IRC_CLEAR_INTERRUPT,122 if (cir_service) 123 async_msg_1(cir_phone, IRC_CLEAR_INTERRUPT, 124 124 IPC_GET_IMETHOD(*call)); 125 125 } -
uspace/srv/hid/kbd/port/z8530.c
rcd1e6b62 rd70765d 108 108 kbd_push_scancode(scan_code); 109 109 110 if ( irc_service)111 async_msg_1( irc_phone, IRC_CLEAR_INTERRUPT,110 if (cir_service) 111 async_msg_1(cir_phone, IRC_CLEAR_INTERRUPT, 112 112 IPC_GET_IMETHOD(*call)); 113 113 } -
uspace/srv/hw/irc/apic/apic.c
rcd1e6b62 rd70765d 54 54 #define NAME "apic" 55 55 56 static bool apic_found = false; 57 56 58 static int apic_enable_irq(sysarg_t irq) 57 59 { … … 79 81 callid = async_get_call(&call); 80 82 81 switch (IPC_GET_IMETHOD(call)) { 83 sysarg_t method = IPC_GET_IMETHOD(call); 84 if (method == IPC_M_PHONE_HUNGUP) { 85 return; 86 } 87 88 if (!apic_found) { 89 async_answer_0(callid, ENOTSUP); 90 break; 91 } 92 93 switch (method) { 82 94 case IRC_ENABLE_INTERRUPT: 83 95 async_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call))); … … 97 109 * 98 110 */ 99 static boolapic_init(void)111 static void apic_init(void) 100 112 { 101 113 sysarg_t apic; 102 114 103 if ((sysinfo_get_value("apic", &apic) != EOK) || (!apic)) {104 printf(NAME ": No APIC found\n");105 return false;115 apic_found = sysinfo_get_value("apic", &apic) && apic; 116 if (!apic_found) { 117 printf(NAME ": Warning: no APIC found\n"); 106 118 } 107 119 108 120 async_set_client_connection(apic_connection); 109 service_register(SERVICE_IRC); 110 111 return true; 121 service_register(SERVICE_APIC); 112 122 } 113 123 … … 116 126 printf(NAME ": HelenOS APIC driver\n"); 117 127 118 if (!apic_init()) 119 return -1; 120 128 apic_init(); 129 121 130 printf(NAME ": Accepting connections\n"); 122 131 async_manager(); -
uspace/srv/hw/irc/fhc/fhc.c
rcd1e6b62 rd70765d 136 136 137 137 async_set_client_connection(fhc_connection); 138 service_register(SERVICE_ IRC);138 service_register(SERVICE_FHC); 139 139 140 140 return true; -
uspace/srv/hw/irc/i8259/i8259.c
rcd1e6b62 rd70765d 149 149 150 150 async_set_client_connection(i8259_connection); 151 service_register(SERVICE_I RC);151 service_register(SERVICE_I8259); 152 152 153 153 return true; -
uspace/srv/hw/irc/obio/obio.c
rcd1e6b62 rd70765d 137 137 138 138 async_set_client_connection(obio_connection); 139 service_register(SERVICE_ IRC);139 service_register(SERVICE_OBIO); 140 140 141 141 return true; -
uspace/srv/hw/netif/ne2000/ne2000.c
rcd1e6b62 rd70765d 75 75 #define IRQ_GET_TSR(call) ((int) IPC_GET_ARG3(call)) 76 76 77 static bool irc_service = false;77 static int irc_service = 0; 78 78 static int irc_phone = -1; 79 79 … … 383 383 sysarg_t i8259; 384 384 385 if (((sysinfo_get_value("apic", &apic) == EOK) && (apic)) 386 || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) 387 irc_service = true; 385 if ((sysinfo_get_value("apic", &apic) == EOK) && (apic)) 386 irc_service = SERVICE_APIC; 387 else if ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259)) 388 irc_service = SERVICE_I8259; 388 389 389 390 if (irc_service) { 390 391 while (irc_phone < 0) 391 irc_phone = service_connect_blocking( SERVICE_IRC, 0, 0);392 irc_phone = service_connect_blocking(irc_service, 0, 0); 392 393 } 393 394 -
uspace/srv/net/net/net.c
rcd1e6b62 rd70765d 289 289 if (rc != EOK) 290 290 return rc; 291 292 291 rc = add_module(NULL, &net_globals.modules, (uint8_t *) NE2000_NAME, 293 292 (uint8_t *) NE2000_FILENAME, SERVICE_NE2000, 0, connect_to_service); 294 293 if (rc != EOK) 295 294 return rc; 296 297 295 rc = add_module(NULL, &net_globals.modules, (uint8_t *) ETHERNET_NAME, 298 296 (uint8_t *) ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service); 299 297 if (rc != EOK) 300 298 return rc; 301 302 299 rc = add_module(NULL, &net_globals.modules, (uint8_t *) NILDUMMY_NAME, 303 300 (uint8_t *) NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service); … … 593 590 rc = start_device(netif); 594 591 if (rc != EOK) { 595 printf("%s: Ignoring failedinterface %s (%s)\n", NAME,592 printf("%s: Error starting interface %s (%s)\n", NAME, 596 593 netif->name, str_error(rc)); 597 594 measured_strings_destroy(&netif->configuration); 598 595 netifs_exclude_index(&net_globals.netifs, index); 599 continue; 596 597 return rc; 600 598 } 601 599 -
uspace/srv/vfs/vfs_ops.c
rcd1e6b62 rd70765d 1234 1234 if (!parentc) { 1235 1235 fibril_rwlock_write_unlock(&namespace_rwlock); 1236 vfs_node_put(old_node);1237 1236 async_answer_0(rid, rc); 1238 1237 free(old); … … 1252 1251 if (rc != EOK) { 1253 1252 fibril_rwlock_write_unlock(&namespace_rwlock); 1254 vfs_node_put(old_node);1255 1253 async_answer_0(rid, rc); 1256 1254 free(old); … … 1263 1261 (old_node->devmap_handle != new_par_lr.triplet.devmap_handle)) { 1264 1262 fibril_rwlock_write_unlock(&namespace_rwlock); 1265 vfs_node_put(old_node);1266 1263 async_answer_0(rid, EXDEV); /* different file systems */ 1267 1264 free(old); … … 1282 1279 if (!new_node) { 1283 1280 fibril_rwlock_write_unlock(&namespace_rwlock); 1284 vfs_node_put(old_node);1285 1281 async_answer_0(rid, ENOMEM); 1286 1282 free(old); … … 1294 1290 default: 1295 1291 fibril_rwlock_write_unlock(&namespace_rwlock); 1296 vfs_node_put(old_node);1297 1292 async_answer_0(rid, ENOTEMPTY); 1298 1293 free(old); … … 1305 1300 if (rc != EOK) { 1306 1301 fibril_rwlock_write_unlock(&namespace_rwlock); 1307 vfs_node_put(old_node);1308 1302 if (new_node) 1309 1303 vfs_node_put(new_node); -
version
rcd1e6b62 rd70765d 37 37 VERSION = 0 38 38 PATCHLEVEL = 4 39 SUBLEVEL = 339 SUBLEVEL = 2 40 40 41 41 ifdef EXTRAVERSION … … 45 45 endif 46 46 47 NAME = S ashimi47 NAME = Skewer
Note:
See TracChangeset
for help on using the changeset viewer.