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

Ignore:
Timestamp:
2011-01-28T11:58:27Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial
Children:
eb03e92
Parents:
579dec2
Message:

Added get() and dispose() convenience functions()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/uhci_struct/transfer_descriptor.h

    r579dec2 rdcc5b9d  
    9595} __attribute__((packed)) transfer_descriptor_t;
    9696
     97
    9798void transfer_descriptor_init(transfer_descriptor_t *instance,
    9899  int error_count, size_t size, bool isochronous, usb_target_t target,
    99100        int pid);
    100101
     102static inline transfer_descriptor_t * transfer_descriptor_get(
     103  int error_count, size_t size, bool isochronous, usb_target_t target, int pid)
     104{
     105        transfer_descriptor_t * instance =
     106          trans_malloc(sizeof(transfer_descriptor_t));
     107
     108        if (instance)
     109                transfer_descriptor_init(
     110                  instance, error_count, size, isochronous, target, pid);
     111        return instance;
     112}
     113
    101114void transfer_descriptor_fini(transfer_descriptor_t *instance);
     115
     116static inline void transfer_descriptor_dispose(transfer_descriptor_t *instance)
     117{
     118        assert(instance);
     119        transfer_descriptor_fini(instance);
     120        trans_free(instance);
     121}
    102122
    103123static inline void transfer_descriptor_append(
Note: See TracChangeset for help on using the changeset viewer.