summaryrefslogtreecommitdiff
path: root/viengoos/cap.h
diff options
context:
space:
mode:
Diffstat (limited to 'viengoos/cap.h')
-rw-r--r--viengoos/cap.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/viengoos/cap.h b/viengoos/cap.h
new file mode 100644
index 0000000..d6ecfb5
--- /dev/null
+++ b/viengoos/cap.h
@@ -0,0 +1,44 @@
+/* cap.h - Basic capability framework interface.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Written by Neal H. Walfield <neal@gnu.org>.
+
+ This file is part of the GNU Hurd.
+
+ The GNU Hurd is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ The GNU Hurd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef RM_CAP_H
+#define RM_CAP_H
+
+#include <l4.h>
+#include <hurd/cap.h>
+
+#include "rm.h"
+
+/* The number of slots in a capability object of the given type. */
+extern const int cap_type_num_slots[];
+
+/* Set's the capability TARGET to point to the same object as the
+ capability SOURCE, however, preserves the guard in TARGET. */
+static inline bool
+cap_set (struct cap *target, struct cap source)
+{
+ /* This is kosher as we know the implementation of CAP_COPY. */
+ return cap_copy (0, target, ADDR_VOID, source, ADDR_VOID);
+}
+
+/* Invalidate all mappings that may depend on this object. */
+extern void cap_shootdown (struct activity *activity, struct cap *cap);
+
+#endif