From ae718d7b60e54b0b4d2480c22ab83cb6687e9759 Mon Sep 17 00:00:00 2001 From: Wenlong Zhang Date: Tue, 8 Nov 2022 09:57:40 +0800 Subject: [PATCH] Add support for loongarch64 Signed-off-by: Wenlong Zhang --- .cirrus.yml | 3 +++ README.md | 1 + src/sys/ioctl/linux.rs | 3 ++- src/sys/signal.rs | 15 ++++++++++++++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 30f1b122a2..e8b48a4126 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -288,6 +288,9 @@ task: - name: Haiku x86_64 env: TARGET: x86_64-unknown-haiku + - name: Linux loongarch64 lp64d + env: + TARGET: loongarch64-unknown-linux-gnuf64 setup_script: - rustup component add rust-src << : *BUILD diff --git a/README.md b/README.md index 7597ba0afc..6cf9326cbf 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ Tier 3: * x86_64-unknown-linux-gnux32 * x86_64-unknown-openbsd * x86_64-unknown-redox + * loongarch64-unknown-linux-gnuf64 ## Minimum Supported Rust Version (MSRV) diff --git a/src/sys/ioctl/linux.rs b/src/sys/ioctl/linux.rs index 0c0a209053..669d517906 100644 --- a/src/sys/ioctl/linux.rs +++ b/src/sys/ioctl/linux.rs @@ -42,7 +42,8 @@ mod consts { target_arch = "x86_64", target_arch = "aarch64", target_arch = "riscv32", - target_arch = "riscv64" + target_arch = "riscv64", + target_arch = "loongarch64" ))] mod consts { #[doc(hidden)] diff --git a/src/sys/signal.rs b/src/sys/signal.rs index d3746e609a..bdcb670ce3 100644 --- a/src/sys/signal.rs +++ b/src/sys/signal.rs @@ -319,7 +319,8 @@ const SIGNALS: [Signal; 28] = [ not(any( target_arch = "mips", target_arch = "mips64", - target_arch = "sparc64" + target_arch = "sparc64", + target_arch = "loongarch64" )) ))] #[cfg(feature = "signal")] @@ -360,6 +361,18 @@ const SIGNALS: [Signal; 31] = [ SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH, SIGIO, SIGSYS, SIGEMT, SIGINFO, ]; +#[cfg(all( + any(target_os = "linux"), + any(target_arch = "loongarch64") +))] +#[cfg(feature = "signal")] +const SIGNALS: [Signal; 31] = [ + SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, + SIGFPE, SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, + SIGTERM, SIGSTKFLT, SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN, + SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH, + SIGIO, SIGPWR, SIGSYS +]; feature! { #![feature = "signal"]