Added function to initialize intermon rx_vtbl capop entries.
authorMark Nevill <nevillm@ethz.ch>
Tue, 22 May 2012 11:12:55 +0000 (13:12 +0200)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Thu, 18 Jul 2013 12:58:33 +0000 (14:58 +0200)
12 files changed:
usr/monitor/Hakefile
usr/monitor/capops/capsend.c
usr/monitor/capops/copy.c
usr/monitor/capops/delete.c
usr/monitor/capops/init.c [new file with mode: 0644]
usr/monitor/capops/internal.h [new file with mode: 0644]
usr/monitor/capops/move.c
usr/monitor/capops/retype.c
usr/monitor/capops/revoke.c
usr/monitor/include/capop_handlers.h [deleted file]
usr/monitor/include/capops.h
usr/monitor/inter.c

index 4e18ba2..30571ea 100644 (file)
@@ -33,7 +33,7 @@
                      "send_cap.c", rcap_db, "capops/capsend.c",
                      "capops/capqueue.c", "capops/caplock.c", "capops/copy.c",
                      "capops/move.c", "capops/delete.c", "capops/revoke.c",
-                     "capops/retype.c", "capops/magic.c" ]
+                     "capops/retype.c", "capops/init.c", "capops/magic.c" ]
 
      arch_srcs "x86_32"  = [ "arch/x86/boot.c", "arch/x86/inter.c", "arch/x86/monitor_server.c", "arch/x86/notify_ipi.c" ]
      arch_srcs "x86_64"  = [ "arch/x86/boot.c", "arch/x86/inter.c", "arch/x86/monitor_server.c", "arch/x86/notify_ipi.c" ]
index 92015d3..8a0920a 100644 (file)
@@ -12,7 +12,7 @@
 #include "monitor.h"
 #include "magic.h"
 #include "capops.h"
