speaker.cc (12450:b5a0300fc327) speaker.cc (13229:b45254f2733a)
1/*
2 * Copyright (c) 2008 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 34 unchanged lines hidden (view full) ---

43 assert(pkt->getAddr() == pioAddr);
44 assert(pkt->getSize() == 1);
45 controlVal.timer = timer->outputHigh(2) ? 1 : 0;
46 DPRINTF(PcSpeaker,
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");
1/*
2 * Copyright (c) 2008 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 34 unchanged lines hidden (view full) ---

43 assert(pkt->getAddr() == pioAddr);
44 assert(pkt->getSize() == 1);
45 controlVal.timer = timer->outputHigh(2) ? 1 : 0;
46 DPRINTF(PcSpeaker,
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->set((uint8_t)controlVal);
51 pkt->setLE((uint8_t)controlVal);
52 pkt->makeAtomicResponse();
53 return latency;
54}
55
56Tick
57X86ISA::Speaker::write(PacketPtr pkt)
58{
59 assert(pkt->getAddr() == pioAddr);
60 assert(pkt->getSize() == 1);
52 pkt->makeAtomicResponse();
53 return latency;
54}
55
56Tick
57X86ISA::Speaker::write(PacketPtr pkt)
58{
59 assert(pkt->getAddr() == pioAddr);
60 assert(pkt->getSize() == 1);
61 SpeakerControl val = pkt->get();
61 SpeakerControl val = pkt->getLE<uint8_t>();
62 controlVal.gate = val.gate;
63 //Change the gate value in the timer.
64 if (!val.gate)
65 warn("The gate bit of the pc speaker isn't implemented and "
66 "is always on.\n");
67 //This would control whether the timer output is hooked up to a physical
68 //speaker. Since M5 can't make noise, it's value doesn't actually do
69 //anything.

--- 24 unchanged lines hidden ---
62 controlVal.gate = val.gate;
63 //Change the gate value in the timer.
64 if (!val.gate)
65 warn("The gate bit of the pc speaker isn't implemented and "
66 "is always on.\n");
67 //This would control whether the timer output is hooked up to a physical
68 //speaker. Since M5 can't make noise, it's value doesn't actually do
69 //anything.

--- 24 unchanged lines hidden ---