diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2012-10-12 11:54:38 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2012-10-12 11:54:38 +0100 |
commit | ba4906a9b64e165a958e12f6208ca834dc7a36dc (patch) | |
tree | 69e11bc30e8a212b1dd5f39f638431d936ecae49 /hw/mips_int.c | |
parent | 9ab1b6053f03d58ba8e7accc8f19c882fbffb66f (diff) | |
download | qemu-ba4906a9b64e165a958e12f6208ca834dc7a36dc.zip qemu-ba4906a9b64e165a958e12f6208ca834dc7a36dc.tar.gz qemu-ba4906a9b64e165a958e12f6208ca834dc7a36dc.tar.bz2 |
hw/ds1338: Fix mishandling of register pointer
Correct several deficiencies in the handling of the register pointer:
* it should wrap around after 0x3f, not 0xff
* guard against the caller handing us an out of range pointer
(on h/w this can never happen, because only a 7 bit value is
transferred over the I2C bus)
* there was confusion over whether nvram[] holds only the 56 bytes
of guest-accessible NVRAM, or also the secondary registers
which hold the value of the clock captured at the start of a
multibyte read. Correct to consistently be the latter, by fixing
the array size and the offset used for NVRAM writes.
* ds1338_send was attempting to use 'data' as both the data and
the register offset simultaneously, which meant that writes to
any register were broken; fix to use the register pointer.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/mips_int.c')
0 files changed, 0 insertions, 0 deletions