* Bring back rbuild build to be used until bug 6372 is fixed.
[reactos.git] / hal / halx86 / mp / i386 / mps.S
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: hal/halx86/mp/mps.S
6 * PURPOSE: Intel MultiProcessor specification support
7 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
8 * UPDATE HISTORY:
9 * Created 12/04/2001
10 */
11
12 /* INCLUDES ******************************************************************/
13
14 #include <ndk/asm.h>
15
16 /* FUNCTIONS *****************************************************************/
17
18 #define BEFORE \
19 cld; \
20 pusha; \
21 pushl %ds; \
22 pushl %es; \
23 pushl %fs; \
24 pushl %gs; \
25 movl $(KGDT_R0_DATA), %eax; \
26 movl %eax, %ds; \
27 movl %eax, %es; \
28 movl %eax, %gs; \
29 movl $(KGDT_R0_PCR), %eax; \
30 movl %eax, %fs;
31
32 #define AFTER \
33 popl %gs; \
34 popl %fs; \
35 popl %es; \
36 popl %ds; \
37 popa;
38
39 .global _MpsIpiInterrupt
40 _MpsIpiInterrupt:
41 /* Save registers */
42 BEFORE
43
44 /* Call the C handler */
45 call _MpsIpiHandler
46
47 /* Return to the caller */
48 AFTER
49 iret
50
51
52 .globl _MpsErrorInterrupt
53 _MpsErrorInterrupt:
54 /* Save registers */
55 BEFORE
56
57 /* Call the C handler */
58 call _MpsErrorHandler
59
60 /* Return to the caller */
61 AFTER
62 iret
63
64
65 .globl _MpsSpuriousInterrupt
66 _MpsSpuriousInterrupt:
67 /* Save registers */
68 BEFORE
69
70 /* Call the C handler */
71 call _MpsSpuriousHandler
72
73 /* Return to the caller */
74 AFTER
75 iret
76
77 .global _MpsTimerInterrupt
78 _MpsTimerInterrupt:
79 cld
80 pusha
81 movl $0xef,%ebx
82 pushl %ds
83 pushl %es
84 pushl %fs
85 pushl %gs
86 movl $0xceafbeef,%eax
87 pushl %eax
88 movl $(KGDT_R0_DATA),%eax
89 movl %eax,%ds
90 movl %eax,%es
91 movl %eax,%gs
92 movl $(KGDT_R0_PCR),%eax
93 movl %eax,%fs
94 pushl %esp
95 pushl %ebx
96 call _MpsTimerHandler
97 popl %eax
98 popl %eax
99 popl %eax
100 popl %gs
101 popl %fs
102 popl %es
103 popl %ds
104 popa
105 iret
106
107
108
109 /* EOF */