Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hppa PR/57261: hppa should be converted to __HAVE_S...



details:   https://anonhg.NetBSD.org/src/rev/5453d5572abd
branches:  trunk
changeset: 378157:5453d5572abd
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Jul 23 10:09:36 2023 +0000

description:
PR/57261: hppa should be converted to __HAVE_SYSCALL_INTERN

Provide syscall_intern and use the md_syscall in syscall trap handling.

diffstat:

 sys/arch/hppa/hppa/genassym.cf |   4 ++--
 sys/arch/hppa/hppa/trap.S      |  16 ++++++++++------
 sys/arch/hppa/hppa/trap.c      |  10 ++++++++--
 sys/arch/hppa/include/proc.h   |   4 +++-
 sys/arch/hppa/include/types.h  |   4 ++--
 5 files changed, 25 insertions(+), 13 deletions(-)

diffs (120 lines):

diff -r ac2f92e25d44 -r 5453d5572abd sys/arch/hppa/hppa/genassym.cf
--- a/sys/arch/hppa/hppa/genassym.cf    Sun Jul 23 08:04:29 2023 +0000
+++ b/sys/arch/hppa/hppa/genassym.cf    Sun Jul 23 10:09:36 2023 +0000
@@ -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
diff -r ac2f92e25d44 -r 5453d5572abd sys/arch/hppa/hppa/trap.S
--- a/sys/arch/hppa/hppa/trap.S Sun Jul 23 08:04:29 2023 +0000
+++ b/sys/arch/hppa/hppa/trap.S Sun Jul 23 10:09:36 2023 +0000
@@ -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
diff -r ac2f92e25d44 -r 5453d5572abd sys/arch/hppa/hppa/trap.c
--- a/sys/arch/hppa/hppa/trap.c Sun Jul 23 08:04:29 2023 +0000
+++ b/sys/arch/hppa/hppa/trap.c Sun Jul 23 10:09:36 2023 +0000
@@ -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:
diff -r ac2f92e25d44 -r 5453d5572abd sys/arch/hppa/include/proc.h
--- a/sys/arch/hppa/include/proc.h      Sun Jul 23 08:04:29 2023 +0000
+++ b/sys/arch/hppa/include/proc.h      Sun Jul 23 10:09:36 2023 +0000
@@ -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)
 };
diff -r ac2f92e25d44 -r 5453d5572abd sys/arch/hppa/include/types.h
--- a/sys/arch/hppa/include/types.h     Sun Jul 23 08:04:29 2023 +0000
+++ b/sys/arch/hppa/include/types.h     Sun Jul 23 10:09:36 2023 +0000
@@ -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



Home | Main Index | Thread Index | Old Index