1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 03:27:44 +00:00

Everywhere: Make the codebase more architecture aware

This commit is contained in:
Undefine 2022-07-22 20:48:24 +02:00 committed by Brian Gianforcaro
parent 6c4b5775e1
commit 97cc33ca47
22 changed files with 108 additions and 36 deletions

View file

@ -45,8 +45,10 @@ Optional<FlatPtr> kernel_base()
auto kernel_base_str = String { file.value()->read_all(), NoChomp };
#if ARCH(I386)
using AddressType = u32;
#else
#elif ARCH(X86_64) || ARCH(AARCH64)
using AddressType = u64;
#else
# error Unknown architecture
#endif
auto maybe_kernel_base = kernel_base_str.to_uint<AddressType>();
if (!maybe_kernel_base.has_value()) {