Author: sginsberg
Date: Sat Nov 7 00:55:08 2009
New Revision: 43991
URL:
http://svn.reactos.org/svn/reactos?rev=43991&view=rev
Log:
- Refactor stubbed HAL resource report slightly.
- Move the resource routines to their own file instead of sysinfo.c.
- Add missing members to PCIPBUSDATA.
- Kill old, unused generic.rbuild.
Added:
trunk/reactos/hal/halx86/generic/usage.c (with props)
Removed:
trunk/reactos/hal/halx86/generic/generic.rbuild
Modified:
trunk/reactos/hal/halx86/generic/bus/pcibus.c
trunk/reactos/hal/halx86/generic/halinit.c
trunk/reactos/hal/halx86/generic/sysinfo.c
trunk/reactos/hal/halx86/hal_generic.rbuild
trunk/reactos/hal/halx86/include/bus.h
Modified: trunk/reactos/hal/halx86/generic/bus/pcibus.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bus/pci…
==============================================================================
--- trunk/reactos/hal/halx86/generic/bus/pcibus.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/bus/pcibus.c [iso-8859-1] Sat Nov 7 00:55:08 2009
@@ -1026,10 +1026,5 @@
NTAPI
HalpInitializePciBus(VOID)
{
- /* Initialize the stubs */
- HalpInitializePciStubs();
-
/* FIXME: Initialize NMI Crash Flag */
}
-
-/* EOF */
Removed: trunk/reactos/hal/halx86/generic/generic.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/generic…
==============================================================================
--- trunk/reactos/hal/halx86/generic/generic.rbuild [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/generic.rbuild (removed)
@@ -1,40 +1,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
-<group>
- <module name="hal_generic" type="objectlibrary">
- <include base="hal_generic">../include</include>
- <include base="ntoskrnl">include</include>
- <define name="_NTHAL_" />
- <file>beep.c</file>
- <file>bios.c</file>
- <file>bus.c</file>
- <file>cmos.c</file>
- <file>dma.c</file>
- <file>drive.c</file>
- <file>display.c</file>
- <file>halinit.c</file>
- <file>misc.c</file>
- <file>portio.c</file>
- <file>profil.c</file>
- <file>reboot.c</file>
- <file>sysinfo.c</file>
- <file>timer.c</file>
- <file>systimer.S</file>
- <file>v86.s</file>
- <pch>../include/hal.h</pch>
- </module>
- <module name="hal_generic_up" type="objectlibrary">
- <include base="hal_generic_up">../include</include>
- <include base="ntoskrnl">include</include>
- <define name="_NTHAL_" />
- <file>irq.S</file>
- <file>processor.c</file>
- <file>spinlock.c</file>
- </module>
- <module name="hal_generic_pc" type="objectlibrary">
- <include base="hal_generic_pc">../include</include>
- <include base="ntoskrnl">include</include>
- <define name="_NTHAL_" />
- <file>pci.c</file>
- </module>
-</group>
Modified: trunk/reactos/hal/halx86/generic/halinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/halinit…
==============================================================================
--- trunk/reactos/hal/halx86/generic/halinit.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/halinit.c [iso-8859-1] Sat Nov 7 00:55:08 2009
@@ -168,21 +168,3 @@
/* All done, return */
return TRUE;
}
-
-/*
- * @unimplemented
- */
-VOID
-NTAPI
-HalReportResourceUsage(VOID)
-{
- /* Initialize PCI bus. */
- HalpInitializePciBus();
-
- /* FIXME: This is done in ReactOS MP HAL only*/
- //HaliReconfigurePciInterrupts();
-
- /* FIXME: Report HAL Usage to kernel */
-}
-
-/* EOF */
Modified: trunk/reactos/hal/halx86/generic/sysinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/sysinfo…
==============================================================================
--- trunk/reactos/hal/halx86/generic/sysinfo.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/sysinfo.c [iso-8859-1] Sat Nov 7 00:55:08 2009
@@ -1,42 +1,18 @@
/*
- * PROJECT: ReactOS HA:
+ * PROJECT: ReactOS HAL
* LICENSE: GPL - See COPYING in the top level directory
* FILE: hal/halx86/generic/sysinfo.c
* PURPOSE: HAL Information Routines
* PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
*/
-/* INCLUDES ******************************************************************/
+/* INCLUDES *******************************************************************/
#include <hal.h>
#define NDEBUG
#include <debug.h>
-PUCHAR KdComPortInUse;
-PADDRESS_USAGE HalpAddressUsageList;
-IDTUsageFlags HalpIDTUsageFlags[MAXIMUM_IDTVECTOR];
-IDTUsage HalpIDTUsage[MAXIMUM_IDTVECTOR];
-
-ADDRESS_USAGE HalpDefaultIoSpace =
-{
- NULL, CmResourceTypePort, IDT_INTERNAL,
- {
- {0x2000, 0xC000}, /* PIC?? */
- {0xC000, 0x1000}, /* DMA 2 */
- {0x8000, 0x1000}, /* DMA 1 */
- {0x2000, 0x200}, /* PIC 1 */
- {0xA000, 0x200}, /* PIC 2 */
- {0x4000, 0x400}, /* PIT 1 */
- {0x4800, 0x400}, /* PIT 2 */
- {0x9200, 0x100}, /* ????? */
- {0x7000, 0x200}, /* CMOS */
- {0xF000, 0x1000}, /* ????? */
- {0xCF800, 0x800}, /* PCI 0 */
- {0,0},
- }
-};
-
-/* FUNCTIONS *****************************************************************/
+/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
@@ -89,45 +65,3 @@
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
}
-
-VOID
-NTAPI
-HalpRegisterVector(IN UCHAR Flags,
- IN ULONG BusVector,
- IN ULONG SystemVector,
- IN KIRQL Irql)
-{
- /* Save the vector flags */
- HalpIDTUsageFlags[SystemVector].Flags = Flags;
-
- /* Save the vector data */
- HalpIDTUsage[SystemVector].Irql = Irql;
- HalpIDTUsage[SystemVector].BusReleativeVector = BusVector;
-}
-
-VOID
-NTAPI
-HalpEnableInterruptHandler(IN UCHAR Flags,
- IN ULONG BusVector,
- IN ULONG SystemVector,
- IN KIRQL Irql,
- IN PVOID Handler,
- IN KINTERRUPT_MODE Mode)
-{
- UCHAR Entry;
-
- /* Convert the vector into the IDT entry */
- Entry = HalVectorToIDTEntry(SystemVector);
-
- /* Register the vector */
- HalpRegisterVector(Flags, BusVector, SystemVector, Irql);
-
- /* Connect the interrupt */
- ((PKIPCR)KeGetPcr())->IDT[Entry].ExtendedOffset = (USHORT)(((ULONG_PTR)Handler
>> 16) & 0xFFFF);
- ((PKIPCR)KeGetPcr())->IDT[Entry].Offset = (USHORT)((ULONG_PTR)Handler);
-
- /* Enable the interrupt */
- HalEnableSystemInterrupt(SystemVector, Irql, Mode);
-}
-
-/* EOF */
Added: trunk/reactos/hal/halx86/generic/usage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/usage.c…
==============================================================================
--- trunk/reactos/hal/halx86/generic/usage.c (added)
+++ trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] Sat Nov 7 00:55:08 2009
@@ -1,0 +1,140 @@
+/*
+ * PROJECT: ReactOS HAL
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: hal/halx86/generic/usage.c
+ * PURPOSE: HAL Resource Report Routines
+ * PROGRAMMERS: Stefan Ginsberg (stefan.ginsberg(a)reactos.org)
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include <hal.h>
+#define NDEBUG
+#include <debug.h>
+
+/* GLOBALS ********************************************************************/
+
+PUCHAR KdComPortInUse;
+PADDRESS_USAGE HalpAddressUsageList;
+IDTUsageFlags HalpIDTUsageFlags[MAXIMUM_IDTVECTOR];
+IDTUsage HalpIDTUsage[MAXIMUM_IDTVECTOR];
+
+ADDRESS_USAGE HalpDefaultIoSpace =
+{
+ NULL, CmResourceTypePort, IDT_INTERNAL,
+ {
+ {0x2000, 0xC000}, /* PIC?? */
+ {0xC000, 0x1000}, /* DMA 2 */
+ {0x8000, 0x1000}, /* DMA 1 */
+ {0x2000, 0x200}, /* PIC 1 */
+ {0xA000, 0x200}, /* PIC 2 */
+ {0x4000, 0x400}, /* PIT 1 */
+ {0x4800, 0x400}, /* PIT 2 */
+ {0x9200, 0x100}, /* ????? */
+ {0x7000, 0x200}, /* CMOS */
+ {0xF000, 0x1000}, /* ????? */
+ {0xCF800, 0x800}, /* PCI 0 */
+ {0,0},
+ }
+};
+
+/* FUNCTIONS ******************************************************************/
+
+VOID
+NTAPI
+HalpReportResourceUsage(IN PUNICODE_STRING HalName,
+ IN INTERFACE_TYPE InterfaceType)
+{
+ DbgPrint("%wZ has been initialized\n", HalName);
+}
+
+VOID
+NTAPI
+HalpRegisterVector(IN UCHAR Flags,
+ IN ULONG BusVector,
+ IN ULONG SystemVector,
+ IN KIRQL Irql)
+{
+ /* Save the vector flags */
+ HalpIDTUsageFlags[SystemVector].Flags = Flags;
+
+ /* Save the vector data */
+ HalpIDTUsage[SystemVector].Irql = Irql;
+ HalpIDTUsage[SystemVector].BusReleativeVector = BusVector;
+}
+
+VOID
+NTAPI
+HalpEnableInterruptHandler(IN UCHAR Flags,
+ IN ULONG BusVector,
+ IN ULONG SystemVector,
+ IN KIRQL Irql,
+ IN PVOID Handler,
+ IN KINTERRUPT_MODE Mode)
+{
+ UCHAR Entry;
+
+ /* Convert the vector into the IDT entry */
+ Entry = HalVectorToIDTEntry(SystemVector);
+
+ /* Register the vector */
+ HalpRegisterVector(Flags, BusVector, SystemVector, Irql);
+
+ /* Connect the interrupt */
+ ((PKIPCR)KeGetPcr())->IDT[Entry].ExtendedOffset = (USHORT)(((ULONG_PTR)Handler
>> 16) & 0xFFFF);
+ ((PKIPCR)KeGetPcr())->IDT[Entry].Offset = (USHORT)((ULONG_PTR)Handler);
+
+ /* Enable the interrupt */
+ HalEnableSystemInterrupt(SystemVector, Irql, Mode);
+}
+
+/*
+ * @unimplemented
+ */
+VOID
+NTAPI
+HalReportResourceUsage(VOID)
+{
+ INTERFACE_TYPE InterfaceType;
+ UNICODE_STRING HalString;
+
+ /* FIXME: Initialize DMA 64-bit support */
+
+ /* FIXME: Initialize MCA bus */
+
+ /* Initialize PCI bus. */
+ HalpInitializePciBus();
+
+ /* Initialize the stubs */
+ HalpInitializePciStubs();
+
+ /* What kind of bus is this? */
+ switch (HalpBusType)
+ {
+ /* ISA Machine */
+ case MACHINE_TYPE_ISA:
+ InterfaceType = Isa;
+ break;
+
+ /* EISA Machine */
+ case MACHINE_TYPE_EISA:
+ InterfaceType = Eisa;
+ break;
+
+ /* MCA Machine */
+ case MACHINE_TYPE_MCA:
+ InterfaceType = MicroChannel;
+ break;
+
+ /* Unknown */
+ default:
+ InterfaceType = Internal;
+ break;
+ }
+
+ /* Build HAL usage */
+ RtlInitUnicodeString(&HalString, L"PC Compatible Eisa/Isa HAL");
+ HalpReportResourceUsage(&HalString, InterfaceType);
+
+ /* FIXME: Setup PCI debugging and Hibernation */
+}
Propchange: trunk/reactos/hal/halx86/generic/usage.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/hal/halx86/hal_generic.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/hal_generic.rbu…
==============================================================================
--- trunk/reactos/hal/halx86/hal_generic.rbuild [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/hal_generic.rbuild [iso-8859-1] Sat Nov 7 00:55:08 2009
@@ -24,8 +24,9 @@
<file>profil.c</file>
<file>reboot.c</file>
<file>sysinfo.c</file>
+ <file>systimer.S</file>
<file>timer.c</file>
- <file>systimer.S</file>
+ <file>usage.c</file>
<file>v86.s</file>
</directory>
<directory name="include">
Modified: trunk/reactos/hal/halx86/include/bus.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/bus.h?r…
==============================================================================
--- trunk/reactos/hal/halx86/include/bus.h [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/include/bus.h [iso-8859-1] Sat Nov 7 00:55:08 2009
@@ -80,6 +80,14 @@
WRITE_TO(y)((POINTER_TO_(y))(ULONG_PTR)PciCfg->u.AsUSHORT, \
*((POINTER_TO_(y))Buffer)); \
TYPE2_END(y)
+
+typedef NTSTATUS
+(NTAPI *PciIrqRange)(
+ IN PBUS_HANDLER BusHandler,
+ IN PBUS_HANDLER RootHandler,
+ IN PCI_SLOT_NUMBER PciSlot,
+ OUT PSUPPORTED_RANGE *Interrupt
+);
typedef struct _PCIPBUSDATA
{
@@ -99,6 +107,14 @@
} Type2;
} Config;
ULONG MaxDevice;
+ PciIrqRange GetIrqRange;
+ BOOLEAN BridgeConfigRead;
+ UCHAR ParentBus;
+ UCHAR Subtractive;
+ UCHAR reserved[1];
+ UCHAR SwizzleIn[4];
+ RTL_BITMAP DeviceConfigured;
+ ULONG ConfiguredBits[PCI_MAX_DEVICES * PCI_MAX_FUNCTION / 32];
} PCIPBUSDATA, *PPCIPBUSDATA;
typedef ULONG
@@ -284,6 +300,12 @@
VOID
);
+VOID
+NTAPI
+HalpInitializePciStubs(
+ VOID
+);
+
extern ULONG HalpBusType;
extern BOOLEAN HalpPCIConfigInitialized;
extern BUS_HANDLER HalpFakePciBusHandler;