linux/include/linux/thread_info.h
<<
>>
Prefs
   1/* thread_info.h: common low-level thread information accessors
   2 *
   3 * Copyright (C) 2002  David Howells (dhowells@redhat.com)
   4 * - Incorporating suggestions made by Linus Torvalds
   5 */
   6
   7#ifndef _LINUX_THREAD_INFO_H
   8#define _LINUX_THREAD_INFO_H
   9
  10#include <linux/types.h>
  11#include <linux/bug.h>
  12
  13struct timespec;
  14struct compat_timespec;
  15
  16/*
  17 * System call restart block.
  18 */
  19struct restart_block {
  20        long (*fn)(struct restart_block *);
  21        union {
  22                /* For futex_wait and futex_wait_requeue_pi */
  23                struct {
  24                        u32 __user *uaddr;
  25                        u32 val;
  26                        u32 flags;
  27                        u32 bitset;
  28                        u64 time;
  29                        u32 __user *uaddr2;
  30                } futex;
  31                /* For nanosleep */
  32                struct {
  33                        clockid_t clockid;
  34                        struct timespec __user *rmtp;
  35#ifdef CONFIG_COMPAT
  36                        struct compat_timespec __user *compat_rmtp;
  37#endif
  38                        u64 expires;
  39                } nanosleep;
  40                /* For poll */
  41                struct {
  42                        struct pollfd __user *ufds;
  43                        int nfds;
  44                        int has_timeout;
  45                        unsigned long tv_sec;
  46                        unsigned long tv_nsec;
  47                } poll;
  48        };
  49};
  50
  51extern long do_no_restart_syscall(struct restart_block *parm);
  52
  53#include <linux/bitops.h>
  54#include <asm/thread_info.h>
  55
  56#ifdef __KERNEL__
  57
  58#ifdef CONFIG_DEBUG_STACK_USAGE
  59# define THREADINFO_GFP         (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
  60#else
  61# define THREADINFO_GFP         (GFP_KERNEL | __GFP_NOTRACK)
  62#endif
  63
  64/*
  65 * flag set/clear/test wrappers
  66 * - pass TIF_xxxx constants to these functions
  67 */
  68
  69static inline void set_ti_thread_flag(struct thread_info *ti, int flag)
  70{
  71        set_bit(flag, (unsigned long *)&ti->flags);
  72}
  73
  74static inline void clear_ti_thread_flag(struct thread_info *ti, int flag)
  75{
  76        clear_bit(flag, (unsigned long *)&ti->flags);
  77}
  78
  79static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
  80{
  81        return test_and_set_bit(flag, (unsigned long *)&ti->flags);
  82}
  83
  84static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
  85{
  86        return test_and_clear_bit(flag, (unsigned long *)&ti->flags);
  87}
  88
  89static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
  90{
  91        return test_bit(flag, (unsigned long *)&ti->flags);
  92}
  93
  94#define set_thread_flag(flag) \
  95        set_ti_thread_flag(current_thread_info(), flag)
  96#define clear_thread_flag(flag) \
  97        clear_ti_thread_flag(current_thread_info(), flag)
  9a>(flagpollfd __user *
  v2.6.16.43pollfd   9a>(  9a>(linux/types.h>
01" claf="include/linux/thread_infotatic inline int 
  v2.6.16.43pollfd   9a>(linux/bug.h>
02" cla2s="sr
	  >
  v2.6.165"+code=__us href="+code=inline" class="sref id="L96" inux/thread_info.h#L96" id="L96" class="line" name="L96">  9a>(  12
03" cla3="include/linux/thread_infotatic inline int  *
  v2.6.16.43pollfd   9a>(timespec;
04" cla4="include/linux/thread_info.h#L93" id="L93"10lass="sre0f">compat_timespec;
05" cla5="include/linux/thread_info.h#Lneedche" name="L42">  4.h#Lneedche"2?v43  94#define   9a>(  15
06" claf="include/linux/thread_info.h#L96needche" name="L42">  4.h#L96needche"2?v43  96#define   9a>(/*
07" claf="include/linux/thread_info.h#L57" id="L57"10ystem cal0l restart block.
08" claf="inclu/thread_info.h#L5ude/l" name="L42">  45ude/l"="incne   45ude/l"="incne  */
09" cla9="include/linux/thread_info.h#L64" id="L64" class="line" name="L64">  64   9

eore_sigmask3  64linux/types.h>
<1" cl1href="include/linux/thread_o.hjob >
   3"> ver works, with or without d="LRESTORE_SIGMASde" name="L17">  17 * S class="frref">linux/bug.h>

  18 class="liine" name="L12">  12

  18 spec" claass="sref">timespec;

compat_timespec;

  64  15


  h#L64" id="L64" class="line" name="L64">  64/*

  64

  64 */

. clash#L64" id="L64" class="line" name="L64">  64restart_block {1
  64restart_block *);1
  64linux/bug.h>
<  641
  64  17 * Sde=uaddr"1 class="sref">uaddr;1
   5val;1
  69static/a>eore_sigmask" class="line" name/a>eore_sigmask#defiame=__user" class=ame="L96">  9a>(flags;1
bitset;1
  94#define ti->time;1
#!thread_info.h#L=__us href="+code=inline" class="sref id="L96" inux/thread_info.h#Ld="LSIGPENDINGe=GFP_KERNEL" cd="LSIGPENDING="intti" class="sref">ti->uaddr2;1
futex;1
  74static eore_sigmask" class="line" atic eore_sigmask#defiame=__user" class=ame="L96">  9a>(/*1 For nanosleep */1
  321                struct {1
  96#define ti->clockid;1
rmtp;1
t="include/linux/th 
084e" name/a"+code=__user" class="sr1ef">_13lear_thread_fnfo.h#L90" id="L90" class="ruct #!thread_info.h.h#L96" id="L96" class="line" name="L96">  96#define ftp;
 p;1
  39   14ass="sref">ti, int   96#define ti->pollf1d uaddr;1
  43   14lass="line" name="L18">  18 spec" claass=" name="L144">  44            1     14ass="srenux/thread_info.h#L6bist_bi !thread_info.h#L5ude/l" name="L42">  45ude/l"="incne   45            1     1      #error="+code=nanoslstring">"no/1"class="liine" name="provided/spanux/ault ="frwoncludetnux/t"Sde=uaddr"1 class="sref">uaddr;1
  46              1     14ser *147" id="L147" class="line" name="L147"> 14inux/thread_info.h#L87" id="L87" class="line1f">poll;
  55 * Sde=uaddr"1 class="sref">uaddr;1
  48        };
  49};

uaddr;1
re
 e=restafooter">
The origipec"LXR softw1 clbyde/lir"1 classhttp://sourcaassge.net/projects/lxr">LXR eep"unityid="L9tati experi" clec"   9bydr"1 classmailto:lxr@uaddr.no">lxr@uaddr.noid=".
" value"">
 e=restasubfooter">
lxr.uaddr.no kindly hosted/bydr"1 classhttp://www.redpill-uadpro.no">Redpillpan>pro ASid="L9provider="inLaddr/testultt"> spanoperaedhat.servicet.s="se 1995.
" value="/bodyue"/htmlsu