diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-03-25 00:12:47 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-03-25 00:12:47 +0000 |
commit | eaf863cd1ef55ef8c276e5dd7c277f22522a0436 (patch) | |
tree | dfc0285293eb6eee6123708c8aa73635d6c86e68 /sim | |
parent | ee196b8c2b47bcb9a090a9f144664b10523117e0 (diff) | |
download | gdb-eaf863cd1ef55ef8c276e5dd7c277f22522a0436.zip gdb-eaf863cd1ef55ef8c276e5dd7c277f22522a0436.tar.gz gdb-eaf863cd1ef55ef8c276e5dd7c277f22522a0436.tar.bz2 |
sim: bfin: fix clear/set/toggle GPIO handling
The clear/set/toggle MMRs aren't backed by "real" data; they implicitly
perform bit operations on the associated data register. So when we go
to process writes to them, we need to adjust the pointer accordingly so
that the actual backing data is modified.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim')
-rw-r--r-- | sim/bfin/ChangeLog | 5 | ||||
-rw-r--r-- | sim/bfin/dv-bfin_gpio.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog index c5ab9ae..d4a36ca 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,8 @@ +2011-03-24 Mike Frysinger <vapier@gentoo.org> + + * dv-bfin_gpio.c (bfin_gpio_io_write_buffer): Subtract 2 from the + valuep pointer for clear MMRs, 4 for set MMRs, and 6 for toggle MMRs. + 2011-03-23 Mike Frysinger <vapier@gentoo.org> * TODO: Document some known SIC issues. diff --git a/sim/bfin/dv-bfin_gpio.c b/sim/bfin/dv-bfin_gpio.c index 50baf03..6b18a40 100644 --- a/sim/bfin/dv-bfin_gpio.c +++ b/sim/bfin/dv-bfin_gpio.c @@ -92,16 +92,22 @@ bfin_gpio_io_write_buffer (struct hw *me, const void *source, int space, case mmr_offset(clear): case mmr_offset(maska_clear): case mmr_offset(maskb_clear): + /* We want to clear the related data MMR. */ + valuep -= 2; dv_w1c_2 (valuep, value, -1); break; case mmr_offset(set): case mmr_offset(maska_set): case mmr_offset(maskb_set): + /* We want to set the related data MMR. */ + valuep -= 4; *valuep |= value; break; case mmr_offset(toggle): case mmr_offset(maska_toggle): case mmr_offset(maskb_toggle): + /* We want to toggle the related data MMR. */ + valuep -= 6; *valuep ^= value; break; default: |