Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
io.h File Reference
#include <mach/hardware.h>

Go to the source code of this file.

Macros

#define IO_SPACE_LIMIT   0xffffffff
 
#define __PORT_PCIO(x)   ((x) < (1<<28))
 
#define PCIO_BASE   (S3C24XX_VA_ISA_WORD)
 
#define PCIO_BASE_b   (S3C24XX_VA_ISA_BYTE)
 
#define PCIO_BASE_w   (S3C24XX_VA_ISA_WORD)
 
#define PCIO_BASE_l   (S3C24XX_VA_ISA_WORD)
 
#define DECLARE_DYN_OUT(sz, fnsuffix, instr)
 
#define DECLARE_DYN_IN(sz, fnsuffix, instr)
 
#define DECLARE_IO(sz, fnsuffix, instr)
 
#define __outbc(value, port)
 
#define __inbc(port)
 
#define __outwc(value, port)
 
#define __inwc(port)
 
#define __outlc(value, port)
 
#define __inlc(port)
 
#define __ioaddrc(port)   ((__PORT_PCIO(port) ? PCIO_BASE + (port) : (void __iomem *)(port)))
 
#define inb(p)   (__builtin_constant_p((p)) ? __inbc(p) : __inb(p))
 
#define inw(p)   (__builtin_constant_p((p)) ? __inwc(p) : __inw(p))
 
#define inl(p)   (__builtin_constant_p((p)) ? __inlc(p) : __inl(p))
 
#define outb(v, p)   (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p))
 
#define outw(v, p)   (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
 
#define outl(v, p)   (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
 
#define __ioaddr(p)   (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p))
 
#define insb(p, d, l)   __raw_readsb(__ioaddr(p),d,l)
 
#define insw(p, d, l)   __raw_readsw(__ioaddr(p),d,l)
 
#define insl(p, d, l)   __raw_readsl(__ioaddr(p),d,l)
 
#define outsb(p, d, l)   __raw_writesb(__ioaddr(p),d,l)
 
#define outsw(p, d, l)   __raw_writesw(__ioaddr(p),d,l)
 
#define outsl(p, d, l)   __raw_writesl(__ioaddr(p),d,l)
 

Macro Definition Documentation

#define __inbc (   port)
Value:
({ \
unsigned char result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
"ldrb %0, [%1, %2] @ inbc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port))); \
else \
__asm__ __volatile__( \
"ldrb %0, [%1, #0] @ inbc" \
: "=r" (result) : "r" ((port))); \
result; \
})

Definition at line 99 of file io.h.

#define __inlc (   port)
Value:
({ \
unsigned long result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
"ldr %0, [%1, %2] @ inlc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port))); \
else \
__asm__ __volatile__( \
"ldr %0, [%1, #0] @ inlc" \
: "=r" (result) : "r" ((port))); \
result; \
})

Definition at line 179 of file io.h.

#define __inwc (   port)
Value:
({ \
unsigned short result; \
if (__PORT_PCIO((port))) { \
if ((port) < 256 && (port) > -256 ) \
__asm__ __volatile__( \
"ldrh %0, [%1, %2] @ inwc" \
: "=r" (result) \
: "r" (PCIO_BASE), \
"Jr" ((port))); \
else if ((port) > 0) \
__asm__ __volatile__( \
"ldrh %0, [%1, %2] @ inwc" \
: "=r" (result) \
: "r" (PCIO_BASE + ((port) & ~0xff)), \
"Jr" (((port) & 0xff))); \
else \
__asm__ __volatile__( \
"ldrh %0, [%1, #0] @ inwc" \
: "=r" (result) \
: "r" (PCIO_BASE + ((port)))); \
} else \
__asm__ __volatile__( \
"ldrh %0, [%1, #0] @ inwc" \
: "=r" (result) : "r" ((port))); \
result; \
})

Definition at line 138 of file io.h.

#define __ioaddr (   p)    (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p))

Definition at line 201 of file io.h.

#define __ioaddrc (   port)    ((__PORT_PCIO(port) ? PCIO_BASE + (port) : (void __iomem *)(port)))

Definition at line 193 of file io.h.

#define __outbc (   value,
  port 
)
Value:
({ \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
"strb %0, [%1, %2] @ outbc" \
: : "r" (value), "r" (PCIO_BASE), "Jr" ((port))); \
else \
__asm__ __volatile__( \
"strb %0, [%1, #0] @ outbc" \
: : "r" (value), "r" ((port))); \
})

Definition at line 87 of file io.h.

#define __outlc (   value,
  port 
)
Value:
({ \
unsigned long v = value; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
"str %0, [%1, %2] @ outlc" \
: : "r" (v), "r" (PCIO_BASE), "Jr" ((port))); \
else \
__asm__ __volatile__( \
"str %0, [%1, #0] @ outlc" \
: : "r" (v), "r" ((port))); \
})

