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 Tidy up a bit: don't set...



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

description:
Tidy up a bit: don't set things we won't use; assert nonzeroness.

diffstat:

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

diffs (51 lines):

diff -r 2a7d53f7aff6 -r ac4730b35ea2 external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c
--- a/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c     Wed Feb 12 01:09:38 2020 +0000
+++ b/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c     Wed Feb 12 01:09:48 2020 +0000
@@ -70,6 +70,7 @@
                            frame->tf_regs.r_reg[3], frame->tf_regs.r_reg[4]);
 
                        cpu->cpu_dtrace_caller = 0;
+                       KASSERT(fbt->fbtp_savedval != 0);
                        return (fbt->fbtp_savedval);
                }
        }
@@ -142,6 +143,7 @@
 
        if (instr >= limit)
                return (0);
+       KASSERT(*instr != 0);
 
 #ifdef __FreeBSD__
        fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO);
@@ -161,7 +163,6 @@
 #endif
        fbt->fbtp_savedval = *instr;
        fbt->fbtp_patchval = FBT_PATCHVAL;
-       fbt->fbtp_rval = DTRACE_INVOP_PUSHM;
        fbt->fbtp_symindx = symindx;
 
        fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)];
@@ -192,6 +193,7 @@
 
        if (instr >= limit)
                return (0);
+       KASSERT(*instr != 0);
 
        /*
         * We have a winner!
@@ -219,13 +221,10 @@
 #ifdef __NetBSD__
        fbt->fbtp_ctl = mod;
 #endif
-       fbt->fbtp_symindx = symindx;
-       if ((*instr & B_MASK) == B_INSTR)
-               fbt->fbtp_rval = DTRACE_INVOP_B;
-       else
-               fbt->fbtp_rval = DTRACE_INVOP_RET;
        fbt->fbtp_savedval = *instr;
        fbt->fbtp_patchval = FBT_PATCHVAL;
+       fbt->fbtp_symindx = symindx;
+
        fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)];
        fbt_probetab[FBT_ADDR2NDX(instr)] = fbt;
 



Home | Main Index | Thread Index | Old Index