ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
June 2010
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
24 participants
407 discussions
Start a n
N
ew thread
[evb] 47898: Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support. PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Di
by evb@svn.reactos.org
Author: evb Date: Mon Jun 28 17:30:35 2010 New Revision: 47898 URL:
http://svn.reactos.org/svn/reactos?rev=47898&view=rev
Log: Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support. PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support This 1000 more codes done now~ Modified: trunk/reactos/drivers/bus/pcix/arb/arb_comn.c trunk/reactos/drivers/bus/pcix/dispatch.c trunk/reactos/drivers/bus/pcix/fdo.c trunk/reactos/drivers/bus/pcix/intrface/intrface.c trunk/reactos/drivers/bus/pcix/pci.h trunk/reactos/drivers/bus/pcix/pci/config.c trunk/reactos/drivers/bus/pcix/pci/state.c trunk/reactos/drivers/bus/pcix/utils.c Modified: trunk/reactos/drivers/bus/pcix/arb/arb_comn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/arb/arb_c…
============================================================================== --- trunk/reactos/drivers/bus/pcix/arb/arb_comn.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/arb/arb_comn.c [iso-8859-1] Mon Jun 28 17:30:35 2010 @@ -14,6 +14,111 @@ /* GLOBALS ********************************************************************/ +PCHAR PciArbiterNames[] = +{ + "I/O Port", + "Memory", + "Interrupt", + "Bus Number" +}; + /* FUNCTIONS ******************************************************************/ +VOID +NTAPI +PciArbiterDestructor(IN PPCI_ARBITER_INSTANCE Arbiter) +{ + /* This function is not yet implemented */ + UNIMPLEMENTED; + while (TRUE); +} + +NTSTATUS +NTAPI +PciInitializeArbiters(IN PPCI_FDO_EXTENSION FdoExtension) +{ + PPCI_INTERFACE CurrentInterface, *Interfaces; + PPCI_ARBITER_INSTANCE ArbiterInterface; + NTSTATUS Status; + PCI_SIGNATURE ArbiterType; + ASSERT_FDO(FdoExtension); + + /* Loop all the arbiters */ + for (ArbiterType = PciArb_Io; ArbiterType <= PciArb_Memory; ArbiterType++) + { + /* Check if this is the extension for the Root PCI Bus */ + if (!PCI_IS_ROOT_FDO(FdoExtension)) + { +#if 0 // at next sync when PDO add + /* Get the PDO extension */ + PdoExtension = FdoExtension->PhysicalDeviceObject->DeviceExtension; + ASSERT_PDO(PdoExtension); + + /* Skip this bus if it does subtractive decode */ + if (PdoExtension->Substractive) + { + DPRINT1("PCI Not creating arbiters for subtractive bus %d\n", + PdoExtension->Substractive); + continue; + } +#endif + } + + /* Query all the registered arbiter interfaces */ + Interfaces = PciInterfaces; + while (*Interfaces) + { + /* Find the one that matches the arbiter currently being setup */ + CurrentInterface = *Interfaces; + if (CurrentInterface->Signature == ArbiterType) break; + Interfaces++; + } + + /* Check if the required arbiter was not found in the list */ + if (!*Interfaces) + { + /* Skip this arbiter and try the next one */ + DPRINT1("PCI - FDO ext 0x%08x no %s arbiter.\n", + FdoExtension, + PciArbiterNames[ArbiterType - PciArb_Io]); + continue; + } + + /* An arbiter was found, allocate an instance for it */ + Status = STATUS_INSUFFICIENT_RESOURCES; + ArbiterInterface = ExAllocatePoolWithTag(PagedPool, + sizeof(PCI_ARBITER_INSTANCE), + PCI_POOL_TAG); + if (!ArbiterInterface) break; + + /* Setup the instance */ + ArbiterInterface->BusFdoExtension = FdoExtension; + ArbiterInterface->Interface = CurrentInterface; + swprintf(ArbiterInterface->InstanceName, + L"PCI %S (b=%02x)", + PciArbiterNames[ArbiterType - PciArb_Io], + FdoExtension->BaseBus); + + /* Call the interface initializer for it */ + Status = CurrentInterface->Initializer(ArbiterInterface); + if (!NT_SUCCESS(Status)) break; + + /* Link it with this FDO */ + PcipLinkSecondaryExtension(&FdoExtension->SecondaryExtension, + &FdoExtension->SecondaryExtLock, + &ArbiterInterface->Header, + ArbiterType, + PciArbiterDestructor); + + /* This arbiter is now initialized, move to the next one */ + DPRINT1("PCI - FDO ext 0x%08x %S arbiter initialized (context 0x%08x).\n", + FdoExtension, + "ARBITER HEADER MISSING", //ArbiterInterface->CommonInstance.Name, + ArbiterInterface); + Status = STATUS_SUCCESS; + } + + /* Return to caller */ + return Status; +} /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/dispatch.…
============================================================================== --- trunk/reactos/drivers/bus/pcix/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/dispatch.c [iso-8859-1] Mon Jun 28 17:30:35 2010 @@ -27,4 +27,16 @@ return STATUS_SUCCESS; } +NTSTATUS +NTAPI +PciIrpNotSupported(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + /* Not supported */ + DPRINT1("WARNING: PCI received unsupported IRP!\n"); + DbgBreakPoint(); + return STATUS_NOT_SUPPORTED; +} + /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/fdo.c?rev…
============================================================================== --- trunk/reactos/drivers/bus/pcix/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/fdo.c [iso-8859-1] Mon Jun 28 17:30:35 2010 @@ -14,17 +14,306 @@ /* GLOBALS ********************************************************************/ +SINGLE_LIST_ENTRY PciFdoExtensionListHead; +BOOLEAN PciBreakOnDefault; + +PCI_MN_DISPATCH_TABLE PciFdoDispatchPowerTable[] = +{ + {IRP_DISPATCH, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported} +}; + +PCI_MN_DISPATCH_TABLE PciFdoDispatchPnpTable[] = +{ + {IRP_UPWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DISPATCH, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DISPATCH, PciIrpNotSupported}, + {IRP_UPWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_UPWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciIrpNotSupported} +}; + +PCI_MJ_DISPATCH_TABLE PciFdoDispatchTable = +{ + IRP_MN_QUERY_LEGACY_BUS_INFORMATION, + PciFdoDispatchPnpTable, + IRP_MN_QUERY_POWER, + PciFdoDispatchPowerTable, + IRP_DOWNWARD, + PciIrpNotSupported, + IRP_DOWNWARD, + PciIrpNotSupported +}; + /* FUNCTIONS ******************************************************************/ + +VOID +NTAPI +PciGetHotPlugParameters(IN PPCI_FDO_EXTENSION FdoExtension) +{ + ACPI_EVAL_INPUT_BUFFER InputBuffer; + PACPI_EVAL_OUTPUT_BUFFER OutputBuffer; + ULONG Length; + NTSTATUS Status; + PAGED_CODE(); + + /* We should receive 4 parameters, per the HPP specification */ + Length = sizeof(ACPI_EVAL_OUTPUT_BUFFER) + 4 * sizeof(ACPI_METHOD_ARGUMENT); + + /* Allocate the buffer to hold the parameters */ + OutputBuffer = ExAllocatePoolWithTag(PagedPool, Length, PCI_POOL_TAG); + if (!OutputBuffer) return; + + /* Initialize the output and input buffers. The method is _HPP */ + RtlZeroMemory(OutputBuffer, Length); + *(PULONG)InputBuffer.MethodName = 'PPH_'; + InputBuffer.Signature = ACPI_EVAL_INPUT_BUFFER_SIGNATURE; + do + { + /* Send the IOCTL to the ACPI driver */ + Status = PciSendIoctl(FdoExtension->PhysicalDeviceObject, + IOCTL_ACPI_EVAL_METHOD, + &InputBuffer, + sizeof(InputBuffer), + OutputBuffer, + Length); + if (!NT_SUCCESS(Status)) + { + /* The method failed, check if we can salvage data from parent */ + if (!PCI_IS_ROOT_FDO(FdoExtension)) + { + /* Copy the root bus' hot plug parameters */ + FdoExtension->HotPlugParameters = FdoExtension->ParentFdoExtension->HotPlugParameters; + } + + /* Nothing more to do on this path */ + break; + } + + /* ACPI sent back some data. 4 parameters are expected in the output */ + if (OutputBuffer->Count != 4) break; + + /* HotPlug PCI Support not yet implemented */ + UNIMPLEMENTED; + while (TRUE); + } while (FALSE); + + /* Free the buffer and return */ + ExFreePoolWithTag(OutputBuffer, 0); +} + +VOID +NTAPI +PciInitializeFdoExtensionCommonFields(PPCI_FDO_EXTENSION FdoExtension, + IN PDEVICE_OBJECT DeviceObject, + IN PDEVICE_OBJECT PhysicalDeviceObject) +{ + /* Initialize the extension */ + RtlZeroMemory(FdoExtension, sizeof(PCI_FDO_EXTENSION)); + + /* Setup the common fields */ + FdoExtension->PhysicalDeviceObject = PhysicalDeviceObject; + FdoExtension->FunctionalDeviceObject = DeviceObject; + FdoExtension->ExtensionType = PciFdoExtensionType; + FdoExtension->PowerState.CurrentSystemState = PowerSystemWorking; + FdoExtension->PowerState.CurrentDeviceState = PowerDeviceD0; + FdoExtension->IrpDispatchTable = &PciFdoDispatchTable; + + /* Initialize the extension locks */ + KeInitializeEvent(&FdoExtension->SecondaryExtLock, SynchronizationEvent, TRUE); + KeInitializeEvent(&FdoExtension->ChildListLock, SynchronizationEvent, TRUE); + + /* Initialize the default state */ + PciInitializeState(FdoExtension); +} NTSTATUS NTAPI PciAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject) { - /* This function is not yet implemented */ - UNIMPLEMENTED; - while (TRUE); - return STATUS_SUCCESS; + PCM_RESOURCE_LIST Descriptor; + PDEVICE_OBJECT AttachedTo; + PPCI_FDO_EXTENSION FdoExtension; + PPCI_FDO_EXTENSION ParentExtension; + PDEVICE_OBJECT DeviceObject; + UCHAR Buffer[sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG)]; + PKEY_VALUE_PARTIAL_INFORMATION ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)Buffer; + NTSTATUS Status; + HANDLE KeyHandle; + UNICODE_STRING ValueName; + ULONG ResultLength; + PAGED_CODE(); + DPRINT1("PCI - AddDevice (a new bus). PDO: %p (Driver: %wZ)\n", + PhysicalDeviceObject, &PhysicalDeviceObject->DriverObject->DriverName); + + /* Zero out variables so failure path knows what to do */ + AttachedTo = NULL; + do + { + /* Check if there's already a device extension for this bus */ + ParentExtension = PciFindParentPciFdoExtension(PhysicalDeviceObject, + &PciGlobalLock); + if (ParentExtension) + { + /* More than one PCI bus, this is not expected yet */ + UNIMPLEMENTED; + while (TRUE); + } + + /* Create the FDO for the bus */ + Status = IoCreateDevice(DriverObject, + sizeof(PCI_FDO_EXTENSION), + NULL, + FILE_DEVICE_BUS_EXTENDER, + 0, + 0, + &DeviceObject); + if (!NT_SUCCESS(Status)) break; + + /* Initialize the extension for the FDO */ + FdoExtension = DeviceObject->DeviceExtension; + PciInitializeFdoExtensionCommonFields(DeviceObject->DeviceExtension, + DeviceObject, + PhysicalDeviceObject); + + /* Attach to the root PDO */ + Status = STATUS_NO_SUCH_DEVICE; + AttachedTo = IoAttachDeviceToDeviceStack(DeviceObject, + PhysicalDeviceObject); + ASSERT(AttachedTo != NULL); + if (!AttachedTo) break; + FdoExtension->AttachedDeviceObject = AttachedTo; + if (ParentExtension) + { + /* More than one PCI bus, this is not expected yet */ + UNIMPLEMENTED; + while (TRUE); + } + else + { + /* Query the boot configuration */ + Status = PciGetDeviceProperty(PhysicalDeviceObject, + DevicePropertyBootConfiguration, + (PVOID*)&Descriptor); + if (!NT_SUCCESS(Status)) + { + /* No configuration has been set */ + Descriptor = NULL; + } + else + { + /* Root PDO in ReactOS does not assign boot resources */ + UNIMPLEMENTED; + while (TRUE); + } + + if (Descriptor) + { + /* Root PDO in ReactOS does not assign boot resources */ + UNIMPLEMENTED; + while (TRUE); + } + else + { + /* Default configuration isn't the normal path on Windows */ + if (PciBreakOnDefault) + { + /* If a second bus is found and there's still no data, crash */ + KeBugCheckEx(PCI_BUS_DRIVER_INTERNAL, + 0xDEAD0010u, + (ULONG_PTR)DeviceObject, + 0, + 0); + } + + /* Warn that a default configuration will be used, and set bus 0 */ + DPRINT1("PCI Will use default configuration.\n"); + PciBreakOnDefault = TRUE; + FdoExtension->BaseBus = 0; + } + + /* This is the root bus */ + FdoExtension->BusRootFdoExtension = FdoExtension; + } + + /* Get the HAL or ACPI Bus Handler Callbacks for Configuration Access */ + Status = PciGetConfigHandlers(FdoExtension); + if (!NT_SUCCESS(Status)) break; + + /* Initialize all the supported PCI arbiters */ + Status = PciInitializeArbiters(FdoExtension); + if (!NT_SUCCESS(Status)) break; + + /* This is a real FDO, insert it into the list */ + FdoExtension->Fake = FALSE; + PciInsertEntryAtTail(&PciFdoExtensionListHead, + FdoExtension, + &PciGlobalLock); + + /* Open the device registry key so that we can query the errata flags */ + IoOpenDeviceRegistryKey(DeviceObject, + PLUGPLAY_REGKEY_DEVICE, + KEY_ALL_ACCESS, + &KeyHandle), + + /* Open the value that contains errata flags for this bus instance */ + RtlInitUnicodeString(&ValueName, L"HackFlags"); + Status = ZwQueryValueKey(KeyHandle, + &ValueName, + KeyValuePartialInformation, + ValueInfo, + sizeof(Buffer), + &ResultLength); + ZwClose(KeyHandle); + if (NT_SUCCESS(Status)) + { + /* Make sure the data is of expected type and size */ + if ((ValueInfo->Type == REG_DWORD) && + (ValueInfo->DataLength == sizeof(ULONG))) + { + /* Read the flags for this bus */ + FdoExtension->BusHackFlags = *(PULONG)&ValueInfo->Data; + } + } + + /* Query ACPI for PCI HotPlug Support */ + PciGetHotPlugParameters(FdoExtension); + + /* The Bus FDO is now initialized */ + DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; + DPRINT1("PCI Root FDO Added: %p %p\n", DeviceObject, FdoExtension); + return STATUS_SUCCESS; + } while (FALSE); + + /* This is the failure path */ + ASSERT(!NT_SUCCESS(Status)); + if (AttachedTo) IoDetachDevice(AttachedTo); + if (DeviceObject) IoDeleteDevice(DeviceObject); + return Status; } /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/intrface/intrface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/intrface/…
============================================================================== --- trunk/reactos/drivers/bus/pcix/intrface/intrface.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/intrface/intrface.c [iso-8859-1] Mon Jun 28 17:30:35 2010 @@ -14,6 +14,11 @@ /* GLOBALS ********************************************************************/ +PPCI_INTERFACE PciInterfaces[] = +{ + NULL +}; + /* FUNCTIONS ******************************************************************/ /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/pci.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci.h?rev…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci.h [iso-8859-1] Mon Jun 28 17:30:35 2010 @@ -17,11 +17,23 @@ #include "halfuncs.h" #include "rtlfuncs.h" #include "vffuncs.h" +#include "bugcodes.h" // // Tag used in all pool allocations (Pci Bus) // #define PCI_POOL_TAG 'BicP' + +// +// Checks if the specified FDO is the FDO for the Root PCI Bus +// +#define PCI_IS_ROOT_FDO(x) ((x)->BusRootFdoExtension == x) + +// +// Assertions to make sure we are dealing with the right kind of extension +// +#define ASSERT_FDO(x) ASSERT((x)->ExtensionType == PciFdoExtensionType); +#define ASSERT_PDO(x) ASSERT((x)->ExtensionType == PciPdoExtensionType); // // PCI Hack Entry Name Lengths @@ -32,10 +44,62 @@ #define PCI_HACK_ENTRY_FULL_SIZE sizeof(L"VVVVddddssssIIIIRR") // 36 // -// PCI Hack Entry Information +// PCI Hack Entry Flags // #define PCI_HACK_HAS_REVISION_INFO 0x01 #define PCI_HACK_HAS_SUBSYSTEM_INFO 0x02 + +// +// Device Extension, Interface, Translator and Arbiter Signatures +// +typedef enum _PCI_SIGNATURE +{ + PciPdoExtensionType = '0Pci', + PciFdoExtensionType = '1Pci', + PciArb_Io = '2Pci', + PciArb_Memory = '3Pci', + PciArb_Interrupt = '4Pci', + PciArb_BusNumber = '5Pci', + PciTrans_Interrupt = '6Pci', + PciInterface_BusHandler = '7Pci', + PciInterface_IntRouteHandler = '8Pci', + PciInterface_PciCb = '9Pci', + PciInterface_LegacyDeviceDetection = ':Pci', + PciInterface_PmeHandler = ';Pci', + PciInterface_DevicePresent = '<Pci', + PciInterface_NativeIde = '=Pci', + PciInterface_AgpTarget = '>Pci', + PciInterface_Location = '?Pci' +} PCI_SIGNATURE, *PPCI_SIGNATURE; + +// +// Device Extension Logic States +// +typedef enum _PCI_STATE +{ + PciNotStarted, + PciStarted, + PciDeleted, + PciStopped, + PciSurpriseRemoved, + PciSynchronizedOperation, + PciMaxObjectState +} PCI_STATE; + +// +// IRP Dispatch Logic Style +// +typedef enum _PCI_DISPATCH_STYLE +{ + IRP_COMPLETE, + IRP_DOWNWARD, + IRP_UPWARD, + IRP_DISPATCH, +} PCI_DISPATCH_STYLE; + +// +// PCI Hack Entry Information +// typedef struct _PCI_HACK_ENTRY { USHORT VendorID; @@ -48,6 +112,165 @@ } PCI_HACK_ENTRY, *PPCI_HACK_ENTRY; // +// Power State Information for Device Extension +// +typedef struct _PCI_POWER_STATE +{ + SYSTEM_POWER_STATE CurrentSystemState; + DEVICE_POWER_STATE CurrentDeviceState; + SYSTEM_POWER_STATE SystemWakeLevel; + DEVICE_POWER_STATE DeviceWakeLevel; + DEVICE_POWER_STATE SystemStateMapping[7]; + PIRP WaitWakeIrp; + PVOID SavedCancelRoutine; + LONG Paging; + LONG Hibernate; + LONG CrashDump; +} PCI_POWER_STATE, *PPCI_POWER_STATE; + +// +// Internal PCI Lock Structure +// +typedef struct _PCI_LOCK +{ + LONG Atom; + BOOLEAN OldIrql; +} PCI_LOCK, *PPCI_LOCK; + +// +// Device Extension for a Bus FDO +// +typedef struct _PCI_FDO_EXTENSION +{ + SINGLE_LIST_ENTRY List; + ULONG ExtensionType; + struct _PCI_MJ_DISPATCH_TABLE *IrpDispatchTable; + BOOLEAN DeviceState; + BOOLEAN TentativeNextState; + KEVENT SecondaryExtLock; + PDEVICE_OBJECT PhysicalDeviceObject; + PDEVICE_OBJECT FunctionalDeviceObject; + PDEVICE_OBJECT AttachedDeviceObject; + KEVENT ChildListLock; + struct _PCI_PDO_EXTENSION *ChildPdoList; + struct _PCI_FDO_EXTENSION *BusRootFdoExtension; + struct _PCI_FDO_EXTENSION *ParentFdoExtension; + struct _PCI_PDO_EXTENSION *ChildBridgePdoList; + PPCI_BUS_INTERFACE_STANDARD PciBusInterface; + BOOLEAN MaxSubordinateBus; + BUS_HANDLER *BusHandler; + BOOLEAN BaseBus; + BOOLEAN Fake; + BOOLEAN ChildDelete; + BOOLEAN Scanned; + BOOLEAN ArbitersInitialized; + BOOLEAN BrokenVideoHackApplied; + BOOLEAN Hibernated; + PCI_POWER_STATE PowerState; + SINGLE_LIST_ENTRY SecondaryExtension; + LONG ChildWaitWakeCount; + PPCI_COMMON_CONFIG PreservedConfig; + PCI_LOCK Lock; + struct + { + BOOLEAN Acquired; + BOOLEAN CacheLineSize; + BOOLEAN LatencyTimer; + BOOLEAN EnablePERR; + BOOLEAN EnableSERR; + } HotPlugParameters; + LONG BusHackFlags; +} PCI_FDO_EXTENSION, *PPCI_FDO_EXTENSION; + +// +// IRP Dispatch Function Type +// +typedef NTSTATUS (NTAPI *PCI_DISPATCH_FUNCTION)( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +// +// IRP Dispatch Minor Table +// +typedef struct _PCI_MN_DISPATCH_TABLE +{ + PCI_DISPATCH_STYLE DispatchStyle; + PCI_DISPATCH_FUNCTION DispatchFunction; +} PCI_MN_DISPATCH_TABLE, *PPCI_MN_DISPATCH_TABLE; + +// +// IRP Dispatch Major Table +// +typedef struct _PCI_MJ_DISPATCH_TABLE +{ + ULONG PnpIrpMaximumMinorFunction; + PPCI_MN_DISPATCH_TABLE PnpIrpDispatchTable; + ULONG PowerIrpMaximumMinorFunction; + PPCI_MN_DISPATCH_TABLE PowerIrpDispatchTable; + PCI_DISPATCH_STYLE SystemControlIrpDispatchStyle; + PCI_DISPATCH_FUNCTION SystemControlIrpDispatchFunction; + PCI_DISPATCH_STYLE OtherIrpDispatchStyle; + PCI_DISPATCH_FUNCTION OtherIrpDispatchFunction; +} PCI_MJ_DISPATCH_TABLE, *PPCI_MJ_DISPATCH_TABLE; + +// +// Generic PCI Interface Constructor and Initializer +// +struct _PCI_INTERFACE; +typedef NTSTATUS (NTAPI *PCI_INTERFACE_CONSTRUCTOR)( + IN PPCI_FDO_EXTENSION DeviceExtension, + IN PVOID Instance, + IN PVOID InterfaceData, + IN USHORT Version, + IN USHORT Size, + IN PINTERFACE Interface +); + +typedef NTSTATUS (NTAPI *PCI_INTERFACE_INITIALIZER)( + IN PVOID Instance +); + +// +// Generic PCI Interface (Interface, Translator, Arbiter) +// +typedef struct _PCI_INTERFACE +{ + LPGUID InterfaceType; + USHORT MinSize; + USHORT MinVersion; + USHORT MaxVersion; + USHORT Flags; + LONG ReferenceCount; + PCI_SIGNATURE Signature; + PCI_INTERFACE_CONSTRUCTOR Constructor; + PCI_INTERFACE_INITIALIZER Initializer; +} PCI_INTERFACE, *PPCI_INTERFACE; + +// +// Generic Secondary Extension Instance Header (Interface, Translator, Arbiter) +// +typedef struct PCI_SECONDARY_EXTENSION +{ + SINGLE_LIST_ENTRY List; + PCI_SIGNATURE ExtensionType; + PVOID Destructor; +} PCI_SECONDARY_EXTENSION, *PPCI_SECONDARY_EXTENSION; + +// +// PCI Arbiter Instance +// +typedef struct PCI_ARBITER_INSTANCE +{ + PCI_SECONDARY_EXTENSION Header; + PPCI_INTERFACE Interface; + PPCI_FDO_EXTENSION BusFdoExtension; + WCHAR InstanceName[24]; + //ARBITER_INSTANCE CommonInstance; FIXME: Need Arbiter Headers +} PCI_ARBITER_INSTANCE, *PPCI_ARBITER_INSTANCE; + +// // IRP Dispatch Routines // NTSTATUS @@ -55,6 +278,14 @@ PciDispatchIrp( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp +); + +NTSTATUS +NTAPI +PciIrpNotSupported( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension ); // @@ -136,4 +367,82 @@ OUT PULONG OutputLength ); +PPCI_FDO_EXTENSION +NTAPI +PciFindParentPciFdoExtension( + IN PDEVICE_OBJECT DeviceObject, + IN PKEVENT Lock +); + +VOID +NTAPI +PciInsertEntryAtTail( + IN PSINGLE_LIST_ENTRY ListHead, + IN PPCI_FDO_EXTENSION DeviceExtension, + IN PKEVENT Lock +); + +NTSTATUS +NTAPI +PciGetDeviceProperty( + IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_REGISTRY_PROPERTY DeviceProperty, + OUT PVOID *OutputBuffer +); + +NTSTATUS +NTAPI +PciSendIoctl( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG IoControlCode, + IN PVOID InputBuffer, + IN ULONG InputBufferLength, + IN PVOID OutputBuffer, + IN ULONG OutputBufferLength +); + +VOID +NTAPI +PcipLinkSecondaryExtension( + IN PSINGLE_LIST_ENTRY List, + IN PVOID Lock, + IN PPCI_SECONDARY_EXTENSION SecondaryExtension, + IN PCI_SIGNATURE ExtensionType, + IN PVOID Destructor +); + +// +// Configuration Routines +// +NTSTATUS +NTAPI +PciGetConfigHandlers( + IN PPCI_FDO_EXTENSION FdoExtension +); + +// +// State Machine Logic Transition Routines +// +VOID +NTAPI +PciInitializeState( + IN PPCI_FDO_EXTENSION DeviceExtension +); + +// +// Arbiter Support +// +NTSTATUS +NTAPI +PciInitializeArbiters( + IN PPCI_FDO_EXTENSION FdoExtension +); + +// +// External Resources +// +extern SINGLE_LIST_ENTRY PciFdoExtensionListHead; +extern KEVENT PciGlobalLock; +extern PPCI_INTERFACE PciInterfaces[]; + /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/pci/config.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci/confi…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci/config.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci/config.c [iso-8859-1] Mon Jun 28 17:30:35 2010 @@ -14,6 +14,154 @@ /* GLOBALS ********************************************************************/ +BOOLEAN PciAssignBusNumbers; + /* FUNCTIONS ******************************************************************/ +NTSTATUS +NTAPI +PciQueryForPciBusInterface(IN PPCI_FDO_EXTENSION FdoExtension) +{ + PDEVICE_OBJECT AttachedDevice; + IO_STATUS_BLOCK IoStatusBlock; + KEVENT Event; + NTSTATUS Status; + PIRP Irp; + PIO_STACK_LOCATION IoStackLocation; + PPCI_BUS_INTERFACE_STANDARD PciInterface; + PAGED_CODE(); + ASSERT(PCI_IS_ROOT_FDO(FdoExtension)); + + /* Allocate space for the inteface */ + PciInterface = ExAllocatePoolWithTag(NonPagedPool, + sizeof(PCI_BUS_INTERFACE_STANDARD), + PCI_POOL_TAG); + if (!PciInterface) return STATUS_INSUFFICIENT_RESOURCES; + + /* Get the device the PDO is attached to, should be the Root (ACPI) */ + AttachedDevice = IoGetAttachedDeviceReference(FdoExtension->PhysicalDeviceObject); + + /* Build an IRP for this request */ + KeInitializeEvent(&Event, SynchronizationEvent, FALSE); + Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP, + AttachedDevice, + NULL, + 0, + NULL, + &Event, + &IoStatusBlock); + if (Irp) + { + /* Initialize the default PnP response */ + Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; + Irp->IoStatus.Information = 0; + + /* Make it a Query Interface IRP */ + IoStackLocation = IoGetNextIrpStackLocation(Irp); + ASSERT(IoStackLocation->MajorFunction == IRP_MJ_PNP); + IoStackLocation->MinorFunction = IRP_MN_QUERY_INTERFACE; + IoStackLocation->Parameters.QueryInterface.InterfaceType = &GUID_PCI_BUS_INTERFACE_STANDARD; + IoStackLocation->Parameters.QueryInterface.Size = sizeof(GUID_PCI_BUS_INTERFACE_STANDARD); + IoStackLocation->Parameters.QueryInterface.Version = PCI_BUS_INTERFACE_STANDARD_VERSION; + IoStackLocation->Parameters.QueryInterface.Interface = (PINTERFACE)PciInterface; + IoStackLocation->Parameters.QueryInterface.InterfaceSpecificData = NULL; + + /* Send it to the root PDO */ + Status = IoCallDriver(AttachedDevice, Irp); + if (Status == STATUS_PENDING) + { + /* Wait for completion */ + KeWaitForSingleObject(&Event, + Executive, + KernelMode, + FALSE, + NULL); + Status = Irp->IoStatus.Status; + } + + /* Check if an interface was returned */ + if (!NT_SUCCESS(Status)) + { + /* No interface was returned by the root PDO */ + FdoExtension->PciBusInterface = NULL; + ExFreePoolWithTag(PciInterface, 0); + } + else + { + /* An interface was returned, save it */ + FdoExtension->PciBusInterface = PciInterface; + } + + /* Dereference the device object because we took a reference earlier */ + ObfDereferenceObject(AttachedDevice); + } + else + { + /* Failure path, dereference the device object and set failure code */ + if (AttachedDevice) ObfDereferenceObject(AttachedDevice); + ExFreePoolWithTag(PciInterface, 0); + Status = STATUS_INSUFFICIENT_RESOURCES; + } + + /* Return status code to caller */ + return Status; +} + +NTSTATUS +NTAPI +PciGetConfigHandlers(IN PPCI_FDO_EXTENSION FdoExtension) +{ + PBUS_HANDLER BusHandler; + NTSTATUS Status; + ASSERT(FdoExtension->BusHandler == NULL); + + /* Check if this is the FDO for the root bus */ + if (PCI_IS_ROOT_FDO(FdoExtension)) + { + /* Query the PCI Bus Interface that ACPI exposes */ + ASSERT(FdoExtension->PciBusInterface == NULL); + Status = PciQueryForPciBusInterface(FdoExtension); + if (!NT_SUCCESS(Status)) + { + /* No ACPI, so Bus Numbers should be maintained by BIOS */ + ASSERT(!PciAssignBusNumbers); + } + else + { + /* ACPI detected, PCI Bus Driver will reconfigure bus numbers*/ + PciAssignBusNumbers = TRUE; + } + } + else + { + /* Check if the root bus already has the interface set up */ + if (FdoExtension->BusRootFdoExtension->PciBusInterface) + { + /* Nothing for this FDO to do */ + return STATUS_SUCCESS; + } + + /* Fail into case below so we can query the HAL interface */ + Status = STATUS_NOT_SUPPORTED; + } + + /* If the ACPI PCI Bus Interface couldn't be obtained, try the HAL */ + if (!NT_SUCCESS(Status)) + { + /* Bus number assignment should be static */ + ASSERT(Status == STATUS_NOT_SUPPORTED); + ASSERT(!PciAssignBusNumbers); + + /* Call the HAL to obtain the bus handler for PCI */ + BusHandler = HalReferenceHandlerForBus(PCIBus, FdoExtension->BaseBus); + FdoExtension->BusHandler = BusHandler; + + /* Fail if the HAL does not have a PCI Bus Handler for this bus */ + if (!BusHandler) return STATUS_INVALID_DEVICE_REQUEST; + } + + /* Appropriate interface was obtained */ + return STATUS_SUCCESS; +} + /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/pci/state.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci/state…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci/state.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci/state.c [iso-8859-1] Mon Jun 28 17:30:35 2010 @@ -16,4 +16,13 @@ /* FUNCTIONS ******************************************************************/ +VOID +NTAPI +PciInitializeState(IN PPCI_FDO_EXTENSION DeviceExtension) +{ + /* Set the initial state */ + DeviceExtension->DeviceState = PciNotStarted; + DeviceExtension->TentativeNextState = PciNotStarted; +} + /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/utils.c?r…
============================================================================== --- trunk/reactos/drivers/bus/pcix/utils.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/utils.c [iso-8859-1] Mon Jun 28 17:30:35 2010 @@ -333,4 +333,226 @@ return Status; } +PPCI_FDO_EXTENSION +NTAPI +PciFindParentPciFdoExtension(IN PDEVICE_OBJECT DeviceObject, + IN PKEVENT Lock) +{ + PPCI_FDO_EXTENSION FoundExtension; + + /* Assume we'll find nothing */ + FoundExtension = NULL; + + /* Check if a lock was specified */ + if (Lock) + { + /* Wait for the lock to be released */ + KeEnterCriticalRegion(); + KeWaitForSingleObject(Lock, Executive, KernelMode, FALSE, NULL); + } + + /* Now search for the extension */ + if (PciFdoExtensionListHead.Next) + { + /* This case should not be hit yet */ + UNIMPLEMENTED; + while (TRUE); + } + + /* Check if we had acquired a lock previously */ + if (Lock) + { + /* Release it */ + KeSetEvent(Lock, IO_NO_INCREMENT, FALSE); + KeLeaveCriticalRegion(); + } + + /* Return which extension was found, if any */ + return FoundExtension; +} + +VOID +NTAPI +PciInsertEntryAtTail(IN PSINGLE_LIST_ENTRY ListHead, + IN PPCI_FDO_EXTENSION DeviceExtension, + IN PKEVENT Lock) +{ + PSINGLE_LIST_ENTRY NextEntry; + PAGED_CODE(); + + /* Check if a lock was specified */ + if (Lock) + { + /* Wait for the lock to be released */ + KeEnterCriticalRegion(); + KeWaitForSingleObject(Lock, Executive, KernelMode, FALSE, NULL); + } + + /* Loop the list until we get to the end, then insert this entry there */ + for (NextEntry = ListHead; NextEntry->Next; NextEntry = NextEntry->Next); + NextEntry->Next = &DeviceExtension->List; + + /* Check if we had acquired a lock previously */ + if (Lock) + { + /* Release it */ + KeSetEvent(Lock, IO_NO_INCREMENT, FALSE); + KeLeaveCriticalRegion(); + } +} + +VOID +NTAPI +PciInsertEntryAtHead(IN PSINGLE_LIST_ENTRY ListHead, + IN PSINGLE_LIST_ENTRY Entry, + IN PKEVENT Lock) +{ + PAGED_CODE(); + + /* Check if a lock was specified */ + if (Lock) + { + /* Wait for the lock to be released */ + KeEnterCriticalRegion(); + KeWaitForSingleObject(Lock, Executive, KernelMode, FALSE, NULL); + } + + /* Make the entry point to the current head and make the head point to it */ + Entry->Next = ListHead->Next; + ListHead->Next = Entry; + + /* Check if we had acquired a lock previously */ + if (Lock) + { + /* Release it */ + KeSetEvent(Lock, IO_NO_INCREMENT, FALSE); + KeLeaveCriticalRegion(); + } +} + +VOID +NTAPI +PcipLinkSecondaryExtension(IN PSINGLE_LIST_ENTRY List, + IN PVOID Lock, + IN PPCI_SECONDARY_EXTENSION SecondaryExtension, + IN PCI_SIGNATURE ExtensionType, + IN PVOID Destructor) +{ + PAGED_CODE(); + + /* Setup the extension data, and insert it into the primary's list */ + SecondaryExtension->ExtensionType = ExtensionType; + SecondaryExtension->Destructor = Destructor; + PciInsertEntryAtHead(List, &SecondaryExtension->List, Lock); +} + +NTSTATUS +NTAPI +PciGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_REGISTRY_PROPERTY DeviceProperty, + OUT PVOID *OutputBuffer) +{ + NTSTATUS Status; + ULONG BufferLength, ResultLength; + PVOID Buffer; + do + { + /* Query the requested property size */ + Status = IoGetDeviceProperty(DeviceObject, + DeviceProperty, + 0, + NULL, + &BufferLength); + if (Status != STATUS_BUFFER_TOO_SMALL) + { + /* Call should've failed with buffer too small! */ + DPRINT1("PCI - Unexpected status from GetDeviceProperty, saw %08X, expected %08X.\n", + Status, + STATUS_BUFFER_TOO_SMALL); + *OutputBuffer = NULL; + ASSERTMSG(FALSE, "PCI Successfully did the impossible!"); + break; + } + + /* Allocate the required buffer */ + Buffer = ExAllocatePoolWithTag(PagedPool, BufferLength, 'BicP'); + if (!Buffer) + { + /* No memory, fail the request */ + DPRINT1("PCI - Failed to allocate DeviceProperty buffer (%d bytes).\n", BufferLength); + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + + /* Do the actual property query call */ + Status = IoGetDeviceProperty(DeviceObject, + DeviceProperty, + BufferLength, + Buffer, + &ResultLength); + if (!NT_SUCCESS(Status)) break; + + /* Return the buffer to the caller */ + ASSERT(BufferLength == ResultLength); + *OutputBuffer = Buffer; + return STATUS_SUCCESS; + } while (FALSE); + + /* Failure path */ + return STATUS_UNSUCCESSFUL; +} + +NTSTATUS +NTAPI +PciSendIoctl(IN PDEVICE_OBJECT DeviceObject, + IN ULONG IoControlCode, + IN PVOID InputBuffer, + IN ULONG InputBufferLength, + IN PVOID OutputBuffer, + IN ULONG OutputBufferLength) +{ + PIRP Irp; + NTSTATUS Status; + KEVENT Event; + IO_STATUS_BLOCK IoStatusBlock; + PDEVICE_OBJECT AttachedDevice; + PAGED_CODE(); + + /* Initialize the pending IRP event */ + KeInitializeEvent(&Event, SynchronizationEvent, FALSE); + + /* Get a reference to the root PDO (ACPI) */ + AttachedDevice = IoGetAttachedDeviceReference(DeviceObject); + if (!AttachedDevice) return STATUS_INVALID_PARAMETER; + + /* Build the requested IOCTL IRP */ + Irp = IoBuildDeviceIoControlRequest(IoControlCode, + AttachedDevice, + InputBuffer, + InputBufferLength, + OutputBuffer, + OutputBufferLength, + 0, + &Event, + &IoStatusBlock); + if (!Irp) return STATUS_INSUFFICIENT_RESOURCES; + + /* Send the IOCTL to the driver */ + Status = IoCallDriver(AttachedDevice, Irp); + if (Status == STATUS_PENDING) + { + /* Wait for a response */ + KeWaitForSingleObject(&Event, + Executive, + KernelMode, + FALSE, + NULL); + Status = Irp->IoStatus.Status; + } + + /* Take away the reference we took and return the result to the caller */ + ObDereferenceObject(AttachedDevice); + return Status; +} + /* EOF */
14 years, 5 months
1
0
0
0
[evb] 47897: Missing PCI_BUS_DRIVER_INTERNAL added to bugcodes. Thx for sir_richard to show me how to add.
by evb@svn.reactos.org
Author: evb Date: Mon Jun 28 17:21:16 2010 New Revision: 47897 URL:
http://svn.reactos.org/svn/reactos?rev=47897&view=rev
Log: Missing PCI_BUS_DRIVER_INTERNAL added to bugcodes. Thx for sir_richard to show me how to add. Modified: trunk/reactos/include/reactos/mc/bugcodes.mc Modified: trunk/reactos/include/reactos/mc/bugcodes.mc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/mc/bugcode…
============================================================================== --- trunk/reactos/include/reactos/mc/bugcodes.mc [iso-8859-1] (original) +++ trunk/reactos/include/reactos/mc/bugcodes.mc [iso-8859-1] Mon Jun 28 17:21:16 2010 @@ -1189,6 +1189,14 @@ INTERNAL_POWER_ERROR . +MessageId=0xA1 +Severity=Success +Facility=System +SymbolicName=PCI_BUS_DRIVER_INTERNAL +Language=English +Inconsistency detected in the PCI Bus driver's internal structures. +. + MessageId=0xA5 Severity=Success Facility=System
14 years, 5 months
1
0
0
0
[spetreolle] 47896: Fix midiOutOpen and midiInOpen prototypes.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Mon Jun 28 16:59:17 2010 New Revision: 47896 URL:
http://svn.reactos.org/svn/reactos?rev=47896&view=rev
Log: Fix midiOutOpen and midiInOpen prototypes. Modified: trunk/reactos/include/psdk/mmsystem.h Modified: trunk/reactos/include/psdk/mmsystem.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/mmsystem.h?re…
============================================================================== --- trunk/reactos/include/psdk/mmsystem.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/mmsystem.h [iso-8859-1] Mon Jun 28 16:59:17 2010 @@ -1780,7 +1780,7 @@ MMRESULT WINAPI midiOutSetVolume(HMIDIOUT,DWORD); MMRESULT WINAPI midiOutGetErrorTextA(MMRESULT,LPSTR,UINT); MMRESULT WINAPI midiOutGetErrorTextW(MMRESULT,LPWSTR,UINT); -MMRESULT WINAPI midiOutOpen(LPHMIDIOUT,UINT_PTR,DWORD_PTR,DWORD_PTR,DWORD); +MMRESULT WINAPI midiOutOpen(LPHMIDIOUT,UINT,DWORD_PTR,DWORD_PTR,DWORD); MMRESULT WINAPI midiOutClose(HMIDIOUT); MMRESULT WINAPI midiOutPrepareHeader(HMIDIOUT,LPMIDIHDR,UINT); MMRESULT WINAPI midiOutUnprepareHeader(HMIDIOUT,LPMIDIHDR,UINT); @@ -1802,7 +1802,7 @@ MMRESULT WINAPI midiInGetDevCapsW(UINT_PTR,LPMIDIINCAPSW,UINT); MMRESULT WINAPI midiInGetErrorTextA(MMRESULT,LPSTR,UINT); MMRESULT WINAPI midiInGetErrorTextW(MMRESULT,LPWSTR,UINT); -MMRESULT WINAPI midiInOpen(LPHMIDIIN,UINT_PTR,DWORD_PTR,DWORD_PTR,DWORD); +MMRESULT WINAPI midiInOpen(LPHMIDIIN,UINT,DWORD_PTR,DWORD_PTR,DWORD); MMRESULT WINAPI midiInClose(HMIDIIN); MMRESULT WINAPI midiInPrepareHeader(HMIDIIN,LPMIDIHDR,UINT); MMRESULT WINAPI midiInUnprepareHeader(HMIDIIN,LPMIDIHDR,UINT);
14 years, 5 months
1
0
0
0
[evb] 47894: Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test) Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect HAL Hoooking enabled, callbacks stub Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp PCI utility routines: PciUnicodeStringStrStr, P
by evb@svn.reactos.org
Author: evb Date: Mon Jun 28 05:23:31 2010 New Revision: 47894 URL:
http://svn.reactos.org/svn/reactos?rev=47894&view=rev
Log: Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test) Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect HAL Hoooking enabled, callbacks stub Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub) Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~ Modified: trunk/reactos/drivers/bus/pcix/dispatch.c trunk/reactos/drivers/bus/pcix/fdo.c trunk/reactos/drivers/bus/pcix/hookhal.c trunk/reactos/drivers/bus/pcix/init.c trunk/reactos/drivers/bus/pcix/pci.h trunk/reactos/drivers/bus/pcix/pcivrify.c trunk/reactos/drivers/bus/pcix/utils.c Modified: trunk/reactos/drivers/bus/pcix/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/dispatch.…
============================================================================== --- trunk/reactos/drivers/bus/pcix/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/dispatch.c [iso-8859-1] Mon Jun 28 05:23:31 2010 @@ -16,4 +16,15 @@ /* FUNCTIONS ******************************************************************/ +NTSTATUS +NTAPI +PciDispatchIrp(IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + /* This function is not yet implemented */ + UNIMPLEMENTED; + while (TRUE); + return STATUS_SUCCESS; +} + /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/fdo.c?rev…
============================================================================== --- trunk/reactos/drivers/bus/pcix/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/fdo.c [iso-8859-1] Mon Jun 28 05:23:31 2010 @@ -16,4 +16,15 @@ /* FUNCTIONS ******************************************************************/ +NTSTATUS +NTAPI +PciAddDevice(IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT PhysicalDeviceObject) +{ + /* This function is not yet implemented */ + UNIMPLEMENTED; + while (TRUE); + return STATUS_SUCCESS; +} + /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/hookhal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/hookhal.c…
============================================================================== --- trunk/reactos/drivers/bus/pcix/hookhal.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/hookhal.c [iso-8859-1] Mon Jun 28 05:23:31 2010 @@ -14,6 +14,55 @@ /* GLOBALS ********************************************************************/ +pHalTranslateBusAddress PcipSavedTranslateBusAddress; +pHalAssignSlotResources PcipSavedAssignSlotResources; + /* FUNCTIONS ******************************************************************/ +BOOLEAN +NTAPI +PciTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber, + IN PHYSICAL_ADDRESS BusAddress, + OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress) +{ + /* This function is not yet implemented */ + UNIMPLEMENTED; + while (TRUE); + return FALSE; +} + +NTSTATUS +NTAPI +PciAssignSlotResources(IN PUNICODE_STRING RegistryPath, + IN PUNICODE_STRING DriverClassName OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT DeviceObject, + IN INTERFACE_TYPE BusType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN OUT PCM_RESOURCE_LIST *AllocatedResources) +{ + /* This function is not yet implemented */ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +VOID +NTAPI +PciHookHal(VOID) +{ + /* Save the old HAL routines */ + ASSERT(PcipSavedAssignSlotResources == NULL); + ASSERT(PcipSavedTranslateBusAddress == NULL); + PcipSavedAssignSlotResources = HalPciAssignSlotResources; + PcipSavedTranslateBusAddress = HalPciTranslateBusAddress; + + /* Take over the HAL's Bus Handler functions */ + HalPciAssignSlotResources = PciAssignSlotResources; + HalPciTranslateBusAddress = PciTranslateBusAddress; +} + /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/init.c?re…
============================================================================== --- trunk/reactos/drivers/bus/pcix/init.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/init.c [iso-8859-1] Mon Jun 28 05:23:31 2010 @@ -14,17 +14,843 @@ /* GLOBALS ********************************************************************/ +BOOLEAN PciRunningDatacenter; +PDRIVER_OBJECT PciDriverObject; +KEVENT PciGlobalLock; +KEVENT PciBusLock; +KEVENT PciLegacyDescriptionLock; +BOOLEAN PciLockDeviceResources; +BOOLEAN PciEnableNativeModeATA; +ULONG PciSystemWideHackFlags; +PPCI_IRQ_ROUTING_TABLE PciIrqRoutingTable; +PWATCHDOG_TABLE WdTable; +PPCI_HACK_ENTRY PciHackTable; + /* FUNCTIONS ******************************************************************/ + +NTSTATUS +NTAPI +PciAcpiFindRsdt(OUT PACPI_BIOS_MULTI_NODE *AcpiMultiNode) +{ + BOOLEAN Result; + NTSTATUS Status; + HANDLE KeyHandle, SubKey; + ULONG NumberOfBytes, i, Length; + PKEY_FULL_INFORMATION FullInfo; + PKEY_VALUE_BASIC_INFORMATION KeyInfo; + PKEY_VALUE_PARTIAL_INFORMATION ValueInfo; + PACPI_BIOS_MULTI_NODE NodeData; + UNICODE_STRING ValueName; + struct + { + CM_FULL_RESOURCE_DESCRIPTOR Descriptor; + ACPI_BIOS_MULTI_NODE Node; + } *Package; + + /* So we know what to free at the end of the body */ + ValueInfo = NULL; + KeyInfo = NULL; + KeyHandle = NULL; + FullInfo = NULL; + Package = NULL; + do + { + /* Open the ACPI BIOS key */ + Result = PciOpenKey(L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\" + L"System\\MultiFunctionAdapter", + NULL, + KEY_QUERY_VALUE, + &KeyHandle, + &Status); + if (!Result) break; + + /* Query how much space should be allocated for the key information */ + Status = ZwQueryKey(KeyHandle, + KeyFullInformation, + NULL, + sizeof(ULONG), + &NumberOfBytes); + if (Status != STATUS_BUFFER_TOO_SMALL) break; + + /* Allocate the space required */ + Status = STATUS_INSUFFICIENT_RESOURCES; + FullInfo = ExAllocatePoolWithTag(PagedPool, NumberOfBytes, PCI_POOL_TAG); + if ( !FullInfo ) break; + + /* Now query the key information that's needed */ + Status = ZwQueryKey(KeyHandle, + KeyFullInformation, + FullInfo, + NumberOfBytes, + &NumberOfBytes); + if (!NT_SUCCESS(Status)) break; + + /* Allocate enough space to hold the value information plus the name */ + Status = STATUS_INSUFFICIENT_RESOURCES; + Length = FullInfo->MaxNameLen + 26; + KeyInfo = ExAllocatePoolWithTag(PagedPool, Length, PCI_POOL_TAG); + if ( !KeyInfo ) break; + + /* Allocate the value information and name we expect to find */ + ValueInfo = ExAllocatePoolWithTag(PagedPool, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + + sizeof(L"ACPI BIOS"), + PCI_POOL_TAG); + if (!ValueInfo) break; + + /* Query each sub-key */ + Status = ZwEnumerateKey(KeyHandle, + 0, + KeyValueBasicInformation, + KeyInfo, + Length, + &NumberOfBytes); + for (i = 0; Status != STATUS_NO_MORE_ENTRIES; i++) + { + /* Null-terminate the keyname, because the kernel does not */ + KeyInfo->Name[KeyInfo->NameLength / sizeof(WCHAR)] = UNICODE_NULL; + + /* Open this subkey */ + Result = PciOpenKey(KeyInfo->Name, + KeyHandle, + KEY_QUERY_VALUE, + &SubKey, + &Status); + if (Result) + { + /* Query the identifier value for this subkey */ + RtlInitUnicodeString(&ValueName, L"Identifier"); + Status = ZwQueryValueKey(SubKey, + &ValueName, + KeyValuePartialInformation, + ValueInfo, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + + sizeof(L"ACPI BIOS"), + &NumberOfBytes); + if (NT_SUCCESS(Status)) + { + /* Check if this is the PCI BIOS subkey */ + if (!wcsncmp((PWCHAR)ValueInfo->Data, + L"ACPI BIOS", + ValueInfo->DataLength)) + { + /* It is, proceed to query the PCI IRQ routing table */ + Status = PciGetRegistryValue(L"Configuration Data", + KeyInfo->Name, + KeyHandle, + REG_FULL_RESOURCE_DESCRIPTOR, + (PVOID*)&Package, + &NumberOfBytes); + ZwClose(SubKey); + break; + } + } + + /* Close the subkey and try the next one */ + ZwClose(SubKey); + } + } + + /* Check if we got here because the routing table was found */ + if (!NT_SUCCESS(Status)) + { + /* This should only fail if we're out of entries */ + ASSERT(Status == STATUS_NO_MORE_ENTRIES); + break; + } + + /* Check if a descriptor was found */ + if (!Package) break; + + /* The configuration data is a resource list, and the BIOS node follows */ + NodeData = &Package->Node; + + /* How many E820 memory entries are there? */ + Length = sizeof(ACPI_BIOS_MULTI_NODE) + + (NodeData->Count - 1) * sizeof(ACPI_E820_ENTRY); + + /* Allocate the buffer needed to copy the information */ + Status = STATUS_INSUFFICIENT_RESOURCES; + *AcpiMultiNode = ExAllocatePoolWithTag(NonPagedPool, Length, PCI_POOL_TAG); + if (!*AcpiMultiNode) break; + + /* Copy the data */ + RtlCopyMemory(*AcpiMultiNode, NodeData, Length); + } while (FALSE); + + /* Close any opened keys, free temporary allocations, and return status */ + if (Package) ExFreePoolWithTag(Package, 0); + if (ValueInfo) ExFreePoolWithTag(ValueInfo, 0); + if (KeyInfo) ExFreePoolWithTag(KeyInfo, 0); + if (FullInfo) ExFreePoolWithTag(FullInfo, 0); + if (KeyHandle) ZwClose(KeyHandle); + return Status; +} + +PVOID +NTAPI +PciGetAcpiTable(IN ULONG TableCode) +{ + PDESCRIPTION_HEADER Header; + PACPI_BIOS_MULTI_NODE AcpiMultiNode; + PRSDT Rsdt; + PXSDT Xsdt; + ULONG EntryCount, TableLength, Offset, CurrentEntry; + PVOID TableBuffer, MappedAddress; + PHYSICAL_ADDRESS PhysicalAddress; + NTSTATUS Status; + + /* Try to find the RSDT or XSDT */ + Status = PciAcpiFindRsdt(&AcpiMultiNode); + if (NT_SUCCESS(Status)) + { + /* No ACPI on the machine */ + DPRINT1("AcpiFindRsdt() Failed!\n"); + return NULL; + } + + /* Map the RSDT with the minimum size allowed */ + MappedAddress = MmMapIoSpace(AcpiMultiNode->RsdtAddress, + sizeof(DESCRIPTION_HEADER), + MmNonCached); + Header = MappedAddress; + if (!Header) return NULL; + + /* Check how big the table really is and get rid of the temporary header */ + TableLength = Header->Length; + MmUnmapIoSpace(Header, sizeof(DESCRIPTION_HEADER)); + Header = NULL; + + /* Map its true size */ + MappedAddress = MmMapIoSpace(AcpiMultiNode->RsdtAddress, + TableLength, + MmNonCached); + Rsdt = MappedAddress; + Xsdt = MappedAddress; + ExFreePoolWithTag(AcpiMultiNode, 0); + if (!Rsdt) return NULL; + + /* Validate the table's signature */ + DPRINT1("ACPI RSDT/XSDT at 0x%p\n", Rsdt); + if ((Rsdt->Header.Signature != RSDT_SIGNATURE) && + (Rsdt->Header.Signature != XSDT_SIGNATURE)) + { + /* Very bad: crash */ + HalDisplayString("RSDT table contains invalid signature\n"); + MmUnmapIoSpace(Rsdt, TableLength); + return NULL; + } + + /* Smallest RSDT/XSDT is one without table entries */ + Offset = FIELD_OFFSET(RSDT, Tables); + if (Rsdt->Header.Signature == XSDT_SIGNATURE) + { + /* Figure out total size of table and the offset */ + TableLength = Xsdt->Header.Length; + if (TableLength < Offset) Offset = Xsdt->Header.Length; + + /* The entries are each 64-bits, so count them */ + EntryCount = (TableLength - Offset) / sizeof(PHYSICAL_ADDRESS); + } + else + { + /* Figure out total size of table and the offset */ + TableLength = Rsdt->Header.Length; + if (TableLength < Offset) Offset = Rsdt->Header.Length; + + /* The entries are each 32-bits, so count them */ + EntryCount = (TableLength - Offset) / sizeof(ULONG); + } + + /* Start at the beginning of the array and loop it */ + for (CurrentEntry = 0; CurrentEntry < EntryCount; CurrentEntry++) + { + /* Are we using the XSDT? */ + if (Rsdt->Header.Signature != XSDT_SIGNATURE) + { + /* Read the 32-bit physical address */ + PhysicalAddress.LowPart = Rsdt->Tables[CurrentEntry]; + } + else + { + /* Read the 64-bit physical address */ + PhysicalAddress = Xsdt->Tables[CurrentEntry]; + } + + /* Map this table */ + Header = MmMapIoSpace(PhysicalAddress, + sizeof(DESCRIPTION_HEADER), + MmNonCached); + if (!Header) break; + + /* Check if this is the table that's being asked for */ + if (Header->Signature == TableCode) + { + /* Allocate a buffer for it */ + TableBuffer = ExAllocatePoolWithTag(PagedPool, + Header->Length, + PCI_POOL_TAG); + if (!TableBuffer) break; + + /* Copy the table into the buffer */ + RtlCopyMemory(TableBuffer, Header, Header->Length); + } + + /* Done with this table, keep going */ + MmUnmapIoSpace(Header, sizeof(DESCRIPTION_HEADER)); + } + + if (Header) MmUnmapIoSpace(Header, sizeof(DESCRIPTION_HEADER)); + return NULL; +} + +NTSTATUS +NTAPI +PciGetIrqRoutingTableFromRegistry(OUT PPCI_IRQ_ROUTING_TABLE *PciRoutingTable) +{ + BOOLEAN Result; + NTSTATUS Status; + HANDLE KeyHandle, SubKey; + ULONG NumberOfBytes, i, Length; + PKEY_FULL_INFORMATION FullInfo; + PKEY_VALUE_BASIC_INFORMATION KeyInfo; + PKEY_VALUE_PARTIAL_INFORMATION ValueInfo; + UNICODE_STRING ValueName; + struct + { + CM_FULL_RESOURCE_DESCRIPTOR Descriptor; + PCI_IRQ_ROUTING_TABLE Table; + } *Package; + + /* So we know what to free at the end of the body */ + Package = NULL; + ValueInfo = NULL; + KeyInfo = NULL; + KeyHandle = NULL; + FullInfo = NULL; + do + { + /* Open the BIOS key */ + Result = PciOpenKey(L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\" + L"System\\MultiFunctionAdapter", + NULL, + KEY_QUERY_VALUE, + &KeyHandle, + &Status); + if (!Result) break; + + /* Query how much space should be allocated for the key information */ + Status = ZwQueryKey(KeyHandle, + KeyFullInformation, + NULL, + sizeof(ULONG), + &NumberOfBytes); + if (Status != STATUS_BUFFER_TOO_SMALL) break; + + /* Allocate the space required */ + Status = STATUS_INSUFFICIENT_RESOURCES; + FullInfo = ExAllocatePoolWithTag(PagedPool, NumberOfBytes, PCI_POOL_TAG); + if ( !FullInfo ) break; + + /* Now query the key information that's needed */ + Status = ZwQueryKey(KeyHandle, + KeyFullInformation, + FullInfo, + NumberOfBytes, + &NumberOfBytes); + if (!NT_SUCCESS(Status)) break; + + /* Allocate enough space to hold the value information plus the name */ + Status = STATUS_INSUFFICIENT_RESOURCES; + Length = FullInfo->MaxNameLen + 26; + KeyInfo = ExAllocatePoolWithTag(PagedPool, Length, PCI_POOL_TAG); + if ( !KeyInfo ) break; + + /* Allocate the value information and name we expect to find */ + ValueInfo = ExAllocatePoolWithTag(PagedPool, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + + sizeof(L"PCI BIOS"), + PCI_POOL_TAG); + if ( !ValueInfo ) break; + + /* Query each sub-key */ + Status = ZwEnumerateKey(KeyHandle, + 0, + KeyValueBasicInformation, + KeyInfo, + Length, + &NumberOfBytes); + for (i = 0; Status != STATUS_NO_MORE_ENTRIES; i++) + { + /* Null-terminate the keyname, because the kernel does not */ + KeyInfo->Name[KeyInfo->NameLength / sizeof(WCHAR)] = UNICODE_NULL; + + /* Open this subkey */ + Result = PciOpenKey(KeyInfo->Name, + KeyHandle, + KEY_QUERY_VALUE, + &SubKey, + &Status); + if (Result) + { + /* Query the identifier value for this subkey */ + RtlInitUnicodeString(&ValueName, L"Identifier"); + Status = ZwQueryValueKey(SubKey, + &ValueName, + KeyValuePartialInformation, + ValueInfo, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + + sizeof(L"PCI BIOS"), + &NumberOfBytes); + if (NT_SUCCESS(Status)) + { + /* Check if this is the PCI BIOS subkey */ + if (!wcsncmp((PWCHAR)ValueInfo->Data, + L"PCI BIOS", + ValueInfo->DataLength)) + { + /* It is, proceed to query the PCI IRQ routing table */ + Status = PciGetRegistryValue(L"Configuration Data", + L"RealModeIrqRoutingTable" + L"\\0", + SubKey, + REG_FULL_RESOURCE_DESCRIPTOR, + (PVOID*)&Package, + &NumberOfBytes); + ZwClose(SubKey); + break; + } + } + + /* Close the subkey and try the next one */ + ZwClose(SubKey); + } + } + + /* Check if we got here because the routing table was found */ + if (!NT_SUCCESS(Status)) break; + + /* Check if a descriptor was found */ + if (!Package) break; + + /* Make sure the buffer is large enough to hold the table */ + if ((NumberOfBytes < sizeof(*Package)) || + (Package->Table.TableSize > + (NumberOfBytes - sizeof(CM_FULL_RESOURCE_DESCRIPTOR)))) + { + /* Invalid package size */ + Status = STATUS_UNSUCCESSFUL; + break; + } + + /* Allocate space for the table */ + Status = STATUS_INSUFFICIENT_RESOURCES; + *PciRoutingTable = ExAllocatePoolWithTag(PagedPool, + NumberOfBytes, + PCI_POOL_TAG); + if (!*PciRoutingTable) break; + + /* Copy the registry data */ + RtlCopyMemory(*PciRoutingTable, + &Package->Table, + NumberOfBytes - sizeof(CM_FULL_RESOURCE_DESCRIPTOR)); + Status = STATUS_SUCCESS; + } while (FALSE); + + /* Close any opened keys, free temporary allocations, and return status */ + if (Package) ExFreePoolWithTag(Package, 0); + if (ValueInfo) ExFreePoolWithTag(ValueInfo, 0); + if (KeyInfo) ExFreePoolWithTag(KeyInfo, 0); + if (FullInfo) ExFreePoolWithTag(FullInfo, 0); + if (KeyHandle) ZwClose(KeyHandle); + return Status; +} + +NTSTATUS +NTAPI +PciBuildHackTable(IN HANDLE KeyHandle) +{ + PKEY_FULL_INFORMATION FullInfo; + ULONG i, HackCount; + PKEY_VALUE_FULL_INFORMATION ValueInfo; + PPCI_HACK_ENTRY Entry; + NTSTATUS Status; + ULONG NameLength, ResultLength; + ULONGLONG HackFlags; + + /* So we know what to free at the end of the body */ + FullInfo = NULL; + ValueInfo = NULL; + do + { + /* Query the size required for full key information */ + Status = ZwQueryKey(KeyHandle, + KeyFullInformation, + NULL, + 0, + &ResultLength); + if (Status != STATUS_BUFFER_TOO_SMALL) break; + + /* Allocate the space required to hold the full key information */ + Status = STATUS_INSUFFICIENT_RESOURCES; + ASSERT(ResultLength > 0); + FullInfo = ExAllocatePoolWithTag(PagedPool, ResultLength, PCI_POOL_TAG); + if (!FullInfo) break; + + /* Go ahead and query the key information */ + Status = ZwQueryKey(KeyHandle, + KeyFullInformation, + FullInfo, + ResultLength, + &ResultLength); + if (!NT_SUCCESS(Status)) break; + + /* The only piece of information that's needed is the count of values */ + HackCount = FullInfo->Values; + + /* Free the structure now */ + ExFreePoolWithTag(FullInfo, 0); + FullInfo = NULL; + + /* Allocate the hack table, now that the number of entries is known */ + Status = STATUS_INSUFFICIENT_RESOURCES; + ResultLength = sizeof(PCI_HACK_ENTRY) * HackCount; + PciHackTable = ExAllocatePoolWithTag(NonPagedPool, + ResultLength + + sizeof(PCI_HACK_ENTRY), + PCI_POOL_TAG); + if (!PciHackTable) break; + + /* Allocate the space needed to hold the full value information */ + ValueInfo = ExAllocatePoolWithTag(NonPagedPool, + sizeof(KEY_VALUE_FULL_INFORMATION) + + PCI_HACK_ENTRY_FULL_SIZE, + PCI_POOL_TAG); + if (!PciHackTable) break; + + /* Loop each value in the registry */ + Entry = &PciHackTable[0]; + for (i = 0; i < HackCount; i++) + { + /* Get the entry for this value */ + Entry = &PciHackTable[i]; + + /* Query the value in the key */ + Status = ZwEnumerateValueKey(KeyHandle, + i, + KeyValueFullInformation, + ValueInfo, + sizeof(KEY_VALUE_FULL_INFORMATION) + + PCI_HACK_ENTRY_FULL_SIZE, + &ResultLength); + if (!NT_SUCCESS(Status)) + { + /* Check why the call failed */ + if ((Status != STATUS_BUFFER_OVERFLOW) && + (Status != STATUS_BUFFER_TOO_SMALL)) + { + /* The call failed due to an unknown error, bail out */ + break; + } + + /* The data seems to mismatch, try the next key in the list */ + continue; + } + + /* Check if the value data matches what's expected */ + if ((ValueInfo->Type != REG_BINARY) || + (ValueInfo->DataLength != sizeof(ULONGLONG))) + { + /* It doesn't, try the next key in the list */ + continue; + } + + /* Read the actual hack flags */ + HackFlags = *(PULONGLONG)((ULONG_PTR)ValueInfo + + ValueInfo->DataOffset); + + /* Check what kind of errata entry this is, based on the name */ + NameLength = ValueInfo->NameLength; + if ((NameLength != PCI_HACK_ENTRY_SIZE) && + (NameLength != PCI_HACK_ENTRY_REV_SIZE) && + (NameLength != PCI_HACK_ENTRY_SUBSYS_SIZE) && + (NameLength != PCI_HACK_ENTRY_FULL_SIZE)) + { + DPRINT1("Skipping hack entry with invalid length name\n"); + } + + /* Initialize the entry */ + RtlZeroMemory(Entry, sizeof(PCI_HACK_ENTRY)); + + /* Get the vendor and device data */ + if (!(PciStringToUSHORT(ValueInfo->Name, &Entry->VendorID)) || + !(PciStringToUSHORT(&ValueInfo->Name[4], &Entry->DeviceID))) + { + /* This failed, try the next entry */ + continue; + } + + /* Check if the entry contains subsystem information */ + if ((NameLength == PCI_HACK_ENTRY_SUBSYS_SIZE) || + (NameLength == PCI_HACK_ENTRY_FULL_SIZE)) + { + /* Get the data */ + if (!(PciStringToUSHORT(&ValueInfo->Name[8], + &Entry->SubVendorID)) || + !(PciStringToUSHORT(&ValueInfo->Name[12], + &Entry->SubSystemID))) + { + /* This failed, try the next entry */ + continue; + } + + /* Save the fact this entry has finer controls */ + Entry->Flags |= PCI_HACK_HAS_SUBSYSTEM_INFO; + } + + /* Check if the entry contains revision information */ + if ((NameLength == PCI_HACK_ENTRY_REV_SIZE) || + (NameLength == PCI_HACK_ENTRY_FULL_SIZE)) + { + /* Get the data */ + if (!PciStringToUSHORT(&ValueInfo->Name[16], + &Entry->RevisionID)) + { + /* This failed, try the next entry */ + continue; + } + + /* Save the fact this entry has finer controls */ + Entry->Flags |= PCI_HACK_HAS_REVISION_INFO; + } + + /* Only the last entry should have this set */ + ASSERT(Entry->VendorID != PCI_INVALID_VENDORID); + + /* Save the actual hack flags */ + Entry->HackFlags = HackFlags; + + /* Print out for the debugger's sake */ + DPRINT1("Adding Hack entry for Vendor:0x%04x Device:0x%04x ", + Entry->VendorID, Entry->DeviceID); + if (Entry->Flags & PCI_HACK_HAS_SUBSYSTEM_INFO) + DPRINT1("SybSys:0x%04x SubVendor:0x%04x ", + Entry->SubSystemID, Entry->SubVendorID); + if (Entry->Flags & PCI_HACK_HAS_REVISION_INFO) + DPRINT1("Revision:0x%02x", Entry->RevisionID); + DPRINT1(" = 0x%I64x\n", Entry->HackFlags); + } + + /* Bail out in case of failure */ + if (!NT_SUCCESS(Status)) break; + + /* Terminate the table with an invalid entry */ + ASSERT(Entry < (PciHackTable + HackCount + 1)); + Entry->VendorID = PCI_INVALID_VENDORID; + + /* Success path, free the temporary registry data */ + ExFreePoolWithTag(ValueInfo, 0); + return STATUS_SUCCESS; + } while (TRUE); + + /* Failure path, free temporary allocations and return failure code */ + ASSERT(!NT_SUCCESS(Status)); + if (FullInfo) ExFreePool(FullInfo); + if (ValueInfo) ExFreePool(ValueInfo); + if (PciHackTable) ExFreePool(PciHackTable); + return Status; +} + +NTSTATUS +NTAPI +PciGetDebugPorts(IN HANDLE DebugKey) +{ + /* This function is not yet implemented */ + UNIMPLEMENTED; + while (TRUE); + return STATUS_SUCCESS; +} + +VOID +NTAPI +PciDriverUnload(IN PDRIVER_OBJECT DriverObject) +{ + /* This function is not yet implemented */ + DPRINT1("PCI: Unload\n"); + UNIMPLEMENTED; + while (TRUE); +} NTSTATUS NTAPI DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { + HANDLE KeyHandle, ParametersKey, DebugKey, ControlSetKey; + BOOLEAN Result; + OBJECT_ATTRIBUTES ObjectAttributes; + ULONG ResultLength; + PULONG Value; + PWCHAR StartOptions; + UNICODE_STRING OptionString, PciLockString; + NTSTATUS Status; DPRINT1("PCI: DriverEntry!\n"); - - /* FIXME: TODO */ - return STATUS_NOT_SUPPORTED; + do + { + /* Remember our object so we can get it to it later */ + PciDriverObject = DriverObject; + + /* Setup the IRP dispatcher */ + DriverObject->MajorFunction[IRP_MJ_POWER] = PciDispatchIrp; + DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = PciDispatchIrp; + DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = PciDispatchIrp; + DriverObject->MajorFunction[IRP_MJ_PNP] = PciDispatchIrp; + DriverObject->DriverUnload = PciDriverUnload; + + /* This is how we'll detect a new PCI bus */ + DriverObject->DriverExtension->AddDevice = PciAddDevice; + + /* Open the PCI key */ + InitializeObjectAttributes(&ObjectAttributes, + RegistryPath, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = ZwOpenKey(&KeyHandle, KEY_QUERY_VALUE, &ObjectAttributes); + if (!NT_SUCCESS(Status)) break; + + /* Open the Parameters subkey */ + Result = PciOpenKey(L"Parameters", + KeyHandle, + KEY_QUERY_VALUE, + &ParametersKey, + &Status); + if (!Result) break; + + /* Build the list of all known PCI erratas */ + Status = PciBuildHackTable(ParametersKey); + if (!NT_SUCCESS(Status)) break; + + /* Open the debug key, if it exists */ + Result = PciOpenKey(L"Debug", + KeyHandle, + KEY_QUERY_VALUE, + &DebugKey, + &Status); + if (Result) + { + /* There are PCI debug devices, go discover them */ + Status = PciGetDebugPorts(DebugKey); + if (!NT_SUCCESS(Status)) break; + } + + /* Initialize the synchronization locks */ + KeInitializeEvent(&PciGlobalLock, SynchronizationEvent, TRUE); + KeInitializeEvent(&PciBusLock, SynchronizationEvent, TRUE); + KeInitializeEvent(&PciLegacyDescriptionLock, SynchronizationEvent, TRUE); + + /* Open the control set key */ + Status = PciOpenKey(L"\\Registry\\Machine\\System\\CurrentControlSet", + NULL, + KEY_QUERY_VALUE, + &ControlSetKey, + &Status); + if (!NT_SUCCESS(Status)) break; + + /* Read the command line */ + Status = PciGetRegistryValue(L"SystemStartOptions", + L"Control", + ControlSetKey, + REG_SZ, + (PVOID*)&StartOptions, + &ResultLength); + if (NT_SUCCESS(Status)) + { + /* Initialize the command-line as a string */ + OptionString.Buffer = StartOptions; + OptionString.MaximumLength = OptionString.Length = ResultLength; + + /* Check if the command-line has the PCILOCK argument */ + RtlInitUnicodeString(&PciLockString, L"PCILOCK"); + if (PciUnicodeStringStrStr(&OptionString, &PciLockString, TRUE)) + { + /* The PCI Bus driver will keep the BIOS-assigned resources */ + PciLockDeviceResources = TRUE; + } + + /* This data isn't needed anymore */ + ExFreePoolWithTag(StartOptions, 0); + } + + /* The PCILOCK feature can also be enabled per-system in the registry */ + Status = PciGetRegistryValue(L"PCILock", + L"Control\\BiosInfo\\PCI", + ControlSetKey, + REG_DWORD, + (PVOID*)&Value, + &ResultLength); + if (NT_SUCCESS(Status)) + { + /* Read the value it's been set to. This overrides /PCILOCK */ + if (ResultLength == sizeof(ULONG)) PciLockDeviceResources = *Value; + ExFreePoolWithTag(Value, 0); + } + + /* The system can have global PCI erratas in the registry */ + Status = PciGetRegistryValue(L"HackFlags", + L"Control\\PnP\\PCI", + ControlSetKey, + REG_DWORD, + (PVOID*)&Value, + &ResultLength); + if (NT_SUCCESS(Status)) + { + /* Read them in */ + if (ResultLength == sizeof(ULONG)) PciSystemWideHackFlags = *Value; + ExFreePoolWithTag(Value, 0); + } + + /* Check if the system should allow native ATA support */ + Status = PciGetRegistryValue(L"EnableNativeModeATA", + L"Control\\PnP\\PCI", + ControlSetKey, + REG_DWORD, + (PVOID*)&Value, + &ResultLength); + if (NT_SUCCESS(Status)) + { + /* This key is typically set by drivers, but users can force it */ + if (ResultLength == sizeof(ULONG)) PciEnableNativeModeATA = *Value; + ExFreePoolWithTag(Value, 0); + } + + /* Build the range lists for all the excluded resource areas */ + Status = PciBuildDefaultExclusionLists(); + if (!NT_SUCCESS(Status)) break; + + /* Read the PCI IRQ Routing Table that the loader put in the registry */ + PciGetIrqRoutingTableFromRegistry(&PciIrqRoutingTable); + + /* Take over the HAL's default PCI Bus Handler routines */ + PciHookHal(); + + /* Initialize verification of PCI BIOS and devices, if requested */ + PciVerifierInit(DriverObject); + + /* Check if this is a Datacenter SKU, which impacts IRQ alignment */ + PciRunningDatacenter = PciIsDatacenter(); + if (PciRunningDatacenter) DPRINT1("PCI running on datacenter build\n"); + + /* Check if the system has an ACPI Hardware Watchdog Timer */ + WdTable = PciGetAcpiTable(WDRT_SIGNATURE); + } while (FALSE); + + /* Close all opened keys, return driver status to PnP Manager */ + if (KeyHandle) ZwClose(KeyHandle); + if (ControlSetKey) ZwClose(ControlSetKey); + if (ParametersKey) ZwClose(ParametersKey); + if (DebugKey) ZwClose(DebugKey); + return Status; } /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/pci.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci.h?rev…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci.h [iso-8859-1] Mon Jun 28 05:23:31 2010 @@ -6,6 +6,134 @@ * PROGRAMMERS: ReactOS Portable Systems Group */ -#include <ntddk.h> +#include <initguid.h> +#include <ntifs.h> +#include <ntagp.h> +#include <wdmguid.h> +#include <wchar.h> +#include <acpiioct.h> +#include <drivers/pci/pci.h> +#include <drivers/acpi/acpi.h> +#include "halfuncs.h" +#include "rtlfuncs.h" +#include "vffuncs.h" + +// +// Tag used in all pool allocations (Pci Bus) +// +#define PCI_POOL_TAG 'BicP' + +// +// PCI Hack Entry Name Lengths +// +#define PCI_HACK_ENTRY_SIZE sizeof(L"VVVVdddd") // 16 +#define PCI_HACK_ENTRY_REV_SIZE sizeof(L"VVVVddddRR") // 20 +#define PCI_HACK_ENTRY_SUBSYS_SIZE sizeof(L"VVVVddddssssIIII") // 32 +#define PCI_HACK_ENTRY_FULL_SIZE sizeof(L"VVVVddddssssIIIIRR") // 36 + +// +// PCI Hack Entry Information +// +#define PCI_HACK_HAS_REVISION_INFO 0x01 +#define PCI_HACK_HAS_SUBSYSTEM_INFO 0x02 +typedef struct _PCI_HACK_ENTRY +{ + USHORT VendorID; + USHORT DeviceID; + USHORT SubVendorID; + USHORT SubSystemID; + ULONGLONG HackFlags; + USHORT RevisionID; + UCHAR Flags; +} PCI_HACK_ENTRY, *PPCI_HACK_ENTRY; + +// +// IRP Dispatch Routines +// +NTSTATUS +NTAPI +PciDispatchIrp( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp +); + +// +// Bus FDO Routines +// +NTSTATUS +NTAPI +PciAddDevice( + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT PhysicalDeviceObject +); + +// +// HAL Callback/Hook Routines +// +VOID +NTAPI +PciHookHal( + VOID +); + +// +// PCI Verifier Routines +// +VOID +NTAPI +PciVerifierInit( + IN PDRIVER_OBJECT DriverObject +); + +// +// Utility Routines +// +BOOLEAN +NTAPI +PciStringToUSHORT( + IN PWCHAR String, + OUT PUSHORT Value +); + +BOOLEAN +NTAPI +PciIsDatacenter( + VOID +); + +NTSTATUS +NTAPI +PciBuildDefaultExclusionLists( + VOID +); + +BOOLEAN +NTAPI +PciUnicodeStringStrStr( + IN PUNICODE_STRING InputString, + IN PCUNICODE_STRING EqualString, + IN BOOLEAN CaseInSensitive +); + +BOOLEAN +NTAPI +PciOpenKey( + IN PWCHAR KeyName, + IN HANDLE RootKey, + IN ACCESS_MASK DesiredAccess, + OUT PHANDLE KeyHandle, + OUT PNTSTATUS KeyStatus +); + +NTSTATUS +NTAPI +PciGetRegistryValue( + IN PWCHAR ValueName, + IN PWCHAR KeyName, + IN HANDLE RootHandle, + IN ULONG Type, + OUT PVOID *OutputBuffer, + OUT PULONG OutputLength +); /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/pcivrify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pcivrify.…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pcivrify.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pcivrify.c [iso-8859-1] Mon Jun 28 05:23:31 2010 @@ -14,6 +14,41 @@ /* GLOBALS ********************************************************************/ +BOOLEAN PciVerifierRegistered; +PVOID PciVerifierNotificationHandle; + /* FUNCTIONS ******************************************************************/ +NTSTATUS +NTAPI +PciVerifierProfileChangeCallback(IN PVOID NotificationStructure, + IN PVOID Context) +{ + /* This function is not yet implemented */ + UNIMPLEMENTED; + while (TRUE); + return STATUS_SUCCESS; +} + +VOID +NTAPI +PciVerifierInit(IN PDRIVER_OBJECT DriverObject) +{ + NTSTATUS Status; + + /* Check if the kernel driver verifier is enabled */ + if (VfIsVerificationEnabled(VFOBJTYPE_SYSTEM_BIOS, NULL)) + { + /* Register a notification for changes, to keep track of the PCI tree */ + Status = IoRegisterPlugPlayNotification(EventCategoryHardwareProfileChange, + 0, + NULL, + DriverObject, + PciVerifierProfileChangeCallback, + NULL, + &PciVerifierNotificationHandle); + if (NT_SUCCESS(Status)) PciVerifierRegistered = TRUE; + } +} + /* EOF */ Modified: trunk/reactos/drivers/bus/pcix/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/utils.c?r…
============================================================================== --- trunk/reactos/drivers/bus/pcix/utils.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/utils.c [iso-8859-1] Mon Jun 28 05:23:31 2010 @@ -14,6 +14,323 @@ /* GLOBALS ********************************************************************/ +RTL_RANGE_LIST PciIsaBitExclusionList; +RTL_RANGE_LIST PciVgaAndIsaBitExclusionList; + /* FUNCTIONS ******************************************************************/ +BOOLEAN +NTAPI +PciUnicodeStringStrStr(IN PUNICODE_STRING InputString, + IN PCUNICODE_STRING EqualString, + IN BOOLEAN CaseInSensitive) +{ + UNICODE_STRING PartialString; + LONG EqualChars, TotalChars; + + /* Build a partial string with the smaller substring */ + PartialString.Length = EqualString->Length; + PartialString.MaximumLength = InputString->MaximumLength;; + PartialString.Buffer = InputString->Buffer; + + /* Check how many characters that need comparing */ + EqualChars = 0; + TotalChars = (InputString->Length - EqualString->Length) / sizeof(WCHAR); + + /* If the substring is bigger, just fail immediately */ + if (TotalChars < 0) return FALSE; + + /* Keep checking each character */ + while (!RtlEqualUnicodeString(EqualString, &PartialString, CaseInSensitive)) + { + /* Continue checking until all the required characters are equal */ + PartialString.Buffer++; + PartialString.MaximumLength -= sizeof(WCHAR); + if (++EqualChars > TotalChars) return FALSE; + } + + /* The string is equal */ + return TRUE; +} + +BOOLEAN +NTAPI +PciStringToUSHORT(IN PWCHAR String, + OUT PUSHORT Value) +{ + USHORT Short; + ULONG Low, High, Length; + WCHAR Char; + + /* Initialize everything to zero */ + Short = 0; + Length = 0; + while (TRUE) + { + /* Get the character and set the high byte based on the previous one */ + Char = *String++; + High = 16 * Short; + + /* Check for numbers */ + if ( Char >= '0' && Char <= '9' ) + { + /* Convert them to a byte */ + Low = Char - '0'; + } + else if ( Char >= 'A' && Char <= 'F' ) + { + /* Convert upper-case hex letters into a byte */ + Low = Char - '7'; + } + else if ( Char >= 'a' && Char <= 'f' ) + { + /* Convert lower-case hex letters into a byte */ + Low = Char - 'W'; + } + else + { + /* Invalid string, fail the conversion */ + return FALSE; + } + + /* Combine the high and low byte */ + Short = High | Low; + + /* If 4 letters have been reached, the 16-bit integer should exist */ + if (++Length >= 4) + { + /* Return it to the caller */ + *Value = Short; + return TRUE; + } + } +} + +BOOLEAN +NTAPI +PciIsSuiteVersion(IN USHORT SuiteMask) +{ + ULONGLONG Mask = 0; + RTL_OSVERSIONINFOEXW VersionInfo; + + /* Initialize the version information */ + RtlZeroMemory(&VersionInfo, sizeof(RTL_OSVERSIONINFOEXW)); + VersionInfo.dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOEXW); + VersionInfo.wSuiteMask = SuiteMask; + + /* Set the comparison mask and return if the passed suite mask matches */ + VER_SET_CONDITION(Mask, VER_SUITENAME, VER_AND); + return NT_SUCCESS(RtlVerifyVersionInfo(&VersionInfo, VER_SUITENAME, Mask)); +} + +BOOLEAN +NTAPI +PciIsDatacenter(VOID) +{ + BOOLEAN Result; + PVOID Value; + ULONG ResultLength; + NTSTATUS Status; + + /* Assume this isn't Datacenter */ + Result = FALSE; + + /* First, try opening the setup key */ + Status = PciGetRegistryValue(L"", + L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Services\\setupdd", + 0, + REG_BINARY, + &Value, + &ResultLength); + if (!NT_SUCCESS(Status)) + { + /* This is not an in-progress Setup boot, so query the suite version */ + Result = PciIsSuiteVersion(VER_SUITE_DATACENTER); + } + else + { + /* This scenario shouldn't happen yet, since SetupDD isn't used */ + UNIMPLEMENTED; + while (TRUE); + } + + /* Return if this is Datacenter or not */ + return Result; +} + +BOOLEAN +NTAPI +PciOpenKey(IN PWCHAR KeyName, + IN HANDLE RootKey, + IN ACCESS_MASK DesiredAccess, + OUT PHANDLE KeyHandle, + OUT PNTSTATUS KeyStatus) +{ + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyString; + PAGED_CODE(); + + /* Initialize the object attributes */ + RtlInitUnicodeString(&KeyString, KeyName); + InitializeObjectAttributes(&ObjectAttributes, + &KeyString, + OBJ_CASE_INSENSITIVE, + RootKey, + NULL); + + /* Open the key, returning a boolean, and the status, if requested */ + Status = ZwOpenKey(KeyHandle, DesiredAccess, &ObjectAttributes); + if (KeyStatus) *KeyStatus = Status; + return NT_SUCCESS(Status); +} + +NTSTATUS +NTAPI +PciGetRegistryValue(IN PWCHAR ValueName, + IN PWCHAR KeyName, + IN HANDLE RootHandle, + IN ULONG Type, + OUT PVOID *OutputBuffer, + OUT PULONG OutputLength) +{ + NTSTATUS Status; + PKEY_VALUE_PARTIAL_INFORMATION PartialInfo; + ULONG NeededLength, ActualLength; + UNICODE_STRING ValueString; + HANDLE KeyHandle; + BOOLEAN Result; + + /* So we know what to free at the end of the body */ + PartialInfo = NULL; + KeyHandle = NULL; + do + { + /* Open the key by name, rooted off the handle passed */ + Result = PciOpenKey(KeyName, + RootHandle, + KEY_QUERY_VALUE, + &KeyHandle, + &Status); + if (!Result) break; + + /* Query for the size that's needed for the value that was passed in */ + RtlInitUnicodeString(&ValueString, ValueName); + Status = ZwQueryValueKey(KeyHandle, + &ValueString, + KeyValuePartialInformation, + NULL, + 0, + &NeededLength); + ASSERT(!NT_SUCCESS(Status)); + if (Status != STATUS_BUFFER_TOO_SMALL) break; + + /* Allocate an appropriate buffer for the size that was returned */ + ASSERT(NeededLength != 0); + Status = STATUS_INSUFFICIENT_RESOURCES; + PartialInfo = ExAllocatePoolWithTag(PagedPool, + NeededLength, + PCI_POOL_TAG); + if (!PartialInfo) break; + + /* Query the actual value information now that the size is known */ + Status = ZwQueryValueKey(KeyHandle, + &ValueString, + KeyValuePartialInformation, + PartialInfo, + NeededLength, + &ActualLength); + if (!NT_SUCCESS(Status)) break; + + /* Make sure it's of the type that the caller expects */ + Status = STATUS_INVALID_PARAMETER; + if (PartialInfo->Type != Type) break; + + /* Subtract the registry-specific header, to get the data size */ + ASSERT(NeededLength == ActualLength); + NeededLength -= sizeof(KEY_VALUE_PARTIAL_INFORMATION); + + /* Allocate a buffer to hold the data and return it to the caller */ + Status = STATUS_INSUFFICIENT_RESOURCES; + *OutputBuffer = ExAllocatePoolWithTag(PagedPool, + NeededLength, + PCI_POOL_TAG); + if (!*OutputBuffer) break; + + /* Copy the data into the buffer and return its length to the caller */ + RtlCopyMemory(*OutputBuffer, PartialInfo->Data, NeededLength); + if (OutputLength) *OutputLength = NeededLength; + } while (0); + + /* Close any opened keys and free temporary allocations */ + if (KeyHandle) ZwClose(KeyHandle); + if (PartialInfo) ExFreePoolWithTag(PartialInfo, 0); + return Status; +} + +NTSTATUS +NTAPI +PciBuildDefaultExclusionLists(VOID) +{ + ULONG Start; + NTSTATUS Status; + ASSERT(PciIsaBitExclusionList.Count == 0); + ASSERT(PciVgaAndIsaBitExclusionList.Count == 0); + + /* Initialize the range lists */ + RtlInitializeRangeList(&PciIsaBitExclusionList); + RtlInitializeRangeList(&PciVgaAndIsaBitExclusionList); + + /* Loop x86 I/O ranges */ + for (Start = 0x100; Start <= 0xFEFF; Start += 0x400) + { + /* Add the ISA I/O ranges */ + Status = RtlAddRange(&PciIsaBitExclusionList, + Start, + Start + 0x2FF, + 0, + RTL_RANGE_LIST_ADD_IF_CONFLICT, + NULL, + NULL); + if (!NT_SUCCESS(Status)) break; + + /* Add the ISA I/O ranges */ + Status = RtlAddRange(&PciVgaAndIsaBitExclusionList, + Start, + Start + 0x2AF, + 0, + RTL_RANGE_LIST_ADD_IF_CONFLICT, + NULL, + NULL); + if (!NT_SUCCESS(Status)) break; + + /* Add the VGA I/O range for Monochrome Video */ + Status = RtlAddRange(&PciVgaAndIsaBitExclusionList, + Start + 0x2BC, + Start + 0x2BF, + 0, + RTL_RANGE_LIST_ADD_IF_CONFLICT, + NULL, + NULL); + if (!NT_SUCCESS(Status)) break; + + /* Add the VGA I/O range for certain CGA adapters */ + Status = RtlAddRange(&PciVgaAndIsaBitExclusionList, + Start + 0x2E0, + Start + 0x2FF, + 0, + RTL_RANGE_LIST_ADD_IF_CONFLICT, + NULL, + NULL); + if (!NT_SUCCESS(Status)) break; + + /* Success, ranges added done */ + return STATUS_SUCCESS; + }; + + RtlFreeRangeList(&PciIsaBitExclusionList); + RtlFreeRangeList(&PciVgaAndIsaBitExclusionList); + return Status; +} + /* EOF */
14 years, 5 months
1
0
0
0
[sir_richard] 47893: [NDK]: Add some missing RTL Range Functions needed by eVb.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Mon Jun 28 04:26:18 2010 New Revision: 47893 URL:
http://svn.reactos.org/svn/reactos?rev=47893&view=rev
Log: [NDK]: Add some missing RTL Range Functions needed by eVb. Modified: trunk/reactos/include/ndk/rtlfuncs.h Modified: trunk/reactos/include/ndk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
============================================================================== --- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Mon Jun 28 04:26:18 2010 @@ -2631,7 +2631,29 @@ NTSYSAPI VOID NTAPI -RtlFreeRangeList(IN PRTL_RANGE_LIST RangeList); +RtlInitializeRangeList( + IN OUT PRTL_RANGE_LIST RangeList +); + +NTSYSAPI +VOID +NTAPI +RtlFreeRangeList( + IN PRTL_RANGE_LIST RangeList +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlAddRange( + IN OUT PRTL_RANGE_LIST RangeList, + IN ULONGLONG Start, + IN ULONGLONG End, + IN UCHAR Attributes, + IN ULONG Flags, + IN PVOID UserData OPTIONAL, + IN PVOID Owner OPTIONAL +); // // Debug Functions
14 years, 5 months
1
0
0
0
[sir_richard] 47892: [ACPI]: Share ACPI table structures and NT-specific registry data in a shared, internal ACPI header, instead of HAL's internal headers, because FreeLDR, the kernel's PnP Manager, the PCI Bus Driver and the ACPI Driver all need access to these types as well.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Mon Jun 28 04:25:38 2010 New Revision: 47892 URL:
http://svn.reactos.org/svn/reactos?rev=47892&view=rev
Log: [ACPI]: Share ACPI table structures and NT-specific registry data in a shared, internal ACPI header, instead of HAL's internal headers, because FreeLDR, the kernel's PnP Manager, the PCI Bus Driver and the ACPI Driver all need access to these types as well. Added: trunk/reactos/include/reactos/drivers/acpi/ trunk/reactos/include/reactos/drivers/acpi/acpi.h (with props) Modified: trunk/reactos/hal/halx86/include/hal.h trunk/reactos/hal/halx86/include/halacpi.h Modified: trunk/reactos/hal/halx86/include/hal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/hal.h?r…
============================================================================== --- trunk/reactos/hal/halx86/include/hal.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/include/hal.h [iso-8859-1] Mon Jun 28 04:25:38 2010 @@ -29,8 +29,9 @@ #include <arc/arc.h> #include <ntndk.h> -/* Internal shared PCI header */ +/* Internal shared PCI and ACPI header */ #include <drivers/pci/pci.h> +#include <drivers/acpi/acpi.h> /* Internal kernel headers */ #define KeGetCurrentThread _KeGetCurrentThread Modified: trunk/reactos/hal/halx86/include/halacpi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halacpi…
============================================================================== --- trunk/reactos/hal/halx86/include/halacpi.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/include/halacpi.h [iso-8859-1] Mon Jun 28 04:25:38 2010 @@ -1,201 +1,4 @@ #pragma once - -// -// Should be shared with FreeLDR -// -typedef struct _ACPI_E820_ENTRY -{ - PHYSICAL_ADDRESS Base; - LARGE_INTEGER Length; - ULONGLONG Type; -} ACPI_E820_ENTRY, *PACPI_E820_ENTRY; - -typedef struct _ACPI_BIOS_MULTI_NODE -{ - PHYSICAL_ADDRESS RsdtAddress; - ULONGLONG Count; - ACPI_E820_ENTRY E820Entry[1]; -} ACPI_BIOS_MULTI_NODE, *PACPI_BIOS_MULTI_NODE; - -// -// ACPI Signatures -// -#define RSDP_SIGNATURE 0x2052545020445352 // "RSD PTR " -#define FACS_SIGNATURE 0x53434146 // "FACS" -#define FADT_SIGNATURE 0x50434146 // "FACP" -#define RSDT_SIGNATURE 0x54445352 // "RSDT" -#define APIC_SIGNATURE 0x43495041 // "APIC" -#define DSDT_SIGNATURE 0x54445344 // "DSDT" -#define SSDT_SIGNATURE 0x54445353 // "SSDT" -#define PSDT_SIGNATURE 0x54445350 // "PSDT" -#define SBST_SIGNATURE 0x54534253 // "SBST" -#define DBGP_SIGNATURE 0x50474244 // "DBGP" -#define XSDT_SIGNATURE 'TDSX' -#define BOOT_SIGNATURE 'TOOB' -#define SRAT_SIGNATURE 'TARS' - -// -// FADT Flags -// -#define ACPI_TMR_VAL_EXT 0x100 - -// -// ACPI Generic Register Address -// -typedef struct _GEN_ADDR -{ - UCHAR AddressSpaceID; - UCHAR BitWidth; - UCHAR BitOffset; - UCHAR Reserved; - PHYSICAL_ADDRESS Address; -} GEN_ADDR, *PGEN_ADDR; - -// -// ACPI BIOS Structures (packed) -// -#include <pshpack1.h> -typedef struct _RSDP -{ - ULONGLONG Signature; - UCHAR Checksum; - UCHAR OEMID[6]; - UCHAR Reserved[1]; - ULONG RsdtAddress; -} RSDP; -typedef RSDP *PRSDP; - -typedef struct _DESCRIPTION_HEADER -{ - ULONG Signature; - ULONG Length; - UCHAR Revision; - UCHAR Checksum; - UCHAR OEMID[6]; - UCHAR OEMTableID[8]; - ULONG OEMRevision; - UCHAR CreatorID[4]; - ULONG CreatorRev; -} DESCRIPTION_HEADER; -typedef DESCRIPTION_HEADER *PDESCRIPTION_HEADER; - -typedef struct _FACS -{ - ULONG Signature; - ULONG Length; - ULONG HardwareSignature; - ULONG pFirmwareWakingVector; - ULONG GlobalLock; - ULONG Flags; - PHYSICAL_ADDRESS x_FirmwareWakingVector; - UCHAR version; - UCHAR Reserved[32]; -} FACS; -typedef FACS *PFACS; - -typedef struct _FADT -{ - DESCRIPTION_HEADER Header; - ULONG facs; - ULONG dsdt; - UCHAR int_model; - UCHAR pm_profile; - USHORT sci_int_vector; - ULONG smi_cmd_io_port; - UCHAR acpi_on_value; - UCHAR acpi_off_value; - UCHAR s4bios_req; - UCHAR pstate_control; - ULONG pm1a_evt_blk_io_port; - ULONG pm1b_evt_blk_io_port; - ULONG pm1a_ctrl_blk_io_port; - ULONG pm1b_ctrl_blk_io_port; - ULONG pm2_ctrl_blk_io_port; - ULONG pm_tmr_blk_io_port; - ULONG gp0_blk_io_port; - ULONG gp1_blk_io_port; - UCHAR pm1_evt_len; - UCHAR pm1_ctrl_len; - UCHAR pm2_ctrl_len; - UCHAR pm_tmr_len; - UCHAR gp0_blk_len; - UCHAR gp1_blk_len; - UCHAR gp1_base; - UCHAR cstate_control; - USHORT lvl2_latency; - USHORT lvl3_latency; - USHORT flush_size; - USHORT flush_stride; - UCHAR duty_offset; - UCHAR duty_width; - UCHAR day_alarm_index; - UCHAR month_alarm_index; - UCHAR century_alarm_index; - USHORT boot_arch; - UCHAR reserved3[1]; - ULONG flags; - GEN_ADDR reset_reg; - UCHAR reset_val; - UCHAR reserved4[3]; - PHYSICAL_ADDRESS x_firmware_ctrl; - PHYSICAL_ADDRESS x_dsdt; - GEN_ADDR x_pm1a_evt_blk; - GEN_ADDR x_pm1b_evt_blk; - GEN_ADDR x_pm1a_ctrl_blk; - GEN_ADDR x_pm1b_ctrl_blk; - GEN_ADDR x_pm2_ctrl_blk; - GEN_ADDR x_pm_tmr_blk; - GEN_ADDR x_gp0_blk; - GEN_ADDR x_gp1_blk; -} FADT; -typedef FADT *PFADT; - -typedef struct _DSDT -{ - DESCRIPTION_HEADER Header; - UCHAR DiffDefBlock[ANYSIZE_ARRAY]; -} DSDT; -typedef DSDT *PDSDT; - -typedef struct _RSDT -{ - DESCRIPTION_HEADER Header; - ULONG Tables[ANYSIZE_ARRAY]; -} RSDT; -typedef RSDT *PRSDT; - -typedef struct _XSDT -{ - DESCRIPTION_HEADER Header; - PHYSICAL_ADDRESS Tables[ANYSIZE_ARRAY]; -} XSDT; -typedef XSDT *PXSDT; -#include <poppack.h> - -// -// Microsoft-specific (pretty much) ACPI Tables, normal MS ABI packing -// -typedef struct _DEBUG_PORT_TABLE -{ - DESCRIPTION_HEADER Header; - UCHAR InterfaceType; - UCHAR Reserved[3]; - GEN_ADDR BaseAddress; -} DEBUG_PORT_TABLE, *PDEBUG_PORT_TABLE; - -typedef struct _BOOT_TABLE -{ - DESCRIPTION_HEADER Header; - UCHAR CMOSIndex; - UCHAR Reserved[3]; -} BOOT_TABLE, *PBOOT_TABLE; - -typedef struct _ACPI_SRAT -{ - DESCRIPTION_HEADER Header; - UCHAR TableRevision; - ULONG Reserved[2]; -} ACPI_SRAT, *PACPI_SRAT; // // Internal HAL structure Added: trunk/reactos/include/reactos/drivers/acpi/acpi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/ac…
============================================================================== --- trunk/reactos/include/reactos/drivers/acpi/acpi.h (added) +++ trunk/reactos/include/reactos/drivers/acpi/acpi.h [iso-8859-1] Mon Jun 28 04:25:38 2010 @@ -1,0 +1,222 @@ +/* + * PROJECT: ReactOS PCI Bus Driver + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: include/reactos/drivers/acpi/acpi.h + * PURPOSE: ACPI Tables and NT Registry Data + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +// +// ACPI BIOS Registry Component Configuration Data +// +typedef struct _ACPI_E820_ENTRY +{ + PHYSICAL_ADDRESS Base; + LARGE_INTEGER Length; + ULONGLONG Type; +} ACPI_E820_ENTRY, *PACPI_E820_ENTRY; + +typedef struct _ACPI_BIOS_MULTI_NODE +{ + PHYSICAL_ADDRESS RsdtAddress; + ULONGLONG Count; + ACPI_E820_ENTRY E820Entry[1]; +} ACPI_BIOS_MULTI_NODE, *PACPI_BIOS_MULTI_NODE; + +// +// ACPI Signatures +// +#define RSDP_SIGNATURE 0x2052545020445352 // "RSD PTR " +#define FACS_SIGNATURE 0x53434146 // "FACS" +#define FADT_SIGNATURE 0x50434146 // "FACP" +#define RSDT_SIGNATURE 0x54445352 // "RSDT" +#define APIC_SIGNATURE 0x43495041 // "APIC" +#define DSDT_SIGNATURE 0x54445344 // "DSDT" +#define SSDT_SIGNATURE 0x54445353 // "SSDT" +#define PSDT_SIGNATURE 0x54445350 // "PSDT" +#define SBST_SIGNATURE 0x54534253 // "SBST" +#define DBGP_SIGNATURE 0x50474244 // "DBGP" +#define XSDT_SIGNATURE 'TDSX' +#define BOOT_SIGNATURE 'TOOB' +#define SRAT_SIGNATURE 'TARS' +#define WDRT_SIGNATURE 'TRDW' + +// +// FADT Flags +// +#define ACPI_TMR_VAL_EXT 0x100 + +// +// ACPI Generic Register Address +// +typedef struct _GEN_ADDR +{ + UCHAR AddressSpaceID; + UCHAR BitWidth; + UCHAR BitOffset; + UCHAR Reserved; + PHYSICAL_ADDRESS Address; +} GEN_ADDR, *PGEN_ADDR; + +// +// ACPI BIOS Structures (packed) +// +#include <pshpack1.h> +typedef struct _RSDP +{ + ULONGLONG Signature; + UCHAR Checksum; + UCHAR OEMID[6]; + UCHAR Reserved[1]; + ULONG RsdtAddress; +} RSDP; +typedef RSDP *PRSDP; + +typedef struct _DESCRIPTION_HEADER +{ + ULONG Signature; + ULONG Length; + UCHAR Revision; + UCHAR Checksum; + UCHAR OEMID[6]; + UCHAR OEMTableID[8]; + ULONG OEMRevision; + UCHAR CreatorID[4]; + ULONG CreatorRev; +} DESCRIPTION_HEADER; +typedef DESCRIPTION_HEADER *PDESCRIPTION_HEADER; + +typedef struct _FACS +{ + ULONG Signature; + ULONG Length; + ULONG HardwareSignature; + ULONG pFirmwareWakingVector; + ULONG GlobalLock; + ULONG Flags; + PHYSICAL_ADDRESS x_FirmwareWakingVector; + UCHAR version; + UCHAR Reserved[32]; +} FACS; +typedef FACS *PFACS; + +typedef struct _FADT +{ + DESCRIPTION_HEADER Header; + ULONG facs; + ULONG dsdt; + UCHAR int_model; + UCHAR pm_profile; + USHORT sci_int_vector; + ULONG smi_cmd_io_port; + UCHAR acpi_on_value; + UCHAR acpi_off_value; + UCHAR s4bios_req; + UCHAR pstate_control; + ULONG pm1a_evt_blk_io_port; + ULONG pm1b_evt_blk_io_port; + ULONG pm1a_ctrl_blk_io_port; + ULONG pm1b_ctrl_blk_io_port; + ULONG pm2_ctrl_blk_io_port; + ULONG pm_tmr_blk_io_port; + ULONG gp0_blk_io_port; + ULONG gp1_blk_io_port; + UCHAR pm1_evt_len; + UCHAR pm1_ctrl_len; + UCHAR pm2_ctrl_len; + UCHAR pm_tmr_len; + UCHAR gp0_blk_len; + UCHAR gp1_blk_len; + UCHAR gp1_base; + UCHAR cstate_control; + USHORT lvl2_latency; + USHORT lvl3_latency; + USHORT flush_size; + USHORT flush_stride; + UCHAR duty_offset; + UCHAR duty_width; + UCHAR day_alarm_index; + UCHAR month_alarm_index; + UCHAR century_alarm_index; + USHORT boot_arch; + UCHAR reserved3[1]; + ULONG flags; + GEN_ADDR reset_reg; + UCHAR reset_val; + UCHAR reserved4[3]; + PHYSICAL_ADDRESS x_firmware_ctrl; + PHYSICAL_ADDRESS x_dsdt; + GEN_ADDR x_pm1a_evt_blk; + GEN_ADDR x_pm1b_evt_blk; + GEN_ADDR x_pm1a_ctrl_blk; + GEN_ADDR x_pm1b_ctrl_blk; + GEN_ADDR x_pm2_ctrl_blk; + GEN_ADDR x_pm_tmr_blk; + GEN_ADDR x_gp0_blk; + GEN_ADDR x_gp1_blk; +} FADT; +typedef FADT *PFADT; + +typedef struct _DSDT +{ + DESCRIPTION_HEADER Header; + UCHAR DiffDefBlock[ANYSIZE_ARRAY]; +} DSDT; +typedef DSDT *PDSDT; + +typedef struct _RSDT +{ + DESCRIPTION_HEADER Header; + ULONG Tables[ANYSIZE_ARRAY]; +} RSDT; +typedef RSDT *PRSDT; + +typedef struct _XSDT +{ + DESCRIPTION_HEADER Header; + PHYSICAL_ADDRESS Tables[ANYSIZE_ARRAY]; +} XSDT; +typedef XSDT *PXSDT; +#include <poppack.h> + +// +// Microsoft-specific (pretty much) ACPI Tables, normal MS ABI packing +// +typedef struct _DEBUG_PORT_TABLE +{ + DESCRIPTION_HEADER Header; + UCHAR InterfaceType; + UCHAR Reserved[3]; + GEN_ADDR BaseAddress; +} DEBUG_PORT_TABLE, *PDEBUG_PORT_TABLE; + +typedef struct _WATCHDOG_TABLE +{ + DESCRIPTION_HEADER Header; + GEN_ADDR ControlRegister; + GEN_ADDR CountRegister; + USHORT PciDeviceId; + USHORT PciVendorId; + UCHAR PciBus; + UCHAR PciDevice; + UCHAR PciFunction; + UCHAR PciSegment; + USHORT MaxCount; + UCHAR Units; +} WATCHDOG_TABLE, *PWATCHDOG_TABLE; + +typedef struct _BOOT_TABLE +{ + DESCRIPTION_HEADER Header; + UCHAR CMOSIndex; + UCHAR Reserved[3]; +} BOOT_TABLE, *PBOOT_TABLE; + +typedef struct _ACPI_SRAT +{ + DESCRIPTION_HEADER Header; + UCHAR TableRevision; + ULONG Reserved[2]; +} ACPI_SRAT, *PACPI_SRAT; + +/* EOF */ Propchange: trunk/reactos/include/reactos/drivers/acpi/acpi.h ------------------------------------------------------------------------------ svn:eol-style = native
14 years, 5 months
1
0
0
0
[tkreuzer] 47890: [WINED3D] Fix prototype of wined3d_event_query_supported (BOOL != HRESULT)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 28 02:27:53 2010 New Revision: 47890 URL:
http://svn.reactos.org/svn/reactos?rev=47890&view=rev
Log: [WINED3D] Fix prototype of wined3d_event_query_supported (BOOL != HRESULT) Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
============================================================================== --- trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h [iso-8859-1] Mon Jun 28 02:27:53 2010 @@ -1029,7 +1029,7 @@ enum wined3d_event_query_result wined3d_event_query_test(struct wined3d_event_query *query, IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN; enum wined3d_event_query_result wined3d_event_query_finish(struct wined3d_event_query *query, IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN; void wined3d_event_query_issue(struct wined3d_event_query *query, IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN; -HRESULT wined3d_event_query_supported(const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; +BOOL wined3d_event_query_supported(const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; struct wined3d_context {
14 years, 5 months
1
0
0
0
[tkreuzer] 47889: usurp: Physicus: better use </if> in .rbuild ; ) So be it.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 28 01:29:27 2010 New Revision: 47889 URL:
http://svn.reactos.org/svn/reactos?rev=47889&view=rev
Log: usurp: Physicus: better use </if> in .rbuild ;) So be it. Modified: trunk/rostests/apitests/directory.rbuild Modified: trunk/rostests/apitests/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/directory.rbuild…
============================================================================== --- trunk/rostests/apitests/directory.rbuild [iso-8859-1] (original) +++ trunk/rostests/apitests/directory.rbuild [iso-8859-1] Mon Jun 28 01:29:27 2010 @@ -26,7 +26,7 @@ <directory name="w32knapi"> <xi:include href="w32knapi/w32knapi.rbuild" /> </directory> - </endif> + </if> <directory name="ws2_32"> <xi:include href="ws2_32/ws2_32.rbuild" />
14 years, 5 months
1
0
0
0
[tkreuzer] 47888: build w32knapi only for x86
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 28 00:32:35 2010 New Revision: 47888 URL:
http://svn.reactos.org/svn/reactos?rev=47888&view=rev
Log: build w32knapi only for x86 Modified: trunk/rostests/apitests/directory.rbuild Modified: trunk/rostests/apitests/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/directory.rbuild…
============================================================================== --- trunk/rostests/apitests/directory.rbuild [iso-8859-1] (original) +++ trunk/rostests/apitests/directory.rbuild [iso-8859-1] Mon Jun 28 00:32:35 2010 @@ -18,13 +18,15 @@ <xi:include href="user32api/user32api.rbuild" /> </directory> - <directory name="w32kdll"> - <xi:include href="w32kdll/directory.rbuild" /> - </directory> + <if property="ARCH" value="i386"> + <directory name="w32kdll"> + <xi:include href="w32kdll/directory.rbuild" /> + </directory> - <directory name="w32knapi"> - <xi:include href="w32knapi/w32knapi.rbuild" /> - </directory> + <directory name="w32knapi"> + <xi:include href="w32knapi/w32knapi.rbuild" /> + </directory> + </endif> <directory name="ws2_32"> <xi:include href="ws2_32/ws2_32.rbuild" />
14 years, 5 months
1
0
0
0
[sir_richard] 47887: [PCI]: Add pciclass.rc to use the pciclass.mc/res-generated file by MC. eVb can now start committing his driver.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Mon Jun 28 00:02:20 2010 New Revision: 47887 URL:
http://svn.reactos.org/svn/reactos?rev=47887&view=rev
Log: [PCI]: Add pciclass.rc to use the pciclass.mc/res-generated file by MC. eVb can now start committing his driver. Modified: trunk/reactos/drivers/bus/pcix/pci.rc trunk/reactos/drivers/bus/pcix/pcix.rbuild Modified: trunk/reactos/drivers/bus/pcix/pci.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci.rc?re…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci.rc [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci.rc [iso-8859-1] Mon Jun 28 00:02:20 2010 @@ -3,3 +3,5 @@ #define REACTOS_STR_INTERNAL_NAME "pci\0" #define REACTOS_STR_ORIGINAL_FILENAME "pci.sys\0" #include <reactos/version.rc> +#include "pciclass.rc" + Modified: trunk/reactos/drivers/bus/pcix/pcix.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pcix.rbui…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pcix.rbuild [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pcix.rbuild [iso-8859-1] Mon Jun 28 00:02:20 2010 @@ -5,6 +5,7 @@ <include base="pcix">.</include> <library>ntoskrnl</library> <library>hal</library> + <dependency>pciclass</dependency> <directory name="arb"> <file>ar_busno.c</file> <file>ar_memio.c</file>
14 years, 5 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
41
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Results per page:
10
25
50
100
200