summaryrefslogtreecommitdiff
path: root/kernel/x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/x86.c')
-rw-r--r--kernel/x86.c18
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;
}