Ignore:
Timestamp:
2012-11-06T21:03:44Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
338810f
Parents:
de73242 (diff), 94795812 (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 mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.h

    rde73242 refdfebc  
    4444
    4545#include "completion_codes.h"
     46#include "mem_access.h"
    4647
    4748/**
     
    116117{
    117118        assert(instance);
    118         return (instance->td_head & ED_TDHEAD_HALTED_FLAG)
    119             || (instance->status & ED_STATUS_K_FLAG);
     119        return (OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_HALTED_FLAG)
     120            || (OHCI_MEM32_RD(instance->status) & ED_STATUS_K_FLAG);
     121}
     122
     123static inline void ed_clear_halt(ed_t *instance)
     124{
     125        assert(instance);
     126        OHCI_MEM32_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG);
    120127}
    121128
     
    128135{
    129136        assert(instance);
    130         return (instance->td_head & ED_TDHEAD_PTR_MASK)
    131             != (instance->td_tail & ED_TDTAIL_PTR_MASK);
     137        return (OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_PTR_MASK)
     138            != (OHCI_MEM32_RD(instance->td_tail) & ED_TDTAIL_PTR_MASK);
    132139}
    133140
     
    141148        assert(instance);
    142149        const uintptr_t pa = addr_to_phys(td);
    143         instance->td_tail = pa & ED_TDTAIL_PTR_MASK;
     150        OHCI_MEM32_WR(instance->td_tail, pa & ED_TDTAIL_PTR_MASK);
     151}
     152
     153static inline uint32_t ed_tail_td(const ed_t *instance)
     154{
     155        assert(instance);
     156        return OHCI_MEM32_RD(instance->td_tail) & ED_TDTAIL_PTR_MASK;
     157}
     158
     159static inline uint32_t ed_head_td(const ed_t *instance)
     160{
     161        assert(instance);
     162        return OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_PTR_MASK;
    144163}
    145164
     
    155174        const uint32_t pa = addr_to_phys(next);
    156175        assert((pa & ED_NEXT_PTR_MASK) << ED_NEXT_PTR_SHIFT == pa);
    157         instance->next = pa;
     176        OHCI_MEM32_WR(instance->next, pa);
     177}
     178
     179static inline uint32_t ed_next(const ed_t *instance)
     180{
     181        assert(instance);
     182        return OHCI_MEM32_RD(instance->next) & ED_NEXT_PTR_MASK;
    158183}
    159184
     
    166191{
    167192        assert(instance);
    168         return (instance->td_head & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0;
     193        return (OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0;
    169194}
    170195
     
    178203        assert(instance);
    179204        if (toggle) {
    180                 instance->td_head |= ED_TDHEAD_TOGGLE_CARRY;
     205                OHCI_MEM32_SET(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);
    181206        } else {
    182207                /* Clear halted flag when reseting toggle TODO: Why? */
    183                 instance->td_head &= ~ED_TDHEAD_TOGGLE_CARRY;
    184                 instance->td_head &= ~ED_TDHEAD_HALTED_FLAG;
     208                OHCI_MEM32_CLR(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);
     209                OHCI_MEM32_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG);
    185210        }
    186211}
Note: See TracChangeset for help on using the changeset viewer.