Changeset 5fe1c32 in mainline
- Timestamp:
- 2010-04-21T22:01:54Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f928a8a
- Parents:
- 5dc9622
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/amd64/Makefile.inc
r5dc9622 r5fe1c32 40 40 rootia32 \ 41 41 pciintel \ 42 isa 42 isa \ 43 serial 43 44 44 45 RD_DRV_CONF = \ -
uspace/Makefile
r5dc9622 r5fe1c32 80 80 DIRS += srv/drivers/pciintel 81 81 DIRS += srv/drivers/isa 82 DIRS += srv/drivers/serial 82 83 # DIRS += srv/hw/bus/pci 83 84 endif -
uspace/srv/drivers/isa/isa.c
r5dc9622 r5fe1c32 312 312 char *end = val; 313 313 314 while ( isspace(*end)) {314 while (!isspace(*end)) { 315 315 end++; 316 316 } … … 330 330 val = skip_spaces(val); 331 331 332 score = (int)strtol(val, &end, 0x10);332 score = (int)strtol(val, &end, 10); 333 333 if (val == end) { 334 printf(NAME " : error - could not read match score for device %s.\n", dev->name); 334 335 return; 335 336 } … … 337 338 match_id_t *match_id = create_match_id(); 338 339 if (NULL == match_id) { 340 printf(NAME " : failed to allocate match id for device %s.\n", dev->name); 339 341 return; 340 342 } … … 343 345 get_match_id(&id, val); 344 346 if (NULL == id) { 347 printf(NAME " : error - could not read match id for device %s.\n", dev->name); 345 348 delete_match_id(match_id); 346 349 return; … … 350 353 match_id->score = score; 351 354 355 printf(NAME ": adding match id %s with score %d to device %s\n", id, score, dev->name); 352 356 add_match_id(&dev->match_ids, match_id); 353 357 } 354 358 359 static bool read_dev_prop( 360 device_t *dev, char *line, const char *prop, void (* read_fn)(device_t *, char *)) 361 { 362 size_t proplen = str_size(prop); 363 if (0 == str_lcmp(line, prop, proplen)) { 364 line += proplen; 365 line = skip_spaces(line); 366 (*read_fn)(dev, line); 367 return true; 368 } 369 return false; 370 } 371 355 372 static void get_dev_prop(device_t *dev, char *line) 356 373 { 374 printf(NAME " get_dev_prop from line '%s'\n", line); 357 375 // skip leading spaces 358 376 line = skip_spaces(line); 359 377 360 // value of the property 361 char *val; 362 363 if (NULL != (val = strtok(line, "io_range"))) { 364 get_dev_io_range(dev, val); 365 } else if (NULL != (val = strtok(line, "irq"))) { 366 get_dev_irq(dev, val); 367 } else if (NULL != (val = strtok(line, "match"))) { 368 get_dev_match_id(dev, val); 378 if (!read_dev_prop(dev, line, "io_range", &get_dev_io_range) && 379 !read_dev_prop(dev, line, "irq", &get_dev_irq) && 380 !read_dev_prop(dev, line, "match", &get_dev_match_id) 381 ) { 382 printf(NAME " error undefined device property at line %s\n", line); 369 383 } 370 384 } … … 397 411 } 398 412 413 printf(NAME ": next line ='%s'\n", dev_conf); 414 printf(NAME ": current line ='%s'\n", line); 415 399 416 // get device name 400 417 dev_name = get_device_name(line); … … 424 441 // get the device's property from the configuration line and store it in the device structure 425 442 get_dev_prop(dev, line); 443 444 printf(NAME ": next line ='%s'\n", dev_conf); 445 printf(NAME ": current line ='%s'\n", line); 426 446 } 427 447 … … 429 449 dev->class = &isa_child_class; 430 450 431 child_device_register(dev, parent); 451 child_device_register(dev, parent); 432 452 433 453 return dev_conf; … … 456 476 // add child devices 457 477 add_legacy_children(dev); 478 printf(NAME ": finished the enumeration of legacy devices\n", dev->handle); 458 479 459 480 return true;
Note:
See TracChangeset
for help on using the changeset viewer.