mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 20:43:25 +00:00
[HAL]
- Move all amd64 specific files to one amd64 folder - Compile x86 specific timer code only on x86 - Use KeRegisterInterruptHandler instead of manual idt manipulation - add missing stubs for amd64 svn path=/trunk/; revision=47565
This commit is contained in:
parent
a95f10c476
commit
2b0533a1b0
11 changed files with 239 additions and 31 deletions
31
reactos/hal/halx86/amd64/halinit.c
Normal file
31
reactos/hal/halx86/amd64/halinit.c
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS HAL
|
||||||
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
|
* FILE: hal/halx86/amd64/halinit.c
|
||||||
|
* PURPOSE: HAL Entrypoint and Initialization
|
||||||
|
* PROGRAMMERS:
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
|
#include <hal.h>
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
/* PRIVATE FUNCTIONS *********************************************************/
|
||||||
|
|
||||||
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
HalInitSystem(IN ULONG BootPhase,
|
||||||
|
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return FALSE;
|
||||||
|
}
|
97
reactos/hal/halx86/amd64/processor.c
Normal file
97
reactos/hal/halx86/amd64/processor.c
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS HAL
|
||||||
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
|
* FILE: hal/halx86/amd64/processor.c
|
||||||
|
* PURPOSE: HAL Processor Routines
|
||||||
|
* PROGRAMMERS: Timo Kreuzer (timo.kreuzer@reactos.org)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
|
#include <hal.h>
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
KAFFINITY HalpActiveProcessors;
|
||||||
|
KAFFINITY HalpDefaultInterruptAffinity;
|
||||||
|
|
||||||
|
/* PRIVATE FUNCTIONS *********************************************************/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
HaliHaltSystem(VOID)
|
||||||
|
{
|
||||||
|
/* Disable interrupts and halt the CPU */
|
||||||
|
_disable();
|
||||||
|
__halt();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
HalInitializeProcessor(IN ULONG ProcessorNumber,
|
||||||
|
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
|
{
|
||||||
|
/* Set default stall count */
|
||||||
|
KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT;
|
||||||
|
|
||||||
|
/* Update the interrupt affinity and processor mask */
|
||||||
|
InterlockedBitTestAndSet((PLONG)&HalpActiveProcessors, ProcessorNumber);
|
||||||
|
InterlockedBitTestAndSet((PLONG)&HalpDefaultInterruptAffinity,
|
||||||
|
ProcessorNumber);
|
||||||
|
|
||||||
|
/* Register routines for KDCOM */
|
||||||
|
//HalpRegisterKdSupportFunctions();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
HalAllProcessorsStarted(VOID)
|
||||||
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
HalStartNextProcessor(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
|
IN PKPROCESSOR_STATE ProcessorState)
|
||||||
|
{
|
||||||
|
/* Ready to start */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
HalProcessorIdle(VOID)
|
||||||
|
{
|
||||||
|
/* Enable interrupts and halt the processor */
|
||||||
|
_enable();
|
||||||
|
__halt();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
HalRequestIpi(KAFFINITY TargetProcessors)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
__debugbreak();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
97
reactos/hal/halx86/amd64/stubs.c
Normal file
97
reactos/hal/halx86/amd64/stubs.c
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS HAL
|
||||||
|
* LICENSE: GPL - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: hal/halx86/amd64/stubs.c
|
||||||
|
* PURPOSE: HAL stubs
|
||||||
|
* PROGRAMMERS:
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES *******************************************************************/
|
||||||
|
|
||||||
|
#include <hal.h>
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
/* GLOBALS ********************************************************************/
|
||||||
|
|
||||||
|
LARGE_INTEGER HalpPerformanceFrequency;
|
||||||
|
|
||||||
|
|
||||||
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
HalClearSoftwareInterrupt(
|
||||||
|
IN KIRQL Irql)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
HalRequestSoftwareInterrupt(
|
||||||
|
IN KIRQL Irql)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
HalBeginSystemInterrupt(
|
||||||
|
IN KIRQL Irql,
|
||||||
|
IN UCHAR Vector,
|
||||||
|
OUT PKIRQL OldIrql)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
HalEnableSystemInterrupt(
|
||||||
|
IN UCHAR Vector,
|
||||||
|
IN KIRQL Irql,
|
||||||
|
IN KINTERRUPT_MODE InterruptMode)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
HalDisableSystemInterrupt(
|
||||||
|
IN UCHAR Vector,
|
||||||
|
IN KIRQL Irql)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
HalEndSystemInterrupt(
|
||||||
|
IN KIRQL OldIrql,
|
||||||
|
IN PKTRAP_FRAME TrapFrame)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
LARGE_INTEGER
|
||||||
|
NTAPI
|
||||||
|
KeQueryPerformanceCounter(
|
||||||
|
OUT PLARGE_INTEGER PerformanceFrequency OPTIONAL)
|
||||||
|
{
|
||||||
|
LARGE_INTEGER Result;
|
||||||
|
|
||||||
|
// ASSERT(HalpPerformanceFrequency.QuadPart != 0);
|
||||||
|
|
||||||
|
/* Does the caller want the frequency? */
|
||||||
|
if (PerformanceFrequency)
|
||||||
|
{
|
||||||
|
/* Return value */
|
||||||
|
*PerformanceFrequency = HalpPerformanceFrequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result.QuadPart = __rdtsc();
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
//#define NDEBUG
|
//#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include "x86emu.h"
|
//#include "x86emu.h"
|
||||||
|
|
||||||
/* This page serves as fallback for pages used by Mm */
|
/* This page serves as fallback for pages used by Mm */
|
||||||
#define DEFAULT_PAGE 0x21
|
#define DEFAULT_PAGE 0x21
|
||||||
|
@ -216,6 +216,7 @@ x86BiosWriteMemory(
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
x86BiosCall(
|
x86BiosCall(
|
||||||
|
@ -261,11 +262,13 @@ x86BiosCall(
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
HalpBiosDisplayReset(VOID)
|
HalpBiosDisplayReset(VOID)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
X86_BIOS_REGISTERS Registers;
|
X86_BIOS_REGISTERS Registers;
|
||||||
ULONG OldEflags;
|
ULONG OldEflags;
|
||||||
|
|
||||||
|
@ -283,7 +286,7 @@ HalpBiosDisplayReset(VOID)
|
||||||
|
|
||||||
/* Restore previous flags */
|
/* Restore previous flags */
|
||||||
__writeeflags(OldEflags);
|
__writeeflags(OldEflags);
|
||||||
|
#endif
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
0
reactos/hal/halx86/generic/amd64/.gitignore
vendored
0
reactos/hal/halx86/generic/amd64/.gitignore
vendored
|
@ -109,6 +109,7 @@ HalpInitializeClock(VOID)
|
||||||
HalpCurrentRollOver = RollOver;
|
HalpCurrentRollOver = RollOver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _M_IX86
|
||||||
#ifndef _MINIHAL_
|
#ifndef _MINIHAL_
|
||||||
VOID
|
VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
|
@ -163,6 +164,7 @@ HalpProfileInterruptHandler(IN PKTRAP_FRAME TrapFrame)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* PUBLIC FUNCTIONS ***********************************************************/
|
/* PUBLIC FUNCTIONS ***********************************************************/
|
||||||
|
|
||||||
|
|
|
@ -509,17 +509,11 @@ HalpEnableInterruptHandler(IN UCHAR Flags,
|
||||||
IN PVOID Handler,
|
IN PVOID Handler,
|
||||||
IN KINTERRUPT_MODE Mode)
|
IN KINTERRUPT_MODE Mode)
|
||||||
{
|
{
|
||||||
UCHAR Entry;
|
|
||||||
|
|
||||||
/* Convert the vector into the IDT entry */
|
|
||||||
Entry = HalVectorToIDTEntry(SystemVector);
|
|
||||||
|
|
||||||
/* Register the vector */
|
/* Register the vector */
|
||||||
HalpRegisterVector(Flags, BusVector, SystemVector, Irql);
|
HalpRegisterVector(Flags, BusVector, SystemVector, Irql);
|
||||||
|
|
||||||
/* Connect the interrupt */
|
/* Connect the interrupt */
|
||||||
((PKIPCR)KeGetPcr())->IDT[Entry].ExtendedOffset = (USHORT)(((ULONG_PTR)Handler >> 16) & 0xFFFF);
|
KeRegisterInterruptHandler(SystemVector, Handler);
|
||||||
((PKIPCR)KeGetPcr())->IDT[Entry].Offset = (USHORT)((ULONG_PTR)Handler);
|
|
||||||
|
|
||||||
/* Enable the interrupt */
|
/* Enable the interrupt */
|
||||||
HalEnableSystemInterrupt(SystemVector, Irql, Mode);
|
HalEnableSystemInterrupt(SystemVector, Irql, Mode);
|
||||||
|
|
|
@ -36,19 +36,6 @@
|
||||||
<file>trap.S</file>
|
<file>trap.S</file>
|
||||||
</directory>
|
</directory>
|
||||||
</if>
|
</if>
|
||||||
<if property="ARCH" value="amd64">
|
|
||||||
<define name="_X86BIOS_" />
|
|
||||||
<!-- include base="x86emu">.</include -->
|
|
||||||
<directory name="amd64">
|
|
||||||
<file>x86bios.c</file>
|
|
||||||
<!-- file>halinit.c</file -->
|
|
||||||
<!-- file>irq.S</file -->
|
|
||||||
<!-- file>misc.c</file -->
|
|
||||||
<!-- file>apic.c</file -->
|
|
||||||
<file>systimer.S</file>
|
|
||||||
<!-- file>usage.c</file -->
|
|
||||||
</directory>
|
|
||||||
</if>
|
|
||||||
</directory>
|
</directory>
|
||||||
<directory name="include">
|
<directory name="include">
|
||||||
<pch>hal.h</pch>
|
<pch>hal.h</pch>
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<include base="ntoskrnl">include</include>
|
<include base="ntoskrnl">include</include>
|
||||||
<!-- include base="x86emu">.</include -->
|
<!-- include base="x86emu">.</include -->
|
||||||
<define name="_DISABLE_TIDENTS" />
|
<define name="_DISABLE_TIDENTS" />
|
||||||
|
<define name="_NTHALDLL_" />
|
||||||
<define name="_NTHAL_" />
|
<define name="_NTHAL_" />
|
||||||
<define name="_X86BIOS_" />
|
<define name="_X86BIOS_" />
|
||||||
<library>hal_generic</library>
|
<library>hal_generic</library>
|
||||||
|
@ -19,18 +20,14 @@
|
||||||
<file>spinlock.c</file>
|
<file>spinlock.c</file>
|
||||||
</directory>
|
</directory>
|
||||||
|
|
||||||
<directory name="up">
|
<directory name="amd64">
|
||||||
|
<file>x86bios.c</file>
|
||||||
|
<file>halinit.c</file>
|
||||||
|
<file>stubs.c</file>
|
||||||
|
<file>systimer.S</file>
|
||||||
<file>processor.c</file>
|
<file>processor.c</file>
|
||||||
</directory>
|
</directory>
|
||||||
|
|
||||||
<!-- directory name="mp">
|
|
||||||
<file>halinit_mp.c</file>
|
|
||||||
<file>processor_mp.c</file>
|
|
||||||
<file>halmp.rc</file>
|
|
||||||
<directory name="amd64">
|
|
||||||
<file>mps.S</file>
|
|
||||||
</directory>
|
|
||||||
</directory -->
|
|
||||||
</module>
|
</module>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue