[Pdbg] [PATCH 3/5] adu: Set default blocksize for adu
Amitay Isaacs
amitay at ozlabs.org
Mon Jan 7 15:30:18 AEDT 2019
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
libpdbg/adu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libpdbg/adu.c b/libpdbg/adu.c
index bc01625..650ec6b 100644
--- a/libpdbg/adu.c
+++ b/libpdbg/adu.c
@@ -117,6 +117,9 @@ static int adu_read(struct adu *adu, uint64_t start_addr, uint8_t *output,
int rc = 0;
uint64_t addr0, addr;
+ if (!block_size)
+ block_size = 8;
+
output0 = output;
/* Align start address to block_sized boundary */
@@ -209,6 +212,9 @@ static int adu_write(struct adu *adu, uint64_t start_addr, uint8_t *input,
int rc = 0, tsize;
uint64_t addr, data, end_addr;
+ if (!block_size)
+ block_size = 8;
+
end_addr = start_addr + size;
for (addr = start_addr; addr < end_addr; addr += tsize, input += tsize) {
if ((addr % block_size) || (addr + block_size > end_addr)) {
--
2.20.1
More information about the Pdbg
mailing list