mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-12 05:55:37 +00:00
parent
9de81369a7
commit
f2188bd397
@ -64,6 +64,23 @@ class Vmm::Virtio_console : public Virtio_device<Virtio_split_queue, 2>
|
|||||||
|
|
||||||
enum Device_id { CONSOLE = 0x3 };
|
enum Device_id { CONSOLE = 0x3 };
|
||||||
|
|
||||||
|
struct Config_area : Reg
|
||||||
|
{
|
||||||
|
Register read(Address_range & range, Cpu&) override
|
||||||
|
{
|
||||||
|
switch (range.start) {
|
||||||
|
case 4: return 1; /* maximum ports */
|
||||||
|
default: ;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void write(Address_range & range, Cpu&, Register v) override {}
|
||||||
|
|
||||||
|
Config_area(Virtio_console & console)
|
||||||
|
: Reg(console, "ConfigArea", Mmio_register::RW, 0x100, 12) { }
|
||||||
|
} _config_area { *this };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Virtio_console(const char * const name,
|
Virtio_console(const char * const name,
|
||||||
|
@ -318,6 +318,13 @@ class Vmm::Virtio_device : public Vmm::Mmio_device, public Virtio_device_base
|
|||||||
Set _device_low { *this, _queue_sel, "QueueDeviceLow", Reg::WO, 0xa0 };
|
Set _device_low { *this, _queue_sel, "QueueDeviceLow", Reg::WO, 0xa0 };
|
||||||
Set _device_high { *this, _queue_sel, "QueueDeviceHigh", Reg::WO, 0xa4 };
|
Set _device_high { *this, _queue_sel, "QueueDeviceHigh", Reg::WO, 0xa4 };
|
||||||
|
|
||||||
|
Reg _shm_id { *this, "SHMSel", Reg::WO, 0xac };
|
||||||
|
Reg _shm_len_low { *this, "SHMLenLow", Reg::RO, 0xb0, 0xffffffff };
|
||||||
|
Reg _shm_len_high { *this, "SHMLenHigh", Reg::RO, 0xb4, 0xffffffff };
|
||||||
|
Reg _shm_base_low { *this, "SHMBaseLow", Reg::RO, 0xb8, 0xffffffff };
|
||||||
|
Reg _shm_base_high { *this, "SHMBaseHigh", Reg::RO, 0xbc, 0xffffffff };
|
||||||
|
Reg _config_gen { *this, "ConfigGeneration", Reg::RW, 0xfc, 0 };
|
||||||
|
|
||||||
|
|
||||||
uint64_t _descriptor_area() const
|
uint64_t _descriptor_area() const
|
||||||
{
|
{
|
||||||
@ -432,6 +439,7 @@ class Vmm::Virtio_device : public Vmm::Mmio_device, public Virtio_device_base
|
|||||||
}
|
}
|
||||||
|
|
||||||
Genode::Mutex & mutex() { return _mutex; }
|
Genode::Mutex & mutex() { return _mutex; }
|
||||||
|
void config_has_changed() { _config_gen.set(_config_gen.get() + 1); }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _VIRTIO_DEVICE_H_ */
|
#endif /* _VIRTIO_DEVICE_H_ */
|
||||||
|
@ -130,8 +130,10 @@ class Vmm::Virtio_net : public Virtio_device<Virtio_split_queue, 2>
|
|||||||
return mac.addr[range.start];
|
return mac.addr[range.start];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void write(Address_range & range, Cpu&, Register v) override {}
|
||||||
|
|
||||||
Config_area(Virtio_net & device, Nic::Mac_address & mac)
|
Config_area(Virtio_net & device, Nic::Mac_address & mac)
|
||||||
: Reg(device, "ConfigArea", Mmio_register::RO, 0x100, 8),
|
: Reg(device, "ConfigArea", Mmio_register::RW, 0x100, 24),
|
||||||
mac(mac)
|
mac(mac)
|
||||||
{ }
|
{ }
|
||||||
} _config_area { *this, _mac };
|
} _config_area { *this, _mac };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user