summaryrefslogtreecommitdiff
path: root/arch/um/include/asm/current.h
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin.berg@intel.com>2024-11-11 11:29:10 +0100
committerJohannes Berg <johannes.berg@intel.com>2024-11-12 14:50:31 +0100
commit2f681ba4b352cdd5658ed2a96062375a12839755 (patch)
tree8cc0179eb7c009f8c155acee180270918b93af23 /arch/um/include/asm/current.h
parent0f659ff362eac69777c4c191b7e5ccb19d76c67d (diff)
um: move thread info into task
This selects the THREAD_INFO_IN_TASK option for UM and changes the way that the current task is discovered. This is trivial though, as UML already tracks the current task in cpu_tasks[] and this can be used to retrieve it. Also remove the signal handler code that copies the thread information into the IRQ stack. It is obsolete now, which also means that the mentioned race condition cannot happen anymore. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Reviewed-by: Hajime Tazaki <thehajime@gmail.com> Link: https://patch.msgid.link/20241111102910.46512-1-benjamin@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/include/asm/current.h')
-rw-r--r--arch/um/include/asm/current.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/um/include/asm/current.h b/arch/um/include/asm/current.h
new file mode 100644
index 000000000000..de64e032d66c
--- /dev/null
+++ b/arch/um/include/asm/current.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __ASM_CURRENT_H
+#define __ASM_CURRENT_H
+
+#include <linux/compiler.h>
+#include <linux/threads.h>
+
+#ifndef __ASSEMBLY__
+
+struct task_struct;
+extern struct task_struct *cpu_tasks[NR_CPUS];
+
+static __always_inline struct task_struct *get_current(void)
+{
+ return cpu_tasks[0];
+}
+
+
+#define current get_current()
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_CURRENT_H */