Commit 07b3aa54 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

lib/nicbm: pointer to runner in device base class

All devices will somehow need this, might as well stick it in the base
class.
parent b72b8a52
...@@ -475,6 +475,7 @@ void Runner::EventTrigger() { ...@@ -475,6 +475,7 @@ void Runner::EventTrigger() {
Runner::Runner(Device &dev) : dev_(dev), events_(EventCmp()) { Runner::Runner(Device &dev) : dev_(dev), events_(EventCmp()) {
// mac_addr = lrand48() & ~(3ULL << 46); // mac_addr = lrand48() & ~(3ULL << 46);
dma_pending_ = 0; dma_pending_ = 0;
dev_.runner_ = this;
int rfd; int rfd;
if ((rfd = open("/dev/urandom", O_RDONLY)) < 0) { if ((rfd = open("/dev/urandom", O_RDONLY)) < 0) {
......
...@@ -63,6 +63,8 @@ class Runner { ...@@ -63,6 +63,8 @@ class Runner {
public: public:
class Device { class Device {
protected: protected:
friend class Runner;
Runner *runner_;
bool int_intx_en_; bool int_intx_en_;
bool int_msi_en_; bool int_msi_en_;
bool int_msix_en_; bool int_msix_en_;
......
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