Initialize the ppc stack frame correctly

This commit is contained in:
Benjamin Feng
2021-04-10 12:58:21 -05:00
parent 2e85eb2bf8
commit 073d8e55c3

View File

@@ -198,13 +198,16 @@ fn _start() callconv(.Naked) noreturn {
);
},
.powerpc => {
// Setup the initial stack frame and clear the back chain pointer.
argc_argv_ptr = asm volatile (
\\ mr 3, 1
\\ mr 4, 1
\\ li 0, 0
\\ stwu 1,-16(1)
\\ stw 0, 0(1)
\\ mtlr 0
: [argc] "={r3}" (-> [*]usize)
: [argc] "={r4}" (-> [*]usize)
:
: "r0", "r3"
: "r0"
);
},
.powerpc64le => {