-#include "capop_handlers.h"
+#include "internal.h"
 
 /*
  * Single-cast {{{1
index e7fcc9a..52f8065 100644 (file)
@@ -14,7 +14,7 @@
 #include "capops.h"
 #include "capsend.h"
 #include "magic.h"
-#include "capop_handlers.h"
+#include "internal.h"
 
 /*
  * RPC state {{{1
index 63b4b88..85dd024 100644 (file)
@@ -15,7 +15,7 @@
 #include "caplock.h"
 #include "capqueue.h"
 #include "dom_invocations.h"
-#include "capop_handlers.h"
+#include "internal.h"
 #include <if/mem_rpcclient_defs.h>
 
 struct delete_st {
diff --git a/usr/monitor/capops/init.c b/usr/monitor/capops/init.c
new file mode 100644 (file)
index 0000000..7d18047
--- /dev/null
@@ -0,0 +1,26 @@
+#include <if/intermon_defs.h>
+#include <capops.h>
+#include "internal.h"
+
+errval_t capops_intermon_init(struct intermon_binding *b)
+{
+    b->rx_vtbl.capops_request_copy            = request_copy__rx_handler;
+    b->rx_vtbl.capops_recv_copy               = recv_copy__rx_handler;
+    b->rx_vtbl.capops_recv_copy_result        = recv_copy_result__rx_handler;
+    b->rx_vtbl.capops_move_request            = move_request__rx_handler;
+    b->rx_vtbl.capops_move_result             = move_result__rx_handler;
+    b->rx_vtbl.capops_delete_remote           = delete_remote__rx_handler;
+    b->rx_vtbl.capops_delete_remote_result    = delete_remote_result__rx_handler;
+    b->rx_vtbl.capops_request_revoke          = request_revoke__rx_handler;
+    b->rx_vtbl.capops_revoke_result           = revoke_result__rx_handler;
+    b->rx_vtbl.capops_request_retype          = request_retype__rx_handler;
+    b->rx_vtbl.capops_retype_response         = retype_response__rx_handler;
+    b->rx_vtbl.capops_update_owner            = update_owner__rx_handler;
+    b->rx_vtbl.capops_owner_updated           = owner_updated__rx_handler;
+    b->rx_vtbl.capops_find_cap                = find_cap__rx_handler;
+    b->rx_vtbl.capops_find_cap_result         = find_cap_result__rx_handler;
+    b->rx_vtbl.capops_find_descendants        = find_descendants__rx_handler;
+    b->rx_vtbl.capops_find_descendants_result = find_descendants_result__rx_handler;
+
+    return SYS_ERR_OK;
+}
diff --git a/usr/monitor/capops/internal.h b/usr/monitor/capops/internal.h
new file mode 100644 (file)
index 0000000..3095376
--- /dev/null
@@ -0,0 +1,37 @@
+
+void find_cap__rx_handler(struct intermon_binding *b, intermon_caprep_t caprep,
+                          genvaddr_t st);
+void find_cap_result__rx_handler(struct intermon_binding *b, errval_t result,
+                                 genvaddr_t st);
+void find_descendants__rx_handler(struct intermon_binding *b,
+                                  intermon_caprep_t caprep, genvaddr_t st);
+void find_descendants_result__rx_handler(struct intermon_binding *b,
+                                         errval_t status, genvaddr_t st);
+void owner_updated__rx_handler(struct intermon_binding *b, genvaddr_t st);
+void update_owner__rx_handler(struct intermon_binding *b,
+                              intermon_caprep_t caprep, genvaddr_t st);
+void recv_copy_result__rx_handler(struct intermon_binding *b, errval_t status,
+                                  capaddr_t capaddr, uint8_t vbits,
+                                  cslot_t slot, genvaddr_t st);
+void recv_copy__rx_handler(struct intermon_binding *b,
+                           intermon_caprep_t caprep, genvaddr_t st);
+void request_copy__rx_handler(struct intermon_binding *b, coreid_t dest,
+                              intermon_caprep_t caprep, genvaddr_t st);
+void delete_remote__rx_handler(struct intermon_binding *b,
+                               intermon_caprep_t caprep, genvaddr_t st);
+void delete_remote_result__rx_handler(struct intermon_binding *b,
+                                      errval_t status, genvaddr_t st);
+void move_request__rx_handler(struct intermon_binding *b,
+                              intermon_caprep_t caprep, uint8_t relations,
+                              genvaddr_t st);
+void move_result__rx_handler(struct intermon_binding *b, errval_t status,
+                             genvaddr_t st);
+void request_retype__rx_handler(struct intermon_binding *b,
+                                intermon_caprep_t srcrep, int desttype,
+                                uint32_t destbits, genvaddr_t st);
+void retype_response__rx_handler(struct intermon_binding *b, errval_t status,
+                                 genvaddr_t st);
+void request_revoke__rx_handler(struct intermon_binding *b,
+                                intermon_caprep_t caprep, genvaddr_t st);
+void revoke_result__rx_handler(struct intermon_binding *b, errval_t status,
+                               genvaddr_t st);
index 86a425d..3c2d347 100644 (file)
@@ -14,7 +14,7 @@
 #include "capsend.h"
 #include "magic.h"
 #include "caplock.h"
-#include "capop_handlers.h"
+#include "internal.h"
 #include "dom_invocations.h"
 
 /*
index 9eaf398..8987ff3 100644 (file)
@@ -15,7 +15,7 @@
 #include "capsend.h"
 #include "caplock.h"
 #include "magic.h"
-#include "capop_handlers.h"
+#include "internal.h"
 
 /*
  *
index 3f7eef1..18fa96b 100644 (file)
@@ -13,7 +13,7 @@
 #include "capsend.h"
 #include "magic.h"
 #include "caplock.h"
-#include "capop_handlers.h"
+#include "internal.h"
 
 struct revoke_st {
     struct domcapref revokecap;
diff --git a/usr/monitor/include/capop_handlers.h b/usr/monitor/include/capop_handlers.h
deleted file mode 100644 (file)
index 02e5b53..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2012 ETH Zurich.
- * All rights reserved.
- *
- * This file is distributed under the terms in the attached LICENSE file.
- * If you do not find this file, copies can be found by writing to:
- * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
- */
-
-#ifndef CAPOPS_HANDLERS_H
-#define CAPOPS_HANDLERS_H
-
-#include <if/intermon_defs.h>
-
-void find_cap__rx_handler(struct intermon_binding *b, intermon_caprep_t caprep, genvaddr_t st);
-
-void find_cap_result__rx_handler(struct intermon_binding *b, errval_t result, genvaddr_t st);
-
-void find_descendants__rx_handler(struct intermon_binding *b, intermon_caprep_t caprep, genvaddr_t st);
-
-void find_descendants_result__rx_handler(struct intermon_binding *b, errval_t status, genvaddr_t st);
-
-void owner_updated__rx_handler(struct intermon_binding *b, genvaddr_t st);
-
-void update_owner__rx_handler(struct intermon_binding *b, intermon_caprep_t caprep, genvaddr_t st);
-
-void recv_copy_result__rx_handler(struct intermon_binding *b, errval_t status, capaddr_t capaddr, uint8_t vbits, cslot_t slot, genvaddr_t st);
-
-void recv_copy__rx_handler(struct intermon_binding *b, intermon_caprep_t caprep, genvaddr_t st);
-
-void request_copy__rx_handler(struct intermon_binding *b, coreid_t dest, intermon_caprep_t caprep, genvaddr_t st);
-
-void delete_remote__rx_handler(struct intermon_binding *b, intermon_caprep_t caprep, genvaddr_t st);
-
-void delete_remote_result__rx_handler(struct intermon_binding *b, errval_t status, genvaddr_t st);
-
-void move_request__rx_handler(struct intermon_binding *b, intermon_caprep_t caprep, uint8_t relations, genvaddr_t st);
-
-void move_result__rx_handler(struct intermon_binding *b, errval_t status, genvaddr_t st);
-
-void request_retype__rx_handler(struct intermon_binding *b, intermon_caprep_t srcrep, int desttype, uint32_t destbits, genvaddr_t st);
-
-void retype_response__rx_handler(struct intermon_binding *b, errval_t status, genvaddr_t st);
-
-void request_revoke__rx_handler(struct intermon_binding *b, intermon_caprep_t caprep, genvaddr_t st);
-
-void revoke_result__rx_handler(struct intermon_binding *b, errval_t status, genvaddr_t st);
-
-#endif
index c2b06d6..dbead09 100644 (file)
@@ -37,4 +37,7 @@ errval_t capops_retype(enum objtype type, size_t objbits, struct capref croot,
                        capaddr_t src, uint8_t src_bits, retype_result_handler_t
                        result_handler, void *st);
 
