add memory allocation for thread stack
All checks were successful
continuous-integration/drone/push Build is passing
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:
parent
268b36188e
commit
bc0c885052
@ -1,9 +1,17 @@
|
|||||||
|
use alloc::alloc::{alloc, dealloc, Layout};
|
||||||
|
|
||||||
|
const STACK_SIZE: usize = 4096 * 20;
|
||||||
|
|
||||||
pub struct Thread {
|
pub struct Thread {
|
||||||
rsp: u64
|
rsp: u64
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Thread {
|
impl Thread {
|
||||||
pub fn new() {
|
pub fn new() -> Self {
|
||||||
|
unsafe {
|
||||||
|
Thread {
|
||||||
|
rsp: alloc(Layout::new::<[u8; STACK_SIZE]>()) as u64,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user