rt-thread/libcpu
Shell f17f994f8c
[arm64] add hw thread self (#8942)
* [libcpu] arm64: Add hardware thread_self support

This patch introduces hardware-based thread self-identification
for the AArch64 architecture. It optimizes thread management by
using hardware registers to store and access the current thread's
pointer, reducing overhead and improving overall performance.

Changes include:
- Added `ARCH_USING_HW_THREAD_SELF` configuration option.
- Modified `rtdef.h`, `rtsched.h` to conditionally include
  `critical_switch_flag` based on the new config.
- Updated context management in `context_gcc.S`, `cpuport.h`
  to support hardware-based thread self.
- Enhanced `scheduler_mp.c` and `thread.c` to leverage the new
  hardware thread self feature.

These modifications ensure better scheduling and thread handling,
particularly in multi-core environments, by minimizing the
software overhead associated with thread management.

Signed-off-by: Shell <smokewood@qq.com>

* fixup: address suggestion

* fixup: rt_current_thread as global

* scheduler: add cpu object for UP scheduler

Also, maintain the rt_current_thread in cpu object on UP scheduler.

---------

Signed-off-by: Shell <smokewood@qq.com>
2024-05-28 14:27:55 +08:00
..
aarch64 [arm64] add hw thread self (#8942) 2024-05-28 14:27:55 +08:00
arc [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
arm [libcpu] discard rt_current_thread (#8976) 2024-05-26 22:00:17 +08:00
avr32 [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
blackfin [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
c-sky [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
ia32 [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
m16c [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
mips [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
nios [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
ppc [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
risc-v [libcpu] discard rt_current_thread (#8976) 2024-05-26 22:00:17 +08:00
rx [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
sim [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
sparc-v8 [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
ti-dsp [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
unicore32 [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
v850 [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
xilinx [libcpu][SConscript]规范group名为libcpu 2024-02-20 08:39:05 +08:00
Kconfig [arm64] add hw thread self (#8942) 2024-05-28 14:27:55 +08:00
SConscript [libcpu] Fix the build directory issue 2019-03-26 13:36:01 +00:00