mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-18 23:28:29 +00:00
base-foc: don't use Native_thread in pager code
The Native_thread type was solely used to refer to the originator of a page fault. A plain kcap value suffices for that.
This commit is contained in:
@ -16,23 +16,12 @@
|
|||||||
#define _CORE__INCLUDE__IPC_PAGER_H_
|
#define _CORE__INCLUDE__IPC_PAGER_H_
|
||||||
|
|
||||||
/* Genode includes */
|
/* Genode includes */
|
||||||
#include <base/ipc.h>
|
|
||||||
#include <base/stdint.h>
|
|
||||||
#include <base/native_capability.h>
|
|
||||||
#include <base/thread_state.h>
|
|
||||||
#include <util/touch.h>
|
|
||||||
#include <foc/native_capability.h>
|
#include <foc/native_capability.h>
|
||||||
#include <foc/thread_state.h>
|
#include <foc/thread_state.h>
|
||||||
|
|
||||||
/* base-internal includes */
|
|
||||||
#include <base/internal/native_thread.h>
|
|
||||||
|
|
||||||
/* core includes */
|
/* core includes */
|
||||||
#include <mapping.h>
|
#include <mapping.h>
|
||||||
|
|
||||||
/* Fiasco.OC includes */
|
|
||||||
#include <foc/syscall.h>
|
|
||||||
|
|
||||||
namespace Core { class Ipc_pager; }
|
namespace Core { class Ipc_pager; }
|
||||||
|
|
||||||
|
|
||||||
@ -44,7 +33,9 @@ class Core::Ipc_pager : public Native_capability
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Native_thread _last { }; /* origin of last fault */
|
struct Last { Foc::l4_cap_idx_t kcap; };
|
||||||
|
|
||||||
|
Last _last { }; /* origin of last fault */
|
||||||
addr_t _pf_addr { 0 }; /* page-fault address */
|
addr_t _pf_addr { 0 }; /* page-fault address */
|
||||||
addr_t _pf_ip { 0 }; /* ip of faulter */
|
addr_t _pf_ip { 0 }; /* ip of faulter */
|
||||||
Mapping _reply_mapping { }; /* page-fault answer */
|
Mapping _reply_mapping { }; /* page-fault answer */
|
||||||
@ -97,7 +88,7 @@ class Core::Ipc_pager : public Native_capability
|
|||||||
/**
|
/**
|
||||||
* Set destination for next reply
|
* Set destination for next reply
|
||||||
*/
|
*/
|
||||||
void set_reply_dst(Native_thread t) { _last = t; }
|
void set_reply_dst(Last last) { _last = last; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Answer call without sending a flex-page mapping
|
* Answer call without sending a flex-page mapping
|
||||||
@ -115,7 +106,7 @@ class Core::Ipc_pager : public Native_capability
|
|||||||
/**
|
/**
|
||||||
* Return thread ID of last faulter
|
* Return thread ID of last faulter
|
||||||
*/
|
*/
|
||||||
Native_thread last() const { return _last; }
|
Last last() const { return _last; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return badge for faulting thread
|
* Return badge for faulting thread
|
||||||
|
@ -61,7 +61,7 @@ void Pager_entrypoint::entry()
|
|||||||
|
|
||||||
/* handle request */
|
/* handle request */
|
||||||
if (obj->pager(_pager) == Pager_object::Pager_result::CONTINUE) {
|
if (obj->pager(_pager) == Pager_object::Pager_result::CONTINUE) {
|
||||||
_pager.set_reply_dst(Native_thread(obj->badge()));
|
_pager.set_reply_dst({ .kcap = obj->badge() });
|
||||||
reply_pending = true;
|
reply_pending = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ void Pager_entrypoint::entry()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* send reply to the caller */
|
/* send reply to the caller */
|
||||||
_pager.set_reply_dst(Native_thread());
|
_pager.set_reply_dst({ });
|
||||||
_pager.acknowledge_wakeup();
|
_pager.acknowledge_wakeup();
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -91,7 +91,7 @@ void Pager_entrypoint::entry()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* send wake up message to requested thread */
|
/* send wake up message to requested thread */
|
||||||
_pager.set_reply_dst(Native_thread(obj->badge()));
|
_pager.set_reply_dst({ .kcap = obj->badge() });
|
||||||
_pager.acknowledge_exception();
|
_pager.acknowledge_exception();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ void Pager_entrypoint::entry()
|
|||||||
* that case we unblock it immediately.
|
* that case we unblock it immediately.
|
||||||
*/
|
*/
|
||||||
if (!obj->state.paused) {
|
if (!obj->state.paused) {
|
||||||
_pager.set_reply_dst(Native_thread(obj->badge()));
|
_pager.set_reply_dst({ .kcap = obj->badge() });
|
||||||
reply_pending = true;
|
reply_pending = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user