From 3bdf70f771a4e503dc032af1211e06a133fbf3cf Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Thu, 5 Dec 2013 16:12:48 +0100 Subject: [PATCH] hw: rename kill_* functions in bin_* In the future bin_* means the direct destruction of a kernel object without any blocking. kill_* in contrast is used for bringing a kernel object such as signal contexts synchronized into a sleeping state from where they can be destructed without the risk of getting broken refs in userland. ref #989 --- base-hw/include/kernel/interface.h | 24 ++++++++++---------- base-hw/src/core/kernel/thread.cc | 16 ++++++------- base-hw/src/core/kernel/thread.h | 8 +++---- base-hw/src/core/platform_pd.cc | 2 +- base-hw/src/core/platform_thread.cc | 2 +- base-hw/src/core/signal_session_component.cc | 4 ++-- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/base-hw/include/kernel/interface.h b/base-hw/include/kernel/interface.h index 4eead3e90..9c1a12e40 100644 --- a/base-hw/include/kernel/interface.h +++ b/base-hw/include/kernel/interface.h @@ -39,7 +39,7 @@ namespace Kernel { enum { NEW_THREAD = 0, - KILL_THREAD = 1, + BIN_THREAD = 1, START_THREAD = 2, PAUSE_THREAD = 3, RESUME_THREAD = 4, @@ -49,14 +49,14 @@ namespace Kernel UPDATE_PD = 8, UPDATE_REGION = 9, NEW_PD = 10, - KILL_PD = 11, + BIN_PD = 11, SEND_REQUEST_MSG = 12, SEND_REPLY_MSG = 13, AWAIT_REQUEST_MSG = 14, NEW_SIGNAL_RECEIVER = 15, NEW_SIGNAL_CONTEXT = 16, - KILL_SIGNAL_CONTEXT = 17, - KILL_SIGNAL_RECEIVER = 18, + BIN_SIGNAL_CONTEXT = 17, + BIN_SIGNAL_RECEIVER = 18, SUBMIT_SIGNAL = 19, AWAIT_SIGNAL = 20, SIGNAL_PENDING = 21, @@ -151,9 +151,9 @@ namespace Kernel * \retval 0 succeeded * \retval -1 failed */ - inline int kill_pd(unsigned const pd_id) + inline int bin_pd(unsigned const pd_id) { - return call(Call_id::KILL_PD, pd_id); + return call(Call_id::BIN_PD, pd_id); } @@ -223,9 +223,9 @@ namespace Kernel * * Restricted to core threads. */ - inline void kill_thread(unsigned const thread_id) + inline void bin_thread(unsigned const thread_id) { - call(Call_id::KILL_THREAD, thread_id); + call(Call_id::BIN_THREAD, thread_id); } @@ -532,9 +532,9 @@ namespace Kernel * * Restricted to core threads. */ - inline int kill_signal_context(unsigned const context) + inline int bin_signal_context(unsigned const context) { - return call(Call_id::KILL_SIGNAL_CONTEXT, context); + return call(Call_id::BIN_SIGNAL_CONTEXT, context); } @@ -548,9 +548,9 @@ namespace Kernel * * Restricted to core threads. */ - inline int kill_signal_receiver(unsigned const receiver) + inline int bin_signal_receiver(unsigned const receiver) { - return call(Call_id::KILL_SIGNAL_RECEIVER, receiver); + return call(Call_id::BIN_SIGNAL_RECEIVER, receiver); } diff --git a/base-hw/src/core/kernel/thread.cc b/base-hw/src/core/kernel/thread.cc index 9f86ca06a..03a8fbbcd 100644 --- a/base-hw/src/core/kernel/thread.cc +++ b/base-hw/src/core/kernel/thread.cc @@ -293,7 +293,7 @@ void Thread::_call_new_pd() } -void Thread::_call_kill_pd() +void Thread::_call_bin_pd() { /* check permissions */ if (!_core()) { @@ -337,7 +337,7 @@ void Thread::_call_new_thread() } -void Thread::_call_kill_thread() +void Thread::_call_bin_thread() { /* check permissions */ assert(_core()); @@ -815,7 +815,7 @@ void Thread::_call_ack_signal() } -void Thread::_call_kill_signal_context() +void Thread::_call_bin_signal_context() { /* check permissions */ if (!_core()) { @@ -841,7 +841,7 @@ void Thread::_call_kill_signal_context() } -void Thread::_call_kill_signal_receiver() +void Thread::_call_bin_signal_receiver() { /* check permissions */ if (!_core()) { @@ -944,7 +944,7 @@ void Thread::_call() { switch (user_arg_0()) { case Call_id::NEW_THREAD: _call_new_thread(); return; - case Call_id::KILL_THREAD: _call_kill_thread(); return; + case Call_id::BIN_THREAD: _call_bin_thread(); return; case Call_id::START_THREAD: _call_start_thread(); return; case Call_id::PAUSE_THREAD: _call_pause_thread(); return; case Call_id::RESUME_THREAD: _call_resume_thread(); return; @@ -958,8 +958,8 @@ void Thread::_call() case Call_id::PRINT_CHAR: _call_print_char(); return; case Call_id::NEW_SIGNAL_RECEIVER: _call_new_signal_receiver(); return; case Call_id::NEW_SIGNAL_CONTEXT: _call_new_signal_context(); return; - case Call_id::KILL_SIGNAL_CONTEXT: _call_kill_signal_context(); return; - case Call_id::KILL_SIGNAL_RECEIVER: _call_kill_signal_receiver(); return; + case Call_id::BIN_SIGNAL_CONTEXT: _call_bin_signal_context(); return; + case Call_id::BIN_SIGNAL_RECEIVER: _call_bin_signal_receiver(); return; case Call_id::AWAIT_SIGNAL: _call_await_signal(); return; case Call_id::SUBMIT_SIGNAL: _call_submit_signal(); return; case Call_id::SIGNAL_PENDING: _call_signal_pending(); return; @@ -967,7 +967,7 @@ void Thread::_call() case Call_id::NEW_VM: _call_new_vm(); return; case Call_id::RUN_VM: _call_run_vm(); return; case Call_id::PAUSE_VM: _call_pause_vm(); return; - case Call_id::KILL_PD: _call_kill_pd(); return; + case Call_id::BIN_PD: _call_bin_pd(); return; case Call_id::ACCESS_THREAD_REGS: _call_access_thread_regs(); return; case Call_id::ROUTE_THREAD_EVENT: _call_route_thread_event(); return; default: diff --git a/base-hw/src/core/kernel/thread.h b/base-hw/src/core/kernel/thread.h index 1f76e43d6..80e181cb9 100644 --- a/base-hw/src/core/kernel/thread.h +++ b/base-hw/src/core/kernel/thread.h @@ -203,9 +203,9 @@ class Kernel::Thread ****************************************************************/ void _call_new_pd(); - void _call_kill_pd(); + void _call_bin_pd(); void _call_new_thread(); - void _call_kill_thread(); + void _call_bin_thread(); void _call_start_thread(); void _call_pause_thread(); void _call_resume_thread(); @@ -222,8 +222,8 @@ class Kernel::Thread void _call_signal_pending(); void _call_submit_signal(); void _call_ack_signal(); - void _call_kill_signal_context(); - void _call_kill_signal_receiver(); + void _call_bin_signal_context(); + void _call_bin_signal_receiver(); void _call_new_vm(); void _call_run_vm(); void _call_pause_vm(); diff --git a/base-hw/src/core/platform_pd.cc b/base-hw/src/core/platform_pd.cc index 8b9ce6995..615478529 100644 --- a/base-hw/src/core/platform_pd.cc +++ b/base-hw/src/core/platform_pd.cc @@ -20,7 +20,7 @@ Platform_pd::~Platform_pd() { _tlb->remove_region(platform()->vm_start(), platform()->vm_size()); regain_ram_from_tlb(_tlb); - if (Kernel::kill_pd(_id)) { + if (Kernel::bin_pd(_id)) { PERR("failed to destruct protection domain at kernel"); } } diff --git a/base-hw/src/core/platform_thread.cc b/base-hw/src/core/platform_thread.cc index 89c6ed572..971af0145 100644 --- a/base-hw/src/core/platform_thread.cc +++ b/base-hw/src/core/platform_thread.cc @@ -71,7 +71,7 @@ Platform_thread::~Platform_thread() rm->remove_client(cap); } /* destroy object at the kernel */ - Kernel::kill_thread(_id); + Kernel::bin_thread(_id); } diff --git a/base-hw/src/core/signal_session_component.cc b/base-hw/src/core/signal_session_component.cc index a2205e2f1..5942b3e7e 100644 --- a/base-hw/src/core/signal_session_component.cc +++ b/base-hw/src/core/signal_session_component.cc @@ -137,7 +137,7 @@ void Signal_session_component::free_context(Signal_context_capability cap) void Signal_session_component::_destruct_context(Context * const c) { /* release kernel resources */ - if (Kernel::kill_signal_context(c->id())) + if (Kernel::bin_signal_context(c->id())) { /* clean-up */ c->release(); @@ -153,7 +153,7 @@ void Signal_session_component::_destruct_context(Context * const c) void Signal_session_component::_destruct_receiver(Receiver * const r) { /* release kernel resources */ - if (Kernel::kill_signal_receiver(r->id())) + if (Kernel::bin_signal_receiver(r->id())) { /* clean-up */ r->release();