Changeset 692c40cb in mainline for uspace/srv/devman/devman.h
- Timestamp:
- 2010-05-28T09:04:37Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5159ae9
- Parents:
- c9f3b45c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.h
rc9f3b45c r692c40cb 158 158 link_t link; 159 159 /** List of dev_class_info structures - one for each device registered by this class.*/ 160 link_t devices; 161 /** Default base name for the device within the class, might be overrided by the driver.*/ 160 link_t devices; 161 /** Default base name for the device within the class, might be overrided by the driver.*/ 162 162 const char *base_dev_name; 163 /** Unique numerical identifier appened to the base nameof the newly added device.*/163 /** Unique numerical identifier of the newly added device.*/ 164 164 size_t curr_dev_idx; 165 165 /** Synchronize access to the list of devices in this class. */ … … 185 185 } dev_class_info_t; 186 186 187 /** The list of device classes. */ 188 typedef struct class_list { 189 /** List of classes */ 190 link_t classes; 191 /** Fibril mutex for list of classes. */ 192 fibril_mutex_t classes_mutex; 193 } class_list_t; 194 187 195 // Match ids and scores 188 196 … … 282 290 { 283 291 node_t *res = malloc(sizeof(node_t)); 292 284 293 if (res != NULL) { 285 294 memset(res, 0, sizeof(node_t)); 295 list_initialize(&res->children); 296 list_initialize(&res->match_ids.ids); 297 list_initialize(&res->classes); 286 298 } 287 288 list_initialize(&res->children);289 list_initialize(&res->match_ids.ids);290 299 291 300 return res; … … 364 373 if (NULL != cl) { 365 374 memset(cl, 0, sizeof(dev_class_t)); 375 list_initialize(&cl->devices); 366 376 fibril_mutex_initialize(&cl->mutex); 367 377 } … … 394 404 dev_class_info_t * add_device_to_class(node_t *dev, dev_class_t *cl, const char *base_dev_name); 395 405 406 static inline void init_class_list(class_list_t *class_list) 407 { 408 list_initialize(&class_list->classes); 409 fibril_mutex_initialize(&class_list->classes_mutex); 410 } 411 412 dev_class_t * get_dev_class(class_list_t *class_list, char *class_name); 413 dev_class_t * find_dev_class_no_lock(class_list_t *class_list, const char *class_name); 414 415 static inline void add_dev_class_no_lock(class_list_t *class_list, dev_class_t *cl) 416 { 417 list_append(&cl->link, &class_list->classes); 418 } 419 396 420 #endif 397 421
Note:
See TracChangeset
for help on using the changeset viewer.