[1/2] linux-gen: shm: fix init on systems not supporting huge pages

Message ID 1496069179-10504-1-git-send-email-matias.elo@nokia.com
State New
Headers show
Series
  • [1/2] linux-gen: shm: fix init on systems not supporting huge pages
Related show

Commit Message

Matias Elo May 29, 2017, 2:46 p.m.
Align _ODP_ISHM_SINGLE_VA address space to system page size
if huge pages are not supported. Fixes _odp_ishm_init_global()
failing on systems without huge page support.

Signed-off-by: Matias Elo <matias.elo@nokia.com>

---
 platform/linux-generic/_ishm.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.7.4

Patch hide | download patch | download mbox

diff --git a/platform/linux-generic/_ishm.c b/platform/linux-generic/_ishm.c
index c1efd7d..303a131 100644
--- a/platform/linux-generic/_ishm.c
+++ b/platform/linux-generic/_ishm.c
@@ -1419,6 +1419,8 @@  int _odp_ishm_init_global(void)
 	 * only address space!
 	 */
 	spce_addr = _odp_ishmphy_book_va(ODP_CONFIG_ISHM_VA_PREALLOC_SZ,
+					 (odp_sys_huge_page_size() == 0) ?
+					 odp_sys_page_size() :
 					 odp_sys_huge_page_size());
 	if (!spce_addr) {
 		ODP_ERR("unable to reserve virtual space\n.");