arrakis merge: make x86_32 build
authorSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 17 Aug 2015 08:53:34 +0000 (10:53 +0200)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 17 Aug 2015 08:53:40 +0000 (10:53 +0200)
Signed-off-by: Simon Gerber <simon.gerber@inf.ethz.ch>

hake/X86_32.hs
include/arch/x86_32/barrelfish/invocations_arch.h
usr/acpi/intel_vtd.c
usr/drivers/e10k/Hakefile
usr/drivers/megaraid/Hakefile
usr/drivers/megaraid/megaraid.c
usr/drivers/megaraid/megaraid_vsic.c
usr/tests/e10ktest/Hakefile

index b26ec68..d10b35b 100644 (file)
@@ -47,7 +47,7 @@ cxxFlags = ArchDefaults.commonCxxFlags
 cDefines = ArchDefaults.cDefines options
 
 ourLdFlags = [ Str "-Wl,-section-start,.text=0x300000",
-               Str "-Wl,-section-start,.data.rel.ro=0x640000",
+               Str "-Wl,-section-start,.data.rel.ro=0x800000",
                Str "-Wl,-z,max-page-size=0x1000",
                Str "-Wl,--build-id=none",
                Str "-m32"]
index deb5261..af26c41 100644 (file)
@@ -335,6 +335,24 @@ static inline errval_t invoke_frame_identify(struct capref frame,
     return sysret.error;
 }
 
