#include <kern/orb.h>
#include <kern/pagealloc.h>
#include <kern/compiler.h>
+#include <kern/thread.h>
+
#include <arch/usercopy.h>
+
#include <orb.h>
using System::RunTime::ParamInfoBlock;
return &hdr->frames[0];
}
- return &hdr->frames[thread->orbstack_top += 1];
+ return &hdr->frames[++thread->orbstack_top];
+ }
+
+ ObjectHdr *IDSpace::get_local_hdr(Object *obj)
+ {
+ ObjectHdr *hdr = *rmap.lookup(obj->id);
+ if (hdr)
+ return hdr;
+
+ int id = alloc.alloc();
+ ObjectPtr *ptr = &table.lookup(id, true)->ptr;
+
+ ptr->id = id;
+ ptr->flags = 0;
+ ptr->Pointer = 1;
+ ptr->object = obj;
+
+ *rmap.lookup(id, true) = ptr;
+ return ptr;
+ }
+
+ Object *IDSpace::newobj(Mem::ProcAddrSpace *aspace, uintptr_t entry)
+ {
+ int id = alloc.alloc();
+ Object *obj = &table.lookup(id, true)->obj;
+
+ obj->id = id;
+ obj->flags = 0;
+ obj->aspace = aspace;
+ obj->entry = entry;
+
+ return obj;
}
}
-extern "C" void invoke_method(ulong objid, ulong methid,
- ParamInfoBlock *user_pib, ulong ret_pc)
+extern "C" void invoke_method(ParamInfoBlock *user_pib, ulong ret_pc)
{
ParamInfoBlock pib = Arch::copyin(user_pib);
CallFrame *frame = new_frame(curthread);
- frame->object = objid;
- frame->method = methid;
+// frame->object = objid;
frame->caller_user_pib = user_pib;
frame->ret_pc = ret_pc;
- printf("invoke_method: frame %p object %lx method %lx pib %p ret %lx\n",
- frame, frame->object, frame->method, frame->caller_user_pib,
+ printf("invoke_method: frame %p pib %p ret %lx\n",
+ frame, frame->caller_user_pib,
frame->ret_pc);