summaryrefslogtreecommitdiff
path: root/util/mem_if.c
diff options
context:
space:
mode:
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);
}