mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
sched: use THREAD_DEFAULT_KSTACK_SIZE rather than hardcoding 10*PAGE_SIZE
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include <kernel/fd.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define THREAD_DEFAULT_KSTACK_SIZE PAGE_SIZE*10
|
||||
|
||||
#define THREAD_PRIORITY_INTERRUPT 0
|
||||
#define THREAD_PRIORITY_KERNEL 1
|
||||
#define THREAD_PRIORITY_USER 2
|
||||
|
||||
@@ -409,7 +409,7 @@ void sched_runinit(){
|
||||
|
||||
printf("Loading /sbin/init\n");
|
||||
|
||||
thread_t* thread = sched_newuthread(NULL, PAGE_SIZE*10, NULL, NULL, false, THREAD_PRIORITY_USER);
|
||||
thread_t* thread = sched_newuthread(NULL, THREAD_DEFAULT_KSTACK_SIZE, NULL, NULL, false, THREAD_PRIORITY_USER);
|
||||
|
||||
proc_t* proc = thread->proc;
|
||||
init = proc;
|
||||
|
||||
@@ -10,7 +10,7 @@ syscallret syscall_fork(arch_regs* ctx){
|
||||
|
||||
syscallret retv;
|
||||
retv.ret = -1;
|
||||
thread_t* newthread = sched_newuthread(NULL, PAGE_SIZE*10, NULL, NULL, false, THREAD_PRIORITY_USER);
|
||||
thread_t* newthread = sched_newuthread(NULL, THREAD_DEFAULT_KSTACK_SIZE, NULL, NULL, false, THREAD_PRIORITY_USER);
|
||||
|
||||
if(!newthread){
|
||||
retv.errno = ENOMEM;
|
||||
|
||||
@@ -294,7 +294,7 @@ void consoledev_init(){
|
||||
if(ringbuffer_init(&input, THREAD_BUFF_MAX))
|
||||
_panic("Failed to initialise console ringbuffer", 0);
|
||||
|
||||
thread = sched_newkthread(console_thread, 4096*10, true, THREAD_PRIORITY_KERNEL);
|
||||
thread = sched_newkthread(console_thread, THREAD_DEFAULT_KSTACK_SIZE, true, THREAD_PRIORITY_KERNEL);
|
||||
|
||||
if(!thread)
|
||||
_panic("Failed to initialise console thread", 0);
|
||||
|
||||
Reference in New Issue
Block a user