Module Name:    src
Committed By:   maxv
Date:           Wed Nov 13 10:13:41 UTC 2019

Modified Files:
        src/external/cddl/osnet/dev/fbt/x86: fbt_isa.c

Log Message:
Use x86_patch_window_{open,close}. This also fixes a bug: the CR0/PSL
reloads were inverted.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c

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

Modified files:

Index: src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c
diff -u src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.1 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.2
--- src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.1	Mon May 28 23:47:39 2018
+++ src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c	Wed Nov 13 10:13:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fbt_isa.c,v 1.1 2018/05/28 23:47:39 chs Exp $	*/
+/*	$NetBSD: fbt_isa.c,v 1.2 2019/11/13 10:13:41 maxv Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -175,28 +175,15 @@ fbt_patch_tracepoint(fbt_probe_t *fbt, f
 void
 fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val)
 {
-	u_long psl;
-	u_long cr0;
+	u_long psl, cr0;
 
-	/* Disable interrupts. */
-	psl = x86_read_psl();
-	x86_disable_intr();
-
-	/* Disable write protection in supervisor mode. */
-	cr0 = rcr0();
-	lcr0(cr0 & ~CR0_WP);
+	x86_patch_window_open(&psl, &cr0);
 
 	for (; fbt != NULL; fbt = fbt->fbtp_next) {
 		*fbt->fbtp_patchpoint = val;
 	}
 
-	/* Write back and invalidate cache, flush pipelines. */
-	wbinvd();
-	x86_flush();
-	x86_write_psl(psl);
-
-	/* Re-enable write protection. */
-	lcr0(cr0);
+	x86_patch_window_close(psl, cr0);
 }
 #endif
 

Reply via email to