X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/32b9a6d76790c73d3d2d36d9081a2581cc65d184..28c176b668c841a3b7fb093faccf0efa39257603:/lunaix-os/arch/x86/exec/exec.c diff --git a/lunaix-os/arch/x86/exec/exec.c b/lunaix-os/arch/x86/exec/exec.c new file mode 100644 index 0000000..81ad0ec --- /dev/null +++ b/lunaix-os/arch/x86/exec/exec.c @@ -0,0 +1,23 @@ +#include +#include +#include + +int +exec_arch_prepare_entry(struct thread* thread, struct exec_host* container) +{ + struct hart_state* hstate; + + hstate = thread->hstate; + +#ifdef CONFIG_ARCH_X86_64 + hstate->execp->rip = container->exe.entry; + hstate->execp->rsp = container->stack_top; + +#else + hstate->execp->eip = container->exe.entry; + hstate->execp->esp = container->stack_top; + +#endif + + return 0; +} \ No newline at end of file