Changeset d30e067 in mainline for uspace/srv/devman/dev.c


Ignore:
Timestamp:
2025-03-02T20:02:33Z (5 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
8cdf360
Parents:
7debda3 (diff), 4285f384 (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 'upstream/master' into helenraid-para

File:
1 edited

Legend:

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

    r7debda3 rd30e067  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2010 Lenka Trochtova
    34 * All rights reserved.
     
    5051        refcount_init(&dev->refcnt);
    5152        list_initialize(&dev->functions);
     53        fibril_mutex_initialize(&dev->state_lock);
     54        fibril_condvar_initialize(&dev->state_cv);
    5255        link_initialize(&dev->driver_devices);
    5356
     
    8790        if (refcount_down(&dev->refcnt))
    8891                delete_dev_node(dev);
     92}
     93
     94/** Wait until the device node enters stable state.
     95 *
     96 * @param dev Device node
     97 */
     98void dev_wait_stable(dev_node_t *dev)
     99{
     100        fibril_mutex_lock(&dev->state_lock);
     101        while (dev->state == DEVICE_ATTACHING)
     102                fibril_condvar_wait(&dev->state_cv, &dev->state_lock);
     103        fibril_mutex_unlock(&dev->state_lock);
    89104}
    90105
Note: See TracChangeset for help on using the changeset viewer.