ACPI_STATUS
AcpiOsTerminate(void)
{
- DPRINT1("AcpiOsTerminate() called\n");
+ DPRINT("AcpiOsTerminate() called\n");
if (AcpiInterruptHandlerRegistered)
AcpiOsRemoveInterruptHandler(AcpiIrqNumber, AcpiIrqHandler);
const char *Fmt,
va_list Args)
{
+#ifndef NDEBUG
vDbgPrintEx (-1, DPFLTR_ERROR_LEVEL, Fmt, Args);
+#endif
return;
}
void
AcpiOsStall (UINT32 microseconds)
{
- DPRINT1("AcpiOsStall %d\n",microseconds);
+ DPRINT("AcpiOsStall %d\n",microseconds);
KeStallExecutionProcessor(microseconds);
return;
}
void
AcpiOsSleep (ACPI_INTEGER milliseconds)
{
- DPRINT1("AcpiOsSleep %d\n", milliseconds);
+ DPRINT("AcpiOsSleep %d\n", milliseconds);
KeStallExecutionProcessor(milliseconds*1000);
return;
}
NTSTATUS Status;
PCI_SLOT_NUMBER slot;
- if (Register == 0)
+ if (Register == 0 || PciId->Device == 0 ||
+ Register + Width > PCI_COMMON_HDR_LENGTH)
return AE_ERROR;
slot.u.AsULONG = 0;
ULONG buf = Value;
PCI_SLOT_NUMBER slot;
- if (Register == 0)
+ if (Register == 0 || PciId->Device == 0 ||
+ Register + Width > PCI_COMMON_HDR_LENGTH)
return AE_ERROR;
slot.u.AsULONG = 0;
DPRINT("Waiting for semaphore %p\n", Handle);
ASSERT(Mutex);
- ExAcquireFastMutex(Mutex);
+ /* HACK: We enter here at a high IRQL sometimes
+ * because we get called from DPCs and ISRs and
+ * we can't use a fast mutex at that IRQL */
+ if (KeGetCurrentIrql() <= APC_LEVEL)
+ ExAcquireFastMutex(Mutex);
+
return AE_OK;
}
DPRINT("AcpiOsSignalSemaphore %p\n",Handle);
ASSERT(Mutex);
- ExReleaseFastMutex(Mutex);
+ /* HACK: We enter here at a high IRQL sometimes
+ * because we get called from DPCs and ISRs and
+ * we can't use a fast mutex at that IRQL */
+ if (KeGetCurrentIrql() <= APC_LEVEL)
+ ExReleaseFastMutex(Mutex);
+
return AE_OK;
}
ACPI_OSD_EXEC_CALLBACK Function,
void *Context)
{
- DPRINT1("AcpiOsExecute\n");
+ DPRINT("AcpiOsExecute\n");
KeInsertQueueDpc(&AcpiDpc, (PVOID)Function, (PVOID)Context);