|
From: <ge...@op...> - 2018-04-30 08:44:57
|
This is an automated email from Gerrit. Muhammad Omair Javaid (oma...@li...) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/4509 -- gerrit commit d64cc75ed5bd00ae2a5d3840ec6048ed1b2f4e1a Author: Omair Javaid <oma...@li...> Date: Mon Apr 30 13:38:43 2018 +0500 Fix AArch64 memory access to better use fast read/write Fast memory access was only used when size was 4 and count a multiple of 4. Adds a check for the case where both size and count are a multiple of 4. This makes sure we are using fast access in cases where size is 8,12,16 etc.. Change-Id: I9e8c0422b5450abe05936dc90a0a40c643c08e1d Signed-off-by: Omair Javaid <oma...@li...> diff --git a/src/target/aarch64.c b/src/target/aarch64.c index cc54e73..f827bf0 100644 --- a/src/target/aarch64.c +++ b/src/target/aarch64.c @@ -1854,8 +1854,8 @@ static int aarch64_write_cpu_memory(struct target *target, if (retval != ERROR_OK) return retval; - if (size == 4 && (address % 4) == 0) - retval = aarch64_write_cpu_memory_fast(target, count, buffer, &dscr); + if ((size % 4) == 0 && (address % 4) == 0) + retval = aarch64_write_cpu_memory_fast(target, count * size / 4, buffer, &dscr); else retval = aarch64_write_cpu_memory_slow(target, size, count, buffer, &dscr); @@ -2072,8 +2072,8 @@ static int aarch64_read_cpu_memory(struct target *target, if (retval != ERROR_OK) return retval; - if (size == 4 && (address % 4) == 0) - retval = aarch64_read_cpu_memory_fast(target, count, buffer, &dscr); + if ((size % 4) == 0 && (address % 4) == 0) + retval = aarch64_read_cpu_memory_fast(target, count * size / 4, buffer, &dscr); else retval = aarch64_read_cpu_memory_slow(target, size, count, buffer, &dscr); -- |