* [libcpu/arm64] add C11 atomic ticket spinlock
Replace the former implementation of flag-based spinlock which is unfair
Besides, C11 atomic implementation is more readable (it's C anyway),
and maintainable. Cause toolchain can use their builtin optimization and
tune for different micro-architectures. For example armv8.5 introduces a
better instruction. The compiler can help with that when it knows your
target platform in support of it.
Signed-off-by: Shell <smokewood@qq.com>
* fixup: RT_CPUS_NR
---------
Signed-off-by: Shell <smokewood@qq.com>
* [src] add rt_hw_cpu_id() wrapper API
rt_hw_cpu_id() is an unsafe API which should not be used by most codes
directly. It's error-prone because it must be used in proper context,
otherwise it can lead to errors and unpredictable behavior.
This patch adds a wrapper API for rt_hw_cpu_id() to address this risk.
It includes the context-checking functionality and provides a safer
alternative for obtaining CPU IDs, ensuring that it is used correctly
within the appropriate context.
Signed-off-by: Shell <smokewood@qq.com>
* fixup UMP
* update API & comment
* ci: cpp_check
---------
Signed-off-by: Shell <smokewood@qq.com>