add memory allocation for thread stack
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
Julien CLEMENT 2022-12-31 00:05:17 +01:00
parent 268b36188e
commit bc0c885052

@ -1,9 +1,17 @@
use alloc::alloc::{alloc, dealloc, Layout};
const STACK_SIZE: usize = 4096 * 20;
pub struct Thread {
rsp: u64
}
impl Thread {
pub fn new() {
pub fn new() -> Self {
unsafe {
Thread {
rsp: alloc(Layout::new::<[u8; STACK_SIZE]>()) as u64,
}
}
}
}