forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
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,10 +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 */
46
- int preempt_lazy_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
+ };
4744 #ifdef CONFIG_SHADOW_CALL_STACK
48
- void *shadow_call_stack;
45
+ void *scs_base;
46
+ void *scs_sp;
4947 #endif
5048 };
5149
....@@ -63,29 +61,19 @@
6361
6462 #endif
6563
66
-/*
67
- * thread information flags:
68
- * TIF_SYSCALL_TRACE - syscall trace active
69
- * TIF_SYSCALL_TRACEPOINT - syscall tracepoint for ftrace
70
- * TIF_SYSCALL_AUDIT - syscall auditing
71
- * TIF_SECOMP - syscall secure computing
72
- * TIF_SIGPENDING - signal pending
73
- * TIF_NEED_RESCHED - rescheduling necessary
74
- * TIF_NOTIFY_RESUME - callback before returning to user
75
- * TIF_USEDFPU - FPU was used by this task this quantum (SMP)
76
- */
77
-#define TIF_SIGPENDING 0
78
-#define TIF_NEED_RESCHED 1
64
+#define TIF_SIGPENDING 0 /* signal pending */
65
+#define TIF_NEED_RESCHED 1 /* rescheduling necessary */
7966 #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
8067 #define TIF_FOREIGN_FPSTATE 3 /* CPU's FP state is not current's */
8168 #define TIF_UPROBE 4 /* uprobe breakpoint or singlestep */
8269 #define TIF_FSCHECK 5 /* Check FS is USER_DS on return */
83
-#define TIF_NEED_RESCHED_LAZY 6
84
-#define TIF_NOHZ 7
85
-#define TIF_SYSCALL_TRACE 8
86
-#define TIF_SYSCALL_AUDIT 9
87
-#define TIF_SYSCALL_TRACEPOINT 10
88
-#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 */
8977 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */
9078 #define TIF_FREEZE 19
9179 #define TIF_RESTORE_SIGMASK 20
....@@ -100,33 +88,42 @@
10088 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
10189 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
10290 #define _TIF_FOREIGN_FPSTATE (1 << TIF_FOREIGN_FPSTATE)
103
-#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY)
104
-#define _TIF_NOHZ (1 << TIF_NOHZ)
10591 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
10692 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
10793 #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
10894 #define _TIF_SECCOMP (1 << TIF_SECCOMP)
95
+#define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU)
10996 #define _TIF_UPROBE (1 << TIF_UPROBE)
11097 #define _TIF_FSCHECK (1 << TIF_FSCHECK)
11198 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
11299 #define _TIF_32BIT (1 << TIF_32BIT)
113100 #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)
114103
115104 #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
116105 _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \
117
- _TIF_UPROBE | _TIF_FSCHECK | _TIF_NEED_RESCHED_LAZY)
106
+ _TIF_UPROBE | _TIF_FSCHECK | _TIF_MTE_ASYNC_FAULT | \
107
+ _TIF_NOTIFY_SIGNAL)
118108
119
-#define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)
120109 #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
121110 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \
122
- _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
123120
124121 #define INIT_THREAD_INFO(tsk) \
125122 { \
126123 .flags = _TIF_FOREIGN_FPSTATE, \
127124 .preempt_count = INIT_PREEMPT_COUNT, \
128125 .addr_limit = KERNEL_DS, \
126
+ INIT_SCS \
129127 }
130128
131
-#endif /* __KERNEL__ */
132129 #endif /* __ASM_THREAD_INFO_H */