8static __inline__
unsigned char inb(
unsigned short port)
11 __asm__ __volatile__ (
"inb %w1, %0\n\t"
17static __inline__
unsigned short inw(
unsigned short port)
19 unsigned short retval;
20 __asm__ __volatile__ (
"inw %w1, %0\n\t"
26static __inline__
unsigned int inl(
int port)
29 __asm__ __volatile__ (
"inl %w1, %0\n\t"
35static __inline__
void outb(
int port,
unsigned char val)
37 __asm__ __volatile__ (
"outb %0, %w1\n\t"
43static __inline__
void outw(
int port,
unsigned short val)
45 __asm__ __volatile__ (
"outw %0, %w1\n\t"
51static __inline__
void outl(
int port,
unsigned int val)
53 __asm__ __volatile__ (
"outl %0, %w1\n\t"
59static __inline__
void insb(
int port,
void *
buf,
int cnt)
61 __asm__ __volatile__ (
"cld\n\trepne\n\tinsb\n\t"
62 :
"=D" (
buf),
"=c" (cnt)
63 :
"d" (port),
"0" (
buf),
"1" (cnt) :
"memory",
"cc");
66static __inline__
void insw(
int port,
void *
buf,
int cnt)
68 __asm__ __volatile__ (
"cld\n\trepne\n\tinsw\n\t"
69 :
"=D" (
buf),
"=c" (cnt)
70 :
"d" (port),
"0" (
buf),
"1" (cnt) :
"memory",
"cc");
73static __inline__
void insl(
int port,
void *
buf,
int cnt)
75 __asm__ __volatile__ (
"cld\n\trepne\n\tinsl\n\t"
76 :
"=D" (
buf),
"=c" (cnt)
77 :
"d" (port),
"0" (
buf),
"1" (cnt) :
"memory",
"cc");
80static __inline__
void outsb(
int port,
const void *
buf,
int cnt)
82 __asm__ __volatile__ (
"cld\n\trepne\n\toutsb\n\t"
83 :
"=S" (
buf),
"=c" (cnt)
84 :
"d" (port),
"0" (
buf),
"1" (cnt) :
"cc");
87static __inline__
void outsw(
int port,
const void *
buf,
int cnt)
89 __asm__ __volatile__ (
"cld\n\trepne\n\toutsw\n\t"
90 :
"=S" (
buf),
"=c" (cnt)
91 :
"d" (port),
"0" (
buf),
"1" (cnt) :
"cc");
94static __inline__
void outsl(
int port,
const void *
buf,
int cnt)
96 __asm__ __volatile__ (
"cld\n\trepne\n\toutsl\n\t"
97 :
"=S" (
buf),
"=c" (cnt)
98 :
"d" (port),
"0" (
buf),
"1" (cnt) :
"cc");
static __inline__ void outsw(int port, const void *buf, int cnt)
static __inline__ void outw(int port, unsigned short val)
static __inline__ unsigned int inl(int port)
static __inline__ void outb(int port, unsigned char val)
static __inline__ void outsl(int port, const void *buf, int cnt)
static __inline__ void insb(int port, void *buf, int cnt)
static __inline__ void outl(int port, unsigned int val)
static __inline__ unsigned char inb(unsigned short port)
static __inline__ unsigned short inw(unsigned short port)
static __inline__ void insl(int port, void *buf, int cnt)
static __inline__ void outsb(int port, const void *buf, int cnt)
static __inline__ void insw(int port, void *buf, int cnt)