base: Rework bitunions so they can be more flexible.
They are now oriented around a class which makes it easy to provide custom setter/getter functions which let you set or read bits in an arbitrary way. Future additions may add the ability to add custom bitfield methods, and index-able bitfields. Change-Id: Ibd6d4d9e49107490f6dad30a4379a8c93bda9333 Reviewed-on: https://gem5-review.googlesource.com/7201 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
@@ -72,33 +72,33 @@ typedef std::ostream CheckpointOut;
|
||||
template <class T>
|
||||
void paramOut(CheckpointOut &cp, const std::string &name, const T ¶m);
|
||||
|
||||
template <typename DataType, typename BitUnion>
|
||||
template <typename BitUnion>
|
||||
void paramOut(CheckpointOut &cp, const std::string &name,
|
||||
const BitfieldBackend::BitUnionOperators<DataType, BitUnion> &p)
|
||||
const BitfieldBackend::BitUnionOperators<BitUnion> &p)
|
||||
{
|
||||
paramOut(cp, name, p.__data);
|
||||
paramOut(cp, name, p.__storage);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void paramIn(CheckpointIn &cp, const std::string &name, T ¶m);
|
||||
|
||||
template <typename DataType, typename BitUnion>
|
||||
template <typename BitUnion>
|
||||
void paramIn(CheckpointIn &cp, const std::string &name,
|
||||
BitfieldBackend::BitUnionOperators<DataType, BitUnion> &p)
|
||||
BitfieldBackend::BitUnionOperators<BitUnion> &p)
|
||||
{
|
||||
paramIn(cp, name, p.__data);
|
||||
paramIn(cp, name, p.__storage);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool optParamIn(CheckpointIn &cp, const std::string &name, T ¶m,
|
||||
bool warn = true);
|
||||
|
||||
template <typename DataType, typename BitUnion>
|
||||
template <typename BitUnion>
|
||||
bool optParamIn(CheckpointIn &cp, const std::string &name,
|
||||
BitfieldBackend::BitUnionOperators<DataType, BitUnion> &p,
|
||||
BitfieldBackend::BitUnionOperators<BitUnion> &p,
|
||||
bool warn = true)
|
||||
{
|
||||
return optParamIn(cp, name, p.__data, warn);
|
||||
return optParamIn(cp, name, p.__storage, warn);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
||||
Reference in New Issue
Block a user