mirror of
https://github.com/sgmarz/osblog.git
synced 2024-11-24 02:16:19 +04:00
Fixed stack location, mapping
This commit is contained in:
parent
fb4f3eea91
commit
eb2b9a6aca
@ -336,9 +336,9 @@ extern "C" fn kmain() {
|
|||||||
unsafe {
|
unsafe {
|
||||||
let mtimecmp = 0x0200_4000 as *mut u64;
|
let mtimecmp = 0x0200_4000 as *mut u64;
|
||||||
let mtime = 0x0200_bff8 as *const u64;
|
let mtime = 0x0200_bff8 as *const u64;
|
||||||
// mtimecmp.write_volatile(mtime.read_volatile() + 10_000_000);
|
mtimecmp.write_volatile(mtime.read_volatile() + 10_000_000);
|
||||||
let v = 0x0 as *mut u64;
|
// let v = 0x0 as *mut u64;
|
||||||
v.write_volatile(0);
|
// v.write_volatile(0);
|
||||||
}
|
}
|
||||||
// If we get here, the Box, vec, and String should all be freed since
|
// If we get here, the Box, vec, and String should all be freed since
|
||||||
// they go out of scope. This calls their "Drop" trait.
|
// they go out of scope. This calls their "Drop" trait.
|
||||||
|
@ -22,17 +22,11 @@ fn m_trap(epc: usize, tval: usize, cause: usize, hart: usize, stat: usize, frame
|
|||||||
// mode (s_trap).
|
// mode (s_trap).
|
||||||
if cause == 0x8000_0000_0000_0007 {
|
if cause == 0x8000_0000_0000_0007 {
|
||||||
unsafe {
|
unsafe {
|
||||||
// let satp: usize = KERNEL_TABLE >> 12 | 8 << 60;
|
|
||||||
// println!("cause: {}", cause & 0xff);
|
|
||||||
// println!("Kernel table = 0x{:x}", KERNEL_TABLE);
|
|
||||||
// asm!("csrw satp, $0" :: "r"(satp) :: "volatile");
|
|
||||||
let addr = 0x0200_4000 + hart * 8;
|
let addr = 0x0200_4000 + hart * 8;
|
||||||
let mtimecmp = addr as *mut u64;
|
let mtimecmp = addr as *mut u64;
|
||||||
let mtime = 0x0200_bff8 as *const u64;
|
let mtime = 0x0200_bff8 as *const u64;
|
||||||
mtimecmp.write_volatile(mtime.read_volatile() + 10_000_000);
|
mtimecmp.write_volatile(mtime.read_volatile() + 10_000_000);
|
||||||
asm!("csrw sip, $0" ::"r"(2));
|
asm!("csrw sip, $0" ::"r"(2));
|
||||||
// asm!("sfence.vma" :::: "volatile");
|
|
||||||
// asm!("csrw mie, zero" :::: "volatile");
|
|
||||||
}
|
}
|
||||||
epc
|
epc
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user