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