[NTVDM]
[reactos.git] / reactos / subsystems / ntvdm / int32.h
1 /*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: int32.h
5 * PURPOSE: 32-bit Interrupt Handlers
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10 #ifndef _INT32_H_
11 #define _INT32_H_
12
13 /* INCLUDES *******************************************************************/
14
15 #include "cpu/callback.h"
16
17 /* DEFINES ********************************************************************/
18
19 /* 32-bit Interrupt Identifiers */
20 #define EMULATOR_MAX_INT32_NUM 0xFF + 1
21
22
23 //
24 // WARNING WARNING!!
25 // If you're changing the stack indices here, you then need
26 // to also fix the Int16To32 handler code in int32.c !!
27 //
28
29 // Custom variable pushed onto the stack for INT32 interrupts
30 #define STACK_INT_NUM 0
31
32 // This is the standard stack layout for an interrupt
33 #define STACK_IP 1
34 #define STACK_CS 2
35 #define STACK_FLAGS 3
36
37 extern const ULONG Int16To32StubSize;
38
39 /* FUNCTIONS ******************************************************************/
40
41 typedef VOID (WINAPI *EMULATOR_INT32_PROC)(LPWORD Stack);
42
43 ULONG
44 RegisterInt16(IN ULONG FarPtr,
45 IN BYTE IntNumber,
46 IN LPBYTE CallbackCode,
47 IN SIZE_T CallbackSize,
48 OUT PSIZE_T CodeSize OPTIONAL);
49
50 ULONG
51 RegisterInt32(IN ULONG FarPtr,
52 IN BYTE IntNumber,
53 IN EMULATOR_INT32_PROC IntHandler,
54 OUT PSIZE_T CodeSize OPTIONAL);
55
56 VOID
57 Int32Call(IN PCALLBACK16 Context,
58 IN BYTE IntNumber);
59
60 VOID InitializeInt32(VOID);
61
62 #endif // _INT32_H_
63
64 /* EOF */