Go to the documentation of this file.
18 #ifndef __LIBARCH_INTELIO_H
19 #define __LIBARCH_INTELIO_H
72 asm volatile (
"inb %%dx, %%al" :
"=a" (b) :
"d" (port));
87 asm volatile (
"inw %%dx, %%ax" :
"=a" (w) :
"d" (port));
100 asm volatile (
"outb %%al,%%dx"::
"a" (byte),
"d" (port));
112 asm volatile (
"outw %%ax,%%dx"::
"a" (word),
"d" (port));
124 asm volatile (
"outl %%eax,%%dx"::
"a" (l),
"d" (port));
136 const volatile u32 *ptr = (
const volatile u32 *)((
const volatile u8 *)
m_base + addr);
149 for (
Size i = 0; i < count; i+=
sizeof(
u32))
151 *(
u32 *)(((
u8 *)buf) + i) =
read(addr + i);
163 volatile u32 *ptr = (
volatile u32 *)((
volatile u8 *)
m_base + addr);
176 for (
Size i = 0; i < count; i+=
sizeof(
u32))
192 write(addr, current);
205 write(addr, current);
void read(Address addr, Size count, void *buf) const
Read a number of 32-bit values.
void setPortBase(const u16 base)
Set port I/O base address.
void set(Address addr, u32 data)
Set bits in memory mapped register.
u16 m_portBase
Port I/O base address.
Address m_base
memory I/O base offset is added to each I/O address.
u8 inb(u16 port) const
Read a byte from a port.
unsigned long Address
A memory address.
void outb(u16 port, u8 byte)
Output a byte to a port.
u32 read(const Address addr) const
Read memory mapped register.
u16 inw(u16 port) const
Read a word from a port.
unsigned short u16
Unsigned 16-bit number.
unsigned int u32
Unsigned 32-bit number.
unsigned int Size
Any sane size indicator cannot go negative.
void unset(Address addr, u32 data)
Unset bits in memory mapped register.
void outw(u16 port, u16 word)
Output a word to a port.
unsigned char u8
Unsigned 8-bit number.
void outl(u16 port, u32 l)
Output a long to a I/O port.
void write(const Address addr, const u32 data)
Write memory mapped register.
void write(Address addr, Size count, const void *buf)
Write a number of 32-bit values.