vdso_data_page.h 929 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 RT_VDSO_DATA_PAGE_H
  11. #define RT_VDSO_DATA_PAGE_H
  12. #include <stdint.h>
  13. #include <time.h>
  14. #include <sys/types.h>
  15. #include "vdso_constants.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #define RT_VDSO_CLOCK_ID_MAX 16
  20. #define RT_VDSO_NSEC_PER_SEC 1000000000ULL
  21. #define RT_VDSO_FLAG_REALTIME_VALID (1ULL << 0)
  22. enum rt_vdso_clock_data_index
  23. {
  24. RT_VDSO_CLOCK_REALTIME_INDEX = 0,
  25. RT_VDSO_CLOCK_MONOTONIC_INDEX,
  26. RT_VDSO_CLOCK_DATA_COUNT,
  27. };
  28. struct rt_vdso_data_page
  29. {
  30. uint32_t seq_counter;
  31. uint32_t reserved0;
  32. uint64_t flags;
  33. uint64_t counter_last;
  34. uint64_t counter_freq;
  35. struct timespec base_time[RT_VDSO_CLOCK_DATA_COUNT];
  36. };
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif /* RT_VDSO_DATA_PAGE_H */