20#include "pedigree/kernel/panic.h"
21#include "pedigree/kernel/processor/IoPort.h"
22#include "pedigree/kernel/processor/Processor.h"
27 panic(
"8-bit IO read past allocated space.");
31 asm volatile(
"inb %%dx, %%al" :
"=a"(value) :
"dN"(
m_IoPort + offset));
36 if ((offset + 1) >=
m_Size)
37 panic(
"16-bit IO read past allocated space.");
41 asm volatile(
"inw %%dx, %%ax" :
"=a"(value) :
"dN"(
m_IoPort + offset));
46 if ((offset + 3) >=
m_Size)
47 panic(
"32-bit IO read past allocated space.");
51 asm volatile(
"in %%dx, %%eax" :
"=a"(value) :
"dN"(
m_IoPort + offset));
63 panic(
"8-bit IO write past allocated space.");
66 asm volatile(
"outb %%al, %%dx" ::
"dN"(
m_IoPort + offset),
"a"(value));
70 if ((offset + 1) >=
m_Size)
71 panic(
"16-bit IO write past allocated space.");
74 asm volatile(
"outw %%ax, %%dx" ::
"dN"(
m_IoPort + offset),
"a"(value));
79 panic(
"32-bit IO write past allocated space.");
82 asm volatile(
"out %%eax, %%dx" ::
"dN"(
m_IoPort + offset),
"a"(value));
virtual uint64_t read64(size_t offset=0)
virtual uint16_t read16(size_t offset=0)
virtual uint32_t read32(size_t offset=0)
virtual void write8(uint8_t value, size_t offset=0)
virtual void write32(uint32_t value, size_t offset=0)
virtual uint8_t read8(size_t offset=0)
virtual void write64(uint64_t value, size_t offset=0)
virtual void write16(uint16_t value, size_t offset=0)
void EXPORTED_PUBLIC panic(const char *msg) NORETURN