biscuit: fix argc, argv

master
WangRunji 6 years ago
parent 5eeb7b20c9
commit d84f21465c

@ -3519,7 +3519,7 @@ char __progname[64];
char **environ = _environ; char **environ = _environ;
void void
_start(int argc, char **argv, struct kinfo_t *k) __start(int argc, char **argv, struct kinfo_t *k)
{ {
kinfo = k; kinfo = k;
@ -3532,15 +3532,17 @@ _start(int argc, char **argv, struct kinfo_t *k)
} }
void void
_entry(void) _start(void)
{ {
// make sure that the stack is 16-byte aligned, as gcc assumes, after // make sure that the stack is 16-byte aligned, as gcc assumes, after
// _start's function prologue. gcc emits SSE instructions that require // _start's function prologue. gcc emits SSE instructions that require
// 16-byte alignment (misalignment generates #GP). // 16-byte alignment (misalignment generates #GP).
asm( asm(
"movq (%%rsp), %%rdi\n" // argc
"leaq 8(%%rsp), %%rsi\n" // argv
"andq $0xfffffffffffffff0, %%rsp\n" "andq $0xfffffffffffffff0, %%rsp\n"
"subq $8, %%rsp\n" "subq $8, %%rsp\n"
"movabs $_start, %%rax\n" "movabs $__start, %%rax\n"
"jmpq *%%rax\n" "jmpq *%%rax\n"
::: "memory", "cc"); ::: "memory", "cc");
} }

Loading…
Cancel
Save