tests/twolevel_cspace: fix use of frame_identify on ram cap
authorReto Achermann <reto.achermann@inf.ethz.ch>
Tue, 16 Jul 2019 09:51:35 +0000 (11:51 +0200)
committerReto Achermann <reto.achermann@inf.ethz.ch>
Tue, 16 Jul 2019 09:51:35 +0000 (11:51 +0200)
Signed-off-by: Reto Achermann <reto.achermann@inf.ethz.ch>

usr/tests/twolevel_cspace/test_create_l1l2.c

index d54799f..ddadcd0 100644 (file)
     } \
 } while (0)
 
+
+static errval_t frame_ram_identify(struct capref cap, struct frame_identity *id)
+{
+    errval_t err;
+
+
+
+    struct capability thecap;
+    err = cap_direct_identify(bunch_o_ram, &thecap);
+    if (err_is_fail(err)) {
+        return err;
+    }
+    
+    assert(type_is_mappable(thecap.type) || thecap.type == ObjType_RAM);
+
+    id->base  = get_address(&thecap);
+    id->bytes = get_size(&thecap);
+    id->pasid = get_pasid(&thecap);
+
+    return SYS_ERR_OK;
+}
+
+
 //{{{1 setup & helpers
 static struct capref bunch_o_ram;
 static struct frame_identity bor_id;
@@ -33,7 +56,7 @@ static void setup(size_t bytes)
     errval_t err;
     err = ram_alloc(&bunch_o_ram, log2ceil(bytes));
     assert(err_is_ok(err));
-    err = frame_identify(bunch_o_ram, &bor_id);
+    err = frame_ram_identify(bunch_o_ram, &bor_id);
     assert(err_is_ok(err));
 }