Skip to content

Commit d4015e8

Browse files
Refactor: change namespace pci to devices
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
1 parent 46425a3 commit d4015e8

File tree

14 files changed

+23
-22
lines changed

14 files changed

+23
-22
lines changed

common/include/villas/kernel/devices/pci_device.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace villas {
1919
namespace kernel {
20-
namespace pci {
20+
namespace devices {
2121

2222
#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
2323
#define PCI_FUNC(devfn) ((devfn) & 0x07)
@@ -125,6 +125,6 @@ class PciDeviceList : public std::list<std::shared_ptr<PciDevice>> {
125125
PciDeviceList::value_type lookupDevice(const PciDevice &f);
126126
};
127127

128-
} // namespace pci
128+
} // namespace devices
129129
} // namespace kernel
130130
} // namespace villas

common/include/villas/kernel/vfio_container.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Container {
4949
std::shared_ptr<Group> getOrAttachGroup(int index);
5050

5151
std::shared_ptr<Device> attachDevice(const std::string &name, int groupIndex);
52-
std::shared_ptr<Device> attachDevice(pci::PciDevice &pdev);
52+
std::shared_ptr<Device> attachDevice(devices::PciDevice &pdev);
5353

5454
// Map VM to an IOVA, which is accessible by devices in the container
5555
//

common/include/villas/kernel/vfio_device.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace vfio {
2929
class Device {
3030
public:
3131
Device(const std::string &name, int groupFileDescriptor,
32-
const kernel::pci::PciDevice *pci_device = nullptr);
32+
const kernel::devices::PciDevice *pci_device = nullptr);
3333
~Device();
3434

3535
// No copying allowed because we manage the vfio state in constructor and destructors
@@ -89,7 +89,7 @@ class Device {
8989
std::vector<void *> mappings;
9090

9191
// libpci handle of the device
92-
const kernel::pci::PciDevice *pci_device;
92+
const kernel::devices::PciDevice *pci_device;
9393

9494
Logger log;
9595
};

common/include/villas/kernel/vfio_group.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Group {
4848
std::shared_ptr<Device> attachDevice(std::shared_ptr<Device> device);
4949
std::shared_ptr<Device>
5050
attachDevice(const std::string &name,
51-
const kernel::pci::PciDevice *pci_device = nullptr);
51+
const kernel::devices::PciDevice *pci_device = nullptr);
5252

5353
bool checkStatus();
5454
void dump();

common/lib/kernel/devices/pci_device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <villas/kernel/devices/pci_device.hpp>
2222
#include <villas/utils.hpp>
2323

24-
using namespace villas::kernel::pci;
24+
using namespace villas::kernel::devices;
2525

2626
#define PCI_BASE_ADDRESS_N(n) (PCI_BASE_ADDRESS_0 + sizeof(uint32_t) * (n))
2727

common/lib/kernel/vfio_container.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ std::shared_ptr<Device> Container::attachDevice(const std::string &name,
187187
return device;
188188
}
189189

190-
std::shared_ptr<Device> Container::attachDevice(pci::PciDevice &pdev) {
190+
std::shared_ptr<Device> Container::attachDevice(devices::PciDevice &pdev) {
191191
int ret;
192192
char name[32], iommu_state[4];
193193
static constexpr const char *kernelDriver = "vfio-pci";

common/lib/kernel/vfio_device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static const char *vfio_pci_irq_names[] = {
5353
};
5454

5555
Device::Device(const std::string &name, int groupFileDescriptor,
56-
const kernel::pci::PciDevice *pci_device)
56+
const kernel::devices::PciDevice *pci_device)
5757
: name(name), fd(-1), attachedToGroup(false), groupFd(groupFileDescriptor),
5858
info(), irqs(), regions(), mappings(), pci_device(pci_device),
5959
log(Log::get("kernel:vfio:device")) {

common/lib/kernel/vfio_group.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ std::shared_ptr<Device> Group::attachDevice(std::shared_ptr<Device> device) {
6868

6969
std::shared_ptr<Device>
7070
Group::attachDevice(const std::string &name,
71-
const kernel::pci::PciDevice *pci_device) {
71+
const kernel::devices::PciDevice *pci_device) {
7272
auto device = std::make_shared<Device>(name, fd, pci_device);
7373
return attachDevice(device);
7474
}

fpga/include/villas/fpga/pcie_card.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class PCIeCard : public Card {
5555
bool doReset; // Reset VILLASfpga during startup?
5656
int affinity; // Affinity for MSI interrupts
5757

58-
std::shared_ptr<kernel::pci::PciDevice> pdev; // PCI device handle
58+
std::shared_ptr<kernel::devices::PciDevice> pdev; // PCI device handle
5959

6060
protected:
6161
Logger getLogger() const { return villas::Log::get(name); }

fpga/lib/dma.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
using namespace villas;
2323

24-
static std::shared_ptr<kernel::pci::PciDeviceList> pciDevices;
24+
static std::shared_ptr<kernel::devices::PciDeviceList> pciDevices;
2525
static auto logger = villas::Log::get("villasfpga_dma");
2626

2727
struct villasfpga_handle_t {

0 commit comments

Comments
 (0)