fix: put inb outb to header
This commit is contained in:
parent
0ad16863ba
commit
e3d8ef6154
@ -1,4 +1,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
inline uint8_t inb(uint16_t port);
|
static inline void outb(uint16_t port, uint8_t val)
|
||||||
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;
|
||||||
|
}
|
@ -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;
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
inline void outb(uint16_t port, uint8_t val)
|
|
||||||
{
|
|
||||||
__asm__ volatile ( "outb %b0, %w1" : : "a"(val), "Nd"(port) : "memory");
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user