[NTOSKRNL/CONFIG]
[reactos.git] / reactos / hal / halx86 / mp / amd64 / 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 <reactos/asm.h>
12 #include <ndk/amd64/asm.h>
13
14 /* FUNCTIONS *****************************************************************/
15
16 #define BEFORE \
17 cld; \
18 push rax; \
19 push rbx; \
20 push rcx; \
21 push rdx; \
22 push rsi; \
23 push rdi; \
24 push fs; \
25 push gs; \
26
27 #define AFTER \
28 pop gs; \
29 pop fs; \
30 pop rdi; \
31 pop rsi; \
32 pop rdx; \
33 pop rcx; \
34 pop rbx; \
35 pop rax; \
36
37 #ifdef CONFIG_SMP
38 PUBLIC MpsIpiInterrupt
39 MpsIpiInterrupt:
40 /* Save registers */
41 BEFORE
42
43 /* Call the C handler */
44 call MpsIpiHandler
45
46 /* Return to the caller */
47 AFTER
48 iret
49 #endif
50
51 PUBLIC MpsErrorInterrupt
52 MpsErrorInterrupt:
53 /* Save registers */
54 BEFORE
55
56 /* Call the C handler */
57 call MpsErrorHandler
58
59 /* Return to the caller */
60 AFTER
61 iret
62
63
64 PUBLIC MpsSpuriousInterrupt
65 MpsSpuriousInterrupt:
66 /* Save registers */
67 BEFORE
68
69 /* Call the C handler */
70 call MpsSpuriousHandler
71
72 /* Return to the caller */
73 AFTER
74 iret
75
76 PUBLIC MpsTimerInterrupt
77 MpsTimerInterrupt:
78 /* Save registers */
79 BEFORE
80
81 mov ebx, 0xef
82 mov eax, 0xceafbeef
83 push rax
84 push rsp
85 push rbx
86 call MpsTimerHandler
87 pop rax
88 pop rax
89 pop rax
90
91 /* Return to the caller */
92 AFTER
93 iret
94
95
96 /* EOF */