Rev 22 | Rev 106 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 22 | Rev 65 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | #include <arch/types.h> |
31 | #include <arch/types.h> |
32 | #include <arch.h> |
32 | #include <arch.h> |
33 | #include <proc/thread.h> |
33 | #include <proc/thread.h> |
34 | #include <mm/vm.h> |
34 | #include <mm/vm.h> |
35 | 35 | ||
- | 36 | ||
- | 37 | /** Enter userspace |
|
- | 38 | * |
|
- | 39 | * Change CPU protection level to 3, enter userspace. |
|
- | 40 | * |
|
- | 41 | */ |
|
36 | void userspace(void) |
42 | void userspace(void) |
37 | { |
43 | { |
38 | pri_t pri; |
44 | pri_t pri; |
39 | 45 | ||
40 | pri = cpu_priority_high(); |
46 | pri = cpu_priority_high(); |
Line 45... | Line 51... | ||
45 | "pushl %2\n" |
51 | "pushl %2\n" |
46 | "pushl %3\n" |
52 | "pushl %3\n" |
47 | "pushl %4\n" |
53 | "pushl %4\n" |
48 | "iret" |
54 | "iret" |
49 | : : "i" (selector(UDATA_DES) | PL_USER), "i" (USTACK_ADDRESS+THREAD_STACK_SIZE-1000), "r" (pri), "i" (selector(UTEXT_DES) | PL_USER), "i" (UTEXT_ADDRESS)); |
55 | : : "i" (selector(UDATA_DES) | PL_USER), "i" (USTACK_ADDRESS+THREAD_STACK_SIZE-1000), "r" (pri), "i" (selector(UTEXT_DES) | PL_USER), "i" (UTEXT_ADDRESS)); |
50 | /* NOT REACHED */ |
- | |
51 | 56 | ||
- | 57 | /* Unreachable */ |
|
52 | for(;;); |
58 | for(;;); |
53 | } |
59 | } |