Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2019 01:25:37 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352882 - in stable/12/sys/cddl/dev/dtrace: amd64 i386
Message-ID:  <201909300125.x8U1PbIb090280@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Sep 30 01:25:37 2019
New Revision: 352882
URL: https://svnweb.freebsd.org/changeset/base/352882

Log:
  MFC r352627:
  Implement x86 dtrace_invop_(un)init() in C.

Modified:
  stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S
  stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  stable/12/sys/cddl/dev/dtrace/i386/dtrace_asm.S
  stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S
==============================================================================
--- stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S	Mon Sep 30 01:25:14 2019	(r352881)
+++ stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S	Mon Sep 30 01:25:37 2019	(r352882)
@@ -150,22 +150,6 @@ bp_ret:
 	END(dtrace_invop_start)
 
 /*
-void dtrace_invop_init(void)
-*/
-	ENTRY(dtrace_invop_init)
-	movq	$dtrace_invop_start, dtrace_invop_jump_addr(%rip)
-	ret
-	END(dtrace_invop_init)
-
-/*
-void dtrace_invop_uninit(void)
-*/
-	ENTRY(dtrace_invop_uninit)
-	movq	$0, dtrace_invop_jump_addr(%rip)
-	ret
-	END(dtrace_invop_uninit)
-
-/*
 greg_t dtrace_getfp(void)
 */
 	ENTRY(dtrace_getfp)

Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==============================================================================
--- stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Mon Sep 30 01:25:14 2019	(r352881)
+++ stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Mon Sep 30 01:25:37 2019	(r352882)
@@ -48,8 +48,12 @@
 #include <vm/pmap.h>
 
 extern void dtrace_getnanotime(struct timespec *tsp);
+extern int (*dtrace_invop_jump_addr)(struct trapframe *);
 
-int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
+int	dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
+int	dtrace_invop_start(struct trapframe *frame);
+void	dtrace_invop_init(void);
+void	dtrace_invop_uninit(void);
 
 typedef struct dtrace_invop_hdlr {
 	int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t);
@@ -107,6 +111,20 @@ dtrace_invop_remove(int (*func)(uintptr_t, struct trap
 	}
 
 	kmem_free(hdlr, 0);
+}
+
+void
+dtrace_invop_init(void)
+{
+
+	dtrace_invop_jump_addr = dtrace_invop_start;
+}
+
+void
+dtrace_invop_uninit(void)
+{
+
+	dtrace_invop_jump_addr = NULL;
 }
 
 /*ARGSUSED*/

Modified: stable/12/sys/cddl/dev/dtrace/i386/dtrace_asm.S
==============================================================================
--- stable/12/sys/cddl/dev/dtrace/i386/dtrace_asm.S	Mon Sep 30 01:25:14 2019	(r352881)
+++ stable/12/sys/cddl/dev/dtrace/i386/dtrace_asm.S	Mon Sep 30 01:25:37 2019	(r352882)
@@ -135,22 +135,6 @@ invop_nop:
 	END(dtrace_invop_start)
 
 /*
-void dtrace_invop_init(void)
-*/
-	ENTRY(dtrace_invop_init)
-	movl	$dtrace_invop_start, dtrace_invop_jump_addr
-	ret
-	END(dtrace_invop_init)
-
-/*
-void dtrace_invop_uninit(void)
-*/
-	ENTRY(dtrace_invop_uninit)
-	movl	$0, dtrace_invop_jump_addr
-	ret
-	END(dtrace_invop_uninit)
-
-/*
 greg_t dtrace_getfp(void)
 */
 

Modified: stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==============================================================================
--- stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Mon Sep 30 01:25:14 2019	(r352881)
+++ stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Mon Sep 30 01:25:37 2019	(r352882)
@@ -51,8 +51,12 @@
 extern uintptr_t 	kernelbase;
 
 extern void dtrace_getnanotime(struct timespec *tsp);
+extern int (*dtrace_invop_jump_addr)(struct trapframe *);
 
-int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
+int	dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
+int	dtrace_invop_start(struct trapframe *frame);
+void	dtrace_invop_init(void);
+void	dtrace_invop_uninit(void);
 
 typedef struct dtrace_invop_hdlr {
 	int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t);
@@ -110,6 +114,20 @@ dtrace_invop_remove(int (*func)(uintptr_t, struct trap
 	}
 
 	kmem_free(hdlr, 0);
+}
+
+void
+dtrace_invop_init(void)
+{
+
+	dtrace_invop_jump_addr = dtrace_invop_start;
+}
+
+void
+dtrace_invop_uninit(void)
+{
+
+	dtrace_invop_jump_addr = NULL;
 }
 
 void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909300125.x8U1PbIb090280>