#include <orb.h>
#include <util/list.h>
+#include <util/rbtree.h>
#include <System/Objects.h>
namespace Mem {
- class AddrSpace;
+ class ProcAddrSpace;
};
namespace Threads {
};
namespace ORB {
- typedef ulong ID;
+ typedef u32 ID;
struct CallFrame {
// Address Space and PC to return to
- Mem::AddrSpace *ret_aspace;
+ Mem::ProcAddrSpace *ret_aspace;
ulong ret_pc;
// Caller's PIB Pointer
CallFrame frames[0];
};
+
+ struct ObjectHdr;
+ struct Object;
+
+ typedef Util::RBTree<ObjectHdr, Object *, Object *> IDRMap;
+
+ struct ObjectHdr {
+ IDRMap::Node rbtree_node;
+ u32 id;
+
+ union {
+ struct {
+ u32 Pointer:1;
+ };
+
+ u32 flags;
+ };
+ };
+
+ struct Object : public ObjectHdr {
+ Mem::ProcAddrSpace *aspace;
+ uintptr_t entry;
+ };
+
+ struct ObjectPtr : public ObjectHdr {
+ Object *object;
+ };
+
+ class IDSpace {
+ // Reverse mapping of object pointers to local IDs
+ IDRMap id_rmap;
+
+ public:
+ Object *lookup(u32 id);
+ u32 rlookup(Object *obj);
+ };
}
#endif