@@ -29,10 +29,20 @@ void *_cpus_lock_pc = 0;
2929
3030#endif /* RT_DEBUGING_SPINLOCK */
3131
32+ /**
33+ * @addtogroup group_thread_comm
34+ *
35+ * @cond DOXYGEN_SMP
36+ *
37+ * @{
38+ */
39+
3240/**
3341 * @brief Initialize a static spinlock object.
3442 *
3543 * @param lock is a pointer to the spinlock to initialize.
44+ *
45+ * @note This function has UP version and MP version.
3646 */
3747void rt_spin_lock_init (struct rt_spinlock * lock )
3848{
@@ -43,10 +53,12 @@ RTM_EXPORT(rt_spin_lock_init)
4353/**
4454 * @brief This function will lock the spinlock, will lock the thread scheduler.
4555 *
46- * @note If the spinlock is locked, the current CPU will keep polling the spinlock state
47- * until the spinlock is unlocked.
56+ * If the spinlock is locked, the current CPU will keep polling the spinlock state
57+ * until the spinlock is unlocked.
4858 *
4959 * @param lock is a pointer to the spinlock.
60+ *
61+ * @note This function has UP version and MP version.
5062 */
5163void rt_spin_lock (struct rt_spinlock * lock )
5264{
@@ -59,9 +71,11 @@ RTM_EXPORT(rt_spin_lock)
5971/**
6072 * @brief This function will unlock the spinlock, will unlock the thread scheduler.
6173 *
62- * @note If the scheduling function is called before unlocking, it will be scheduled in this function.
74+ * If the scheduling function is called before unlocking, it will be scheduled in this function.
6375 *
6476 * @param lock is a pointer to the spinlock.
77+ *
78+ * @note This function has UP version and MP version.
6579 */
6680void rt_spin_unlock (struct rt_spinlock * lock )
6781{
@@ -75,12 +89,14 @@ RTM_EXPORT(rt_spin_unlock)
7589/**
7690 * @brief This function will disable the local interrupt and then lock the spinlock, will lock the thread scheduler.
7791 *
78- * @note If the spinlock is locked, the current CPU will keep polling the spinlock state
79- * until the spinlock is unlocked.
92+ * If the spinlock is locked, the current CPU will keep polling the spinlock state
93+ * until the spinlock is unlocked.
8094 *
8195 * @param lock is a pointer to the spinlock.
8296 *
8397 * @return Return current cpu interrupt status.
98+ *
99+ * @note This function has UP version and MP version.
84100 */
85101rt_base_t rt_spin_lock_irqsave (struct rt_spinlock * lock )
86102{
@@ -97,11 +113,13 @@ RTM_EXPORT(rt_spin_lock_irqsave)
97113/**
98114 * @brief This function will unlock the spinlock and then restore current cpu interrupt status, will unlock the thread scheduler.
99115 *
100- * @note If the scheduling function is called before unlocking, it will be scheduled in this function.
116+ * If the scheduling function is called before unlocking, it will be scheduled in this function.
101117 *
102118 * @param lock is a pointer to the spinlock.
103119 *
104120 * @param level is interrupt status returned by rt_spin_lock_irqsave().
121+ *
122+ * @note This function has UP version and MP version.
105123 */
106124void rt_spin_unlock_irqrestore (struct rt_spinlock * lock , rt_base_t level )
107125{
@@ -118,6 +136,8 @@ RTM_EXPORT(rt_spin_unlock_irqrestore)
118136 * @brief This fucntion will return current cpu object.
119137 *
120138 * @return Return a pointer to the current cpu object.
139+ *
140+ * @note This function has UP version and MP version.
121141 */
122142struct rt_cpu * rt_cpu_self (void )
123143{
@@ -130,6 +150,8 @@ struct rt_cpu *rt_cpu_self(void)
130150 * @param index is the index of target cpu object.
131151 *
132152 * @return Return a pointer to the cpu object corresponding to index.
153+ *
154+ * @note This function has UP version and MP version.
133155 */
134156struct rt_cpu * rt_cpu_index (int index )
135157{
@@ -140,6 +162,8 @@ struct rt_cpu *rt_cpu_index(int index)
140162 * @brief This function will lock all cpus's scheduler and disable local irq.
141163 *
142164 * @return Return current cpu interrupt status.
165+ *
166+ * @note This function only has MP version.
143167 */
144168rt_base_t rt_cpus_lock (void )
145169{
@@ -176,6 +200,8 @@ RTM_EXPORT(rt_cpus_lock);
176200 * @brief This function will restore all cpus's scheduler and restore local irq.
177201 *
178202 * @param level is interrupt status returned by rt_cpus_lock().
203+ *
204+ * @note This function only has MP version.
179205 */
180206void rt_cpus_unlock (rt_base_t level )
181207{
@@ -211,6 +237,8 @@ RTM_EXPORT(rt_cpus_unlock);
211237 * If target thread not locked the cpus then unlock the cpus lock.
212238 *
213239 * @param thread is a pointer to the target thread.
240+ *
241+ * @note This function only has MP version.
214242 */
215243void rt_cpus_lock_status_restore (struct rt_thread * thread )
216244{
@@ -228,6 +256,8 @@ RTM_EXPORT(rt_cpus_lock_status_restore);
228256 * @brief Get logical CPU ID
229257 *
230258 * @return logical CPU ID
259+ *
260+ * @note This function only has MP version.
231261 */
232262rt_base_t rt_cpu_get_id (void )
233263{
@@ -238,3 +268,9 @@ rt_base_t rt_cpu_get_id(void)
238268
239269 return rt_hw_cpu_id ();
240270}
271+
272+ /**
273+ * @}
274+ *
275+ * @endcond
276+ */
0 commit comments