Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi/acpica/Osd Workaround for AcpiOsGetThreadId: ca...



details:   https://anonhg.NetBSD.org/src/rev/ed5e929864fd
branches:  trunk
changeset: 550264:ed5e929864fd
user:      kochi <kochi%NetBSD.org@localhost>
date:      Sun Aug 03 08:19:58 2003 +0000

description:
Workaround for AcpiOsGetThreadId: can be called with curlwp == NULL

diffstat:

 sys/dev/acpi/acpica/Osd/OsdSchedule.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 14300927a2ac -r ed5e929864fd sys/dev/acpi/acpica/Osd/OsdSchedule.c
--- a/sys/dev/acpi/acpica/Osd/OsdSchedule.c     Sun Aug 03 08:16:07 2003 +0000
+++ b/sys/dev/acpi/acpica/Osd/OsdSchedule.c     Sun Aug 03 08:19:58 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: OsdSchedule.c,v 1.8 2003/06/29 22:30:05 fvdl Exp $     */
+/*     $NetBSD: OsdSchedule.c,v 1.9 2003/08/03 08:19:58 kochi Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.8 2003/06/29 22:30:05 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.9 2003/08/03 08:19:58 kochi Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -100,10 +100,12 @@
 AcpiOsGetThreadId(void)
 {
 
-       KASSERT(curlwp != NULL);
+       /* 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 (curproc->p_pid + 1);
+       return (curproc->p_pid + 2);
 }
 
 /*



Home | Main Index | Thread Index | Old Index