Changeset 3ca3430 in mainline for uspace/srv/devman/devman.c
- Timestamp:
- 2010-12-17T23:32:02Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6e50466
- Parents:
- 7551706b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
r7551706b r3ca3430 62 62 } 63 63 64 static int devmap_devices_class_compare(unsigned long key[], hash_count_t keys, 65 link_t *item) 66 { 67 dev_class_info_t *class_info 68 = hash_table_get_instance(item, dev_class_info_t, devmap_link); 69 assert(class_info != NULL); 70 71 return (class_info->devmap_handle == (devmap_handle_t) key[0]); 72 } 73 64 74 static void devices_remove_callback(link_t *item) 65 75 { … … 75 85 .hash = devices_hash, 76 86 .compare = devmap_devices_compare, 87 .remove_callback = devices_remove_callback 88 }; 89 90 static hash_table_operations_t devmap_devices_class_ops = { 91 .hash = devices_hash, 92 .compare = devmap_devices_class_compare, 77 93 .remove_callback = devices_remove_callback 78 94 }; … … 1043 1059 1044 1060 info = (dev_class_info_t *) malloc(sizeof(dev_class_info_t)); 1045 if (info != NULL) 1061 if (info != NULL) { 1046 1062 memset(info, 0, sizeof(dev_class_info_t)); 1063 list_initialize(&info->dev_classes); 1064 list_initialize(&info->devmap_link); 1065 list_initialize(&info->link); 1066 } 1047 1067 1048 1068 return info; … … 1168 1188 fibril_rwlock_initialize(&class_list->rwlock); 1169 1189 hash_table_create(&class_list->devmap_devices, DEVICE_BUCKETS, 1, 1170 &devmap_devices_ ops);1190 &devmap_devices_class_ops); 1171 1191 } 1172 1192 … … 1216 1236 hash_table_insert(&class_list->devmap_devices, &key, &cli->devmap_link); 1217 1237 fibril_rwlock_write_unlock(&class_list->rwlock); 1238 1239 assert(find_devmap_class_device(class_list, cli->devmap_handle) != NULL); 1218 1240 } 1219 1241
Note:
See TracChangeset
for help on using the changeset viewer.