Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/linuxkpi/common/include/linux/compat.h
Show All 35 Lines | |||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
struct thread; | struct thread; | ||||
struct task_struct; | struct task_struct; | ||||
extern int linux_alloc_current(struct thread *, int flags); | extern int linux_alloc_current(struct thread *, int flags); | ||||
extern void linux_free_current(struct task_struct *); | extern void linux_free_current(struct task_struct *); | ||||
static inline void | static inline void | ||||
linux_set_current(struct thread *td) | linux_set_current(struct thread *td) | ||||
{ | { | ||||
if (__predict_false(td->td_lkpi_task == NULL)) | if (__predict_false(td->td_lkpi_task == NULL)) | ||||
linux_alloc_current(td, M_WAITOK); | lkpi_alloc_current(td, M_WAITOK); | ||||
} | } | ||||
static inline int | static inline int | ||||
linux_set_current_flags(struct thread *td, int flags) | linux_set_current_flags(struct thread *td, int flags) | ||||
{ | { | ||||
if (__predict_false(td->td_lkpi_task == NULL)) | if (__predict_false(td->td_lkpi_task == NULL)) | ||||
return (linux_alloc_current(td, flags)); | return (lkpi_alloc_current(td, flags)); | ||||
return (0); | return (0); | ||||
} | } | ||||
#endif /* _LINUX_COMPAT_H_ */ | #endif /* _LINUX_COMPAT_H_ */ |