1 added + 6 modified, total 7 files
reactos/hal/halx86/generic
diff -u -r1.2 -r1.3
--- halinit.c 4 Dec 2004 21:40:55 -0000 1.2
+++ halinit.c 4 Dec 2004 22:52:59 -0000 1.3
@@ -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 @@
{
if (BootPhase == 0)
{
+ RtlZeroMemory(&HalpHooks, sizeof(HALP_HOOKS));
HalpInitPhase0();
}
else if (BootPhase == 1)
reactos/hal/halx86/generic
diff -u -r1.1 -r1.2
--- pci.c 3 Dec 2004 20:10:43 -0000 1.1
+++ pci.c 4 Dec 2004 22:52:59 -0000 1.2
@@ -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 @@
// (pGetSetBusData)HalpAdjustPciResourceList;
BusHandler->AssignSlotResources =
(pAssignSlotResources)HalpAssignPciSlotResources;
+ if (NULL != HalpHooks.InitPciBus)
+ {
+ HalpHooks.InitPciBus(0, BusHandler);
+ }
/* agp bus (bus 1) handler */
@@ -780,6 +785,10 @@
// (pGetSetBusData)HalpAdjustPciResourceList;
BusHandler->AssignSlotResources =
(pAssignSlotResources)HalpAssignPciSlotResources;
+ if (NULL != HalpHooks.InitPciBus)
+ {
+ HalpHooks.InitPciBus(1, BusHandler);
+ }
/* PCI bus (bus 2) handler */
@@ -796,6 +805,10 @@
// (pGetSetBusData)HalpAdjustPciResourceList;
BusHandler->AssignSlotResources =
(pAssignSlotResources)HalpAssignPciSlotResources;
+ if (NULL != HalpHooks.InitPciBus)
+ {
+ HalpHooks.InitPciBus(2, BusHandler);
+ }
DPRINT("HalpInitPciBus() finished.\n");
}
reactos/hal/halx86/include
diff -u -r1.17 -r1.18
--- hal.h 4 Dec 2004 17:22:46 -0000 1.17
+++ hal.h 4 Dec 2004 22:52:59 -0000 1.18
@@ -433,8 +433,11 @@
#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 */
reactos/hal/halx86/xbox
diff -N pci_xbox.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pci_xbox.c 4 Dec 2004 22:52:59 -0000 1.1
@@ -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 */
reactos/hal/halx86/xbox
diff -u -r1.1 -r1.2
--- Makefile 4 Dec 2004 21:43:37 -0000 1.1
+++ Makefile 4 Dec 2004 22:52:59 -0000 1.2
@@ -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 @@
flashleds.o \
display_xbox.o \
font.o \
- halinit_xbox.o
+ halinit_xbox.o \
+ pci_xbox.o
HAL_OBJECTS = $(GENERIC_OBJECTS) $(XBOX_OBJECTS)
reactos/hal/halx86/xbox
diff -u -r1.1 -r1.2
--- halinit_xbox.c 4 Dec 2004 21:43:37 -0000 1.1
+++ halinit_xbox.c 4 Dec 2004 22:52:59 -0000 1.2
@@ -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 */
reactos/hal/halx86/xbox
diff -u -r1.1 -r1.2
--- halxbox.h 4 Dec 2004 21:43:37 -0000 1.1
+++ halxbox.h 4 Dec 2004 22:52:59 -0000 1.2
@@ -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 */
CVSspam 0.2.8