forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/arch/arm64/include/asm/thread_info.h
....@@ -1,25 +1,12 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Based on arch/arm/include/asm/thread_info.h
34 *
45 * Copyright (C) 2002 Russell King.
56 * Copyright (C) 2012 ARM Ltd.
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
187 */
198 #ifndef __ASM_THREAD_INFO_H
209 #define __ASM_THREAD_INFO_H
21
-
22
-#ifdef __KERNEL__
2310
2411 #include <linux/compiler.h>
2512
....@@ -42,9 +29,21 @@
4229 #ifdef CONFIG_ARM64_SW_TTBR0_PAN
4330 u64 ttbr0; /* saved TTBR0_EL1 */
4431 #endif
45
- int preempt_count; /* 0 => preemptable, <0 => bug */
32
+ union {
33
+ u64 preempt_count; /* 0 => preemptible, <0 => bug */
34
+ struct {
35
+#ifdef CONFIG_CPU_BIG_ENDIAN
36
+ u32 need_resched;
37
+ u32 count;
38
+#else
39
+ u32 count;
40
+ u32 need_resched;
41
+#endif
42
+ } preempt;
43
+ };
4644 #ifdef CONFIG_SHADOW_CALL_STACK
47
- void *shadow_call_stack;
45
+ void *scs_base;
46
+ void *scs_sp;
4847 #endif
4948 };
5049
....@@ -62,28 +61,19 @@
6261
6362 #endif
6463
65
-/*
66
- * thread information flags:
67
- * TIF_SYSCALL_TRACE - syscall trace active
68
- * TIF_SYSCALL_TRACEPOINT - syscall tracepoint for ftrace
69
- * TIF_SYSCALL_AUDIT - syscall auditing
70
- * TIF_SECOMP - syscall secure computing
71
- * TIF_SIGPENDING - signal pending
72
- * TIF_NEED_RESCHED - rescheduling necessary
73
- * TIF_NOTIFY_RESUME - callback before returning to user
74
- * TIF_USEDFPU - FPU was used by this task this quantum (SMP)
75
- */
76
-#define TIF_SIGPENDING 0
77
-#define TIF_NEED_RESCHED 1
64
+#define TIF_SIGPENDING 0 /* signal pending */
65
+#define TIF_NEED_RESCHED 1 /* rescheduling necessary */
7866 #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
7967 #define TIF_FOREIGN_FPSTATE 3 /* CPU's FP state is not current's */
8068 #define TIF_UPROBE 4 /* uprobe breakpoint or singlestep */
8169 #define TIF_FSCHECK 5 /* Check FS is USER_DS on return */
82
-#define TIF_NOHZ 7
83
-#define TIF_SYSCALL_TRACE 8
84
-#define TIF_SYSCALL_AUDIT 9
85
-#define TIF_SYSCALL_TRACEPOINT 10
86
-#define TIF_SECCOMP 11
70
+#define TIF_MTE_ASYNC_FAULT 6 /* MTE Asynchronous Tag Check Fault */
71
+#define TIF_NOTIFY_SIGNAL 7 /* signal notifications exist */
72
+#define TIF_SYSCALL_TRACE 8 /* syscall trace active */
73
+#define TIF_SYSCALL_AUDIT 9 /* syscall auditing */
74
+#define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */
75
+#define TIF_SECCOMP 11 /* syscall secure computing */
76
+#define TIF_SYSCALL_EMU 12 /* syscall emulation active */
8777 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */
8878 #define TIF_FREEZE 19
8979 #define TIF_RESTORE_SIGMASK 20
....@@ -98,31 +88,42 @@
9888 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
9989 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
10090 #define _TIF_FOREIGN_FPSTATE (1 << TIF_FOREIGN_FPSTATE)
101
-#define _TIF_NOHZ (1 << TIF_NOHZ)
10291 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
10392 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
10493 #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
10594 #define _TIF_SECCOMP (1 << TIF_SECCOMP)
95
+#define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU)
10696 #define _TIF_UPROBE (1 << TIF_UPROBE)
10797 #define _TIF_FSCHECK (1 << TIF_FSCHECK)
10898 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
10999 #define _TIF_32BIT (1 << TIF_32BIT)
110100 #define _TIF_SVE (1 << TIF_SVE)
101
+#define _TIF_MTE_ASYNC_FAULT (1 << TIF_MTE_ASYNC_FAULT)
102
+#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
111103
112104 #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
113105 _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \
114
- _TIF_UPROBE | _TIF_FSCHECK)
106
+ _TIF_UPROBE | _TIF_FSCHECK | _TIF_MTE_ASYNC_FAULT | \
107
+ _TIF_NOTIFY_SIGNAL)
115108
116109 #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
117110 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \
118
- _TIF_NOHZ)
111
+ _TIF_SYSCALL_EMU)
112
+
113
+#ifdef CONFIG_SHADOW_CALL_STACK
114
+#define INIT_SCS \
115
+ .scs_base = init_shadow_call_stack, \
116
+ .scs_sp = init_shadow_call_stack,
117
+#else
118
+#define INIT_SCS
119
+#endif
119120
120121 #define INIT_THREAD_INFO(tsk) \
121122 { \
122123 .flags = _TIF_FOREIGN_FPSTATE, \
123124 .preempt_count = INIT_PREEMPT_COUNT, \
124125 .addr_limit = KERNEL_DS, \
126
+ INIT_SCS \
125127 }
126128
127
-#endif /* __KERNEL__ */
128129 #endif /* __ASM_THREAD_INFO_H */