mirror of
https://github.com/XunilGroup/XunilOS.git
synced 2026-06-02 12:44:24 +02:00
2a73c3aeb4
interrupts with IRQ and syscalls, make phys_to_virt checked, recreate stack on aarch64, make serial console finally line wrap and have max height correctly, add U64Buf for when i need number debug, rename mouse and keyboard files to kmi and merge them, add non-working pl050 support
26 lines
804 B
Rust
26 lines
804 B
Rust
use std::env;
|
|
use std::fs;
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
|
|
|
|
let timer_frequency_hz = env::var("TIMER_FREQUENCY_HZ").unwrap_or_else(|_| "1000".to_string());
|
|
|
|
let out_dir = PathBuf::from("src");
|
|
fs::write(
|
|
out_dir.join("config.rs"),
|
|
format!(r#"pub const TIMER_FREQUENCY_HZ: usize = {timer_frequency_hz};"#),
|
|
)
|
|
.unwrap();
|
|
|
|
println!("cargo:rerun-if-env-changed=KARCH");
|
|
println!("cargo:rerun-if-env-changed=TIMER_FREQUENCY_HZ");
|
|
println!("cargo:rerun-if-env-changed=OUTPUT");
|
|
|
|
// Tell cargo to pass the linker script to the linker..
|
|
println!("cargo:rustc-link-arg=-Tlinker-{arch}.ld");
|
|
// ..and to re-run if it changes.
|
|
println!("cargo:rerun-if-changed=linker-{arch}.ld");
|
|
}
|