diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-06-26 09:02:13 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-06-26 09:02:13 +0000 |
commit | b7aba10a042466ec6829008a56f15fff3c0662c4 (patch) | |
tree | 0ee82f111afcd87b54f0d9e112476f3b65dc9c6e /sys | |
parent | f7ea9f011b4234beaba1b156c41b072cfed19f57 (diff) |
Fix system calls; set %r0 to zero upon success and set (instead of clear)
bit in %cr upon failure.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/powerpc64/powerpc64/syscall.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/powerpc64/powerpc64/syscall.c b/sys/arch/powerpc64/powerpc64/syscall.c index be492b1ae9b..9b6c90925cf 100644 --- a/sys/arch/powerpc64/powerpc64/syscall.c +++ b/sys/arch/powerpc64/powerpc64/syscall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.c,v 1.2 2020/06/19 21:24:01 kettenis Exp $ */ +/* $OpenBSD: syscall.c,v 1.3 2020/06/26 09:02:12 kettenis Exp $ */ /* * Copyright (c) 2015 Dale Rahn <drahn@dalerahn.com> @@ -72,6 +72,7 @@ syscall(struct trapframe *frame) switch (error) { case 0: + frame->fixreg[0] = 0; frame->fixreg[3] = rval[0]; frame->fixreg[4] = rval[1]; frame->cr &= ~0x10000000; @@ -88,7 +89,7 @@ syscall(struct trapframe *frame) default: bad: frame->fixreg[0] = error; - frame->cr &= ~0x10000000; + frame->cr |= 0x10000000; break; } |