Changeset 5542b83 in mainline for uspace/lib
- Timestamp:
- 2011-04-02T15:47:45Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 322a8066, d8987b1
- Parents:
- 969585f (diff), 0053fa38 (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. - Location:
- uspace/lib
- Files:
-
- 2 added
- 5 edited
-
c/generic/adt/hash_table.c (modified) (1 diff)
-
c/include/adt/hash_table.h (modified) (2 diffs)
-
usb/Makefile (modified) (1 diff)
-
usb/include/usb/host/bandwidth.h (added)
-
usb/include/usb/host/device_keeper.h (modified) (2 diffs)
-
usb/src/host/bandwidth.c (added)
-
usb/src/host/device_keeper.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/adt/hash_table.c
r969585f r5542b83 54 54 * 55 55 */ 56 inthash_table_create(hash_table_t *h, hash_count_t m, hash_count_t max_keys,56 bool hash_table_create(hash_table_t *h, hash_count_t m, hash_count_t max_keys, 57 57 hash_table_operations_t *op) 58 58 { -
uspace/lib/c/include/adt/hash_table.h
r969585f r5542b83 38 38 #include <adt/list.h> 39 39 #include <unistd.h> 40 #include <bool.h> 40 41 41 42 typedef unsigned long hash_count_t; … … 83 84 list_get_instance((item), type, member) 84 85 85 extern inthash_table_create(hash_table_t *, hash_count_t, hash_count_t,86 extern bool hash_table_create(hash_table_t *, hash_count_t, hash_count_t, 86 87 hash_table_operations_t *); 87 88 extern void hash_table_insert(hash_table_t *, unsigned long [], link_t *); -
uspace/lib/usb/Makefile
r969585f r5542b83 53 53 src/hidreport.c \ 54 54 src/host/device_keeper.c \ 55 src/host/batch.c 55 src/host/batch.c \ 56 src/host/bandwidth.c 56 57 57 58 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/usb/include/usb/host/device_keeper.h
r969585f r5542b83 51 51 usb_speed_t speed; 52 52 bool occupied; 53 boolcontrol_used;53 uint16_t control_used; 54 54 uint16_t toggle_status[2]; 55 55 devman_handle_t handle; … … 99 99 100 100 void usb_device_keeper_use_control(usb_device_keeper_t *instance, 101 usb_ address_t address);101 usb_target_t target); 102 102 103 103 void usb_device_keeper_release_control(usb_device_keeper_t *instance, 104 usb_ address_t address);104 usb_target_t target); 105 105 106 106 #endif -
uspace/lib/usb/src/host/device_keeper.c
r969585f r5542b83 54 54 for (; i < USB_ADDRESS_COUNT; ++i) { 55 55 instance->devices[i].occupied = false; 56 instance->devices[i].control_used = false;56 instance->devices[i].control_used = 0; 57 57 instance->devices[i].handle = 0; 58 58 instance->devices[i].toggle_status[0] = 0; … … 311 311 /*----------------------------------------------------------------------------*/ 312 312 void usb_device_keeper_use_control(usb_device_keeper_t *instance, 313 usb_address_t address) 314 { 315 assert(instance); 316 fibril_mutex_lock(&instance->guard); 317 while (instance->devices[address].control_used) { 313 usb_target_t target) 314 { 315 assert(instance); 316 const uint16_t ep = 1 << target.endpoint; 317 fibril_mutex_lock(&instance->guard); 318 while (instance->devices[target.address].control_used & ep) { 318 319 fibril_condvar_wait(&instance->change, &instance->guard); 319 320 } 320 instance->devices[ address].control_used = true;321 instance->devices[target.address].control_used |= ep; 321 322 fibril_mutex_unlock(&instance->guard); 322 323 } 323 324 /*----------------------------------------------------------------------------*/ 324 325 void usb_device_keeper_release_control(usb_device_keeper_t *instance, 325 usb_address_t address) 326 { 327 assert(instance); 328 fibril_mutex_lock(&instance->guard); 329 instance->devices[address].control_used = false; 326 usb_target_t target) 327 { 328 assert(instance); 329 const uint16_t ep = 1 << target.endpoint; 330 fibril_mutex_lock(&instance->guard); 331 assert((instance->devices[target.address].control_used & ep) != 0); 332 instance->devices[target.address].control_used &= ~ep; 330 333 fibril_mutex_unlock(&instance->guard); 331 334 fibril_condvar_signal(&instance->change);
Note:
See TracChangeset
for help on using the changeset viewer.