Definition at line 166 of file io.h.

#define __outwc (   value,
  port 
)
Value:
({ \
unsigned long v = value; \
if (__PORT_PCIO((port))) { \
if ((port) < 256 && (port) > -256) \
__asm__ __volatile__( \
"strh %0, [%1, %2] @ outwc" \
: : "r" (v), "r" (PCIO_BASE), "Jr" ((port))); \
else if ((port) > 0) \
__asm__ __volatile__( \
"strh %0, [%1, %2] @ outwc" \
: : "r" (v), \
"r" (PCIO_BASE + ((port) & ~0xff)), \
"Jr" (((port) & 0xff))); \
else \
__asm__ __volatile__( \
"strh %0, [%1, #0] @ outwc" \
: : "r" (v), \
"r" (PCIO_BASE + (port))); \
} else \
__asm__ __volatile__( \
"strh %0, [%1, #0] @ outwc" \
: : "r" (v), "r" ((port))); \
})

Definition at line 113 of file io.h.

#define __PORT_PCIO (   x)    ((x) < (1<<28))

Definition at line 24 of file io.h.

#define DECLARE_DYN_IN (   sz,
  fnsuffix,
  instr 
)
Value:
static inline unsigned sz __in##fnsuffix (unsigned int port) \
{ \
unsigned long temp, value; \
__asm__ __volatile__( \
"cmp %2, #(1<<28)\n\t" \
"mov %0, %2\n\t" \
"addcc %0, %0, %3\n\t" \
"ldr" instr " %1, [%0, #0 ] @ in" #fnsuffix \
: "=&r" (temp), "=r" (value) \
: "r" (port), "Ir" (PCIO_BASE_##fnsuffix) \
: "cc"); \
return (unsigned sz)value; \
}

Definition at line 50 of file io.h.

#define DECLARE_DYN_OUT (   sz,
  fnsuffix,
  instr 
)
Value:
static inline void __out##fnsuffix (unsigned int val, unsigned int port) \
{ \
unsigned long temp; \
__asm__ __volatile__( \
"cmp %2, #(1<<28)\n\t" \
"mov %0, %2\n\t" \
"addcc %0, %0, %3\n\t" \
"str" instr " %1, [%0, #0 ] @ out" #fnsuffix \
: "=&r" (temp) \
: "r" (val), "r" (port), "Ir" (PCIO_BASE_##fnsuffix) \
: "cc"); \
}

Definition at line 35 of file io.h.

#define DECLARE_IO (   sz,
  fnsuffix,
  instr 
)
Value:
DECLARE_DYN_IN(sz,fnsuffix,instr) \
DECLARE_DYN_OUT(sz,fnsuffix,instr)

Definition at line 70 of file io.h.

#define inb (   p)    (__builtin_constant_p((p)) ? __inbc(p) : __inb(p))

Definition at line 195 of file io.h.

#define inl (   p)    (__builtin_constant_p((p)) ? __inlc(p) : __inl(p))

Definition at line 197 of file io.h.

#define insb (   p,
  d,
  l 
)    __raw_readsb(__ioaddr(p),d,l)

Definition at line 203 of file io.h.

#define insl (   p,
  d,
  l 
)    __raw_readsl(__ioaddr(p),d,l)

Definition at line 205 of file io.h.

#define insw (   p,
  d,
  l 
)    __raw_readsw(__ioaddr(p),d,l)

Definition at line 204 of file io.h.

#define inw (   p)    (__builtin_constant_p((p)) ? __inwc(p) : __inw(p))

Definition at line 196 of file io.h.

#define IO_SPACE_LIMIT   0xffffffff

Definition at line 14 of file io.h.

#define outb (   v,
  p 
)    (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p))

Definition at line 198 of file io.h.

#define outl (   v,
  p 
)    (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))

Definition at line 200 of file io.h.

#define outsb (   p,
  d,
  l 
)    __raw_writesb(__ioaddr(p),d,l)

Definition at line 207 of file io.h.

#define outsl (   p,
  d,
  l 
)    __raw_writesl(__ioaddr(p),d,l)

Definition at line 209 of file io.h.

#define outsw (   p,
  d,
  l 
)    __raw_writesw(__ioaddr(p),d,l)

Definition at line 208 of file io.h.

#define outw (   v,
  p 
)    (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))

Definition at line 199 of file io.h.

#define PCIO_BASE   (S3C24XX_VA_ISA_WORD)

Definition at line 26 of file io.h.

#define PCIO_BASE_b   (S3C24XX_VA_ISA_BYTE)

Definition at line 27 of file io.h.

#define PCIO_BASE_l   (S3C24XX_VA_ISA_WORD)

Definition at line 29 of file io.h.

#define PCIO_BASE_w   (S3C24XX_VA_ISA_WORD)

Definition at line 28 of file io.h.