summaryrefslogtreecommitdiff
path: root/libl4
diff options
context:
space:
mode:
authorneal <neal>2007-12-13 15:48:37 +0000
committerneal <neal>2007-12-13 15:48:37 +0000
commita3f72c471a268d0118f18234f9df36aebb22e71b (patch)
treed5e2a3dd617ed8683412924a6a8ccfe30943411c /libl4
parentda262d47e46048a37c9074ad42d29ac66b400996 (diff)
2007-12-13 Neal H. Walfield <neal@gnu.org>
* l4/pagefault.h (_L4_pagefault_reply_formulate_in): New function. (_L4_pagefault_reply_formulate): Reimplement in terms of this new function. * l4/gnu/pagefault.h (l4_pagefault_reply_formulate_in): New function.
Diffstat (limited to 'libl4')
-rw-r--r--libl4/ChangeLog8
-rw-r--r--libl4/l4/gnu/pagefault.h11
-rw-r--r--libl4/l4/pagefault.h28
3 files changed, 32 insertions, 15 deletions
diff --git a/libl4/ChangeLog b/libl4/ChangeLog
index eee9fa6..674b5e1 100644
--- a/libl4/ChangeLog
+++ b/libl4/ChangeLog
@@ -1,5 +1,13 @@
2007-12-13 Neal H. Walfield <neal@gnu.org>
+ * l4/pagefault.h (_L4_pagefault_reply_formulate_in): New function.
+ (_L4_pagefault_reply_formulate): Reimplement in terms of this new
+ function.
+ * l4/gnu/pagefault.h (l4_pagefault_reply_formulate_in): New
+ function.
+
+2007-12-13 Neal H. Walfield <neal@gnu.org>
+
* l4/ipc.h (_L4_msg_put): Correctly advance ANY_TYPED.
(_L4_msg_get): Likewise.
diff --git a/libl4/l4/gnu/pagefault.h b/libl4/l4/gnu/pagefault.h
index 9357946..0c918b8 100644
--- a/libl4/l4/gnu/pagefault.h
+++ b/libl4/l4/gnu/pagefault.h
@@ -53,6 +53,17 @@ l4_pagefault_reply_formulate (void *item)
}
+/* Formulate a reply message (in the thread's virtual registers) to a
+ previous pagefault request message with the provided map or grant
+ item. */
+static inline void
+_L4_attribute_always_inline
+l4_pagefault_reply_formulate_in (l4_msg_t msg, void *item)
+{
+ _L4_pagefault_reply_formulate_in (msg, item);
+}
+
+
/* Reply to a previous pagefault request message by thread TO with the
provided map or grant item. Returns 1 on success and 0 if the Ipc
system call failed (then l4_error_code provides more information
diff --git a/libl4/l4/pagefault.h b/libl4/l4/pagefault.h
index 664b8bc..8bc9441 100644
--- a/libl4/l4/pagefault.h
+++ b/libl4/l4/pagefault.h
@@ -64,6 +64,16 @@ _L4_pagefault (_L4_msg_tag_t tag, _L4_word_t *access, _L4_word_t *ip)
}
+/* Formulate a reply message in MSG to a previous pagefault request
+ message with the provided map or grant item. */
+static inline void
+_L4_attribute_always_inline
+_L4_pagefault_reply_formulate_in (_L4_msg_t msg, void *item)
+{
+ _L4_msg_put (msg, 0, 0, 0, 2, item);
+}
+
+
/* Formulate a reply message (in the thread's virtual registers) to a
previous pagefault request message with the provided map or grant
item. */
@@ -71,21 +81,9 @@ static inline void
_L4_attribute_always_inline
_L4_pagefault_reply_formulate (void *item)
{
- __L4_msg_tag_t _tag;
- _L4_msg_tag_t tag;
- _L4_word_t msg[2];
-
- /* We have to use memcpy here to avoid breaking the strict aliasing
- rules, as we don't know the type of ITEM. */
- __builtin_memcpy (msg, item, sizeof (msg));
-
- _tag.raw = _L4_niltag;
- _tag.typed = 2;
- tag = _tag.raw;
-
- _L4_set_msg_tag (tag);
- _L4_load_mr (1, msg[0]);
- _L4_load_mr (2, msg[1]);
+ _L4_msg_t msg;
+ _L4_pagefault_reply_formulate_in (msg, item);
+ _L4_msg_load (msg);
}