source: vendor/emx/current/src/dos/pmint.inc

Last change on this file was 18, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 7.2 KB
Line 
1;
2; PMINT.INC -- Handle interrupts
3;
4; Copyright (c) 1991-1996 by Eberhard Mattes
5;
6; This file is part of emx.
7;
8; emx is free software; you can redistribute it and/or modify it
9; under the terms of the GNU General Public License as published by
10; the Free Software Foundation; either version 2, or (at your option)
11; any later version.
12;
13; emx is distributed in the hope that it will be useful,
14; but WITHOUT ANY WARRANTY; without even the implied warranty of
15; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16; GNU General Public License for more details.
17;
18; You should have received a copy of the GNU General Public License
19; along with emx; see the file COPYING. If not, write to
20; the Free Software Foundation, 59 Temple Place - Suite 330,
21; Boston, MA 02111-1307, USA.
22;
23; See emx.asm for a special exception.
24;
25
26;
27; Stack (at PMINT_STACK_SNAP_SHOT):
28;
29; GS FS ES DS EDI ESI EBP ESP EBX EDX ECX EAX ERRCD EIP CS EFLAGS ESP(U) SS(U)
30; 0 2 4 6 8 12 16 20 24 28 32 36 40 44 48 52 56 60
31; ^ ----- ------------
32; | simulated only for
33; EBP for interrupts user program
34; and exc. 0..7, 16
35;
36; See also PROCESS.INC, SPECIAL.ASM, /emx/include/sys/reg.h.
37;
38
39ISTACKFRAME STRUC
40IS_GS DW ? ; 0
41IS_FS DW ? ; 2
42IS_ES DW ? ; 4
43IS_DS DW ? ; 6
44IS_EDI DD ? ; 8
45IS_ESI DD ? ; 12
46IS_EBP DD ? ; 16
47IS_ESP_1 DD ? ; 20
48IS_EBX DD ? ; 24
49IS_EDX DD ? ; 28
50IS_ECX DD ? ; 32
51IS_EAX DD ? ; 36
52IS_ERRCD DD ? ; 40
53IS_EIP DD ? ; 44
54IS_CS DW ? ; 48
55IS_CS_PAD DW ? ; 50
56IS_EFLAGS DD ? ; 52
57IS_ESP DD ? ; 56
58IS_SS DW ? ; 60
59IS_SS_PAD DW ? ; 62
60ISTACKFRAME ENDS
61
62I_GS EQU [BP].IS_GS
63I_FS EQU [BP].IS_FS
64I_ES EQU [BP].IS_ES
65I_DS EQU [BP].IS_DS
66I_EDI EQU [BP].IS_EDI
67I_ESI EQU [BP].IS_ESI
68I_EBP EQU [BP].IS_EBP
69I_ESP_1 EQU [BP].IS_ESP_1
70I_EBX EQU [BP].IS_EBX
71I_EDX EQU [BP].IS_EDX
72I_ECX EQU [BP].IS_ECX
73I_EAX EQU [BP].IS_EAX
74I_ERRCD EQU [BP].IS_ERRCD
75I_EIP EQU [BP].IS_EIP
76I_CS EQU [BP].IS_CS
77I_EFLAGS EQU [BP].IS_EFLAGS
78I_ESP EQU [BP].IS_ESP
79I_SS EQU [BP].IS_SS
80
81I_REG_DWORDS = 16 ; Cf. PROCESS.ASM
82
83;
84; Size of local variables of exception/interrupt handler
85;
86FRAME_SIZE = 38
87
88;
89; Local variables for exceptions
90;
91VOUTPUT EQU (BYTE PTR [BP-2])
92SWAP_PIDX EQU (BYTE PTR [BP-3])
93EXCEPT_NO EQU (BYTE PTR [BP-4])
94FAULT_ADDR EQU (DWORD PTR [BP-8])
95ETEXT EQU (WORD PTR [BP-10])
96EBYTE EQU (WORD PTR [BP-12])
97EWORD EQU (WORD PTR [BP-14])
98EDWORD EQU (WORD PTR [BP-16])
99ECRLF EQU (WORD PTR [BP-18])
100ECHAR EQU (WORD PTR [BP-20])
101EXC_UNUSED_1 EQU (DWORD PTR [BP-24])
102FAULT_PROC EQU (WORD PTR [BP-26])
103
104;
105; Local variables for interrupts
106;
107INT_NO EQU (BYTE PTR [BP-1])
108HW_INT_VEC EQU (BYTE PTR [BP-2])
109;unused EQU (BYTE PTR [BP-3])
110RM_FLAGS EQU (BYTE PTR [BP-4])
111INP_HANDLE EQU (WORD PTR [BP-6])
112RM_AX EQU (WORD PTR [BP-8])
113RM_BX EQU (WORD PTR [BP-10])
114RM_CX EQU (WORD PTR [BP-12])
115RM_DX EQU (WORD PTR [BP-14])
116RM_SI EQU (WORD PTR [BP-16])
117RM_DI EQU (WORD PTR [BP-18])
118RM_BP EQU (WORD PTR [BP-20])
119RM_DS EQU (WORD PTR [BP-22])
120RM_ES EQU (WORD PTR [BP-24])
121NREQ EQU (DWORD PTR [BP-28])
122NPTR EQU (DWORD PTR [BP-32])
123N_TMP EQU (WORD PTR [BP-34])
124N_AX EQU (WORD PTR [BP-36])
125CONV_FLAG EQU (WORD PTR [BP-38])
126
127;
128; Communication area for __fpuemu()
129;
130FPUEMU_COM STRUCT
131FEC_NOTIFY DD ?
132FEC_PNUM DD ?
133FEC_SIGNAL DD ?
134FEC_FRAME DD I_REG_DWORDS DUP (?)
135FPUEMU_COM ENDS
136
137FPUC_INIT = 0
138FPUC_NEXT = 1
139FPUC_SIGNAL = 2
140
141FPUN_NEWPROC = 0
142FPUN_ENDPROC = 1
143FPUN_EMU = 2
144
145;
146; These are the offsets of the PM/RM communication buffer
147;
148; Note: There's a bug in DOS function 5AH (COMPAQ DOS 3.31):
149; It stores a backslash DS:[DX+0FFFFH] if DX=0 !!!
150; 0 < OFFSET_1 < 16 (cf. D_READ, D_WRITE, INIT_BUFFER)
151;
152OFFSET_1 = 0004H ; Used if one buffer is required
153OFFSET_2 = 8000H ; Used for second buffer if two
154 ; buffers are required
155 IFNDEF __PMINT
156
157SV_DATA SEGMENT
158
159 EXTRN BUF_SEG:WORD
160 EXTRN BUF_SEL:WORD
161 EXTRN BUF1_SEG:WORD
162 EXTRN BUF2_SEG:WORD
163 EXTRN PMINT0_TAB:WORD
164 EXTRN PMINT8_TAB:WORD
165 EXTRN RM_CR0:DWORD
166 EXTRN PM_CR0:DWORD
167 EXTRN DBCS_LEAD_TAB:WORD
168
169SV_DATA ENDS
170
171SV_CODE SEGMENT
172
173 EXTRN IRQ0_ADD:BYTE
174 EXTRN IRQ8_ADD:BYTE
175
176 EXTRN INTERRUPT:NEAR ; Unexpected interrupt
177 EXTRN V2P_CONT:NEAR ; Return from VCPI server
178 EXTRN DOSF_ERROR:NEAR ; Invalid function code
179 EXTRN BREAK_AFTER_IRET:NEAR ; Set breakpoint to ret addr
180 EXTRN NMI:NEAR ; NMI handler
181 EXTRN PMINT_10H:NEAR ; VIO interface interrupt
182 EXTRN PMINT_11H:NEAR ; Equipment interrupt
183 EXTRN PMINT_14H:NEAR ; ASY interface interrupt
184 EXTRN PMINT_16H:NEAR ; KBD interface interrupt
185 EXTRN PMINT_17H:NEAR ; PRN interface interrupt
186 EXTRN PMINT_21H:NEAR ; DOS interface interrupt
187 EXTRN PMINT_31H:NEAR ; EXT interface interrupt
188 EXTRN PMINT_33H:NEAR ; MOU interface interrupt
189 EXTRN INT_RM:NEAR ; Call RM interrupt routine
190 EXTRN GET_DBCS_LEAD:NEAR ; Get DBCS lead bytes
191
192MOVE_TO_RM PROTO NEAR
193MOVE_FROM_RM PROTO NEAR
194
195SV_CODE ENDS
196
197
198INIT_CODE SEGMENT
199
200 EXTRN V2V_CONT:NEAR
201 EXTRN INIT_BUFFER:NEAR
202
203INIT_CODE ENDS
204
205 ENDIF
Note: See TracBrowser for help on using the repository browser.