X-Git-Url: http://git.buserror.net/cgi-bin/gitweb.cgi?p=polintos%2Fscott%2Fpriv.git;a=blobdiff_plain;f=kernel%2Finclude%2Fkern%2Forb.h;h=22664ec2d006dac80c92d67ce6dae7a24939c4e5;hp=dc832c385c1566d0e8122c389408eea6e1d1522b;hb=139f54779f6395a1828261423cd8013ca940ff36;hpb=b4bfc871337ca32ce83407916a87db2524729ca9 diff --git a/kernel/include/kern/orb.h b/kernel/include/kern/orb.h index dc832c3..22664ec 100644 --- a/kernel/include/kern/orb.h +++ b/kernel/include/kern/orb.h @@ -2,11 +2,16 @@ #define _KERN_ORB_H #include -#include +#include +#include #include #include +#include +#include + #include +#include namespace Mem { class ProcAddrSpace; @@ -22,17 +27,10 @@ namespace ORB { struct CallFrame { // Address Space and PC to return to Mem::ProcAddrSpace *ret_aspace; - ulong ret_pc; + uintptr_t ret_stack; // Caller's PIB Pointer System::RunTime::ParamInfoBlock *caller_user_pib; - - // Object and Method that were called -- it probably isn't strictly - // necessary to keep track of this here, but it'd help in doing a - // "traceforward" of the method invocation stack in order to - // debug a stalled method call. - - ID object, method; }; struct CallStackHeader { @@ -50,42 +48,41 @@ namespace ORB { CallFrame frames[0]; }; - - struct ObjectHdr; - struct Object; - - typedef Util::RBTree IDRMap; + static const ID invalid_id = 0xffffffff; struct ObjectHdr { - IDRMap::Node rbtree_node; - u32 id; - - union { - struct { - u32 Pointer:1; - }; - - u32 flags; - }; + ID id; }; struct Object : public ObjectHdr { Mem::ProcAddrSpace *aspace; - uintptr_t entry; }; struct ObjectPtr : public ObjectHdr { Object *object; }; + + typedef Util::RadixTree LocalIDTable; + typedef Util::RadixTree RemoteIDTable; + typedef Util::RBPtr IDRMap; + typedef Util::BitmapTree IDAlloc; class IDSpace { - // Reverse mapping of object pointers to local IDs - IDRMap id_rmap; + Lock::SpinLock lock; // For add/del only; not needed for lookup + LocalIDTable locals; // Objects that live in this address space + RemoteIDTable remotes; // Objects that live in other address spaces + IDRMap rmap; // Reverse mapping of remote object pointers to local IDs + IDAlloc alloc; // Bitmap for allocating IDs public: Object *lookup(u32 id); - u32 rlookup(Object *obj); + ObjectHdr *get_local(Object *obj); + Object *newobj(Mem::ProcAddrSpace *aspace); }; + + void invoke_method(System::RunTime::ParamInfoBlock *pib, uintptr_t &stack); + uintptr_t return_from_method(uintptr_t &exptr, size_t &exlen); + void init(); } #endif