/* V86 TRAP HANDLERS **********************************************************/
+#ifndef _MINIHAL_
VOID
FASTCALL
DECLSPEC_NORETURN
longjmp(HalpSavedContext, 1);
UNREACHABLE;
}
+#endif
/* V8086 ENTER ****************************************************************/
HalpFlushTLB();
}
+#ifndef _MINIHAL_
VOID
NTAPI
HalpSwitchToRealModeTrapHandlers(VOID)
//
KeRegisterInterruptHandler(6, HalpTrap06);
}
+#endif
VOID
NTAPI
HalpFlushTLB();
}
+#ifndef _MINIHAL_
BOOLEAN
NTAPI
HalpBiosDisplayReset(VOID)
__writeeflags(Flags);
return TRUE;
}
+#endif
/* EOF */
KdReleasePciDeviceforDebugging = HalpReleasePciDeviceForDebugging;
/* Register memory functions */
+#ifndef _MINIHAL_
KdMapPhysicalMemory64 = HalpMapPhysicalMemory64;
KdUnmapVirtualAddress = HalpUnmapVirtualAddress;
+#endif
/* Register ACPI stub */
KdCheckPowerButton = HalpCheckPowerButton;
NTAPI
HalpQueryPciRegistryInfo(VOID)
{
+#ifndef _MINIHAL_
WCHAR NameBuffer[8];
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName, ConfigName, IdentName;
/* Return it */
return PciRegistryInfo;
+#else
+ return NULL;
+#endif
}
VOID
/* GLOBALS *******************************************************************/
+#ifndef _MINIHAL_
CHAR ClassTable[3922] =
{
0x43, 0x20, 0x30, 0x30, 0x20, 0x20, 0x55, 0x6E, 0x63, 0x6C, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69,
0x20, 0x49, 0x6C, 0x6C, 0x65, 0x67, 0x61, 0x6C, 0x20, 0x56, 0x65, 0x6E, 0x64, 0x6F, 0x72, 0x20,
0x49, 0x44, 0x00,
};
+#endif
NTAPI
HalDisplayString(IN PCH String)
{
+#ifndef _MINIHAL_
/* Call the Inbv driver */
InbvDisplayString(String);
+#endif
}
/*
#define NDEBUG
#include <debug.h>
+#ifndef _MINIHAL_
static KEVENT HalpDmaLock;
static LIST_ENTRY HalpDmaAdapterList;
static PADAPTER_OBJECT HalpEisaAdapter[8];
+#endif
static BOOLEAN HalpEisaDma;
+#ifndef _MINIHAL_
static PADAPTER_OBJECT HalpMasterAdapter;
+#endif
static const ULONG_PTR HalpEisaPortPage[8] = {
FIELD_OFFSET(DMA_PAGE, Channel0),
FIELD_OFFSET(DMA_PAGE, Channel7)
};
+#ifndef _MINIHAL_
static DMA_OPERATIONS HalpDmaOperations = {
sizeof(DMA_OPERATIONS),
(PPUT_DMA_ADAPTER)HalPutDmaAdapter,
NULL /*(PBUILD_SCATTER_GATHER_LIST)HalBuildScatterGatherList*/,
NULL /*(PBUILD_MDL_FROM_SCATTER_GATHER_LIST)HalBuildMdlFromScatterGatherList*/
};
+#endif
#define MAX_MAP_REGISTERS 64
/* FUNCTIONS *****************************************************************/
+#ifndef _MINIHAL_
VOID
HalpInitDma(VOID)
{
*/
HalGetDmaAdapter = HalpGetDmaAdapter;
}
+#endif
/**
* @name HalpGetAdapterMaximumPhysicalAddress
return HighestAddress;
}
+#ifndef _MINIHAL_
/**
* @name HalpGrowMapBuffers
*
return AdapterObject;
}
+#endif
/**
* @name HalpDmaInitializeEisaAdapter
return TRUE;
}
+#ifndef _MINIHAL_
/**
* @name HalGetAdapter
*
Length,
CacheEnabled ? MmCached : MmNonCached);
}
+#endif
/**
* @name HalpDmaGetDmaAlignment
return Count;
}
+#ifndef _MINIHAL_
/**
* @name HalpGrowMapBufferWorker
*
*/
return PhysicalAddress;
}
+#endif
/**
* @name HalFlushCommonBuffer
KeBugCheckEx(MISMATCHED_HAL, 1, Prcb->MajorVersion, 1, 0);
}
+#ifndef _MINIHAL_
/* Initialize the PICs */
HalpInitializePICs(TRUE);
+#endif
/* Force initial PIC state */
KfRaiseIrql(KeGetCurrentIrql());
HalQuerySystemInformation = HaliQuerySystemInformation;
HalSetSystemInformation = HaliSetSystemInformation;
HalInitPnpDriver = NULL; // FIXME: TODO
+#ifndef _MINIHAL_
HalGetDmaAdapter = HalpGetDmaAdapter;
+#else
+ HalGetDmaAdapter = NULL;
+#endif
HalGetInterruptTranslator = NULL; // FIXME: TODO
+#ifndef _MINIHAL_
HalResetDisplay = HalpBiosDisplayReset;
+#else
+ HalResetDisplay = NULL;
+#endif
HalHaltSystem = HaliHaltSystem;
/* Register IRQ 2 */
/* Setup busy waiting */
HalpCalibrateStallExecution();
+#ifndef _MINIHAL_
/* Initialize the clock */
HalpInitializeClock();
+#endif
/*
* We could be rebooting with a pending profile interrupt,
/* Initialize bus handlers */
HalpInitBusHandler();
+#ifndef _MINIHAL_
/* Enable IRQ 0 */
HalpEnableInterruptHandler(IDT_DEVICE,
0,
/* Initialize DMA. NT does this in Phase 0 */
HalpInitDma();
+#endif
/* Do some HAL-specific initialization */
HalpInitPhase1();
return;
}
+#ifndef _MINIHAL_
PVOID
NTAPI
HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress,
//
MmUnmapIoSpace(VirtualAddress, NumberPages << PAGE_SHIFT);
}
+#endif
VOID
NTAPI
NTAPI
HalHandleNMI(IN PVOID NmiInfo)
{
+#ifndef _MINIHAL_
SYSTEM_CONTROL_PORT_B_REGISTER SystemControl;
//
// Halt the system
//
InbvDisplayString("\n*** The system has halted ***\n");
+#endif
//
// Enter the debugger if possible
/* GLOBALS ********************************************************************/
+#ifndef _MINIHAL_
/*
* This table basically keeps track of level vs edge triggered interrupts.
* Windows has 250+ entries, but it seems stupid to replicate that since the PIC
}
}
+#else
+
+KIRQL
+NTAPI
+KeGetCurrentIrql(VOID)
+{
+ return PASSIVE_LEVEL;
+}
+
+VOID
+FASTCALL
+KfLowerIrql(
+ IN KIRQL OldIrql)
+{
+}
+
+KIRQL
+FASTCALL
+KfRaiseIrql(
+ IN KIRQL NewIrql)
+{
+ return NewIrql;
+}
+
+#endif
case HalHaltRoutine:
case HalRebootRoutine:
+#ifndef _MINIHAL_
/* Acquire the display */
InbvAcquireDisplayOwnership();
+#endif
/* Call the internal reboot function */
HalpReboot();
ret
.endfunc
+#ifndef _MINIHAL_
.globl _KeStallExecutionProcessor@4
.func KeStallExecutionProcessor@4
_KeStallExecutionProcessor@4:
/* Return */
ret 4
.endfunc
+#endif
.global _KeQueryPerformanceCounter@4
.func KeQueryPerformanceCounter@4
HalpCurrentRollOver = RollOver;
}
+#ifndef _MINIHAL_
VOID
FASTCALL
HalpClockInterruptHandler(IN PKTRAP_FRAME TrapFrame)
/* Spurious, just end the interrupt */
KiEoiHelper(TrapFrame);
}
+#endif
/* PUBLIC FUNCTIONS ***********************************************************/
HalpIDTUsage[SystemVector].BusReleativeVector = BusVector;
}
+#ifndef _MINIHAL_
VOID
NTAPI
HalpEnableInterruptHandler(IN UCHAR Flags,
/* Enable the interrupt */
HalEnableSystemInterrupt(SystemVector, Irql, Mode);
}
+#endif
/*
* @unimplemented
<pch>hal.h</pch>
</directory>
</module>
+ <module name="mini_hal" type="objectlibrary">
+ <include>include</include>
+ <include base="ntoskrnl">include</include>
+ <define name="_NTHAL_" />
+ <define name="_NTSYSTEM_" />
+ <define name="_MINIHAL_" />
+ <directory name="generic">
+ <directory name="bus">
+ <file>bushndlr.c</file>
+ <file>isabus.c</file>
+ <file>halbus.c</file>
+ <file>pcibus.c</file>
+ <file>pcidata.c</file>
+ <file>sysbus.c</file>
+ </directory>
+ <file>beep.c</file>
+ <file>bios.c</file>
+ <file>cmos.c</file>
+ <file>dma.c</file>
+ <file>display.c</file>
+ <file>drive.c</file>
+ <file>misc.c</file>
+ <file>pic.c</file>
+ <file>portio.c</file>
+ <file>processor.c</file>
+ <file>profil.c</file>
+ <file>reboot.c</file>
+ <file>spinlock.c</file>
+ <file>sysinfo.c</file>
+ <file>systimer.S</file>
+ <file>timer.c</file>
+ <file>usage.c</file>
+ </directory>
+ <directory name="up">
+ <file>halinit_up.c</file>
+ </directory>
+ </module>
</group>
#undef _NTHAL_
#undef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT
+#ifndef _MINIHAL_
#undef NTSYSAPI
#define NTSYSAPI __declspec(dllimport)
+#else
+#undef _NTSYSTEM_
+#endif
/* IFS/DDK/NDK Headers */
#include <ntifs.h>