From 0c29bed30f81f79f3265813b186d1091e4411dc4 Mon Sep 17 00:00:00 2001 From: wangqinglin <53550140+HelloByeAll@users.noreply.github.com> Date: Mon, 5 Jun 2023 16:43:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E6=A0=B8Kconfig=E5=A2=9E=E5=8A=A0AMP?= =?UTF-8?q?=E9=80=89=E9=A1=B9,=20api:rt=5Fhw=5Fcpu=5Fid=E5=92=8C=20RT=5FUS?= =?UTF-8?q?ING=5FSMP=E5=AE=8F=E8=A7=A3=E8=80=A6=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?rt=5Fhw=5Fipi=5Fsend=E5=AF=B9RT=5FUSING=5FAMP=E7=9A=84=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/rthw.h | 16 +++++++++------- src/Kconfig | 18 +++++++++++++++++- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/include/rthw.h b/include/rthw.h index 0fe01f3073..21b28072ce 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -160,6 +160,15 @@ void rt_hw_exception_install(rt_err_t (*exception_handle)(void *context)); */ void rt_hw_us_delay(rt_uint32_t us); +int rt_hw_cpu_id(void); + +#if defined(RT_USING_SMP) || defined(RT_USING_AMP) +/** + * ipi function + */ +void rt_hw_ipi_send(int ipi_vector, unsigned int cpu_mask); +#endif + #ifdef RT_USING_SMP #include /* for spinlock from arch */ @@ -172,8 +181,6 @@ void rt_hw_spin_lock_init(rt_hw_spinlock_t *lock); void rt_hw_spin_lock(rt_hw_spinlock_t *lock); void rt_hw_spin_unlock(rt_hw_spinlock_t *lock); -int rt_hw_cpu_id(void); - extern rt_hw_spinlock_t _cpus_lock; extern rt_hw_spinlock_t _rt_critical_lock; @@ -185,11 +192,6 @@ extern rt_hw_spinlock_t _rt_critical_lock; #define RT_DEFINE_SPINLOCK(x) rt_hw_spinlock_t x = __RT_HW_SPIN_LOCK_UNLOCKED(x) #define RT_DECLARE_SPINLOCK(x) -/** - * ipi function - */ -void rt_hw_ipi_send(int ipi_vector, unsigned int cpu_mask); - /** * boot secondary cpu */ diff --git a/src/Kconfig b/src/Kconfig index 4a4b06413a..2cc250de38 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -38,6 +38,22 @@ config RT_USING_SMART help RT-Thread Smart is a microkernel based operating system on RT-Thread. +config RT_USING_AMP + bool "Enable AMP(Asymmetric Multi-Processing)" + default n + if RT_USING_AMP + choice + prompt "Select the AMP role" + default RT_AMP_SLAVE + + config RT_AMP_MASTER + bool "amp role MASTER" + + config RT_AMP_SLAVE + bool "amp role SLAVE" + endchoice + endif + config RT_USING_SMP bool "Enable SMP(Symmetric multiprocessing)" default n @@ -50,7 +66,7 @@ config RT_USING_SMP config RT_CPUS_NR int "Number of CPUs" default 2 - depends on RT_USING_SMP + depends on RT_USING_SMP || RT_USING_AMP help Number of CPUs in the system