Skip to content

Commit

Permalink
Add support for loongarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangwenlong8911 committed Jun 13, 2022
1 parent 5dedbc7 commit 61256c1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Tier 3:
* x86_64-unknown-linux-gnux32
* x86_64-unknown-openbsd
* x86_64-unknown-redox
* loongarch64-unknown-linux-gnu

## Minimum Supported Rust Version (MSRV)

Expand Down
3 changes: 2 additions & 1 deletion src/sys/ioctl/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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)]
pub const NONE: u8 = 0;
Expand Down
13 changes: 9 additions & 4 deletions src/sys/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ libc_enum!{
#[cfg(all(any(target_os = "android", target_os = "emscripten",
target_os = "fuchsia", target_os = "linux"),
not(any(target_arch = "mips", target_arch = "mips64",
target_arch = "sparc64"))))]
target_arch = "sparc64",
target_arch = "loongarch64"))))]
SIGSTKFLT,
/// To parent on child stop or exit
SIGCHLD,
Expand Down Expand Up @@ -138,7 +139,8 @@ impl FromStr for Signal {
#[cfg(all(any(target_os = "android", target_os = "emscripten",
target_os = "fuchsia", target_os = "linux"),
not(any(target_arch = "mips", target_arch = "mips64",
target_arch = "sparc64"))))]
target_arch = "sparc64",
target_arch = "loongarch64"))))]
"SIGSTKFLT" => Signal::SIGSTKFLT,
"SIGCHLD" => Signal::SIGCHLD,
"SIGCONT" => Signal::SIGCONT,
Expand Down Expand Up @@ -197,7 +199,9 @@ impl Signal {
Signal::SIGTERM => "SIGTERM",
#[cfg(all(any(target_os = "android", target_os = "emscripten",
target_os = "fuchsia", target_os = "linux"),
not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))]
not(any(target_arch = "mips", target_arch = "mips64",
target_arch = "sparc64",
target_arch = "loongarch64"))))]
Signal::SIGSTKFLT => "SIGSTKFLT",
Signal::SIGCHLD => "SIGCHLD",
Signal::SIGCONT => "SIGCONT",
Expand Down Expand Up @@ -312,7 +316,8 @@ const SIGNALS: [Signal; 28] = [
#[cfg(all(any(target_os = "linux", target_os = "android",
target_os = "emscripten", target_os = "fuchsia"),
not(any(target_arch = "mips", target_arch = "mips64",
target_arch = "sparc64"))))]
target_arch = "sparc64",
target_arch = "loongarch64"))))]
#[cfg(feature = "signal")]
const SIGNALS: [Signal; 31] = [
SIGHUP,
Expand Down

0 comments on commit 61256c1

Please sign in to comment.