genode/base-nova/include
Alexander Boettcher 841a1fd579 NOVA: extend cpu_session with synchronous pause
The kernel provides a "recall" feature issued on threads to force a thread into
an exception. In the exception the current state of the thread can be obtained
and its execution can be halted/paused.

However, the recall exception is only delivered when the next time the thread
would leave the kernel. That means the delivery is asynchronous and Genode has
to wait until the exception triggered.

Waiting for the exception can either be done in the cpu_session service or
outside the service in the protection domain of the caller.

It turned out that waiting inside the cpu_service is prone to deadlock the
system. The cpu_session interface is one of many session interfaces handled by
the same thread inside Core.

Deadlock situation:
* The caller (thread_c) to pause some thread_p manages to establish the call
  to the cpu_session thread_s of Core but get be interrupted before issuing
  the actual pause (recall) command.
* Now the - to be recalled thread_p - is scheduled and tries to invoke another
  service of Core, like making log output.
* Since the Core thread_s is handling the session request of thread_c, the
  kernel uses the timeslice of thread_p to help to finish the request handled
  by thread_s.
* Thread_s issues the actual pause/recall on thread_p and blocks inside Core
  to wait for the recall exception to be issued.
* thread_p will leave not the kernel before finishing it actual IPC with
  thread_s which is blocked waiting for thread_p.

That is the reason why the waiting/blocking for the recall exception taking
place must be done on NOVA in the context of the caller (thread_1).

Introduce a pause_sync call to the cpu_session which returns a semaphore
capability to the caller. The caller blocks on the semaphore and is woken up
when the pager of thread_p receives the recall exception with the state of
thread_p.
2012-08-30 10:40:00 +02:00
..
32bit/nova Move semaphore op codes to generic syscall 2012-07-04 14:56:45 +02:00
64bit/nova NOVA: fix compiler warning 2012-08-16 10:03:07 +02:00
base NOVA: Use thread_state with all registers 2012-08-30 10:40:00 +02:00
cap_session NOVA: extend cap session for base-nova 2012-08-09 11:09:40 +02:00
cpu_session NOVA: extend cpu_session with synchronous pause 2012-08-30 10:40:00 +02:00
nova NOVA: let thread die if SM cap is invalid 2012-08-09 11:09:42 +02:00
nova_cpu_session NOVA: extend cpu_session with synchronous pause 2012-08-30 10:40:00 +02:00
pd_session NOVA: force to map cap in pd_session::assing_pd 2012-08-09 11:09:41 +02:00
rm_session NOVA: make noux_tool_chain happy 2012-08-17 11:43:04 +02:00
signal_session NOVA: let thread die if SM cap is invalid 2012-08-09 11:09:42 +02:00