Changeset 8033f89 in mainline for uspace/drv/bus/usb/xhci/hw_struct/common.h
- Timestamp:
- 2018-01-23T12:41:22Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e7e1fd3
- Parents:
- e546142
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hw_struct/common.h
re546142 r8033f89 59 59 typedef volatile uint64_t xhci_qword_t __attribute__((aligned(8))); 60 60 61 #define XHCI_DWORD_EXTRACT(field, hi, lo) (BIT_RANGE_EXTRACT(uint32_t, hi, lo, xhci2host(32, field))) 62 #define XHCI_QWORD_EXTRACT(field, hi, lo) (BIT_RANGE_EXTRACT(uint64_t, hi, lo, xhci2host(64, field))) 61 #define XHCI_DWORD_EXTRACT(field, hi, lo) \ 62 (BIT_RANGE_EXTRACT(uint32_t, hi, lo, xhci2host(32, field))) 63 #define XHCI_QWORD_EXTRACT(field, hi, lo) \ 64 (BIT_RANGE_EXTRACT(uint64_t, hi, lo, xhci2host(64, field))) 63 65 64 66 /** … … 67 69 * Not thread-safe, proper synchronization over this dword must be assured. 68 70 */ 69 static inline void xhci_dword_set_bits(xhci_dword_t *storage, uint32_t value, unsigned hi, unsigned lo) 71 static inline void xhci_dword_set_bits(xhci_dword_t *storage, uint32_t value, 72 unsigned hi, unsigned lo) 70 73 { 71 74 const uint32_t mask = host2xhci(32, BIT_RANGE(uint32_t, hi, lo)); … … 82 85 } 83 86 84 static inline void xhci_qword_set_bits(xhci_qword_t *storage, uint64_t value, unsigned hi, unsigned lo) 87 static inline void xhci_qword_set_bits(xhci_qword_t *storage, uint64_t value, 88 unsigned hi, unsigned lo) 85 89 { 86 90 const uint64_t mask = host2xhci(64, BIT_RANGE(uint64_t, hi, lo)); … … 89 93 } 90 94 91 static inline int xhci_reg_wait(xhci_dword_t *reg, uint32_t mask, uint32_t expected) 95 static inline int xhci_reg_wait(xhci_dword_t *reg, uint32_t mask, 96 uint32_t expected) 92 97 { 93 98 mask = host2xhci(32, mask);
Note:
See TracChangeset
for help on using the changeset viewer.