aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64/asm
diff options
context:
space:
mode:
authorTianhao Wang <wth@riseup.net>2024-02-01 04:16:43 +0100
committerTianhao Wang <wth@riseup.net>2024-02-01 04:16:43 +0100
commit2bdafab229439dcd9968114ab232ed0a3a218bfb (patch)
tree3a45d4357099c2862dfca205e3757846e51aaf76 /src/arch/x86_64/asm
parent79ab357c2ecf84c5cb9c8c588f2e0ccf02eb4209 (diff)
use inline asm for x86 IO instr
Diffstat (limited to 'src/arch/x86_64/asm')
-rw-r--r--src/arch/x86_64/asm/io_port.s71
1 files changed, 0 insertions, 71 deletions
diff --git a/src/arch/x86_64/asm/io_port.s b/src/arch/x86_64/asm/io_port.s
deleted file mode 100644
index 3aec69d..0000000
--- a/src/arch/x86_64/asm/io_port.s
+++ /dev/null
@@ -1,71 +0,0 @@
-;***************************************************************************
-;* Operating-System Construction *
-;*---------------------------------------------------------------------------*
-;* *
-;* I O _ P O R T *
-;* *
-;*---------------------------------------------------------------------------*
-;* The functions defined here encapsulate the machine instructions 'in' and *
-;* 'out' for class IO_Port. *
-;*****************************************************************************
-
-; EXPORTED FUNCTIONS
-
-[GLOBAL _outb]
-[GLOBAL _outw]
-[GLOBAL _inb]
-[GLOBAL _inw]
-
-; FUNCTION IMPLEMENTATIONS
-
-[SECTION .text]
-
-; OUTB: Byte-wise output via an I/O port.
-;
-; C prototype: void outb (int port, int value);
-
-_outb:
- push rbp
- mov rbp, rsp
- mov rdx, rdi
- mov rax, rsi
- out dx, al
- pop rbp
- ret
-
-; OUTW: Word-wise output via an I/O port.
-;
-; C prototype: void outw (int port, int value);
-
-_outw:
- push rbp
- mov rbp, rsp
- mov rdx, rdi
- mov rax, rsi
- out dx, ax
- pop rbp
- ret
-
-; INB: Byte-wise input via an I/O port.
-;
-; C prototype: unsigned char inb (int port);
-
-_inb:
- push rbp
- mov rbp, rsp
- mov rdx, rdi
- in al, dx
- pop rbp
- ret
-
-; INW: Word-wise input via an I/O port.
-;
-; C prototype: unsigned short inw (int port);
-
-_inw:
- push rbp
- mov rbp, rsp
- mov rdx, rdi
- in ax, dx
- pop rbp
- ret