Skip to content

Latest commit

 

History

History
230 lines (135 loc) · 4.25 KB

File metadata and controls

230 lines (135 loc) · 4.25 KB

Device

#include <device.hpp>

struct Device

Defined in include/device.hpp:31

Inherits: enable_shared_from_this< Device > Subclassed by: CLINT, I2C, PLIC, SYSCON, UART, VirtIO_BLK

Device base structure.

List of all members

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

Public Attributes

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.

mmap

rv64vm::runner::MemoryMap * mmap

Defined in include/device.hpp:45

MMAP pointer.

Note

Defined by constructor


start

uint64_t start

Defined in include/device.hpp:50

Device memory start address.

Note

Defined by constructor


size

uint64_t size

Defined in include/device.hpp:55

Device memory size.

Note

Defined by constructor


end

uint64_t end

Defined in include/device.hpp:60

Device memory end address.

Note

Defined by constructor

Public Methods

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.

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.


read

virtual inline

virtual inline uint64_t read(uint64_t addr, MemorySize size)

Defined in include/device.hpp:65

Device read function.

Reimplemented by


write

virtual inline

virtual inline void write(uint64_t addr, MemorySize size, uint64_t val)

Defined in include/device.hpp:69

Device write function.

Reimplemented by


tick

virtual inline

virtual inline void tick()

Defined in include/device.hpp:74

Device tick function.

This function would call almost(optimization) every tick

Reimplemented by


get

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.