@@ -82,7 +82,7 @@ DeviceList::DeviceList() {
8282 if (ret != 4 )
8383 throw RuntimeError (" Failed to parse PCI slot number: {}" , e->d_name );
8484
85- emplace_back (std::make_shared<Device >(id, slot));
85+ emplace_back (std::make_shared<PciDevice >(id, slot));
8686 }
8787
8888 closedir (dp);
@@ -100,7 +100,7 @@ DeviceList::value_type DeviceList::lookupDevice(const Id &i) {
100100 });
101101}
102102
103- DeviceList::value_type DeviceList::lookupDevice (const Device &d) {
103+ DeviceList::value_type DeviceList::lookupDevice (const PciDevice &d) {
104104 auto dev = std::find_if (
105105 begin (), end (), [d](const DeviceList::value_type &e) { return *e == d; });
106106
@@ -247,11 +247,11 @@ bool Slot::operator==(const Slot &s) {
247247 return true ;
248248}
249249
250- bool Device ::operator ==(const Device &f) {
250+ bool PciDevice ::operator ==(const PciDevice &f) {
251251 return id == f.id && slot == f.slot ;
252252}
253253
254- std::list<Region> Device ::getRegions () const {
254+ std::list<Region> PciDevice ::getRegions () const {
255255 FILE *f;
256256 char sysfs[1024 ];
257257
@@ -311,7 +311,7 @@ std::list<Region> Device::getRegions() const {
311311 return regions;
312312}
313313
314- std::string Device ::getDriver () const {
314+ std::string PciDevice ::getDriver () const {
315315 int ret;
316316 char sysfs[1024 ], syml[1024 ];
317317 memset (syml, 0 , sizeof (syml));
@@ -331,7 +331,7 @@ std::string Device::getDriver() const {
331331 return basename (syml);
332332}
333333
334- bool Device ::attachDriver (const std::string &driver) const {
334+ bool PciDevice ::attachDriver (const std::string &driver) const {
335335 FILE *f;
336336 char fn[1024 ];
337337
@@ -363,7 +363,7 @@ bool Device::attachDriver(const std::string &driver) const {
363363 return true ;
364364}
365365
366- uint32_t Device ::readHostBar (unsigned barNum) const {
366+ uint32_t PciDevice ::readHostBar (unsigned barNum) const {
367367 auto file = openSysFs (" resource" , std::ios_base::in);
368368
369369 std::string line;
@@ -389,7 +389,7 @@ uint32_t Device::readHostBar(unsigned barNum) const {
389389 return start;
390390}
391391
392- void Device ::rewriteBar (unsigned barNum) {
392+ void PciDevice ::rewriteBar (unsigned barNum) {
393393 auto hostBar = readHostBar (barNum);
394394 auto configBar = readBar (barNum);
395395
@@ -405,7 +405,7 @@ void Device::rewriteBar(unsigned barNum) {
405405 writeBar (hostBar, barNum);
406406}
407407
408- uint32_t Device ::readBar (unsigned barNum) const {
408+ uint32_t PciDevice ::readBar (unsigned barNum) const {
409409 uint32_t addr;
410410 auto file = openSysFs (" config" , std::ios_base::in);
411411
@@ -415,14 +415,14 @@ uint32_t Device::readBar(unsigned barNum) const {
415415 return addr;
416416}
417417
418- void Device ::writeBar (uint32_t addr, unsigned barNum) {
418+ void PciDevice ::writeBar (uint32_t addr, unsigned barNum) {
419419 auto file = openSysFs (" config" , std::ios_base::out);
420420
421421 file.seekp (PCI_BASE_ADDRESS_N (barNum));
422422 file.write (reinterpret_cast <char *>(&addr), sizeof (addr));
423423}
424424
425- int Device ::getIommuGroup () const {
425+ int PciDevice ::getIommuGroup () const {
426426 int ret;
427427 char *group;
428428
@@ -443,7 +443,7 @@ int Device::getIommuGroup() const {
443443 return atoi (group);
444444}
445445
446- std::fstream Device ::openSysFs (const std::string &subPath,
446+ std::fstream PciDevice ::openSysFs (const std::string &subPath,
447447 std::ios_base::openmode mode) const {
448448 std::fstream file;
449449
0 commit comments