1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:35:08 +00:00
serenity/Kernel/API/TimePage.h
Andreas Kling aaead6f332 Kernel: Only expose CLOCK_REALTIME_COARSE via the kernel time page
Non-COARSE clock sources may probably still require a syscall.
2021-08-10 21:51:05 +02:00

30 lines
475 B
C++

/*
* 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;
}
struct TimePage {
volatile u32 update1;
struct timespec clocks[CLOCK_ID_COUNT];
volatile u32 update2;
};
}