Kernel: Do not do integer to pointer conversion in constexpr functions

Creating pointers from arbitrary values is not a valid thing to do in
constexpr functions. Furthermore, this functions is always called with
runtime values anyways, so there's no use in having it be constexpr.
Instead, make it ALWAYS_INLINE.
This commit is contained in:
Daniel Bertalan 2021-12-04 09:11:10 +01:00 committed by Brian Gianforcaro
parent 8e2d0c8d5c
commit 9b90f1fed5
Notes: sideshowbarker 2024-07-17 23:11:18 +09:00

View file

@ -48,7 +48,7 @@ constexpr u32 INNER_SHAREABLE = (3 << 8);
constexpr u32 NORMAL_MEMORY = (0 << 2);
constexpr u32 DEVICE_MEMORY = (1 << 2);
constexpr u64* descriptor_to_pointer(FlatPtr descriptor)
ALWAYS_INLINE static u64* descriptor_to_pointer(FlatPtr descriptor)
{
return (u64*)(descriptor & DESCRIPTOR_MASK);
}