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

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

Version: ~ [ linux-5.18-rc6 ] ~ [ linux-5.17.6 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.38 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.114 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.192 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.241 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.277 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.312 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2006 Atmark Techno, Inc.
  3  *
  4  * This file is subject to the terms and conditions of the GNU General Public
  5  * License. See the file "COPYING" in the main directory of this archive
  6  * for more details.
  7  */
  8 
  9 #ifndef _ASM_MICROBLAZE_THREAD_INFO_H
 10 #define _ASM_MICROBLAZE_THREAD_INFO_H
 11 
 12 #ifdef __KERNEL__
 13 
 14 /* we have 8k stack */
 15 #define THREAD_SHIFT            13
 16 #define THREAD_SIZE             (1 << THREAD_SHIFT)
 17 #define THREAD_SIZE_ORDER       1
 18 
 19 #ifndef __ASSEMBLY__
 20 # include <linux/types.h>
 21 # include <asm/processor.h>
 22 
 23 /*
 24  * low level task data that entry.S needs immediate access to
 25  * - this struct should fit entirely inside of one cache line
 26  * - this struct shares the supervisor stack pages
 27  * - if the contents of this structure are changed, the assembly constants
 28  *       must also be changed
 29  */
 30 
 31 struct cpu_context {
 32         __u32   r1; /* stack pointer */
 33         __u32   r2;
 34         /* dedicated registers */
 35         __u32   r13;
 36         __u32   r14;
 37         __u32   r15;
 38         __u32   r16;
 39         __u32   r17;
 40         __u32   r18;
 41         /* non-volatile registers */
 42         __u32   r19;
 43         __u32   r20;
 44         __u32   r21;
 45         __u32   r22;
 46         __u32   r23;
 47         __u32   r24;
 48         __u32   r25;
 49         __u32   r26;
 50         __u32   r27;
 51         __u32   r28;
 52         __u32   r29;
 53         __u32   r30;
 54         /* r31 is used as current task pointer */
 55         /* special purpose registers */
 56         __u32   msr;
 57         __u32   ear;
 58         __u32   esr;
 59         __u32   fsr;
 60 };
 61 
 62 typedef struct {
 63         unsigned long seg;
 64 } mm_segment_t;
 65 
 66 struct thread_info {
 67         struct task_struct      *task; /* main task structure */
 68         unsigned long           flags; /* low level flags */
 69         unsigned long           status; /* thread-synchronous flags */
 70         __u32                   cpu; /* current CPU */
 71         __s32                   preempt_count; /* 0 => preemptable,< 0 => BUG*/
 72         mm_segment_t            addr_limit; /* thread address space */
 73 
 74         struct cpu_context      cpu_context;
 75 };
 76 
 77 /*
 78  * macros/functions for gaining access to the thread information structure
 79  */
 80 #define INIT_THREAD_INFO(tsk)                   \
 81 {                                               \
 82         .task           = &tsk,                 \
 83         .flags          = 0,                    \
 84         .cpu            = 0,                    \
 85         .preempt_count  = INIT_PREEMPT_COUNT,   \
 86         .addr_limit     = KERNEL_DS,            \
 87 }
 88 
 89 #define init_thread_info        (init_thread_union.thread_info)
 90 #define init_stack              (init_thread_union.stack)
 91 
 92 /* how to get the thread information struct from C */
 93 static inline struct thread_info *current_thread_info(void)
 94 {
 95         register unsigned long sp asm("r1");
 96 
 97         return (struct thread_info *)(sp & ~(THREAD_SIZE-1));
 98 }
 99 
100 /* thread information allocation */
101 #endif /* __ASSEMBLY__ */
102 
103 /*
104  * thread information flags
105  * - these are process state flags that various assembly files may
106  *   need to access
107  * - pending work-to-be-done flags are in LSW
108  * - other flags in MSW
109  */
110 #define TIF_SYSCALL_TRACE       0 /* syscall trace active */
111 #define TIF_NOTIFY_RESUME       1 /* resumption notification requested */
112 #define TIF_SIGPENDING          2 /* signal pending */
113 #define TIF_NEED_RESCHED        3 /* rescheduling necessary */
114 /* restore singlestep on return to user mode */
115 #define TIF_SINGLESTEP          4
116 #define TIF_MEMDIE              6       /* is terminating due to OOM killer */
117 #define TIF_SYSCALL_AUDIT       9       /* syscall auditing active */
118 #define TIF_SECCOMP             10      /* secure computing */
119 
120 /* true if poll_idle() is polling TIF_NEED_RESCHED */
121 #define TIF_POLLING_NRFLAG      16
122 
123 #define _TIF_SYSCALL_TRACE      (1 << TIF_SYSCALL_TRACE)
124 #define _TIF_NOTIFY_RESUME      (1 << TIF_NOTIFY_RESUME)
125 #define _TIF_SIGPENDING         (1 << TIF_SIGPENDING)
126 #define _TIF_NEED_RESCHED       (1 << TIF_NEED_RESCHED)
127 #define _TIF_SINGLESTEP         (1 << TIF_SINGLESTEP)
128 #define _TIF_POLLING_NRFLAG     (1 << TIF_POLLING_NRFLAG)
129 #define _TIF_SYSCALL_AUDIT      (1 << TIF_SYSCALL_AUDIT)
130 #define _TIF_SECCOMP            (1 << TIF_SECCOMP)
131 
132 /* work to do in syscall trace */
133 #define _TIF_WORK_SYSCALL_MASK  (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
134                                  _TIF_SYSCALL_AUDIT | _TIF_SECCOMP)
135 
136 /* work to do on interrupt/exception return */
137 #define _TIF_WORK_MASK          0x0000FFFE
138 
139 /* work to do on any return to u-space */
140 #define _TIF_ALLWORK_MASK       0x0000FFFF
141 
142 /*
143  * Thread-synchronous status.
144  *
145  * This is different from the flags in that nobody else
146  * ever touches our thread-synchronous status, so we don't
147  * have to worry about atomic accesses.
148  */
149 /* FPU was used by this task this quantum (SMP) */
150 #define TS_USEDFPU              0x0001
151 #define TS_RESTORE_SIGMASK      0x0002
152 
153 #ifndef __ASSEMBLY__
154 #define HAVE_SET_RESTORE_SIGMASK 1
155 static inline void set_restore_sigmask(void)
156 {
157         struct thread_info *ti = current_thread_info();
158         ti->status |= TS_RESTORE_SIGMASK;
159         WARN_ON(!test_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags));
160 }
161 static inline void clear_restore_sigmask(void)
162 {
163         current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
164 }
165 static inline bool test_restore_sigmask(void)
166 {
167         return current_thread_info()->status & TS_RESTORE_SIGMASK;
168 }
169 static inline bool test_and_clear_restore_sigmask(void)
170 {
171         struct thread_info *ti = current_thread_info();
172         if (!(ti->status & TS_RESTORE_SIGMASK))
173                 return false;
174         ti->status &= ~TS_RESTORE_SIGMASK;
175         return true;
176 }
177 #endif
178 
179 #endif /* __KERNEL__ */
180 #endif /* _ASM_MICROBLAZE_THREAD_INFO_H */
181 

~ [ 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