ELF: don't change the cpu context

This commit is contained in:
Matheus
2022-09-04 14:42:59 -03:00
parent 5127ce9217
commit 2f8c8fc8e3
2 changed files with 8 additions and 6 deletions
+6 -3
View File
@@ -159,7 +159,7 @@ static void* stacksetup(char** argv, char** env, auxv64_list auxv){
}
int elf_load(thread_t* thread, vnode_t* node, char** argv, char** env){
int elf_load(thread_t* thread, vnode_t* node, char** argv, char** env, void** stack, void** entry){
elf_header64 header;
elf_ph64 phbuff;
@@ -262,9 +262,12 @@ int elf_load(thread_t* thread, vnode_t* node, char** argv, char** env){
}
void* stack = stacksetup(argv, env, auxv);
*stack = stacksetup(argv, env, auxv);
if(!(*stack))
return ENOMEM;
arch_regs_setupuser(thread->regs, (void*)header.entry, stack, true);
*entry = (void*)header.entry;
return 0;