From d8331335ff1720ce28eba45afe1a02814b38b033 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Mon, 1 Dec 2014 21:49:22 +0100 Subject: finally implemented fork() syscall --- kernel/x86.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'kernel/x86.c') diff --git a/kernel/x86.c b/kernel/x86.c index 65552cd..4163481 100644 --- a/kernel/x86.c +++ b/kernel/x86.c @@ -10,23 +10,25 @@ // +/* volatile void sleep(int i) { uint64_t clock=timer_get_ticks(); while(clock+i>timer_get_ticks()); } +*/ // disable interrupts void x86_int_disable() { - __asm__("cli"); + asm volatile("cli"); } // enable interrupts void x86_int_enable() { - __asm__("sti"); + asm volatile("sti"); } // get control registers (cr0-cr4) @@ -74,37 +76,37 @@ uint32_t x86_get_cr4() } void x86_outb(int port, uint8_t data) { - __asm __volatile("outb %0,%w1" : : "a" (data), "d" (port)); + asm volatile("outb %0,%w1" : : "a" (data), "d" (port)); } uint8_t x86_inb(int port) { uint8_t data; - __asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port)); + asm volatile("inb %w1,%0" : "=a" (data) : "d" (port)); return data; } void x86_outw(int port, uint16_t data) { - __asm __volatile("outw %0,%w1" : : "a" (data), "d" (port)); + asm volatile("outw %0,%w1" : : "a" (data), "d" (port)); } uint16_t x86_inw(int port) { uint16_t data; - __asm __volatile("inw %w1,%0" : "=a" (data) : "d" (port)); + asm volatile("inw %w1,%0" : "=a" (data) : "d" (port)); return data; } void x86_outl(int port, uint32_t data) { - __asm __volatile("outl %0,%w1" : : "a" (data), "d" (port)); + asm volatile("outl %0,%w1" : : "a" (data), "d" (port)); } uint32_t x86_inl(int port) { uint32_t data; - __asm __volatile("inl %w1,%0" : "=a" (data) : "d" (port)); + asm volatile("inl %w1,%0" : "=a" (data) : "d" (port)); return data; } -- cgit v1.2.3