add/use halt() wrapper for issuing "hlt" asm instruction

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1158 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Kenneth J Davis 2005-11-26 18:59:53 +00:00
parent f9f2a082c1
commit 3a8752a5ab
2 changed files with 8 additions and 4 deletions

View File

@ -83,8 +83,9 @@ static char *portab_hRcsId =
void __int__(int);
#ifndef FORSYS
void __emit__(char, ...);
#define disable() __emit__(0xfa)
#define enable() __emit__(0xfb)
#define disable() __emit__(0xfa) /* cli; disable interrupts */
#define enable() __emit__(0xfb) /* sti; enable interrupts */
#define halt() __emit__(0xf4) /* hlt; halt until interrupt */
#endif
#elif defined (_MSC_VER)
@ -99,6 +100,7 @@ void __emit__(char, ...);
#define __int__(intno) asm int intno;
#define disable() asm cli
#define enable() asm sti
#define halt() asm hlt
#define _CS getCS()
static unsigned short __inline getCS(void)
{
@ -118,6 +120,8 @@ void disable(void);
#pragma aux disable = "cli" modify exact [];
void enable(void);
#pragma aux enable = "sti" modify exact [];
void halt(void);
#pragma aux halt = "hlt" modify exact [];
#define asm __asm
#define far __far
#define CDECL __cdecl

View File

@ -1929,8 +1929,8 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs r)
case 0x80: /* Win Release Time-slice */
{
/* This function is generally only called in idle loops */
__emit__(0xfb); /* sti; enable interrupts */
__emit__(0xf4); /* hlt; halt until interrupt */
enable(); /* sti; enable interrupts */
halt(); /* hlt; halt until interrupt */
r.AX = 0;
/* DebugPrintf(("Release Time Slice\n")); */
break;