diff options
author | neal <neal> | 2007-08-05 11:15:33 +0000 |
---|---|---|
committer | neal <neal> | 2007-08-05 11:15:33 +0000 |
commit | 1d310862ab2c59f95783a326e1d85f272f8509d5 (patch) | |
tree | 9ee092dd0cf328c23333f35ab5ccf04a1aec3360 /libl4/l4 | |
parent | d7e61f1c4ee9d6a362162b00008c16993ba2bf2c (diff) |
2007-08-05 Neal H. Walfield <neal@gnu.org>
* l4/pagefault.h (_L4_pagefault_reply_formulate): New function.
(_L4_pagefault_reply): Refactor code into the above new function
and use it.
* l4/gnu/pagefault.h (l4_pagefault_reply): New function.
Diffstat (limited to 'libl4/l4')
-rw-r--r-- | libl4/l4/gnu/pagefault.h | 24 | ||||
-rw-r--r-- | libl4/l4/pagefault.h | 39 |
2 files changed, 42 insertions, 21 deletions
diff --git a/libl4/l4/gnu/pagefault.h b/libl4/l4/gnu/pagefault.h index 54f90bf..9357946 100644 --- a/libl4/l4/gnu/pagefault.h +++ b/libl4/l4/gnu/pagefault.h @@ -2,22 +2,19 @@ Copyright (C) 2004 Free Software Foundation, Inc. Written by Marcus Brinkmann <marcus@gnu.org>. - This file is part of the GNU L4 library. - The GNU L4 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2.1 of + as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + The GNU L4 library 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 Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public - License along with the GNU L4 library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + License along with this program. If not, see + <http://www.gnu.org/licenses/>. */ #ifndef _L4_PAGEFAULT_H # error "Never use <l4/gnu/pagefault.h> directly; include <l4/pagefault.h> instead." @@ -45,6 +42,17 @@ l4_pagefault (l4_msg_tag_t tag, l4_word_t *access, l4_word_t *ip) } +/* 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 (void *item) +{ + _L4_pagefault_reply_formulate (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 17e7c83..664b8bc 100644 --- a/libl4/l4/pagefault.h +++ b/libl4/l4/pagefault.h @@ -1,23 +1,22 @@ /* l4/pagefault.h - Public interface to the pagefault protocol. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. Written by Marcus Brinkmann <marcus@gnu.org>. This file is part of the GNU L4 library. The GNU L4 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2.1 of + as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + The GNU L4 library 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 Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public - License along with the GNU L4 library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + License along with this program. If not, see + <http://www.gnu.org/licenses/>. */ #ifndef _L4_PAGEFAULT_H #define _L4_PAGEFAULT_H 1 @@ -65,13 +64,12 @@ _L4_pagefault (_L4_msg_tag_t tag, _L4_word_t *access, _L4_word_t *ip) } -/* 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 - about the failure). */ -static inline _L4_word_t +/* 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 (_L4_thread_id_t to, void *item) +_L4_pagefault_reply_formulate (void *item) { __L4_msg_tag_t _tag; _L4_msg_tag_t tag; @@ -88,6 +86,21 @@ _L4_pagefault_reply (_L4_thread_id_t to, void *item) _L4_set_msg_tag (tag); _L4_load_mr (1, msg[0]); _L4_load_mr (2, msg[1]); +} + + +/* 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 + about the failure). */ +static inline _L4_word_t +_L4_attribute_always_inline +_L4_pagefault_reply (_L4_thread_id_t to, void *item) +{ + _L4_msg_tag_t tag; + + _L4_pagefault_reply_formulate (item); + tag = _L4_reply (to); return _L4_ipc_succeeded (tag); } |