25 lines
408 B
C
25 lines
408 B
C
#ifndef IO_H
|
|
#define IO_H
|
|
|
|
static inline void outb(unsigned short port, unsigned char val) {
|
|
__asm__ volatile(
|
|
"outb %0, %1"
|
|
:
|
|
: "a"(val),
|
|
"Nd"(port) );
|
|
}
|
|
|
|
static inline unsigned char inb(unsigned short port) {
|
|
unsigned char ret;
|
|
__asm__ volatile(
|
|
"inb %1, %0"
|
|
: "=a"(ret)
|
|
: "Nd"(port)
|
|
);
|
|
|
|
return ret;
|
|
}
|
|
|
|
void io_wait();
|
|
|
|
#endif |