From 4c4efc0ac71948c25fbd7928bf095843ea9b8ff6 Mon Sep 17 00:00:00 2001 From: guenther Date: Sat, 11 Feb 2023 06:10:39 +0000 Subject: [PATCH] Use a consistent comment to explain why 32bit archs set their second return register to -1 in the syscall error path ("for lseek"). removal of the misleading __syscall() mention requested by deraadt@ ok deraadt@ --- lib/libc/arch/arm/sys/cerror.S | 4 ++-- lib/libc/arch/hppa/SYS.h | 4 ++-- lib/libc/arch/powerpc/SYS.h | 4 ++-- lib/libc/arch/sh/SYS.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/libc/arch/arm/sys/cerror.S b/lib/libc/arch/arm/sys/cerror.S index 9d04b9cb4e2..d01674b1b84 100644 --- a/lib/libc/arch/arm/sys/cerror.S +++ b/lib/libc/arch/arm/sys/cerror.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cerror.S,v 1.10 2016/10/04 03:15:51 guenther Exp $ */ +/* $OpenBSD: cerror.S,v 1.11 2023/02/11 06:10:39 guenther Exp $ */ /* $NetBSD: cerror.S,v 1.5 2003/08/07 16:42:04 agc Exp $ */ /*- @@ -41,6 +41,6 @@ _ENTRY(CERROR) mrc p15, 0, r1, c13, c0, 3 str r0, [r1, #TCB_OFFSET_ERRNO] mvn r0, #0x00000000 - mvn r1, #0x00000000 + mvn r1, #0x00000000 /* for lseek */ mov pc, lr END(CERROR) diff --git a/lib/libc/arch/hppa/SYS.h b/lib/libc/arch/hppa/SYS.h index 79cfa517c2c..896bf6fb372 100644 --- a/lib/libc/arch/hppa/SYS.h +++ b/lib/libc/arch/hppa/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.22 2016/05/07 19:05:21 guenther Exp $ */ +/* $OpenBSD: SYS.h,v 1.23 2023/02/11 06:10:39 guenther Exp $ */ /* * Copyright (c) 1998-2002 Michael Shalayeff @@ -93,7 +93,7 @@ LEAF_ENTRY(__CONCAT(_thread_sys_,x)) stw t1, TCB_OFFSET_ERRNO(r1) !\ ldi -1, ret0 !\ bv r0(rp) !\ - ldi -1, ret1 !\ + ldi -1, ret1 /* for lseek */ !\ 1: #define PSEUDO(x,y) !\ diff --git a/lib/libc/arch/powerpc/SYS.h b/lib/libc/arch/powerpc/SYS.h index f7fae8ba6da..5ae77643568 100644 --- a/lib/libc/arch/powerpc/SYS.h +++ b/lib/libc/arch/powerpc/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.26 2022/06/10 01:56:02 guenther Exp $ */ +/* $OpenBSD: SYS.h,v 1.27 2023/02/11 06:10:39 guenther Exp $ */ /*- * Copyright (c) 1994 * Andrew Cagney. All rights reserved. @@ -77,7 +77,7 @@ beq+ .L_ret; \ stw %r0, R2_OFFSET_ERRNO(2); \ li %r3, -1; \ - li %r4, -1; /* for __syscall(lseek) */ \ + li %r4, -1; /* for lseek */ \ .L_ret: \ RETGUARD_CHECK(x, %r11, %r12); \ blr; \ diff --git a/lib/libc/arch/sh/SYS.h b/lib/libc/arch/sh/SYS.h index bed791bab88..6c14b919449 100644 --- a/lib/libc/arch/sh/SYS.h +++ b/lib/libc/arch/sh/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.12 2022/09/02 06:19:04 miod Exp $ */ +/* $OpenBSD: SYS.h,v 1.13 2023/02/11 06:10:39 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -122,7 +122,7 @@ mov #TCB_OFFSET_ERRNO_NEG,r2; \ sub r2,r1; \ mov.l r0,@r1; \ - mov #-1, r1; \ + mov #-1, r1; /* for lseek */ \ rts; \ mov #-1, r0 -- 2.20.1