diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-09-04 11:31:40 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-09-04 11:31:40 -0400 |
| commit | 8251da342161767fe203627223ccd4a7026701c6 (patch) | |
| tree | af2db0f11b0ea8ad35f88663a855bab39a80f679 /arch/x86_64/hal/port.h | |
| download | jove-kernel-8251da342161767fe203627223ccd4a7026701c6.tar.gz jove-kernel-8251da342161767fe203627223ccd4a7026701c6.tar.bz2 jove-kernel-8251da342161767fe203627223ccd4a7026701c6.zip | |
initial commit. working on tasking
Diffstat (limited to 'arch/x86_64/hal/port.h')
| -rw-r--r-- | arch/x86_64/hal/port.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86_64/hal/port.h b/arch/x86_64/hal/port.h new file mode 100644 index 0000000..6dbc27c --- /dev/null +++ b/arch/x86_64/hal/port.h @@ -0,0 +1,12 @@ +#ifndef _JOVE_PORT_H +#define _JOVE_PORT_H 1 + +#include <stdint.h> + +static inline uint8_t inb(uint16_t port) +{ uint8_t r; __asm__ volatile("inb %w1, %b0": "=a"(r): "Nd"(port): "memory"); return r; } + +static inline void outb(uint16_t port, uint8_t v) +{ __asm__ volatile("outb %b0, %w1":: "a"(v), "Nd"(port): "memory"); } + +#endif |
