5 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
8 I/O operations, generic header.
11 #include <aros/macros.h>
13 /* Include the actual CPU-dependent definitions */
15 # include <asm/i386/io.h>
16 #elif defined __x86_64__
17 /* I/O operations are the same on i386 and x86-64 */
18 # include <asm/i386/io.h>
19 #elif defined __powerpc__
20 # include <asm/ppc/io.h>
23 /* Default version for memory-mapped I/O with strong ordering */
25 #define inb(address) (*((volatile unsigned char *)(address)))
26 #define inw(address) (*((volatile unsigned short *)(address)))
27 #define inl(address) (*((volatile unsigned int *)(address)))
29 #define outb(value, address) *((volatile unsigned char *)(address)) = (value)
30 #define outw(value, address) *((volatile unsigned short *)(address)) = (value)
31 #define outl(value, address) *((volatile unsigned int *)(address)) = (value)
41 #define mmio_inb(address) (*((volatile unsigned char *)(address)))
42 #define mmio_inw(address) (*((volatile unsigned short *)(address)))
43 #define mmio_inl(address) (*((volatile unsigned int *)(address)))
45 #define mmio_outb(value, address) *((volatile unsigned char *)(address)) = (value)
46 #define mmio_outw(value, address) *((volatile unsigned short *)(address)) = (value)
47 #define mmio_outl(value, address) *((volatile unsigned int *)(address)) = (value)
53 #define inw_le(address) AROS_LE2WORD(inw(address))
54 #define inl_le(address) AROS_LE2LONG(inl(address))
56 #define outw_le(value, address) outw(AROS_WORD2LE(value), address)
57 #define outl_le(value, address) outl(AROS_LONG2LE(value), address)
61 #ifndef HAVE_LE_MMIO_IO
63 #define mmio_inw_le(address) AROS_LE2WORD(mmio_inw(address))
64 #define mmio_inl_le(address) AROS_LE2LONG(mmio_inl(address))
66 #define mmio_outw_le(value, address) mmio_outw(AROS_WORD2LE(value), address)
67 #define mmio_outl_le(value, address) mmio_outl(AROS_LONG2LE(value), address)