Changeset ebb1489 in mainline for kernel/arch/ia32/src/userspace.c


Ignore:
Timestamp:
2024-10-13T08:23:40Z (8 weeks ago)
Author:
GitHub <noreply@…>
Children:
0472cf17
Parents:
2a0c827c (diff), b3b79981 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
boba-buba <120932204+boba-buba@…> (2024-10-13 08:23:40)
git-committer:
GitHub <noreply@…> (2024-10-13 08:23:40)
Message:

Merge branch 'HelenOS:master' into topic/packet-capture

File:
1 edited

Legend:

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

    r2a0c827c rebb1489  
    3838#include <stdint.h>
    3939#include <arch.h>
    40 #include <abi/proc/uarg.h>
    4140#include <mm/as.h>
    4241#include <arch/cpu.h>
    4342#include <arch/asm.h>
     43
     44uintptr_t arch_get_initial_sp(uintptr_t stack_base, uintptr_t stack_size)
     45{
     46        return stack_base + stack_size;
     47}
    4448
    4549/** Enter userspace
     
    4852 *
    4953 */
    50 void userspace(uspace_arg_t *kernel_uarg)
     54void userspace(uintptr_t pc, uintptr_t sp)
    5155{
    5256        uint32_t eflags = read_eflags();
     
    6165            "pushl %[utext_des]\n"
    6266            "pushl %[entry]\n"
    63             "movl %[uarg], %%eax\n"
    6467
    6568            /* %edi is defined to hold pcb_ptr - set it to 0 */
     
    7073            : [eflags_mask] "i" (~EFLAGS_NT),
    7174              [udata_des] "i" (GDT_SELECTOR(UDATA_DES) | PL_USER),
    72               [stack_top] "r" (kernel_uarg->uspace_stack +
    73               kernel_uarg->uspace_stack_size),
     75              [stack_top] "r" (sp),
    7476              [eflags] "r" ((eflags & ~(EFLAGS_NT)) | EFLAGS_IF),
    7577              [utext_des] "i" (GDT_SELECTOR(UTEXT_DES) | PL_USER),
    76               [entry] "r" (kernel_uarg->uspace_entry),
    77               [uarg] "r" (kernel_uarg->uspace_uarg),
     78              [entry] "r" (pc),
    7879              [vreg_des] "r" (GDT_SELECTOR(VREG_DES))
    7980            : "eax");
Note: See TracChangeset for help on using the changeset viewer.