hw: don't restrict update_data_region to core

ref #1115
This commit is contained in:
Martin Stein 2014-04-07 15:52:21 +02:00 committed by Christian Helmuth
parent 5a1fc6da60
commit 3f14defd9d
3 changed files with 22 additions and 26 deletions

View File

@ -47,6 +47,7 @@ namespace Kernel
constexpr Call_arg call_id_signal_pending() { return 9; }
constexpr Call_arg call_id_ack_signal() { return 10; }
constexpr Call_arg call_id_print_char() { return 11; }
constexpr Call_arg call_id_update_data_region() { return 12; }
/*****************************************************************
@ -120,6 +121,16 @@ namespace Kernel
call(call_id_yield_thread(), thread_id);
}
/**
* Globally apply writes to a data region in the current domain
*
* \param base base of the region within the current domain
* \param size size of the region
*/
inline void update_data_region(addr_t const base, size_t const size)
{
call(call_id_update_data_region(), (Call_arg)base, (Call_arg)size);
}
/**
* Send request message and await receipt of corresponding reply message

View File

@ -31,14 +31,13 @@ namespace Kernel
/**
* Kernel names of the kernel calls
*/
constexpr Call_arg call_id_new_thread() { return 12; }
constexpr Call_arg call_id_bin_thread() { return 13; }
constexpr Call_arg call_id_start_thread() { return 14; }
constexpr Call_arg call_id_resume_thread() { return 15; }
constexpr Call_arg call_id_access_thread_regs() { return 16; }
constexpr Call_arg call_id_route_thread_event() { return 17; }
constexpr Call_arg call_id_update_pd() { return 18; }
constexpr Call_arg call_id_update_data_region() { return 19; }
constexpr Call_arg call_id_new_thread() { return 13; }
constexpr Call_arg call_id_bin_thread() { return 14; }
constexpr Call_arg call_id_start_thread() { return 15; }
constexpr Call_arg call_id_resume_thread() { return 16; }
constexpr Call_arg call_id_access_thread_regs() { return 17; }
constexpr Call_arg call_id_route_thread_event() { return 18; }
constexpr Call_arg call_id_update_pd() { return 19; }
constexpr Call_arg call_id_new_pd() { return 20; }
constexpr Call_arg call_id_bin_pd() { return 21; }
constexpr Call_arg call_id_new_signal_receiver() { return 22; }
@ -94,20 +93,6 @@ namespace Kernel
}
/**
* Write-through the cached contents of a region in the current domain
*
* \param base base of the region within the current domain
* \param size size of the region
*
* Does apply only to data caches.
*/
inline void update_data_region(addr_t const base, size_t const size)
{
call(call_id_update_data_region(), (Call_arg)base, (Call_arg)size);
}
/**
* Create a thread
*

View File

@ -543,9 +543,9 @@ void Thread::_call_update_pd()
void Thread::_call_update_data_region()
{
/* flush hardware caches */
Processor::flush_data_caches_by_virt_region((addr_t)user_arg_1(),
(size_t)user_arg_2());
auto base = (addr_t)user_arg_1();
auto const size = (size_t)user_arg_2();
Processor::flush_data_caches_by_virt_region(base, size);
}
@ -855,6 +855,7 @@ void Thread::_call()
/* switch over unrestricted kernel calls */
unsigned const call_id = user_arg_0();
switch (call_id) {
case call_id_update_data_region(): _call_update_data_region(); return;
case call_id_pause_current_thread(): _call_pause_current_thread(); return;
case call_id_resume_local_thread(): _call_resume_local_thread(); return;
case call_id_yield_thread(): _call_yield_thread(); return;
@ -884,7 +885,6 @@ void Thread::_call()
case call_id_access_thread_regs(): _call_access_thread_regs(); return;
case call_id_route_thread_event(): _call_route_thread_event(); return;
case call_id_update_pd(): _call_update_pd(); return;
case call_id_update_data_region(): _call_update_data_region(); return;
case call_id_new_pd(): _call_new_pd(); return;
case call_id_bin_pd(): _call_bin_pd(); return;
case call_id_new_signal_receiver(): _call_new_signal_receiver(); return;