Release 4.11 include/linux/thread_info.h
/* thread_info.h: common low-level thread information accessors
*
* Copyright (C) 2002 David Howells (dhowells@redhat.com)
* - Incorporating suggestions made by Linus Torvalds
*/
#ifndef _LINUX_THREAD_INFO_H
#define _LINUX_THREAD_INFO_H
#include <linux/types.h>
#include <linux/bug.h>
#include <linux/restart_block.h>
#ifdef CONFIG_THREAD_INFO_IN_TASK
/*
* For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
* definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
* including <asm/current.h> can cause a circular dependency on some platforms.
*/
#include <asm/current.h>
#define current_thread_info() ((struct thread_info *)current)
#endif
#include <linux/bitops.h>
#include <asm/thread_info.h>
#ifdef __KERNEL__
#ifdef CONFIG_DEBUG_STACK_USAGE
# define THREADINFO_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK | \
__GFP_ZERO)
#else
# define THREADINFO_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK)
#endif
/*
* flag set/clear/test wrappers
* - pass TIF_xxxx constants to these functions
*/
static inline void set_ti_thread_flag(struct thread_info *ti, int flag)
{
set_bit(flag, (unsigned long *)&ti->flags);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 25 | 83.33% | 1 | 50.00% |
Jeremy Fitzhardinge | 5 | 16.67% | 1 | 50.00% |
Total | 30 | 100.00% | 2 | 100.00% |
static inline void clear_ti_thread_flag(struct thread_info *ti, int flag)
{
clear_bit(flag, (unsigned long *)&ti->flags);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 25 | 83.33% | 1 | 50.00% |
Jeremy Fitzhardinge | 5 | 16.67% | 1 | 50.00% |
Total | 30 | 100.00% | 2 | 100.00% |
static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
{
return test_and_set_bit(flag, (unsigned long *)&ti->flags);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 26 | 83.87% | 1 | 50.00% |
Jeremy Fitzhardinge | 5 | 16.13% | 1 | 50.00% |
Total | 31 | 100.00% | 2 | 100.00% |
static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
{
return test_and_clear_bit(flag, (unsigned long *)&ti->flags);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 26 | 83.87% | 1 | 50.00% |
Jeremy Fitzhardinge | 5 | 16.13% | 1 | 50.00% |
Total | 31 | 100.00% | 2 | 100.00% |
static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
{
return test_bit(flag, (unsigned long *)&ti->flags);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 26 | 83.87% | 1 | 50.00% |
Jeremy Fitzhardinge | 5 | 16.13% | 1 | 50.00% |
Total | 31 | 100.00% | 2 | 100.00% |
#define set_thread_flag(flag) \
set_ti_thread_flag(current_thread_info(), flag)
#define clear_thread_flag(flag) \
clear_ti_thread_flag(current_thread_info(), flag)
#define test_and_set_thread_flag(flag) \
test_and_set_ti_thread_flag(current_thread_info(), flag)
#define test_and_clear_thread_flag(flag) \
test_and_clear_ti_thread_flag(current_thread_info(), flag)
#define test_thread_flag(flag) \
test_ti_thread_flag(current_thread_info(), flag)
#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
#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;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Kees Cook | 31 | 100.00% | 1 | 100.00% |
Total | 31 | 100.00% | 1 | 100.00% |
#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)
{
if (!__builtin_constant_p(n))
__check_object_size(ptr, n, to_user);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Kees Cook | 36 | 100.00% | 3 | 100.00% |
Total | 36 | 100.00% | 3 | 100.00% |
#else
static inline void check_object_size(const void *ptr, unsigned long n,
bool to_user)
{ }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Kees Cook | 18 | 100.00% | 1 | 100.00% |
Total | 18 | 100.00% | 1 | 100.00% |
#endif /* CONFIG_HARDENED_USERCOPY */
#endif /* __KERNEL__ */
#endif /* _LINUX_THREAD_INFO_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 152 | 40.64% | 2 | 11.11% |
Kees Cook | 115 | 30.75% | 4 | 22.22% |
Roman Zippel | 36 | 9.63% | 1 | 5.56% |
Jeremy Fitzhardinge | 25 | 6.68% | 1 | 5.56% |
Thomas Gleixner | 13 | 3.48% | 1 | 5.56% |
Andrew Lutomirski | 10 | 2.67% | 1 | 5.56% |
Mark Rutland | 7 | 1.87% | 2 | 11.11% |
Peter Zijlstra | 5 | 1.34% | 1 | 5.56% |
Al Viro | 3 | 0.80% | 1 | 5.56% |
Steven Rostedt | 3 | 0.80% | 1 | 5.56% |
Hirofumi Ogawa | 2 | 0.53% | 1 | 5.56% |
Vladimir Davydov | 2 | 0.53% | 1 | 5.56% |
Roland McGrath | 1 | 0.27% | 1 | 5.56% |
Total | 374 | 100.00% | 18 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.