[HAL] Convert HalpEndSoftwareInterrupt2 to fastcall. CORE-14076
[reactos.git] / hal / halx86 / up / pic.S
1 /*
2 * FILE: hal/halx86/up/pic.S
3 * COPYRIGHT: See COPYING in the top level directory
4 * PURPOSE: HAL PIC Management and Control Code
5 * PROGRAMMER: Thomas Faber (thomas.faber@reactos.org)
6 */
7
8 /* INCLUDES ******************************************************************/
9
10 #include <asm.inc>
11
12 #include <ks386.inc>
13
14 EXTERN @HalpEndSoftwareInterrupt2@8:PROC
15
16 /* GLOBALS *******************************************************************/
17
18 .data
19 ASSUME CS:NOTHING, DS:NOTHING, ES:NOTHING, FS:NOTHING, GS:NOTHING
20
21 /* FUNCTIONS *****************************************************************/
22
23 .code
24 PUBLIC _HalpEndSoftwareInterrupt@8
25 .PROC _HalpEndSoftwareInterrupt@8
26 FPO 0, 2, 0, 0, 0, FRAME_FPO
27
28 /* Call the C function with the same arguments we got */
29 mov ecx, [esp+4]
30 mov edx, [esp+8]
31 call @HalpEndSoftwareInterrupt2@8
32
33 /* Check if we got a pointer back */
34 test eax, eax
35 jnz CallIntHandler
36
37 /* No? Just return */
38 ret 8
39
40 CallIntHandler:
41 /* We got a pointer to call. Since it won't return, free up our stack
42 space. Otherwise we could end up with some nasty deep recursion.
43 The next function takes the trap frame as its (fastcall) argument. */
44 mov ecx, [esp+8]
45 add esp, 12
46 jmp eax
47 .ENDP
48
49 END