Commit 2f6e1d50 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

libnicbm: nits

parent 4e277b38
...@@ -8,14 +8,21 @@ extern "C" { ...@@ -8,14 +8,21 @@ extern "C" {
static const size_t MAX_DMA_LEN = 2048; static const size_t MAX_DMA_LEN = 2048;
struct DMAOp { class DMAOp {
bool write; public:
uint64_t dma_addr; virtual ~DMAOp() { }
size_t len; bool write;
void *data; uint64_t dma_addr;
size_t len;
void *data;
}; };
/**
* The Runner drives the main simulation loop. It's initialized with a reference
* to a device it should manage, and then once `runMain` is called, it will
* start interacting with the PCI and Ethernet queue and forwarding calls to the
* device as needed.
* */
class Runner { class Runner {
public: public:
class Device { class Device {
...@@ -73,7 +80,7 @@ class Runner { ...@@ -73,7 +80,7 @@ class Runner {
public: public:
Runner(Device &dev_); Runner(Device &dev_);
/** */ /** Run the simulation */
int runMain(int argc, char *argv[]); int runMain(int argc, char *argv[]);
/* these three are for `Runner::Device`. */ /* these three are for `Runner::Device`. */
...@@ -82,7 +89,9 @@ class Runner { ...@@ -82,7 +89,9 @@ class Runner {
void eth_send(const void *data, size_t len); void eth_send(const void *data, size_t len);
}; };
/* Very simple device that just has one register size */ /**
* Very simple device that just has one register size.
*/
template <class TReg = uint32_t> template <class TReg = uint32_t>
class SimpleDevice : public Runner::Device { class SimpleDevice : public Runner::Device {
public: public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment