adevs
|
#include <adevs_qemu.h>
Classes | |
class | io_buffer |
Public Member Functions | |
int | num_bytes_to_read () |
void | read_bytes (void *buf) |
virtual void | write_bytes (void *data, int num_bytes)=0 |
virtual void | append_qemu_arguments (std::vector< std::string > &args)=0 |
virtual | ~QemuDeviceModel () |
Destructor. | |
QemuDeviceModel () | |
Constructor. | |
void | read_loop () |
Called by the reading thread to execute the read loop. | |
void | init_func () |
Protected Member Functions | |
void | start () |
virtual io_buffer * | read ()=0 |
virtual void | initialize_io_structures ()=0 |
This is the interface to be implemented by all device models that will be encapsulated in a model of the computer. The interface is written from the perspective of a person outside the computer.
|
pure virtual |
The device may append arguments to the qemu command line by appending them to this vector. Distinct elements in the vector will be separated by a space on the command line. This method should called by the simulator prior to forking qemu.
Implemented in adevs::uCsimSerialPort, adevs::QemuSerialPort, and adevs::QemuNic.
int adevs::QemuDeviceModel::num_bytes_to_read | ( | ) |
Returns the number of bytes available to be read from the device. For message oriented devices, this will be the size of the next message (e.g., an ethernet frame).
void adevs::QemuDeviceModel::read_bytes | ( | void * | buf | ) |
Copy the available data to the supplied buffer.
buf | Buffer with space sufficient to hold num_bytes_to_read() |
|
pure virtual |
Cause data to arrive at the external, physical port. This call will block if the corresponding write to the underlying file descriptor blocks.
data | Data buffer to copy to device |
num_bytes | Number of bytes to copy |
Implemented in adevs::uCsimSerialPort, adevs::QemuSerialPort, and adevs::QemuNic.