mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 03:06:39 +00:00
NOVA: Use solely unsigned types for selectors
This commit is contained in:
parent
a6d2042d5b
commit
755ed3dc90
@ -15,6 +15,7 @@
|
||||
#define _INCLUDE__BASE__NATIVE_TYPES_H_
|
||||
|
||||
#include <base/native_capability.h>
|
||||
#include <base/stdint.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
@ -22,17 +23,23 @@ namespace Genode {
|
||||
|
||||
struct Native_thread
|
||||
{
|
||||
int ec_sel; /* NOVA cap selector for execution context */
|
||||
int sc_sel; /* NOVA cap selector for scheduling context */
|
||||
int rs_sel; /* NOVA cap selector for running semaphore */
|
||||
int pd_sel; /* NOVA cap selector of protection domain */
|
||||
int exc_pt_sel; /* base of event portal window */
|
||||
addr_t ec_sel; /* NOVA cap selector for execution context */
|
||||
addr_t sc_sel; /* NOVA cap selector for scheduling context */
|
||||
addr_t rs_sel; /* NOVA cap selector for running semaphore */
|
||||
addr_t pd_sel; /* NOVA cap selector of protection domain */
|
||||
addr_t exc_pt_sel; /* base of event portal window */
|
||||
};
|
||||
|
||||
typedef Native_thread Native_thread_id;
|
||||
|
||||
inline bool operator == (Native_thread_id t1, Native_thread_id t2) { return (t1.ec_sel == t2.ec_sel) && (t1.sc_sel == t2.sc_sel) && (t1.rs_sel == t2.rs_sel); }
|
||||
inline bool operator != (Native_thread_id t1, Native_thread_id t2) { return (t1.ec_sel != t2.ec_sel) && (t1.sc_sel != t2.sc_sel) && (t1.rs_sel != t2.rs_sel); }
|
||||
inline bool operator == (Native_thread_id t1, Native_thread_id t2)
|
||||
{
|
||||
return (t1.ec_sel == t2.ec_sel) && (t1.rs_sel == t2.rs_sel);
|
||||
}
|
||||
inline bool operator != (Native_thread_id t1, Native_thread_id t2)
|
||||
{
|
||||
return (t1.ec_sel != t2.ec_sel) && (t1.rs_sel != t2.rs_sel);
|
||||
}
|
||||
|
||||
class Native_utcb
|
||||
{
|
||||
@ -55,7 +62,7 @@ namespace Genode {
|
||||
|
||||
struct Cap_dst_policy
|
||||
{
|
||||
typedef int Dst;
|
||||
typedef addr_t Dst;
|
||||
static bool valid(Dst pt) { return pt != 0; }
|
||||
static Dst invalid() { return 0; }
|
||||
static void copy(void* dst, Native_capability_tpl<Cap_dst_policy>* src);
|
||||
|
Loading…
Reference in New Issue
Block a user