Simplify P2V and V2P macros - also makes them more useful
This commit is contained in:
parent
8e47d7625f
commit
823560d3ae
@ -6,8 +6,8 @@
|
|||||||
#define P2V(a) ((a) + KERNEL_OFFSET)
|
#define P2V(a) ((a) + KERNEL_OFFSET)
|
||||||
#else
|
#else
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#define V2P(a) ((uintptr_t)(a) - KERNEL_OFFSET)
|
#define V2P(a) ((uintptr_t)(a) & ~KERNEL_OFFSET)
|
||||||
#define P2V(a) ((void *)((uintptr_t)(a) + KERNEL_OFFSET))
|
#define P2V(a) ((void *)((uintptr_t)(a) | KERNEL_OFFSET))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define P1_OFFSET(a) (((a)>>12) & 0x1FF)
|
#define P1_OFFSET(a) (((a)>>12) & 0x1FF)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user