Changeset ebb1489 in mainline for kernel/arch/amd64/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/amd64/src/userspace.c

    r2a0c827c rebb1489  
    3939#include <stdint.h>
    4040#include <arch.h>
    41 #include <abi/proc/uarg.h>
    4241#include <mm/as.h>
     42
     43uintptr_t arch_get_initial_sp(uintptr_t stack_base, uintptr_t stack_size)
     44{
     45        return stack_base + stack_size;
     46}
    4347
    4448/** Enter userspace
     
    4751 *
    4852 */
    49 void userspace(uspace_arg_t *kernel_uarg)
     53void userspace(uintptr_t pc, uintptr_t sp)
    5054{
    5155        uint64_t rflags = read_rflags();
     
    6064            "pushq %[utext_des]\n"
    6165            "pushq %[entry]\n"
    62             "movq %[uarg], %%rax\n"
    6366
    6467            /* %rdi is defined to hold pcb_ptr - set it to 0 */
     
    6669            "iretq\n"
    6770            :: [udata_des] "i" (GDT_SELECTOR(UDATA_DES) | PL_USER),
    68               [stack_top] "r" (kernel_uarg->uspace_stack +
    69               kernel_uarg->uspace_stack_size),
     71              [stack_top] "r" (sp),
    7072              [rflags] "r" (rflags),
    7173              [utext_des] "i" (GDT_SELECTOR(UTEXT_DES) | PL_USER),
    72               [entry] "r" (kernel_uarg->uspace_entry),
    73               [uarg] "r" (kernel_uarg->uspace_uarg)
    74             : "rax"
     74              [entry] "r" (pc)
    7575        );
    7676
Note: See TracChangeset for help on using the changeset viewer.