42 #include "config/the_isa.hh"
43 #include "debug/Uart.hh"
50 using namespace TheISA;
55 DPRINTF(
Uart,
"UART Interrupt Event Initilizing\n");
62 return "uart interrupt delay";
68 if (intrBit & uart->IER) {
70 uart->platform->postConsoleInt();
71 uart->status |= intrBit;
75 DPRINTF(
Uart,
"UART InterEvent, not interrupting\n");
95 DPRINTF(
Uart,
"Scheduling IER interrupt for %#x, at cycle %lld\n", intrBit,
98 uart->schedule(
this,
curTick() + interval);
100 uart->reschedule(
this,
curTick() + interval);
126 pkt->
set((uint8_t)0);
151 else if (status &
TX_INT) {
175 pkt->
set((uint8_t)0);
178 pkt->
set((uint8_t)0);
181 panic(
"Tried to access a UART port that doesn't exist\n");
200 DPRINTF(
Uart,
" write register %#x value %#x\n", daddr, pkt->
get<uint8_t>());
216 IER = pkt->
get<uint8_t>();
219 DPRINTF(
Uart,
"IER: IER_THRI set, scheduling TX intrrupt\n");
221 DPRINTF(
Uart,
"-- Interrupting Immediately... %d,%d\n",
232 DPRINTF(
Uart,
"IER: IER_THRI cleared, descheduling TX intrrupt\n");
241 DPRINTF(
Uart,
"IER: IER_RDI set, scheduling RX intrrupt\n");
244 DPRINTF(
Uart,
"IER: IER_RDI cleared, descheduling RX intrrupt\n");
258 LCR = pkt->
get<uint8_t>();
268 panic(
"Tried to access a UART port that doesn't exist\n");
336 Uart8250Params::create()
AddrRange RangeSize(Addr start, Addr size)
const uint8_t UART_IER_THRI
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
const uint8_t UART_IER_RDI
void dataAvailable() override
Inform the uart that there is data available.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
const uint8_t UART_LSR_TEMT
bool scheduled() const
Determine if the current event is scheduled.
IntrEvent(Uart8250 *u, int bit)
const uint8_t UART_MCR_LOOP
void deschedule(Event &event)
T get(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
virtual const char * description() const
Return a C string describing the event.
#define UNSERIALIZE_SCALAR(scalar)
Tick curTick()
The current simulated tick.
Addr pioSize
Size that the device's address range.
Uart8250(const Params *p)
Tick when() const
Get the time that the event is scheduled.
void makeAtomicResponse()
uint64_t Tick
Tick count type.
AddrRangeList getAddrRanges() const override
Determine the address ranges that this device responds to.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
const uint8_t UART_LSR_DR
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Declaration of IniFile object.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
#define SERIALIZE_SCALAR(scalar)
const uint8_t UART_LSR_THRE
Declaration of the Packet class.
std::ostream CheckpointOut
Tick pioDelay
Delay that the device experinces on an access.
void schedule(Event &event, Tick when)
Addr pioAddr
Address that the device listens to.
void serialize(CheckpointOut &cp) const override
Serialize an object.