Changeset bae9e76 in mainline
- Timestamp:
- 2011-01-25T18:09:20Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d5f7a8ab
- Parents:
- 643b983
- Location:
- uspace/drv/uhci/uhci_struct
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/uhci_struct/link_pointer.h
r643b983 rbae9e76 36 36 37 37 /* UHCI link pointer, used by many data structures */ 38 typedef struct link_pointer { 39 uint32_t addr:28; 40 uint8_t zero:1; 41 uint8_t reserved:1; 42 uint8_t qh:1; 43 uint8_t terminate:1; 44 } __attribute__((packed)) link_pointer_t; 38 typedef uint32_t link_pointer_t; 39 40 #define LINK_POINTER_TERMINATE_FLAG (1 << 0); 41 #define LINK_POINTER_QUEUE_HEAD_FLAG (1 << 1); 42 #define LINK_POINTER_ZERO_BIT_FLAG (1 << 2); 43 #define LINK_POINTER_RESERVED_FLAG (1 << 3); 44 45 #define LINK_POINTER_ADDRESS_MASK 0xfffffff0 /* upper 28 bits */ 45 46 46 47 #endif -
uspace/drv/uhci/uhci_struct/queue_head.h
r643b983 rbae9e76 38 38 #include <assert.h> 39 39 40 #include "translating_malloc.h"41 40 #include "link_pointer.h" 42 41 … … 46 45 } __attribute__((packed)) queue_head_t; 47 46 48 static inline void queue_head_init(queue_head_t *instance, uint32_t next_ pa)47 static inline void queue_head_init(queue_head_t *instance, uint32_t next_queue_pa) 49 48 { 50 49 assert(instance); 51 assert((next_ pa & 0xf) == 0);50 assert((next_queue_pa & LINK_POINTER_ADDRESS_MASK) == next_queue_pa); 52 51 53 memset(instance, 0, sizeof(*instance)); 54 instance->element.terminate = 1; 55 if (next_pa) { 56 instance->next_queue.terminate = 0; 57 instance->next_queue.addr = next_pa >> 4; 52 instance->element = 0 | LINK_POINTER_TERMINATE_FLAG; 53 if (next_queue_pa) { 54 instance->next_queue = (next_queue_pa & LINK_POINTER_ADDRESS_MASK) 55 | LINK_POINTER_QUEUE_HEAD_FLAG; 58 56 } else { 59 instance-> element.terminate = 1;57 instance->next_queue = 0 | LINK_POINTER_TERMINATE_FLAG; 60 58 } 61 59 }
Note:
See TracChangeset
for help on using the changeset viewer.