diff options
author | Frank Ch. Eigler <fche@redhat.com> | 1998-03-05 20:23:59 +0000 |
---|---|---|
committer | Frank Ch. Eigler <fche@redhat.com> | 1998-03-05 20:23:59 +0000 |
commit | 370e0ef781738ddc0171c86823323d46eae8c0fe (patch) | |
tree | 3fd82844f7271444de571b4fad128108c6736c2e | |
parent | 1d7a3fd77597bae3c76039b603aef03471615020 (diff) | |
download | gdb-370e0ef781738ddc0171c86823323d46eae8c0fe.zip gdb-370e0ef781738ddc0171c86823323d46eae8c0fe.tar.gz gdb-370e0ef781738ddc0171c86823323d46eae8c0fe.tar.bz2 |
* Fixed a double-buffering bug in PKE, due to naive use of
complex macros with side-effects. Gripes.
-rw-r--r-- | sim/mips/sky-pke.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sim/mips/sky-pke.c b/sim/mips/sky-pke.c index c9dfe0e..db9ecc4 100644 --- a/sim/mips/sky-pke.c +++ b/sim/mips/sky-pke.c @@ -913,18 +913,19 @@ pke_check_stall(struct pke_device* me, enum pke_check_target what) void pke_flip_dbf(struct pke_device* me) { + int newdf; /* compute new TOP */ PKE_REG_MASK_SET(me, TOP, TOP, PKE_REG_MASK_GET(me, TOPS, TOPS)); /* flip DBF */ - PKE_REG_MASK_SET(me, DBF, DF, - PKE_REG_MASK_GET(me, DBF, DF) ? 0 : 1); - PKE_REG_MASK_SET(me, STAT, DBF, PKE_REG_MASK_GET(me, DBF, DF)); + newdf = PKE_REG_MASK_GET(me, DBF, DF) ? 0 : 1; + PKE_REG_MASK_SET(me, DBF, DF, newdf); + PKE_REG_MASK_SET(me, STAT, DBF, newdf); /* compute new TOPS */ PKE_REG_MASK_SET(me, TOPS, TOPS, (PKE_REG_MASK_GET(me, BASE, BASE) + - (PKE_REG_MASK_GET(me, DBF, DF) * - PKE_REG_MASK_GET(me, OFST, OFFSET)))); + newdf * PKE_REG_MASK_GET(me, OFST, OFFSET))); + /* this is equivalent to last word from okadaa (98-02-25): 1) TOP=TOPS; 2) TOPS=BASE + !DBF*OFFSET |