armv7: handle VNodeCmd_Identify
authorSimon Gerber <simon.gerber@inf.ethz.ch>
Wed, 9 Nov 2016 12:37:33 +0000 (13:37 +0100)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Thu, 10 Nov 2016 10:14:47 +0000 (11:14 +0100)
Signed-off-by: Simon Gerber <simon.gerber@inf.ethz.ch>

kernel/arch/armv7/syscall.c

index 416d771..3cf488b 100644 (file)
@@ -337,6 +337,25 @@ handle_resize(
 }
 
 static struct sysret
+handle_vnode_identify(
+        struct capability *vnode,
+        arch_registers_state_t *context,
+        int argc
+        )
+{
+    assert(argc == 2);
+    assert(type_is_vnode(vnode->type));
+
+    lpaddr_t base_addr = get_address(vnode);
+    assert((base_addr & BASE_PAGE_MASK) == 0);
+
+    return (struct sysret) {
+        .error = SYS_ERR_OK,
+        .value = base_addr | ((uint8_t)vnode->type),
+    };
+}
+
+static struct sysret
 handle_map(
     struct capability *ptable,
     arch_registers_state_t *context,
@@ -987,10 +1006,12 @@ static invocation_t invocations[ObjType_Num][CAP_MAX_CMD] = {
         [CNodeCmd_Resize]   = handle_resize,
     },
     [ObjType_VNode_ARM_l1] = {
+        [VNodeCmd_Identify] = handle_vnode_identify,
        [VNodeCmd_Map]   = handle_map,
        [VNodeCmd_Unmap] = handle_unmap,
     },
     [ObjType_VNode_ARM_l2] = {
+        [VNodeCmd_Identify] = handle_vnode_identify,
        [VNodeCmd_Map]   = handle_map,
        [VNodeCmd_Unmap] = handle_unmap,
     },