Module Name: src Committed By: riastradh Date: Tue May 9 21:29:07 UTC 2023
Modified Files: src/external/cddl/osnet/dev/fbt/aarch64: fbt_isa.c Log Message: dtrace_fbt: Read and write instruction words in little-endian. Step toward making this work on aarch64eb. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 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.7 src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.8 --- src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.7 Wed Mar 24 04:46:41 2021 +++ src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c Tue May 9 21:29:07 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: fbt_isa.c,v 1.7 2021/03/24 04:46:41 simonb Exp $ */ +/* $NetBSD: fbt_isa.c,v 1.8 2023/05/09 21:29:07 riastradh Exp $ */ /* * CDDL HEADER START @@ -103,7 +103,7 @@ fbt_patch_tracepoint(fbt_probe_t *fbt, f return; if (!mm_md_direct_mapped_phys(pa, &va)) return; - *(fbt_patchval_t *)va = val; + *(fbt_patchval_t *)va = htole32(val); cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, sizeof(val)); } @@ -157,7 +157,7 @@ fbt_provide_module_cb(const char *name, /* Look for stp (pre-indexed) operation */ for (; instr < limit; instr++) { - if ((*instr & LDP_STP_MASK) == STP_64) + if ((le32toh(*instr) & LDP_STP_MASK) == STP_64) break; } @@ -181,7 +181,7 @@ fbt_provide_module_cb(const char *name, #ifdef __NetBSD__ fbt->fbtp_ctl = mod; #endif - fbt->fbtp_savedval = *instr; + fbt->fbtp_savedval = le32toh(*instr); fbt->fbtp_patchval = FBT_PATCHVAL; fbt->fbtp_symindx = symindx; @@ -195,10 +195,10 @@ fbt_provide_module_cb(const char *name, retfbt = NULL; again: for (; instr < limit; instr++) { - if (*instr == RET_INSTR) + if (le32toh(*instr) == RET_INSTR) break; - else if ((*instr & B_MASK) == B_INSTR) { - offs = (*instr & B_DATA_MASK); + else if ((le32toh(*instr) & B_MASK) == B_INSTR) { + offs = (le32toh(*instr) & B_DATA_MASK); offs *= 4; target = (instr + offs); #ifdef __FreeBSD__ @@ -241,7 +241,7 @@ again: #ifdef __NetBSD__ fbt->fbtp_ctl = mod; #endif - fbt->fbtp_savedval = *instr; + fbt->fbtp_savedval = le32toh(*instr); fbt->fbtp_patchval = FBT_PATCHVAL; fbt->fbtp_symindx = symindx;