forked from auracaster/openocd
openocd: drop iteration downsampling for keep_alive()
The function keep_alive() is optimized and return immediately if has nothing to do. There is no need to overly-complicate the code with extra counters or time computation plus the relative checks to reduce the number of calls to keep_alive(). Drop such extra code. Change-Id: I4574a3f154b5779f44105936c74af8fca1d2c49c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/9064 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins Reviewed-by: Lucien Buchmann <lucien.buchmann@dufour.aero>
This commit is contained in:
@@ -2135,8 +2135,6 @@ int arm7_9_read_memory(struct target *target,
|
||||
reg[0] = address;
|
||||
arm7_9->write_core_regs(target, 0x1, reg);
|
||||
|
||||
int j = 0;
|
||||
|
||||
switch (size) {
|
||||
case 4:
|
||||
while (num_accesses < count) {
|
||||
@@ -2166,8 +2164,7 @@ int arm7_9_read_memory(struct target *target,
|
||||
buffer += thisrun_accesses * 4;
|
||||
num_accesses += thisrun_accesses;
|
||||
|
||||
if ((j++%1024) == 0)
|
||||
keep_alive();
|
||||
keep_alive();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
@@ -2199,8 +2196,7 @@ int arm7_9_read_memory(struct target *target,
|
||||
buffer += thisrun_accesses * 2;
|
||||
num_accesses += thisrun_accesses;
|
||||
|
||||
if ((j++%1024) == 0)
|
||||
keep_alive();
|
||||
keep_alive();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
@@ -2231,8 +2227,7 @@ int arm7_9_read_memory(struct target *target,
|
||||
buffer += thisrun_accesses * 1;
|
||||
num_accesses += thisrun_accesses;
|
||||
|
||||
if ((j++%1024) == 0)
|
||||
keep_alive();
|
||||
keep_alive();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user