summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-08-20 11:38:26 -0700
committerOri Bernstein <ori@eigenstate.org>2015-08-20 11:38:26 -0700
commit58d89cfed95d30bcd7fdfed4973237121803ad70 (patch)
treefee013ae7f3932b2ba08103e8fe8071954e04970 /libstd
parentc34f7840a5c1984deb9bedf2817aa0c8d4b09b83 (diff)
downloadmc-58d89cfed95d30bcd7fdfed4973237121803ad70.tar.gz
Update Plan 9 build for new ABI.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/syscall+plan9-x64.s41
-rw-r--r--libstd/util+plan9-x64.s20
2 files changed, 17 insertions, 44 deletions
diff --git a/libstd/syscall+plan9-x64.s b/libstd/syscall+plan9-x64.s
index 765a527..4de6502 100644
--- a/libstd/syscall+plan9-x64.s
+++ b/libstd/syscall+plan9-x64.s
@@ -10,39 +10,24 @@ Luckily, the kernel doesn't touch our stack,
and we have 256 bytes of gap if we get a note.
*/
TEXT sys$syscall+0(SB),1,$0
- MOVQ BX,-16(SP)
- MOVQ CX,-24(SP)
- MOVQ DX,-32(SP)
- MOVQ SI,-40(SP)
- MOVQ DI,-48(SP)
+ MOVQ R11,-16(SP)
+ MOVQ R12,-24(SP)
+ MOVQ R13,-32(SP)
+ MOVQ R14,-40(SP)
+ MOVQ R15,-48(SP)
MOVQ BP,-56(SP)
- MOVQ R8,-64(SP)
- MOVQ R9,-72(SP)
- MOVQ R10,-80(SP)
- MOVQ R11,-88(SP)
- MOVQ R12,-104(SP)
- MOVQ R13,-112(SP)
- MOVQ R14,-120(SP)
- MOVQ R15,-128(SP)
MOVQ 8(SP),RARG
- ADDQ $16,SP
+ ADDQ $8,SP
+ MOVQ DI, RARG
SYSCALL
+ SUBQ $8,SP
- SUBQ $16,SP
- MOVQ -16(SP),BX
- MOVQ -24(SP),CX
- MOVQ -32(SP),DX
- MOVQ -40(SP),SI
- MOVQ -48(SP),DI
+ MOVQ -16(SP),R11
+ MOVQ -24(SP),R12
+ MOVQ -32(SP),R13
+ MOVQ -40(SP),R14
+ MOVQ -48(SP),R15
MOVQ -56(SP),BP
- MOVQ -64(SP),R8
- MOVQ -72(SP),R9
- MOVQ -80(SP),R10
- MOVQ -88(SP),R11
- MOVQ -104(SP),R12
- MOVQ -112(SP),R13
- MOVQ -120(SP),R14
- MOVQ -128(SP),R15
RET
diff --git a/libstd/util+plan9-x64.s b/libstd/util+plan9-x64.s
index aff583f..f4b8586 100644
--- a/libstd/util+plan9-x64.s
+++ b/libstd/util+plan9-x64.s
@@ -46,27 +46,15 @@ TEXT sys$cstring+0(SB),$0
TEXT sys$alloca+0(SB),$0
/* save registers */
- MOVQ SP,AX
- SUBQ $32,SP
- MOVQ BP,-8(AX)
- MOVQ R15,-16(AX)
- MOVQ BX,-24(AX)
- MOVQ AX,BP
-
- MOVQ (BP),R15 /* ret addr */
- MOVQ 8(BP),BX /* len */
+ MOVQ (SP),R10 /* ret addr */
/* get stack space */
- SUBQ BX,SP /* get stack space */
+ SUBQ DI,SP /* get stack space */
MOVQ SP,AX /* top of stack (return value) */
- SUBQ $32,SP /* "unpop" the args, and make room for ret addr */
ANDQ $(~15),SP /* align */
+ SUBQ $32,SP /* "unpop" the args, and make room for ret addr */
- MOVQ R15,0(SP) /* place ret addr */
- /* restore registers */
- MOVQ -16(BP),R15
- MOVQ -24(SP),BX
- MOVQ -8(BP),BP
+ MOVQ R10,(SP) /* place ret addr */
RET
GLOBL sys$tosptr+0(SB),$8