Go to the documentation of this file.
40 #include "debug/Uart.hh"
52 platform->postConsoleInt();
57 DPRINTF(
Uart,
"UART InterEvent, not interrupting\n");
77 DPRINTF(
Uart,
"Scheduling IER interrupt for %s, at cycle %lld\n",
79 if (!
event->scheduled())
87 :
Uart(
p, 8),
IER(0), DLAB(0), LCR(0), MCR(0), lastTxInt(0),
89 rxIntrEvent([
this]{ processIntrEvent(
RX_INT); },
"RX")
164 panic(
"Tried to access a UART port that doesn't exist\n");
183 DPRINTF(
Uart,
" write register %#x value %#x\n", daddr,
204 "IER: IER_THRI set, scheduling TX intrrupt\n");
206 DPRINTF(
Uart,
"-- Interrupting Immediately... %d,%d\n",
218 "descheduling TX intrrupt\n");
228 "IER: IER_RDI set, scheduling RX intrrupt\n");
232 "descheduling RX intrrupt\n");
256 panic(
"Tried to access a UART port that doesn't exist\n");
324 Uart8250Params::create()
bool scheduled() const
Determine if the current event is scheduled.
void makeAtomicResponse()
Addr pioAddr
Address that the device listens to.
#define UNSERIALIZE_SCALAR(scalar)
void setRaw(T v)
Set the value in the data pointer to v without byte swapping.
uint64_t Tick
Tick count type.
void processIntrEvent(int intrBit)
void deschedule(Event &event)
Tick when() const
Get the time that the event is scheduled.
EventFunctionWrapper txIntrEvent
AddrRangeList getAddrRanges() const override
Determine the address ranges that this device responds to.
Uart8250(const Params *p)
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void schedule(Event &event, Tick when)
virtual bool dataAvailable() const =0
Check if there is pending data from the serial device.
AddrRange RangeSize(Addr start, Addr size)
const uint8_t UART_LSR_TEMT
Addr pioSize
Size that the device's address range.
virtual uint8_t readData()=0
Read a character from the device.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
void scheduleIntr(Event *event)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
#define SERIALIZE_SCALAR(scalar)
EventFunctionWrapper rxIntrEvent
const uint8_t UART_IER_RDI
T getRaw() const
Get the data in the packet without byte swapping.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Overload hash function for BasicBlockRange type.
const uint8_t UART_MCR_LOOP
const uint8_t UART_IER_THRI
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void dataAvailable() override
Inform the uart that there is data available.
Tick pioDelay
Delay that the device experinces on an access.
std::ostream CheckpointOut
virtual void writeData(uint8_t c)=0
Transmit a character from the host interface to the device.
const uint8_t UART_LSR_DR
void unserialize(CheckpointIn &cp) override
Unserialize an object.
const uint8_t UART_LSR_THRE
#define panic(...)
This implements a cprintf based panic() function.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17