mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
Add initial symmetric multi-processing (SMP) support to UML. With this support enabled, users can tell UML to start multiple virtual processors, each represented as a separate host thread. In UML, kthreads and normal threads (when running in kernel mode) can be scheduled and executed simultaneously on different virtual processors. However, the userspace code of normal threads still runs within their respective single-threaded stubs. That is, SMP support is currently available both within the kernel and across different processes, but still remains limited within threads of the same process in userspace. Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Link: https://patch.msgid.link/20251027001815.1666872-6-tiwei.bie@linux.dev Signed-off-by: Johannes Berg <johannes.berg@intel.com>
25 lines
449 B
C
25 lines
449 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ASM_CURRENT_H
|
|
#define __ASM_CURRENT_H
|
|
|
|
#include <linux/compiler.h>
|
|
#include <linux/threads.h>
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
#include <shared/smp.h>
|
|
|
|
struct task_struct;
|
|
extern struct task_struct *cpu_tasks[NR_CPUS];
|
|
|
|
static __always_inline struct task_struct *get_current(void)
|
|
{
|
|
return cpu_tasks[uml_curr_cpu()];
|
|
}
|
|
|
|
#define current get_current()
|
|
|
|
#endif /* __ASSEMBLER__ */
|
|
|
|
#endif /* __ASM_CURRENT_H */
|