Home | History | Annotate | Download | only in arch
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ****************************************************************************
     11  ****************************************************************************/
     12 #ifndef __ASM_ARM_ARCH_IO_H
     13 #define __ASM_ARM_ARCH_IO_H
     14 
     15 #include <asm/hardware.h>
     16 
     17 #define IO_SPACE_LIMIT 0xffffffff
     18 
     19 #define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
     20 #define __mem_pci(a) (a)
     21 
     22 #define PCIO_BASE 0
     23 
     24 #ifndef __ASSEMBLER__
     25 
     26 #define omap_readb(a) (*(volatile unsigned char *)IO_ADDRESS(a))
     27 #define omap_readw(a) (*(volatile unsigned short *)IO_ADDRESS(a))
     28 #define omap_readl(a) (*(volatile unsigned int *)IO_ADDRESS(a))
     29 
     30 #define omap_writeb(v,a) (*(volatile unsigned char *)IO_ADDRESS(a) = (v))
     31 #define omap_writew(v,a) (*(volatile unsigned short *)IO_ADDRESS(a) = (v))
     32 #define omap_writel(v,a) (*(volatile unsigned int *)IO_ADDRESS(a) = (v))
     33 
     34 typedef struct { volatile u16 offset[256]; } __regbase16;
     35 #define __REGV16(vaddr) ((__regbase16 *)((vaddr)&~0xff))   ->offset[((vaddr)&0xff)>>1]
     36 #define __REG16(paddr) __REGV16(io_p2v(paddr))
     37 
     38 typedef struct { volatile u8 offset[4096]; } __regbase8;
     39 #define __REGV8(vaddr) ((__regbase8 *)((vaddr)&~4095))   ->offset[((vaddr)&4095)>>0]
     40 #define __REG8(paddr) __REGV8(io_p2v(paddr))
     41 
     42 typedef struct { volatile u32 offset[4096]; } __regbase32;
     43 #define __REGV32(vaddr) ((__regbase32 *)((vaddr)&~4095))   ->offset[((vaddr)&4095)>>2]
     44 #define __REG32(paddr) __REGV32(io_p2v(paddr))
     45 
     46 #else
     47 
     48 #define __REG8(paddr) io_p2v(paddr)
     49 #define __REG16(paddr) io_p2v(paddr)
     50 #define __REG32(paddr) io_p2v(paddr)
     51 
     52 #endif
     53 
     54 #endif
     55