diff --git a/include/rtdef.h b/include/rtdef.h index 9994c67613..13a3c743ad 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -727,11 +727,11 @@ enum #define RT_THREAD_CTRL_INFO 0x03 /**< Get thread information. */ #define RT_THREAD_CTRL_BIND_CPU 0x04 /**< Set thread bind cpu. */ +#ifdef RT_USING_SMP + #define RT_CPU_DETACHED RT_CPUS_NR /**< The thread not running on cpu. */ #define RT_CPU_MASK ((1 << RT_CPUS_NR) - 1) /**< All CPUs mask bit. */ -#ifdef RT_USING_SMP - #ifndef RT_SCHEDULE_IPI #define RT_SCHEDULE_IPI 0 #endif /* RT_SCHEDULE_IPI */ @@ -740,8 +740,6 @@ enum #define RT_STOP_IPI 1 #endif /* RT_STOP_IPI */ -#endif /* RT_USING_SMP */ - struct rt_cpu_usage_stats { rt_uint64_t user; @@ -778,6 +776,8 @@ struct rt_cpu }; typedef struct rt_cpu *rt_cpu_t; +#endif /* RT_USING_SMP */ + struct rt_thread; #ifdef RT_USING_SMART diff --git a/include/rthw.h b/include/rthw.h index 60f97f2329..ed512ac14f 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -127,8 +127,6 @@ void rt_hw_local_irq_enable(rt_base_t level); #define rt_hw_interrupt_disable rt_cpus_lock #define rt_hw_interrupt_enable rt_cpus_unlock #else -#define rt_hw_local_irq_disable rt_hw_interrupt_disable -#define rt_hw_local_irq_enable rt_hw_interrupt_enable rt_base_t rt_hw_interrupt_disable(void); void rt_hw_interrupt_enable(rt_base_t level); #endif /*RT_USING_SMP*/ diff --git a/include/rtthread.h b/include/rtthread.h index 883af363b2..610115134c 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -624,11 +624,11 @@ void rt_interrupt_leave(void); rt_base_t rt_cpus_lock(void); void rt_cpus_unlock(rt_base_t level); -#endif /* RT_USING_SMP */ - struct rt_cpu *rt_cpu_self(void); struct rt_cpu *rt_cpu_index(int index); +#endif /* RT_USING_SMP */ + /* * the number of nested interrupts. */