Skip to content

Commit e358e2b

Browse files
committed
runtime: fix syscall error returns on ppc64
1 parent 04f718f commit e358e2b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/runtime/sys_linux_ppc64x.s

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ TEXT runtime·rt_sigaction(SB),NOSPLIT|NOFRAME,$0-36
193193
MOVD old+16(FP), R5
194194
MOVD size+24(FP), R6
195195
SYSCALL $SYS_rt_sigaction
196+
BVC 2(PC)
197+
NEG R3 // caller expects negative errno
196198
MOVW R3, ret+32(FP)
197199
RET
198200

@@ -388,6 +390,8 @@ TEXT runtime·futex(SB),NOSPLIT|NOFRAME,$0
388390
MOVD addr2+24(FP), R7
389391
MOVW val3+32(FP), R8
390392
SYSCALL $SYS_futex
393+
BVC 2(PC)
394+
NEG R3 // caller expects negative errno
391395
MOVW R3, ret+40(FP)
392396
RET
393397

@@ -409,6 +413,8 @@ TEXT runtime·clone(SB),NOSPLIT|NOFRAME,$0
409413
MOVD R7, -32(R4)
410414

411415
SYSCALL $SYS_clone
416+
BVC 2(PC)
417+
NEG R3 // caller expects negative errno
412418

413419
// In parent, return.
414420
CMP R3, $0
@@ -472,20 +478,26 @@ TEXT runtime·sched_getaffinity(SB),NOSPLIT|NOFRAME,$0
472478
MOVD len+8(FP), R4
473479
MOVD buf+16(FP), R5
474480
SYSCALL $SYS_sched_getaffinity
481+
BVC 2(PC)
482+
NEG R3 // caller expects negative errno
475483
MOVW R3, ret+24(FP)
476484
RET
477485

478486
// int32 runtime·epollcreate(int32 size);
479487
TEXT runtime·epollcreate(SB),NOSPLIT|NOFRAME,$0
480488
MOVW size+0(FP), R3
481489
SYSCALL $SYS_epoll_create
490+
BVC 2(PC)
491+
NEG R3 // caller expects negative errno
482492
MOVW R3, ret+8(FP)
483493
RET
484494

485495
// int32 runtime·epollcreate1(int32 flags);
486496
TEXT runtime·epollcreate1(SB),NOSPLIT|NOFRAME,$0
487497
MOVW flags+0(FP), R3
488498
SYSCALL $SYS_epoll_create1
499+
BVC 2(PC)
500+
NEG R3 // caller expects negative errno
489501
MOVW R3, ret+8(FP)
490502
RET
491503

@@ -507,6 +519,8 @@ TEXT runtime·epollwait(SB),NOSPLIT|NOFRAME,$0
507519
MOVW nev+16(FP), R5
508520
MOVW timeout+20(FP), R6
509521
SYSCALL $SYS_epoll_wait
522+
BVC 2(PC)
523+
NEG R3 // caller expects negative errno
510524
MOVW R3, ret+24(FP)
511525
RET
512526

0 commit comments

Comments
 (0)