mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
hw: unlock kernel before context propagation
Propagating the user context-pointer from C++ code to the mode transition assembly doesn't touch any CPU global data. Thus, we can reduce the in-sync window. Fixes #1223
This commit is contained in:
parent
91cb3decdb
commit
555835c95b
@ -69,14 +69,14 @@ void Mode_transition_control::switch_to(Cpu::Context * const context,
|
||||
addr_t const entry_raw,
|
||||
addr_t const context_ptr_base)
|
||||
{
|
||||
/* unlock kernel data */
|
||||
data_lock().unlock();
|
||||
|
||||
/* override client-context pointer of the executing CPU */
|
||||
size_t const context_ptr_offset = cpu * sizeof(context);
|
||||
addr_t const context_ptr = context_ptr_base + context_ptr_offset;
|
||||
*(void * *)context_ptr = context;
|
||||
|
||||
/* unlock kernel data */
|
||||
data_lock().unlock();
|
||||
|
||||
/* call assembly code that applies the virtual-machine context */
|
||||
typedef void (* Entry)();
|
||||
Entry __attribute__((noreturn)) const entry = (Entry)entry_raw;
|
||||
|
Loading…
x
Reference in New Issue
Block a user