?? i8259.c
字號:
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
i8259.c
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Forrest Yu, 2005
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#include "type.h"
#include "const.h"
#include "protect.h"
#include "proto.h"
/*======================================================================*
init_8259A
*======================================================================*/
PUBLIC void init_8259A()
{
out_byte(INT_M_CTL, 0x11); // Master 8259, ICW1.
out_byte(INT_S_CTL, 0x11); // Slave 8259, ICW1.
out_byte(INT_M_CTLMASK, INT_VECTOR_IRQ0); // Master 8259, ICW2. 設(shè)置 '主8259' 的中斷入口地址為 0x20.
out_byte(INT_S_CTLMASK, INT_VECTOR_IRQ8); // Slave 8259, ICW2. 設(shè)置 '從8259' 的中斷入口地址為 0x28
out_byte(INT_M_CTLMASK, 0x4); // Master 8259, ICW3. IR2 對應(yīng) '從8259'.
out_byte(INT_S_CTLMASK, 0x2); // Slave 8259, ICW3. 對應(yīng) '主8259' 的 IR2.
out_byte(INT_M_CTLMASK, 0x1); // Master 8259, ICW4.
out_byte(INT_S_CTLMASK, 0x1); // Slave 8259, ICW4.
out_byte(INT_M_CTLMASK, 0xFE); // Master 8259, OCW1.
out_byte(INT_S_CTLMASK, 0xFF); // Slave 8259, OCW1.
}
/*======================================================================*
spurious_irq
*======================================================================*/
PUBLIC void spurious_irq(int irq)
{
disp_str("spurious_irq: ");
disp_int(irq);
disp_str("\n");
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -