diff options
| author | Shell <[email protected]> | 2024-02-23 17:49:15 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-23 17:49:15 +0800 |
| commit | 71560bafb5735220696ca24a42ba4a668b55949b (patch) | |
| tree | 236df5973a1fd5b6f0cc9f6c6b6a2d71fd069203 /libcpu | |
| parent | 6fe69d7431ed54fcea863ed68d7c4f9746e771b0 (diff) | |
🎯 Sync smart & scheduler codes (#8537)
Signed-off-by: Shell <[email protected]>
Co-authored-by: xqyjlj <[email protected]>
Diffstat (limited to 'libcpu')
| -rw-r--r-- | libcpu/aarch64/common/cpuport.h | 1 | ||||
| -rw-r--r-- | libcpu/aarch64/cortex-a/entry_point.S | 2 | ||||
| -rw-r--r-- | libcpu/arm/cortex-a/cpuport.c | 7 | ||||
| -rw-r--r-- | libcpu/arm/cortex-a/cpuport.h | 2 | ||||
| -rw-r--r-- | libcpu/risc-v/virt64/cpuport.c | 5 |
5 files changed, 16 insertions, 1 deletions
diff --git a/libcpu/aarch64/common/cpuport.h b/libcpu/aarch64/common/cpuport.h index 1108ce98fe..2def65b474 100644 --- a/libcpu/aarch64/common/cpuport.h +++ b/libcpu/aarch64/common/cpuport.h @@ -13,6 +13,7 @@ #define CPUPORT_H__ #include <armv8.h> +#include <rtcompiler.h> #include <rtdef.h> #ifdef RT_USING_SMP diff --git a/libcpu/aarch64/cortex-a/entry_point.S b/libcpu/aarch64/cortex-a/entry_point.S index 087cac6e7a..e8634612e2 100644 --- a/libcpu/aarch64/cortex-a/entry_point.S +++ b/libcpu/aarch64/cortex-a/entry_point.S @@ -151,7 +151,7 @@ _secondary_cpu_entry: #else bl rt_hw_cpu_id_set mrs x0, tpidr_el1 -#endif +#endif /* RT_USING_OFW */ /* Set current cpu's stack top */ sub x0, x0, #1 diff --git a/libcpu/arm/cortex-a/cpuport.c b/libcpu/arm/cortex-a/cpuport.c index ac947fb823..064db011b0 100644 --- a/libcpu/arm/cortex-a/cpuport.c +++ b/libcpu/arm/cortex-a/cpuport.c @@ -103,4 +103,11 @@ int __rt_ffs(int value) } #endif +rt_bool_t rt_hw_interrupt_is_disabled(void) +{ + int rc; + __asm__ volatile("mrs %0, cpsr" : "=r" (rc)); + return !!(rc & 0x80); +} + /*@}*/ diff --git a/libcpu/arm/cortex-a/cpuport.h b/libcpu/arm/cortex-a/cpuport.h index 5aec5a84bc..5fb067999c 100644 --- a/libcpu/arm/cortex-a/cpuport.h +++ b/libcpu/arm/cortex-a/cpuport.h @@ -10,6 +10,8 @@ #ifndef CPUPORT_H__ #define CPUPORT_H__ +#include <rtcompiler.h> + /* the exception stack without VFP registers */ struct rt_hw_exp_stack { diff --git a/libcpu/risc-v/virt64/cpuport.c b/libcpu/risc-v/virt64/cpuport.c index 33d9e83c04..126ec9f825 100644 --- a/libcpu/risc-v/virt64/cpuport.c +++ b/libcpu/risc-v/virt64/cpuport.c @@ -56,6 +56,11 @@ void *_rt_hw_stack_init(rt_ubase_t *sp, rt_ubase_t ra, rt_ubase_t sstatus) return (void *)sp; } +int rt_hw_cpu_id(void) +{ + return 0; +} + /** * This function will initialize thread stack, we assuming * when scheduler restore this new thread, context will restore |
