adevs
|
#include <adevs_qemu.h>
Classes | |
class | io_buffer |
Public Member Functions | |
int | num_bytes_to_read () |
void | read_bytes (void *buf) |
void | write_bytes (void *data, int num_bytes) |
virtual void | append_qemu_arguments (std::vector< std::string > &args)=0 |
void | read_loop () |
void | write_loop () |
void | init_func () |
Public Attributes | |
volatile bool | _is_done_with_init |
Protected Member Functions | |
void | start () |
virtual io_buffer * | read ()=0 |
virtual void | write (void *data, int num_bytes)=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 |
Arguments to be appended to the qemu argument vector when qemu is forked to simulate the computer.
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.
void adevs::QemuDeviceModel::write_bytes | ( | void * | data, |
int | num_bytes | ||
) |
Cause data to arrive at the external, physical port. This call will block if the corresponding write to the underlying file descriptor blocks.