vdso_data.h 846 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #ifndef _VDSO_KDATA_H
  11. #define _VDSO_KDATA_H
  12. #include <rtatomic.h>
  13. #include <vdso_datapage.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. extern struct vdso_data *vdso_data;
  18. rt_inline
  19. struct vdso_data *_get_k_vdso_data(void)
  20. {
  21. return vdso_data;
  22. }
  23. #define get_k_vdso_data _get_k_vdso_data
  24. rt_inline
  25. void rt_vdso_write_begin(struct vdso_data *vd)
  26. {
  27. rt_atomic_add(&vd[CS_HRES_COARSE].seq, 1);
  28. rt_atomic_add(&vd[CS_RAW].seq, 1);
  29. }
  30. rt_inline
  31. void rt_vdso_write_end(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. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif /* _VDSO_KDATA_H */