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=404e9c0dbad8ab78daa30300f8f0930559d08254;hb=139f54779f6395a1828261423cd8013ca940ff36;hpb=0601614ebbcc48b961a2f0613281e6e629af29b1 diff --git a/kernel/include/kern/orb.h b/kernel/include/kern/orb.h index 404e9c0..22664ec 100644 --- a/kernel/include/kern/orb.h +++ b/kernel/include/kern/orb.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include @@ -11,6 +11,7 @@ #include #include +#include namespace Mem { class ProcAddrSpace; @@ -26,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 { @@ -54,56 +48,41 @@ namespace ORB { CallFrame frames[0]; }; - - struct ObjectHdr; - struct Object; - typedef u32 ID; + static const ID invalid_id = 0xffffffff; struct ObjectHdr { ID id; - - union { - struct { - u32 Pointer:1; - }; - - u32 flags; - }; }; struct Object : public ObjectHdr { Mem::ProcAddrSpace *aspace; - uintptr_t entry; }; struct ObjectPtr : public ObjectHdr { Object *object; }; - union ObjTableEntry { - ObjectHdr hdr; - Object obj; - ObjectPtr ptr; - }; - - typedef Util::RadixTree IDTable; - typedef Util::RadixTree IDRMap; + 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 - IDTable table; - IDRMap rmap; - IDAlloc alloc; + 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); - ObjectHdr *get_local_hdr(Object *obj); - Object *newobj(Mem::ProcAddrSpace *aspace, uintptr_t entry); + 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