Merge pull request #172 from riscv/dbus_read_comment

Add a comment in dbus_read
rbb_cleanup
Megan Wachs 2018-01-10 15:30:56 -08:00 committed by GitHub
commit 6f9585068f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -455,7 +455,12 @@ static uint64_t dbus_read(struct target *target, uint16_t address)
uint64_t value; uint64_t value;
dbus_status_t status; dbus_status_t status;
uint16_t address_in; uint16_t address_in;
/* If the previous read/write was to the same address, we will get the read data
* from the previous access.
* While somewhat nonintuitive, this is an efficient way to get the data.
*/
unsigned i = 0; unsigned i = 0;
do { do {
status = dbus_scan(target, &address_in, &value, DBUS_OP_READ, address, 0); status = dbus_scan(target, &address_in, &value, DBUS_OP_READ, address, 0);