Move sensitive instructions from libc into kernel
This commit is contained in:
@@ -12,6 +12,13 @@ SRCS+= arch_do_vmctl.c \
|
||||
do_sdevio.c \
|
||||
exception.c \
|
||||
i8259.c \
|
||||
io_inb.S \
|
||||
io_inl.S \
|
||||
io_intr.S \
|
||||
io_inw.S \
|
||||
io_outb.S \
|
||||
io_outl.S \
|
||||
io_outw.S \
|
||||
klib.S \
|
||||
memory.c \
|
||||
oxpcie.c \
|
||||
|
||||
14
kernel/arch/i386/io_inb.S
Normal file
14
kernel/arch/i386/io_inb.S
Normal file
@@ -0,0 +1,14 @@
|
||||
/* inb() - Input one byte Author: Kees J. Bot */
|
||||
/* 18 Mar 1996 */
|
||||
/* unsigned inb(U16_t port); */
|
||||
|
||||
.text
|
||||
.globl _inb
|
||||
_inb:
|
||||
push %ebp
|
||||
movl %esp, %ebp
|
||||
movl 8(%ebp), %edx /* port */
|
||||
xorl %eax, %eax
|
||||
inb %dx /* read 1 byte */
|
||||
pop %ebp
|
||||
ret
|
||||
13
kernel/arch/i386/io_inl.S
Normal file
13
kernel/arch/i386/io_inl.S
Normal file
@@ -0,0 +1,13 @@
|
||||
/* inl() - Input one dword Author: Kees J. Bot */
|
||||
/* 18 Mar 1996 */
|
||||
/* unsigned inl(U16_t port); */
|
||||
|
||||
.text
|
||||
.globl _inl
|
||||
_inl:
|
||||
push %ebp
|
||||
movl %esp, %ebp
|
||||
movl 8(%ebp), %edx /* port */
|
||||
inl %dx /* read 1 dword */
|
||||
pop %ebp
|
||||
ret
|
||||
16
kernel/arch/i386/io_intr.S
Normal file
16
kernel/arch/i386/io_intr.S
Normal file
@@ -0,0 +1,16 @@
|
||||
/* intr_disable(), intr_enable - Disable/Enable hardware interrupts. */
|
||||
/* Author: Kees J. Bot */
|
||||
/* 18 Mar 1996 */
|
||||
/* void intr_disable(void); */
|
||||
/* void intr_enable(void); */
|
||||
|
||||
.text
|
||||
.globl _intr_disable
|
||||
_intr_disable:
|
||||
cli
|
||||
ret
|
||||
|
||||
.globl _intr_enable
|
||||
_intr_enable:
|
||||
sti
|
||||
ret
|
||||
14
kernel/arch/i386/io_inw.S
Normal file
14
kernel/arch/i386/io_inw.S
Normal file
@@ -0,0 +1,14 @@
|
||||
/* inw() - Input one word Author: Kees J. Bot */
|
||||
/* 18 Mar 1996 */
|
||||
/* unsigned inw(U16_t port); */
|
||||
|
||||
.text
|
||||
.globl _inw
|
||||
_inw:
|
||||
push %ebp
|
||||
movl %esp, %ebp
|
||||
movl 8(%ebp), %edx /* port */
|
||||
xorl %eax, %eax
|
||||
inw %dx /* read 1 word */
|
||||
pop %ebp
|
||||
ret
|
||||
14
kernel/arch/i386/io_outb.S
Normal file
14
kernel/arch/i386/io_outb.S
Normal file
@@ -0,0 +1,14 @@
|
||||
/* outb() - Output one byte Author: Kees J. Bot */
|
||||
/* 18 Mar 1996 */
|
||||
/* void outb(U16_t port, U8_t value); */
|
||||
|
||||
.text
|
||||
.globl _outb
|
||||
_outb:
|
||||
push %ebp
|
||||
movl %esp, %ebp
|
||||
movl 8(%ebp), %edx /* port */
|
||||
movl 8+4(%ebp), %eax /* value */
|
||||
outb %dx /* output 1 byte */
|
||||
pop %ebp
|
||||
ret
|
||||
14
kernel/arch/i386/io_outl.S
Normal file
14
kernel/arch/i386/io_outl.S
Normal file
@@ -0,0 +1,14 @@
|
||||
/* outl() - Output one dword Author: Kees J. Bot */
|
||||
/* 18 Mar 1996 */
|
||||
/* void outl(U16_t port, u32_t value); */
|
||||
|
||||
.text
|
||||
.globl _outl
|
||||
_outl:
|
||||
push %ebp
|
||||
movl %esp, %ebp
|
||||
movl 8(%ebp), %edx /* port */
|
||||
movl 8+4(%ebp), %eax /* value */
|
||||
outl %dx /* output 1 dword */
|
||||
pop %ebp
|
||||
ret
|
||||
14
kernel/arch/i386/io_outw.S
Normal file
14
kernel/arch/i386/io_outw.S
Normal file
@@ -0,0 +1,14 @@
|
||||
/* outw() - Output one word Author: Kees J. Bot */
|
||||
/* 18 Mar 1996 */
|
||||
/* void outw(U16_t port, U16_t value); */
|
||||
|
||||
.text
|
||||
.globl _outw
|
||||
_outw:
|
||||
push %ebp
|
||||
movl %esp, %ebp
|
||||
movl 8(%ebp), %edx /* port */
|
||||
movl 8+4(%ebp), %eax /* value */
|
||||
outw %dx /* output 1 word */
|
||||
pop %ebp
|
||||
ret
|
||||
Reference in New Issue
Block a user