Changes in / [73aec008:917a8c8] in mainline
- Files:
-
- 4 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r73aec008 r917a8c8 528 528 ! [PLATFORM=sparc64&MACHINE=generic] CONFIG_AOUT_ISOFS_B (y) 529 529 530 % Run devman on startup531 ! CONFIG_START_DEVMAN (y/n)532 533 % Launch (devman) test drivers534 ! [CONFIG_START_DEVMAN=y&CONFIG_DEBUG=y] CONFIG_TEST_DRIVERS (y/n)535 536 530 % Load disk drivers on startup 537 531 ! CONFIG_START_BD (n/y) … … 554 548 % Line debugging information 555 549 ! [CONFIG_STRIP_BINARIES!=y] CONFIG_LINE_DEBUG (n/y) 550 551 % Launch (devman) test drivers 552 ! [CONFIG_DEBUG=y] CONFIG_TEST_DRIVERS (y/n) 553 -
uspace/app/init/init.c
r73aec008 r917a8c8 272 272 mount_tmpfs(); 273 273 274 #ifdef CONFIG_START_DEVMAN275 spawn("/srv/devman");276 #endif277 274 spawn("/srv/apic"); 278 275 spawn("/srv/i8259"); -
uspace/drv/isa/isa.c
r73aec008 r917a8c8 53 53 54 54 #include <ddf/driver.h> 55 #include <ddf/log.h>56 55 #include <ops/hw_res.h> 57 56 … … 135 134 fd = open(conf_path, O_RDONLY); 136 135 if (fd < 0) { 137 ddf_msg(LVL_ERROR, "Unable to open %s\n", conf_path);136 printf(NAME ": unable to open %s\n", conf_path); 138 137 goto cleanup; 139 138 } … … 142 141 143 142 len = lseek(fd, 0, SEEK_END); 144 lseek(fd, 0, SEEK_SET); 143 lseek(fd, 0, SEEK_SET); 145 144 if (len == 0) { 146 ddf_msg(LVL_ERROR, "Configuration file '%s' is empty.\n",147 conf_path);145 printf(NAME ": fun_conf_read error: configuration file '%s' " 146 "is empty.\n", conf_path); 148 147 goto cleanup; 149 148 } … … 151 150 buf = malloc(len + 1); 152 151 if (buf == NULL) { 153 ddf_msg(LVL_ERROR, "Memory allocation failed.\n");152 printf(NAME ": fun_conf_read error: memory allocation failed.\n"); 154 153 goto cleanup; 155 154 } 156 155 157 156 if (0 >= read(fd, buf, len)) { 158 ddf_msg(LVL_ERROR, "Unable to read file '%s'.\n", conf_path); 157 printf(NAME ": fun_conf_read error: unable to read file '%s'.\n", 158 conf_path); 159 159 goto cleanup; 160 160 } … … 252 252 fun->hw_resources.count++; 253 253 254 ddf_msg(LVL_NOTE, "Added irq 0x%x to function %s\n", irq,254 printf(NAME ": added irq 0x%x to function %s\n", irq, 255 255 fun->fnode->name); 256 256 } … … 270 270 fun->hw_resources.count++; 271 271 272 ddf_msg(LVL_NOTE, "Added io range (addr=0x%x, size=0x%x) to "272 printf(NAME ": added io range (addr=0x%x, size=0x%x) to " 273 273 "function %s\n", (unsigned int) addr, (unsigned int) len, 274 274 fun->fnode->name); … … 331 331 score = (int)strtol(val, &end, 10); 332 332 if (val == end) { 333 ddf_msg(LVL_ERROR, "Cannot read match score for function"334 " %s.\n", fun->fnode->name);333 printf(NAME " : error - could not read match score for " 334 "function %s.\n", fun->fnode->name); 335 335 return; 336 336 } … … 339 339 get_match_id(&id, val); 340 340 if (id == NULL) { 341 ddf_msg(LVL_ERROR, "Cannot read match ID for function %s.\n",342 fun->fnode->name);341 printf(NAME " : error - could not read match id for " 342 "function %s.\n", fun->fnode->name); 343 343 return; 344 344 } 345 345 346 ddf_msg(LVL_DEBUG, "Adding match id '%s' with score %d to "347 "function %s\n", id,score, fun->fnode->name);346 printf(NAME ": adding match id '%s' with score %d to function %s\n", id, 347 score, fun->fnode->name); 348 348 349 349 rc = ddf_fun_add_match_id(fun->fnode, id, score); 350 if (rc != EOK) { 351 ddf_msg(LVL_ERROR, "Failed adding match ID: %s\n", 352 str_error(rc)); 353 } 350 if (rc != EOK) 351 printf(NAME ": error adding match ID: %s\n", str_error(rc)); 354 352 } 355 353 … … 377 375 if (!prop_parse(fun, line, "io_range", &fun_parse_io_range) && 378 376 !prop_parse(fun, line, "irq", &fun_parse_irq) && 379 !prop_parse(fun, line, "match", &fun_parse_match_id)) {380 381 ddf_msg(LVL_ERROR, "Undefined device property at line '%s'\n",382 377 !prop_parse(fun, line, "match", &fun_parse_match_id)) 378 { 379 printf(NAME " error undefined device property at line '%s'\n", 380 line); 383 381 } 384 382 } … … 441 439 fun->fnode->ops = &isa_fun_ops; 442 440 443 ddf_msg(LVL_DEBUG, "Binding function %s.\n", fun->fnode->name);441 printf(NAME ": Binding function %s.\n", fun->fnode->name); 444 442 445 443 /* XXX Handle error */ … … 469 467 static int isa_add_device(ddf_dev_t *dev) 470 468 { 471 ddf_msg(LVL_DEBUG, "isa_add_device, device handle = %d\n",469 printf(NAME ": isa_add_device, device handle = %d\n", 472 470 (int) dev->handle); 473 471 474 472 /* Make the bus device more visible. Does not do anything. */ 475 ddf_msg(LVL_DEBUG, "Adding a 'ctl' function\n");473 printf(NAME ": adding a 'ctl' function\n"); 476 474 477 475 ddf_fun_t *ctl = ddf_fun_create(dev, fun_exposed, "ctl"); 478 476 if (ctl == NULL) { 479 ddf_msg(LVL_ERROR, "Failedcreating control function.\n");477 printf(NAME ": Error creating control function.\n"); 480 478 return EXDEV; 481 479 } 482 480 483 481 if (ddf_fun_bind(ctl) != EOK) { 484 ddf_msg(LVL_ERROR, "Failedbinding control function.\n");482 printf(NAME ": Error binding control function.\n"); 485 483 return EXDEV; 486 484 } … … 488 486 /* Add functions as specified in the configuration file. */ 489 487 isa_functions_add(dev); 490 ddf_msg(LVL_NOTE, "Finished enumeratinglegacy functions\n");488 printf(NAME ": finished the enumeration of legacy functions\n"); 491 489 492 490 return EOK; … … 495 493 static void isa_init() 496 494 { 497 ddf_log_init(NAME, LVL_ERROR);498 495 isa_fun_ops.interfaces[HW_RES_DEV_IFACE] = &isa_fun_hw_res_ops; 499 496 } -
uspace/drv/ns8250/ns8250.c
r73aec008 r917a8c8 55 55 #include <ddf/driver.h> 56 56 #include <ddf/interrupt.h> 57 #include <ddf/log.h>58 57 #include <ops/char_dev.h> 59 58 … … 276 275 static bool ns8250_pio_enable(ns8250_t *ns) 277 276 { 278 ddf_msg(LVL_DEBUG, "ns8250_pio_enable %s\n", ns->dev->name);277 printf(NAME ": ns8250_pio_enable %s\n", ns->dev->name); 279 278 280 279 /* Gain control over port's registers. */ 281 280 if (pio_enable((void *)(uintptr_t) ns->io_addr, REG_COUNT, 282 281 (void **) &ns->port)) { 283 ddf_msg(LVL_ERROR, "Cannot map the port %#" PRIx32284 " for device%s.\n", ns->io_addr, ns->dev->name);282 printf(NAME ": error - cannot gain the port %#" PRIx32 " for device " 283 "%s.\n", ns->io_addr, ns->dev->name); 285 284 return false; 286 285 } … … 296 295 static bool ns8250_dev_probe(ns8250_t *ns) 297 296 { 298 ddf_msg(LVL_DEBUG, "ns8250_dev_probe %s\n", ns->dev->name);297 printf(NAME ": ns8250_dev_probe %s\n", ns->dev->name); 299 298 300 299 ioport8_t *port_addr = ns->port; … … 314 313 pio_write_8(port_addr + 4, olddata); 315 314 316 if (!res) { 317 ddf_msg(LVL_DEBUG, "Device %s is not present.\n", 318 ns->dev->name); 319 } 315 if (!res) 316 printf(NAME ": device %s is not present.\n", ns->dev->name); 320 317 321 318 return res; … … 329 326 static int ns8250_dev_initialize(ns8250_t *ns) 330 327 { 331 ddf_msg(LVL_DEBUG, "ns8250_dev_initialize %s\n", ns->dev->name);328 printf(NAME ": ns8250_dev_initialize %s\n", ns->dev->name); 332 329 333 330 int ret = EOK; … … 340 337 IPC_FLAG_BLOCKING); 341 338 if (ns->dev->parent_phone < 0) { 342 ddf_msg(LVL_ERROR, "Failed to connect to parent driver of"339 printf(NAME ": failed to connect to the parent driver of the " 343 340 "device %s.\n", ns->dev->name); 344 341 ret = ns->dev->parent_phone; … … 349 346 ret = hw_res_get_resource_list(ns->dev->parent_phone, &hw_resources); 350 347 if (ret != EOK) { 351 ddf_msg(LVL_ERROR, "Failed to get HW resources fordevice "348 printf(NAME ": failed to get hw resources for the device " 352 349 "%s.\n", ns->dev->name); 353 350 goto failed; … … 365 362 ns->irq = res->res.interrupt.irq; 366 363 irq = true; 367 ddf_msg(LVL_NOTE, "Device %swas asigned irq = 0x%x.\n",364 printf(NAME ": the %s device was asigned irq = 0x%x.\n", 368 365 ns->dev->name, ns->irq); 369 366 break; … … 372 369 ns->io_addr = res->res.io_range.address; 373 370 if (res->res.io_range.size < REG_COUNT) { 374 ddf_msg(LVL_ERROR, "I/O range assigned to"375 " device%s is too small.\n", ns->dev->name);371 printf(NAME ": i/o range assigned to the device " 372 "%s is too small.\n", ns->dev->name); 376 373 ret = ELIMIT; 377 374 goto failed; 378 375 } 379 376 ioport = true; 380 ddf_msg(LVL_NOTE, "Device %s was asigned I/Oaddress = "377 printf(NAME ": the %s device was asigned i/o address = " 381 378 "0x%x.\n", ns->dev->name, ns->io_addr); 382 379 break; … … 388 385 389 386 if (!irq || !ioport) { 390 ddf_msg(LVL_ERROR, "Missing HW resource(s) fordevice %s.\n",387 printf(NAME ": missing hw resource(s) for the device %s.\n", 391 388 ns->dev->name); 392 389 ret = ENOENT; … … 473 470 474 471 if (baud_rate < 50 || MAX_BAUD_RATE % baud_rate != 0) { 475 ddf_msg(LVL_ERROR, "Invalid baud rate %d requested.\n",476 baud_rate);472 printf(NAME ": error - somebody tried to set invalid baud rate " 473 "%d\n", baud_rate); 477 474 return EINVAL; 478 475 } … … 657 654 if (ns->client_connected) { 658 655 if (!buf_push_back(&ns->input_buffer, val)) { 659 ddf_msg(LVL_WARN, "Buffer overflow on "656 printf(NAME ": buffer overflow on " 660 657 "%s.\n", ns->dev->name); 661 658 } else { 662 ddf_msg(LVL_DEBUG2, "Character %c saved "659 printf(NAME ": the character %c saved " 663 660 "to the buffer of %s.\n", 664 661 val, ns->dev->name); … … 717 714 int rc; 718 715 719 ddf_msg(LVL_DEBUG, "ns8250_add_device %s (handle = %d)\n",716 printf(NAME ": ns8250_add_device %s (handle = %d)\n", 720 717 dev->name, (int) dev->handle); 721 718 … … 752 749 /* Register interrupt handler. */ 753 750 if (ns8250_register_interrupt_handler(ns) != EOK) { 754 ddf_msg(LVL_ERROR, "Failed to register interrupt handler.\n");751 printf(NAME ": failed to register interrupt handler.\n"); 755 752 rc = EADDRNOTAVAIL; 756 753 goto fail; … … 760 757 rc = ns8250_interrupt_enable(ns); 761 758 if (rc != EOK) { 762 ddf_msg(LVL_ERROR, "Failed to enable the interrupt. Error code = "759 printf(NAME ": failed to enable the interrupt. Error code = " 763 760 "%d.\n", rc); 764 761 goto fail; … … 767 764 fun = ddf_fun_create(dev, fun_exposed, "a"); 768 765 if (fun == NULL) { 769 ddf_msg(LVL_ERROR, "Failedcreating function.\n");766 printf(NAME ": error creating function.\n"); 770 767 goto fail; 771 768 } … … 775 772 rc = ddf_fun_bind(fun); 776 773 if (rc != EOK) { 777 ddf_msg(LVL_ERROR, "Failedbinding function.\n");774 printf(NAME ": error binding function.\n"); 778 775 goto fail; 779 776 } … … 783 780 ddf_fun_add_to_class(fun, "serial"); 784 781 785 ddf_msg(LVL_NOTE, "Device %ssuccessfully initialized.\n",782 printf(NAME ": the %s device has been successfully initialized.\n", 786 783 dev->name); 787 784 … … 865 862 fibril_mutex_unlock(&data->mutex); 866 863 867 ddf_msg(LVL_DEBUG, "ns8250_get_props: baud rate %d, parity 0x%x, word "864 printf(NAME ": ns8250_get_props: baud rate %d, parity 0x%x, word " 868 865 "length %d, stop bits %d\n", *baud_rate, *parity, *word_length, 869 866 *stop_bits); … … 882 879 unsigned int parity, unsigned int word_length, unsigned int stop_bits) 883 880 { 884 ddf_msg(LVL_DEBUG, "ns8250_set_props: baud rate %d, parity 0x%x, word "881 printf(NAME ": ns8250_set_props: baud rate %d, parity 0x%x, word " 885 882 "length %d, stop bits %d\n", baud_rate, parity, word_length, 886 883 stop_bits); … … 943 940 static void ns8250_init(void) 944 941 { 945 ddf_log_init(NAME, LVL_ERROR);946 947 942 ns8250_dev_ops.open = &ns8250_open; 948 943 ns8250_dev_ops.close = &ns8250_close; -
uspace/drv/pciintel/pci.c
r73aec008 r917a8c8 48 48 49 49 #include <ddf/driver.h> 50 #include <ddf/log.h>51 50 #include <devman.h> 52 51 #include <ipc/devman.h> … … 226 225 227 226 if (match_id_str == NULL) { 228 ddf_msg(LVL_ERROR, "Out of memory creating match ID.\n");227 printf(NAME ": out of memory creating match ID.\n"); 229 228 return; 230 229 } … … 232 231 rc = ddf_fun_add_match_id(fun->fnode, match_id_str, 90); 233 232 if (rc != EOK) { 234 ddf_msg(LVL_ERROR, "Failedadding match ID: %s\n",233 printf(NAME ": error adding match ID: %s\n", 235 234 str_error(rc)); 236 235 } … … 324 323 325 324 if (range_addr != 0) { 326 ddf_msg(LVL_DEBUG, "Function %s : address = %" PRIx64327 ", size = %x\n", fun->fnode->name, range_addr,328 325 printf(NAME ": function %s : ", fun->fnode->name); 326 printf("address = %" PRIx64, range_addr); 327 printf(", size = %x\n", (unsigned int) range_size); 329 328 } 330 329 … … 351 350 hw_res_list->count++; 352 351 353 ddf_msg(LVL_NOTE, "Function %s uses irq %x.\n", fun->fnode->name, irq);352 printf(NAME ": function %s uses irq %x.\n", fun->fnode->name, irq); 354 353 } 355 354 … … 407 406 char *fun_name = pci_fun_create_name(fun); 408 407 if (fun_name == NULL) { 409 ddf_msg(LVL_ERROR, "Out of memory.\n");408 printf(NAME ": out of memory.\n"); 410 409 return; 411 410 } … … 413 412 fnode = ddf_fun_create(bus->dnode, fun_inner, fun_name); 414 413 if (fnode == NULL) { 415 ddf_msg(LVL_ERROR, "Failedcreating function.\n");414 printf(NAME ": error creating function.\n"); 416 415 return; 417 416 } … … 427 426 fnode->driver_data = fun; 428 427 429 ddf_msg(LVL_DEBUG, "Adding new function %s.\n",428 printf(NAME ": adding new function %s.\n", 430 429 fnode->name); 431 430 … … 444 443 child_bus = pci_conf_read_8(fun, 445 444 PCI_BRIDGE_SEC_BUS_NUM); 446 ddf_msg(LVL_DEBUG, "Device is pci-to-pci " 447 "bridge, secondary bus number = %d.\n", 448 bus_num); 445 printf(NAME ": device is pci-to-pci bridge, " 446 "secondary bus number = %d.\n", bus_num); 449 447 if (child_bus > bus_num) 450 448 pci_bus_scan(bus, child_bus); … … 468 466 int rc; 469 467 470 ddf_msg(LVL_DEBUG, "pci_add_device\n");468 printf(NAME ": pci_add_device\n"); 471 469 dnode->parent_phone = -1; 472 470 473 471 bus = pci_bus_new(); 474 472 if (bus == NULL) { 475 ddf_msg(LVL_ERROR, "pci_add_device allocation failed.\n");473 printf(NAME ": pci_add_device allocation failed.\n"); 476 474 rc = ENOMEM; 477 475 goto fail; … … 483 481 IPC_FLAG_BLOCKING); 484 482 if (dnode->parent_phone < 0) { 485 ddf_msg(LVL_ERROR, "pci_add_device failed to connect to the "483 printf(NAME ": pci_add_device failed to connect to the " 486 484 "parent's driver.\n"); 487 485 rc = dnode->parent_phone; … … 493 491 rc = hw_res_get_resource_list(dnode->parent_phone, &hw_resources); 494 492 if (rc != EOK) { 495 ddf_msg(LVL_ERROR, "pci_add_device failed to get hw resources"496 " forthe device.\n");493 printf(NAME ": pci_add_device failed to get hw resources for " 494 "the device.\n"); 497 495 goto fail; 498 496 } 499 497 got_res = true; 500 498 501 ddf_msg(LVL_DEBUG, "conf_addr = %" PRIx64 ".\n",499 printf(NAME ": conf_addr = %" PRIx64 ".\n", 502 500 hw_resources.resources[0].res.io_range.address); 503 501 … … 511 509 if (pio_enable((void *)(uintptr_t)bus->conf_io_addr, 8, 512 510 &bus->conf_addr_port)) { 513 ddf_msg(LVL_ERROR, "Failed to enable configuration ports.\n");511 printf(NAME ": failed to enable configuration ports.\n"); 514 512 rc = EADDRNOTAVAIL; 515 513 goto fail; … … 518 516 519 517 /* Make the bus device more visible. It has no use yet. */ 520 ddf_msg(LVL_DEBUG, "Adding a 'ctl' function\n");518 printf(NAME ": adding a 'ctl' function\n"); 521 519 522 520 ctl = ddf_fun_create(bus->dnode, fun_exposed, "ctl"); … … 534 532 535 533 /* Enumerate functions. */ 536 ddf_msg(LVL_DEBUG, "Scanning the bus\n");534 printf(NAME ": scanning the bus\n"); 537 535 pci_bus_scan(bus, 0); 538 536 … … 556 554 static void pciintel_init(void) 557 555 { 558 ddf_log_init(NAME, LVL_ERROR);559 556 pci_fun_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_hw_res_ops; 560 557 } -
uspace/drv/root/root.c
r73aec008 r917a8c8 52 52 53 53 #include <ddf/driver.h> 54 #include <ddf/log.h>55 54 #include <devman.h> 56 55 #include <ipc/devman.h> … … 90 89 int rc; 91 90 92 ddf_msg(LVL_DEBUG, "Adding new function for virtual devices. "93 "Function node is `%s' (%d %s)\n", name,91 printf(NAME ": adding new function for virtual devices.\n"); 92 printf(NAME ": function node is `%s' (%d %s)\n", name, 94 93 VIRTUAL_FUN_MATCH_SCORE, VIRTUAL_FUN_MATCH_ID); 95 94 96 95 fun = ddf_fun_create(dev, fun_inner, name); 97 96 if (fun == NULL) { 98 ddf_msg(LVL_ERROR, "Failedcreating function %s\n", name);97 printf(NAME ": error creating function %s\n", name); 99 98 return ENOMEM; 100 99 } … … 103 102 VIRTUAL_FUN_MATCH_SCORE); 104 103 if (rc != EOK) { 105 ddf_msg(LVL_ERROR, "Failedadding match IDs to function %s\n", name);104 printf(NAME ": error adding match IDs to function %s\n", name); 106 105 ddf_fun_destroy(fun); 107 106 return rc; … … 110 109 rc = ddf_fun_bind(fun); 111 110 if (rc != EOK) { 112 ddf_msg(LVL_ERROR, "Failedbinding function %s: %s\n", name,111 printf(NAME ": error binding function %s: %s\n", name, 113 112 str_error(rc)); 114 113 ddf_fun_destroy(fun); … … 137 136 platform = sysinfo_get_data("platform", &platform_size); 138 137 if (platform == NULL) { 139 ddf_msg(LVL_ERROR, "Failed to obtain platform name.\n");138 printf(NAME ": Failed to obtain platform name.\n"); 140 139 return ENOENT; 141 140 } … … 144 143 platform = realloc(platform, platform_size + 1); 145 144 if (platform == NULL) { 146 ddf_msg(LVL_ERROR, "Memory allocation failed.\n");145 printf(NAME ": Memory allocation failed.\n"); 147 146 return ENOMEM; 148 147 } … … 152 151 /* Construct match ID. */ 153 152 if (asprintf(&match_id, PLATFORM_FUN_MATCH_ID_FMT, platform) == -1) { 154 ddf_msg(LVL_ERROR, "Memory allocation failed.\n");153 printf(NAME ": Memory allocation failed.\n"); 155 154 return ENOMEM; 156 155 } 157 156 158 157 /* Add function. */ 159 ddf_msg(LVL_DEBUG, "Adding platform function. Function node is `%s' "160 " (%d %s)\n", PLATFORM_FUN_NAME, PLATFORM_FUN_MATCH_SCORE,161 match_id);158 printf(NAME ": adding platform function\n"); 159 printf(NAME ": function node is `%s' (%d %s)\n", PLATFORM_FUN_NAME, 160 PLATFORM_FUN_MATCH_SCORE, match_id); 162 161 163 162 fun = ddf_fun_create(dev, fun_inner, name); 164 163 if (fun == NULL) { 165 ddf_msg(LVL_ERROR, "Error creating function %s\n", name);164 printf(NAME ": error creating function %s\n", name); 166 165 return ENOMEM; 167 166 } … … 169 168 rc = ddf_fun_add_match_id(fun, match_id, PLATFORM_FUN_MATCH_SCORE); 170 169 if (rc != EOK) { 171 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n", 172 name); 170 printf(NAME ": error adding match IDs to function %s\n", name); 173 171 ddf_fun_destroy(fun); 174 172 return rc; … … 177 175 rc = ddf_fun_bind(fun); 178 176 if (rc != EOK) { 179 ddf_msg(LVL_ERROR, "Failedbinding function %s: %s\n", name,177 printf(NAME ": error binding function %s: %s\n", name, 180 178 str_error(rc)); 181 179 ddf_fun_destroy(fun); … … 193 191 static int root_add_device(ddf_dev_t *dev) 194 192 { 195 ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun "\n",193 printf(NAME ": root_add_device, device handle=%" PRIun "\n", 196 194 dev->handle); 197 195 … … 206 204 int res = add_platform_fun(dev); 207 205 if (EOK != res) 208 ddf_msg(LVL_ERROR, "Failed addingchild device for platform.\n");206 printf(NAME ": failed to add child device for platform.\n"); 209 207 210 208 return res; … … 214 212 { 215 213 printf(NAME ": HelenOS root device driver\n"); 216 217 ddf_log_init(NAME, LVL_ERROR);218 214 return ddf_driver_main(&root_driver); 219 215 } -
uspace/drv/rootpc/rootpc.c
r73aec008 r917a8c8 47 47 48 48 #include <ddf/driver.h> 49 #include <ddf/log.h>50 49 #include <devman.h> 51 50 #include <ipc/devman.h> … … 120 119 rootpc_fun_t *fun) 121 120 { 122 ddf_msg(LVL_DEBUG, "Adding new function '%s'.\n", name);121 printf(NAME ": adding new function '%s'.\n", name); 123 122 124 123 ddf_fun_t *fnode = NULL; … … 146 145 /* Register function. */ 147 146 if (ddf_fun_bind(fnode) != EOK) { 148 ddf_msg(LVL_ERROR, "Failedbinding function %s.\n", name);147 printf(NAME ": error binding function %s.\n", name); 149 148 goto failure; 150 149 } … … 159 158 ddf_fun_destroy(fnode); 160 159 161 ddf_msg(LVL_ERROR, "Failed addingfunction '%s'.\n", name);160 printf(NAME ": failed to add function '%s'.\n", name); 162 161 163 162 return false; … … 177 176 static int rootpc_add_device(ddf_dev_t *dev) 178 177 { 179 ddf_msg(LVL_DEBUG, "rootpc_add_device, device handle = %d\n",178 printf(NAME ": rootpc_add_device, device handle = %d\n", 180 179 (int)dev->handle); 181 180 182 181 /* Register functions. */ 183 182 if (!rootpc_add_functions(dev)) { 184 ddf_msg(LVL_ERROR, "Failed to add functions for PC platform.\n");183 printf(NAME ": failed to add functions for PC platform.\n"); 185 184 } 186 185 … … 190 189 static void root_pc_init(void) 191 190 { 192 ddf_log_init(NAME, LVL_ERROR);193 191 rootpc_fun_ops.interfaces[HW_RES_DEV_IFACE] = &fun_hw_res_ops; 194 192 } -
uspace/drv/rootvirt/rootvirt.c
r73aec008 r917a8c8 40 40 #include <str_error.h> 41 41 #include <ddf/driver.h> 42 #include <ddf/log.h>43 42 44 43 #define NAME "rootvirt" … … 84 83 int rc; 85 84 86 ddf_msg(LVL_DEBUG, "Registering function `%s' (match \"%s\")\n",85 printf(NAME ": registering function `%s' (match \"%s\")\n", 87 86 vfun->name, vfun->match_id); 88 87 89 88 fun = ddf_fun_create(vdev, fun_inner, vfun->name); 90 89 if (fun == NULL) { 91 ddf_msg(LVL_ERROR, "Failedcreating function %s\n", vfun->name);90 printf(NAME ": error creating function %s\n", vfun->name); 92 91 return ENOMEM; 93 92 } … … 95 94 rc = ddf_fun_add_match_id(fun, vfun->match_id, 10); 96 95 if (rc != EOK) { 97 ddf_msg(LVL_ERROR, "Failedadding match IDs to function %s\n",96 printf(NAME ": error adding match IDs to function %s\n", 98 97 vfun->name); 99 98 ddf_fun_destroy(fun); … … 103 102 rc = ddf_fun_bind(fun); 104 103 if (rc != EOK) { 105 ddf_msg(LVL_ERROR, "Failedbinding function %s: %s\n", vfun->name,104 printf(NAME ": error binding function %s: %s\n", vfun->name, 106 105 str_error(rc)); 107 106 ddf_fun_destroy(fun); … … 109 108 } 110 109 111 ddf_msg(LVL_NOTE, "Registered child device `%s'\n", vfun->name);110 printf(NAME ": registered child device `%s'\n", vfun->name); 112 111 return EOK; 113 112 } … … 125 124 } 126 125 127 ddf_msg(LVL_DEBUG, "add_device(handle=%d)\n", (int)dev->handle);126 printf(NAME ": add_device(handle=%d)\n", (int)dev->handle); 128 127 129 128 /* … … 143 142 { 144 143 printf(NAME ": HelenOS virtual devices root driver\n"); 145 146 ddf_log_init(NAME, LVL_ERROR);147 144 return ddf_driver_main(&rootvirt_driver); 148 145 } -
uspace/drv/test1/test1.c
r73aec008 r917a8c8 35 35 #include <str_error.h> 36 36 #include <ddf/driver.h> 37 #include <ddf/log.h>38 37 39 38 #include "test1.h" … … 64 63 int rc; 65 64 66 ddf_msg(LVL_DEBUG, "Registering function `%s': %s.\n", name, message);65 printf(NAME ": registering function `%s': %s.\n", name, message); 67 66 68 67 fun = ddf_fun_create(parent, fun_inner, name); 69 68 if (fun == NULL) { 70 ddf_msg(LVL_ERROR, "Failedcreating function %s\n", name);69 printf(NAME ": error creating function %s\n", name); 71 70 return ENOMEM; 72 71 } … … 74 73 rc = ddf_fun_add_match_id(fun, match_id, match_score); 75 74 if (rc != EOK) { 76 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n", 77 name); 75 printf(NAME ": error adding match IDs to function %s\n", name); 78 76 ddf_fun_destroy(fun); 79 77 return rc; … … 82 80 rc = ddf_fun_bind(fun); 83 81 if (rc != EOK) { 84 ddf_msg(LVL_ERROR, "Failedbinding function %s: %s\n", name,82 printf(NAME ": error binding function %s: %s\n", name, 85 83 str_error(rc)); 86 84 ddf_fun_destroy(fun); … … 88 86 } 89 87 90 ddf_msg(LVL_NOTE, "Registered child device `%s'\n", name);88 printf(NAME ": registered child device `%s'\n", name); 91 89 return EOK; 92 90 } … … 114 112 int rc; 115 113 116 ddf_msg(LVL_DEBUG, "add_device(name=\"%s\", handle=%d)\n",114 printf(NAME ": add_device(name=\"%s\", handle=%d)\n", 117 115 dev->name, (int) dev->handle); 118 116 119 117 fun_a = ddf_fun_create(dev, fun_exposed, "a"); 120 118 if (fun_a == NULL) { 121 ddf_msg(LVL_ERROR, "Failedcreating function 'a'.\n");119 printf(NAME ": error creating function 'a'.\n"); 122 120 return ENOMEM; 123 121 } … … 125 123 rc = ddf_fun_bind(fun_a); 126 124 if (rc != EOK) { 127 ddf_msg(LVL_ERROR, "Failedbinding function 'a'.\n");125 printf(NAME ": error binding function 'a'.\n"); 128 126 return rc; 129 127 } … … 142 140 } 143 141 144 ddf_msg(LVL_DEBUG, "Device `%s' accepted.\n", dev->name);142 printf(NAME ": device `%s' accepted.\n", dev->name); 145 143 146 144 return EOK; … … 150 148 { 151 149 printf(NAME ": HelenOS test1 virtual device driver\n"); 152 ddf_log_init(NAME, LVL_ERROR);153 150 return ddf_driver_main(&test1_driver); 154 151 } -
uspace/drv/test2/test2.c
r73aec008 r917a8c8 36 36 #include <str_error.h> 37 37 #include <ddf/driver.h> 38 #include <ddf/log.h>39 38 40 39 #define NAME "test2" … … 65 64 int rc; 66 65 67 ddf_msg(LVL_DEBUG, "Registering function `%s': %s.\n", name, message);66 printf(NAME ": registering function `%s': %s.\n", name, message); 68 67 69 68 fun = ddf_fun_create(parent, fun_inner, name); 70 69 if (fun == NULL) { 71 ddf_msg(LVL_ERROR, "Failedcreating function %s\n", name);70 printf(NAME ": error creating function %s\n", name); 72 71 return ENOMEM; 73 72 } … … 75 74 rc = ddf_fun_add_match_id(fun, match_id, match_score); 76 75 if (rc != EOK) { 77 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n", 78 name); 76 printf(NAME ": error adding match IDs to function %s\n", name); 79 77 ddf_fun_destroy(fun); 80 78 return rc; … … 83 81 rc = ddf_fun_bind(fun); 84 82 if (rc != EOK) { 85 ddf_msg(LVL_ERROR, "Failedbinding function %s: %s\n", name,83 printf(NAME ": error binding function %s: %s\n", name, 86 84 str_error(rc)); 87 85 ddf_fun_destroy(fun); … … 89 87 } 90 88 91 ddf_msg(LVL_NOTE, "Registered child device `%s'\n", name);89 printf(NAME ": registered child device `%s'\n", name); 92 90 return EOK; 93 91 } … … 113 111 fun_a = ddf_fun_create(dev, fun_exposed, "a"); 114 112 if (fun_a == NULL) { 115 ddf_msg(LVL_ERROR, "Failedcreating function 'a'.\n");113 printf(NAME ": error creating function 'a'.\n"); 116 114 return ENOMEM; 117 115 } … … 119 117 rc = ddf_fun_bind(fun_a); 120 118 if (rc != EOK) { 121 ddf_msg(LVL_ERROR, "Failedbinding function 'a'.\n");119 printf(NAME ": error binding function 'a'.\n"); 122 120 return rc; 123 121 } … … 130 128 static int test2_add_device(ddf_dev_t *dev) 131 129 { 132 ddf_msg(LVL_DEBUG, "test2_add_device(name=\"%s\", handle=%d)\n",130 printf(NAME ": test2_add_device(name=\"%s\", handle=%d)\n", 133 131 dev->name, (int) dev->handle); 134 132 … … 136 134 fid_t postpone = fibril_create(postponed_birth, dev); 137 135 if (postpone == 0) { 138 ddf_msg(LVL_ERROR, "fibril_create() failed.\n");136 printf(NAME ": fibril_create() error\n"); 139 137 return ENOMEM; 140 138 } … … 151 149 { 152 150 printf(NAME ": HelenOS test2 virtual device driver\n"); 153 ddf_log_init(NAME, LVL_ERROR);154 151 return ddf_driver_main(&test2_driver); 155 152 } -
uspace/lib/c/Makefile
r73aec008 r917a8c8 76 76 generic/io/io.c \ 77 77 generic/io/printf.c \ 78 generic/io/log.c \79 78 generic/io/klog.c \ 80 79 generic/io/snprintf.c \ -
uspace/lib/drv/Makefile
r73aec008 r917a8c8 35 35 generic/driver.c \ 36 36 generic/dev_iface.c \ 37 generic/log.c \38 37 generic/remote_hw_res.c \ 39 38 generic/remote_char_dev.c -
uspace/lib/drv/generic/driver.c
r73aec008 r917a8c8 273 273 274 274 res = driver->driver_ops->add_device(dev); 275 if (res != EOK) 275 if (res == EOK) { 276 printf("%s: new device with handle=%" PRIun " was added.\n", 277 driver->name, dev_handle); 278 } else { 279 printf("%s: failed to add a new device with handle = %" PRIun ".\n", 280 driver->name, dev_handle); 276 281 delete_device(dev); 282 } 277 283 278 284 async_answer_0(iid, res); -
uspace/srv/devman/devman.c
r73aec008 r917a8c8 34 34 #include <fcntl.h> 35 35 #include <sys/stat.h> 36 #include <io/log.h>37 36 #include <ipc/driver.h> 38 37 #include <ipc/devman.h> … … 147 146 fibril_mutex_unlock(&drivers_list->drivers_mutex); 148 147 149 log_msg(LVL_NOTE, "Driver `%s'was added to the list of available "148 printf(NAME": the '%s' driver was added to the list of available " 150 149 "drivers.\n", drv->name); 151 150 } … … 238 237 bool read_match_ids(const char *conf_path, match_id_list_t *ids) 239 238 { 240 log_msg(LVL_DEBUG, "read_match_ids(conf_path=\"%s\")\n", conf_path);239 printf(NAME ": read_match_ids conf_path = %s.\n", conf_path); 241 240 242 241 bool suc = false; … … 248 247 fd = open(conf_path, O_RDONLY); 249 248 if (fd < 0) { 250 log_msg(LVL_ERROR, "Unable to open `%s' for reading: %s.\n", 251 conf_path, str_error(fd)); 249 printf(NAME ": unable to open %s\n", conf_path); 252 250 goto cleanup; 253 251 } … … 257 255 lseek(fd, 0, SEEK_SET); 258 256 if (len == 0) { 259 log_msg(LVL_ERROR, "Configuration file '%s' is empty.\n", 260 conf_path); 257 printf(NAME ": configuration file '%s' is empty.\n", conf_path); 261 258 goto cleanup; 262 259 } … … 264 261 buf = malloc(len + 1); 265 262 if (buf == NULL) { 266 log_msg(LVL_ERROR, "Memory allocation failed when parsing file "263 printf(NAME ": memory allocation failed when parsing file " 267 264 "'%s'.\n", conf_path); 268 265 goto cleanup; … … 271 268 ssize_t read_bytes = safe_read(fd, buf, len); 272 269 if (read_bytes <= 0) { 273 log_msg(LVL_ERROR, "Unable to read file '%s'.\n", conf_path);270 printf(NAME ": unable to read file '%s'.\n", conf_path); 274 271 goto cleanup; 275 272 } … … 309 306 bool get_driver_info(const char *base_path, const char *name, driver_t *drv) 310 307 { 311 log_msg(LVL_DEBUG, "get_driver_info(base_path=\"%s\", name=\"%s\")\n",308 printf(NAME ": get_driver_info base_path = %s, name = %s.\n", 312 309 base_path, name); 313 310 … … 341 338 struct stat s; 342 339 if (stat(drv->binary_path, &s) == ENOENT) { /* FIXME!! */ 343 log_msg(LVL_ERROR, "Driver not found at path `%s'.", 344 drv->binary_path); 340 printf(NAME ": driver not found at path %s.", drv->binary_path); 345 341 goto cleanup; 346 342 } … … 369 365 int lookup_available_drivers(driver_list_t *drivers_list, const char *dir_path) 370 366 { 371 log_msg(LVL_DEBUG, "lookup_available_drivers(dir=\"%s\")\n", dir_path);367 printf(NAME ": lookup_available_drivers, dir = %s \n", dir_path); 372 368 373 369 int drv_cnt = 0; … … 403 399 dev_node_t *dev; 404 400 405 log_msg(LVL_DEBUG, "create_root_nodes()\n");401 printf(NAME ": create_root_nodes\n"); 406 402 407 403 fibril_rwlock_write_lock(&tree->rwlock); … … 488 484 void attach_driver(dev_node_t *dev, driver_t *drv) 489 485 { 490 log_msg(LVL_DEBUG, "attach_driver(dev=\"%s\",drv=\"%s\")\n",491 d ev->pfun->pathname, drv->name);486 printf(NAME ": attach_driver %s to device %s\n", 487 drv->name, dev->pfun->pathname); 492 488 493 489 fibril_mutex_lock(&drv->driver_mutex); … … 511 507 assert(fibril_mutex_is_locked(&drv->driver_mutex)); 512 508 513 log_msg(LVL_DEBUG, "start_driver(drv=\"%s\")\n", drv->name);509 printf(NAME ": start_driver '%s'\n", drv->name); 514 510 515 511 rc = task_spawnl(NULL, drv->binary_path, drv->binary_path, NULL); 516 512 if (rc != EOK) { 517 log_msg(LVL_ERROR, "Spawning driver `%s' (%s) failed: %s.\n",518 drv->name, drv->binary_path,str_error(rc));513 printf(NAME ": error spawning %s (%s)\n", 514 drv->name, str_error(rc)); 519 515 return false; 520 516 } … … 578 574 int phone; 579 575 580 log_msg(LVL_DEBUG, "pass_devices_to_driver(driver=\"%s\")\n", 581 driver->name); 576 printf(NAME ": pass_devices_to_driver(`%s')\n", driver->name); 582 577 583 578 fibril_mutex_lock(&driver->driver_mutex); … … 646 641 * immediately and possibly started here as well. 647 642 */ 648 log_msg(LVL_DEBUG, "Driver `%s' entersrunning state.\n", driver->name);643 printf(NAME ": driver %s goes into running state.\n", driver->name); 649 644 driver->state = DRIVER_RUNNING; 650 645 … … 663 658 void initialize_running_driver(driver_t *driver, dev_tree_t *tree) 664 659 { 665 log_msg(LVL_DEBUG, "initialize_running_driver(driver=\"%s\")\n", 666 driver->name); 660 printf(NAME ": initialize_running_driver (`%s')\n", driver->name); 667 661 668 662 /* … … 754 748 * access any structures that would affect driver_t. 755 749 */ 756 log_msg(LVL_DEBUG, "add_device(drv=\"%s\", dev=\"%s\")\n",757 d rv->name, dev->pfun->name);750 printf(NAME ": add_device (driver `%s', device `%s')\n", drv->name, 751 dev->pfun->name); 758 752 759 753 sysarg_t rc; … … 816 810 driver_t *drv = find_best_match_driver(drivers_list, dev); 817 811 if (drv == NULL) { 818 log_msg(LVL_ERROR, "No driver found for device `%s'.\n",812 printf(NAME ": no driver found for device '%s'.\n", 819 813 dev->pfun->pathname); 820 814 return false; … … 854 848 bool init_device_tree(dev_tree_t *tree, driver_list_t *drivers_list) 855 849 { 856 log_msg(LVL_DEBUG, "init_device_tree()\n");850 printf(NAME ": init_device_tree.\n"); 857 851 858 852 tree->current_handle = 0; … … 1033 1027 fun->pathname = (char *) malloc(pathsize); 1034 1028 if (fun->pathname == NULL) { 1035 log_msg(LVL_ERROR, "Failed to allocate device path.\n");1029 printf(NAME ": failed to allocate device path.\n"); 1036 1030 return false; 1037 1031 } … … 1064 1058 assert(fibril_rwlock_is_write_locked(&tree->rwlock)); 1065 1059 1066 log_msg(LVL_DEBUG, "insert_dev_node(dev=%p, pfun=%p [\"%s\"])\n",1067 dev, pfun, pfun->pathname);1068 1069 1060 /* Add the node to the handle-to-node map. */ 1070 1061 dev->handle = ++tree->current_handle; … … 1073 1064 1074 1065 /* Add the node to the list of its parent's children. */ 1066 printf("insert_dev_node: dev=%p, dev->pfun := %p\n", dev, pfun); 1075 1067 dev->pfun = pfun; 1076 1068 pfun->child = dev; -
uspace/srv/devman/main.c
r73aec008 r917a8c8 43 43 #include <stdio.h> 44 44 #include <errno.h> 45 #include <str_error.h>46 45 #include <bool.h> 47 46 #include <fibril_synch.h> … … 52 51 #include <sys/stat.h> 53 52 #include <ctype.h> 54 #include <io/log.h>55 53 #include <ipc/devman.h> 56 54 #include <ipc/driver.h> … … 73 71 driver_t *driver = NULL; 74 72 75 log_msg(LVL_DEBUG, "devman_driver_register\n");73 printf(NAME ": devman_driver_register \n"); 76 74 77 75 iid = async_get_call(&icall); … … 90 88 } 91 89 92 log_msg(LVL_DEBUG, "The `%s' driver is trying to register.\n",90 printf(NAME ": the %s driver is trying to register by the service.\n", 93 91 drv_name); 94 92 … … 97 95 98 96 if (driver == NULL) { 99 log_msg(LVL_ERROR, "No driver named `%s'was found.\n", drv_name);97 printf(NAME ": no driver named %s was found.\n", drv_name); 100 98 free(drv_name); 101 99 drv_name = NULL; … … 108 106 109 107 /* Create connection to the driver. */ 110 log_msg(LVL_DEBUG, "Creating connection to the `%s' driver.\n", 111 driver->name); 108 printf(NAME ": creating connection to the %s driver.\n", driver->name); 112 109 ipc_call_t call; 113 110 ipc_callid_t callid = async_get_call(&call); … … 121 118 set_driver_phone(driver, IPC_GET_ARG5(call)); 122 119 123 log_msg(LVL_NOTE, 124 "The `%s' driver was successfully registered as running.\n", 120 printf(NAME ": the %s driver was successfully registered as running.\n", 125 121 driver->name); 126 122 … … 146 142 callid = async_get_call(&call); 147 143 if (DEVMAN_ADD_MATCH_ID != IPC_GET_IMETHOD(call)) { 148 log_msg(LVL_ERROR,149 " Invalid protocol when trying to receive match id.\n");144 printf(NAME ": ERROR: devman_receive_match_id - invalid " 145 "protocol.\n"); 150 146 async_answer_0(callid, EINVAL); 151 147 delete_match_id(match_id); … … 154 150 155 151 if (match_id == NULL) { 156 log_msg(LVL_ERROR, "Failed to allocate match id.\n"); 152 printf(NAME ": ERROR: devman_receive_match_id - failed to " 153 "allocate match id.\n"); 157 154 async_answer_0(callid, ENOMEM); 158 155 return ENOMEM; … … 168 165 if (rc != EOK) { 169 166 delete_match_id(match_id); 170 log_msg(LVL_ERROR, "Failed to receive match id string: %s.\n",171 str_error(rc));167 printf(NAME ": devman_receive_match_id - failed to receive " 168 "match id string.\n"); 172 169 return rc; 173 170 } … … 175 172 list_append(&match_id->link, &match_ids->ids); 176 173 177 log_msg(LVL_DEBUG, "Received match id `%s', score %d.\n",174 printf(NAME ": received match id '%s', score = %d \n", 178 175 match_id->id, match_id->score); 179 176 return rc; … … 231 228 if (ftype != fun_inner && ftype != fun_exposed) { 232 229 /* Unknown function type */ 233 log_msg(LVL_ERROR, 234 "Unknown function type %d provided by driver.\n", 235 (int) ftype); 230 printf(NAME ": Error, unknown function type provided by driver!\n"); 236 231 237 232 fibril_rwlock_write_unlock(&tree->rwlock); … … 270 265 fibril_rwlock_write_unlock(&tree->rwlock); 271 266 272 log_msg(LVL_DEBUG, "devman_add_function(fun=\"%s\")\n", fun->pathname);267 printf(NAME ": devman_add_function %s\n", fun->pathname); 273 268 274 269 devman_receive_match_ids(match_count, &fun->match_ids); … … 352 347 devmap_register_class_dev(class_info); 353 348 354 log_msg(LVL_NOTE, "Function `%s' added to class `%s' as `%s'.\n",355 fun->pathname, class_name, class_info->dev_name);349 printf(NAME ": function'%s' added to class '%s', class name '%s' was " 350 "asigned to it\n", fun->pathname, class_name, class_info->dev_name); 356 351 357 352 async_answer_0(callid, EOK); … … 368 363 369 364 initialize_running_driver(driver, &device_tree); 370 log_msg(LVL_DEBUG, "The `%s` driver was successfully initialized.\n",365 printf(NAME ": the %s driver was successfully initialized. \n", 371 366 driver->name); 372 367 return 0; … … 390 385 fid_t fid = fibril_create(init_running_drv, driver); 391 386 if (fid == 0) { 392 log_msg(LVL_ERROR, "Failed to create initialization fibril " \393 " for driver `%s' .\n", driver->name);387 printf(NAME ": Error creating fibril for the initialization of " 388 "the newly registered running driver.\n"); 394 389 return; 395 390 } … … 489 484 */ 490 485 if (dev == NULL) { 491 log_msg(LVL_ERROR, "IPC forwarding failed - no device or"492 " function withhandle %" PRIun " was found.\n", handle);486 printf(NAME ": devman_forward error - no device or function with " 487 "handle %" PRIun " was found.\n", handle); 493 488 async_answer_0(iid, ENOENT); 494 489 return; … … 496 491 497 492 if (fun == NULL && !drv_to_parent) { 498 log_msg(LVL_ERROR, NAME ": devman_forward error - cannot " 499 "connect to handle %" PRIun ", refers to a device.\n", 500 handle); 493 printf(NAME ": devman_forward error - cannot connect to " 494 "handle %" PRIun ", refers to a device.\n", handle); 501 495 async_answer_0(iid, ENOENT); 502 496 return; … … 519 513 520 514 if (driver == NULL) { 521 log_msg(LVL_ERROR, "IPC forwarding refused - " \522 " the device %" PRIun " is not inusable state.\n", handle);515 printf(NAME ": devman_forward error - the device is not in %" PRIun 516 " usable state.\n", handle); 523 517 async_answer_0(iid, ENOENT); 524 518 return; … … 532 526 533 527 if (driver->phone <= 0) { 534 log_msg(LVL_ERROR,535 "Could not forward to driver `%s' (phone is %d).\n",536 driver->name, (int)driver->phone);528 printf(NAME ": devman_forward: cound not forward to driver %s ", 529 driver->name); 530 printf("the driver's phone is %" PRIun ").\n", driver->phone); 537 531 async_answer_0(iid, EINVAL); 538 532 return; … … 540 534 541 535 if (fun != NULL) { 542 log_msg(LVL_DEBUG, 543 "Forwarding request for `%s' function to driver `%s'.\n", 544 fun->pathname, driver->name); 536 printf(NAME ": devman_forward: forward connection to function %s to " 537 "driver %s.\n", fun->pathname, driver->name); 545 538 } else { 546 log_msg(LVL_DEBUG, 547 "Forwarding request for `%s' device to driver `%s'.\n", 548 dev->pfun->pathname, driver->name); 539 printf(NAME ": devman_forward: forward connection to device %s to " 540 "driver %s.\n", dev->pfun->pathname, driver->name); 549 541 } 550 542 … … 578 570 async_forward_fast(iid, dev->drv->phone, DRIVER_CLIENT, fun->handle, 0, 579 571 IPC_FF_NONE); 580 log_msg(LVL_DEBUG, 581 "Forwarding devmapper request for `%s' function to driver `%s'.\n", 582 fun->pathname, dev->drv->name); 572 printf(NAME ": devman_connection_devmapper: forwarded connection to " 573 "device %s to driver %s.\n", fun->pathname, dev->drv->name); 583 574 } 584 575 … … 615 606 static bool devman_init(void) 616 607 { 617 log_msg(LVL_DEBUG, "devman_init - looking for available drivers.\n");608 printf(NAME ": devman_init - looking for available drivers.\n"); 618 609 619 610 /* Initialize list of available drivers. */ … … 621 612 if (lookup_available_drivers(&drivers_list, 622 613 DRIVER_DEFAULT_STORE) == 0) { 623 log_msg(LVL_FATAL, "no drivers found.");614 printf(NAME " no drivers found."); 624 615 return false; 625 616 } 626 617 627 log_msg(LVL_DEBUG, "devman_init- list of drivers has been initialized.\n");618 printf(NAME ": devman_init - list of drivers has been initialized.\n"); 628 619 629 620 /* Create root device node. */ 630 621 if (!init_device_tree(&device_tree, &drivers_list)) { 631 log_msg(LVL_FATAL, "Failed to initialize device tree.");622 printf(NAME " failed to initialize device tree."); 632 623 return false; 633 624 } … … 650 641 printf(NAME ": HelenOS Device Manager\n"); 651 642 652 if (log_init(NAME, LVL_ERROR) != EOK) {653 printf(NAME ": Error initializing logging subsystem.\n");654 return -1;655 }656 657 643 if (!devman_init()) { 658 log_msg(LVL_ERROR, "Error while initializing service.\n");644 printf(NAME ": Error while initializing service\n"); 659 645 return -1; 660 646 } … … 664 650 665 651 /* Register device manager at naming service. */ 666 if (service_register(SERVICE_DEVMAN) != EOK) { 667 log_msg(LVL_ERROR, "Failed registering as a service.\n"); 652 if (service_register(SERVICE_DEVMAN) != EOK) 668 653 return -1; 669 } 670 671 printf(NAME ": Accepting connections.\n"); 654 655 printf(NAME ": Accepting connections\n"); 672 656 async_manager(); 673 657
Note:
See TracChangeset
for help on using the changeset viewer.