1
0
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:
WangRunji 2018-07-15 20:50:57 +08:00
parent 1cb50c00ba
commit f1407dff7b

View File

@ -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]));