PAGE_SHIFT is used by both Virtio and Xen as a contant when moving addresses from guest space to machine space, in order to have a single definition PAGE_SHIFT has been moved to memmap.h. This has no impact on neither virtio or xen.
Signed-off-by: Daniel Castro evil.dani@gmail.com --- src/memmap.h | 2 ++ src/virtio-ring.h | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/memmap.h b/src/memmap.h index 01c7ddb..8674168 100644 --- a/src/memmap.h +++ b/src/memmap.h @@ -21,6 +21,8 @@ void memmap_finalize(void);
// A typical OS page size #define PAGE_SIZE 4096 +//Used by Virtio and Xen +#define PAGE_SHIFT 12
// e820 map storage (defined in system.c) extern struct e820entry e820_list[]; diff --git a/src/virtio-ring.h b/src/virtio-ring.h index b7a7aaf..fd30778 100644 --- a/src/virtio-ring.h +++ b/src/virtio-ring.h @@ -4,7 +4,7 @@ #include "types.h" // u64 #include "memmap.h" // PAGE_SIZE
-#define PAGE_SHIFT 12 + #define PAGE_MASK (PAGE_SIZE-1)
#define virt_to_phys(v) (unsigned long)(v)