xref: /reactos/hal/halx86/mp/mps.S (revision 53221834)
1/*
2 * COPYRIGHT:       See COPYING in the top level directory
3 * PROJECT:         ReactOS kernel
4 * FILE:            hal/halx86/mp/mps.S
5 * PURPOSE:         Intel MultiProcessor specification support
6 * PROGRAMMER:      Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * UPDATE HISTORY:
8 *                  Created 12/04/2001
9 */
10
11/* INCLUDES ******************************************************************/
12
13#include <ndk/asm.h>
14
15/* FUNCTIONS *****************************************************************/
16
17#define BEFORE \
18  cld; \
19  pusha; \
20  pushl %ds; \
21  pushl %es; \
22  pushl %fs; \
23  pushl %gs; \
24  movl  $(KGDT_R0_DATA), %eax; \
25  movl  %eax, %ds; \
26  movl  %eax, %es; \
27  movl  %eax, %gs; \
28  movl  $(KGDT_R0_PCR), %eax; \
29  movl  %eax, %fs;
30
31#define AFTER \
32  popl  %gs; \
33  popl  %fs; \
34  popl  %es; \
35  popl  %ds; \
36  popa;
37
38.global _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
50
51.globl _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.globl _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.global _MpsTimerInterrupt
77_MpsTimerInterrupt:
78	cld
79	pusha
80	movl	$0xef,%ebx
81  	pushl 	%ds
82  	pushl 	%es
83  	pushl 	%fs
84  	pushl	%gs
85  	movl	$0xceafbeef,%eax
86  	pushl 	%eax
87  	movl	$(KGDT_R0_DATA),%eax
88  	movl	%eax,%ds
89  	movl	%eax,%es
90  	movl	%eax,%gs
91  	movl	$(KGDT_R0_PCR),%eax
92  	movl	%eax,%fs
93  	pushl 	%esp
94  	pushl 	%ebx
95  	call	_MpsTimerHandler
96    	popl	%eax
97  	popl	%eax
98  	popl	%eax
99  	popl	%gs
100  	popl	%fs
101  	popl	%es
102  	popl	%ds
103  	popa
104  	iret
105
106
107
108/* EOF */
109