Author: cgutman
Date: Tue Mar 27 07:23:14 2012
New Revision: 56245
URL: http://svn.reactos.org/svn/reactos?rev=56245&view=rev
Log:
[ACPI]
- Fix implementations of AcpiOsWaitSemaphore and AcpiOsAcquireMutex to obey the caller's demands to not block if requested
Modified:
trunk/reactos/drivers/bus/acpi/osl.c
Modified: trunk/reactos/drivers/bus/acpi/osl.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/osl.c?rev…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/osl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/osl.c [iso-8859-1] Tue Mar 27 07:23:14 2012
@@ -298,8 +298,19 @@
return AE_BAD_PARAMETER;
}
- ExAcquireFastMutex((PFAST_MUTEX)Handle);
-
+ /* Check what the caller wants us to do */
+ if (Timeout == ACPI_DO_NOT_WAIT)
+ {
+ /* Try to acquire without waiting */
+ if (!ExTryToAcquireFastMutex((PFAST_MUTEX)Handle))
+ return AE_TIME;
+ }
+ else
+ {
+ /* Block until we get it */
+ ExAcquireFastMutex((PFAST_MUTEX)Handle);
+ }
+
return AE_OK;
}
@@ -377,8 +388,18 @@
DPRINT1("Bad parameter\n");
return AE_BAD_PARAMETER;
}
-
+
KeAcquireSpinLock(&Sem->Lock, &OldIrql);
+
+ /* Make sure we can wait if we have fewer units than we need */
+ if ((Timeout == ACPI_DO_NOT_WAIT) && (Sem->CurrentUnits < Units))
+ {
+ /* We can't so we must bail now */
+ KeReleaseSpinLock(&Sem->Lock, OldIrql);
+ return AE_TIME;
+ }
+
+ /* Time to block until we get enough units */
while (Sem->CurrentUnits < Units)
{
KeReleaseSpinLock(&Sem->Lock, OldIrql);
Author: cgutman
Date: Tue Mar 27 06:50:01 2012
New Revision: 56243
URL: http://svn.reactos.org/svn/reactos?rev=56243&view=rev
Log:
[ACPI]
- Fix a stupid string comparison mistake that lead to false positives in the duplicate device detection (1 and 10 detected as conflict)
Modified:
trunk/reactos/drivers/bus/acpi/acpienum.c
Modified: trunk/reactos/drivers/bus/acpi/acpienum.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpienum.…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpienum.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/acpienum.c [iso-8859-1] Tue Mar 27 06:50:01 2012
@@ -60,11 +60,11 @@
continue;
//check if the HID matches
- if (strstr(Device->pnp.hardware_id, CurrentDevice->pnp.hardware_id))
+ if (!strcmp(Device->pnp.hardware_id, CurrentDevice->pnp.hardware_id))
{
//check if UID exists for both and matches
if (Device->flags.unique_id && CurrentDevice->flags.unique_id &&
- strstr(Device->pnp.unique_id, CurrentDevice->pnp.unique_id))
+ !strcmp(Device->pnp.unique_id, CurrentDevice->pnp.unique_id))
{
/* We have a UID on both but they're the same so we have to ignore it */
DPRINT1("Detected duplicate device: %hs %hs\n", Device->pnp.hardware_id, Device->pnp.unique_id);
Author: cgutman
Date: Tue Mar 27 06:26:38 2012
New Revision: 56242
URL: http://svn.reactos.org/svn/reactos?rev=56242&view=rev
Log:
[TXTSETUP]
- Add *PNP0A08
[ACPI]
- Handle the PNP0A08 in a couple of missed cases
- Finally, PCI should work on systems that use the new PNP0A08 ID for identifying a PCI Express root bus
Modified:
trunk/reactos/boot/bootdata/txtsetup.sif
trunk/reactos/drivers/bus/acpi/buspdo.c
Modified: trunk/reactos/boot/bootdata/txtsetup.sif
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/txtsetup.sif…
==============================================================================
--- trunk/reactos/boot/bootdata/txtsetup.sif [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/txtsetup.sif [iso-8859-1] Tue Mar 27 06:26:38 2012
@@ -62,6 +62,7 @@
[HardwareIdsDatabase]
;*PNP0A00 = isapnp
*PNP0A03 = pci
+*PNP0A08 = pci
*PNP0C08 = acpi
;PCI\CC_0601 = isapnp
PCI\CC_0604 = pci
Modified: trunk/reactos/drivers/bus/acpi/buspdo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/buspdo.c?…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] Tue Mar 27 06:26:38 2012
@@ -594,7 +594,8 @@
Temp = L"ACPI Embedded Controller";
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0B") != 0)
Temp = L"ACPI Fan";
- else if (wcsstr(DeviceData->HardwareIDs, L"PNP0A03") != 0)
+ else if (wcsstr(DeviceData->HardwareIDs, L"PNP0A03") != 0 ||
+ wcsstr(DeviceData->HardwareIDs, L"PNP0A08") != 0 )
Temp = L"PCI Root Bridge";
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0A") != 0)
Temp = L"ACPI Battery";
@@ -666,7 +667,8 @@
/* A bus number resource is not included in the list of current resources
* for the root PCI bus so we manually query one here and if we find it
* we create a resource list and add a bus number descriptor to it */
- if (wcsstr(DeviceData->HardwareIDs, L"PNP0A03") != 0)
+ if (wcsstr(DeviceData->HardwareIDs, L"PNP0A03") != 0 ||
+ wcsstr(DeviceData->HardwareIDs, L"PNP0A08") != 0)
{
acpi_bus_get_device(DeviceData->AcpiHandle, &device);
@@ -1169,7 +1171,8 @@
}
/* Handle the PCI root manually */
- if (wcsstr(DeviceData->HardwareIDs, L"PNP0A03") != 0)
+ if (wcsstr(DeviceData->HardwareIDs, L"PNP0A03") != 0 ||
+ wcsstr(DeviceData->HardwareIDs, L"PNP0A08") != 0)
{
return Irp->IoStatus.Status;
}