kern

view src/asmops.h @ 40:710739e33da8

- now read_rtc doesn't try to read weekday as it's probably wrong anyway, and doesn't set yearday either - mktime now fixes yearday and weekday - moved init_timer and init_rtc just before enabling the interrupts in main
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 12 Jun 2011 15:45:21 +0300
parents b11a86695493
children e6de3c6015cb
line source
1 #ifndef ASMOPS_H_
2 #define ASMOPS_H_
4 #define enable_intr() asm volatile("sti")
5 #define disable_intr() asm volatile("cli")
6 #define halt_cpu() asm volatile("hlt")
8 #define inb(dest, port) asm volatile( \
9 "inb %1, %0\n\t" \
10 : "=a" ((unsigned char)(dest)) \
11 : "dN" ((unsigned short)(port)))
13 #define inw(dest, port) asm volatile( \
14 "inw %1, %0\n\t" \
15 : "=a" ((unsigned short)(dest)) \
16 : "dN" ((unsigned short)(port)))
18 #define inl(dest, port) asm volatile( \
19 "inl %1, %0\n\t" \
20 : "=a" ((unsigned long)(dest)) \
21 : "dN" ((unsigned short)(port)))
23 #define outb(src, port) asm volatile( \
24 "outb %0, %1\n\t" \
25 :: "a" ((unsigned char)(src)), "dN" ((unsigned short)(port)))
27 #define outw(src, port) asm volatile( \
28 "outw %0, %1\n\t" \
29 :: "a" ((unsigned short)(src)), "dN" ((unsigned short)(port)))
31 #define outl(src, port) asm volatile( \
32 "outl %0, %1\n\t" \
33 :: "a" ((unsigned long)(src)), "dN" ((unsigned short)(port)))
35 #define iodelay() outb(0, 0x80)
37 #endif /* ASMOPS_H_ */