]> git.buserror.net Git - polintos/scott/priv.git/blobdiff - kernel/orb/invoke.cc
Regs struct, int98/99
[polintos/scott/priv.git] / kernel / orb / invoke.cc
index 57097c55e0bc15a2500e3887eada0c677c8b533a..ffcd8372318c4e8f581fc490602c73b750c4993b 100644 (file)
 #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;
@@ -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;
+       }
 }