Bump Rust version to nightly-2025-02-18(2024 Edition)

This commit is contained in:
Yifan Wu 2025-02-19 21:27:17 +08:00
parent 123595601d
commit 5b846fce6a
44 changed files with 118 additions and 105 deletions

View file

@ -1,6 +1,5 @@
#![no_std]
#![feature(linkage)]
#![feature(panic_info_message)]
#![feature(alloc_error_handler)]
#[macro_use]
@ -13,6 +12,7 @@ extern crate alloc;
extern crate bitflags;
use buddy_system_allocator::LockedHeap;
use core::ptr::addr_of_mut;
use syscall::*;
const USER_HEAP_SIZE: usize = 32768;
@ -27,18 +27,18 @@ pub fn handle_alloc_error(layout: core::alloc::Layout) -> ! {
panic!("Heap allocation error, layout = {:?}", layout);
}
#[no_mangle]
#[link_section = ".text.entry"]
#[unsafe(no_mangle)]
#[unsafe(link_section = ".text.entry")]
pub extern "C" fn _start() -> ! {
unsafe {
HEAP.lock()
.init(HEAP_SPACE.as_ptr() as usize, USER_HEAP_SIZE);
.init(addr_of_mut!(HEAP_SPACE) as usize, USER_HEAP_SIZE);
}
exit(main());
}
#[linkage = "weak"]
#[no_mangle]
#[unsafe(no_mangle)]
fn main() -> i32 {
panic!("Cannot find main!");
}