[dpdk-dev,v7,02/19] eal: fix PAGE_SIZE redefine complaint on freebsd

Message ID 1423970145-31985-3-git-send-email-cunming.liang@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Cunming Liang Feb. 15, 2015, 3:15 a.m. UTC
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
---
 lib/librte_eal/bsdapp/eal/eal_memory.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
  

Patch

diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c
index 65ee87d..33ebd0f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_memory.c
+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c
@@ -45,7 +45,7 @@ 
 #include "eal_internal_cfg.h"
 #include "eal_filesystem.h"
 
-#define PAGE_SIZE (sysconf(_SC_PAGESIZE))
+#define EAL_PAGE_SIZE (sysconf(_SC_PAGESIZE))
 
 /*
  * Get physical address of any mapped virtual address in the current process.
@@ -93,7 +93,8 @@  rte_eal_contigmem_init(void)
 			char physaddr_str[64];
 
 			addr = mmap(NULL, hpi->hugepage_sz, PROT_READ|PROT_WRITE,
-					MAP_SHARED, hpi->lock_descriptor, j * PAGE_SIZE);
+				    MAP_SHARED, hpi->lock_descriptor,
+				    j * EAL_PAGE_SIZE);
 			if (addr == MAP_FAILED) {
 				RTE_LOG(ERR, EAL, "Failed to mmap buffer %u from %s\n",
 						j, hpi->hugedir);
@@ -167,7 +168,8 @@  rte_eal_contigmem_attach(void)
 		struct rte_memseg *seg = &mcfg->memseg[i];
 
 		addr = mmap(seg->addr, hpi->hugepage_sz, PROT_READ|PROT_WRITE,
-				MAP_SHARED|MAP_FIXED, fd_hugepage, i * PAGE_SIZE);
+			    MAP_SHARED|MAP_FIXED, fd_hugepage,
+			    i * EAL_PAGE_SIZE);
 		if (addr == MAP_FAILED || addr != seg->addr) {
 			RTE_LOG(ERR, EAL, "Failed to mmap buffer %u from %s\n",
 				i, hpi->hugedir);