Changeset 7bd34e5 in mainline
- Timestamp:
- 2011-01-07T14:40:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8324b65
- Parents:
- 92f924c8
- Location:
- uspace/drv/uhci
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/Makefile
r92f924c8 r7bd34e5 39 39 root_hub/root_hub.c \ 40 40 uhci.c \ 41 utils/fibril_semaphore.c \ 41 42 utils/hc_synchronizer.c 42 43 -
uspace/drv/uhci/root_hub/port.c
r92f924c8 r7bd34e5 185 185 return EOK; 186 186 } 187 187 188 static usb_address_t assign_address_to_zero_device( device_t *hc ) 188 189 { … … 211 212 212 213 sync_value_t value; 214 sync_init(&value); 213 215 214 216 uhci_setup( … … 217 219 uhci_print_verbose("address assignment sent, waiting to complete.\n"); 218 220 219 //sync_wait_for(&value);221 sync_wait_for(&value); 220 222 221 223 uhci_print_info( "Assigned address %#x.\n", usb_address ); -
uspace/drv/uhci/utils/hc_synchronizer.c
r92f924c8 r7bd34e5 1 1 #include "hc_synchronizer.h" 2 2 3 void sync_init(sync_value_t *value) 4 { 5 assert(value); 6 fibril_semaphore_initialize(&value->done, 0); 7 } 8 /*----------------------------------------------------------------------------*/ 3 9 void sync_wait_for(sync_value_t *value) 4 10 { 5 11 assert( value ); 6 value->waiting_fibril = fibril_get_id(); 7 uhci_print_verbose("turning off fibril %p.\n", value->waiting_fibril); 8 fibril_switch(FIBRIL_TO_MANAGER); 12 fibril_semaphore_down(&value->done); 9 13 } 10 14 /*----------------------------------------------------------------------------*/ … … 16 20 value->size = size; 17 21 value->result = result; 18 fibril_ add_ready(value->waiting_fibril);22 fibril_semaphore_up(&value->done); 19 23 } 20 24 /*----------------------------------------------------------------------------*/ … … 25 29 assert(value); 26 30 value->result = result; 27 uhci_print_verbose("resuming fibril %p.\n", value->waiting_fibril); 28 fibril_add_ready(value->waiting_fibril); 31 fibril_semaphore_up(&value->done); 29 32 } -
uspace/drv/uhci/utils/hc_synchronizer.h
r92f924c8 r7bd34e5 37 37 #include <assert.h> 38 38 #include <driver.h> 39 #include <fibril.h>40 39 #include <usb/usb.h> 41 40 42 41 #include "debug.h" 42 #include "utils/fibril_semaphore.h" 43 43 44 44 typedef struct value 45 45 { 46 46 /* TODO Think of better fibril synch to use */ 47 fid_t waiting_fibril;48 47 usb_transaction_outcome_t result; 49 48 size_t size; 50 booldone;49 fibril_semaphore_t done; 51 50 } sync_value_t; 51 52 void sync_init(sync_value_t *value); 52 53 53 54 void sync_wait_for(sync_value_t *value);
Note:
See TracChangeset
for help on using the changeset viewer.