Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144434369
D19257.id54098.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D19257.id54098.diff
View Options
Index: sys/compat/linuxkpi/common/include/linux/compat.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/compat.h
+++ sys/compat/linuxkpi/common/include/linux/compat.h
@@ -40,19 +40,25 @@
extern int linux_alloc_current(struct thread *, int flags);
extern void linux_free_current(struct task_struct *);
+extern int (*lkpi_alloc_current)(struct thread *, int);
+
static inline void
linux_set_current(struct thread *td)
{
+ if (__predict_false(lkpi_alloc_current == NULL))
+ return;
if (__predict_false(td->td_lkpi_task == NULL))
- linux_alloc_current(td, M_WAITOK);
+ lkpi_alloc_current(td, M_WAITOK);
}
static inline int
linux_set_current_flags(struct thread *td, int flags)
{
+ if (__predict_false(lkpi_alloc_current == NULL))
+ return (0);
if (__predict_false(td->td_lkpi_task == NULL))
- return (linux_alloc_current(td, flags));
+ return (lkpi_alloc_current(td, flags));
return (0);
}
Index: sys/compat/linuxkpi/common/src/linux_current.c
===================================================================
--- sys/compat/linuxkpi/common/src/linux_current.c
+++ sys/compat/linuxkpi/common/src/linux_current.c
@@ -220,6 +220,7 @@
{
linuxkpi_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor,
linuxkpi_thread_dtor, NULL, EVENTHANDLER_PRI_ANY);
+ lkpi_alloc_current = linux_alloc_current;
}
SYSINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_init, NULL);
@@ -242,7 +243,7 @@
PROC_UNLOCK(p);
}
sx_sunlock(&allproc_lock);
-
+ lkpi_alloc_current = NULL;
EVENTHANDLER_DEREGISTER(thread_dtor, linuxkpi_thread_dtor_tag);
}
SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_uninit, NULL);
Index: sys/kern/init_main.c
===================================================================
--- sys/kern/init_main.c
+++ sys/kern/init_main.c
@@ -106,6 +106,7 @@
struct thread0_storage thread0_st __aligned(32);
struct vmspace vmspace0;
struct proc *initproc;
+int (*lkpi_alloc_current)(struct thread *, int);
#ifndef BOOTHOWTO
#define BOOTHOWTO 0
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 10:26 AM (11 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28568353
Default Alt Text
D19257.id54098.diff (2 KB)
Attached To
Mode
D19257: allow late binding of linux_alloc_current
Attached
Detach File
Event Timeline
Log In to Comment