Use a consistent comment to explain why 32bit archs set their second
authorguenther <guenther@openbsd.org>
Sat, 11 Feb 2023 06:10:39 +0000 (06:10 +0000)
committerguenther <guenther@openbsd.org>
Sat, 11 Feb 2023 06:10:39 +0000 (06:10 +0000)
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
lib/libc/arch/hppa/SYS.h
lib/libc/arch/powerpc/SYS.h
lib/libc/arch/sh/SYS.h

index 9d04b9c..d01674b 100644 (file)
@@ -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)
index 79cfa51..896bf6f 100644 (file)
@@ -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)                             !\
index f7fae8b..5ae7764 100644 (file)
@@ -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;                                    \
index bed791b..6c14b91 100644 (file)
@@ -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.
                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