From fd495c5ce3d53d6227626f5be7882ad3410a7e5b Mon Sep 17 00:00:00 2001 From: jmcneill Date: Tue, 22 Apr 2008 02:02:50 +0000 Subject: [PATCH] AcpiOsGetThreadId should return lwpid, not pid -- otherwise we always return the same value! Fixes the AE_AML_MUTEX_NOT_ACQUIRED issue when evaluating _BST on ASUS Eee PC. Who knows what other mysterious bugs this has caused over the years... --- sys/dev/acpi/acpica/OsdSchedule.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sys/dev/acpi/acpica/OsdSchedule.c b/sys/dev/acpi/acpica/OsdSchedule.c index 8275a349f76e..736d2bd0a1c1 100644 --- a/sys/dev/acpi/acpica/OsdSchedule.c +++ b/sys/dev/acpi/acpica/OsdSchedule.c @@ -1,4 +1,4 @@ -/* $NetBSD: OsdSchedule.c,v 1.5 2007/12/21 18:42:38 jmcneill Exp $ */ +/* $NetBSD: OsdSchedule.c,v 1.6 2008/04/22 02:02:50 jmcneill Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.5 2007/12/21 18:42:38 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.6 2008/04/22 02:02:50 jmcneill Exp $"); #include #include @@ -106,13 +106,7 @@ acpi_osd_sched_fini(void) ACPI_THREAD_ID AcpiOsGetThreadId(void) { - - /* XXX ACPI CA can call this function in interrupt context */ - if (curlwp == NULL) - return 1; - - /* XXX Bleh, we're not allowed to return 0 (how stupid!) */ - return (curlwp->l_proc->p_pid + 1); + return curlwp->l_lid + 1; } /*