Loading [MathJax]/extensions/tex2jax.js
CS350 COS
COS
All Data Structures Files Functions Variables Typedefs Macros
ioport.h File Reference
#include <stdint.h>
Include dependency graph for ioport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static __inline__ unsigned char inb (unsigned short port)
 
static __inline__ unsigned short inw (unsigned short port)
 
static __inline__ unsigned int inl (int port)
 
static __inline__ void outb (int port, unsigned char val)
 
static __inline__ void outw (int port, unsigned short val)
 
static __inline__ void outl (int port, unsigned int val)
 
static __inline__ void insb (int port, void *buf, int cnt)
 
static __inline__ void insw (int port, void *buf, int cnt)
 
static __inline__ void insl (int port, void *buf, int cnt)
 
static __inline__ void outsb (int port, const void *buf, int cnt)
 
static __inline__ void outsw (int port, const void *buf, int cnt)
 
static __inline__ void outsl (int port, const void *buf, int cnt)
 

Function Documentation

◆ inb()

static __inline__ unsigned char inb ( unsigned short  port)
static

Definition at line 8 of file ioport.h.

9{
10 unsigned char retval;
11 __asm__ __volatile__ ("inb %w1, %0\n\t"
12 : "=a" (retval)
13 : "d" (port));
14 return retval;
15}

◆ inl()

static __inline__ unsigned int inl ( int  port)
static

Definition at line 26 of file ioport.h.

27{
28 unsigned int retval;
29 __asm__ __volatile__ ("inl %w1, %0\n\t"
30 : "=a" (retval)
31 : "d" (port));
32 return retval;
33}

◆ insb()

static __inline__ void insb ( int  port,
void *  buf,
int  cnt 
)
static

Definition at line 59 of file ioport.h.

60{
61 __asm__ __volatile__ ("cld\n\trepne\n\tinsb\n\t"
62 : "=D" (buf), "=c" (cnt)
63 : "d" (port), "0" (buf), "1" (cnt) : "memory", "cc");
64}
static char buf[4096]
Definition: ethdump.c:10

◆ insl()

static __inline__ void insl ( int  port,
void *  buf,
int  cnt 
)
static

Definition at line 73 of file ioport.h.

74{
75 __asm__ __volatile__ ("cld\n\trepne\n\tinsl\n\t"
76 : "=D" (buf), "=c" (cnt)
77 : "d" (port), "0" (buf), "1" (cnt) : "memory", "cc");
78}

◆ insw()

static __inline__ void insw ( int  port,
void *  buf,
int  cnt 
)
static

Definition at line 66 of file ioport.h.

67{
68 __asm__ __volatile__ ("cld\n\trepne\n\tinsw\n\t"
69 : "=D" (buf), "=c" (cnt)
70 : "d" (port), "0" (buf), "1" (cnt) : "memory", "cc");
71}
Here is the caller graph for this function:

◆ inw()

static __inline__ unsigned short inw ( unsigned short  port)
static

Definition at line 17 of file ioport.h.

18{
19 unsigned short retval;
20 __asm__ __volatile__ ("inw %w1, %0\n\t"
21 : "=a" (retval)
22 : "d" (port));
23 return retval;
24}

◆ outb()

static __inline__ void outb ( int  port,
unsigned char  val 
)
static

Definition at line 35 of file ioport.h.

36{
37 __asm__ __volatile__ ("outb %0, %w1\n\t"
38 :
39 : "a" (val),
40 "d" (port));
41}

◆ outl()

static __inline__ void outl ( int  port,
unsigned int  val 
)
static

Definition at line 51 of file ioport.h.

52{
53 __asm__ __volatile__ ("outl %0, %w1\n\t"
54 :
55 : "a" (val),
56 "d" (port));
57}

◆ outsb()

static __inline__ void outsb ( int  port,
const void *  buf,
int  cnt 
)
static

Definition at line 80 of file ioport.h.

81{
82 __asm__ __volatile__ ("cld\n\trepne\n\toutsb\n\t"
83 : "=S" (buf), "=c" (cnt)
84 : "d" (port), "0" (buf), "1" (cnt) : "cc");
85}

◆ outsl()

static __inline__ void outsl ( int  port,
const void *  buf,
int  cnt 
)
static

Definition at line 94 of file ioport.h.

95{
96 __asm__ __volatile__ ("cld\n\trepne\n\toutsl\n\t"
97 : "=S" (buf), "=c" (cnt)
98 : "d" (port), "0" (buf), "1" (cnt) : "cc");
99}

◆ outsw()

static __inline__ void outsw ( int  port,
const void *  buf,
int  cnt 
)
static

Definition at line 87 of file ioport.h.

88{
89 __asm__ __volatile__ ("cld\n\trepne\n\toutsw\n\t"
90 : "=S" (buf), "=c" (cnt)
91 : "d" (port), "0" (buf), "1" (cnt) : "cc");
92}
Here is the caller graph for this function:

◆ outw()

static __inline__ void outw ( int  port,
unsigned short  val 
)
static

Definition at line 43 of file ioport.h.

44{
45 __asm__ __volatile__ ("outw %0, %w1\n\t"
46 :
47 : "a" (val),
48 "d" (port));
49}