summaryrefslogtreecommitdiff
path: root/util/mem_if.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 01:42:44 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 01:42:44 +0100
commit7551a684bcbc7de7ac3d2e52eea0f9f812affd18 (patch)
tree469d3c40a1c88fcb3ec208a820f7a0fa93dca81c /util/mem_if.c
parentc71717661b7ee871e5bc957f314ad8779e85abc6 (diff)
parentee6c7128ed0d58cb1812049463a13bba9cfb31b7 (diff)
Merge tag 'upstream/2.9.7'
Upstream version 2.9.7
Diffstat (limited to 'util/mem_if.c')
-rw-r--r--util/mem_if.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/util/mem_if.c b/util/mem_if.c
index c445138..9be58a9 100644
--- a/util/mem_if.c
+++ b/util/mem_if.c
@@ -65,8 +65,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/param.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
+#ifdef __linux__
+#include <linux/param.h>
#endif
-#if defined(SOLARIS) || defined(BSD)
+#endif
+#if defined(SOLARIS) || defined(BSD) || defined(HPUX)
#define EXEC_PAGESIZE 4096
#endif
@@ -274,6 +277,11 @@ static int m_iCount = 0;
int OpenIMemoryInterface(void)
{
int rv = -1;
+/* ARM64 does not handle /dev/mem the same.
+ * It exposes SMBIOS at /sys/firmware/dmi/tables/, but because
+ * IO memory is memory mapped, cannot use legacy /dev/mem. */
+#ifndef __arm__
+#ifndef __aarch64__
//check to see if driver has been previously defined
if (!m_iDriver) { //open the driver
m_iDriver = open(MEM_DRIVER, O_RDONLY);
@@ -286,6 +294,8 @@ int OpenIMemoryInterface(void)
m_iCount++;
}
if (m_iDriver > 0) rv = 0;
+#endif
+#endif
return(rv);
}