1 /* 2 * Copyright (c) 2006-2024 RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2024-07-04 rcitach init ver. 9 */ 10 11 #ifndef _VDSO_KDATA_H 12 #define _VDSO_KDATA_H 13 14 #include <rtatomic.h> 15 #include <vdso_datapage.h> 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 extern struct vdso_data *vdso_data; 22 23 rt_inline _get_k_vdso_data(void)24struct vdso_data *_get_k_vdso_data(void) 25 { 26 return vdso_data; 27 } 28 #define get_k_vdso_data _get_k_vdso_data 29 30 rt_inline rt_vdso_write_begin(struct vdso_data * vd)31void rt_vdso_write_begin(struct vdso_data *vd) 32 { 33 rt_atomic_add(&vd[CS_HRES_COARSE].seq, 1); 34 rt_atomic_add(&vd[CS_RAW].seq, 1); 35 } 36 37 rt_inline rt_vdso_write_end(struct vdso_data * vd)38void rt_vdso_write_end(struct vdso_data *vd) 39 { 40 rt_atomic_add(&vd[CS_HRES_COARSE].seq, 1); 41 rt_atomic_add(&vd[CS_RAW].seq, 1); 42 } 43 44 #ifdef __cplusplus 45 } 46 #endif 47 48 #endif /* _VDSO_KDATA_H */ 49