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