seminix 0.1.58

seminix 内核标准库
Documentation
use aarch64_define::{KIMAGE_START, KIO_VADDR, KMEM_VADDR, KPAGE_VADDR};

// 由链接器或者汇编导出的符号和函数在此申明
unsafe extern "C" {
    static _text: usize;
    static _end: usize;
    static _stack_end: usize;
}

#[inline(always)]
pub(super) fn arch_start_text() -> usize {
    core::ptr::addr_of!(_text) as usize
}

#[inline(always)]
pub(super) fn arch_end_bss() -> usize {
    core::ptr::addr_of!(_end) as usize
}

#[inline(always)]
pub(super) fn arch_init_stack_base() -> usize {
    core::ptr::addr_of!(_stack_end) as usize
}

pub(super) const ARCH_KIMAGE_OFFSET: usize = KIMAGE_START;
// 注意:
// io 地址是通过连续映射 0-16G 的物理地址实现的, 因此 io 地址最大不能超过 16G 范围
pub(super) const ARCH_KIO_OFFSET: usize = KIO_VADDR;
// 注意:
// 线性地址是通过连续映射 0-16G 的物理地址实现的, 因此线性地址最大不能超过 16G 范围
pub(super) const ARCH_KMEM_OFFSET: usize = KMEM_VADDR;

pub(super) const ARCH_KPAGE_OFFSET: usize = KPAGE_VADDR;