Changeset f1a9e87 in mainline for uspace/lib/c/arch/ia64/include/ddi.h


Ignore:
Timestamp:
2011-09-24T14:27:08Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b3bf143, eb87adb
Parents:
1ab4aca (diff), bd5f3b7 (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 from lp:~jakub/helenos/ia64-revival.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/ia64/include/ddi.h

    r1ab4aca rf1a9e87  
    5252static inline void pio_write_8(ioport8_t *port, uint8_t v)
    5353{
    54         uintptr_t prt = (uintptr_t) port;
     54        if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
     55                uintptr_t prt = (uintptr_t) port;
    5556
    56         *((ioport8_t *)(IA64_IOSPACE_ADDRESS +
    57             ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     57                *((ioport8_t *)(IA64_IOSPACE_ADDRESS +
     58                    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     59        } else {
     60                *port = v;
     61        }
    5862
    5963        asm volatile ("mf\n" ::: "memory");
     
    6266static inline void pio_write_16(ioport16_t *port, uint16_t v)
    6367{
    64         uintptr_t prt = (uintptr_t) port;
     68        if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
     69                uintptr_t prt = (uintptr_t) port;
    6570
    66         *((ioport16_t *)(IA64_IOSPACE_ADDRESS +
    67             ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     71                *((ioport16_t *)(IA64_IOSPACE_ADDRESS +
     72                    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     73        } else {
     74                *port = v;
     75        }
    6876
    6977        asm volatile ("mf\n" ::: "memory");
     
    7280static inline void pio_write_32(ioport32_t *port, uint32_t v)
    7381{
    74         uintptr_t prt = (uintptr_t) port;
     82        if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
     83                uintptr_t prt = (uintptr_t) port;
    7584
    76         *((ioport32_t *)(IA64_IOSPACE_ADDRESS +
    77             ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     85                *((ioport32_t *)(IA64_IOSPACE_ADDRESS +
     86                    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     87        } else {
     88                *port = v;
     89        }
    7890
    7991        asm volatile ("mf\n" ::: "memory");
     
    8294static inline uint8_t pio_read_8(ioport8_t *port)
    8395{
    84         uintptr_t prt = (uintptr_t) port;
     96        uint8_t v;
    8597
    8698        asm volatile ("mf\n" ::: "memory");
    8799
    88         return *((ioport8_t *)(IA64_IOSPACE_ADDRESS +
    89             ((prt & 0xfff) | ((prt >> 2) << 12))));
     100        if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
     101                uintptr_t prt = (uintptr_t) port;
     102
     103                v = *((ioport8_t *)(IA64_IOSPACE_ADDRESS +
     104                    ((prt & 0xfff) | ((prt >> 2) << 12))));
     105        } else {
     106                v = *port;
     107        }
     108
     109        return v;
    90110}
    91111
    92112static inline uint16_t pio_read_16(ioport16_t *port)
    93113{
    94         uintptr_t prt = (uintptr_t) port;
     114        uint16_t v;
    95115
    96116        asm volatile ("mf\n" ::: "memory");
    97117
    98         return *((ioport16_t *)(IA64_IOSPACE_ADDRESS +
    99             ((prt & 0xfff) | ((prt >> 2) << 12))));
     118        if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
     119                uintptr_t prt = (uintptr_t) port;
     120
     121                v = *((ioport16_t *)(IA64_IOSPACE_ADDRESS +
     122                    ((prt & 0xfff) | ((prt >> 2) << 12))));
     123        } else {
     124                v = *port;
     125        }
     126
     127        return v;
    100128}
    101129
    102130static inline uint32_t pio_read_32(ioport32_t *port)
    103131{
    104         uintptr_t prt = (uintptr_t) port;
     132        uint32_t v;
    105133
    106134        asm volatile ("mf\n" ::: "memory");
    107135
    108         return *((ioport32_t *)(IA64_IOSPACE_ADDRESS +
    109             ((prt & 0xfff) | ((prt >> 2) << 12))));
     136        if (port < (ioport32_t *) port) {
     137                uintptr_t prt = (uintptr_t) port;
     138
     139                v = *((ioport32_t *)(IA64_IOSPACE_ADDRESS +
     140                    ((prt & 0xfff) | ((prt >> 2) << 12))));
     141        } else {
     142                v = *port;
     143        }
     144
     145        return v;
    110146}
    111147
Note: See TracChangeset for help on using the changeset viewer.