mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-18 02:19:39 +00:00
ps3: add elfv2 support
ps3 are broken since we moved to clang/elfv2. Fix this by updating the hypercall glue to the new ABI. Signed-off-by: Chattrapat Sangmanee <aomsin27@hotmail.co.th> Reviewed by: jhibbits MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1413
This commit is contained in:
parent
afd096326a
commit
50a03971d3
@ -12,6 +12,10 @@ BEGIN {
|
||||
}
|
||||
|
||||
/HVCALL.*/ {
|
||||
# Parameter save area
|
||||
# 48 in elfv1, 32 in elfv2
|
||||
stack_offset = 32;
|
||||
|
||||
code = $2;
|
||||
ins = split($4, a, ",")
|
||||
outs = split($5, a, ",")
|
||||
@ -19,7 +23,7 @@ BEGIN {
|
||||
printf("ASENTRY(%s)\n",$3);
|
||||
printf("\tmflr %%r0\n");
|
||||
printf("\tstd %%r0,16(%%r1)\n");
|
||||
printf("\tstdu %%r1,-%d(%%r1)\n", 48+8*outs);
|
||||
printf("\tstdu %%r1,-%d(%%r1)\n", stack_offset+8*outs);
|
||||
|
||||
if ($4 == "UNUSED")
|
||||
ins = 0
|
||||
@ -27,10 +31,10 @@ BEGIN {
|
||||
# Save output reg addresses to the stack
|
||||
for (i = 0; i < outs; i++) {
|
||||
if (ins+i >= 8) {
|
||||
printf("\tld %%r11,%d(%%r1)\n", 48+8*outs + 48 + 8*(i+ins));
|
||||
printf("\tstd %%r11,%d(%%r1)\n", 48+8*i);
|
||||
printf("\tld %%r11,%d(%%r1)\n", stack_offset+8*outs + stack_offset + 8*(i+ins));
|
||||
printf("\tstd %%r11,%d(%%r1)\n", stack_offset+8*i);
|
||||
} else {
|
||||
printf("\tstd %%r%d,%d(%%r1)\n", 3+ins+i, 48+8*i);
|
||||
printf("\tstd %%r%d,%d(%%r1)\n", 3+ins+i, stack_offset+8*i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,12 +43,14 @@ BEGIN {
|
||||
printf("\textsw %%r3,%%r3\n");
|
||||
|
||||
for (i = 0; i < outs; i++) {
|
||||
printf("\tld %%r11,%d(%%r1)\n", 48+8*i);
|
||||
printf("\tld %%r11,%d(%%r1)\n", stack_offset+8*i);
|
||||
printf("\tstd %%r%d,0(%%r11)\n", 4+i);
|
||||
}
|
||||
|
||||
printf("\tld %%r1,0(%%r1)\n");
|
||||
printf("\tld %%r0,16(%%r1)\n");
|
||||
printf("\tmtlr %%r0\n");
|
||||
printf("\tblr\n\n");
|
||||
printf("\tblr\n");
|
||||
|
||||
printf("ASEND(%s)\n\n",$3);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user