Skip to content

Commit ed1b1f2

Browse files
committed
改成 irqsave 语义的锁
1 parent 98f3bb9 commit ed1b1f2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

components/lwp/arch/common/vdso_kernel.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void rt_vdso_set_realtime(const struct timespec *realtime)
203203
struct timespec monotonic;
204204
rt_uint64_t counter;
205205
rt_uint64_t freq;
206-
206+
rt_base_t level;
207207
if (rt_vdso_runtime_status != RT_EOK || realtime == RT_NULL)
208208
{
209209
return;
@@ -214,13 +214,13 @@ void rt_vdso_set_realtime(const struct timespec *realtime)
214214
return;
215215
}
216216

217-
rt_hw_spin_lock(&rt_vdso_data_page_lock);
217+
level = rt_spin_lock_irqsave(&rt_vdso_data_page_lock);
218218
rt_vdso_data_page_write_begin(rt_vdso_kernel_data_page);
219219
rt_vdso_realtime_offset = rt_vdso_timespec_subtract(realtime, &monotonic);
220220
rt_vdso_realtime_offset_ready = RT_TRUE;
221221
rt_vdso_store_clock_snapshot(&monotonic, counter, freq);
222222
rt_vdso_data_page_write_end(rt_vdso_kernel_data_page);
223-
rt_hw_spin_unlock(&rt_vdso_data_page_lock);
223+
rt_spin_unlock_irqrestore(&rt_vdso_data_page_lock, level);
224224
}
225225

226226
static void *rt_vdso_map_physical_pages(struct rt_lwp *lwp, void *user_va,

0 commit comments

Comments
 (0)