mirror of
https://github.com/gbowne1/ClassicOS.git
synced 2025-10-26 02:15:06 -07:00
17 lines
296 B
C
17 lines
296 B
C
#ifndef IO_H
|
|
#define IO_H
|
|
|
|
#include <stdint.h>
|
|
|
|
static inline void outb(uint16_t port, uint8_t val) {
|
|
__asm__("outb %0, %1" : : "a"(val), "Nd"(port));
|
|
}
|
|
|
|
static inline uint8_t inb(uint16_t port) {
|
|
uint8_t ret;
|
|
__asm__("inb %1, %0" : "=a"(ret) : "Nd"(port));
|
|
return ret;
|
|
}
|
|
|
|
#endif
|