Skip to content

Commit

Permalink
fix compilation in PCM_USE_PCI_MM_LINUX mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rdementi authored and opcm committed Dec 20, 2018
1 parent 5847f63 commit 4ce8d36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ klocwork: $(EXE)

CXXFLAGS += -Wall -g -O3 -Wno-unknown-pragmas

# uncomment if your Linux kernel supports access to /dev/mem from user space
# CXXFLAGS += -DPCM_USE_PCI_MM_LINUX

# rely on Linux perf support (user needs CAP_SYS_ADMIN privileges), comment out to disable
ifneq ($(wildcard /usr/include/linux/perf_event.h),)
CXXFLAGS += -DPCM_USE_PERF
Expand Down
4 changes: 2 additions & 2 deletions pci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,6 @@ PciHandle::~PciHandle()
if (fd >= 0) ::close(fd);
}

#ifndef PCM_USE_PCI_MM_LINUX

int PciHandle::openMcfgTable() {
const char* path = "/sys/firmware/acpi/tables/MCFG";
int handle = ::open(path, O_RDONLY);
Expand All @@ -450,6 +448,8 @@ int PciHandle::openMcfgTable() {
return handle;
}

#ifndef PCM_USE_PCI_MM_LINUX

PciHandleM::PciHandleM(uint32 bus_, uint32 device_, uint32 function_) :
fd(-1),
bus(bus_),
Expand Down

0 comments on commit 4ce8d36

Please sign in to comment.