Changeset 01b87dc5 in mainline for uspace/srv/devman/devman.c
- Timestamp:
- 2010-12-21T16:07:59Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 61cc94e
- Parents:
- c81b6f2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
rc81b6f2 r01b87dc5 384 384 printf(NAME ": create_root_node\n"); 385 385 386 fibril_rwlock_write_lock(&tree->rwlock); 386 387 node = create_dev_node(); 387 388 if (node != NULL) { … … 393 394 tree->root_node = node; 394 395 } 396 fibril_rwlock_write_unlock(&tree->rwlock); 395 397 396 398 return node != NULL; … … 455 457 /** Start a driver 456 458 * 457 * The driver's mutex is assumed to be locked.458 *459 459 * @param drv The driver's structure. 460 460 * @return True if the driver's task is successfully spawned, false … … 465 465 int rc; 466 466 467 assert(fibril_mutex_is_locked(&drv->driver_mutex)); 468 467 469 printf(NAME ": start_driver '%s'\n", drv->name); 468 470 … … 859 861 /** Find the device node structure of the device witch has the specified handle. 860 862 * 861 * Device tree's rwlock should be held at least for reading.862 *863 863 * @param tree The device tree where we look for the device node. 864 864 * @param handle The handle of the device. … … 868 868 { 869 869 unsigned long key = handle; 870 link_t *link = hash_table_find(&tree->devman_devices, &key); 870 link_t *link; 871 872 assert(fibril_rwlock_is_locked(&tree->rwlock)); 873 874 link = hash_table_find(&tree->devman_devices, &key); 871 875 return hash_table_get_instance(link, node_t, devman_link); 872 876 } … … 924 928 /** Insert new device into device tree. 925 929 * 926 * The device tree's rwlock should be already held exclusively when calling this927 * function.928 *929 930 * @param tree The device tree. 930 931 * @param node The newly added device node. … … 941 942 assert(tree != NULL); 942 943 assert(dev_name != NULL); 944 assert(fibril_rwlock_is_write_locked(&tree->rwlock)); 943 945 944 946 node->name = dev_name;
Note:
See TracChangeset
for help on using the changeset viewer.