diff --git a/src/arch/aarch64/kernel/mod.rs b/src/arch/aarch64/kernel/mod.rs index a5485271966ae882932b82f7bc1f7106c188a8f9..94bdd522070626398a68055edf780050b93587cd 100644 --- a/src/arch/aarch64/kernel/mod.rs +++ b/src/arch/aarch64/kernel/mod.rs @@ -29,14 +29,14 @@ static mut COM1: SerialPort = SerialPort::new(0x800); static CPU_ONLINE: Spinlock<u32> = Spinlock::new(0); /// Kernel header to announce machine features -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] static mut BOOT_INFO: *mut BootInfo = ptr::null_mut(); -#[cfg(all(any(target_os = "none", target_os = "hermit"), not(feature = "newlib")))] +#[cfg(all(target_os = "none", not(feature = "newlib")))] #[link_section = ".data"] static mut BOOT_INFO: *mut BootInfo = ptr::null_mut(); -#[cfg(all(any(target_os = "none", target_os = "hermit"), feature = "newlib"))] +#[cfg(all(target_os = "none", feature = "newlib"))] #[link_section = ".mboot"] static mut BOOT_INFO: *mut BootInfo = ptr::null_mut(); diff --git a/src/arch/mod.rs b/src/arch/mod.rs index 8d6d741739666a4c01564439906a34165f4b0c70..ba2ad4a6667310f7caf3f806693dde9da825568d 100644 --- a/src/arch/mod.rs +++ b/src/arch/mod.rs @@ -44,11 +44,7 @@ pub use crate::arch::x86_64::*; #[cfg(target_arch = "x86_64")] pub use crate::arch::x86_64::kernel::apic::{set_oneshot_timer, wakeup_core}; -#[cfg(all( - target_arch = "x86_64", - any(target_os = "none", target_os = "hermit"), - feature = "smp" -))] +#[cfg(all(target_arch = "x86_64", target_os = "none", feature = "smp"))] pub use crate::arch::x86_64::kernel::application_processor_init; #[cfg(target_arch = "x86_64")] pub use crate::arch::x86_64::kernel::gdt::set_current_kernel_stack; @@ -64,7 +60,7 @@ pub use crate::arch::x86_64::kernel::scheduler; pub use crate::arch::x86_64::kernel::switch; #[cfg(target_arch = "x86_64")] pub use crate::arch::x86_64::kernel::systemtime::get_boot_time; -#[cfg(all(target_arch = "x86_64", any(target_os = "none", target_os = "hermit")))] +#[cfg(all(target_arch = "x86_64", target_os = "none"))] pub use crate::arch::x86_64::kernel::{boot_application_processors, boot_processor_init}; #[cfg(target_arch = "x86_64")] pub use crate::arch::x86_64::kernel::{ diff --git a/src/arch/x86_64/kernel/apic.rs b/src/arch/x86_64/kernel/apic.rs index 7c3679337b2aa7836876591821501242cca44f4f..03048c6433e2c8975b0462dfa04a1574104a69a8 100644 --- a/src/arch/x86_64/kernel/apic.rs +++ b/src/arch/x86_64/kernel/apic.rs @@ -760,7 +760,7 @@ extern "C" { /// This algorithm is derived from Intel MultiProcessor Specification 1.4, B.4, but testing has shown /// that a second STARTUP IPI and setting the BIOS Reset Vector are no longer necessary. /// This is partly confirmed by <https://wiki.osdev.org/Symmetric_Multiprocessing> -#[cfg(all(any(target_os = "none", target_os = "hermit"), feature = "smp"))] +#[cfg(all(target_os = "none", feature = "smp"))] pub fn boot_application_processors() { use include_transformed::include_nasm_bin; diff --git a/src/arch/x86_64/kernel/irq.rs b/src/arch/x86_64/kernel/irq.rs index fd9292b7b6fc647bb38b85dca16cc9f7a3b5d0c0..d8accba0ea80edf8d6a4b2ff86d185036c719eb4 100644 --- a/src/arch/x86_64/kernel/irq.rs +++ b/src/arch/x86_64/kernel/irq.rs @@ -91,7 +91,7 @@ pub fn disable() { /// were not activated before calling this function. #[inline] pub fn nested_disable() -> bool { - cfg!(any(target_os = "none", target_os = "hermit")) && { + cfg!(target_os = "none") && { let ret = rflags::read().contains(RFlags::FLAGS_IF); disable(); ret diff --git a/src/arch/x86_64/kernel/mod.rs b/src/arch/x86_64/kernel/mod.rs index e380c6fa015d4fc99cee2bab814d02d91ee8e8b5..1d9081ec34ebd8ae73a8be8f97dc2b27a1b24387 100644 --- a/src/arch/x86_64/kernel/mod.rs +++ b/src/arch/x86_64/kernel/mod.rs @@ -115,14 +115,14 @@ impl BootInfo { } /// Kernel header to announce machine features -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] static mut BOOT_INFO: *mut BootInfo = ptr::null_mut(); -#[cfg(all(any(target_os = "none", target_os = "hermit"), not(feature = "newlib")))] +#[cfg(all(target_os = "none", not(feature = "newlib")))] #[link_section = ".data"] static mut BOOT_INFO: *mut BootInfo = ptr::null_mut(); -#[cfg(all(any(target_os = "none", target_os = "hermit"), feature = "newlib"))] +#[cfg(all(target_os = "none", feature = "newlib"))] #[link_section = ".mboot"] static mut BOOT_INFO: *mut BootInfo = ptr::null_mut(); @@ -298,10 +298,7 @@ pub fn message_output_init() { } } -#[cfg(all( - not(any(target_os = "none", target_os = "hermit")), - not(target_os = "windows") -))] +#[cfg(all(not(target_os = "none"), not(target_os = "windows")))] pub fn output_message_byte(byte: u8) { extern "C" { fn write(fd: i32, buf: *const u8, count: usize) -> isize; @@ -323,7 +320,7 @@ pub fn output_message_byte(byte: u8) { } } -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] #[test] fn test_output() { output_message_byte('t' as u8); @@ -333,7 +330,7 @@ fn test_output() { output_message_byte('\n' as u8); } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] pub fn output_message_byte(byte: u8) { if env::is_single_kernel() { // Output messages to the serial port and VGA screen in unikernel mode. @@ -351,7 +348,7 @@ pub fn output_message_byte(byte: u8) { } } -//#[cfg(any(target_os = "none", target_os = "hermit"))] +//#[cfg(target_os = "none")] pub fn output_message_buf(buf: &[u8]) { for byte in buf { output_message_byte(*byte); @@ -359,7 +356,7 @@ pub fn output_message_buf(buf: &[u8]) { } /// Real Boot Processor initialization as soon as we have put the first Welcome message on the screen. -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] pub fn boot_processor_init() { processor::detect_features(); processor::configure(); @@ -406,7 +403,7 @@ pub fn boot_processor_init() { /// Boots all available Application Processors on bare-metal or QEMU. /// Called after the Boot Processor has been fully initialized along with its scheduler. -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] pub fn boot_application_processors() { #[cfg(feature = "smp")] apic::boot_application_processors(); @@ -414,7 +411,7 @@ pub fn boot_application_processors() { } /// Application Processor initialization -#[cfg(all(any(target_os = "none", target_os = "hermit"), feature = "smp"))] +#[cfg(all(target_os = "none", feature = "smp"))] pub fn application_processor_init() { percore::init(); processor::configure(); @@ -469,7 +466,7 @@ pub fn print_statistics() { } } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] #[inline(never)] #[no_mangle] unsafe fn pre_init(boot_info: &'static mut BootInfo) -> ! { diff --git a/src/arch/x86_64/kernel/percore.rs b/src/arch/x86_64/kernel/percore.rs index 160d9453986753fede74d717381e0e5821c29af2..3a36765ed3a99dceb546bb555622cc9e0c98b482 100644 --- a/src/arch/x86_64/kernel/percore.rs +++ b/src/arch/x86_64/kernel/percore.rs @@ -150,13 +150,13 @@ impl<T: Is32BitVariable> PerCoreVariableMethods<T> for PerCoreVariable<T> { } } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] #[inline] pub fn core_id() -> CoreId { unsafe { PERCORE.core_id.get() } } -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] pub fn core_id() -> CoreId { 0 } diff --git a/src/arch/x86_64/kernel/processor.rs b/src/arch/x86_64/kernel/processor.rs index 2fceeab5f630840dc50317c0f3885815c3a39664..ddba96814a2dbf091c40ea009884100185e0c5c0 100644 --- a/src/arch/x86_64/kernel/processor.rs +++ b/src/arch/x86_64/kernel/processor.rs @@ -341,14 +341,14 @@ impl CpuFrequency { pic::eoi(pit::PIT_INTERRUPT_NUMBER); } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] fn measure_frequency(&mut self) -> Result<(), ()> { // return just Ok because the real implementation must run in ring 0 self.source = CpuFrequencySources::Measurement; Ok(()) } - #[cfg(any(target_os = "none", target_os = "hermit"))] + #[cfg(target_os = "none")] fn measure_frequency(&mut self) -> Result<(), ()> { // The PIC is not initialized for uhyve, so we cannot measure anything. if env::is_uhyve() { @@ -884,7 +884,7 @@ pub fn print_information() { infofooter!(); } -/*#[cfg(not(any(target_os = "none", target_os = "hermit")))] +/*#[cfg(not(target_os = "none"))] #[test] fn print_cpu_information() { ::logging::init(); diff --git a/src/arch/x86_64/kernel/scheduler.rs b/src/arch/x86_64/kernel/scheduler.rs index aafea938247dd761dd492c755f919102a8255f85..d03ab5ecab2ea8957f8b49b09a09fc36125cf677 100644 --- a/src/arch/x86_64/kernel/scheduler.rs +++ b/src/arch/x86_64/kernel/scheduler.rs @@ -294,12 +294,12 @@ impl TaskTLS { } } -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] extern "C" fn task_start(_f: extern "C" fn(usize), _arg: usize, _user_stack: u64) -> ! { unimplemented!() } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] #[naked] extern "C" fn task_start(_f: extern "C" fn(usize), _arg: usize, _user_stack: u64) -> ! { // `f` is in the `rdi` register diff --git a/src/console.rs b/src/console.rs index 0c244160630076d1772ad746d6df23213dc695c3..25f1d0f5c592ccf9fa8a3d2d0e4250b21218eb9b 100644 --- a/src/console.rs +++ b/src/console.rs @@ -28,7 +28,7 @@ impl Console { pub static CONSOLE: SpinlockIrqSave<Console> = SpinlockIrqSave::new(Console(())); -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] #[test] fn test_console() { println!("HelloWorld"); diff --git a/src/lib.rs b/src/lib.rs index 56368541e074ab79f8ec2c132c0280135f652c0a..350f8c3d064139844cd19534292eadb450113947 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,19 +25,13 @@ #![feature(vec_into_raw_parts)] #![feature(drain_filter)] #![no_std] +#![cfg_attr(target_os = "none", feature(custom_test_frameworks))] +#![cfg_attr(target_os = "none", cfg_attr(test, test_runner(crate::test_runner)))] #![cfg_attr( - any(target_os = "none", target_os = "hermit"), - feature(custom_test_frameworks) -)] -#![cfg_attr( - any(target_os = "none", target_os = "hermit"), - cfg_attr(test, test_runner(crate::test_runner)) -)] -#![cfg_attr( - any(target_os = "none", target_os = "hermit"), + target_os = "none", cfg_attr(test, reexport_test_harness_main = "test_main") )] -#![cfg_attr(any(target_os = "none", target_os = "hermit"), cfg_attr(test, no_main))] +#![cfg_attr(target_os = "none", cfg_attr(test, no_main))] // EXTERNAL CRATES #[macro_use] @@ -46,7 +40,7 @@ extern crate alloc; extern crate bitflags; #[macro_use] extern crate log; -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] #[macro_use] extern crate std; #[cfg(target_arch = "aarch64")] @@ -90,7 +84,7 @@ mod env; pub mod errno; mod kernel_message_buffer; mod mm; -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] mod runtime_glue; mod scheduler; mod synch; @@ -103,7 +97,7 @@ pub fn _print(args: ::core::fmt::Arguments<'_>) { } #[cfg(test)] -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] #[no_mangle] extern "C" fn runtime_entry(_argc: i32, _argv: *const *const u8, _env: *const *const u8) -> ! { println!("Executing hermit unittests. Any arguments are dropped"); @@ -121,14 +115,14 @@ pub fn test_runner(tests: &[&dyn Fn()]) { sys_exit(0); } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] #[test_case] fn trivial_test() { println!("Test test test"); panic!("Test called"); } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] #[global_allocator] static ALLOCATOR: LockedHeap = LockedHeap::empty(); @@ -138,7 +132,7 @@ static ALLOCATOR: LockedHeap = LockedHeap::empty(); /// Returning a null pointer indicates that either memory is exhausted or /// `size` and `align` do not meet this allocator's size or alignment constraints. /// -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] pub(crate) extern "C" fn __sys_malloc(size: usize, align: usize) -> *mut u8 { let layout_res = Layout::from_size_align(size, align); if layout_res.is_err() || size == 0 { @@ -180,7 +174,7 @@ pub(crate) extern "C" fn __sys_malloc(size: usize, align: usize) -> *mut u8 { /// # Errors /// Returns null if the new layout does not meet the size and alignment constraints of the /// allocator, or if reallocation otherwise fails. -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] pub(crate) extern "C" fn __sys_realloc( ptr: *mut u8, size: usize, @@ -225,7 +219,7 @@ pub(crate) extern "C" fn __sys_realloc( /// /// # Errors /// May panic if debug assertions are enabled and invalid parameters `size` or `align` where passed. -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] pub(crate) extern "C" fn __sys_free(ptr: *mut u8, size: usize, align: usize) { unsafe { let layout_res = Layout::from_size_align(size, align); @@ -248,7 +242,7 @@ pub(crate) extern "C" fn __sys_free(ptr: *mut u8, size: usize, align: usize) { } } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] extern "C" { static mut __bss_start: usize; } @@ -260,7 +254,7 @@ fn has_ipdevice() -> bool { } /// Entry point of a kernel thread, which initialize the libos -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] extern "C" fn initd(_arg: usize) { extern "C" { #[cfg(not(test))] @@ -320,7 +314,7 @@ fn synch_all_cores() { } /// Entry Point of HermitCore for the Boot Processor -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] fn boot_processor_main() -> ! { // Initialize the kernel and hardware. arch::message_output_init(); @@ -383,7 +377,7 @@ fn boot_processor_main() -> ! { } /// Entry Point of HermitCore for an Application Processor -#[cfg(all(any(target_os = "none", target_os = "hermit"), feature = "smp"))] +#[cfg(all(target_os = "none", feature = "smp"))] fn application_processor_main() -> ! { arch::application_processor_init(); scheduler::add_current_core(); diff --git a/src/mm/allocator.rs b/src/mm/allocator.rs index 06a454d7f67a0cdf8aedd321bb4474de90d4c385..4759aa0264ffff3e8f9b9f66c6ccfd5c862cf32b 100644 --- a/src/mm/allocator.rs +++ b/src/mm/allocator.rs @@ -31,9 +31,9 @@ pub struct Heap { index: usize, bottom: usize, size: usize, - #[cfg(any(target_os = "none", target_os = "hermit"))] + #[cfg(target_os = "none")] holes: HoleList, - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] pub holes: HoleList, } diff --git a/src/mm/freelist.rs b/src/mm/freelist.rs index 7db3bd02fcefdaaf68e399e93569dc42017f78e7..4dd370e71c128d95ed89ee39140730d025527e71 100644 --- a/src/mm/freelist.rs +++ b/src/mm/freelist.rs @@ -190,7 +190,7 @@ impl FreeList { } } -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] #[test] fn add_element() { let mut freelist = FreeList::new(); @@ -208,7 +208,7 @@ fn add_element() { } } -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] #[test] fn allocate() { let mut freelist = FreeList::new(); @@ -241,7 +241,7 @@ fn allocate() { } } -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] #[test] fn deallocate() { let mut freelist = FreeList::new(); diff --git a/src/mm/hole.rs b/src/mm/hole.rs index cdb7f01d2b73dc91ee308b006b82c25bdeb67365..ddc58a00fbd7da8672f312729ab925f62b563224 100644 --- a/src/mm/hole.rs +++ b/src/mm/hole.rs @@ -82,7 +82,7 @@ impl HoleList { } /// Returns information about the first hole for test purposes. - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[cfg(test)] pub fn first_hole(&self) -> Option<(usize, usize)> { self.first @@ -93,13 +93,13 @@ impl HoleList { } /// A block containing free memory. It points to the next hole and thus forms a linked list. -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] pub struct Hole { size: usize, next: Option<&'static mut Hole>, } -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] pub struct Hole { pub size: usize, pub next: Option<&'static mut Hole>, diff --git a/src/mm/mod.rs b/src/mm/mod.rs index fc5e4423cab60bcab5396e540bba1ad63d77b862..810839a29cc5c064f4b85570dbc05428e3474594 100644 --- a/src/mm/mod.rs +++ b/src/mm/mod.rs @@ -71,7 +71,7 @@ fn map_heap<S: PageSize>(virt_addr: VirtAddr, size: usize) -> usize { i } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] pub fn init() { // Calculate the start and end addresses of the 2 MiB page(s) that map the kernel. unsafe { diff --git a/src/mm/test.rs b/src/mm/test.rs index dda0e9056228d41567fd4232ac751c1aadef96f6..9800af2f9440c7384d1cfc8a40467f8beee1ed53 100644 --- a/src/mm/test.rs +++ b/src/mm/test.rs @@ -5,7 +5,7 @@ // To avoid false sharing, our version allocate as smallest block 64 byte (= cache line). // In addition, for pre -#[cfg(not(any(target_os = "none", target_os = "hermit")))] +#[cfg(not(target_os = "none"))] #[cfg(test)] mod tests { use super::*; @@ -42,7 +42,7 @@ mod tests { heap } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn empty() { let mut heap = Heap::empty(); @@ -55,7 +55,7 @@ mod tests { assert!(addr.is_err()); } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn oom() { let mut heap = new_heap(); @@ -64,7 +64,7 @@ mod tests { assert!(addr.is_err()); } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn allocate_double_usize() { let mut heap = new_heap(); @@ -86,7 +86,7 @@ mod tests { } } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn allocate_and_free_double_usize() { let mut heap = new_heap(); @@ -102,7 +102,7 @@ mod tests { } } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn deallocate_right_before() { let mut heap = new_heap(); @@ -129,7 +129,7 @@ mod tests { } } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn deallocate_right_behind() { let mut heap = new_heap(); @@ -151,7 +151,7 @@ mod tests { } } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn deallocate_middle() { let mut heap = new_heap(); @@ -178,7 +178,7 @@ mod tests { } } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn reallocate_double_usize() { let mut heap = new_heap(); @@ -198,7 +198,7 @@ mod tests { assert_eq!(x, y); } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn allocate_usize() { let mut heap = new_heap(); @@ -208,7 +208,7 @@ mod tests { assert!(heap.allocate_first_fit(layout.clone()).is_ok()); } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn allocate_usize_in_bigger_block() { let mut heap = new_heap(); @@ -233,7 +233,7 @@ mod tests { } } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] // see https://github.com/phil-opp/blog_os/issues/160 fn align_from_small_to_big() { @@ -248,7 +248,7 @@ mod tests { assert!(heap.allocate_first_fit(layout_2.clone()).is_ok()); } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn extend_empty_heap() { let mut heap = new_max_heap(); @@ -262,7 +262,7 @@ mod tests { assert!(heap.allocate_first_fit(layout.clone()).is_ok()); } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn extend_full_heap() { let mut heap = new_max_heap(); @@ -277,7 +277,7 @@ mod tests { assert!(heap.allocate_first_fit(layout.clone()).is_ok()); } - #[cfg(not(any(target_os = "none", target_os = "hermit")))] + #[cfg(not(target_os = "none"))] #[test] fn extend_fragmented_heap() { let mut heap = new_max_heap(); diff --git a/src/runtime_glue.rs b/src/runtime_glue.rs index be52ca9a3a0f693f2e22a9576f45dd16539109a4..c341979fb6c1123016d4ead8e89a62b5b2cb9129 100644 --- a/src/runtime_glue.rs +++ b/src/runtime_glue.rs @@ -7,7 +7,7 @@ use core::panic::PanicInfo; use crate::arch::percore; use crate::syscalls; -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] #[panic_handler] fn panic(info: &PanicInfo<'_>) -> ! { let core_id = percore::core_id(); diff --git a/src/syscalls/interfaces/uhyve.rs b/src/syscalls/interfaces/uhyve.rs index 861d2b52ab7e12893034e6624dc61c906d105637..967232b152ba39d5691488209b30817d17311b35 100644 --- a/src/syscalls/interfaces/uhyve.rs +++ b/src/syscalls/interfaces/uhyve.rs @@ -226,7 +226,7 @@ impl SyscallInterface for Uhyve { /// /// ToDo: Add Safety section under which circumctances this is safe/unsafe to use /// ToDo: Add an Errors section - What happens when e.g. malloc fails, how is that handled (currently it isn't) - #[cfg(any(target_os = "none", target_os = "hermit"))] + #[cfg(target_os = "none")] fn get_application_parameters(&self) -> (i32, *const *const u8, *const *const u8) { // determine the number of arguments and environment variables let mut syscmdsize = SysCmdsize::new(); diff --git a/src/syscalls/mod.rs b/src/syscalls/mod.rs index c32dba9c24916c6b584413335c04d46da0ef7416..037543640135e9865fc1b4ff6d4d6b87362e91ff 100644 --- a/src/syscalls/mod.rs +++ b/src/syscalls/mod.rs @@ -6,7 +6,7 @@ use crate::env; #[cfg(feature = "newlib")] use crate::synch::spinlock::SpinlockIrqSave; use crate::syscalls::interfaces::SyscallInterface; -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] use crate::{__sys_free, __sys_malloc, __sys_realloc}; pub use self::condvar::*; @@ -71,19 +71,19 @@ pub(crate) fn init() { sbrk_init(); } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] #[no_mangle] pub extern "C" fn sys_malloc(size: usize, align: usize) -> *mut u8 { __sys_malloc(size, align) } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] #[no_mangle] pub extern "C" fn sys_realloc(ptr: *mut u8, size: usize, align: usize, new_size: usize) -> *mut u8 { __sys_realloc(ptr, size, align, new_size) } -#[cfg(any(target_os = "none", target_os = "hermit"))] +#[cfg(target_os = "none")] #[no_mangle] pub extern "C" fn sys_free(ptr: *mut u8, size: usize, align: usize) { __sys_free(ptr, size, align)