Go to the documentation of this file.
33 #include "debug/I8259.hh"
40 latency(
p->pio_latency),
43 readIRR(true), initControlWord(0), autoEOI(false)
45 for (
int i = 0;
i <
p->port_output_connection_count;
i++) {
50 int in_count =
p->port_inputs_connection_count;
52 "I8259 only supports 8 inputs, but there are %d.", in_count);
53 for (
int i = 0;
i < in_count;
i++) {
67 for (
auto *input: inputs)
68 pinStates[input->getId()] = input->state();
75 switch(pkt->
getAddr() - pioAddr)
100 switch (pkt->
getAddr() - pioAddr) {
103 DPRINTF(
I8259,
"Received initialization command word 1.\n");
107 edgeTriggered ?
"Edge" :
"Level");
110 cascadeMode ?
"Cascade" :
"Single");
116 DPRINTF(
I8259,
"Expecting %d more bytes.\n", expectICW4 ? 3 : 2);
117 }
else if (
bits(
val, 4, 3) == 0) {
122 "Subcommand: Rotate in auto-EOI mode (clear).\n");
127 DPRINTF(
I8259,
"Subcommand: Nonspecific EOI on line %d.\n",
138 DPRINTF(
I8259,
"Subcommand: Specific EIO on line %d.\n",
144 DPRINTF(
I8259,
"Subcommand: Rotate in auto-EOI mode (set).\n");
147 DPRINTF(
I8259,
"Subcommand: Rotate on nonspecific EOI.\n");
155 DPRINTF(
I8259,
"Subcommand: Rotate on specific EOI.\n");
160 }
else if (
bits(
val, 4, 3) == 1) {
164 bits(
val, 6) ?
"Set" :
"Clear");
173 switch (initControlWord) {
180 DPRINTF(
I8259,
"Received initialization command word 2.\n");
183 vectorOffset, vectorOffset |
mask(3));
192 DPRINTF(
I8259,
"Received initialization command word 3.\n");
193 if (
mode == Enums::I8259Master) {
195 "IRQs:%s%s%s%s%s%s%s%s\n",
215 DPRINTF(
I8259,
"Received initialization command word 4.\n");
223 }
else if (
bits(
val, 2) == 0) {
230 autoEOI ?
"Automatic" :
"Normal");
258 for (
auto *wire:
output) {
264 warn(
"Received interrupt but didn't have "
265 "anyone to tell about it.\n");
273 DPRINTF(
I8259,
"Interrupt requested for line %d.\n", line);
274 if (line >= NumLines)
275 fatal(
"Line number %d doesn't exist. The max is %d.\n",
281 requestInterrupt(line);
288 DPRINTF(
I8259,
"Interrupt signal raised for pin %d.\n", number);
289 if (number >= NumLines)
290 fatal(
"Line number %d doesn't exist. The max is %d.\n",
291 number, NumLines - 1);
292 if (!pinStates[number])
293 signalInterrupt(number);
294 pinStates[number] =
true;
300 DPRINTF(
I8259,
"Interrupt signal lowered for pin %d.\n", number);
301 if (number >= NumLines)
302 fatal(
"Line number %d doesn't exist. The max is %d.\n",
303 number, NumLines - 1);
304 pinStates[number] =
false;
324 if (slave &&
bits(cascadeBits, line)) {
326 "provide the vector.\n");
327 return slave->getVector();
329 return line | vectorOffset;
369 I8259Params::create()
#define fatal(...)
This implements a cprintf based fatal() function.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
static void output(const char *filename)
void makeAtomicResponse()
void serialize(CheckpointOut &cp) const override
Serialize an object.
#define UNSERIALIZE_SCALAR(scalar)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
int findMsbSet(uint64_t val)
Returns the bit position of the MSB that is set in the input.
static const int NumLines
uint64_t Tick
Tick count type.
void raiseInterruptPin(int number)
#define SERIALIZE_ENUM(scalar)
void requestInterrupt(int line)
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
#define SERIALIZE_ARRAY(member, size)
#define SERIALIZE_SCALAR(scalar)
std::vector< IntSinkPin< I8259 > * > inputs
virtual const std::string name() const
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
void signalInterrupt(int line)
#define UNSERIALIZE_ARRAY(member, size)
std::vector< IntSourcePin< I8259 > * > output
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void lowerInterruptPin(int number)
void setLE(T v)
Set the value in the data pointer to v as little endian.
std::ostream CheckpointOut
#define UNSERIALIZE_ENUM(scalar)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
std::string csprintf(const char *format, const Args &...args)
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17