2013-06-26 22:58:41 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: GPL - See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Virtual DOS Machine
|
|
|
|
* FILE: pic.h
|
2013-12-24 15:30:59 +00:00
|
|
|
* PURPOSE: Programmable Interrupt Controller emulation
|
|
|
|
* (Interrupt Controller Adapter (ICA) in Windows terminology)
|
2013-06-26 22:58:41 +00:00
|
|
|
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PIC_H_
|
|
|
|
#define _PIC_H_
|
|
|
|
|
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
|
|
|
#include "ntvdm.h"
|
|
|
|
|
|
|
|
/* DEFINES ********************************************************************/
|
|
|
|
|
2014-01-11 21:45:01 +00:00
|
|
|
#define PIC_MASTER_CMD 0x20
|
2013-06-26 22:58:41 +00:00
|
|
|
#define PIC_MASTER_DATA 0x21
|
2014-01-11 21:45:01 +00:00
|
|
|
#define PIC_SLAVE_CMD 0xA0
|
|
|
|
#define PIC_SLAVE_DATA 0xA1
|
|
|
|
|
|
|
|
#define PIC_ICW1 0x10
|
|
|
|
#define PIC_ICW1_ICW4 (1 << 0)
|
2013-06-26 22:58:41 +00:00
|
|
|
#define PIC_ICW1_SINGLE (1 << 1)
|
2014-01-11 21:45:01 +00:00
|
|
|
#define PIC_ICW4_8086 (1 << 0)
|
|
|
|
#define PIC_ICW4_AEOI (1 << 1)
|
|
|
|
|
|
|
|
#define PIC_OCW2_NUM_MASK 0x07
|
|
|
|
#define PIC_OCW2_EOI (1 << 5)
|
|
|
|
#define PIC_OCW2_SL (1 << 6)
|
|
|
|
|
|
|
|
#define PIC_OCW3 (1 << 3)
|
|
|
|
#define PIC_OCW3_READ_ISR 0x0B
|
2013-06-26 22:58:41 +00:00
|
|
|
|
|
|
|
typedef struct _PIC
|
|
|
|
{
|
|
|
|
BOOLEAN Initialization;
|
|
|
|
BYTE MaskRegister;
|
2013-10-27 00:37:01 +00:00
|
|
|
BYTE IntRequestRegister;
|
2013-06-26 22:58:41 +00:00
|
|
|
BYTE InServiceRegister;
|
|
|
|
BYTE IntOffset;
|
|
|
|
BYTE ConfigRegister;
|
|
|
|
BYTE CascadeRegister;
|
|
|
|
BOOLEAN CascadeRegisterSet;
|
|
|
|
BOOLEAN AutoEoi;
|
|
|
|
BOOLEAN Slave;
|
|
|
|
BOOLEAN ReadIsr;
|
|
|
|
} PIC, *PPIC;
|
|
|
|
|
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
|
|
|
VOID PicInterruptRequest(BYTE Number);
|
2013-10-27 00:37:01 +00:00
|
|
|
BYTE PicGetInterrupt(VOID);
|
2014-01-11 21:45:01 +00:00
|
|
|
|
2014-01-11 20:59:27 +00:00
|
|
|
VOID PicInitialize(VOID);
|
2013-06-26 22:58:41 +00:00
|
|
|
|
2013-08-09 18:55:35 +00:00
|
|
|
#endif // _PIC_H_
|
2013-06-26 22:58:41 +00:00
|
|
|
|
|
|
|
/* EOF */
|