fix: put inb outb to header

This commit is contained in:
starnakin 2024-09-07 14:12:50 +02:00
parent 0ad16863ba
commit e3d8ef6154
3 changed files with 14 additions and 16 deletions

View File

@ -1,4 +1,16 @@
#pragma once
inline uint8_t inb(uint16_t port);
inline void outb(uint16_t port, uint8_t val);
static inline void outb(uint16_t port, uint8_t val)
{
__asm__ volatile ( "outb %b0, %w1" : : "a"(val), "Nd"(port) : "memory");
}
static inline uint8_t inb(uint16_t port)
{
uint8_t ret;
__asm__ volatile ( "inb %w1, %b0"
: "=a"(ret)
: "Nd"(port)
: "memory");
return ret;
}

View File

@ -1,10 +0,0 @@
inline uint8_t inb(uint16_t port)
{
uint8_t ret;
__asm__ volatile ( "inb %w1, %b0"
: "=a"(ret)
: "Nd"(port)
: "memory");
return ret;
}

View File

@ -1,4 +0,0 @@
inline void outb(uint16_t port, uint8_t val)
{
__asm__ volatile ( "outb %b0, %w1" : : "a"(val), "Nd"(port) : "memory");
}