Skip to content

Commit

Permalink
feat(newlib): remove lwIP support
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening authored and CarlWachter committed May 31, 2024
1 parent f6cdf9d commit 0bf4f1d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 60 deletions.
4 changes: 2 additions & 2 deletions src/arch/aarch64/mm/paging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ pub fn virtual_to_physical(virtual_address: VirtAddr) -> Option<PhysAddr> {
get_physical_address::<BasePageSize>(virtual_address)
}

#[no_mangle]
pub extern "C" fn virt_to_phys(virtual_address: VirtAddr) -> PhysAddr {
#[cfg(any(feature = "fuse", feature = "tcp", feature = "udp"))]
pub fn virt_to_phys(virtual_address: VirtAddr) -> PhysAddr {
virtual_to_physical(virtual_address).unwrap()
}

Expand Down
4 changes: 2 additions & 2 deletions src/arch/riscv64/mm/paging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,8 @@ pub fn virtual_to_physical(virtual_address: VirtAddr) -> Option<PhysAddr> {
panic!("virtual_to_physical should never reach this point");
}

#[no_mangle]
pub extern "C" fn virt_to_phys(virtual_address: VirtAddr) -> PhysAddr {
#[cfg(any(feature = "fuse", feature = "tcp", feature = "udp"))]
pub fn virt_to_phys(virtual_address: VirtAddr) -> PhysAddr {
virtual_to_physical(virtual_address).unwrap()
}

Expand Down
3 changes: 1 addition & 2 deletions src/arch/x86_64/kernel/apic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,7 @@ fn default_apic() -> PhysAddr {
default_address
}

#[no_mangle]
pub extern "C" fn eoi() {
pub fn eoi() {
local_apic_write(IA32_X2APIC_EOI, APIC_EOI_ACK);
}

Expand Down
11 changes: 11 additions & 0 deletions src/arch/x86_64/kernel/interrupts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ use hashbrown::HashMap;
use hermit_sync::{InterruptSpinMutex, InterruptTicketMutex};
pub use x86_64::instructions::interrupts::{disable, enable, enable_and_hlt as enable_and_wait};
use x86_64::set_general_handler;
#[cfg(any(feature = "fuse", feature = "tcp", feature = "udp"))]
use x86_64::structures::idt;
use x86_64::structures::idt::InterruptDescriptorTable;
pub use x86_64::structures::idt::InterruptStackFrame as ExceptionStackFrame;
<<<<<<< HEAD
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};
=======
>>>>>>> 657edb5c (feat(newlib): remove lwIP support)

use crate::arch::x86_64::kernel::core_local::{core_scheduler, increment_irq_counter};
use crate::arch::x86_64::kernel::{apic, processor};
Expand Down Expand Up @@ -108,11 +114,16 @@ pub(crate) fn install() {
IRQ_NAMES.lock().insert(7, "FPU");
}

<<<<<<< HEAD
#[no_mangle]
pub extern "C" fn irq_install_handler(
irq_number: u8,
handler: extern "x86-interrupt" fn(InterruptStackFrame),
) {
=======
#[cfg(any(feature = "fuse", feature = "tcp", feature = "udp"))]
pub fn irq_install_handler(irq_number: u8, handler: idt::HandlerFunc) {
>>>>>>> 657edb5c (feat(newlib): remove lwIP support)
debug!("Install handler for interrupt {}", irq_number);

let mut idt = IDT.lock();
Expand Down
4 changes: 2 additions & 2 deletions src/arch/x86_64/mm/paging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ pub fn virtual_to_physical(virtual_address: VirtAddr) -> Option<PhysAddr> {
}
}

#[no_mangle]
pub extern "C" fn virt_to_phys(virtual_address: VirtAddr) -> PhysAddr {
#[cfg(any(feature = "fuse", feature = "tcp", feature = "udp"))]
pub fn virt_to_phys(virtual_address: VirtAddr) -> PhysAddr {
virtual_to_physical(virtual_address).unwrap()
}

Expand Down
3 changes: 0 additions & 3 deletions src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ impl fmt::Write for Console {
}
}

#[cfg(feature = "newlib")]
pub static CONSOLE: InterruptTicketMutex<Console> = InterruptTicketMutex::new(Console(()));
#[cfg(not(feature = "newlib"))]
static CONSOLE: InterruptTicketMutex<Console> = InterruptTicketMutex::new(Console(()));

#[doc(hidden)]
Expand Down
39 changes: 0 additions & 39 deletions src/syscalls/lwip.rs

This file was deleted.

11 changes: 1 addition & 10 deletions xtask/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,7 @@ impl Build {
let archive = self.cargo_build.artifact.dist_archive();

let syscall_symbols = archive.syscall_symbols()?;
let explicit_exports = [
"_start",
"__bss_start",
"mcount",
"runtime_entry",
"irq_install_handler",
"virt_to_phys",
"eoi",
]
.into_iter();
let explicit_exports = ["_start", "__bss_start", "mcount", "runtime_entry"].into_iter();

let symbols = explicit_exports.chain(syscall_symbols.iter().map(String::as_str));

Expand Down

0 comments on commit 0bf4f1d

Please sign in to comment.