Skip to content

Commit

Permalink
Fix compilation on Linux on SPARC.
Browse files Browse the repository at this point in the history
Also fix capitalization in various comments.
  • Loading branch information
sunfishcode committed Sep 5, 2024
1 parent 7c6d313 commit c4ef05f
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/backend/linux_raw/arch/mips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! On mipsel, Linux indicates success or failure using `$a3` rather
//! than by returning a negative error code as most other architectures do.
//!
//! Mips-family platforms have a special calling convention for `__NR_pipe`,
//! MIPS-family platforms have a special calling convention for `__NR_pipe`,
//! however we use `__NR_pipe2` instead to avoid having to implement it.
use crate::backend::reg::{
Expand Down
2 changes: 1 addition & 1 deletion src/backend/linux_raw/arch/mips32r6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! On mipsisa32r6el, Linux indicates success or failure using `$a3` rather
//! than by returning a negative error code as most other architectures do.
//!
//! Mips-family platforms have a special calling convention for `__NR_pipe`,
//! MIPS-family platforms have a special calling convention for `__NR_pipe`,
//! however we use `__NR_pipe2` instead to avoid having to implement it.
use crate::backend::reg::{
Expand Down
2 changes: 1 addition & 1 deletion src/backend/linux_raw/arch/mips64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! On mips64el, Linux indicates success or failure using `$a3` (`$7`) rather
//! than by returning a negative error code as most other architectures do.
//!
//! Mips-family platforms have a special calling convention for `__NR_pipe`,
//! MIPS-family platforms have a special calling convention for `__NR_pipe`,
//! however we use `__NR_pipe2` instead to avoid having to implement it.
use crate::backend::reg::{
Expand Down
2 changes: 1 addition & 1 deletion src/backend/linux_raw/arch/mips64r6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! rather than by returning a negative error code as most other architectures
//! do.
//!
//! Mips-family platforms have a special calling convention for `__NR_pipe`,
//! MIPS-family platforms have a special calling convention for `__NR_pipe`,
//! however we use `__NR_pipe2` instead to avoid having to implement it.
//!
//! Note that MIPS R6 inline assembly currently doesn't differ from MIPS,
Expand Down
2 changes: 1 addition & 1 deletion src/fs/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn ioctl_blkpbszget<Fd: AsFd>(fd: Fd) -> io::Result<u32> {

/// `ioctl(fd, FICLONE, src_fd)`—Share data between open files.
///
/// This ioctl is not available on Sparc platforms.
/// This ioctl is not available on SPARC platforms.
///
/// # References
/// - [Linux]
Expand Down
36 changes: 27 additions & 9 deletions src/termios/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1191,18 +1191,33 @@ impl core::fmt::Debug for SpecialCodeIndex {
Self::VQUIT => write!(f, "VQUIT"),
Self::VERASE => write!(f, "VERASE"),
Self::VKILL => write!(f, "VKILL"),
#[cfg(not(solarish))]
#[cfg(not(any(
solarish,
all(linux_kernel, any(target_arch = "sparc", target_arch = "sparc64"))
)))]
Self::VEOF => write!(f, "VEOF"),
#[cfg(not(solarish))]
#[cfg(not(any(
solarish,
all(linux_kernel, any(target_arch = "sparc", target_arch = "sparc64"))
)))]
Self::VTIME => write!(f, "VTIME"),
#[cfg(not(solarish))]
#[cfg(not(any(
solarish,
all(linux_kernel, any(target_arch = "sparc", target_arch = "sparc64"))
)))]
Self::VMIN => write!(f, "VMIN"),

// On Solarish platforms, `VMIN` and `VTIME` have the same value
// as `VEOF` and `VEOL`.
#[cfg(solarish)]
// On Solarish platforms, and Linux on SPARC, `VMIN` and `VTIME`
// have the same value as `VEOF` and `VEOL`.
#[cfg(any(
solarish,
all(linux_kernel, any(target_arch = "sparc", target_arch = "sparc64"))
))]
Self::VMIN => write!(f, "VMIN/VEOF"),
#[cfg(solarish)]
#[cfg(any(
solarish,
all(linux_kernel, any(target_arch = "sparc", target_arch = "sparc64"))
))]
Self::VTIME => write!(f, "VTIME/VEOL"),

#[cfg(not(any(
Expand All @@ -1217,7 +1232,10 @@ impl core::fmt::Debug for SpecialCodeIndex {
Self::VSTART => write!(f, "VSTART"),
Self::VSTOP => write!(f, "VSTOP"),
Self::VSUSP => write!(f, "VSUSP"),
#[cfg(not(solarish))]
#[cfg(not(any(
solarish,
all(linux_kernel, any(target_arch = "sparc", target_arch = "sparc64"))
)))]
Self::VEOL => write!(f, "VEOL"),
#[cfg(not(target_os = "haiku"))]
Self::VREPRINT => write!(f, "VREPRINT"),
Expand Down Expand Up @@ -1344,7 +1362,7 @@ fn termios_layouts() {

#[cfg(not(linux_raw))]
{
// On Mips, Sparc, and Android, the libc lacks the ospeed and ispeed
// On MIPS, SPARC, and Android, the libc lacks the ospeed and ispeed
// fields.
#[cfg(all(
not(all(
Expand Down
2 changes: 1 addition & 1 deletion tests/fs/ioctl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sparc lacks `FICLONE`.
// SPARC lacks `FICLONE`.
#[cfg(all(linux_kernel, not(any(target_arch = "sparc", target_arch = "sparc64"))))]
#[test]
fn test_ioctl_ficlone() {
Expand Down

0 comments on commit c4ef05f

Please sign in to comment.