mirror of
https://github.com/rcore-os/rCore.git
synced 2024-11-23 00:16:17 +04:00
Note the reason of double fault in x86_64 release mode.
This commit is contained in:
parent
1cb50c00ba
commit
f1407dff7b
@ -28,6 +28,8 @@ pub fn dealloc_frame(target: usize) {
|
|||||||
pub fn alloc_stack() -> Stack {
|
pub fn alloc_stack() -> Stack {
|
||||||
use alloc::boxed::Box;
|
use alloc::boxed::Box;
|
||||||
const STACK_SIZE: usize = 0x8000;
|
const STACK_SIZE: usize = 0x8000;
|
||||||
|
// FIXME: This alignment will cause rsp align with 0x8000 in x86_64 release mode.
|
||||||
|
// Because kernel stack is not large enough, it will trigger double fault.
|
||||||
#[repr(align(0x8000))]
|
#[repr(align(0x8000))]
|
||||||
struct StackData([u8; STACK_SIZE]);
|
struct StackData([u8; STACK_SIZE]);
|
||||||
let data = Box::new(StackData([0; STACK_SIZE]));
|
let data = Box::new(StackData([0; STACK_SIZE]));
|
||||||
|
Loading…
Reference in New Issue
Block a user