Ignore:
Timestamp:
2011-03-13T22:02:44Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
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.
Message:

Merge development/ changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/uhci_struct/queue_head.h

    r67f54965 r1b0b86e6  
    4343
    4444typedef struct queue_head {
    45         volatile link_pointer_t next_queue;
     45        volatile link_pointer_t next;
    4646        volatile link_pointer_t element;
    47 } __attribute__((packed)) queue_head_t;
    48 
    49 static inline void queue_head_init(queue_head_t *instance)
     47} __attribute__((packed)) qh_t;
     48/*----------------------------------------------------------------------------*/
     49static inline void qh_init(qh_t *instance)
    5050{
    5151        assert(instance);
    5252
    5353        instance->element = 0 | LINK_POINTER_TERMINATE_FLAG;
    54         instance->next_queue = 0 | LINK_POINTER_TERMINATE_FLAG;
     54        instance->next = 0 | LINK_POINTER_TERMINATE_FLAG;
    5555}
    56 
    57 static inline void queue_head_append_qh(queue_head_t *instance, uint32_t pa)
     56/*----------------------------------------------------------------------------*/
     57static inline void qh_set_next_qh(qh_t *instance, uint32_t pa)
    5858{
    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)
    6162                    | LINK_POINTER_QUEUE_HEAD_FLAG;
     63        } else {
     64                instance->next = 0 | LINK_POINTER_TERMINATE_FLAG;
    6265        }
    6366}
    64 
    65 static inline void queue_head_element_qh(queue_head_t *instance, uint32_t pa)
     67/*----------------------------------------------------------------------------*/
     68static inline void qh_set_element_qh(qh_t *instance, uint32_t pa)
    6669{
    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)
    6973                    | LINK_POINTER_QUEUE_HEAD_FLAG;
     74        } else {
     75                instance->element = 0 | LINK_POINTER_TERMINATE_FLAG;
    7076        }
    7177}
    72 
    73 static inline void queue_head_set_element_td(queue_head_t *instance, uint32_t pa)
     78/*----------------------------------------------------------------------------*/
     79static inline void qh_set_element_td(qh_t *instance, uint32_t pa)
    7480{
    75         if (pa) {
     81        if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) {
    7682                instance->element = (pa & LINK_POINTER_ADDRESS_MASK);
     83        } else {
     84                instance->element = 0 | LINK_POINTER_TERMINATE_FLAG;
    7785        }
    7886}
Note: See TracChangeset for help on using the changeset viewer.