Changes in kernel/arch/arm64/src/arm64.c [3fcea34:db17889] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm64/src/arm64.c
r3fcea34 rdb17889 40 40 #include <arch/exception.h> 41 41 #include <arch/machine_func.h> 42 #include <console/console.h>43 42 #include <interrupt.h> 44 43 #include <proc/scheduler.h> … … 146 145 } 147 146 148 uintptr_t arch_get_initial_sp(uintptr_t stack_base, uintptr_t stack_size)149 {150 return stack_base + stack_size;151 }152 153 147 /** Change processor mode. 154 148 * 155 149 * @param kernel_uarg Userspace settings (entry point, stack, ...). 156 150 */ 157 void userspace(u intptr_t pc, uintptr_t sp)151 void userspace(uspace_arg_t *kernel_uarg) 158 152 { 159 153 /* Prepare return to EL0. */ … … 162 156 163 157 /* Set program entry. */ 164 ELR_EL1_write( pc);158 ELR_EL1_write(kernel_uarg->uspace_entry); 165 159 166 160 /* Set user stack. */ 167 SP_EL0_write(sp); 161 SP_EL0_write(kernel_uarg->uspace_stack + 162 kernel_uarg->uspace_stack_size); 168 163 169 164 /* Clear Thread ID register. */ … … 174 169 * Reset the kernel stack to its base value. 175 170 * 176 * Clear all general-purpose registers. 171 * Clear all general-purpose registers, 172 * except x0 that holds an argument for 173 * the user space. 177 174 */ 178 175 "mov sp, %[kstack]\n" 179 "mov x0, #0\n"176 "mov x0, %[uspace_uarg]\n" 180 177 "mov x1, #0\n" 181 178 "mov x2, #0\n" … … 209 206 "mov x30, #0\n" 210 207 "eret\n" 211 :: [kstack] "r" (((uint64_t) (THREAD->kstack)) + 208 :: [uspace_uarg] "r" (kernel_uarg->uspace_uarg), 209 [kstack] "r" (((uint64_t) (THREAD->kstack)) + 212 210 MEM_STACK_SIZE - SP_DELTA) 213 211 ); … … 258 256 } 259 257 260 void early_putuchar(char32_t c)261 {262 #ifdef CONFIG_DEBUG_EARLY_PRINT263 if (c == '\n')264 machine_early_uart_output('\r');265 266 machine_early_uart_output(c);267 #endif268 }269 270 258 /** @} 271 259 */
Note:
See TracChangeset
for help on using the changeset viewer.