+static inline errval_t invoke_vnode_identify(struct capref vnode,
+                                            struct vnode_identity *ret)
+{
+    struct sysret sysret = cap_invoke1(vnode, VNodeCmd_Identify);
+
+    assert(ret != NULL);
+    if (err_is_ok(sysret.error)) {
+        ret->base = sysret.value & (~BASE_PAGE_MASK);
+       ret->type = sysret.value & BASE_PAGE_MASK;
+        return sysret.error;
+    }
+
+    ret->base = 0;
+    ret->type = 0;
+    return sysret.error;
+}
+
+
 /**
  * \brief Modify mapping flags on parts of a mapped frame
  *
index b92bb66..8a90abc 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <barrelfish/barrelfish.h>
+#include <barrelfish/invocations_arch.h>
 #include <barrelfish/sys_debug.h>
 #include <acpi.h>
 #include <mm/mm.h>
@@ -388,7 +389,7 @@ static inline uint64_t vtd_map(uint64_t va, uint64_t pa, lvaddr_t *pt, int level
 {
     struct capref pe_frame;
     struct frame_identity pe_id;
-    uint64_t *vtp = pt;
+    lvaddr_t *vtp = pt;
 
     int e = 0;
     for (int current_level = 1; current_level <= levels; current_level++) {
@@ -407,7 +408,7 @@ static inline uint64_t vtd_map(uint64_t va, uint64_t pa, lvaddr_t *pt, int level
            break;
        }
        if (current_level == levels) break;
-       if (vtp[e + X86_64_PTABLE_SIZE] == 0) {
+       if (vtp[e + PTABLE_SIZE] == 0) {
            int bytes = 2 * BASE_PAGE_SIZE;
            bytes = (current_level == (levels-1)) ?  bytes : 2 * bytes;
  
@@ -418,7 +419,7 @@ static inline uint64_t vtd_map(uint64_t va, uint64_t pa, lvaddr_t *pt, int level
            err = vspace_map_one_frame_attr(&vbase, bytes, pe_frame, 
                                            vtd_map_attr, NULL, NULL);
            assert(err_is_ok(err));
-           assert(((uint64_t)vbase & BASE_PAGE_MASK) == 0);
+           assert(((lvaddr_t)vbase & BASE_PAGE_MASK) == 0);
     
            err = invoke_frame_identify(pe_frame, &pe_id);
            assert(err_is_ok(err));
@@ -426,9 +427,9 @@ static inline uint64_t vtd_map(uint64_t va, uint64_t pa, lvaddr_t *pt, int level
 
            union sl_pdir_entry *entry = (union sl_pdir_entry *)vtp + e;
            sl_map_table(entry, pe_id.base);
-           vtp[e + X86_64_PTABLE_SIZE] = (uint64_t)vbase;
+           vtp[e + PTABLE_SIZE] = (lvaddr_t)vbase;
        }
-       vtp = (uint64_t *)vtp[e + X86_64_PTABLE_SIZE]; 
+       vtp = (lvaddr_t *)vtp[e + PTABLE_SIZE];
     }
 
     union sl_ptable_entry *entry = (union sl_ptable_entry *)vtp + e;
@@ -482,7 +483,7 @@ static void vtd_create_identity_domain(void)
     // Map only the first 1024 GB of physical memory. Attempting to map
     // the entire address space with this current implementation is 
     // infeasible.
-    uint64_t max_addr = 1UL << 40;
+    uint64_t max_addr = 1ULL << 40;
     errval_t err;
     struct frame_identity pe_frame_id;
     struct capref pe_frame;
@@ -495,7 +496,7 @@ static void vtd_create_identity_domain(void)
                                    vtd_map_attr, NULL, NULL);
     assert(err_is_ok(err));
     assert((pe_frame_id.base & X86_64_BASE_PAGE_MASK) == 0 &&
-          ((uint64_t)pe_vaddr & X86_64_BASE_PAGE_MASK) == 0);
+          ((lvaddr_t)pe_vaddr & X86_64_BASE_PAGE_MASK) == 0);
     
     struct capref empty_pml4;
     err = slot_alloc(&empty_pml4);
index 2c085b4..da999ec 100644 (file)
@@ -35,7 +35,7 @@
                       cFiles = [ "e10k_cdriver.c", "e10k_phy.c", "sleep.c",
                                  "e10k_qdriver.c", "helper.c"],
                       mackerelDevices = [ "e10k", "e10k_q" ],
-                      flounderBindings = [ "e10k", "e10k_vf" ],
+                      flounderBindings = [ "net_queue_manager", "e10k", "e10k_vf" ],
                       flounderDefs = [ "e10k_vf" ],
                       addLibraries = libDeps [ "pci", "bench", "trace", "skb" ],
                       addCFlags = [ "-DLIBRARY" ]
index 8c60af6..69a05a3 100644 (file)
@@ -16,7 +16,8 @@
                       flounderDefs = [ "acpi" ],
                       flounderBindings = [ "acpi" ],
                       flounderExtraBindings = [ ("acpi", ["rpcclient"]) ],
-                      addLibraries = libDeps [ "acpi_client", "skb", "pci" ]
+                      addLibraries = libDeps [ "acpi_client", "skb", "pci" ],
+                      architectures = [ "x86_64", "x86_32" ]
                     },
   build library { target = "megaraid",
                       cFiles = [ "megaraid.c", "megaraid_vsic.c" ],
@@ -25,6 +26,7 @@
                       flounderDefs = [ "acpi" ],
                       flounderBindings = [ "acpi" ],
                       flounderExtraBindings = [ ("acpi", ["rpcclient"]) ],
-                      addLibraries = libDeps [ "acpi_client", "skb", "pci" ]
+                      addLibraries = libDeps [ "acpi_client", "skb", "pci" ],
+                      architectures = [ "x86_64", "x86_32" ]
                     }
 ]
index d49d7dd..417910f 100644 (file)
@@ -1022,8 +1022,8 @@ static void pci_init_card(int bar_count)
     assert(bar_count >= 2);
 #ifdef BARRELFISH
     map_device(&bar_info[0]);
-    DEBUG("BAR[0] mapped (v=%llx p=%llx l=%llx)\n",
-            (unsigned long long) bar_info[0].vaddr,
+    DEBUG("BAR[0] mapped (v=%p p=%llx l=%llx)\n",
+            bar_info[0].vaddr,
             (unsigned long long) bar_info[0].paddr,
             (unsigned long long) bar_info[0].bytes);
 
index a93c1b9..cefc225 100644 (file)
@@ -55,7 +55,7 @@ static uint64_t htonll(uint64_t value)
     }
 }
 
-static uint64_t cmd_cnt = 0;
+static uintptr_t cmd_cnt = 0;
 
 static uint8_t *pmem_start = NULL;
 static uintptr_t paddr_start = 0;
index 1ec9d0d..6233e60 100644 (file)
                       cFiles = [ "subways.c" ],
                       flounderDefs = [ "subways", "acpi" ],
                       flounderBindings = [ "subways" ],
-                     flounderExtraBindings = [ ("acpi", ["rpcclient"]) ],
+                     flounderExtraBindings = [ ("acpi", ["rpcclient"]),
+                                                ("monitor", ["lmp"])
+                                              ],
                       addLibraries = [ "e10k_vf", "skb", "acpi_client" ]
                     },
   build application { target = "subways_e1000",
                       cFiles = [ "subways.c" ],
                       flounderDefs = [ "subways", "acpi" ],
                       flounderBindings = [ "subways" ],
-                     flounderExtraBindings = [ ("acpi", ["rpcclient"]) ],
+                     flounderExtraBindings = [ ("acpi", ["rpcclient"]),
+                                                ("monitor", ["lmp"])
+                                              ],
                       addLibraries = [ "e1000n", "skb", "acpi_client" ]
                     },
   build application { target = "e10ktest",