Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm64/src/arm64.c

    r3fcea34 rdb17889  
    4040#include <arch/exception.h>
    4141#include <arch/machine_func.h>
    42 #include <console/console.h>
    4342#include <interrupt.h>
    4443#include <proc/scheduler.h>
     
    146145}
    147146
    148 uintptr_t arch_get_initial_sp(uintptr_t stack_base, uintptr_t stack_size)
    149 {
    150         return stack_base + stack_size;
    151 }
    152 
    153147/** Change processor mode.
    154148 *
    155149 * @param kernel_uarg Userspace settings (entry point, stack, ...).
    156150 */
    157 void userspace(uintptr_t pc, uintptr_t sp)
     151void userspace(uspace_arg_t *kernel_uarg)
    158152{
    159153        /* Prepare return to EL0. */
     
    162156
    163157        /* Set program entry. */
    164         ELR_EL1_write(pc);
     158        ELR_EL1_write(kernel_uarg->uspace_entry);
    165159
    166160        /* Set user stack. */
    167         SP_EL0_write(sp);
     161        SP_EL0_write(kernel_uarg->uspace_stack +
     162            kernel_uarg->uspace_stack_size);
    168163
    169164        /* Clear Thread ID register. */
     
    174169             * Reset the kernel stack to its base value.
    175170             *
    176              * Clear all general-purpose registers.
     171             * Clear all general-purpose registers,
     172             * except x0 that holds an argument for
     173             * the user space.
    177174             */
    178175            "mov sp, %[kstack]\n"
    179             "mov x0, #0\n"
     176            "mov x0, %[uspace_uarg]\n"
    180177            "mov x1, #0\n"
    181178            "mov x2, #0\n"
     
    209206            "mov x30, #0\n"
    210207            "eret\n"
    211             :: [kstack] "r" (((uint64_t) (THREAD->kstack)) +
     208            :: [uspace_uarg] "r" (kernel_uarg->uspace_uarg),
     209              [kstack] "r" (((uint64_t) (THREAD->kstack)) +
    212210              MEM_STACK_SIZE - SP_DELTA)
    213211        );
     
    258256}
    259257
    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 
    270258/** @}
    271259 */
Note: See TracChangeset for help on using the changeset viewer.