kern
annotate src/intr.h @ 36:e70b1ab9613e
- added cmos rtc code
- added time/date functions in klibc
- implemented an iowait macro with output to 0x80
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 10 Jun 2011 05:33:38 +0300 |
parents | 9939a6d7a45a |
children | f65b348780e3 |
rev | line source |
---|---|
nuclear@11 | 1 #ifndef INTR_H_ |
nuclear@11 | 2 #define INTR_H_ |
nuclear@11 | 3 |
nuclear@11 | 4 #include <inttypes.h> |
nuclear@25 | 5 #include "asmops.h" |
nuclear@11 | 6 |
nuclear@35 | 7 /* offset used to remap IRQ numbers (+32) */ |
nuclear@35 | 8 #define IRQ_OFFSET 32 |
nuclear@35 | 9 /* conversion macros between IRQ and interrupt numbers */ |
nuclear@35 | 10 #define IRQ_TO_INTR(x) ((x) + IRQ_OFFSET) |
nuclear@35 | 11 #define INTR_TO_IRQ(x) ((x) - IRQ_OFFSET) |
nuclear@35 | 12 /* checks whether a particular interrupt is an remapped IRQ */ |
nuclear@35 | 13 #define IS_IRQ(n) ((n) >= IRQ_OFFSET && (n) < IRQ_OFFSET + 16) |
nuclear@35 | 14 |
nuclear@35 | 15 |
nuclear@11 | 16 typedef void (*intr_func_t)(int, uint32_t); |
nuclear@11 | 17 |
nuclear@11 | 18 |
nuclear@11 | 19 void init_intr(void); |
nuclear@11 | 20 |
nuclear@11 | 21 void interrupt(int intr_num, intr_func_t func); |
nuclear@11 | 22 |
nuclear@25 | 23 /* defined in intr-asm.S */ |
nuclear@25 | 24 int get_intr_state(void); |
nuclear@25 | 25 void set_intr_state(int s); |
nuclear@25 | 26 |
nuclear@11 | 27 #endif /* INTR_H_ */ |