Rev 1705 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1705 | Rev 1742 | ||
---|---|---|---|
Line 65... | Line 65... | ||
65 | 65 | ||
66 | #define TLB_EXC ((char *) 0x80000000) |
66 | #define TLB_EXC ((char *) 0x80000000) |
67 | #define NORM_EXC ((char *) 0x80000180) |
67 | #define NORM_EXC ((char *) 0x80000180) |
68 | #define CACHE_EXC ((char *) 0x80000100) |
68 | #define CACHE_EXC ((char *) 0x80000100) |
69 | 69 | ||
- | 70 | ||
- | 71 | /* Why the linker moves the variable 64K away in assembler |
|
- | 72 | * when not in .text section ???????? |
|
- | 73 | */ |
|
- | 74 | __address supervisor_sp __attribute__ ((section (".text"))); |
|
- | 75 | /* Stack pointer saved when entering user mode */ |
|
- | 76 | /* TODO: How do we do it on SMP system???? */ |
|
70 | bootinfo_t bootinfo; |
77 | bootinfo_t bootinfo __attribute__ ((section (".text"))); |
71 | 78 | ||
72 | void arch_pre_main(void) |
79 | void arch_pre_main(void) |
73 | { |
80 | { |
74 | /* Setup usermode */ |
81 | /* Setup usermode */ |
75 | init.cnt = bootinfo.cnt; |
82 | init.cnt = bootinfo.cnt; |
Line 131... | Line 138... | ||
131 | 138 | ||
132 | void arch_post_smp_init(void) |
139 | void arch_post_smp_init(void) |
133 | { |
140 | { |
134 | } |
141 | } |
135 | 142 | ||
136 | /* Stack pointer saved when entering user mode */ |
- | |
137 | /* TODO: How do we do it on SMP system???? */ |
- | |
138 | - | ||
139 | /* Why the linker moves the variable 64K away in assembler |
- | |
140 | * when not in .text section ???????? |
- | |
141 | */ |
- | |
142 | __address supervisor_sp __attribute__ ((section (".text"))); |
- | |
143 | - | ||
144 | void userspace(uspace_arg_t *kernel_uarg) |
143 | void userspace(uspace_arg_t *kernel_uarg) |
145 | { |
144 | { |
146 | /* EXL=1, UM=1, IE=1 */ |
145 | /* EXL=1, UM=1, IE=1 */ |
147 | cp0_status_write(cp0_status_read() | (cp0_status_exl_exception_bit | |
146 | cp0_status_write(cp0_status_read() | (cp0_status_exl_exception_bit | |
148 | cp0_status_um_bit | |
147 | cp0_status_um_bit | |