Skip to content

Commit 194a2ef

Browse files
authored
AMP-step3: 添加conifg ARCH_ARM_CORTEX_A55, rt_hw_cpu_id_set 适配A55架构, 添加aarch64 rt_… (#7628)
1 parent 690446e commit 194a2ef

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

libcpu/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ config ARCH_ARM_CORTEX_A9
152152
bool
153153
select ARCH_ARM_CORTEX_A
154154

155+
config ARCH_ARM_CORTEX_A55
156+
bool
157+
select ARCH_ARM_CORTEX_A
158+
155159
config ARCH_ARM_SECURE_MODE
156160
bool "Running in secure mode [ARM Cortex-A]"
157161
default n

libcpu/aarch64/common/context_gcc.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
.type rt_hw_cpu_id_set, @function
1919
rt_hw_cpu_id_set:
2020
mrs x0, mpidr_el1 /* MPIDR_EL1: Multi-Processor Affinity Register */
21+
#ifdef ARCH_ARM_CORTEX_A55
22+
lsr x0, x0, #8
23+
#endif
2124
and x0, x0, #15
2225
msr tpidr_el1, x0
2326
ret

libcpu/aarch64/common/cpu.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,4 +374,20 @@ rt_weak void rt_hw_cpu_shutdown()
374374
}
375375
MSH_CMD_EXPORT_ALIAS(rt_hw_cpu_shutdown, shutdown, shutdown machine);
376376

377+
#ifdef RT_USING_CPU_FFS
378+
/**
379+
* This function finds the first bit set (beginning with the least significant bit)
380+
* in value and return the index of that bit.
381+
*
382+
* Bits are numbered starting at 1 (the least significant bit). A return value of
383+
* zero from any of these functions means that the argument was zero.
384+
*
385+
* @return return the index of the first bit set. If value is 0, then this function
386+
* shall return 0.
387+
*/
388+
int __rt_ffs(int value)
389+
{
390+
return __builtin_ffs(value);
391+
}
392+
#endif
377393
/*@}*/

0 commit comments

Comments
 (0)