aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2002-10-16 17:25:29 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2002-10-16 17:25:29 +0000
commit680717ff9ecc744cf3b3513c8b3e370201a10583 (patch)
tree134ade69b6afe5ed6f955012d5f509850f2a2221 /sys/dev
parentb60bd0c1296387073644b187839ed5f4a91b564f (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpica/Osd/OsdSchedule.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c
index f402a02db838..8289c5df2d0e 100644
--- a/sys/dev/acpica/Osd/OsdSchedule.c
+++ b/sys/dev/acpica/Osd/OsdSchedule.c
@@ -40,9 +40,7 @@
#include <sys/interrupt.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
-#include <sys/lock.h>
#include <sys/malloc.h>
-#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/taskqueue.h>
#include <machine/clock.h>
@@ -74,6 +72,7 @@ struct acpi_task_queue {
struct acpi_task *at;
};
+#if __FreeBSD_version >= 500000
/*
* Private task queue definition for ACPI
*/
@@ -157,6 +156,7 @@ acpi_task_thread_init(void)
return (err);
}
#endif
+#endif
ACPI_STATUS
AcpiOsQueueForExecution(UINT32 Priority, OSD_EXECUTION_CALLBACK Function, void *Context)
@@ -195,7 +195,11 @@ AcpiOsQueueForExecution(UINT32 Priority, OSD_EXECUTION_CALLBACK Function, void *
}
TASK_INIT(&at->at_task, pri, AcpiOsExecuteQueue, at);
+#if __FreeBSD_version < 500000
+ taskqueue_enqueue(taskqueue_swi, (struct task *)at);
+#else
taskqueue_enqueue(taskqueue_acpi, (struct task *)at);
+#endif
return_ACPI_STATUS(AE_OK);
}
@@ -269,8 +273,14 @@ AcpiOsStall (UINT32 Microseconds)
UINT32
AcpiOsGetThreadId (void)
{
+ struct proc *p;
/* XXX do not add FUNCTION_TRACE here, results in recursive call */
- KASSERT(curproc != NULL, ("%s: curproc is NULL!", __func__));
- return(curproc->p_pid + 1); /* can't return 0 */
+ p = curproc;
+#if __FreeBSD_version < 500000
+ if (p == NULL)
+ p = &proc0;
+#endif
+ KASSERT(p != NULL, ("%s: curproc is NULL!", __func__));
+ return(p->p_pid + 1); /* can't return 0 */
}