kern
diff src/asmops.h @ 10:b11a86695493
interrupt handling
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 18 Feb 2011 08:42:32 +0200 |
parents | 86781ef20689 |
children | e70b1ab9613e |
line diff
1.1 --- a/src/asmops.h Wed Feb 16 08:01:19 2011 +0200 1.2 +++ b/src/asmops.h Fri Feb 18 08:42:32 2011 +0200 1.3 @@ -1,13 +1,17 @@ 1.4 #ifndef ASMOPS_H_ 1.5 #define ASMOPS_H_ 1.6 1.7 +#define enable_intr() asm volatile("sti") 1.8 +#define disable_intr() asm volatile("cli") 1.9 +#define halt_cpu() asm volatile("hlt") 1.10 + 1.11 #define inb(dest, port) asm volatile( \ 1.12 "inb %1, %0\n\t" \ 1.13 : "=a" ((unsigned char)(dest)) \ 1.14 : "dN" ((unsigned short)(port))) 1.15 1.16 -#define ins(dest, port) asm volatile( \ 1.17 - "ins %1, %0\n\t" \ 1.18 +#define inw(dest, port) asm volatile( \ 1.19 + "inw %1, %0\n\t" \ 1.20 : "=a" ((unsigned short)(dest)) \ 1.21 : "dN" ((unsigned short)(port))) 1.22 1.23 @@ -20,8 +24,8 @@ 1.24 "outb %0, %1\n\t" \ 1.25 :: "a" ((unsigned char)(src)), "dN" ((unsigned short)(port))) 1.26 1.27 -#define outs(src, port) asm volatile( \ 1.28 - "outs %0, %1\n\t" \ 1.29 +#define outw(src, port) asm volatile( \ 1.30 + "outw %0, %1\n\t" \ 1.31 :: "a" ((unsigned short)(src)), "dN" ((unsigned short)(port))) 1.32 1.33 #define outl(src, port) asm volatile( \