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:41 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 01:42:41 +0100
commitee6c7128ed0d58cb1812049463a13bba9cfb31b7 (patch)
tree39b80b4d29c70262a7a6f3443e4acb6bd592b287 /util/mem_if.c
parentb18f5bf2db0fba2e7e539f68645836036d940d26 (diff)
Imported Upstream version 2.9.7upstream/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);
}