Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/userspace.c

    r3fcea34 r5a5269d  
    3838#include <stdint.h>
    3939#include <arch.h>
     40#include <abi/proc/uarg.h>
    4041#include <mm/as.h>
    4142#include <arch/cpu.h>
    4243#include <arch/asm.h>
    43 
    44 uintptr_t arch_get_initial_sp(uintptr_t stack_base, uintptr_t stack_size)
    45 {
    46         return stack_base + stack_size;
    47 }
    4844
    4945/** Enter userspace
     
    5248 *
    5349 */
    54 void userspace(uintptr_t pc, uintptr_t sp)
     50void userspace(uspace_arg_t *kernel_uarg)
    5551{
    5652        uint32_t eflags = read_eflags();
     
    6561            "pushl %[utext_des]\n"
    6662            "pushl %[entry]\n"
     63            "movl %[uarg], %%eax\n"
    6764
    6865            /* %edi is defined to hold pcb_ptr - set it to 0 */
     
    7370            : [eflags_mask] "i" (~EFLAGS_NT),
    7471              [udata_des] "i" (GDT_SELECTOR(UDATA_DES) | PL_USER),
    75               [stack_top] "r" (sp),
     72              [stack_top] "r" (kernel_uarg->uspace_stack +
     73              kernel_uarg->uspace_stack_size),
    7674              [eflags] "r" ((eflags & ~(EFLAGS_NT)) | EFLAGS_IF),
    7775              [utext_des] "i" (GDT_SELECTOR(UTEXT_DES) | PL_USER),
    78               [entry] "r" (pc),
     76              [entry] "r" (kernel_uarg->uspace_entry),
     77              [uarg] "r" (kernel_uarg->uspace_uarg),
    7978              [vreg_des] "r" (GDT_SELECTOR(VREG_DES))
    8079            : "eax");
Note: See TracChangeset for help on using the changeset viewer.