Update inline assembler to be compatible with MSVC

svn path=/trunk/; revision=7351
This commit is contained in:
Aleksey Bragin 2003-12-30 22:10:45 +00:00
parent 729c0cac35
commit e4c6acf822
5 changed files with 38 additions and 7 deletions

View file

@ -52,7 +52,14 @@ NtShutdownSystem(IN SHUTDOWN_ACTION Action)
HalReturnToFirmware (FIRMWARE_OFF);
#else
PopSetSystemPowerState(PowerSystemShutdown);
#ifdef __GNUC__
__asm__("cli\n");
#elif defined(_MSC_VER)
__asm cli
#else
#error Unknown compiler for inline assembler
#endif
while (TRUE)
{
;

View file

@ -28,7 +28,6 @@
#endif
#define UNIMPLEMENTED do {DbgPrint("%s at %s:%d is unimplemented, have a nice day\n",__FUNCTION__,__FILE__,__LINE__); for(;;); } while(0)
#ifdef DBG
/* Assert only on "checked" version */

View file

@ -1,4 +1,4 @@
/* $Id: kdebug.c,v 1.48 2003/12/23 05:04:59 arty Exp $
/* $Id: kdebug.c,v 1.49 2003/12/30 22:06:39 fireball Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -386,7 +386,13 @@ KeEnterKernelDebugger(VOID)
HalDisplayString("\n\n *** Entered kernel debugger ***\n");
for (;;)
#ifdef __GNUC__
__asm__("hlt\n\t");
#elif defined(_MSC_VER)
__asm hlt
#else
#error Unknown compiler for inline assembler
#endif
}
VOID STDCALL

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: irq.c,v 1.37 2003/12/30 18:52:05 fireball Exp $
/* $Id: irq.c,v 1.38 2003/12/30 22:10:45 fireball Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/i386/irq.c
@ -491,7 +491,13 @@ KiInterruptDispatch (ULONG irq, PKIRQ_TRAPFRAME Trapframe)
* Enable interrupts
* NOTE: Only higher priority interrupts will get through
*/
#ifdef __GNUC__
__asm__("sti\n\t");
#elif defined(_MSC_VER)
__asm sti
#else
#error Unknown compiler for inline assembler
#endif
/*
* Actually call the ISR.
@ -517,7 +523,14 @@ KiInterruptDispatch (ULONG irq, PKIRQ_TRAPFRAME Trapframe)
/*
* End the system interrupt.
*/
#ifdef __GNUC__
__asm__("cli\n\t");
#elif defined(_MSC_VER)
__asm cli
#else
#error Unknown compiler for inline assembler
#endif
HalEndSystemInterrupt (old_level, 0);
if (old_level==PASSIVE_LEVEL && Trapframe->Cs != KERNEL_CS)

View file

@ -39,7 +39,13 @@ PsIdleThreadMain(PVOID Context)
KeLowerIrql(oldlvl);
}
NtYieldExecution();
__asm__( "hlt" );
#ifdef __GNUC__
__asm__("hlt\n\t");
#elif defined(_MSC_VER)
__asm hlt
#else
#error Unknown compiler for inline assembler
#endif
}
}