From b7aba10a042466ec6829008a56f15fff3c0662c4 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Fri, 26 Jun 2020 09:02:13 +0000 Subject: Fix system calls; set %r0 to zero upon success and set (instead of clear) bit in %cr upon failure. --- sys/arch/powerpc64/powerpc64/syscall.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys') 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 @@ -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; } -- cgit v1.2.3