3 // This software is copyright (c) 2007 Scott Wood <scott@buserror.net>.
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors or contributors be held liable for any damages
7 // arising from the use of this software.
9 // Permission is hereby granted to everyone, free of charge, to use, copy,
10 // modify, prepare derivative works of, publish, distribute, perform,
11 // sublicense, and/or sell copies of the Software, provided that the above
12 // copyright notice and disclaimer of warranty be included in all copies or
13 // substantial portions of this software.
15 #include <kern/types.h>
16 #include <kern/libc.h>
17 #include <kern/thread.h>
20 #include <kern/process.h>
22 extern "C" void arch_new_user_thread(void *, void *);
23 extern u32 test_user_ptr;
24 using namespace Threads;
29 Thread *t = sched.new_thread(arch_new_user_thread, (void *)test_user_ptr,
30 (void *)(Arch::stack_top + 1), "thread");
33 proc_addr_space_factory.create(&obj);
34 IAddrSpace aspace = IAddrSpace::downcast(obj);
36 printf("aspace %p created\n", (void *)aspace);
38 ProcAddrSpace *kaspace = static_cast<ProcAddrSpace *>(AddrSpace::classptr(aspace));
40 printf("kaspace %p\n", kaspace);
42 t->set_aspace(kaspace);