Rev 897 | Rev 1066 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 897 | Rev 938 | ||
---|---|---|---|
Line 116... | Line 116... | ||
116 | /* Why the linker moves the variable 64K away in assembler |
116 | /* Why the linker moves the variable 64K away in assembler |
117 | * when not in .text section ???????? |
117 | * when not in .text section ???????? |
118 | */ |
118 | */ |
119 | __address supervisor_sp __attribute__ ((section (".text"))); |
119 | __address supervisor_sp __attribute__ ((section (".text"))); |
120 | 120 | ||
121 | void userspace(void) |
121 | void userspace(__address entry) |
122 | { |
122 | { |
123 | /* EXL=1, UM=1, IE=1 */ |
123 | /* EXL=1, UM=1, IE=1 */ |
124 | cp0_status_write(cp0_status_read() | (cp0_status_exl_exception_bit | |
124 | cp0_status_write(cp0_status_read() | (cp0_status_exl_exception_bit | |
125 | cp0_status_um_bit | |
125 | cp0_status_um_bit | |
126 | cp0_status_ie_enabled_bit)); |
126 | cp0_status_ie_enabled_bit)); |
127 | cp0_epc_write(UTEXT_ADDRESS); |
127 | cp0_epc_write(entry); |
128 | userspace_asm(USTACK_ADDRESS+PAGE_SIZE); |
128 | userspace_asm(USTACK_ADDRESS+PAGE_SIZE); |
129 | while (1) |
129 | while (1) |
130 | ; |
130 | ; |
131 | } |
131 | } |
132 | 132 |