⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tulip.hh

📁 一个mips虚拟机非常好代码,使用C++来编写的,希望大家多学学,
💻 HH
字号:
#ifndef tulip_hh_included#define tulip_hh_included#include <pcidevice.hh>#include "tulip_types.hh"#define PCI_VENDOR_ID_DEC		0x1011#define PCI_DEVICE_ID_DEC_TULIP_PLUS	0x0014#define PCI_CLASS_NETWORK_ETHERNET	0x0200class Tulip    : public Module, public PCIDevice, public IOListener{private:    static SerialType<Tulip> type;    enum {	IRQ_TI = (1 << 0),	IRQ_TU = (1 << 2),	IRQ_RI = (1 << 6),	IRQ_RU = (1 << 7),	IRQ_AIS = (1 << 15),	IRQ_NIS = (1 << 16)    };    UInt32 irq_status, irq_mask;    UInt8 tx_buffer[1518];    UInt32 tx_base, tx_next, tx_offset;    UInt32 rx_base, rx_next;    union bus_mode bus_mode;    union op_mode op_mode;    union srom_mii srom_mii;    static const int srom_address_bits = 6;    UInt16 srom[1 << srom_address_bits];    UInt16 srom_in, srom_out;    int tap_fd;    void read_uint32(UInt32 address, UInt32 *value);    void write_uint32(UInt32 address, UInt32 value);    void tx_fragment(UInt32 address, UInt32 length);    void tx_frame();    void tx_poll();    void rx_fragment(UInt32 address, UInt32 length, UInt8 *buffer, UInt32 &offset, UInt32 &remaining);    void rx_input(UInt8 *buffer, UInt32 length);    void check_interrupts();    void setup_tap();public:    void io_poll();    // Constructors, etc.    Tulip(const SimArgs& args);    Tulip(Checkpoint& cp);    // Module interfaces.    void reset(bool warm);    // Serialization information.    void checkpoint(Checkpoint& cp, bool parent = false) const;        // Device access    void init(Bus *bus, InterruptSink *intctrl, UInt64 base_address, UInt64 size, int base_irq);    ClockValue read(UInt64 addr, UInt64* buf, int size);    ClockValue write(UInt64 addr, const UInt64* buf, int size);};#endif // tulip_hh_included

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -