diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c759f8d2..80d38953 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,9 @@ jobs: ## ARMv6 - { os: 'ubuntu-latest', target: 'arm-unknown-linux-gnueabihf', cross: true } - { os: 'ubuntu-latest', target: 'arm-unknown-linux-musleabihf', cross: true } + ## LOONGARCH64 + - { os: 'ubuntu-latest', target: 'loongarch64-unknown-linux-gnu', cross: true } + toolchain: - 1.46.0 # MSRV - stable diff --git a/heim-host/src/os/linux.rs b/heim-host/src/os/linux.rs index 01fb44c4..d7c9ef6b 100644 --- a/heim-host/src/os/linux.rs +++ b/heim-host/src/os/linux.rs @@ -5,8 +5,8 @@ use std::net::IpAddr; use crate::Pid; cfg_if::cfg_if! { - // aarch64-unknown-linux-gnu has different type - if #[cfg(all(target_arch = "aarch64", not(target_family = "musl")))] { + // aarch64-unknown-linux-gnu and loongarch64-unknown-linux-gnu has different type + if #[cfg(all(any(target_arch = "aarch64", target_arch = "loongarch64"), not(target_family = "musl")))] { /// User session ID. pub type SessionId = i64; } else { diff --git a/heim-virt/src/sys/linux/device_tree.rs b/heim-virt/src/sys/linux/device_tree.rs index daad422c..20d5858f 100644 --- a/heim-virt/src/sys/linux/device_tree.rs +++ b/heim-virt/src/sys/linux/device_tree.rs @@ -6,7 +6,8 @@ use heim_common::prelude::StreamExt; target_arch = "arm", target_arch = "aarch64", target_arch = "powerpc", - target_arch = "powerpc64" + target_arch = "powerpc64", + target_arch = "loongarch64" ))] use heim_common::prelude::TryFutureExt; use heim_runtime as rt; @@ -54,7 +55,8 @@ where target_arch = "arm", target_arch = "aarch64", target_arch = "powerpc", - target_arch = "powerpc64" + target_arch = "powerpc64", + target_arch = "loongarch64" ))] pub async fn detect_vm_device_tree() -> Result { hypervisor(HYPERVISOR_COMPAT_PATH) @@ -66,7 +68,8 @@ pub async fn detect_vm_device_tree() -> Result { target_arch = "arm", target_arch = "aarch64", target_arch = "powerpc", - target_arch = "powerpc64" + target_arch = "powerpc64", + target_arch = "loongarch64" )))] pub async fn detect_vm_device_tree() -> Result { Err(()) diff --git a/heim-virt/src/sys/linux/dmi.rs b/heim-virt/src/sys/linux/dmi.rs index bb18794a..8d6b4823 100644 --- a/heim-virt/src/sys/linux/dmi.rs +++ b/heim-virt/src/sys/linux/dmi.rs @@ -6,7 +6,8 @@ use crate::Virtualization; target_arch = "x86", target_arch = "x86_64", target_arch = "arm", - target_arch = "aarch64" + target_arch = "aarch64", + target_arch = "loongarch64" ))] pub async fn detect_vm_dmi() -> Result { let probe_files = vec![ @@ -43,7 +44,8 @@ pub async fn detect_vm_dmi() -> Result { target_arch = "x86", target_arch = "x86_64", target_arch = "arm", - target_arch = "aarch64" + target_arch = "aarch64", + target_arch = "loongarch64" )))] pub async fn detect_vm_dmi() -> Result { Err(())