Changes in uspace/drv/uhci-hcd/hw_struct/queue_head.h [9d2d444:1e70157] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/hw_struct/queue_head.h
r9d2d444 r1e70157 34 34 #ifndef DRV_UHCI_QH_H 35 35 #define DRV_UHCI_QH_H 36 37 /* libc */ 36 38 #include <assert.h> 37 39 38 40 #include "link_pointer.h" 39 #include "transfer_descriptor.h"40 #include "utils/malloc32.h"41 41 42 /** This structure is defined in UHCI design guide p. 31 */43 42 typedef struct queue_head { 44 /** Pointer to the next entity (another QH or TD */45 43 volatile link_pointer_t next; 46 /** Pointer to the contained entities (execution controlled by vertical flag*/47 44 volatile link_pointer_t element; 48 45 } __attribute__((packed)) qh_t; … … 67 64 * @param[in] pa Physical address of the next queue head. 68 65 * 69 * Adds proper flag. If the pointer is NULL, sets next to terminal NULL. 66 * Adds proper flag. If the pointer is NULL or terminal, sets next to terminal 67 * NULL. 70 68 */ 71 static inline void qh_set_next_qh(qh_t *instance, qh_t *next)69 static inline void qh_set_next_qh(qh_t *instance, uint32_t pa) 72 70 { 73 uint32_t pa = addr_to_phys(next);74 if (pa ) {71 /* Address is valid and not terminal */ 72 if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) { 75 73 instance->next = LINK_POINTER_QH(pa); 76 74 } else { … … 82 80 * 83 81 * @param[in] instance qh_t structure to initialize. 82 * @param[in] pa Physical address of the next queue head. 83 * 84 * Adds proper flag. If the pointer is NULL or terminal, sets element 85 * to terminal NULL. 86 */ 87 static inline void qh_set_element_qh(qh_t *instance, uint32_t pa) 88 { 89 /* Address is valid and not terminal */ 90 if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) { 91 instance->element = LINK_POINTER_QH(pa); 92 } else { 93 instance->element = LINK_POINTER_TERM; 94 } 95 } 96 /*----------------------------------------------------------------------------*/ 97 /** Set queue head element pointer 98 * 99 * @param[in] instance qh_t structure to initialize. 84 100 * @param[in] pa Physical address of the TD structure. 85 101 * 86 * Adds proper flag. If the pointer is NULL, sets element to terminal NULL. 102 * Adds proper flag. If the pointer is NULL or terminal, sets element 103 * to terminal NULL. 87 104 */ 88 static inline void qh_set_element_td(qh_t *instance, td_t *td)105 static inline void qh_set_element_td(qh_t *instance, uint32_t pa) 89 106 { 90 uint32_t pa = addr_to_phys(td); 91 if (pa) { 107 if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) { 92 108 instance->element = LINK_POINTER_TD(pa); 93 109 } else { … … 95 111 } 96 112 } 113 97 114 #endif 98 115 /**
Note:
See TracChangeset
for help on using the changeset viewer.