#include <device.hpp>
struct DeviceDefined in include/device.hpp:31
Inherits:
enable_shared_from_this< Device >Subclassed by:CLINT,I2C,PLIC,SYSCON,UART,VirtIO_BLK
Device base structure.
| Name | Kind | Owner |
|---|---|---|
mmap |
variable |
Declared here |
start |
variable |
Declared here |
size |
variable |
Declared here |
end |
variable |
Declared here |
Device |
function |
Declared here |
read |
function |
Declared here |
write |
function |
Declared here |
tick |
function |
Declared here |
get |
function |
Declared here |
| Return | Name | Description |
|---|---|---|
rv64vm::runner::MemoryMap * |
mmap |
MMAP pointer. |
uint64_t |
start |
Device memory start address. |
uint64_t |
size |
Device memory size. |
uint64_t |
end |
Device memory end address. |
rv64vm::runner::MemoryMap * mmapDefined in include/device.hpp:45
MMAP pointer.
Note
Defined by constructor
uint64_t startDefined in include/device.hpp:50
Device memory start address.
Note
Defined by constructor
uint64_t sizeDefined in include/device.hpp:55
Device memory size.
Note
Defined by constructor
uint64_t endDefined in include/device.hpp:60
Device memory end address.
Note
Defined by constructor
| Return | Name | Description |
|---|---|---|
Device inline |
Device constructor. | |
uint64_t |
read virtual inline |
Device read function. |
void |
write virtual inline |
Device write function. |
void |
tick virtual inline |
Device tick function. |
std::shared_ptr< T > |
get inline |
Returns device. |
inline
inline Device(uint64_t start, uint64_t size, fdt_node * fdt, rv64vm::runner::MemoryMap * mmap)Defined in include/device.hpp:37
Device constructor.
Note
You must run all FDT functions here.
virtual inline
virtual inline uint64_t read(uint64_t addr, MemorySize size)Defined in include/device.hpp:65
Device read function.
virtual inline
virtual inline void write(uint64_t addr, MemorySize size, uint64_t val)Defined in include/device.hpp:69
Device write function.
virtual inline
virtual inline void tick()Defined in include/device.hpp:74
Device tick function.
This function would call almost(optimization) every tick
inline
template<typenameT> inline std::shared_ptr< T > get()Defined in include/device.hpp:81
Returns device.
Warning
You would break something if you overwrite this.