Ignore:
Timestamp:
2012-03-05T20:33:48Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b90e90
Parents:
d1ca752
Message:

ohci: Use different macros for register and memory access.

File:
1 edited

Legend:

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

    rd1ca752 r45f4f19  
    4040#include <usb/host/endpoint.h>
    4141
    42 #include "../ohci_regs.h"
    4342#include "../utils/malloc32.h"
    4443#include "transfer_descriptor.h"
    4544
    4645#include "completion_codes.h"
     46#include "mem_access.h"
    4747
    4848/**
     
    117117{
    118118        assert(instance);
    119         return (OHCI_RD(instance->td_head) & ED_TDHEAD_HALTED_FLAG)
    120             || (OHCI_RD(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);
    121121}
    122122
     
    124124{
    125125        assert(instance);
    126         OHCI_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG);
     126        OHCI_MEM32_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG);
    127127}
    128128
     
    135135{
    136136        assert(instance);
    137         return (OHCI_RD(instance->td_head) & ED_TDHEAD_PTR_MASK)
    138             != (OHCI_RD(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);
    139139}
    140140
     
    148148        assert(instance);
    149149        const uintptr_t pa = addr_to_phys(td);
    150         OHCI_WR(instance->td_tail, pa & ED_TDTAIL_PTR_MASK);
     150        OHCI_MEM32_WR(instance->td_tail, pa & ED_TDTAIL_PTR_MASK);
    151151}
    152152
     
    154154{
    155155        assert(instance);
    156         return OHCI_RD(instance->td_tail) & ED_TDTAIL_PTR_MASK;
     156        return OHCI_MEM32_RD(instance->td_tail) & ED_TDTAIL_PTR_MASK;
    157157}
    158158
     
    160160{
    161161        assert(instance);
    162         return OHCI_RD(instance->td_head) & ED_TDHEAD_PTR_MASK;
     162        return OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_PTR_MASK;
    163163}
    164164
     
    174174        const uint32_t pa = addr_to_phys(next);
    175175        assert((pa & ED_NEXT_PTR_MASK) << ED_NEXT_PTR_SHIFT == pa);
    176         OHCI_WR(instance->next, pa);
     176        OHCI_MEM32_WR(instance->next, pa);
    177177}
    178178
     
    180180{
    181181        assert(instance);
    182         return OHCI_RD(instance->next) & ED_NEXT_PTR_MASK;
     182        return OHCI_MEM32_RD(instance->next) & ED_NEXT_PTR_MASK;
    183183}
    184184
     
    191191{
    192192        assert(instance);
    193         return (OHCI_RD(instance->td_head) & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0;
     193        return (OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0;
    194194}
    195195
     
    203203        assert(instance);
    204204        if (toggle) {
    205                 OHCI_SET(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);
     205                OHCI_MEM32_SET(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);
    206206        } else {
    207207                /* Clear halted flag when reseting toggle TODO: Why? */
    208                 OHCI_CLR(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);
    209                 OHCI_CLR(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);
    210210        }
    211211}
Note: See TracChangeset for help on using the changeset viewer.