4 #include <kern/types.h>
5 #include <kern/radix.h>
9 #include <util/rbtree.h>
10 #include <util/radix.h>
11 #include <util/bmaptree.h>
13 #include <System/Objects.h>
28 // Address Space and PC to return to
29 Mem::ProcAddrSpace *ret_aspace;
32 // Caller's PIB Pointer
33 System::RunTime::ParamInfoBlock *caller_user_pib;
36 struct CallStackHeader {
37 Threads::Thread *thread;
40 // Number of CallFrames under this header.
41 // For a full page, this is:
42 // (Arch::page_size - sizeof(CallStackHeader)) / sizeof(CallFrame)
43 // There is also a much smaller group of call frames in the Thread
44 // structure, so that an ORB stack page doesn't need to be allocated
45 // in the common case of shallow method nesting.
52 static const ID invalid_id = 0xffffffff;
57 struct Object : public ObjectHdr {
58 Mem::ProcAddrSpace *aspace;
61 struct ObjectPtr : public ObjectHdr {
65 typedef Util::RadixTree<Object, ID, 6> LocalIDTable;
66 typedef Util::RadixTree<ObjectPtr, ID, 6> RemoteIDTable;
67 typedef Util::RBPtr<Object *, ObjectPtr *> IDRMap;
68 typedef Util::BitmapTree<ID> IDAlloc;
71 Lock::SpinLock lock; // For add/del only; not needed for lookup
72 LocalIDTable locals; // Objects that live in this address space
73 RemoteIDTable remotes; // Objects that live in other address spaces
74 IDRMap rmap; // Reverse mapping of remote object pointers to local IDs
75 IDAlloc alloc; // Bitmap for allocating IDs
78 Object *lookup(u32 id);
79 ObjectHdr *get_local(Object *obj);
80 Object *newobj(Mem::ProcAddrSpace *aspace);
83 void invoke_method(System::RunTime::ParamInfoBlock *pib, uintptr_t &stack);
84 uintptr_t return_from_method(uintptr_t &exptr, size_t &exlen);