Changeset a676574 in mainline for uspace/srv/devman/devman.c


Ignore:
Timestamp:
2011-01-09T12:18:00Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
54de5ebd
Parents:
a3eeef45 (diff), 9d12059 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    ra3eeef45 ra676574  
    384384        printf(NAME ": create_root_node\n");
    385385
     386        fibril_rwlock_write_lock(&tree->rwlock);
    386387        node = create_dev_node();
    387388        if (node != NULL) {
     
    393394                tree->root_node = node;
    394395        }
     396        fibril_rwlock_write_unlock(&tree->rwlock);
    395397
    396398        return node != NULL;
     
    455457/** Start a driver
    456458 *
    457  * The driver's mutex is assumed to be locked.
    458  *
    459459 * @param drv           The driver's structure.
    460460 * @return              True if the driver's task is successfully spawned, false
     
    465465        int rc;
    466466
     467        assert(fibril_mutex_is_locked(&drv->driver_mutex));
     468       
    467469        printf(NAME ": start_driver '%s'\n", drv->name);
    468470       
     
    783785                /* Notify the driver about the new device. */
    784786                int phone = async_connect_me_to(drv->phone, DRIVER_DEVMAN, 0, 0);
    785                 if (phone > 0) {
     787                if (phone >= 0) {
    786788                        add_device(phone, drv, node, tree);
    787789                        ipc_hangup(phone);
     
    859861/** Find the device node structure of the device witch has the specified handle.
    860862 *
    861  * Device tree's rwlock should be held at least for reading.
    862  *
    863863 * @param tree          The device tree where we look for the device node.
    864864 * @param handle        The handle of the device.
     
    868868{
    869869        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);
    871875        return hash_table_get_instance(link, node_t, devman_link);
    872876}
     
    924928/** Insert new device into device tree.
    925929 *
    926  * The device tree's rwlock should be already held exclusively when calling this
    927  * function.
    928  *
    929930 * @param tree          The device tree.
    930931 * @param node          The newly added device node.
     
    941942        assert(tree != NULL);
    942943        assert(dev_name != NULL);
     944        assert(fibril_rwlock_is_write_locked(&tree->rwlock));
    943945       
    944946        node->name = dev_name;
Note: See TracChangeset for help on using the changeset viewer.