Workaround for Rust having different system for templating constants to GNU as.

Having a separate file is ugly, but it allows for a single source of truth for constants
Works for C, asm, zig and rust.

https://stackoverflow.com/questions/79840723/shared-assembly-between-rust-and-c-using-preprocessor
This commit is contained in:
Toby Jaffey 2025-12-08 10:13:53 +00:00
parent 2ccd3ac7f4
commit a88f3a1690
5 changed files with 9 additions and 4 deletions

View file

@ -9,7 +9,7 @@ use core::panic::PanicInfo;
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
// startup code
global_asm!(include_str!("../../crt0.S")/*, IOREQ_HALT = const IOREQ_HALT*/);
global_asm!(include_str!("../../crt0.S"), IOREQ_HALT = const IOREQ_HALT);
fn syscall(id: u32, n: u32) -> u32 {
let mut value;