Rev 703 | Rev 796 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 703 | Rev 794 | ||
|---|---|---|---|
| Line 93... | Line 93... | ||
| 93 | 93 | ||
| 94 | console_init(); |
94 | console_init(); |
| 95 | debugger_init(); |
95 | debugger_init(); |
| 96 | arc_print_memory_map(); |
96 | arc_print_memory_map(); |
| 97 | arc_print_devices(); |
97 | arc_print_devices(); |
| - | 98 | ||
| - | 99 | /* Setup usermode...*/ |
|
| - | 100 | config.init_addr = 0x20000000; |
|
| - | 101 | config.init_size = FRAME_SIZE; |
|
| 98 | } |
102 | } |
| 99 | 103 | ||
| 100 | void arch_post_mm_init(void) |
104 | void arch_post_mm_init(void) |
| 101 | { |
105 | { |
| 102 | } |
106 | } |
| Line 107... | Line 111... | ||
| 107 | 111 | ||
| 108 | void arch_post_smp_init(void) |
112 | void arch_post_smp_init(void) |
| 109 | { |
113 | { |
| 110 | } |
114 | } |
| 111 | 115 | ||
| - | 116 | /* Stack pointer saved when entering user mode */ |
|
| - | 117 | /* TODO: How do we do it on SMP system???? */ |
|
| - | 118 | ||
| - | 119 | /* Why the hell moves the linker the variable 64K away in assembler |
|
| - | 120 | * when not in .text section ???????? |
|
| - | 121 | */ |
|
| - | 122 | __address supervisor_sp __attribute__ ((section (".text"))); |
|
| - | 123 | ||
| 112 | void userspace(void) |
124 | void userspace(void) |
| 113 | { |
125 | { |
| 114 | /* EXL=1, UM=1, IE=1 */ |
126 | /* EXL=1, UM=1, IE=1 */ |
| 115 | cp0_status_write(cp0_status_read() | (cp0_status_exl_exception_bit | |
127 | cp0_status_write(cp0_status_read() | (cp0_status_exl_exception_bit | |
| 116 | cp0_status_um_bit | |
128 | cp0_status_um_bit | |
| Line 120... | Line 132... | ||
| 120 | userspace_asm(USTACK_ADDRESS+PAGE_SIZE); |
132 | userspace_asm(USTACK_ADDRESS+PAGE_SIZE); |
| 121 | while (1) |
133 | while (1) |
| 122 | ; |
134 | ; |
| 123 | } |
135 | } |
| 124 | 136 | ||
| 125 | /* Stack pointer saved when entering user mode */ |
- | |
| 126 | /* TODO: How do we do it on SMP system???? */ |
- | |
| 127 | __address supervisor_sp; |
- | |
| 128 | - | ||
| 129 | void before_thread_runs_arch(void) |
137 | void before_thread_runs_arch(void) |
| 130 | { |
138 | { |
| 131 | supervisor_sp = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA]; |
139 | supervisor_sp = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA]; |
| 132 | } |
140 | } |