Changeset 63e0bdd in mainline


Ignore:
Timestamp:
2011-02-26T14:57:55Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
38eaf41
Parents:
27833d8
Message:

Null devices need to be in some driver_devices list too,
otherwise devmap will crash when devmap_null_destroy() is called.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devmap/devmap.c

    r27833d8 r63e0bdd  
    123123static devmap_handle_t last_handle = 0;
    124124static devmap_device_t *null_devices[NULL_DEVICES];
     125
     126/*
     127 * Dummy list for null devices. This is necessary so that null devices can
     128 * be used just as any other devices, e.g. in devmap_device_unregister_core().
     129 */
     130static LIST_INITIALIZE(dummy_null_driver_devices);
    125131
    126132static devmap_handle_t devmap_create_handle(void)
     
    953959        device->name = dev_name;
    954960       
    955         /* Insert device into list of all devices
    956            and into null devices array */
     961        /*
     962         * Insert device into list of all devices and into null devices array.
     963         * Insert device into a dummy list of null driver's devices so that it
     964         * can be safely removed later.
     965         */
    957966        list_append(&device->devices, &devices_list);
     967        list_append(&device->driver_devices, &dummy_null_driver_devices);
    958968        null_devices[i] = device;
    959969       
Note: See TracChangeset for help on using the changeset viewer.