2012-02-18 22:57:24 +00:00
|
|
|
/*
|
2001-08-21 20:18:27 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
2010-01-21 13:43:49 +00:00
|
|
|
* FILE: hal/halx86/mp/mps.S
|
2001-08-21 20:18:27 +00:00
|
|
|
* PURPOSE: Intel MultiProcessor specification support
|
|
|
|
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
|
|
|
* UPDATE HISTORY:
|
|
|
|
* Created 12/04/2001
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
2011-05-23 19:48:04 +00:00
|
|
|
#include <ndk/asm.h>
|
2001-08-21 20:18:27 +00:00
|
|
|
|
|
|
|
/* FUNCTIONS *****************************************************************/
|
|
|
|
|
|
|
|
#define BEFORE \
|
2004-12-03 20:10:45 +00:00
|
|
|
cld; \
|
2001-08-21 20:18:27 +00:00
|
|
|
pusha; \
|
|
|
|
pushl %ds; \
|
|
|
|
pushl %es; \
|
|
|
|
pushl %fs; \
|
|
|
|
pushl %gs; \
|
2005-11-27 03:08:35 +00:00
|
|
|
movl $(KGDT_R0_DATA), %eax; \
|
2001-08-21 20:18:27 +00:00
|
|
|
movl %eax, %ds; \
|
|
|
|
movl %eax, %es; \
|
|
|
|
movl %eax, %gs; \
|
2005-11-27 03:08:35 +00:00
|
|
|
movl $(KGDT_R0_PCR), %eax; \
|
2001-08-21 20:18:27 +00:00
|
|
|
movl %eax, %fs;
|
|
|
|
|
|
|
|
#define AFTER \
|
|
|
|
popl %gs; \
|
|
|
|
popl %fs; \
|
|
|
|
popl %es; \
|
|
|
|
popl %ds; \
|
|
|
|
popa;
|
|
|
|
|
2004-11-28 01:30:02 +00:00
|
|
|
.global _MpsIpiInterrupt
|
|
|
|
_MpsIpiInterrupt:
|
|
|
|
/* Save registers */
|
|
|
|
BEFORE
|
|
|
|
|
|
|
|
/* Call the C handler */
|
|
|
|
call _MpsIpiHandler
|
|
|
|
|
|
|
|
/* Return to the caller */
|
|
|
|
AFTER
|
|
|
|
iret
|
|
|
|
|
|
|
|
|
2001-08-21 20:18:27 +00:00
|
|
|
.globl _MpsErrorInterrupt
|
|
|
|
_MpsErrorInterrupt:
|
|
|
|
/* Save registers */
|
|
|
|
BEFORE
|
|
|
|
|
|
|
|
/* Call the C handler */
|
|
|
|
call _MpsErrorHandler
|
|
|
|
|
|
|
|
/* Return to the caller */
|
|
|
|
AFTER
|
|
|
|
iret
|
|
|
|
|
|
|
|
|
|
|
|
.globl _MpsSpuriousInterrupt
|
|
|
|
_MpsSpuriousInterrupt:
|
|
|
|
/* Save registers */
|
|
|
|
BEFORE
|
|
|
|
|
|
|
|
/* Call the C handler */
|
|
|
|
call _MpsSpuriousHandler
|
|
|
|
|
|
|
|
/* Return to the caller */
|
|
|
|
AFTER
|
|
|
|
iret
|
|
|
|
|
2004-11-01 19:01:25 +00:00
|
|
|
.global _MpsTimerInterrupt
|
|
|
|
_MpsTimerInterrupt:
|
|
|
|
cld
|
|
|
|
pusha
|
|
|
|
movl $0xef,%ebx
|
|
|
|
pushl %ds
|
|
|
|
pushl %es
|
|
|
|
pushl %fs
|
|
|
|
pushl %gs
|
|
|
|
movl $0xceafbeef,%eax
|
|
|
|
pushl %eax
|
2005-11-27 03:08:35 +00:00
|
|
|
movl $(KGDT_R0_DATA),%eax
|
2004-11-01 19:01:25 +00:00
|
|
|
movl %eax,%ds
|
|
|
|
movl %eax,%es
|
|
|
|
movl %eax,%gs
|
2005-11-27 03:08:35 +00:00
|
|
|
movl $(KGDT_R0_PCR),%eax
|
2004-11-01 19:01:25 +00:00
|
|
|
movl %eax,%fs
|
|
|
|
pushl %esp
|
|
|
|
pushl %ebx
|
|
|
|
call _MpsTimerHandler
|
|
|
|
popl %eax
|
|
|
|
popl %eax
|
|
|
|
popl %eax
|
|
|
|
popl %gs
|
|
|
|
popl %fs
|
|
|
|
popl %es
|
|
|
|
popl %ds
|
|
|
|
popa
|
|
|
|
iret
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-08-21 20:18:27 +00:00
|
|
|
/* EOF */
|