Merge large page support code.
[barrelfish] / lib / barrelfish / Hakefile
index 3d005e8..9d733a0 100644 (file)
@@ -9,20 +9,20 @@
 -- Attn: Systems Group.
 --
 -- Hakefile for lib/barrelfish
--- 
+--
 --------------------------------------------------------------------------
 
 [(let arch_dir = "arch" ./. archFamily arch
       common_srcs = [ "capabilities.c", "init.c", "dispatch.c", "threads.c",
-                      "thread_sync.c", "slab.c", "domain.c", "idc.c",
+                      "thread_once.c", "thread_sync.c", "slab.c", "domain.c", "idc.c",
                       "waitset.c", "event_queue.c", "event_mutex.c",
                       "idc_export.c", "nameservice_client.c", "msgbuf.c",
                       "monitor_client.c", "flounder_support.c", "flounder_glue_binding.c",
-                      "morecore.c", "debug.c", "heap.c", "ram_alloc.c",
-                      "terminal.c", "spawn_client.c", "vspace/vspace.c", 
+                      "flounder_txqueue.c","morecore.c", "debug.c", "heap.c",
+                      "ram_alloc.c", "terminal.c", "spawn_client.c", "vspace/vspace.c",
                       "vspace/vregion.c", "vspace/memobj_one_frame.c",
                       "vspace/memobj_one_frame_lazy.c",
-                      "vspace/utils.c",
+                      "vspace/utils.c", "vspace/memobj_fixed.c", "vspace/memobj_numa.c",
                       "vspace/memobj_one_frame_one_map.c", "vspace/mmu_aware.c",
                       "slot_alloc/single_slot_alloc.c", "slot_alloc/multi_slot_alloc.c",
                       "slot_alloc/slot_alloc.c", "slot_alloc/range_slot_alloc.c",
                                  "vspace/arch/x86_64/layout.c",
                                  "vspace/memobj_pinned.c", "vspace/pinned.c", "vspace/memobj_anon.c",
                                  "arch/x86/perfmon.c", "arch/x86/tls.c"]
-      archfam_srcs "arm"     = [ "arch/arm/debug.c", "arch/arm/dispatch.c", 
+      archfam_srcs "k1om"   = [ "arch/x86_64/debug.c", "arch/x86_64/dispatch.c" ,
+                                 "arch/x86_64/syscalls.c", "arch/x86_64/sys_debug.c",
+                                 "arch/x86_64/ldt.c",
+                                 "target/x86_64/pmap_target.c", "target/x86/pmap_x86.c",
+                                 "vspace/arch/x86_64/layout.c",
+                                 "vspace/memobj_pinned.c", "vspace/pinned.c", "vspace/memobj_anon.c",
+                                 "arch/x86/perfmon.c", "arch/x86/tls.c"]
+      archfam_srcs "arm"     = [ "arch/arm/debug.c", "arch/arm/dispatch.c",
                                  "arch/arm/pmap_arch.c", "arch/arm/sys_debug.c",
                                  "arch/arm/syscalls.c", "vspace/memobj_pinned.c" ,
                                  "vspace/pinned.c", "vspace/memobj_anon.c",
       arch_srcs "scc" = [ "arch/x86/ipi_notify.c" ]
       arch_srcs "x86_32" = [ "arch/x86/ipi_notify.c" ]
       arch_srcs "x86_64" = [ "arch/x86/ipi_notify.c" ]
+      arch_srcs "k1om" = [ "arch/x86/ipi_notify.c" ]
       arch_srcs _     = []
 
       arch_assembly "x86_32"  = [ "arch/x86_32/entry.S" ]
       arch_assembly "x86_64"  = [ "arch/x86_64/entry.S" ]
+      arch_assembly "k1om"    = [ "arch/x86_64/entry.S" ]
       arch_assembly "arm"     = [ "arch/arm/entry.S", "arch/arm/syscall.S" ]
       arch_assembly "armv7-m" = [ "arch/arm/entry.S", "arch/arm/syscall.S" ]
       arch_assembly _         = []
                              ++ common_srcs ++ idc_srcs,
                     assemblyFiles = arch_assembly (archFamily arch),
                     flounderBindings = [ "mem", "octopus", "interdisp", "spawn",
-                                         "terminal" ],
+                                         "terminal", "arrakis", "terminal_config" ],
                     -- only makes sense to compile monitor binding for lmp
                     flounderTHCStubs = [ "octopus" ],
                     flounderExtraBindings = [ ("monitor", ["lmp"]),
                                              ("monitor_blocking", ["lmp", "rpcclient"]),
                                               ("mem", ["rpcclient"]),
                                               ("octopus", ["rpcclient"]),
-                                              ("spawn", ["rpcclient"])],
+                                              ("spawn", ["rpcclient"]),
+                                              ("arrakis", ["rpcclient"])],
                     addCFlags = [ "-DMORECORE_PAGESIZE="++(morecore_pagesize arch) ],
                     addIncludes = [ "include", "include" ./. arch_dir ],
                     addGeneratedDependencies = [ "/include/asmoffsets.h" ]
                   }
+ ) | arch <- allArchitectures ] ++
+[(let arch_dir = "arch" ./. archFamily arch
+      common_srcs = [ "capabilities.c", "init.c", "dispatch.c", "threads.c",
+                      "thread_sync.c", "slab.c", "domain.c", "idc.c",
+                      "waitset.c", "event_queue.c", "event_mutex.c",
+                      "idc_export.c", "nameservice_client.c", "msgbuf.c",
+                      "monitor_client.c", "flounder_support.c", "flounder_glue_binding.c",
+                      "morecore.c", "debug.c", "heap.c", "ram_alloc.c",
+                      "terminal.c", "spawn_client.c", "vspace/vspace.c",
+                      "vspace/vregion.c", "vspace/memobj_one_frame.c",
+                      "vspace/memobj_one_frame_lazy.c",
+                      "vspace/utils.c",
+                      "vspace/memobj_one_frame_one_map.c", "vspace/mmu_aware.c",
+                      "slot_alloc/single_slot_alloc.c", "slot_alloc/multi_slot_alloc.c",
+                      "slot_alloc/slot_alloc.c", "slot_alloc/range_slot_alloc.c",
+                      "bulk_transfer.c", "trace.c", "resource_ctrl.c", "coreset.c",
+                      "inthandler.c", "deferred.c"
+                    ]
+
+      idc_srcs = concat $ map getsrcs $ optInterconnectDrivers $ options arch
+          where
+            getsrcs "lmp" = [ "lmp_chan.c", "lmp_endpoints.c" ]
+            getsrcs "ump" = [ "ump_chan.c", "ump_endpoint.c" ]
+            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" ,
+                              "arch/x86_32/sys_debug.c", "target/x86_32/pmap_target.c",
+                              "target/x86/pmap_x86.c",
+                              "vspace/arch/x86_32/layout.c" , "vspace/memobj_pinned.c" ,
+                              "vspace/pinned.c", "vspace/memobj_anon.c",
+                              "arch/x86/perfmon.c", "arch/x86/tls.c"]
+      archfam_srcs "x86_64"  = [ "arch/x86_64/debug.c", "arch/x86_64/dispatch.c" ,
+                                 "arch/x86_64/syscalls.c", "arch/x86_64/sys_debug.c",
+                                 "arch/x86_64/ldt.c",
+                                 "target/x86_64/pmap_target.c", "target/x86/pmap_x86.c",
+                                 "vspace/arch/x86_64/layout.c",
+                                 "vspace/memobj_pinned.c", "vspace/pinned.c", "vspace/memobj_anon.c",
+                                 "arch/x86/perfmon.c", "arch/x86/tls.c"]
+      archfam_srcs "arm"     = [ "arch/arm/debug.c", "arch/arm/dispatch.c",
+                                 "arch/arm/pmap_arch.c", "arch/arm/sys_debug.c",
+                                 "arch/arm/syscalls.c", "vspace/memobj_pinned.c" ,
+                                 "vspace/pinned.c", "vspace/memobj_anon.c",
+                                 "vspace/arch/arm/layout.c" ]
+      archfam_srcs _         = []
+
+      -- sources specific to the architecture
+      arch_srcs "scc" = [ "arch/x86/ipi_notify.c" ]
+      arch_srcs "x86_32" = [ "arch/x86/ipi_notify.c" ]
+      arch_srcs "x86_64" = [ "arch/x86/ipi_notify.c" ]
+      arch_srcs _     = []
+
+      arch_assembly "x86_32"  = [ "arch/x86_32/entry.S" ]
+      arch_assembly "x86_64"  = [ "arch/x86_64/entry.S" ]
+      arch_assembly "arm"     = [ "arch/arm/entry.S", "arch/arm/syscall.S" ]
+      arch_assembly _         = []
+
+  in
+    build library { target = "arrakis",
+                    architectures = [arch],
+                    cFiles = arch_srcs arch ++ archfam_srcs (archFamily arch)
+                             ++ common_srcs ++ idc_srcs,
+                    assemblyFiles = arch_assembly (archFamily arch),
+                    addCFlags = [ "-DARRAKIS", "-DMORECORE_PAGESIZE="++(morecore_pagesize arch) ],
+                    flounderBindings = [ "mem", "octopus", "interdisp", "spawn", "arrakis",
+                                         "terminal" ],
+                    -- only makes sense to compile monitor binding for lmp
+                    flounderTHCStubs = [ "octopus" ],
+                    flounderExtraBindings = [ ("monitor", ["lmp"]),
+                                             ("monitor_blocking", ["lmp", "rpcclient"]),
+                                              ("mem", ["rpcclient"]),
+                                              ("octopus", ["rpcclient"]),
+                                              ("spawn", ["rpcclient"]),
+                                              ("arrakis", ["rpcclient"])],
+                    addIncludes = [ "include", "include" ./. arch_dir ],
+                    addGeneratedDependencies = [ "/include/asmoffsets.h" ]
+                  }
  ) | arch <- allArchitectures ]