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.
65 struct Object : public ObjectHdr {
66 Mem::ProcAddrSpace *aspace;
69 struct ObjectPtr : public ObjectHdr {
79 typedef Util::RadixTree<ObjTableEntry, ID, 6> IDTable;
80 typedef Util::RBPtr<Object *, ObjectPtr *> IDRMap;
81 typedef Util::BitmapTree<ID> IDAlloc;
84 Lock::SpinLock lock; // For add/del only; not needed for lookup
85 IDTable table; // Forward mapping of local IDs to object ptrs
86 IDRMap rmap; // Reverse mapping of remote object pointers to local IDs
87 IDAlloc alloc; // Bitmap for allocating IDs
90 Object *lookup(u32 id);
91 ObjectHdr *get_local(Object *obj);
92 Object *newobj(Mem::ProcAddrSpace *aspace);
95 void invoke_method(System::RunTime::ParamInfoBlock *pib, uintptr_t &stack);
96 uintptr_t return_from_method(uintptr_t &exptr, size_t &exlen);