From d46b30a711c27686c17be293f67cd820b93bc0d5 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Thu, 21 Nov 2013 11:35:33 +0100 Subject: [PATCH] hw: clarify names of messaging kernel-calls ref #958 --- base-hw/include/base/native_types.h | 8 ++++---- base-hw/include/kernel/interface.h | 26 +++++++++++++------------- base-hw/src/base/ipc.cc | 10 ++++------ base-hw/src/core/kernel/thread.cc | 24 ++++++++++++------------ base-hw/src/core/kernel/thread.h | 6 +++--- 5 files changed, 36 insertions(+), 38 deletions(-) diff --git a/base-hw/include/base/native_types.h b/base-hw/include/base/native_types.h index 5479ac78f5..c868f7e5b3 100644 --- a/base-hw/include/base/native_types.h +++ b/base-hw/include/base/native_types.h @@ -174,15 +174,15 @@ struct Genode::Native_utcb Startup_msg startup_msg; }; - void call_wait_for_request(void * & buf_base, size_t & buf_size) + void call_await_request_msg(void * & buf_base, size_t & buf_size) { msg.type = Msg::Type::INVALID; buf_base = base(); buf_size = size(); } - void call_request_and_wait(void * & msg_base, size_t & msg_size, - void * & buf_base, size_t & buf_size) + void call_send_request_msg(void * & msg_base, size_t & msg_size, + void * & buf_base, size_t & buf_size) { msg.type = Msg::Type::IPC; msg_base = ipc_msg_base(); @@ -191,7 +191,7 @@ struct Genode::Native_utcb buf_size = size(); } - void call_reply(void * & msg_base, size_t & msg_size) + void call_send_reply_msg(void * & msg_base, size_t & msg_size) { msg.type = Msg::Type::IPC; msg_base = ipc_msg_base(); diff --git a/base-hw/include/kernel/interface.h b/base-hw/include/kernel/interface.h index fa5593e349..3ba1991c41 100644 --- a/base-hw/include/kernel/interface.h +++ b/base-hw/include/kernel/interface.h @@ -50,9 +50,9 @@ namespace Kernel UPDATE_REGION = 9, NEW_PD = 10, KILL_PD = 11, - REQUEST_AND_WAIT = 12, - REPLY = 13, - WAIT_FOR_REQUEST = 14, + SEND_REQUEST_MSG = 12, + SEND_REPLY_MSG = 13, + AWAIT_REQUEST_MSG = 14, NEW_SIGNAL_RECEIVER = 15, NEW_SIGNAL_CONTEXT = 16, KILL_SIGNAL_CONTEXT = 17, @@ -317,13 +317,13 @@ namespace Kernel /** * Send IPC request and await corresponding IPC reply * - * \param id kernel name of the server thread + * \param thread_id kernel name of targeted thread * * As soon as call returns, callers UTCB provides received message. */ - inline void request_and_wait(unsigned const id) + inline void send_request_msg(unsigned const thread_id) { - call(Call_id::REQUEST_AND_WAIT, id); + call(Call_id::SEND_REQUEST_MSG, thread_id); } @@ -334,23 +334,23 @@ namespace Kernel * * As soon as call returns, callers UTCB provides received message. */ - inline void wait_for_request() + inline void await_request_msg() { - call(Call_id::WAIT_FOR_REQUEST); + call(Call_id::AWAIT_REQUEST_MSG); } /** * Reply to lastly received message * - * \param await_message wether the call shall await receipt of a message + * \param await_request_msg wether the call shall await a request message * - * If await_request = 1, callers UTCB provides received message - * as soon as call returns + * As soon as call returns, callers UTCB provides received message if + * await_request_msg is set. */ - inline void reply(bool const await_message) + inline void send_reply_msg(bool const await_request_msg) { - call(Call_id::REPLY, await_message); + call(Call_id::SEND_REPLY_MSG, await_request_msg); } diff --git a/base-hw/src/base/ipc.cc b/base-hw/src/base/ipc.cc index ce2d209f57..130d5b0607 100644 --- a/base-hw/src/base/ipc.cc +++ b/base-hw/src/base/ipc.cc @@ -116,12 +116,10 @@ Ipc_istream::~Ipc_istream() { } void Ipc_client::_call() { - using namespace Kernel; - /* send request */ unsigned const local_name = Ipc_ostream::_dst.local_name(); msgbuf_to_utcb(_snd_msg, _write_offset, local_name); - request_and_wait(Ipc_ostream::_dst.dst()); + Kernel::send_request_msg(Ipc_ostream::_dst.dst()); /* receive reply */ Native_utcb * const utcb = Thread_base::myself()->utcb(); @@ -169,7 +167,7 @@ void Ipc_server::_prepare_next_reply_wait() void Ipc_server::_wait() { /* receive next request */ - Kernel::wait_for_request(); + Kernel::await_request_msg(); Native_utcb * const utcb = Thread_base::myself()->utcb(); if (utcb->msg.type != Msg::Type::IPC) { PERR("failed to receive request"); @@ -186,7 +184,7 @@ void Ipc_server::_reply() { Native_utcb * const utcb = Thread_base::myself()->utcb(); utcb->ipc_msg.size = _write_offset; - Kernel::reply(0); + Kernel::send_reply_msg(0); } @@ -200,7 +198,7 @@ void Ipc_server::_reply_wait() /* send reply an await request */ unsigned const local_name = Ipc_ostream::_dst.local_name(); msgbuf_to_utcb(_snd_msg, _write_offset, local_name); - Kernel::reply(1); + Kernel::send_reply_msg(1); /* fetch request */ Native_utcb * const utcb = Thread_base::myself()->utcb(); diff --git a/base-hw/src/core/kernel/thread.cc b/base-hw/src/core/kernel/thread.cc index 850e0209c0..23c5c312de 100644 --- a/base-hw/src/core/kernel/thread.cc +++ b/base-hw/src/core/kernel/thread.cc @@ -449,16 +449,16 @@ void Thread::_call_yield_thread() } -void Thread::_call_wait_for_request() +void Thread::_call_await_request_msg() { void * buf_base; size_t buf_size; - _utcb_phys->call_wait_for_request(buf_base, buf_size); + _utcb_phys->call_await_request_msg(buf_base, buf_size); Ipc_node::await_request(buf_base, buf_size); } -void Thread::_call_request_and_wait() +void Thread::_call_send_request_msg() { Thread * const dst = Thread::pool()->object(user_arg_1()); if (!dst) { @@ -470,21 +470,21 @@ void Thread::_call_request_and_wait() size_t msg_size; void * buf_base; size_t buf_size; - _utcb_phys->call_request_and_wait(msg_base, msg_size, - buf_base, buf_size); + _utcb_phys->call_send_request_msg(msg_base, msg_size, + buf_base, buf_size); Ipc_node::send_request_await_reply(dst, msg_base, msg_size, buf_base, buf_size); } -void Thread::_call_reply() +void Thread::_call_send_reply_msg() { void * msg_base; size_t msg_size; - _utcb_phys->call_reply(msg_base, msg_size); + _utcb_phys->call_send_reply_msg(msg_base, msg_size); Ipc_node::send_reply(msg_base, msg_size); - bool const await_request = user_arg_1(); - if (await_request) { _call_wait_for_request(); } + bool const await_request_msg = user_arg_1(); + if (await_request_msg) { _call_await_request_msg(); } } @@ -868,9 +868,9 @@ void Thread::_call() case Call_id::PAUSE_THREAD: _call_pause_thread(); return; case Call_id::RESUME_THREAD: _call_resume_thread(); return; case Call_id::YIELD_THREAD: _call_yield_thread(); return; - case Call_id::REQUEST_AND_WAIT: _call_request_and_wait(); return; - case Call_id::REPLY: _call_reply(); return; - case Call_id::WAIT_FOR_REQUEST: _call_wait_for_request(); return; + case Call_id::SEND_REQUEST_MSG: _call_send_request_msg(); return; + case Call_id::SEND_REPLY_MSG: _call_send_reply_msg(); return; + case Call_id::AWAIT_REQUEST_MSG: _call_await_request_msg(); return; case Call_id::UPDATE_PD: _call_update_pd(); return; case Call_id::UPDATE_REGION: _call_update_region(); return; case Call_id::NEW_PD: _call_new_pd(); return; diff --git a/base-hw/src/core/kernel/thread.h b/base-hw/src/core/kernel/thread.h index a02d345bc5..e62320785f 100644 --- a/base-hw/src/core/kernel/thread.h +++ b/base-hw/src/core/kernel/thread.h @@ -190,9 +190,9 @@ class Kernel::Thread void _call_pause_thread(); void _call_resume_thread(); void _call_yield_thread(); - void _call_wait_for_request(); - void _call_request_and_wait(); - void _call_reply(); + void _call_await_request_msg(); + void _call_send_request_msg(); + void _call_send_reply_msg(); void _call_update_pd(); void _call_update_region(); void _call_print_char();