Skip to content

Commit

Permalink
docs: relax target cfg's to show all architectures in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Qix- committed Dec 26, 2024
1 parent 21e4cd3 commit 8185016
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion oro-arch-aarch64/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//! preboot environment, as the preboot environment MUST NOT rely on TTBR0 for any resource
//! allocation or mapping.
#![no_std]
#![cfg(not(all(doc, not(target_arch = "aarch64"))))]
#![cfg(any(doc, target_arch = "aarch64"))]
#![expect(internal_features)]
#![feature(core_intrinsics)]
// SAFETY(qix-): It's probably accepted, and I want to refactor the
Expand Down
2 changes: 1 addition & 1 deletion oro-arch-x86_64/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
//! once it has booted.
#![no_std]
#![expect(internal_features)]
#![cfg(not(all(doc, not(target_arch = "x86_64"))))]
#![cfg(any(doc, target_arch = "x86_64"))]
#![feature(naked_functions, core_intrinsics)]
// SAFETY(qix-): This is accepted, but moving slowly (in fact, probably the slowest
// SAFETY(qix-): I've seen - predates Rust 1.0). It simplifies the amount of `#[allow]`
Expand Down
5 changes: 5 additions & 0 deletions oro-boot/src/target/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
// NOTE(qix-): on archs instead of the current method, but this is the
// NOTE(qix-): simplest way to do it for now.

// NOTE(qix-): Documenting this with `#[cfg(any(doc, ...))]` doesn't work
// NOTE(qix-): since 1) --cfg doc isn't passed to dependencies, and
// NOTE(qix-): 2) we're exporting the same symbol names based on the arch,
// NOTE(qix-): which causes naming conflicts when generating multi-arch docs.

#[cfg(target_arch = "aarch64")]
mod aarch64;
#[cfg(target_arch = "x86_64")]
Expand Down
2 changes: 1 addition & 1 deletion oro-dbgutil/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub extern "C" fn __oro_dbgutil_kernel_will_transfer() {
/// `PAR_EL1`.
///
/// Pass the virtual address to translate in `x0`.
#[cfg(target_arch = "aarch64")]
#[cfg(any(doc, target_arch = "aarch64"))]
#[link_section = ".text.force_keep"]
#[no_mangle]
#[naked]
Expand Down
2 changes: 1 addition & 1 deletion oro-debug-uart16550/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Early-stage debugging support for the 16550 UART on x86_64
#![cfg_attr(not(test), no_std)]
#![cfg(target_arch = "x86_64")]
#![cfg(any(doc, target_arch = "x86_64"))]
#![cfg_attr(doc, feature(doc_cfg, doc_auto_cfg))]

use core::fmt::{self, Write};
Expand Down

0 comments on commit 8185016

Please sign in to comment.