vbos/init/pio.c
Michael Shaw 605507a688 pci: add simple pci driver
this driver only prints devices on the pci bus.
2023-05-03 23:55:54 -04:00

23 lines
963 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#include <kernel/pio.h>
#define genio(suffix, type) \
inline void out##suffix(uint16_t port, type value) \
{ \
__asm__ volatile("out" #suffix " %0, %1" : : "a"(value), "Nd"(port)); \
} \
inline type in##suffix(uint16_t port) \
{ \
type ret; \
__asm__ volatile("in" #suffix " %1, %0" : "=a"(ret) : "Nd"(port)); \
return ret; \
}
inline void iowait()
{
outb(0x80, 0);
}
genio(b, uint8_t);
genio(w, uint16_t);
genio(l, uint32_t);