aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/src/linux_current.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linuxkpi/common/src/linux_current.c')
-rw-r--r--sys/compat/linuxkpi/common/src/linux_current.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c
index 925d96770cc2..c342eb279caa 100644
--- a/sys/compat/linuxkpi/common/src/linux_current.c
+++ b/sys/compat/linuxkpi/common/src/linux_current.c
@@ -25,7 +25,11 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+#ifdef __amd64__
+#define DEV_APIC
+#elif defined(__i386__)
+#include "opt_apic.h"
+#endif
#include <linux/compat.h>
#include <linux/completion.h>
@@ -39,7 +43,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <vm/uma.h>
-#if defined(__i386__) || defined(__amd64__)
+#ifdef DEV_APIC
extern u_int first_msi_irq, num_msi_irqs;
#endif
@@ -274,7 +278,7 @@ linux_current_init(void *arg __unused)
TUNABLE_INT_FETCH("compat.linuxkpi.task_struct_reserve",
&lkpi_task_resrv);
if (lkpi_task_resrv == 0) {
-#if defined(__i386__) || defined(__amd64__)
+#ifdef DEV_APIC
/*
* Number of interrupt threads plus per-cpu callout
* SWI threads.
@@ -290,7 +294,7 @@ linux_current_init(void *arg __unused)
uma_zone_reserve(linux_current_zone, lkpi_task_resrv);
uma_prealloc(linux_current_zone, lkpi_task_resrv);
linux_mm_zone = uma_zcreate("lkpimm",
- sizeof(struct task_struct), NULL, NULL, NULL, NULL,
+ sizeof(struct mm_struct), NULL, NULL, NULL, NULL,
UMA_ALIGN_PTR, 0);
uma_zone_reserve(linux_mm_zone, lkpi_task_resrv);
uma_prealloc(linux_mm_zone, lkpi_task_resrv);
@@ -301,7 +305,7 @@ linux_current_init(void *arg __unused)
linuxkpi_thread_dtor, NULL, EVENTHANDLER_PRI_ANY);
lkpi_alloc_current = linux_alloc_current;
}
-SYSINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND,
+SYSINIT(linux_current, SI_SUB_EVENTHANDLER + 1, SI_ORDER_SECOND,
linux_current_init, NULL);
static void
@@ -335,5 +339,5 @@ linux_current_uninit(void *arg __unused)
uma_zdestroy(linux_current_zone);
uma_zdestroy(linux_mm_zone);
}
-SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND,
+SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER + 1, SI_ORDER_SECOND,
linux_current_uninit, NULL);