Merge large page support code.
[barrelfish] / lib / barrelfish / Hakefile
index 4a3256e..9d733a0 100644 (file)
@@ -1,5 +1,6 @@
 --------------------------------------------------------------------------
 -- Copyright (c) 2007-2012, ETH Zurich
+-- Copyright (c) 2014, HP Labs.
 -- All rights reserved.
 --
 -- This file is distributed under the terms in the attached LICENSE file.
             getsrcs "multihop" = [ "multihop_chan.c" ]
             getsrcs _ = []
 
+      -- configure default morecore pagesize based on Config.hs
+      morecore_pagesize "x86_64" = case Config.morecore_pagesize of
+          "large" -> "LARGE_PAGE_SIZE"
+          "huge"  -> "HUGE_PAGE_SIZE"
+          _       -> "BASE_PAGE_SIZE"
+      morecore_pagesize "x86_32" = case Config.morecore_pagesize of
+          "large" -> "LARGE_PAGE_SIZE"
+          _       -> "BASE_PAGE_SIZE"
+      morecore_pagesize _ = "BASE_PAGE_SIZE"
+
+
       -- sources specific to the architecture family
       archfam_srcs "x86_32"  = [ "arch/x86_32/debug.c" ,
                               "arch/x86_32/dispatch.c" , "arch/x86_32/syscalls.c" ,
                                               ("octopus", ["rpcclient"]),
                                               ("spawn", ["rpcclient"]),
                                               ("arrakis", ["rpcclient"])],
+                    addCFlags = [ "-DMORECORE_PAGESIZE="++(morecore_pagesize arch) ],
                     addIncludes = [ "include", "include" ./. arch_dir ],
                     addGeneratedDependencies = [ "/include/asmoffsets.h" ]
                   }
             getsrcs "multihop" = [ "multihop_chan.c" ]
             getsrcs _ = []
 
+      -- configure default morecore pagesize based on Config.hs
+      morecore_pagesize "x86_64" = case Config.morecore_pagesize of
+          "large" -> "LARGE_PAGE_SIZE"
+          "huge"  -> "HUGE_PAGE_SIZE"
+          _       -> "BASE_PAGE_SIZE"
+      morecore_pagesize "x86_32" = case Config.morecore_pagesize of
+          "large" -> "LARGE_PAGE_SIZE"
+          _       -> "BASE_PAGE_SIZE"
+      morecore_pagesize _ = "BASE_PAGE_SIZE"
+
+
       -- sources specific to the architecture family
       archfam_srcs "x86_32"  = [ "arch/x86_32/debug.c" ,
                               "arch/x86_32/dispatch.c" , "arch/x86_32/syscalls.c" ,
                     cFiles = arch_srcs arch ++ archfam_srcs (archFamily arch)
                              ++ common_srcs ++ idc_srcs,
                     assemblyFiles = arch_assembly (archFamily arch),
-                    addCFlags = [ "-DARRAKIS" ],
+                    addCFlags = [ "-DARRAKIS", "-DMORECORE_PAGESIZE="++(morecore_pagesize arch) ],
                     flounderBindings = [ "mem", "octopus", "interdisp", "spawn", "arrakis",
                                          "terminal" ],
                     -- only makes sense to compile monitor binding for lmp