35 #include "debug/PcSpeaker.hh" 45 controlVal.timer =
timer->outputHigh(2) ? 1 : 0;
47 "Reading from speaker device: gate %s, speaker %s, output %s.\n",
48 controlVal.gate ?
"on" :
"off",
49 controlVal.speaker ?
"on" :
"off",
50 controlVal.timer ?
"on" :
"off");
51 pkt->
setLE((uint8_t)controlVal);
61 SpeakerControl
val = pkt->
getLE<uint8_t>();
62 controlVal.gate = val.gate;
65 warn(
"The gate bit of the pc speaker isn't implemented and " 70 controlVal.speaker = val.speaker;
71 DPRINTF(PcSpeaker,
"Writing to speaker device: gate %s, speaker %s.\n",
72 controlVal.gate ?
"on" :
"off", controlVal.speaker ?
"on" :
"off");
90 PcSpeakerParams::create()
void setLE(T v)
Set the value in the data pointer to v as little endian.
#define UNSERIALIZE_SCALAR(scalar)
void makeAtomicResponse()
uint64_t Tick
Tick count type.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
void serialize(CheckpointOut &cp) const override
Serialize an object.
#define SERIALIZE_SCALAR(scalar)
Declaration of the Packet class.
std::ostream CheckpointOut
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Addr pioAddr
Address that the device listens to.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.