base,arch: Fixed usage of `bitfield::replaceBits`
authorBobby R. Bruce <bbruce@ucdavis.edu>
Wed, 22 Jul 2020 00:29:19 +0000 (17:29 -0700)
committerBobby R. Bruce <bbruce@ucdavis.edu>
Wed, 22 Jul 2020 05:17:33 +0000 (05:17 +0000)
commitb99c31684025d4c730021330173c5829c9ca13fa
treec76c5d9b1dbc4b98120e272afe47c44b5af7e568
parent18fff9739c6e5c5500619923e39c329b1d46dcd7
base,arch: Fixed usage of `bitfield::replaceBits`

`bitfield::replaceBits` has two parameters, `first` and `last`, which
relate to the position of the MSB and the LSB of the bits to be replaced
respectively. Therefore `first` >= `last`. In some areas of the
codebase, this assumption has been flipped with `first` <= `last`. This
caused at least one known error, recorded here:
https://gem5.atlassian.net/browse/GEM5-695. These inconsistencies have
therefore been rectified.

A note has been added to the `bitfield::replaceBits` Doxygen to make
the usage of this function clearer.

Change-Id: Ie75856161d9a5684066430ecbdcc52e04e1e77bf
Issue-on: https://gem5.atlassian.net/browse/GEM5-696
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31674
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/mips/isa.cc
src/arch/x86/bios/intelmp.cc
src/arch/x86/bios/intelmp.hh
src/base/bitfield.hh