34#include "debug/I8259.hh"
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++) {
63 if (
mode == enums::I8259Master ||
mode == enums::I8259Single) {
76 pinStates[input->getId()] = input->state();
84 assert(
mode == enums::I8259Master ||
mode == enums::I8259Single);
110 uint8_t
val = pkt->
getLE<uint8_t>();
114 DPRINTF(
I8259,
"Received initialization command word 1.\n");
128 }
else if (
bits(
val, 4, 3) == 0) {
133 "Subcommand: Rotate in auto-EOI mode (clear).\n");
138 DPRINTF(
I8259,
"Subcommand: Nonspecific EOI on line %d.\n",
149 DPRINTF(
I8259,
"Subcommand: Specific EIO on line %d.\n",
155 DPRINTF(
I8259,
"Subcommand: Rotate in auto-EOI mode (set).\n");
158 DPRINTF(
I8259,
"Subcommand: Rotate on nonspecific EOI.\n");
166 DPRINTF(
I8259,
"Subcommand: Rotate on specific EOI.\n");
171 }
else if (
bits(
val, 4, 3) == 1) {
175 bits(
val, 6) ?
"Set" :
"Clear");
191 DPRINTF(
I8259,
"Received initialization command word 2.\n");
203 DPRINTF(
I8259,
"Received initialization command word 3.\n");
204 if (
mode == enums::I8259Master) {
206 "IRQs:%s%s%s%s%s%s%s%s\n",
226 DPRINTF(
I8259,
"Received initialization command word 4.\n");
234 }
else if (
bits(
val, 2) == 0) {
241 autoEOI ?
"Automatic" :
"Normal");
269 for (
auto *wire:
output) {
275 warn(
"Received interrupt but didn't have "
276 "anyone to tell about it.\n");
284 DPRINTF(
I8259,
"Interrupt requested for line %d.\n", line);
286 fatal(
"Line number %d doesn't exist. The max is %d.\n",
299 DPRINTF(
I8259,
"Interrupt signal raised for pin %d.\n", number);
301 fatal(
"Line number %d doesn't exist. The max is %d.\n",
311 DPRINTF(
I8259,
"Interrupt signal lowered for pin %d.\n", number);
313 fatal(
"Line number %d doesn't exist. The max is %d.\n",
337 "provide the vector.\n");
338 return slave->getVector();
Addr pioAddr
Address that the device listens to.
BasicPioDevice(const Params &p, Addr size)
AddrRangeList getAddrRanges() const override
Determine the address ranges that this device responds to.
virtual std::string name() const
void setLE(T v)
Set the value in the data pointer to v as little endian.
void makeAtomicResponse()
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void signalInterrupt(int line)
enums::X86I8259CascadeMode mode
std::vector< IntSinkPin< I8259 > * > inputs
void raiseInterruptPin(int number)
void lowerInterruptPin(int number)
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
std::vector< IntSourcePin< I8259 > * > output
static const int NumLines
void unserialize(CheckpointIn &cp) override
Unserialize an object.
AddrRangeList getAddrRanges() const override
Determine the address ranges that this device responds to.
void requestInterrupt(int line)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
void serialize(CheckpointOut &cp) const override
Serialize an object.
AddrRange RangeSize(Addr start, Addr size)
std::list< AddrRange > AddrRangeList
Convenience typedef for a collection of address ranges.
constexpr int findMsbSet(uint64_t val)
Returns the bit position of the MSB that is set in the input.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
#define fatal(...)
This implements a cprintf based fatal() function.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
#define SERIALIZE_ENUM(scalar)
#define UNSERIALIZE_ARRAY(member, size)
#define SERIALIZE_ARRAY(member, size)
#define UNSERIALIZE_ENUM(scalar)
Copyright (c) 2024 Arm Limited All rights reserved.
IntSourcePinBase IntSourcePin
std::ostream CheckpointOut
uint64_t Tick
Tick count type.
std::string csprintf(const char *format, const Args &...args)
IntSinkPinBase IntSinkPin
Declaration of the Packet class.
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)