Skip to content

Commit fbf6cf4

Browse files
authored
Merge pull request torvalds#766 from sulix/rust-uml
Add support for building under x86_64 User-Mode-Linux (UML)
2 parents 165a7fa + 73d4a4a commit fbf6cf4

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

arch/um/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ config UML
2424
select TRACE_IRQFLAGS_SUPPORT
2525
select TTY # Needed for line.c
2626
select HAVE_ARCH_VMAP_STACK
27+
select HAVE_RUST if X86_64
2728

2829
config MMU
2930
bool

rust/kernel/irq.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,12 @@ impl Drop for ChainedGuard<'_> {
352352
/// # Invariants
353353
///
354354
/// The pointer `Domain::ptr` is non-null and valid.
355+
#[cfg(CONFIG_IRQ_DOMAIN)]
355356
pub struct Domain {
356357
ptr: *mut bindings::irq_domain,
357358
}
358359

360+
#[cfg(CONFIG_IRQ_DOMAIN)]
359361
impl Domain {
360362
/// Constructs a new `struct irq_domain` wrapper.
361363
///

rust/kernel/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub mod sync;
8787
pub mod sysctl;
8888

8989
pub mod io_buffer;
90+
#[cfg(CONFIG_HAS_IOMEM)]
9091
pub mod io_mem;
9192
pub mod iov_iter;
9293
pub mod of;

scripts/generate_rust_target.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ fn main() {
198198
features += ",+c";
199199
}
200200
ts.push("features", features);
201-
} else if cfg.has("X86") {
201+
} else if cfg.has("X86_64") {
202202
ts.push("arch", "x86_64");
203203
ts.push(
204204
"data-layout",

0 commit comments

Comments
 (0)