Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset e63a4e1 in mainline


Ignore:
Timestamp:
2010-12-15T22:02:26Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
f37f811
Parents:
774afaae
Message:

A bit clean main() in VHC

Location:
uspace/drv/vhc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/vhc/hc.c

    r774afaae re63a4e1  
    102102/** Host controller manager main function.
    103103 */
    104 void hc_manager(void)
     104static int hc_manager_fibril(void *arg)
    105105{
    106106        list_initialize(&transaction_list);
     
    139139                free(transaction);
    140140        }
     141
     142        assert(false && "unreachable");
     143        return EOK;
     144}
     145
     146void hc_manager(void)
     147{
     148        fid_t fid = fibril_create(hc_manager_fibril, NULL);
     149        if (fid == 0) {
     150                printf(NAME ": failed to start HC manager fibril\n");
     151                return;
     152        }
     153        fibril_add_ready(fid);
    141154}
    142155
  • uspace/drv/vhc/hcd.c

    r774afaae re63a4e1  
    9595};
    9696
    97 /** Fibril wrapper for HC transaction manager.
    98  *
    99  * @param arg Not used.
    100  * @return Nothing, return argument is unreachable.
    101  */
    102 static int hc_manager_fibril(void *arg)
    103 {
    104         hc_manager();
    105         return EOK;
    106 }
    10797
    10898int main(int argc, char * argv[])
     
    112102         * in devman output.
    113103         */
    114         sleep(4);
     104        sleep(5);
     105
     106        usb_dprintf_enable(NAME, 0);
    115107
    116108        printf(NAME ": virtual USB host controller driver.\n");
    117109
    118         usb_dprintf_enable(NAME, 0);
    119 
    120         fid_t fid = fibril_create(hc_manager_fibril, NULL);
    121         if (fid == 0) {
    122                 printf(NAME ": failed to start HC manager fibril\n");
    123                 return ENOMEM;
    124         }
    125         fibril_add_ready(fid);
    126 
     110        hc_manager();
    127111
    128112        return driver_main(&vhc_driver);
Note: See TracChangeset for help on using the changeset viewer.