| 4 | #include "os_type.h" |
| 5 | |
| 6 | class InterruptManager |
| 7 | { |
| 8 | private: |
| 9 | uint32 *IDT; // IDT起始地址 |
| 10 | uint32 IRQ0_8259A_MASTER; // 主片中断起始向量号 |
| 11 | uint32 IRQ0_8259A_SLAVE; // 从片中断起始向量号 |
| 12 | |
| 13 | public: |
| 14 | InterruptManager(); |
| 15 | void initialize(); |
| 16 | // 设置中断描述符 |
| 17 | // index 第index个描述符,index=0, 1, ..., 255 |
| 18 | // address 中断处理程序的起始地址 |
| 19 | // DPL 中断描述符的特权级 |
| 20 | void setInterruptDescriptor(uint32 index, uint32 address, byte DPL); |
| 21 | // 开启时钟中断 |
| 22 | void enableTimeInterrupt(); |
| 23 | // 禁止时钟中断 |
| 24 | void disableTimeInterrupt(); |
| 25 | // 设置时钟中断处理函数 |
| 26 | void setTimeInterrupt(void *handler); |
| 27 | |
| 28 | // 开中断 |
| 29 | void enableInterrupt(); |
| 30 | // 关中断 |
| 31 | void disableInterrupt(); |
| 32 | // 获取中断状态 |
| 33 | // 返回true,中断开启;返回false,中断关闭 |
| 34 | bool getInterruptStatus(); |
| 35 | // 设置中断状态 |
| 36 | // status=true,开中断;status=false,关中断 |
| 37 | void setInterruptStatus(bool status); |
| 38 | |
| 39 | private: |
| 40 | // 初始化8259A芯片 |
| 41 | void initialize8259A(); |
| 42 | }; |
| 43 | |
| 44 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected