2013-03-14 21:04:13 +00:00
|
|
|
/*
|
2020-07-25 13:31:02 +00:00
|
|
|
* PROJECT: Xbox HAL
|
|
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
|
|
|
* PURPOSE: Initialize the x86 HAL
|
|
|
|
* COPYRIGHT: Copyright 1998 David Welch (welch@cwcom.net)
|
2004-12-04 21:43:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *****************************************************************/
|
|
|
|
|
2007-12-14 08:53:56 +00:00
|
|
|
#include "halxbox.h"
|
2004-12-04 21:43:37 +00:00
|
|
|
|
2006-01-08 06:38:39 +00:00
|
|
|
#define NDEBUG
|
2005-06-19 22:53:49 +00:00
|
|
|
#include <debug.h>
|
2004-12-04 21:43:37 +00:00
|
|
|
|
2019-08-12 09:23:25 +00:00
|
|
|
/* FUNCTIONS ****************************************************************/
|
2004-12-04 21:43:37 +00:00
|
|
|
|
2011-09-07 18:39:20 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalpInitProcessor(
|
|
|
|
IN ULONG ProcessorNumber,
|
|
|
|
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|
|
|
{
|
|
|
|
/* Set default IDR */
|
2020-07-25 13:31:02 +00:00
|
|
|
KeGetPcr()->IDR = 0xFFFFFFFF & ~(1 << PIC_CASCADE_IRQ);
|
2011-09-07 18:39:20 +00:00
|
|
|
}
|
|
|
|
|
2004-12-04 21:43:37 +00:00
|
|
|
VOID
|
2019-08-12 09:23:25 +00:00
|
|
|
HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
2004-12-04 21:43:37 +00:00
|
|
|
{
|
2019-08-12 09:23:25 +00:00
|
|
|
/* Initialize Xbox-specific disk hacks */
|
2007-12-13 15:34:02 +00:00
|
|
|
HalpXboxInitPartIo();
|
2004-12-04 21:43:37 +00:00
|
|
|
}
|
|
|
|
|
2006-08-25 00:46:41 +00:00
|
|
|
VOID
|
|
|
|
HalpInitPhase1(VOID)
|
|
|
|
{
|
2020-07-25 13:31:02 +00:00
|
|
|
/* Enable timer interrupt handler */
|
2019-08-12 09:23:25 +00:00
|
|
|
HalpEnableInterruptHandler(IDT_DEVICE,
|
|
|
|
0,
|
2020-07-25 13:31:02 +00:00
|
|
|
PRIMARY_VECTOR_BASE + PIC_TIMER_IRQ,
|
2019-08-12 09:23:25 +00:00
|
|
|
CLOCK2_LEVEL,
|
|
|
|
HalpClockInterrupt,
|
|
|
|
Latched);
|
|
|
|
|
2020-07-25 13:31:02 +00:00
|
|
|
/* Enable RTC interrupt handler */
|
2019-08-12 09:23:25 +00:00
|
|
|
HalpEnableInterruptHandler(IDT_DEVICE,
|
|
|
|
0,
|
2020-07-25 13:31:02 +00:00
|
|
|
PRIMARY_VECTOR_BASE + PIC_RTC_IRQ,
|
2019-08-12 09:23:25 +00:00
|
|
|
PROFILE_LEVEL,
|
|
|
|
HalpProfileInterrupt,
|
|
|
|
Latched);
|
|
|
|
|
|
|
|
/* Initialize DMA. NT does this in Phase 0 */
|
|
|
|
HalpInitDma();
|
2006-08-25 00:46:41 +00:00
|
|
|
}
|
|
|
|
|
2004-12-04 21:43:37 +00:00
|
|
|
/* EOF */
|