summaryrefslogtreecommitdiffstats
path: root/utils/regtools
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2014-11-18 23:27:26 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2014-11-18 23:30:44 +0100
commitcd04a5f1aadc8e2ec4e787f5ba4cc8c38a579314 (patch)
tree63e9f095451aeba0139152c8742d0af67413690a /utils/regtools
parent794169a18f644eea32de20b26646381137545e2d (diff)
downloadrockbox-cd04a5f1aadc8e2ec4e787f5ba4cc8c38a579314.tar.gz
rockbox-cd04a5f1aadc8e2ec4e787f5ba4cc8c38a579314.tar.bz2
rockbox-cd04a5f1aadc8e2ec4e787f5ba4cc8c38a579314.zip
hwstub/qeditor: add support for atomic read/writes
The current code assumed that READ/WRITE would produce atomic read/writes for 8/16/32-bit words, which in turned put assumption on the memcpy function. Since some memcpy implementation do not always guarantee such strong assumption, introduce two new operation READ/WRITE_ATOMIC which provide the necessary tools to do correct read and write to register in a single memory access. Change-Id: I37451bd5057bb0dcaf5a800d8aef8791c792a090
Diffstat (limited to 'utils/regtools')
-rw-r--r--utils/regtools/qeditor/backend.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/regtools/qeditor/backend.cpp b/utils/regtools/qeditor/backend.cpp
index 570ae4d01f..e73263d30a 100644
--- a/utils/regtools/qeditor/backend.cpp
+++ b/utils/regtools/qeditor/backend.cpp
@@ -266,7 +266,7 @@ bool HWStubDevice::ReadMem(soc_addr_t addr, size_t length, void *buffer)
{
if(!m_hwdev)
return false;
- int ret = hwstub_rw_mem(m_hwdev, 1, addr, buffer, length);
+ int ret = hwstub_rw_mem_atomic(m_hwdev, 1, addr, buffer, length);
return ret >= 0 && (size_t)ret == length;
}
@@ -274,7 +274,7 @@ bool HWStubDevice::WriteMem(soc_addr_t addr, size_t length, void *buffer)
{
if(!m_hwdev)
return false;
- int ret = hwstub_rw_mem(m_hwdev, 0, addr, buffer, length);
+ int ret = hwstub_rw_mem_atomic(m_hwdev, 0, addr, buffer, length);
return ret >= 0 && (size_t)ret == length;
}