x86_64: fix page sizes to be derived from sizes in bits.
authorSimon Gerber <simon.gerber@hp.com>
Tue, 17 Jun 2014 00:17:01 +0000 (17:17 -0700)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Thu, 30 Apr 2015 19:19:27 +0000 (21:19 +0200)
Signed-off-by: Simon Gerber <simon.gerber@hp.com>

include/target/x86_64/barrelfish_kpi/paging_target.h

index 0c4725d..da46f7f 100644 (file)
@@ -5,6 +5,7 @@
 
 /*
  * Copyright (c) 2010-2013 ETH Zurich.
+ * Copyright (c) 2014, HP Labs.
  * All rights reserved.
  *
  * This file is distributed under the terms in the attached LICENSE file.
@@ -21,19 +22,19 @@ typedef uint64_t paging_x86_64_flags_t;
 
 /** The system's base page size is 4kB */
 #define X86_64_BASE_PAGE_BITS                  12
-#define X86_64_BASE_PAGE_SIZE                  0x1000
+#define X86_64_BASE_PAGE_SIZE                  (1<<X86_64_BASE_PAGE_BITS)
 #define X86_64_BASE_PAGE_MASK                  (X86_64_BASE_PAGE_SIZE - 1)
 #define X86_64_BASE_PAGE_OFFSET(a)             ((a) & X86_64_BASE_PAGE_MASK)
 
 /** The system's large page size is 2MB */
 #define X86_64_LARGE_PAGE_BITS                  21
-#define X86_64_LARGE_PAGE_SIZE                  0x200000
+#define X86_64_LARGE_PAGE_SIZE                  (1<<X86_64_LARGE_PAGE_BITS)
 #define X86_64_LARGE_PAGE_MASK                  (X86_64_LARGE_PAGE_SIZE - 1)
 #define X86_64_LARGE_PAGE_OFFSET(a)             ((a) & X86_64_LARGE_PAGE_MASK)
 
 /** The system's huge page size is 1GB */
 #define X86_64_HUGE_PAGE_BITS                  30
-#define X86_64_HUGE_PAGE_SIZE                  0x20000000
+#define X86_64_HUGE_PAGE_SIZE                  (1<<X86_64_HUGE_PAGE_BITS)
 #define X86_64_HUGE_PAGE_MASK                  (X86_64_HUGE_PAGE_SIZE - 1)
 #define X86_64_HUGE_PAGE_OFFSET(a)             ((a) & X86_64_HUGE_PAGE_MASK)