diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-12-01 21:49:22 +0100 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-12-01 21:49:22 +0100 |
| commit | d8331335ff1720ce28eba45afe1a02814b38b033 (patch) | |
| tree | f671279d258477321699d158765f576512851e3a /kernel/x86.c | |
| parent | 100be313c22bd6116b1adc5eb30f5db56f4b0772 (diff) | |
finally implemented fork() syscall
Diffstat (limited to 'kernel/x86.c')
| -rw-r--r-- | kernel/x86.c | 18 |
1 files changed, 10 insertions, 8 deletions
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; } |
