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/aarch64 Use db_write_bytes to ov...



details:   https://anonhg.NetBSD.org/src/rev/87050020f1d2
branches:  trunk
changeset: 969206:87050020f1d2
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Feb 12 01:09:27 2020 +0000

description:
Use db_write_bytes to overwrite kernel text.

diffstat:

 external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r 4a67044a2ceb -r 87050020f1d2 external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c
--- a/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c     Wed Feb 12 01:09:17 2020 +0000
+++ b/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c     Wed Feb 12 01:09:27 2020 +0000
@@ -36,6 +36,9 @@
 #include <sys/cpu.h>
 #include <sys/module.h>
 #include <sys/kmem.h>
+
+#include <ddb/ddb.h>
+
 #include <machine/cpufunc.h>
 
 #include <sys/dtrace.h>
@@ -78,8 +81,9 @@
 fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val)
 {
 
-       *fbt->fbtp_patchpoint = val;
-       cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4);
+       db_write_bytes((db_addr_t)fbt->fbtp_patchpoint, sizeof(val),
+           (const void *)&val);
+       cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, sizeof(val));
 }
 
 #if defined(__FreeBSD__)



Home | Main Index | Thread Index | Old Index