Skip to content

Commit a263358

Browse files
committed
Make the entry_point macro only available on x86_64
Inline assembly causes build errors on other architectures. We can still run the config tests on other architectures, so we don't want to set the `target_arch` for the entire crate.
1 parent 074e17a commit a263358

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: api/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ mod version_info {
106106
/// `#[link_section = ".bootloader-config"]`, which instructs the Rust compiler to store it
107107
/// in a special section of the resulting ELF executable. From there, the bootloader will
108108
/// automatically read it when loading the kernel.
109+
#[cfg(target_arch = "x86_64")]
109110
#[macro_export]
110111
macro_rules! entry_point {
111112
($path:path) => {
@@ -139,6 +140,7 @@ macro_rules! entry_point {
139140
}
140141

141142
#[doc(hidden)]
143+
#[cfg(target_arch = "x86_64")]
142144
pub fn __force_use(slice: &&[u8; BootloaderConfig::SERIALIZED_LEN]) {
143145
let force_use = slice as *const _ as usize;
144146
unsafe { core::arch::asm!("add {0}, 0", in(reg) force_use, options(nomem, nostack)) };

0 commit comments

Comments
 (0)