mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-27 15:54:06 +02:00
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:
parent
f9f2a082c1
commit
3a8752a5ab
@ -83,8 +83,9 @@ static char *portab_hRcsId =
|
|||||||
void __int__(int);
|
void __int__(int);
|
||||||
#ifndef FORSYS
|
#ifndef FORSYS
|
||||||
void __emit__(char, ...);
|
void __emit__(char, ...);
|
||||||
#define disable() __emit__(0xfa)
|
#define disable() __emit__(0xfa) /* cli; disable interrupts */
|
||||||
#define enable() __emit__(0xfb)
|
#define enable() __emit__(0xfb) /* sti; enable interrupts */
|
||||||
|
#define halt() __emit__(0xf4) /* hlt; halt until interrupt */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined (_MSC_VER)
|
#elif defined (_MSC_VER)
|
||||||
@ -99,6 +100,7 @@ void __emit__(char, ...);
|
|||||||
#define __int__(intno) asm int intno;
|
#define __int__(intno) asm int intno;
|
||||||
#define disable() asm cli
|
#define disable() asm cli
|
||||||
#define enable() asm sti
|
#define enable() asm sti
|
||||||
|
#define halt() asm hlt
|
||||||
#define _CS getCS()
|
#define _CS getCS()
|
||||||
static unsigned short __inline getCS(void)
|
static unsigned short __inline getCS(void)
|
||||||
{
|
{
|
||||||
@ -118,6 +120,8 @@ void disable(void);
|
|||||||
#pragma aux disable = "cli" modify exact [];
|
#pragma aux disable = "cli" modify exact [];
|
||||||
void enable(void);
|
void enable(void);
|
||||||
#pragma aux enable = "sti" modify exact [];
|
#pragma aux enable = "sti" modify exact [];
|
||||||
|
void halt(void);
|
||||||
|
#pragma aux halt = "hlt" modify exact [];
|
||||||
#define asm __asm
|
#define asm __asm
|
||||||
#define far __far
|
#define far __far
|
||||||
#define CDECL __cdecl
|
#define CDECL __cdecl
|
||||||
|
@ -1929,8 +1929,8 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs r)
|
|||||||
case 0x80: /* Win Release Time-slice */
|
case 0x80: /* Win Release Time-slice */
|
||||||
{
|
{
|
||||||
/* This function is generally only called in idle loops */
|
/* This function is generally only called in idle loops */
|
||||||
__emit__(0xfb); /* sti; enable interrupts */
|
enable(); /* sti; enable interrupts */
|
||||||
__emit__(0xf4); /* hlt; halt until interrupt */
|
halt(); /* hlt; halt until interrupt */
|
||||||
r.AX = 0;
|
r.AX = 0;
|
||||||
/* DebugPrintf(("Release Time Slice\n")); */
|
/* DebugPrintf(("Release Time Slice\n")); */
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user