Unverified Commit 2cc2ea01 authored by bors[bot]'s avatar bors[bot] Committed by GitHub
Browse files

Merge #109



109: port libhermit to support C-based applications r=stlankes a=stlankes

- using of VirtAddr also for newlib-based applications
Co-authored-by: Stefan Lankes's avatarStefan Lankes <slankes@eonerc.rwth-aachen.de>
parents dc3faa53 dbc4322c
......@@ -5,7 +5,7 @@ set(HERMIT_RS "${CMAKE_BINARY_DIR}/hermit_rs/${HERMIT_ARCH}-unknown-hermit-kerne
add_custom_target(hermit_rs
COMMAND
${CMAKE_COMMAND} -E env CARGO_TARGET_DIR=${CMAKE_BINARY_DIR}/hermit_rs RUST_TARGET_PATH=${HERMIT_ROOT}/librs
cargo xbuild ${CARGO_BUILDTYPE_PARAMETER} --target ${HERMIT_ARCH}-unknown-hermit-kernel.json --features newlib
cargo build ${CARGO_BUILDTYPE_PARAMETER} -Z build-std=core,alloc --target ${HERMIT_ARCH}-unknown-hermit-kernel.json --features newlib
WORKING_DIRECTORY
${CMAKE_CURRENT_LIST_DIR})
......
......@@ -4,7 +4,7 @@
"target-endian": "little",
"target-pointer-width": "64",
"target-c-int-width" : "32",
"os": "none",
"os": "hermit",
"arch": "aarch64",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
"pre-link-args": {
......
......@@ -122,7 +122,7 @@ pub fn init() {
let size = 2 * LargePageSize::SIZE;
unsafe {
let start = allocate(size, true);
crate::ALLOCATOR.lock().init(start, size);
crate::ALLOCATOR.lock().init(start.as_usize(), size);
}
info!("Kernel heap size: {} MB", size >> 20);
......
......@@ -258,7 +258,7 @@ impl PerCoreScheduler {
#[cfg(feature = "newlib")]
#[inline]
pub fn get_lwip_errno(&self) -> i32 {
irqsave(|| self.current_task.borrow().lwip_errno);
irqsave(|| self.current_task.borrow().lwip_errno)
}
#[inline]
......
......@@ -87,7 +87,7 @@ static SBRK_COUNTER: AtomicUsize = AtomicUsize::new(0);
#[cfg(feature = "newlib")]
pub fn sbrk_init() {
SBRK_COUNTER.store(task_heap_start(), Ordering::SeqCst);
SBRK_COUNTER.store(task_heap_start().as_usize(), Ordering::SeqCst);
}
#[cfg(feature = "newlib")]
......@@ -99,10 +99,10 @@ fn __sys_sbrk(incr: isize) -> usize {
if incr >= 0 {
old_end = SBRK_COUNTER.fetch_add(incr as usize, Ordering::SeqCst);
assert!(task_heap_end >= old_end + incr as usize);
assert!(task_heap_end.as_usize() >= old_end + incr as usize);
} else {
old_end = SBRK_COUNTER.fetch_sub(incr.abs() as usize, Ordering::SeqCst);
assert!(task_heap_start < old_end - incr.abs() as usize);
assert!(task_heap_start.as_usize() < old_end - incr.abs() as usize);
}
old_end
......
......@@ -4,7 +4,7 @@
"target-endian": "little",
"target-pointer-width": "64",
"target-c-int-width" : "32",
"os": "none",
"os": "hermit",
"arch": "x86_64",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"pre-link-args": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment