diff options
author | marcus <marcus> | 2004-03-16 03:38:31 +0000 |
---|---|---|
committer | marcus <marcus> | 2004-03-16 03:38:31 +0000 |
commit | 2b8832240ad61adb23af5ebc83132c549091c538 (patch) | |
tree | 92ba1a75a0786b31835cf7cba5efef672d7d8c0b /physmem | |
parent | c47efabcdd0f9ddf3c2d70b864eb34a19782e529 (diff) |
2004-03-16 Marcus Brinkmann <marcus@gnu.org>
* output.c (putchar): Replace all &msg with msg. Update
everything to new API.
* physmem.c: Likewise.
Diffstat (limited to 'physmem')
-rw-r--r-- | physmem/ChangeLog | 6 | ||||
-rw-r--r-- | physmem/output.c | 20 | ||||
-rw-r--r-- | physmem/physmem.c | 68 | ||||
-rw-r--r-- | physmem/zalloc.c | 6 |
4 files changed, 55 insertions, 45 deletions
diff --git a/physmem/ChangeLog b/physmem/ChangeLog index 995d97c..51e565c 100644 --- a/physmem/ChangeLog +++ b/physmem/ChangeLog @@ -1,3 +1,9 @@ +2004-03-16 Marcus Brinkmann <marcus@gnu.org> + + * output.c (putchar): Replace all &msg with msg. Update + everything to new API. + * physmem.c: Likewise. + 2003-10-26 Marcus Brinkmann <marcus@gnu.org> * Makefile.am (physmem_CPPFLAGS): Use top_builddir for include diff --git a/physmem/output.c b/physmem/output.c index 871c34d..b96e2cb 100644 --- a/physmem/output.c +++ b/physmem/output.c @@ -39,18 +39,18 @@ shutdown (void) { l4_msg_t msg; - l4_msg_clear (&msg); + l4_msg_clear (msg); /* FIXME: Hard coded message label. */ #define WORTEL_MSG_SHUTDOWN 2 - l4_set_msg_label (&msg, WORTEL_MSG_SHUTDOWN); + l4_set_msg_label (msg, WORTEL_MSG_SHUTDOWN); /* FIXME: This should be our cap ID. */ - l4_msg_append_word (&msg, 0); + l4_msg_append_word (msg, 0); /* This is some yet unspecified specifier. */ - l4_msg_append_word (&msg, 0); + l4_msg_append_word (msg, 0); - l4_msg_load (&msg); + l4_msg_load (msg); /* FIXME: Hard coded thread ID. */ l4_send (l4_global_id (l4_thread_user_base () + 2, 1)); } @@ -62,14 +62,14 @@ putchar (int chr) { l4_msg_t msg; - l4_msg_clear (&msg); + l4_msg_clear (msg); /* FIXME: Hard coded message label. */ #define WORTEL_MSG_PUTCHAR 1 - l4_set_msg_label (&msg, WORTEL_MSG_PUTCHAR); + l4_set_msg_label (msg, WORTEL_MSG_PUTCHAR); /* FIXME: This should be our cap ID. */ - l4_msg_append_word (&msg, 0); - l4_msg_append_word (&msg, (l4_word_t) chr); - l4_msg_load (&msg); + l4_msg_append_word (msg, 0); + l4_msg_append_word (msg, (l4_word_t) chr); + l4_msg_load (msg); /* FIXME: Hard coded thread ID. */ l4_send (l4_global_id (l4_thread_user_base () + 2, 1)); /* FIXME: No error handling. */ diff --git a/physmem/physmem.c b/physmem/physmem.c index 69ab44a..766711b 100644 --- a/physmem/physmem.c +++ b/physmem/physmem.c @@ -44,7 +44,7 @@ get_all_memory (void) { l4_fpage_t fpage; - l4_accept (l4_map_grant_items (l4_complete_address_space)); + l4_accept (l4_map_grant_items (L4_COMPLETE_ADDRESS_SPACE)); do { @@ -52,11 +52,11 @@ get_all_memory (void) l4_msg_tag_t tag; l4_grant_item_t grant_item; - l4_msg_clear (&msg); - l4_set_msg_label (&msg, WORTEL_MSG_GET_MEM); + l4_msg_clear (msg); + l4_set_msg_label (msg, WORTEL_MSG_GET_MEM); /* FIXME: Use real cap_id. */ - l4_msg_append_word (&msg, 0); - l4_msg_load (&msg); + l4_msg_append_word (msg, 0); + l4_msg_load (msg); /* FIXME: Hard coded wortel thread. */ tag = l4_call (l4_global_id (l4_thread_user_base () + 2, 1)); if (l4_ipc_failed (tag)) @@ -68,21 +68,21 @@ get_all_memory (void) || l4_typed_words (tag) != 2) panic ("Invalid format of wortel get_mem reply"); - l4_msg_store (tag, &msg); - l4_msg_get_grant_item (&msg, 0, &grant_item); - fpage = grant_item.send_fpage; + l4_msg_store (tag, msg); + l4_msg_get_grant_item (msg, 0, &grant_item); + fpage = l4_grant_item_snd_fpage (grant_item); - if (fpage.raw != l4_nilpage.raw) + if (fpage != L4_NILPAGE) zfree (l4_address (fpage), l4_size (fpage)); } - while (fpage.raw != l4_nilpage.raw); + while (fpage != L4_NILPAGE); } void create_bootstrap_caps (void) { - l4_accept (l4_map_grant_items (l4_complete_address_space)); + l4_accept (l4_map_grant_items (L4_COMPLETE_ADDRESS_SPACE)); while (1) { @@ -90,11 +90,11 @@ create_bootstrap_caps (void) l4_msg_tag_t tag; unsigned int i; - l4_msg_clear (&msg); - l4_set_msg_label (&msg, WORTEL_MSG_GET_CAP_REQUEST); + l4_msg_clear (msg); + l4_set_msg_label (msg, WORTEL_MSG_GET_CAP_REQUEST); /* FIXME: Use real cap_id. */ - l4_msg_append_word (&msg, 0); - l4_msg_load (&msg); + l4_msg_append_word (msg, 0); + l4_msg_load (msg); /* FIXME: Hard coded wortel thread. */ tag = l4_call (l4_global_id (l4_thread_user_base () + 2, 1)); @@ -103,7 +103,7 @@ create_bootstrap_caps (void) l4_error_code () & 1 ? "receive" : "send", (l4_error_code () >> 1) & 0x7); - l4_msg_store (tag, &msg); + l4_msg_store (tag, msg); if (l4_untyped_words (tag) == 1) { @@ -113,13 +113,13 @@ create_bootstrap_caps (void) "for master control"); /* FIXME: Create capability. */ - l4_msg_clear (&msg); - l4_set_msg_label (&msg, WORTEL_MSG_GET_CAP_REPLY); + l4_msg_clear (msg); + l4_set_msg_label (msg, WORTEL_MSG_GET_CAP_REPLY); /* FIXME: Use our wortel cap here. */ - l4_msg_append_word (&msg, 0); + l4_msg_append_word (msg, 0); /* FIXME: Use our control cap for this task here. */ - l4_msg_append_word (&msg, 0xf00); - l4_msg_load (&msg); + l4_msg_append_word (msg, 0xf00); + l4_msg_load (msg); /* FIXME: Hard coded thread ID. */ l4_send (l4_global_id (l4_thread_user_base () + 2, 1)); @@ -131,17 +131,17 @@ create_bootstrap_caps (void) panic ("Invalid format of wortel get cap request reply"); debug ("Creating cap for 0x%x covering 0x%x to 0x%x:", - l4_msg_word (&msg, 0), l4_msg_word (&msg, 1), - l4_msg_word (&msg, 2)); + l4_msg_word (msg, 0), l4_msg_word (msg, 1), + l4_msg_word (msg, 2)); for (i = 0; i < l4_typed_words (tag); i += 2) { l4_fpage_t fpage; l4_grant_item_t grant_item; - l4_msg_get_grant_item (&msg, i, &grant_item); + l4_msg_get_grant_item (msg, i, &grant_item); - fpage = grant_item.send_fpage; - if (l4_nilpage.raw == fpage.raw) + fpage = l4_grant_item_snd_fpage (grant_item); + if (fpage == L4_NILPAGE) { if (l4_typed_words (tag) == 2) { @@ -152,18 +152,18 @@ create_bootstrap_caps (void) else panic ("Invalid fpage in create bootstrap cap call"); } - debug ("0x%x ", fpage.raw); + debug ("0x%x ", fpage); } debug ("\n"); - l4_msg_clear (&msg); - l4_set_msg_label (&msg, WORTEL_MSG_GET_CAP_REPLY); + l4_msg_clear (msg); + l4_set_msg_label (msg, WORTEL_MSG_GET_CAP_REPLY); /* FIXME: Use our wortel cap here. */ - l4_msg_append_word (&msg, 0); + l4_msg_append_word (msg, 0); /* FIXME: This must return the real capability ID. */ - l4_msg_append_word (&msg, 0xa00); - l4_msg_load (&msg); + l4_msg_append_word (msg, 0xa00); + l4_msg_load (msg); /* FIXME: Hard coded thread ID. */ l4_send (l4_global_id (l4_thread_user_base () + 2, 1)); } @@ -173,7 +173,7 @@ create_bootstrap_caps (void) int main (int argc, char *argv[]) { - output_debug = 0; + output_debug = 1; debug ("%s " PACKAGE_VERSION "\n", program_name); @@ -182,7 +182,7 @@ main (int argc, char *argv[]) create_bootstrap_caps (); while (1) - l4_sleep (l4_never); + l4_sleep (L4_NEVER); return 0; } diff --git a/physmem/zalloc.c b/physmem/zalloc.c index 96fddbc..1b63230 100644 --- a/physmem/zalloc.c +++ b/physmem/zalloc.c @@ -20,9 +20,13 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#if HAVE_CONFIG_H +#include <config.h> +#endif + #include <assert.h> #include <string.h> - +# #include "output.h" #include "zalloc.h" |