+struct intermon_binding;
+errval_t capops_intermon_init(struct intermon_binding *b);
+
 #endif
index 7491a16..55cdc68 100644 (file)
@@ -18,7 +18,6 @@
 #include <monitor.h>
 #include <trace/trace.h>
 #include "send_cap.h"
-#include "capop_handlers.h"
 #include "capops.h"
 
 #define MIN(x,y) ((x<y) ? (x) : (y))
@@ -634,24 +633,6 @@ static struct intermon_rx_vtbl the_intermon_vtable = {
     .rsrc_phase                = inter_rsrc_phase,
     .rsrc_phase_data           = inter_rsrc_phase_data,
 
-    .capops_request_copy            = request_copy__rx_handler,
-    .capops_recv_copy               = recv_copy__rx_handler,
-    .capops_recv_copy_result        = recv_copy_result__rx_handler,
-    .capops_move_request            = move_request__rx_handler,
-    .capops_move_result             = move_result__rx_handler,
-    .capops_delete_remote           = delete_remote__rx_handler,
-    .capops_delete_remote_result    = delete_remote_result__rx_handler,
-    .capops_request_revoke          = request_revoke__rx_handler,
-    .capops_revoke_result           = revoke_result__rx_handler,
-    .capops_request_retype          = request_retype__rx_handler,
-    .capops_retype_response         = retype_response__rx_handler,
-    .capops_update_owner            = update_owner__rx_handler,
-    .capops_owner_updated           = owner_updated__rx_handler,
-    .capops_find_cap                = find_cap__rx_handler,
-    .capops_find_cap_result         = find_cap_result__rx_handler,
-    .capops_find_descendants        = find_descendants__rx_handler,
-    .capops_find_descendants_result = find_descendants_result__rx_handler,
-
 };
 
 errval_t intermon_init(struct intermon_binding *b, coreid_t coreid)
@@ -688,7 +669,13 @@ errval_t intermon_init(struct intermon_binding *b, coreid_t coreid)
 
     err = arch_intermon_init(b);
     if (err_is_fail(err)) {
-        USER_PANIC_ERR(err, "arch_intermon_init failed");       
+        USER_PANIC_ERR(err, "arch_intermon_init failed");
+        return err;
+    }
+
+    err = capops_intermon_init(b);
+    if (err_is_fail(err)) {
+        USER_PANIC_ERR(err, "capops_intermon_init failed");
         return err;
     }