From 5bf41b194b61563e8cd21b2099795ffd327e9aea Mon Sep 17 00:00:00 2001
From: mahailiang <mahailiang@uniontech.com>
Date: Mon, 25 Nov 2024 22:04:21 +0800
Subject: [PATCH] add sw_64 support

---
 src/main/java/com/kenai/jffi/Platform.java            | 4 ++++
 src/main/java/com/kenai/jffi/internal/StubLoader.java | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/main/java/com/kenai/jffi/Platform.java b/src/main/java/com/kenai/jffi/Platform.java
index 8850426..87f49bd 100644
--- a/src/main/java/com/kenai/jffi/Platform.java
+++ b/src/main/java/com/kenai/jffi/Platform.java
@@ -102,6 +102,7 @@ public abstract class Platform {
         ARM(32),
         /** AARCH64 */
         AARCH64(64),
+	SW64(64),
        /** MIPS64EL */
         MIPS64EL(64),
         /** Unknown CPU */
@@ -238,6 +239,9 @@ public abstract class Platform {
             } else if (Util.equalsIgnoreCase("aarch64", archString, LOCALE)) {
                 return CPU.AARCH64;
 
+            } else if (Util.equalsIgnoreCase("sw64", archString, LOCALE) || Util.equalsIgnoreCase("sw_64", archString, LOCALE)) {
+                return CPU.SW64;
+
             } else if (Util.equalsIgnoreCase("mips64", archString, LOCALE) || Util.equalsIgnoreCase("mips64el", archString, LOCALE)) {
                 return CPU.MIPS64EL;
             }
diff --git a/src/main/java/com/kenai/jffi/internal/StubLoader.java b/src/main/java/com/kenai/jffi/internal/StubLoader.java
index 77da24d..c0ed42b 100644
--- a/src/main/java/com/kenai/jffi/internal/StubLoader.java
+++ b/src/main/java/com/kenai/jffi/internal/StubLoader.java
@@ -142,6 +142,8 @@ public class StubLoader {
         ARM,
         /** AArch64 */
         AARCH64,
+	/** sw_64 */
+	SW64,
         /** MIPS 64-bit little endian */
         MIPS64EL,
         /** Unknown CPU */
@@ -208,6 +210,8 @@ public class StubLoader {
             return CPU.ARM;
         } else if (Util.equalsIgnoreCase("aarch64", archString, LOCALE)) {
             return CPU.AARCH64;
+        } else if (Util.equalsIgnoreCase("sw64", archString, LOCALE) || Util.equalsIgnoreCase("sw_64", archString, LOCALE)) {
+            return CPU.SW64;
         } else if (Util.equalsIgnoreCase("mips64", archString, LOCALE) || Util.equalsIgnoreCase("mips64el", archString, LOCALE)) {
             return CPU.MIPS64EL;
 
-- 
2.20.1
