Move sensitive instructions from libc into kernel

This commit is contained in:
Erik van der Kouwe
2010-07-23 07:12:47 +00:00
parent a06e5c383d
commit f389ad2655
9 changed files with 7 additions and 7 deletions

View File

@@ -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
View 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
View 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

View 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
View 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

View 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

View 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

View 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