summaryrefslogtreecommitdiff
path: root/Kernel/API/TimePage.h
blob: 76e6b44f8f4241cc11ddfd9d91747ea033ad0b99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/Types.h>

#ifdef KERNEL
#    include <Kernel/UnixTypes.h>
#else
#    include <time.h>
#endif

namespace Kernel {

inline bool time_page_supports(clockid_t clock_id)
{
    return clock_id == CLOCK_REALTIME_COARSE || clock_id == CLOCK_MONOTONIC_COARSE;
}

struct TimePage {
    volatile u32 update1;
    struct timespec clocks[CLOCK_ID_COUNT];
    volatile u32 update2;
};

}