~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arc/include/asm/thread_info.h

Version: ~ [ linux-5.1.2 ] ~ [ linux-5.0.16 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.43 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.119 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.176 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.179 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.139 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.67 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3  *
  4  * This program is free software; you can redistribute it and/or modify
  5  * it under the terms of the GNU General Public License version 2 as
  6  * published by the Free Software Foundation.
  7  *
  8  * Vineetg: Oct 2009
  9  *  No need for ARC specific thread_info allocator (kmalloc/free). This is
 10  *  anyways one page allocation, thus slab alloc can be short-circuited and
 11  *  the generic version (get_free_page) would be loads better.
 12  *
 13  * Sameer Dhavale: Codito Technologies 2004
 14  */
 15 
 16 #ifndef _ASM_THREAD_INFO_H
 17 #define _ASM_THREAD_INFO_H
 18 
 19 #include <asm/page.h>
 20 
 21 #ifdef CONFIG_16KSTACKS
 22 #define THREAD_SIZE_ORDER 1
 23 #else
 24 #define THREAD_SIZE_ORDER 0
 25 #endif
 26 
 27 #define THREAD_SIZE     (PAGE_SIZE << THREAD_SIZE_ORDER)
 28 #define THREAD_SHIFT    (PAGE_SHIFT << THREAD_SIZE_ORDER)
 29 
 30 #ifndef __ASSEMBLY__
 31 
 32 #include <linux/thread_info.h>
 33 #include <asm/segment.h>
 34 
 35 /*
 36  * low level task data that entry.S needs immediate access to
 37  * - this struct should fit entirely inside of one cache line
 38  * - this struct shares the supervisor stack pages
 39  * - if the contents of this structure are changed, the assembly constants
 40  *   must also be changed
 41  */
 42 struct thread_info {
 43         unsigned long flags;            /* low level flags */
 44         int preempt_count;              /* 0 => preemptable, <0 => BUG */
 45         struct task_struct *task;       /* main task structure */
 46         mm_segment_t addr_limit;        /* thread address space */
 47         __u32 cpu;                      /* current CPU */
 48         unsigned long thr_ptr;          /* TLS ptr */
 49 };
 50 
 51 /*
 52  * macros/functions for gaining access to the thread information structure
 53  *
 54  * preempt_count needs to be 1 initially, until the scheduler is functional.
 55  */
 56 #define INIT_THREAD_INFO(tsk)                   \
 57 {                                               \
 58         .task       = &tsk,                     \
 59         .flags      = 0,                        \
 60         .cpu        = 0,                        \
 61         .preempt_count  = INIT_PREEMPT_COUNT,   \
 62         .addr_limit = KERNEL_DS,                \
 63 }
 64 
 65 static inline __attribute_const__ struct thread_info *current_thread_info(void)
 66 {
 67         register unsigned long sp asm("sp");
 68         return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
 69 }
 70 
 71 #endif /* !__ASSEMBLY__ */
 72 
 73 /*
 74  * thread information flags
 75  * - these are process state flags that various assembly files may need to
 76  *   access
 77  * - pending work-to-be-done flags are in LSW
 78  * - other flags in MSW
 79  */
 80 #define TIF_RESTORE_SIGMASK     0       /* restore sig mask in do_signal() */
 81 #define TIF_NOTIFY_RESUME       1       /* resumption notification requested */
 82 #define TIF_SIGPENDING          2       /* signal pending */
 83 #define TIF_NEED_RESCHED        3       /* rescheduling necessary */
 84 #define TIF_SYSCALL_AUDIT       4       /* syscall auditing active */
 85 #define TIF_SYSCALL_TRACE       15      /* syscall trace active */
 86 
 87 /* true if poll_idle() is polling TIF_NEED_RESCHED */
 88 #define TIF_MEMDIE              16
 89 
 90 #define _TIF_SYSCALL_TRACE      (1<<TIF_SYSCALL_TRACE)
 91 #define _TIF_NOTIFY_RESUME      (1<<TIF_NOTIFY_RESUME)
 92 #define _TIF_SIGPENDING         (1<<TIF_SIGPENDING)
 93 #define _TIF_NEED_RESCHED       (1<<TIF_NEED_RESCHED)
 94 #define _TIF_SYSCALL_AUDIT      (1<<TIF_SYSCALL_AUDIT)
 95 #define _TIF_MEMDIE             (1<<TIF_MEMDIE)
 96 
 97 /* work to do on interrupt/exception return */
 98 #define _TIF_WORK_MASK          (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
 99                                  _TIF_NOTIFY_RESUME)
100 
101 /*
102  * _TIF_ALLWORK_MASK includes SYSCALL_TRACE, but we don't need it.
103  * SYSCALL_TRACE is anyway seperately/unconditionally tested right after a
104  * syscall, so all that reamins to be tested is _TIF_WORK_MASK
105  */
106 
107 #endif /* _ASM_THREAD_INFO_H */
108 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp