mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[FREELDR]
- Implement HwIdle() function to put cpu in idle mode, when waiting for keyboard input. - Patch by Carlo Bramini (carlo dot bramix at libero.it) See issue #6453 for more details. svn path=/trunk/; revision=56270
This commit is contained in:
parent
644889076d
commit
e322927d5a
12 changed files with 63 additions and 0 deletions
|
@ -164,6 +164,12 @@ ArmMemGetMemoryMap(OUT ULONG *MemoryMapSize)
|
|||
return ArmBoardBlock->MemoryMapEntryCount;
|
||||
}
|
||||
|
||||
VOID
|
||||
ArmHwIdle(VOID)
|
||||
{
|
||||
/* UNIMPLEMENTED */
|
||||
}
|
||||
|
||||
VOID
|
||||
MachInit(IN PCCH CommandLine)
|
||||
{
|
||||
|
@ -217,4 +223,5 @@ MachInit(IN PCCH CommandLine)
|
|||
MachVtbl.GetMemoryMap = ArmMemGetMemoryMap;
|
||||
MachVtbl.HwDetect = ArmHwDetect;
|
||||
MachVtbl.DiskGetBootPath = ArmDiskGetBootPath;
|
||||
MachVtbl.HwIdle = ArmHwIdle;
|
||||
}
|
||||
|
|
|
@ -1731,4 +1731,28 @@ PcHwDetect(VOID)
|
|||
return SystemKey;
|
||||
}
|
||||
|
||||
VOID
|
||||
PcHwIdle(VOID)
|
||||
{
|
||||
REGS Regs;
|
||||
|
||||
/* Select APM 1.0+ function */
|
||||
Regs.b.ah = 0x53;
|
||||
|
||||
/* Function 05h: CPU idle */
|
||||
Regs.b.al = 0x05;
|
||||
|
||||
/* Call INT 15h */
|
||||
Int386(0x15, &Regs, &Regs);
|
||||
|
||||
/* Check if successfull (CF set on error) */
|
||||
if (INT386_SUCCESS(Regs))
|
||||
return;
|
||||
|
||||
/*
|
||||
* No futher processing here.
|
||||
* Optionally implement HLT instruction handling.
|
||||
*/
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -47,6 +47,7 @@ PcMachInit(const char *CmdLine)
|
|||
MachVtbl.DiskGetCacheableBlockCount = PcDiskGetCacheableBlockCount;
|
||||
MachVtbl.GetTime = PcGetTime;
|
||||
MachVtbl.HwDetect = PcHwDetect;
|
||||
MachVtbl.HwIdle = PcHwIdle;
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
|
@ -53,6 +53,7 @@ XboxMachInit(const char *CmdLine)
|
|||
MachVtbl.DiskGetCacheableBlockCount = XboxDiskGetCacheableBlockCount;
|
||||
MachVtbl.GetTime = XboxGetTime;
|
||||
MachVtbl.HwDetect = XboxHwDetect;
|
||||
MachVtbl.HwIdle = XboxHwIdle;
|
||||
|
||||
/* Set LEDs to orange after init */
|
||||
XboxSetLED("oooo");
|
||||
|
|
|
@ -512,4 +512,9 @@ XboxHwDetect(VOID)
|
|||
return SystemKey;
|
||||
}
|
||||
|
||||
VOID XboxHwIdle(VOID)
|
||||
{
|
||||
/* UNIMPLEMENTED */
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -414,6 +414,12 @@ PCONFIGURATION_COMPONENT_DATA PpcHwDetect() {
|
|||
return RootKey;
|
||||
}
|
||||
|
||||
VOID
|
||||
PpcHwIdle(VOID)
|
||||
{
|
||||
/* UNIMPLEMENTED */
|
||||
}
|
||||
|
||||
/* Compatibility functions that don't do much */
|
||||
VOID PpcVideoPrepareForReactOS(BOOLEAN Setup) {
|
||||
}
|
||||
|
@ -448,6 +454,7 @@ void PpcDefaultMachVtbl()
|
|||
MachVtbl.GetTime = PpcGetTime;
|
||||
|
||||
MachVtbl.HwDetect = PpcHwDetect;
|
||||
MachVtbl.HwIdle = PpcHwIdle;
|
||||
}
|
||||
|
||||
void PpcOfwInit()
|
||||
|
|
|
@ -118,6 +118,12 @@ PCONFIGURATION_COMPONENT_DATA PpcPrepHwDetect() {
|
|||
return SystemKey;
|
||||
}
|
||||
|
||||
VOID
|
||||
PpcPrepHwIdle(VOID)
|
||||
{
|
||||
/* UNIMPLEMENTED */
|
||||
}
|
||||
|
||||
void PpcPrepInit()
|
||||
{
|
||||
MachVtbl.ConsPutChar = PpcPrepPutChar;
|
||||
|
@ -139,6 +145,7 @@ void PpcPrepInit()
|
|||
|
||||
MachVtbl.GetMemoryMap = PpcPrepGetMemoryMap;
|
||||
MachVtbl.HwDetect = PpcPrepHwDetect;
|
||||
MachVtbl.HwIdle = PcPrepHwIdle;
|
||||
|
||||
printf( "FreeLDR version [%s]\n", GetFreeLoaderVersionString() );
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ ULONG XboxDiskGetCacheableBlockCount(UCHAR DriveNumber);
|
|||
TIMEINFO* XboxGetTime(VOID);
|
||||
|
||||
PCONFIGURATION_COMPONENT_DATA XboxHwDetect(VOID);
|
||||
VOID XboxHwIdle(VOID);
|
||||
|
||||
VOID XboxSetLED(PCSTR Pattern);
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ ULONG PcDiskGetCacheableBlockCount(UCHAR DriveNumber);
|
|||
TIMEINFO* PcGetTime(VOID);
|
||||
|
||||
PCONFIGURATION_COMPONENT_DATA PcHwDetect(VOID);
|
||||
VOID PcHwIdle(VOID);
|
||||
|
||||
extern BIOS_MEMORY_MAP PcBiosMemoryMap[];
|
||||
extern ULONG PcBiosMapCount;
|
||||
|
|
|
@ -69,6 +69,7 @@ typedef struct tagMACHVTBL
|
|||
ULONG (*GetRelativeTime)(VOID);
|
||||
|
||||
PCONFIGURATION_COMPONENT_DATA (*HwDetect)(VOID);
|
||||
VOID (*HwIdle)(VOID);
|
||||
} MACHVTBL, *PMACHVTBL;
|
||||
|
||||
VOID MachInit(const char *CmdLine);
|
||||
|
@ -97,6 +98,7 @@ BOOLEAN MachDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, UL
|
|||
BOOLEAN MachDiskGetDriveGeometry(UCHAR DriveNumber, PGEOMETRY DriveGeometry);
|
||||
ULONG MachDiskGetCacheableBlockCount(UCHAR DriveNumber);
|
||||
VOID MachPrepareForReactOS(IN BOOLEAN Setup);
|
||||
VOID MachHwIdle(VOID);
|
||||
|
||||
#define MachConsPutChar(Ch) MachVtbl.ConsPutChar(Ch)
|
||||
#define MachConsKbHit() MachVtbl.ConsKbHit()
|
||||
|
@ -121,5 +123,6 @@ VOID MachPrepareForReactOS(IN BOOLEAN Setup);
|
|||
#define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
|
||||
#define MachDiskGetCacheableBlockCount(Drive) MachVtbl.DiskGetCacheableBlockCount(Drive)
|
||||
#define MachHwDetect() MachVtbl.HwDetect()
|
||||
#define MachHwIdle() MachVtbl.HwIdle()
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -624,6 +624,8 @@ VOID TuiMessageBoxCritical(PCSTR MessageText)
|
|||
TuiUpdateDateTime();
|
||||
|
||||
VideoCopyOffScreenBufferToVRAM();
|
||||
|
||||
MachHwIdle();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -944,6 +946,8 @@ BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
|
|||
TuiUpdateDateTime();
|
||||
|
||||
VideoCopyOffScreenBufferToVRAM();
|
||||
|
||||
MachHwIdle();
|
||||
}
|
||||
|
||||
// Hide the cursor again
|
||||
|
|
|
@ -119,6 +119,8 @@ TuiDisplayMenu(PCSTR MenuItemList[],
|
|||
//
|
||||
break;
|
||||
}
|
||||
|
||||
MachHwIdle();
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue