rt-thread-official/libcpu/aarch64/common
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
..
SConscript [libcpu][aarch64] Fixed the rt_hw_secondary_cpu_bsp_start() bug (#8898) 2024-05-08 19:48:17 +08:00
armv8.h AArch64: fixup fpu storage's size in stack and append Q16 ~ Q31 (#7815) 2023-07-15 15:21:23 +08:00
asm-fpu.h AArch64: fixup fpu storage's size in stack and append Q16 ~ Q31 (#7815) 2023-07-15 15:21:23 +08:00
asm-generic.h [libcpu][component][debug] add debug info for gdb (#7033) 2023-05-14 23:48:16 +08:00
atomic_aarch64.c AArch64: fixup HW atomic_t ops type from dword to qword (#7861) 2023-07-25 15:34:57 +08:00
backtrace.c sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
cache.S [fixup] add cache maintenance ops; 2023-02-21 08:48:49 +08:00
cache.h [libcpu/aarch64] fix cache invalidate operation (#7363) 2023-04-26 17:17:42 +08:00
cache_ops.c [rt-smart] move sys_cacheflush to lwp_syscall.c (#7048) 2023-03-17 15:11:38 +08:00
context_gcc.S [arm64] add hw thread self (#8942) 2024-05-28 14:27:55 +08:00
cp15.h [smart/aarch64] code sync (#6750) 2022-12-20 17:49:37 +08:00
cpu.c [arm64] add hw thread self (#8942) 2024-05-28 14:27:55 +08:00
cpu.h [components][drivers]add pic-gic (#8388) 2024-02-29 09:39:56 +08:00
cpu_gcc.S [libcpu/arm64] add C11 atomic ticket spinlock (#8882) 2024-05-16 15:45:12 +08:00
cpu_ops_common.h [rt-smart] kernel virtual memory management layer (#6809) 2023-01-08 21:08:55 -05:00
cpu_psci.c [libcpu][aarch64] 使用设备树对CPU进行初始化 (#8221) 2023-11-28 14:20:11 +08:00
cpu_spin_table.c [libcpu][aarch64] 使用设备树对CPU进行初始化 (#8221) 2023-11-28 14:20:11 +08:00
cpuport.h [arm64] add hw thread self (#8942) 2024-05-28 14:27:55 +08:00
entry_point.h [smart/aarch64] code sync (#6750) 2022-12-20 17:49:37 +08:00
exception.c Sync dfs lwp (#8123) 2023-10-17 13:07:59 +08:00
gic.c [fix]:修复GICv2、GICv3中断触发模式设置无效的问题 (#7358) 2023-04-24 17:06:31 +08:00
gic.h [smart/aarch64] code sync (#6750) 2022-12-20 17:49:37 +08:00
gicv3.c [bsp/phytium]中断相关修改 (#8742) 2024-04-11 00:09:17 +08:00
gicv3.h [bsp/phytium]中断相关修改 (#8742) 2024-04-11 00:09:17 +08:00
gtimer.c 🐞 fix(ktime): fix wrong boottime 2023-07-27 11:35:29 +08:00
gtimer.h [smart/aarch64] code sync (#6750) 2022-12-20 17:49:37 +08:00
hypercall.c [smart/aarch64] code sync (#6750) 2022-12-20 17:49:37 +08:00
hypercall.h [smart/aarch64] code sync (#6750) 2022-12-20 17:49:37 +08:00
interrupt.c [components][drivers] fix posix tty, and add more baudrate (#8683) 2024-04-01 21:23:04 +08:00
interrupt.h 更新gicv3中断亲和性设置,重构api: arm_gic_send_affinity_sgi, 增加AMP宏判断, rt_ioremap和宏RT_USING_SMART解耦 2023-06-19 11:35:46 +08:00
mmu.c [libcpu/arm64] dealing with mem region out of kernel space (#8847) 2024-05-08 09:23:31 +08:00
mmu.h [libcpu/arm64] dealing with mem region out of kernel space (#8847) 2024-05-08 09:23:31 +08:00
psci.c [libcpu][aarch64] 使用设备树对CPU进行初始化 (#8221) 2023-11-28 14:20:11 +08:00
psci.h [libcpu][aarch64] 使用设备树对CPU进行初始化 (#8221) 2023-11-28 14:20:11 +08:00
setup.c [libcpu][aarch64] Fixed the rt_hw_secondary_cpu_bsp_start() bug (#8898) 2024-05-08 19:48:17 +08:00
setup.h [libcpu][aarch64] 使用设备树对CPU进行初始化 (#8221) 2023-11-28 14:20:11 +08:00
smccc.S [smart/aarch64] code sync (#6750) 2022-12-20 17:49:37 +08:00
smccc.h [smart/aarch64] code sync (#6750) 2022-12-20 17:49:37 +08:00
stack.c [bsp/rpi4] fixup startup failure (#8754) 2024-04-11 00:02:49 +08:00
startup_gcc.S [smart/aarch64] code sync (#6750) 2022-12-20 17:49:37 +08:00
tlb.h [fix] pipeline 2023-02-21 08:48:49 +08:00
trap.c [components][drivers]add pic-gic (#8388) 2024-02-29 09:39:56 +08:00
vector_gcc.S [smart/aarch64] code sync (#6750) 2022-12-20 17:49:37 +08:00