mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 10:35:03 +00:00
WIP: Fix stack setup
This commit is contained in:
parent
afe8ee173e
commit
1a9e1ffc16
@ -1167,8 +1167,10 @@ static void run_main_entry(u64 addr, EntryParams* params, exit_func_t exit_func)
|
|||||||
rsp = rsp & ~16;
|
rsp = rsp & ~16;
|
||||||
rsp = rsp - 8;
|
rsp = rsp - 8;
|
||||||
|
|
||||||
rsp = rsp - 8;
|
for (int i = params->argc; i > 0; i--) {
|
||||||
*(void**)rsp = params->argv;
|
rsp = rsp - 8;
|
||||||
|
*(void**)rsp = ¶ms->argv[i - 1];
|
||||||
|
}
|
||||||
|
|
||||||
rsp = rsp - 8;
|
rsp = rsp - 8;
|
||||||
*(u64*)rsp = params->argc;
|
*(u64*)rsp = params->argc;
|
||||||
@ -1202,6 +1204,8 @@ static void run_main_entry_native(u64 addr, EntryParams* params, exit_func_t exi
|
|||||||
// Kernel also pushes some more things here during process init
|
// Kernel also pushes some more things here during process init
|
||||||
// at least: environment, auxv, possibly other things
|
// at least: environment, auxv, possibly other things
|
||||||
|
|
||||||
|
// TODO: The array should be pushed here, not the pointer to the array
|
||||||
|
// similar to run_main_entry
|
||||||
"pushq 8(%1)\n" // copy EntryParams to top of stack like the kernel does
|
"pushq 8(%1)\n" // copy EntryParams to top of stack like the kernel does
|
||||||
"pushq 0(%1)\n" // OpenOrbis expects to find it there
|
"pushq 0(%1)\n" // OpenOrbis expects to find it there
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user