Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/dev/fbt/x86 Use x86_patch_window_{open, c...
details: https://anonhg.NetBSD.org/src/rev/1cf59106a802
branches: trunk
changeset: 461015:1cf59106a802
user: maxv <maxv%NetBSD.org@localhost>
date: Wed Nov 13 10:13:41 2019 +0000
description:
Use x86_patch_window_{open,close}. This also fixes a bug: the CR0/PSL
reloads were inverted.
diffstat:
external/cddl/osnet/dev/fbt/x86/fbt_isa.c | 21 ++++-----------------
1 files changed, 4 insertions(+), 17 deletions(-)
diffs (41 lines):
diff -r 7a56fd17c4cc -r 1cf59106a802 external/cddl/osnet/dev/fbt/x86/fbt_isa.c
--- a/external/cddl/osnet/dev/fbt/x86/fbt_isa.c Wed Nov 13 10:06:38 2019 +0000
+++ b/external/cddl/osnet/dev/fbt/x86/fbt_isa.c Wed Nov 13 10:13:41 2019 +0000
@@ -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 @@
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
Home |
Main Index |
Thread Index |
Old Index