mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
kernel: make init proces stack grown downwards
Previously, we were creating a stack beginning at the initial page, and then growing it upwards. The correct behavior is to begin it at the top and grow it downwards. In order to do this, subtract the size of the stack from the initial pointer. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
e29dc5a739
commit
1b315de830
1 changed files with 5 additions and 1 deletions
|
|
@ -360,7 +360,11 @@ impl SystemServices {
|
|||
process.state = ProcessState::Setup(ThreadInit::new(
|
||||
unsafe { core::mem::transmute::<usize, _>(init.entrypoint) },
|
||||
unsafe {
|
||||
MemoryRange::new(init.sp, crate::arch::process::DEFAULT_STACK_SIZE).unwrap()
|
||||
MemoryRange::new(
|
||||
init.sp - crate::arch::process::DEFAULT_STACK_SIZE,
|
||||
crate::arch::process::DEFAULT_STACK_SIZE,
|
||||
)
|
||||
.unwrap()
|
||||
},
|
||||
pid,
|
||||
0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue