mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:57:44 +00:00
Use uintptr_t instead of u32 when storing pointers as integers
uintptr_t is 32-bit or 64-bit depending on the target platform. This will help us write pointer size agnostic code so that when the day comes that we want to do a 64-bit port, we'll be in better shape.
This commit is contained in:
parent
e07b34b9b8
commit
a246e9cd7e
14 changed files with 110 additions and 110 deletions
|
@ -33,7 +33,7 @@
|
|||
#include <Kernel/kstdio.h>
|
||||
|
||||
#define PAGE_SIZE 4096
|
||||
#define PAGE_MASK 0xfffff000
|
||||
#define PAGE_MASK ((uintptr_t)0xfffff000u)
|
||||
|
||||
class MemoryManager;
|
||||
class PageDirectory;
|
||||
|
@ -452,12 +452,12 @@ struct [[gnu::aligned(16)]] FPUState
|
|||
u8 buffer[512];
|
||||
};
|
||||
|
||||
inline constexpr u32 page_base_of(u32 address)
|
||||
inline constexpr uintptr_t page_base_of(uintptr_t address)
|
||||
{
|
||||
return address & PAGE_MASK;
|
||||
}
|
||||
|
||||
inline constexpr u32 offset_in_page(u32 address)
|
||||
inline constexpr uintptr_t offset_in_page(uintptr_t address)
|
||||
{
|
||||
return address & (~PAGE_MASK);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue