This is an automated email from Gerrit. Hsiangkai Wang ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/1324
-- gerrit commit 863807c8fa065e75a10f33bc31d5971b64b7b42d Author: Hsiangkai <[email protected]> Date: Tue Apr 2 17:55:48 2013 +0800 nds32: use DMA to access memory during virtual hosting Use DMA to access memory to improve performance during virtual hosting. As read/write large chunk of data, the performance difference is significant. Change-Id: Ia32c1914cfe11984b504ea053f4e68b48880ed0c Signed-off-by: Hsiangkai <[email protected]> diff --git a/src/target/nds32_v3.c b/src/target/nds32_v3.c index 3570827..554ef7e 100644 --- a/src/target/nds32_v3.c +++ b/src/target/nds32_v3.c @@ -926,8 +926,23 @@ int nds32_v3_write_buffer(struct target *target, uint32_t address, else return ERROR_FAIL; - if (nds32->hit_syscall) - return nds32_gdb_fileio_write_memory(nds32, address, size, buffer); + if (nds32->hit_syscall) { + /* Use bus mode to access memory during virtual hosting */ + struct aice_port_s *aice = target_to_aice(target); + enum nds_memory_access origin_access_channel; + int result; + + origin_access_channel = memory->access_channel; + memory->access_channel = NDS_MEMORY_ACC_BUS; + aice->port->api->memory_access(NDS_MEMORY_ACC_BUS); + + result = nds32_gdb_fileio_write_memory(nds32, address, size, buffer); + + memory->access_channel = origin_access_channel; + aice->port->api->memory_access(origin_access_channel); + + return result; + } return nds32_write_buffer(target, address, size, buffer); } @@ -967,7 +982,26 @@ int nds32_v3_read_memory(struct target *target, uint32_t address, else return ERROR_FAIL; - return nds32_read_memory(target, address, size, count, buffer); + struct aice_port_s *aice = target_to_aice(target); + enum nds_memory_access origin_access_channel; + int result; + + if (nds32->hit_syscall) { + /* Use bus mode to access memory during virtual hosting */ + origin_access_channel = memory->access_channel; + memory->access_channel = NDS_MEMORY_ACC_BUS; + aice->port->api->memory_access(NDS_MEMORY_ACC_BUS); + } + + result = nds32_read_memory(target, address, size, count, buffer); + + if (nds32->hit_syscall) { + /* Restore access_channel after virtual hosting */ + memory->access_channel = origin_access_channel; + aice->port->api->memory_access(origin_access_channel); + } + + return result; } int nds32_v3_write_memory(struct target *target, uint32_t address, -- ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
