diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-08 10:49:18 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-08 10:49:18 -0400 |
commit | c8a1e0531d7ccdce5f76aec8a5b6147c686d3403 (patch) | |
tree | 2a68ab7da901a96fea975ca2ec02a9c77137686b /kernel/old/include/bindings.h | |
parent | tty => term (diff) | |
download | comus-c8a1e0531d7ccdce5f76aec8a5b6147c686d3403.tar.gz comus-c8a1e0531d7ccdce5f76aec8a5b6147c686d3403.tar.bz2 comus-c8a1e0531d7ccdce5f76aec8a5b6147c686d3403.zip |
fix old checkout
Diffstat (limited to 'kernel/old/include/bindings.h')
-rw-r--r-- | kernel/old/include/bindings.h | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/kernel/old/include/bindings.h b/kernel/old/include/bindings.h deleted file mode 100644 index 365abc9..0000000 --- a/kernel/old/include/bindings.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file bindings.h - * @author Freya Murphy <freya@freyacat.org> - * - * C-style function definitions binded to their named assembly instruction. - */ - -#ifndef _BINDINGS_H -#define _BINDINGS_H -#include <types.h> - -static inline uint8_t inb(uint16_t port) -{ - uint8_t ret; - __asm__ volatile("inb %1, %0" : "=a"(ret) : "Nd"(port)); - return ret; -} - -static inline void outb(uint16_t port, uint8_t val) -{ - __asm__ volatile("outb %0, %1" : : "a"(val), "Nd"(port)); -} - -static inline uint16_t inw(uint16_t port) -{ - uint16_t ret; - __asm__ volatile("inw %1, %0" : "=a"(ret) : "Nd"(port)); - return ret; -} - -static inline void outw(uint16_t port, uint16_t val) -{ - __asm__ volatile("outw %0, %1" : : "a"(val), "Nd"(port)); -} - -static inline uint32_t inl(uint16_t port) -{ - uint32_t ret; - __asm__ volatile("inl %1, %0" : "=a"(ret) : "Nd"(port)); - return ret; -} - -static inline void outl(uint16_t port, uint32_t val) -{ - __asm__ volatile("outl %0, %1" : : "a"(val), "Nd"(port)); -} - -static inline void io_wait(void) -{ - outb(0x80, 0); -} - -static inline void sti(void) -{ - __asm__ volatile("sti"); -} - -static inline void cli(void) -{ - __asm__ volatile("cli"); -} - -static inline void int_wait(void) -{ - __asm__ volatile("sti; hlt"); -} - -static inline void halt(void) -{ - __asm__ volatile("cli; hlt"); -} - -#endif /* bindings.h */ |