TimePage.h 513 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Types.h>
  8. #ifdef KERNEL
  9. # include <Kernel/UnixTypes.h>
  10. #else
  11. # include <time.h>
  12. #endif
  13. namespace Kernel {
  14. inline bool time_page_supports(clockid_t clock_id)
  15. {
  16. return clock_id == CLOCK_REALTIME_COARSE || clock_id == CLOCK_MONOTONIC_COARSE;
  17. }
  18. struct TimePage {
  19. volatile u32 update1;
  20. struct timespec clocks[CLOCK_ID_COUNT];
  21. volatile u32 update2;
  22. };
  23. }