Changeset 1b0b86e6 in mainline for uspace/drv/uhci-hcd/uhci_struct/queue_head.h
- Timestamp:
- 2011-03-13T22:02:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b7d8fd9
- Parents:
- 67f54965 (diff), deb4ba7 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/uhci_struct/queue_head.h
r67f54965 r1b0b86e6 43 43 44 44 typedef struct queue_head { 45 volatile link_pointer_t next _queue;45 volatile link_pointer_t next; 46 46 volatile link_pointer_t element; 47 } __attribute__((packed)) q ueue_head_t;48 49 static inline void q ueue_head_init(queue_head_t *instance)47 } __attribute__((packed)) qh_t; 48 /*----------------------------------------------------------------------------*/ 49 static inline void qh_init(qh_t *instance) 50 50 { 51 51 assert(instance); 52 52 53 53 instance->element = 0 | LINK_POINTER_TERMINATE_FLAG; 54 instance->next _queue= 0 | LINK_POINTER_TERMINATE_FLAG;54 instance->next = 0 | LINK_POINTER_TERMINATE_FLAG; 55 55 } 56 57 static inline void q ueue_head_append_qh(queue_head_t *instance, uint32_t pa)56 /*----------------------------------------------------------------------------*/ 57 static inline void qh_set_next_qh(qh_t *instance, uint32_t pa) 58 58 { 59 if (pa) { 60 instance->next_queue = (pa & LINK_POINTER_ADDRESS_MASK) 59 /* address is valid and not terminal */ 60 if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) { 61 instance->next = (pa & LINK_POINTER_ADDRESS_MASK) 61 62 | LINK_POINTER_QUEUE_HEAD_FLAG; 63 } else { 64 instance->next = 0 | LINK_POINTER_TERMINATE_FLAG; 62 65 } 63 66 } 64 65 static inline void q ueue_head_element_qh(queue_head_t *instance, uint32_t pa)67 /*----------------------------------------------------------------------------*/ 68 static inline void qh_set_element_qh(qh_t *instance, uint32_t pa) 66 69 { 67 if (pa) { 68 instance->next_queue = (pa & LINK_POINTER_ADDRESS_MASK) 70 /* address is valid and not terminal */ 71 if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) { 72 instance->element = (pa & LINK_POINTER_ADDRESS_MASK) 69 73 | LINK_POINTER_QUEUE_HEAD_FLAG; 74 } else { 75 instance->element = 0 | LINK_POINTER_TERMINATE_FLAG; 70 76 } 71 77 } 72 73 static inline void q ueue_head_set_element_td(queue_head_t *instance, uint32_t pa)78 /*----------------------------------------------------------------------------*/ 79 static inline void qh_set_element_td(qh_t *instance, uint32_t pa) 74 80 { 75 if (pa ) {81 if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) { 76 82 instance->element = (pa & LINK_POINTER_ADDRESS_MASK); 83 } else { 84 instance->element = 0 | LINK_POINTER_TERMINATE_FLAG; 77 85 } 78 86 }
Note:
See TracChangeset
for help on using the changeset viewer.