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

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

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ALPHA_THREAD_INFO_H
  3 #define _ALPHA_THREAD_INFO_H
  4 
  5 #ifdef __KERNEL__
  6 
  7 #ifndef __ASSEMBLY__
  8 #include <asm/processor.h>
  9 #include <asm/types.h>
 10 #include <asm/hwrpb.h>
 11 #include <asm/sysinfo.h>
 12 #endif
 13 
 14 #ifndef __ASSEMBLY__
 15 struct thread_info {
 16         struct pcb_struct       pcb;            /* palcode state */
 17 
 18         struct task_struct      *task;          /* main task structure */
 19         unsigned int            flags;          /* low level flags */
 20         unsigned int            ieee_state;     /* see fpu.h */
 21 
 22         unsigned                cpu;            /* current CPU */
 23         int                     preempt_count; /* 0 => preemptable, <0 => BUG */
 24         unsigned int            status;         /* thread-synchronous flags */
 25 
 26         int bpt_nsaved;
 27         unsigned long bpt_addr[2];              /* breakpoint handling  */
 28         unsigned int bpt_insn[2];
 29         unsigned long fp[32];
 30 };
 31 
 32 /*
 33  * Macros/functions for gaining access to the thread information structure.
 34  */
 35 #define INIT_THREAD_INFO(tsk)                   \
 36 {                                               \
 37         .task           = &tsk,                 \
 38         .preempt_count  = INIT_PREEMPT_COUNT,   \
 39 }
 40 
 41 /* How to get the thread information struct from C.  */
 42 register struct thread_info *__current_thread_info __asm__("$8");
 43 #define current_thread_info()  __current_thread_info
 44 
 45 register unsigned long *current_stack_pointer __asm__ ("$30");
 46 
 47 #endif /* __ASSEMBLY__ */
 48 
 49 /* Thread information allocation.  */
 50 #define THREAD_SIZE_ORDER 1
 51 #define THREAD_SIZE (2*PAGE_SIZE)
 52 
 53 /*
 54  * Thread information flags:
 55  * - these are process state flags and used from assembly
 56  * - pending work-to-be-done flags come first and must be assigned to be
 57  *   within bits 0 to 7 to fit in and immediate operand.
 58  *
 59  * TIF_SYSCALL_TRACE is known to be 0 via blbs.
 60  */
 61 #define TIF_SYSCALL_TRACE       0       /* syscall trace active */
 62 #define TIF_NOTIFY_RESUME       1       /* callback before returning to user */
 63 #define TIF_SIGPENDING          2       /* signal pending */
 64 #define TIF_NEED_RESCHED        3       /* rescheduling necessary */
 65 #define TIF_SYSCALL_AUDIT       4       /* syscall audit active */
 66 #define TIF_NOTIFY_SIGNAL       5       /* signal notifications exist */
 67 #define TIF_DIE_IF_KERNEL       9       /* dik recursion lock */
 68 #define TIF_MEMDIE              13      /* is terminating due to OOM killer */
 69 #define TIF_POLLING_NRFLAG      14      /* idle is polling for TIF_NEED_RESCHED */
 70 
 71 #define _TIF_SYSCALL_TRACE      (1<<TIF_SYSCALL_TRACE)
 72 #define _TIF_SIGPENDING         (1<<TIF_SIGPENDING)
 73 #define _TIF_NEED_RESCHED       (1<<TIF_NEED_RESCHED)
 74 #define _TIF_NOTIFY_RESUME      (1<<TIF_NOTIFY_RESUME)
 75 #define _TIF_SYSCALL_AUDIT      (1<<TIF_SYSCALL_AUDIT)
 76 #define _TIF_NOTIFY_SIGNAL      (1<<TIF_NOTIFY_SIGNAL)
 77 #define _TIF_POLLING_NRFLAG     (1<<TIF_POLLING_NRFLAG)
 78 
 79 /* Work to do on interrupt/exception return.  */
 80 #define _TIF_WORK_MASK          (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
 81                                  _TIF_NOTIFY_RESUME | _TIF_NOTIFY_SIGNAL)
 82 
 83 #define TS_UAC_NOPRINT          0x0001  /* ! Preserve the following three */
 84 #define TS_UAC_NOFIX            0x0002  /* ! flags as they match          */
 85 #define TS_UAC_SIGBUS           0x0004  /* ! userspace part of 'osf_sysinfo' */
 86 
 87 #define TS_SAVED_FP             0x0008
 88 #define TS_RESTORE_FP           0x0010
 89 
 90 #define SET_UNALIGN_CTL(task,value)     ({                              \
 91         __u32 status = task_thread_info(task)->status & ~UAC_BITMASK;   \
 92         if (value & PR_UNALIGN_NOPRINT)                                 \
 93                 status |= TS_UAC_NOPRINT;                               \
 94         if (value & PR_UNALIGN_SIGBUS)                                  \
 95                 status |= TS_UAC_SIGBUS;                                \
 96         if (value & 4)  /* alpha-specific */                            \
 97                 status |= TS_UAC_NOFIX;                                 \
 98         task_thread_info(task)->status = status;                        \
 99         0; })
100 
101 #define GET_UNALIGN_CTL(task,value)     ({                              \
102         __u32 status = task_thread_info(task)->status & ~UAC_BITMASK;   \
103         __u32 res = 0;                                                  \
104         if (status & TS_UAC_NOPRINT)                                    \
105                 res |= PR_UNALIGN_NOPRINT;                              \
106         if (status & TS_UAC_SIGBUS)                                     \
107                 res |= PR_UNALIGN_SIGBUS;                               \
108         if (status & TS_UAC_NOFIX)                                      \
109                 res |= 4;                                               \
110         put_user(res, (int __user *)(value));                           \
111         })
112 
113 #ifndef __ASSEMBLY__
114 extern void __save_fpu(void);
115 
116 static inline void save_fpu(void)
117 {
118         if (!(current_thread_info()->status & TS_SAVED_FP)) {
119                 current_thread_info()->status |= TS_SAVED_FP;
120                 __save_fpu();
121         }
122 }
123 #endif
124 
125 #endif /* __KERNEL__ */
126 #endif /* _ALPHA_THREAD_INFO_H */
127 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php