summaryrefslogtreecommitdiff
path: root/src/dev
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-01-06 05:30:46 -0800
committerGabe Black <gabeblack@google.com>2018-01-20 07:29:24 +0000
commitcd9450c1d95d9494e2714ec84620c548b0eebbb1 (patch)
tree1f9ec93031ec2a79ef8dbcefa57b7e44104deed9 /src/dev
parentecec88750729b2c94d5ca9dedbf7a755c46c41a7 (diff)
downloadgem5-cd9450c1d95d9494e2714ec84620c548b0eebbb1.tar.xz
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>
Diffstat (limited to 'src/dev')
-rw-r--r--src/dev/x86/i8042.cc17
-rw-r--r--src/dev/x86/speaker.cc7
2 files changed, 6 insertions, 18 deletions
diff --git a/src/dev/x86/i8042.cc b/src/dev/x86/i8042.cc
index c5fca1b47..279c520c1 100644
--- a/src/dev/x86/i8042.cc
+++ b/src/dev/x86/i8042.cc
@@ -491,13 +491,10 @@ X86ISA::I8042::write(PacketPtr pkt)
void
X86ISA::I8042::serialize(CheckpointOut &cp) const
{
- uint8_t statusRegData = statusReg.__data;
- uint8_t commandByteData = commandByte.__data;
-
SERIALIZE_SCALAR(dataPort);
SERIALIZE_SCALAR(commandPort);
- SERIALIZE_SCALAR(statusRegData);
- SERIALIZE_SCALAR(commandByteData);
+ SERIALIZE_SCALAR(statusReg);
+ SERIALIZE_SCALAR(commandByte);
SERIALIZE_SCALAR(dataReg);
SERIALIZE_SCALAR(lastCommand);
mouse.serialize("mouse", cp);
@@ -507,20 +504,14 @@ X86ISA::I8042::serialize(CheckpointOut &cp) const
void
X86ISA::I8042::unserialize(CheckpointIn &cp)
{
- uint8_t statusRegData;
- uint8_t commandByteData;
-
UNSERIALIZE_SCALAR(dataPort);
UNSERIALIZE_SCALAR(commandPort);
- UNSERIALIZE_SCALAR(statusRegData);
- UNSERIALIZE_SCALAR(commandByteData);
+ UNSERIALIZE_SCALAR(statusReg);
+ UNSERIALIZE_SCALAR(commandByte);
UNSERIALIZE_SCALAR(dataReg);
UNSERIALIZE_SCALAR(lastCommand);
mouse.unserialize("mouse", cp);
keyboard.unserialize("keyboard", cp);
-
- statusReg.__data = statusRegData;
- commandByte.__data = commandByteData;
}
void
diff --git a/src/dev/x86/speaker.cc b/src/dev/x86/speaker.cc
index 61a296719..4d39903e2 100644
--- a/src/dev/x86/speaker.cc
+++ b/src/dev/x86/speaker.cc
@@ -77,16 +77,13 @@ X86ISA::Speaker::write(PacketPtr pkt)
void
X86ISA::Speaker::serialize(CheckpointOut &cp) const
{
- uint8_t controlValData = controlVal.__data;
- SERIALIZE_SCALAR(controlValData);
+ SERIALIZE_SCALAR(controlVal);
}
void
X86ISA::Speaker::unserialize(CheckpointIn &cp)
{
- uint8_t controlValData;
- UNSERIALIZE_SCALAR(controlValData);
- controlVal.__data = controlValData;
+ UNSERIALIZE_SCALAR(controlVal);
}
X86ISA::Speaker *