From 7cd47680ac354382f14fd0813489d898bb8d1ced Mon Sep 17 00:00:00 2001
From: lizy <821610729@qq.com>
Date: Wed, 28 Aug 2024 09:42:08 +0800
Subject: [PATCH] Add loongarch64 support #159
---
bindings/java/hyperic_jni/jni-build.xml | 1 +
bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java | 2 +-
src/os/linux/linux_sigar.c | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/bindings/java/hyperic_jni/jni-build.xml b/bindings/java/hyperic_jni/jni-build.xml
index 7fd6a95f5..f20a71a1e 100644
--- a/bindings/java/hyperic_jni/jni-build.xml
+++ b/bindings/java/hyperic_jni/jni-build.xml
@@ -326,6 +326,7 @@
+
diff --git a/bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java b/bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java
index 4cf53924f..e95cb5b99 100644
--- a/bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java
+++ b/bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java
@@ -75,7 +75,7 @@ else if (ArchLoader.IS_AIX) {
if (ArchName.is64()) {
getProject().setProperty("jni.arch64", "true");
if (ArchLoader.IS_LINUX) {
- if (!osArch.equals("ia64")) {
+ if (!osArch.equals("ia64") && !osArch.equals("loongarch64") ) {
getProject().setProperty("jni.gccm", "-m64");
}
}
diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c
index 54f5d6039..81126804d 100644
--- a/src/os/linux/linux_sigar.c
+++ b/src/os/linux/linux_sigar.c
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#ifdef __GNU_LIBRARY__
#include
@@ -35,6 +36,7 @@
#include "sigar_util.h"
#include "sigar_os.h"
+
#define pageshift(x) ((x) << sigar->pagesize)
#define PROC_MEMINFO PROC_FS_ROOT "meminfo"