Module Name:    src
Committed By:   riastradh
Date:           Wed Feb 12 06:05:31 UTC 2020

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

Log Message:
Switch from db_write_bytes to using direct-mapping.

This way there's no dependency on ddb.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/dev/fbt/aarch64/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/aarch64/fbt_isa.c
diff -u src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.5 src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.6
--- src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.5	Wed Feb 12 01:10:25 2020
+++ src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c	Wed Feb 12 06:05:31 2020
@@ -37,7 +37,9 @@
 #include <sys/module.h>
 #include <sys/kmem.h>
 
-#include <ddb/ddb.h>
+#include <uvm/uvm_extern.h>
+
+#include <dev/mm.h>
 
 #include <machine/cpufunc.h>
 
@@ -92,9 +94,14 @@ fbt_invop(uintptr_t addr, struct trapfra
 void
 fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val)
 {
+	paddr_t pa;
+	vaddr_t va;
 
-	db_write_bytes((db_addr_t)fbt->fbtp_patchpoint, sizeof(val),
-	    (const void *)&val);
+	if (!pmap_extract(pmap_kernel(), (vaddr_t)fbt->fbtp_patchpoint, &pa))
+		return;
+	if (!mm_md_direct_mapped_phys(pa, &va))
+		return;
+	*(fbt_patchval_t *)va = val;
 	cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, sizeof(val));
 }
 

Reply via email to