Skip to content

Commit

Permalink
feat: publish polyhal
Browse files Browse the repository at this point in the history
  • Loading branch information
yfblock committed Aug 3, 2024
1 parent a545a4e commit f0002b5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ repository = "https://github.com/Byte-OS/polyhal"

[features]
kcontext = []
multicore = []
interrupt = []
multicore = ["boot"]
trap = []
boot = []
logger = []

vga_text = []
graphic = []

default = ["multicore", "interrupt", "boot", "kcontext"]
default = ["boot", "trap", "kcontext"]

[dependencies]
log = "0.4"
Expand Down
2 changes: 2 additions & 0 deletions example/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/components/boot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ pub(crate) static mut BOOT_STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];

// Declare the _main_for_arch exists.
extern "Rust" {
#[cfg(feature = "boot")]
pub(crate) fn _main_for_arch(hartid: usize);
}
3 changes: 1 addition & 2 deletions src/components/pagetable/riscv64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use bitflags::bitflags;
use riscv::register::satp;

use crate::addr::{PhysAddr, PhysPage, VirtAddr, VirtPage};
use crate::components::boot::boot_page_table;

use crate::components::pagetable::{MappingFlags, PageTable, PTE, TLB};
use crate::utils::bit;
Expand Down Expand Up @@ -185,7 +184,7 @@ impl PageTable {
#[inline]
pub fn restore(&self) {
self.release();
let kernel_arr = Self::get_pte_list(boot_page_table().0);
let kernel_arr = Self::get_pte_list(crate::boot::boot_page_table().0);
let arr = Self::get_pte_list(self.0);
arr[0x100..].copy_from_slice(&kernel_arr[0x100..]);
arr[0..0x100].fill(PTE(0));
Expand Down

0 comments on commit f0002b5

Please sign in to comment.