#ifndef __DEV_UART8250_HH__
#define __DEV_UART8250_HH__
-#include "base/range.hh"
#include "dev/io_device.hh"
#include "dev/uart.hh"
-
+#include "params/Uart8250.hh"
/* UART8250 Interrupt ID Register
* bit 0 Interrupt Pending 0 = true, 1 = false
const uint8_t UART_MCR_LOOP = 0x10;
-class SimConsole;
+class Terminal;
class Platform;
class Uart8250 : public Uart
{
-
-
protected:
uint8_t IER, DLAB, LCR, MCR;
Tick lastTxInt;
public:
IntrEvent(Uart8250 *u, int bit);
virtual void process();
- virtual const char *description();
+ virtual const char *description() const;
void scheduleIntr();
};
IntrEvent rxIntrEvent;
public:
- Uart8250(Params *p);
-
- virtual Tick read(PacketPtr pkt);
- virtual Tick write(PacketPtr pkt);
- virtual void addressRanges(AddrRangeList &range_list);
+ typedef Uart8250Params Params;
+ const Params *
+ params() const
+ {
+ return dynamic_cast<const Params *>(_params);
+ }
+ Uart8250(const Params *p);
+ Tick read(PacketPtr pkt) override;
+ Tick write(PacketPtr pkt) override;
+ AddrRangeList getAddrRanges() const override;
/**
* Inform the uart that there is data available.
*/
- virtual void dataAvailable();
+ void dataAvailable() override;
/**
*/
virtual bool intStatus() { return status ? true : false; }
- virtual void serialize(std::ostream &os);
- virtual void unserialize(Checkpoint *cp, const std::string §ion);
-
+ void serialize(CheckpointOut &cp) const override;
+ void unserialize(CheckpointIn &cp) override;
};
#endif // __TSUNAMI_UART_HH__