summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2023-12-06 06:15:34 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2023-12-06 06:15:34 +0000
commitfa1a6cf266f262f48ecbe7fcaf6c37eb1ef4b02b (patch)
treeebe4e9eb49bf692e526854c121d4b483c42f241d
parent9aac7ee020256c63ca5bfb92048d2a420565335b (diff)
Move CALLSYS_NOERROR macro from <machine/asm.h> to libc, and expand it for
non-libc users. This is a two-liner macro anyway, and this will make deraadt@'s future changes in this area easier to make. NFC
-rw-r--r--lib/libc/arch/alpha/SYS.h5
-rw-r--r--libexec/ld.so/alpha/SYS.h5
-rw-r--r--sys/arch/alpha/alpha/locore.s8
-rw-r--r--sys/arch/alpha/include/asm.h19
4 files changed, 13 insertions, 24 deletions
diff --git a/lib/libc/arch/alpha/SYS.h b/lib/libc/arch/alpha/SYS.h
index a7f505b7589..688864beff0 100644
--- a/lib/libc/arch/alpha/SYS.h
+++ b/lib/libc/arch/alpha/SYS.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: SYS.h,v 1.15 2016/05/16 16:25:06 guenther Exp $ */
+/* $OpenBSD: SYS.h,v 1.16 2023/12/06 06:15:33 miod Exp $ */
/* $NetBSD: SYS.h,v 1.4 1996/10/17 03:03:53 cgd Exp $ */
/*
@@ -65,6 +65,9 @@
_END(_HIDDEN(x))
#define END_WEAK(x) END_STRONG(x); .weak x
+#define CALLSYS_NOERROR(name) \
+ ldiq v0, ___CONCAT(SYS_,name); \
+ call_pal PAL_OSF1_callsys
#define CALLSYS_ERROR(name) \
CALLSYS_NOERROR(name); \
diff --git a/libexec/ld.so/alpha/SYS.h b/libexec/ld.so/alpha/SYS.h
index 004fe5f9c73..4472afa8a11 100644
--- a/libexec/ld.so/alpha/SYS.h
+++ b/libexec/ld.so/alpha/SYS.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: SYS.h,v 1.2 2019/02/03 02:20:36 guenther Exp $ */
+/* $OpenBSD: SYS.h,v 1.3 2023/12/06 06:15:33 miod Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
@@ -63,7 +63,8 @@
#define DL_SYSCALL(c) \
LEAF_NOPROFILE(_dl_##c, irrelevant); \
- CALLSYS_NOERROR(c); \
+ ldiq v0, SYS_##c; \
+ call_pal PAL_OSF1_callsys; \
beq a3, 1f; \
subq zero, v0, v0; /* return -errno */ \
1: \
diff --git a/sys/arch/alpha/alpha/locore.s b/sys/arch/alpha/alpha/locore.s
index 959a6d0326c..1bbf06a512a 100644
--- a/sys/arch/alpha/alpha/locore.s
+++ b/sys/arch/alpha/alpha/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.52 2023/10/24 13:20:09 claudio Exp $ */
+/* $OpenBSD: locore.s,v 1.53 2023/12/06 06:15:33 miod Exp $ */
/* $NetBSD: locore.s,v 1.94 2001/04/26 03:10:44 ross Exp $ */
/*-
@@ -201,11 +201,13 @@ NESTED(sigcode,0,0,ra,0,0)
jsr ra, (t12) /* call the signal handler (t12==pv) */
ldq a0, 0(sp) /* get the sigcontext pointer */
lda sp, 16(sp)
- CALLSYS_NOERROR(sigreturn) /* and call sigreturn() with it. */
+ ldiq v0, SYS_sigreturn /* and call sigreturn() with it. */
+ call_pal PAL_OSF1_callsys
.globl sigcoderet
sigcoderet:
mov v0, a0 /* if that failed, get error code */
- CALLSYS_NOERROR(exit) /* and call exit() with it. */
+ ldiq v0, SYS_exit /* and call exit() with it. */
+ call_pal PAL_OSF1_callsys
XNESTED(esigcode,0)
END(sigcode)
diff --git a/sys/arch/alpha/include/asm.h b/sys/arch/alpha/include/asm.h
index baf9cacce12..7838a4ddd17 100644
--- a/sys/arch/alpha/include/asm.h
+++ b/sys/arch/alpha/include/asm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asm.h,v 1.15 2022/08/30 16:26:29 miod Exp $ */
+/* $OpenBSD: asm.h,v 1.16 2023/12/06 06:15:33 miod Exp $ */
/* $NetBSD: asm.h,v 1.23 2000/06/23 12:18:45 kleink Exp $ */
/*
@@ -591,23 +591,6 @@ label: ASCIZ msg; \
#include <machine/pal.h>
/*
- * System call glue.
- */
-#define SYSCALLNUM(name) \
- ___CONCAT(SYS_,name)
-
-#define CALLSYS_NOERROR(name) \
- ldiq v0, SYSCALLNUM(name); \
- call_pal PAL_OSF1_callsys
-
-#define NETBSD_SYSCALLNUM(name) \
- ___CONCAT(NETBSD_SYS_,name)
-
-#define NETBSD_CALLSYS_NOERROR(name) \
- ldiq v0, NETBSD_SYSCALLNUM(name); \
- call_pal PAL_OSF1_callsys
-
-/*
* Load the global pointer.
*/
#define LDGP(reg) \