2 * Copyright (c) 2008 The Regents of The University of Michigan
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;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include "dev/x86/i8237.hh"
32 #include "mem/packet.hh"
33 #include "mem/packet_access.hh"
36 X86ISA::I8237::read(PacketPtr pkt
)
38 assert(pkt
->getSize() == 1);
39 Addr offset
= pkt
->getAddr() - pioAddr
;
42 panic("Read from i8237 channel 0 current address unimplemented.\n");
44 panic("Read from i8237 channel 0 remaining "
45 "word count unimplemented.\n");
47 panic("Read from i8237 channel 1 current address unimplemented.\n");
49 panic("Read from i8237 channel 1 remaining "
50 "word count unimplemented.\n");
52 panic("Read from i8237 channel 2 current address unimplemented.\n");
54 panic("Read from i8237 channel 2 remaining "
55 "word count unimplemented.\n");
57 panic("Read from i8237 channel 3 current address unimplemented.\n");
59 panic("Read from i8237 channel 3 remaining "
60 "word count unimplemented.\n");
62 panic("Read from i8237 status register unimplemented.\n");
64 panic("Read from undefined i8237 register %d.\n", offset
);
66 pkt
->makeAtomicResponse();
71 X86ISA::I8237::write(PacketPtr pkt
)
73 assert(pkt
->getSize() == 1);
74 Addr offset
= pkt
->getAddr() - pioAddr
;
77 panic("Write to i8237 channel 0 starting address unimplemented.\n");
79 panic("Write to i8237 channel 0 starting "
80 "word count unimplemented.\n");
82 panic("Write to i8237 channel 1 starting address unimplemented.\n");
84 panic("Write to i8237 channel 1 starting "
85 "word count unimplemented.\n");
87 panic("Write to i8237 channel 2 starting address unimplemented.\n");
89 panic("Write to i8237 channel 2 starting "
90 "word count unimplemented.\n");
92 panic("Write to i8237 channel 3 starting address unimplemented.\n");
94 panic("Write to i8237 channel 3 starting "
95 "word count unimplemented.\n");
97 panic("Write to i8237 command register unimplemented.\n");
99 panic("Write to i8237 request register unimplemented.\n");
102 uint8_t command
= pkt
->get
<uint8_t>();
103 uint8_t select
= bits(command
, 1, 0);
104 uint8_t bitVal
= bits(command
, 2);
106 panic("Turning on i8237 channels unimplemented.\n");
107 replaceBits(maskReg
, select
, bitVal
);
111 panic("Write to i8237 mode register unimplemented.\n");
113 panic("Write to i8237 clear LSB/MSB flip-flop "
114 "register unimplemented.\n");
116 panic("Write to i8237 master clear/reset register unimplemented.\n");
118 panic("Write to i8237 clear mask register unimplemented.\n");
120 panic("Write to i8237 write all mask register bits unimplemented.\n");
122 panic("Write to undefined i8237 register.\n");
124 pkt
->makeAtomicResponse();
129 X86ISA::I8237::serialize(CheckpointOut
&cp
) const
131 SERIALIZE_SCALAR(maskReg
);
135 X86ISA::I8237::unserialize(CheckpointIn
&cp
)
137 UNSERIALIZE_SCALAR(maskReg
);
141 I8237Params::create()
143 return new X86ISA::I8237(this);