X-Git-Url: http://git.buserror.net/cgi-bin/gitweb.cgi?p=polintos%2Fscott%2Fpriv.git;a=blobdiff_plain;f=kernel%2Forb%2Finvoke.cc;h=ffcd8372318c4e8f581fc490602c73b750c4993b;hp=57097c55e0bc15a2500e3887eada0c677c8b533a;hb=0601614ebbcc48b961a2f0613281e6e629af29b1;hpb=b4bfc871337ca32ce83407916a87db2524729ca9 diff --git a/kernel/orb/invoke.cc b/kernel/orb/invoke.cc index 57097c5..ffcd837 100644 --- a/kernel/orb/invoke.cc +++ b/kernel/orb/invoke.cc @@ -16,7 +16,10 @@ #include #include #include +#include + #include + #include using System::RunTime::ParamInfoBlock; @@ -43,35 +46,59 @@ namespace ORB { return &hdr->frames[++thread->orbstack_top]; } - - u32 IDSpace::rlookup(Object *obj) + + ObjectHdr *IDSpace::get_local_hdr(Object *obj) { -#if 0 - ObjectHdr *hdr = idtree.find(obj); + ObjectHdr *hdr = *rmap.lookup(obj->id); + if (hdr) + return hdr; - if (!hdr) - return 0; + 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 hdr->id; -#endif - return 0; + return obj; } -} -extern "C" void invoke_method(u32 objid, u32 methid, ParamInfoBlock *user_pib, - ulong ret_pc) -{ - ParamInfoBlock pib = Arch::copyin(user_pib); - CallFrame *frame = new_frame(curthread); - - frame->object = objid; - frame->method = methid; - frame->caller_user_pib = user_pib; - frame->ret_pc = ret_pc; - - printf("invoke_method: frame %p object %x method %x pib %p ret %lx\n", - frame, frame->object, frame->method, frame->caller_user_pib, - frame->ret_pc); - + void invoke_method(ParamInfoBlock *user_pib, uintptr_t &stack) + { + ParamInfoBlock pib = Arch::copyin(user_pib); + CallFrame *frame = new_frame(curthread); + +// if (pib->objlist_len == 0) + + +// frame->object = objid; + frame->caller_user_pib = user_pib; +// frame->ret_pc = ret_pc; + + printf("invoke_method: frame %p pib %p ret %lx\n", + frame, frame->caller_user_pib, + frame->ret_pc); + + + } + uintptr_t return_from_method(uintptr_t &exptr, size_t &exlen) + { + return 0; + } }