summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/i386/boot/boot.s13
-rw-r--r--arch/i386/include/kernel/asm.h19
2 files changed, 19 insertions, 13 deletions
diff --git a/arch/i386/boot/boot.s b/arch/i386/boot/boot.s
index 48f9f29..005b07b 100644
--- a/arch/i386/boot/boot.s
+++ b/arch/i386/boot/boot.s
@@ -92,15 +92,9 @@ load_page_dir:
.global enable_paging
.type enable_paging, @function
enable_paging:
- pushl %ebp
- movl %esp, %ebp
-
movl %cr0, %eax
orl $0x80000001, %eax
movl %eax, %cr0
-
- movl %ebp, %esp
- popl %ebp
ret
.global flush_gdt
@@ -118,13 +112,6 @@ flush_gdt:
.flush:
ret
-.global flush_tss
-.type flush_tss, @function
-flush_tss:
- movw $0x28, %ax
- ltr %ax
- ret
-
.global jump_userspace
.type jump_userspace, @function
jump_userspace:
diff --git a/arch/i386/include/kernel/asm.h b/arch/i386/include/kernel/asm.h
new file mode 100644
index 0000000..33ec3d7
--- /dev/null
+++ b/arch/i386/include/kernel/asm.h
@@ -0,0 +1,19 @@
+#ifndef I386_ASM_H
+#define I386_ASM_H
+
+static inline void enable_ints(void) {
+ __asm__ volatile("sti");
+ return;
+}
+
+static inline void disable_ints(void) {
+ __asm__ volatile("cli");
+ return;
+}
+
+static inline void flush_tss(void) {
+ __asm__ volatile("movw $0x28, %ax; ltr %ax");
+ return;
+}
+
+#endif