merge trunk head (37902)
[reactos.git] / reactos / hal / halamd64 / generic / mps.S
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/hal/amd64/generic/mps.S
5 * PURPOSE: Intel MultiProcessor specification support
6 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 */
8
9 /* INCLUDES ******************************************************************/
10
11 #include <ndk/asm.h>
12
13 /* FUNCTIONS *****************************************************************/
14
15 #define BEFORE \
16 cld; \
17 pushq %rax; \
18 pushq %rbx; \
19 pushq %rcx; \
20 pushq %rdx; \
21 pushq %rsi; \
22 pushq %rdi; \
23 pushq %fs; \
24 pushq %gs; \
25
26 #define AFTER \
27 popq %gs; \
28 popq %fs; \
29 popq %rdi; \
30 popq %rsi; \
31 popq %rdx; \
32 popq %rcx; \
33 popq %rbx; \
34 popq %rax; \
35
36 #ifdef CONFIG_SMP
37 .global _MpsIpiInterrupt
38 _MpsIpiInterrupt:
39 /* Save registers */
40 BEFORE
41
42 /* Call the C handler */
43 call _MpsIpiHandler
44
45 /* Return to the caller */
46 AFTER
47 iret
48 #endif
49
50 .globl _MpsErrorInterrupt
51 _MpsErrorInterrupt:
52 /* Save registers */
53 BEFORE
54
55 /* Call the C handler */
56 call _MpsErrorHandler
57
58 /* Return to the caller */
59 AFTER
60 iret
61
62
63 .globl _MpsSpuriousInterrupt
64 _MpsSpuriousInterrupt:
65 /* Save registers */
66 BEFORE
67
68 /* Call the C handler */
69 call _MpsSpuriousHandler
70
71 /* Return to the caller */
72 AFTER
73 iret
74
75 .global _MpsTimerInterrupt
76 _MpsTimerInterrupt:
77 /* Save registers */
78 BEFORE
79
80 movl $0xef,%ebx
81 movl $0xceafbeef,%eax
82 pushq %rax
83 pushq %rsp
84 pushq %rbx
85 call _MpsTimerHandler
86 popq %rax
87 popq %rax
88 popq %rax
89
90 /* Return to the caller */
91 AFTER
92 iret
93
94
95 /* EOF */