Probing functions 1 and 2 of device 0 on bus 0 completely freezes the Xbox,

blacklist those functions

svn path=/trunk/; revision=11932
This commit is contained in:
Gé van Geldorp 2004-12-04 22:52:59 +00:00
parent b5cbaeae0c
commit b0145a85fe
7 changed files with 103 additions and 8 deletions

View file

@ -1,4 +1,4 @@
/* $Id: halinit.c,v 1.2 2004/12/04 21:40:55 gvg Exp $
/* $Id: halinit.c,v 1.3 2004/12/04 22:52:59 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -20,6 +20,7 @@
/* GLOBALS *****************************************************************/
PVOID HalpZeroPageMapping = NULL;
HALP_HOOKS HalpHooks;
/* FUNCTIONS ***************************************************************/
@ -38,6 +39,7 @@ HalInitSystem (ULONG BootPhase,
{
if (BootPhase == 0)
{
RtlZeroMemory(&HalpHooks, sizeof(HALP_HOOKS));
HalpInitPhase0();
}
else if (BootPhase == 1)

View file

@ -1,4 +1,4 @@
/* $Id: pci.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
/* $Id: pci.c,v 1.2 2004/12/04 22:52:59 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -21,6 +21,7 @@
#include <ddk/ntddk.h>
#include <bus.h>
#include <halirq.h>
#include <hal.h>
#define NDEBUG
#include <internal/debug.h>
@ -764,6 +765,10 @@ HalpInitPciBus(VOID)
// (pGetSetBusData)HalpAdjustPciResourceList;
BusHandler->AssignSlotResources =
(pAssignSlotResources)HalpAssignPciSlotResources;
if (NULL != HalpHooks.InitPciBus)
{
HalpHooks.InitPciBus(0, BusHandler);
}
/* agp bus (bus 1) handler */
@ -780,6 +785,10 @@ HalpInitPciBus(VOID)
// (pGetSetBusData)HalpAdjustPciResourceList;
BusHandler->AssignSlotResources =
(pAssignSlotResources)HalpAssignPciSlotResources;
if (NULL != HalpHooks.InitPciBus)
{
HalpHooks.InitPciBus(1, BusHandler);
}
/* PCI bus (bus 2) handler */
@ -796,6 +805,10 @@ HalpInitPciBus(VOID)
// (pGetSetBusData)HalpAdjustPciResourceList;
BusHandler->AssignSlotResources =
(pAssignSlotResources)HalpAssignPciSlotResources;
if (NULL != HalpHooks.InitPciBus)
{
HalpHooks.InitPciBus(2, BusHandler);
}
DPRINT("HalpInitPciBus() finished.\n");
}

View file

@ -433,8 +433,11 @@ static inline VOID Ki386WriteFsByte(ULONG offset, BYTE value)
#error Unknown compiler for inline assembler
#endif
typedef struct tagHALP_HOOKS
{
void (*InitPciBus)(ULONG BusNumber, PBUS_HANDLER BusHandler);
} HALP_HOOKS, *PHALP_HOOKS;
extern HALP_HOOKS HalpHooks;
#endif /* __INTERNAL_HAL_HAL_H */

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.1 2004/12/04 21:43:37 gvg Exp $
# $Id: Makefile,v 1.2 2004/12/04 22:52:59 gvg Exp $
PATH_TO_TOP = ../../..
@ -64,7 +64,8 @@ XBOX_OBJECTS = \
flashleds.o \
display_xbox.o \
font.o \
halinit_xbox.o
halinit_xbox.o \
pci_xbox.o
HAL_OBJECTS = $(GENERIC_OBJECTS) $(XBOX_OBJECTS)

View file

@ -1,4 +1,4 @@
/* $Id: halinit_xbox.c,v 1.1 2004/12/04 21:43:37 gvg Exp $
/* $Id: halinit_xbox.c,v 1.2 2004/12/04 22:52:59 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -13,6 +13,7 @@
#include <ddk/ntddk.h>
#include <hal.h>
#include "halxbox.h"
#define NDEBUG
#include <internal/debug.h>
@ -22,6 +23,8 @@
VOID
HalpInitPhase0(VOID)
{
HalpHooks.InitPciBus = HalpXboxInitPciBus;
HalpInitPICs();
/* Setup busy waiting */

View file

@ -1,4 +1,4 @@
/* $Id: halxbox.h,v 1.1 2004/12/04 21:43:37 gvg Exp $
/* $Id: halxbox.h,v 1.2 2004/12/04 22:52:59 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: Xbox HAL
@ -14,6 +14,8 @@
extern BYTE XboxFont8x16[256 * 16];
void HalpXboxInitPciBus(ULONG BusNumber, PBUS_HANDLER BusHandler);
#endif /* HALXBOX_H_INCLUDED */
/* EOF */

View file

@ -0,0 +1,71 @@
/* $Id: pci_xbox.c,v 1.1 2004/12/04 22:52:59 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: hal/halx86/xbox/pci_xbox.c
* PURPOSE: Xbox specific handling of PCI cards
* PROGRAMMER: Ge van Geldorp (gvg@reactos.com)
* UPDATE HISTORY:
* 2004/12/04: Created
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <hal.h>
#include <bus.h>
#include "halxbox.h"
#define NDEBUG
#include <internal/debug.h>
/* VARIABLES ***************************************************************/
static ULONG (* STDCALL GenericGetPciData)(PBUS_HANDLER BusHandler,
ULONG BusNumber,
ULONG SlotNumber,
PVOID Buffer,
ULONG Offset,
ULONG Length);
/* FUNCTIONS ***************************************************************/
static ULONG STDCALL
HalpXboxGetPciData(PBUS_HANDLER BusHandler,
ULONG BusNumber,
ULONG SlotNumber,
PVOID Buffer,
ULONG Offset,
ULONG Length)
{
DPRINT("HalpXboxGetPciData() called.\n");
DPRINT(" BusNumber %lu\n", BusNumber);
DPRINT(" SlotNumber %lu\n", SlotNumber);
DPRINT(" Offset 0x%lx\n", Offset);
DPRINT(" Length 0x%lx\n", Length);
if (0 == BusNumber && (1 == ((SlotNumber >> 5) & 0x07) || 2 == ((SlotNumber >> 5) & 0x07)))
{
DPRINT("Blacklisted PCI slot\n");
if (0 == Offset && 2 <= Length)
{
*(PUSHORT)Buffer = PCI_INVALID_VENDORID;
return 2;
}
return 0;
}
return GenericGetPciData(BusHandler, BusNumber, SlotNumber, Buffer, Offset, Length);
}
void
HalpXboxInitPciBus(ULONG BusNumber, PBUS_HANDLER BusHandler)
{
if (0 == BusNumber)
{
GenericGetPciData = BusHandler->GetBusData;
BusHandler->GetBusData = HalpXboxGetPciData;
}
}
/* EOF */