]> git.buserror.net Git - polintos/scott/priv.git/blobdiff - kernel/tests/aspace.cc
update
[polintos/scott/priv.git] / kernel / tests / aspace.cc
index 18f9d05a4d751716a505936980c79d54ff6c1f48..a8b53e682a37807843690290df112ae24900bb45 100644 (file)
 #include <kern/time.h>
 #include <kern/thread.h>
 #include <kern/mem.h>
+#include <kern/process.h>
 
 using namespace Mem;
 namespace Mem {
        extern IMappable physmem;
 }
 
-void thread(void *arg)
+void thread(void *arg1, void *arg2)
 {
        // Yuck -- out param->return value promotion would turn it into
        // AddrSpace aspace = AddrSpace::downcast(Mem::proc_addr_space_factory.create()),
@@ -36,7 +37,7 @@ void thread(void *arg)
        
        printf("aspace %p created\n", (void *)aspace);
        
-       AddrSpace *kaspace = AddrSpace::classptr(aspace);
+       ProcAddrSpace *kaspace = static_cast<ProcAddrSpace *>(AddrSpace::classptr(aspace));
        
        printf("kaspace %p\n", kaspace);
        
@@ -56,7 +57,8 @@ void thread(void *arg)
               (void *)stacked[0], (void *)stacked[1],
               (void *)mappables[0], (void *)mappables[1]);
                
-       char *buf = new char[100000];
+//     char *buf = new char[100000];
+       char *buf = (char *)alloc_pages(25);
        printf("buf %p\n", buf);
        
        char *abuf = (char *)((((ulong)buf) + 4095) & ~4095);
@@ -147,5 +149,5 @@ void thread(void *arg)
 
 void run_test()
 {
-       Threads::sched.new_thread(thread, NULL, "thread")->wake();
+       Threads::sched.new_thread(thread, NULL, NULL, "thread")->wake();
 }