zephyr/soc/snps
Jisheng Zhang 9842b062bb cpuidle: optimize out weak stub function call for !TRACING
For !TRACING, most arch_cpu_idle and arch_cpu_atomic_idle implementation
relies on the fact that there's weak stub implementations in
subsys/tracing/tracing_none.c, this works, but the arch_cpu_idle sits in
hot code path, so we'd better to make it as efficient as possible.

Take the riscv implementation for example,
Before the patch:

80000a66 <arch_cpu_idle>:
80000a66:	1141                	addi	sp,sp,-16
80000a68:	c606                	sw	ra,12(sp)
80000a6a:	37c5                	jal	80000a4a <sys_trace_idle>
80000a6c:	10500073          	wfi
80000a70:	3ff1                	jal	80000a4c <sys_trace_idle_exit>
80000a72:	47a1                	li	a5,8
80000a74:	3007a073          	csrs	mstatus,a5
80000a78:	40b2                	lw	ra,12(sp)
80000a7a:	0141                	addi	sp,sp,16
80000a7c:	8082                	ret

NOTE: the sys_trace_idle and sys_trace_idle_exit are just stubs when
!TRACING

after the patch:
80000a62 <arch_cpu_idle>:
80000a62:	10500073          	wfi
80000a66:	47a1                	li	a5,8
80000a68:	3007a073          	csrs	mstatus,a5
80000a6c:	8082                	ret

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
2026-03-11 23:17:29 -04:00
..
arc_iot cpuidle: optimize out weak stub function call for !TRACING 2026-03-11 23:17:29 -04:00
emsdp
emsk boards: snps: use correct revision scheme 2025-09-22 17:49:08 -04:00
hsdk style: soc: apply coding style on CMakeLists.txt files 2025-11-17 13:48:03 -05:00
hsdk4xd Revert "arch: arc: replace ARC_EARLY_SOC_INIT with PLATFORM_RESET_HOOK" 2024-10-22 18:28:37 -04:00
nsim snps: riscv: use riscv,isa-extensions dt prop 2026-01-26 14:15:18 +01:00
qemu_arc soc: Remove re-defining some defined types 2024-11-18 07:41:23 -05:00