mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:07:34 +00:00
Kernel: Remove some unnecessary casts to uintptr_t
VirtualAddress is constructible from uintptr_t and const void*. PhysicalAddress is constructible from uintptr_t but not const void*.
This commit is contained in:
parent
a246e9cd7e
commit
4b7a89911c
7 changed files with 41 additions and 31 deletions
|
@ -457,11 +457,21 @@ inline constexpr uintptr_t page_base_of(uintptr_t address)
|
|||
return address & PAGE_MASK;
|
||||
}
|
||||
|
||||
inline uintptr_t page_base_of(const void* address)
|
||||
{
|
||||
return page_base_of((uintptr_t)address);
|
||||
}
|
||||
|
||||
inline constexpr uintptr_t offset_in_page(uintptr_t address)
|
||||
{
|
||||
return address & (~PAGE_MASK);
|
||||
}
|
||||
|
||||
inline uintptr_t offset_in_page(const void* address)
|
||||
{
|
||||
return offset_in_page((uintptr_t)address);
|
||||
}
|
||||
|
||||
class CPUID {
|
||||
public:
|
||||
CPUID(u32 function) { asm volatile("cpuid"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue