mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[HAL] Add Xbox Hardware Abstraction Layer
- Create xbox.cmake based on legacy.cmake and pic.cmake - Revive Xbox HAL files and add them to the build - Fix boot with Xbox HAL, add missing parts from halinit_up.c - Code style and debug logging improvements in pcibus.c - Allow to choose Xbox HAL in usetup CORE-16216
This commit is contained in:
parent
83dcae1e0f
commit
5d57e39655
5 changed files with 74 additions and 11 deletions
|
@ -224,6 +224,7 @@ pci_up = "Standard PC Uniprocessor"
|
||||||
;pci_mp = "Standard PC Multiprocessor"
|
;pci_mp = "Standard PC Multiprocessor"
|
||||||
acpi_up = "ACPI PC Uniprocessor"
|
acpi_up = "ACPI PC Uniprocessor"
|
||||||
;acpi_mp = "ACPI PC Multiprocessor"
|
;acpi_mp = "ACPI PC Multiprocessor"
|
||||||
|
xbox = "Original Xbox"
|
||||||
|
|
||||||
[Map.Computer]
|
[Map.Computer]
|
||||||
;<id> = <pnp id string>
|
;<id> = <pnp id string>
|
||||||
|
@ -231,6 +232,7 @@ pci_up = "PC UP"
|
||||||
;pci_mp = "PC MP"
|
;pci_mp = "PC MP"
|
||||||
acpi_up = "ACPI UP"
|
acpi_up = "ACPI UP"
|
||||||
;acpi_mp = "ACPI MP"
|
;acpi_mp = "ACPI MP"
|
||||||
|
xbox = "Xbox"
|
||||||
|
|
||||||
[Files.pci_up]
|
[Files.pci_up]
|
||||||
ntoskrnl.exe = 1,,,,,,,2,,,,1,2
|
ntoskrnl.exe = 1,,,,,,,2,,,,1,2
|
||||||
|
@ -248,6 +250,10 @@ halacpi.dll = 1,,,,,,,2,,,hal.dll,1,2
|
||||||
;ntkrnlmp.exe = 1,,,,,,,2,,,ntoskrnl.exe,1,2
|
;ntkrnlmp.exe = 1,,,,,,,2,,,ntoskrnl.exe,1,2
|
||||||
;halacpi.dll = 1,,,,,,,2,,,hal.dll,1,2
|
;halacpi.dll = 1,,,,,,,2,,,hal.dll,1,2
|
||||||
|
|
||||||
|
[Files.xbox]
|
||||||
|
ntoskrnl.exe = 1,,,,,,,2,,,,1,2
|
||||||
|
halxbox.dll = 1,,,,,,,2,,,hal.dll,1,2
|
||||||
|
|
||||||
[Display]
|
[Display]
|
||||||
;<id> = <user friendly name>,<spare>,<service key name>,<height>,<width>,<bpp>
|
;<id> = <user friendly name>,<spare>,<service key name>,<height>,<width>,<bpp>
|
||||||
vga = "VGA Display (640x480x4)",,Vga,640,480,4
|
vga = "VGA Display (640x480x4)",,Vga,640,480,4
|
||||||
|
|
|
@ -55,6 +55,7 @@ if(ARCH STREQUAL "i386")
|
||||||
include(legacy.cmake)
|
include(legacy.cmake)
|
||||||
include(up.cmake)
|
include(up.cmake)
|
||||||
include(pic.cmake)
|
include(pic.cmake)
|
||||||
|
include(xbox.cmake)
|
||||||
add_subdirectory(minihal)
|
add_subdirectory(minihal)
|
||||||
|
|
||||||
# hal
|
# hal
|
||||||
|
@ -62,6 +63,7 @@ if(ARCH STREQUAL "i386")
|
||||||
add_hal(halacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi up pic)
|
add_hal(halacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi up pic)
|
||||||
add_hal(halapic SOURCES acpi/halacpi.rc COMPONENTS generic legacy up apic)
|
add_hal(halapic SOURCES acpi/halacpi.rc COMPONENTS generic legacy up apic)
|
||||||
add_hal(halaacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi up apic)
|
add_hal(halaacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi up apic)
|
||||||
|
add_hal(halxbox SOURCES xbox/halxbox.rc COMPONENTS generic up xbox)
|
||||||
|
|
||||||
#add_hal(halmps SOURCES up/halup.rc COMPONENTS generic legacy smp pic)
|
#add_hal(halmps SOURCES up/halup.rc COMPONENTS generic legacy smp pic)
|
||||||
#add_hal(halmacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi smp pic)
|
#add_hal(halmacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi smp pic)
|
||||||
|
|
|
@ -368,12 +368,12 @@ HalpGetPCIData(IN PBUS_HANDLER BusHandler,
|
||||||
* video card, so it appears to be present on 1:0:0 - 1:31:0.
|
* video card, so it appears to be present on 1:0:0 - 1:31:0.
|
||||||
* We hack around these problems by indicating "device not present" for devices
|
* We hack around these problems by indicating "device not present" for devices
|
||||||
* 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
|
* 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
|
||||||
if ((0 == BusHandler->BusNumber && 0 == Slot.u.bits.DeviceNumber &&
|
if ((BusHandler->BusNumber == 0 && Slot.u.bits.DeviceNumber == 0 &&
|
||||||
(1 == Slot.u.bits.FunctionNumber || 2 == Slot.u.bits.FunctionNumber)) ||
|
(Slot.u.bits.FunctionNumber == 1 || Slot.u.bits.FunctionNumber == 2)) ||
|
||||||
(1 == BusHandler->BusNumber && 0 != Slot.u.bits.DeviceNumber))
|
(BusHandler->BusNumber == 1 && Slot.u.bits.DeviceNumber != 0))
|
||||||
{
|
{
|
||||||
DPRINT("Blacklisted PCI slot\n");
|
DPRINT("Blacklisted PCI slot (%d:%d:%d)\n", BusHandler->BusNumber, Slot.u.bits.DeviceNumber, Slot.u.bits.FunctionNumber);
|
||||||
if (0 == Offset && sizeof(USHORT) <= Length)
|
if (Offset == 0 && Length >= sizeof(USHORT))
|
||||||
{
|
{
|
||||||
*(PUSHORT)Buffer = PCI_INVALID_VENDORID;
|
*(PUSHORT)Buffer = PCI_INVALID_VENDORID;
|
||||||
return sizeof(USHORT);
|
return sizeof(USHORT);
|
||||||
|
@ -460,11 +460,11 @@ HalpSetPCIData(IN PBUS_HANDLER BusHandler,
|
||||||
* video card, so it appears to be present on 1:0:0 - 1:31:0.
|
* video card, so it appears to be present on 1:0:0 - 1:31:0.
|
||||||
* We hack around these problems by indicating "device not present" for devices
|
* We hack around these problems by indicating "device not present" for devices
|
||||||
* 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
|
* 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
|
||||||
if ((0 == BusHandler->BusNumber && 0 == Slot.u.bits.DeviceNumber &&
|
if ((BusHandler->BusNumber == 0 && Slot.u.bits.DeviceNumber == 0 &&
|
||||||
(1 == Slot.u.bits.FunctionNumber || 2 == Slot.u.bits.FunctionNumber)) ||
|
(Slot.u.bits.FunctionNumber == 1 || Slot.u.bits.FunctionNumber == 2)) ||
|
||||||
(1 == BusHandler->BusNumber && 0 != Slot.u.bits.DeviceNumber))
|
(BusHandler->BusNumber == 1 && Slot.u.bits.DeviceNumber != 0))
|
||||||
{
|
{
|
||||||
DPRINT1("Trying to set data on blacklisted PCI slot\n");
|
DPRINT1("Trying to set data on blacklisted PCI slot (%d:%d:%d)\n", BusHandler->BusNumber, Slot.u.bits.DeviceNumber, Slot.u.bits.FunctionNumber);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
34
hal/halx86/xbox.cmake
Normal file
34
hal/halx86/xbox.cmake
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
|
||||||
|
list(APPEND HAL_XBOX_ASM_SOURCE
|
||||||
|
generic/systimer.S
|
||||||
|
generic/trap.S
|
||||||
|
up/pic.S)
|
||||||
|
|
||||||
|
list(APPEND HAL_XBOX_SOURCE
|
||||||
|
legacy/bus/bushndlr.c
|
||||||
|
legacy/bus/cmosbus.c
|
||||||
|
legacy/bus/isabus.c
|
||||||
|
legacy/bus/pcibus.c
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/pci_classes.c
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/pci_vendors.c
|
||||||
|
legacy/bus/sysbus.c
|
||||||
|
legacy/bussupp.c
|
||||||
|
legacy/halpnpdd.c
|
||||||
|
legacy/halpcat.c
|
||||||
|
generic/profil.c
|
||||||
|
generic/timer.c
|
||||||
|
xbox/part_xbox.c
|
||||||
|
xbox/halinit_xbox.c
|
||||||
|
up/pic.c)
|
||||||
|
|
||||||
|
add_asm_files(lib_hal_xbox_asm ${HAL_XBOX_ASM_SOURCE})
|
||||||
|
add_object_library(lib_hal_xbox ${HAL_XBOX_SOURCE} ${lib_hal_xbox_asm})
|
||||||
|
if(NOT SARCH STREQUAL "xbox")
|
||||||
|
add_target_compile_definitions(lib_hal_xbox SARCH_XBOX)
|
||||||
|
endif()
|
||||||
|
add_dependencies(lib_hal_xbox bugcodes xdk asm)
|
||||||
|
#add_pch(lib_hal_xbox xbox/halxbox.h)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
target_link_libraries(lib_hal_xbox lib_hal_generic)
|
||||||
|
endif()
|
|
@ -15,9 +15,11 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
/* GLOBALS ******************************************************************/
|
||||||
|
|
||||||
const USHORT HalpBuildType = HAL_BUILD_TYPE;
|
const USHORT HalpBuildType = HAL_BUILD_TYPE;
|
||||||
|
|
||||||
/* FUNCTIONS ***************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -30,14 +32,33 @@ HalpInitProcessor(
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
HalpInitPhase0(PLOADER_PARAMETER_BLOCK LoaderBlock)
|
HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
{
|
{
|
||||||
|
/* Initialize Xbox-specific disk hacks */
|
||||||
HalpXboxInitPartIo();
|
HalpXboxInitPartIo();
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
HalpInitPhase1(VOID)
|
HalpInitPhase1(VOID)
|
||||||
{
|
{
|
||||||
|
/* Enable IRQ 0 */
|
||||||
|
HalpEnableInterruptHandler(IDT_DEVICE,
|
||||||
|
0,
|
||||||
|
PRIMARY_VECTOR_BASE,
|
||||||
|
CLOCK2_LEVEL,
|
||||||
|
HalpClockInterrupt,
|
||||||
|
Latched);
|
||||||
|
|
||||||
|
/* Enable IRQ 8 */
|
||||||
|
HalpEnableInterruptHandler(IDT_DEVICE,
|
||||||
|
0,
|
||||||
|
PRIMARY_VECTOR_BASE + 8,
|
||||||
|
PROFILE_LEVEL,
|
||||||
|
HalpProfileInterrupt,
|
||||||
|
Latched);
|
||||||
|
|
||||||
|
/* Initialize DMA. NT does this in Phase 0 */
|
||||||
|
HalpInitDma();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue