Module Name:    src
Committed By:   skrll
Date:           Sun Jul 23 10:09:37 UTC 2023

Modified Files:
        src/sys/arch/hppa/hppa: genassym.cf trap.S trap.c
        src/sys/arch/hppa/include: proc.h types.h

Log Message:
PR/57261: hppa should be converted to __HAVE_SYSCALL_INTERN

Provide syscall_intern and use the md_syscall in syscall trap handling.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hppa/hppa/genassym.cf
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/hppa/hppa/trap.S
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/hppa/hppa/trap.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hppa/include/proc.h
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/hppa/include/types.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hppa/hppa/genassym.cf
diff -u src/sys/arch/hppa/hppa/genassym.cf:1.4 src/sys/arch/hppa/hppa/genassym.cf:1.5
--- src/sys/arch/hppa/hppa/genassym.cf:1.4	Sat Mar 14 16:55:17 2020
+++ src/sys/arch/hppa/hppa/genassym.cf	Sun Jul 23 10:09:36 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.4 2020/03/14 16:55:17 ad Exp $
+#	$NetBSD: genassym.cf,v 1.5 2023/07/23 10:09:36 skrll Exp $
 
 #	$OpenBSD: genassym.cf,v 1.18 2001/09/20 18:31:14 mickey Exp $
 
@@ -174,7 +174,7 @@ member	TF_CR30		tf_cr30
 # proc fields and values
 struct	proc
 member	P_RASLIST	p_raslist
-member	P_MD		p_md
+member	P_MD_SYSCALL	p_md.md_syscall
 
 struct	lwp
 member	L_PROC		l_proc

Index: src/sys/arch/hppa/hppa/trap.S
diff -u src/sys/arch/hppa/hppa/trap.S:1.74 src/sys/arch/hppa/hppa/trap.S:1.75
--- src/sys/arch/hppa/hppa/trap.S:1.74	Mon Sep  6 21:56:03 2021
+++ src/sys/arch/hppa/hppa/trap.S	Sun Jul 23 10:09:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.S,v 1.74 2021/09/06 21:56:03 andvar Exp $	*/
+/*	$NetBSD: trap.S,v 1.75 2023/07/23 10:09:36 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -373,13 +373,17 @@ syscall_entry:
 	ldil	L%$global$,%dp
 	ldo	R%$global$(%dp),%dp
 
-	/* do a syscall */
-	.import	syscall,code
-	CALL(syscall, %r1)
+	GET_CURLWP(%r3)
+	ldw	L_PROC(%r3), %r1
+	ldw	P_MD_SYSCALL(%r1), %r1
+
+	.call
+ 	blr	%r0, %rp
+ 	bv,n	%r0(%r1)
+ 	nop
 
 	/* load curlwp's trapframe pointer */
-	GET_CURLWP(%r1)
-	ldw	L_MD(%r1), %t3
+	ldw	L_MD(%r3), %t3
 
 	.exit
 	.procend

Index: src/sys/arch/hppa/hppa/trap.c
diff -u src/sys/arch/hppa/hppa/trap.c:1.121 src/sys/arch/hppa/hppa/trap.c:1.122
--- src/sys/arch/hppa/hppa/trap.c:1.121	Fri Sep  2 23:48:10 2022
+++ src/sys/arch/hppa/hppa/trap.c	Sun Jul 23 10:09:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.121 2022/09/02 23:48:10 thorpej Exp $	*/
+/*	$NetBSD: trap.c,v 1.122 2023/07/23 10:09:36 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.121 2022/09/02 23:48:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.122 2023/07/23 10:09:36 skrll Exp $");
 
 /* #define INTRDEBUG */
 /* #define TRAPDEBUG */
@@ -1250,6 +1250,12 @@ process_sstep(struct lwp *l, int sstep)
 #endif
 
 
+void
+syscall_intern(struct proc *p)
+{
+	p->p_md.md_syscall = syscall;
+}
+
 /*
  * call actual syscall routine
  * from the low-level syscall handler:

Index: src/sys/arch/hppa/include/proc.h
diff -u src/sys/arch/hppa/include/proc.h:1.14 src/sys/arch/hppa/include/proc.h:1.15
--- src/sys/arch/hppa/include/proc.h:1.14	Sun Jul 23 08:04:29 2023
+++ src/sys/arch/hppa/include/proc.h	Sun Jul 23 10:09:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.14 2023/07/23 08:04:29 skrll Exp $	*/
+/*	$NetBSD: proc.h,v 1.15 2023/07/23 10:09:36 skrll Exp $	*/
 
 /*	$OpenBSD: proc.h,v 1.4 2009/12/29 13:11:40 jsing Exp $ */
 
@@ -49,6 +49,8 @@ struct mdlwp {
 };
 
 struct mdproc {
+	void	      (*md_syscall)(struct trapframe *, int *);
+
 	int		md_flags;		/* machine-dependent flags */
 #define MDP_OLDSPACE	__BIT(0)
 };

Index: src/sys/arch/hppa/include/types.h
diff -u src/sys/arch/hppa/include/types.h:1.31 src/sys/arch/hppa/include/types.h:1.32
--- src/sys/arch/hppa/include/types.h:1.31	Thu Apr  1 04:35:46 2021
+++ src/sys/arch/hppa/include/types.h	Sun Jul 23 10:09:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.31 2021/04/01 04:35:46 simonb Exp $	*/
+/*	$NetBSD: types.h,v 1.32 2023/07/23 10:09:36 skrll Exp $	*/
 
 /*	$OpenBSD: types.h,v 1.6 2001/08/11 01:58:34 art Exp $	*/
 
@@ -83,10 +83,10 @@ typedef int			__register_t;
 #define	__SIMPLELOCK_LOCKED	{ { 0, 0, 0, 0} }
 #define	__SIMPLELOCK_UNLOCKED	{ { 1, 1, 1, 1} }
 
-
 #define	__MACHINE_STACK_GROWS_UP	/* stack grows to higher addresses */
 #define	__HAVE_FUNCTION_DESCRIPTORS	/* function ptrs may be descriptors */
 #define	__HAVE_RAS
+#define	__HAVE_SYSCALL_INTERN
 
 /*
  * On hppa, declaring RAS labels as functions doesn't work, since the toolchain

Reply via email to