#ifndef _LINUX_THREAD_INFO_H
#define _LINUX_THREAD_INFO_H
#include <linux/types.h>
#include <linux/limits.h>
#include <linux/bug.h>
#include <linux/restart_block.h>
#include <linux/errno.h>
#ifdef CONFIG_THREAD_INFO_IN_TASK
#include <asm/current.h>
#define current_thread_info() …
#endif
#include <linux/bitops.h>
enum { … };
#ifdef CONFIG_GENERIC_ENTRY
enum syscall_work_bit { … };
#define SYSCALL_WORK_SECCOMP …
#define SYSCALL_WORK_SYSCALL_TRACEPOINT …
#define SYSCALL_WORK_SYSCALL_TRACE …
#define SYSCALL_WORK_SYSCALL_EMU …
#define SYSCALL_WORK_SYSCALL_AUDIT …
#define SYSCALL_WORK_SYSCALL_USER_DISPATCH …
#define SYSCALL_WORK_SYSCALL_EXIT_TRAP …
#endif
#include <asm/thread_info.h>
#ifdef __KERNEL__
#ifndef arch_set_restart_data
#define arch_set_restart_data …
#endif
static inline long set_restart_fn(struct restart_block *restart,
long (*fn)(struct restart_block *))
{ … }
#ifndef THREAD_ALIGN
#define THREAD_ALIGN …
#endif
#define THREADINFO_GFP …
static inline void set_ti_thread_flag(struct thread_info *ti, int flag)
{ … }
static inline void clear_ti_thread_flag(struct thread_info *ti, int flag)
{ … }
static inline void update_ti_thread_flag(struct thread_info *ti, int flag,
bool value)
{ … }
static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
{ … }
static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
{ … }
static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
{ … }
static __always_inline unsigned long read_ti_thread_flags(struct thread_info *ti)
{ … }
#define set_thread_flag(flag) …
#define clear_thread_flag(flag) …
#define update_thread_flag(flag, value) …
#define test_and_set_thread_flag(flag) …
#define test_and_clear_thread_flag(flag) …
#define test_thread_flag(flag) …
#define read_thread_flags() …
#define read_task_thread_flags(t) …
#ifdef CONFIG_GENERIC_ENTRY
#define set_syscall_work(fl) …
#define test_syscall_work(fl) …
#define clear_syscall_work(fl) …
#define set_task_syscall_work(t, fl) …
#define test_task_syscall_work(t, fl) …
#define clear_task_syscall_work(t, fl) …
#else
#define set_syscall_work …
#define test_syscall_work …
#define clear_syscall_work …
#define set_task_syscall_work …
#define test_task_syscall_work …
#define clear_task_syscall_work …
#endif
#ifdef _ASM_GENERIC_BITOPS_INSTRUMENTED_NON_ATOMIC_H
static __always_inline bool tif_need_resched(void)
{ … }
#else
static __always_inline bool tif_need_resched(void)
{
return test_bit(TIF_NEED_RESCHED,
(unsigned long *)(¤t_thread_info()->flags));
}
#endif
#ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES
static inline int arch_within_stack_frames(const void * const stack,
const void * const stackend,
const void *obj, unsigned long len)
{
return 0;
}
#endif
#ifdef CONFIG_HARDENED_USERCOPY
extern void __check_object_size(const void *ptr, unsigned long n,
bool to_user);
static __always_inline void check_object_size(const void *ptr, unsigned long n,
bool to_user)
{ … }
#else
static inline void check_object_size(const void *ptr, unsigned long n,
bool to_user)
{ }
#endif
extern void __compiletime_error("copy source size is too small")
__bad_copy_from(void);
extern void __compiletime_error("copy destination size is too small")
__bad_copy_to(void);
void __copy_overflow(int size, unsigned long count);
static inline void copy_overflow(int size, unsigned long count)
{ … }
static __always_inline __must_check bool
check_copy_size(const void *addr, size_t bytes, bool is_source)
{ … }
#ifndef arch_setup_new_exec
static inline void arch_setup_new_exec(void) { }
#endif
void arch_task_cache_init(void);
void arch_release_task_struct(struct task_struct *tsk);
int arch_dup_task_struct(struct task_struct *dst,
struct task_struct *src);
#endif
#endif