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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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 /*
  3  * thread_info.h: LoongArch low-level thread information
  4  *
  5  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  6  */
  7 
  8 #ifndef _ASM_THREAD_INFO_H
  9 #define _ASM_THREAD_INFO_H
 10 
 11 #ifdef __KERNEL__
 12 
 13 #ifndef __ASSEMBLY__
 14 
 15 #include <asm/processor.h>
 16 
 17 /*
 18  * low level task data that entry.S needs immediate access to
 19  * - this struct should fit entirely inside of one cache line
 20  * - this struct shares the supervisor stack pages
 21  * - if the contents of this structure are changed, the assembly constants
 22  *   must also be changed
 23  */
 24 struct thread_info {
 25         struct task_struct      *task;          /* main task structure */
 26         unsigned long           flags;          /* low level flags */
 27         unsigned long           tp_value;       /* thread pointer */
 28         __u32                   cpu;            /* current CPU */
 29         int                     preempt_count;  /* 0 => preemptible, <0 => BUG */
 30         struct pt_regs          *regs;
 31         unsigned long           syscall;        /* syscall number */
 32         unsigned long           syscall_work;   /* SYSCALL_WORK_ flags */
 33 };
 34 
 35 /*
 36  * macros/functions for gaining access to the thread information structure
 37  */
 38 #define INIT_THREAD_INFO(tsk)                   \
 39 {                                               \
 40         .task           = &tsk,                 \
 41         .flags          = _TIF_FIXADE,          \
 42         .cpu            = 0,                    \
 43         .preempt_count  = INIT_PREEMPT_COUNT,   \
 44 }
 45 
 46 /* How to get the thread information struct from C. */
 47 register struct thread_info *__current_thread_info __asm__("$tp");
 48 
 49 static inline struct thread_info *current_thread_info(void)
 50 {
 51         return __current_thread_info;
 52 }
 53 
 54 register unsigned long current_stack_pointer __asm__("$sp");
 55 
 56 #endif /* !__ASSEMBLY__ */
 57 
 58 /* thread information allocation */
 59 #define THREAD_SIZE             SZ_16K
 60 #define THREAD_MASK             (THREAD_SIZE - 1UL)
 61 #define THREAD_SIZE_ORDER       ilog2(THREAD_SIZE / PAGE_SIZE)
 62 /*
 63  * thread information flags
 64  * - these are process state flags that various assembly files may need to
 65  *   access
 66  * - pending work-to-be-done flags are in LSW
 67  * - other flags in MSW
 68  */
 69 #define TIF_SIGPENDING          1       /* signal pending */
 70 #define TIF_NEED_RESCHED        2       /* rescheduling necessary */
 71 #define TIF_NOTIFY_RESUME       3       /* callback before returning to user */
 72 #define TIF_NOTIFY_SIGNAL       4       /* signal notifications exist */
 73 #define TIF_RESTORE_SIGMASK     5       /* restore signal mask in do_signal() */
 74 #define TIF_NOHZ                6       /* in adaptive nohz mode */
 75 #define TIF_UPROBE              7       /* breakpointed or singlestepping */
 76 #define TIF_USEDFPU             8       /* FPU was used by this task this quantum (SMP) */
 77 #define TIF_USEDSIMD            9       /* SIMD has been used this quantum */
 78 #define TIF_MEMDIE              10      /* is terminating due to OOM killer */
 79 #define TIF_FIXADE              11      /* Fix address errors in software */
 80 #define TIF_LOGADE              12      /* Log address errors to syslog */
 81 #define TIF_32BIT_REGS          13      /* 32-bit general purpose registers */
 82 #define TIF_32BIT_ADDR          14      /* 32-bit address space */
 83 #define TIF_LOAD_WATCH          15      /* If set, load watch registers */
 84 #define TIF_SINGLESTEP          16      /* Single Step */
 85 #define TIF_LSX_CTX_LIVE        17      /* LSX context must be preserved */
 86 #define TIF_LASX_CTX_LIVE       18      /* LASX context must be preserved */
 87 #define TIF_USEDLBT             19      /* LBT was used by this task this quantum (SMP) */
 88 #define TIF_LBT_CTX_LIVE        20      /* LBT context must be preserved */
 89 #define TIF_PATCH_PENDING       21      /* pending live patching update */
 90 
 91 #define _TIF_SIGPENDING         (1<<TIF_SIGPENDING)
 92 #define _TIF_NEED_RESCHED       (1<<TIF_NEED_RESCHED)
 93 #define _TIF_NOTIFY_RESUME      (1<<TIF_NOTIFY_RESUME)
 94 #define _TIF_NOTIFY_SIGNAL      (1<<TIF_NOTIFY_SIGNAL)
 95 #define _TIF_NOHZ               (1<<TIF_NOHZ)
 96 #define _TIF_UPROBE             (1<<TIF_UPROBE)
 97 #define _TIF_USEDFPU            (1<<TIF_USEDFPU)
 98 #define _TIF_USEDSIMD           (1<<TIF_USEDSIMD)
 99 #define _TIF_FIXADE             (1<<TIF_FIXADE)
100 #define _TIF_LOGADE             (1<<TIF_LOGADE)
101 #define _TIF_32BIT_REGS         (1<<TIF_32BIT_REGS)
102 #define _TIF_32BIT_ADDR         (1<<TIF_32BIT_ADDR)
103 #define _TIF_LOAD_WATCH         (1<<TIF_LOAD_WATCH)
104 #define _TIF_SINGLESTEP         (1<<TIF_SINGLESTEP)
105 #define _TIF_LSX_CTX_LIVE       (1<<TIF_LSX_CTX_LIVE)
106 #define _TIF_LASX_CTX_LIVE      (1<<TIF_LASX_CTX_LIVE)
107 #define _TIF_USEDLBT            (1<<TIF_USEDLBT)
108 #define _TIF_LBT_CTX_LIVE       (1<<TIF_LBT_CTX_LIVE)
109 #define _TIF_PATCH_PENDING      (1<<TIF_PATCH_PENDING)
110 
111 #endif /* __KERNEL__ */
112 #endif /* _ASM_THREAD_INFO_H */
113 

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