From 559035c84c1bb9adbf5674a2d903ef3135198d62 Mon Sep 17 00:00:00 2001 From: Shengwen Cheng Date: Fri, 24 Nov 2023 23:05:10 +0800 Subject: [PATCH] kconfig.h: add daemons' stack size setting --- kconfig.h | 5 +++++ kernel/kernel.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/kconfig.h b/kconfig.h index f6634e3f..4d6001bb 100644 --- a/kconfig.h +++ b/kconfig.h @@ -12,6 +12,11 @@ /* The minimum stack size recommended for creating task and thread */ #define STACK_SIZE_MIN 1024 /* Bytes */ +/* Daemons */ +#define IDLE_STACK_SIZE 2048 +#define SOFTIRQD_STACK_SIZE 2048 +#define FILESYSD_STACK_SIZE 2048 + /* Task */ #define TASK_MAX 64 /* Max number of tasks in the system */ diff --git a/kernel/kernel.c b/kernel/kernel.c index 2ef9ceca..194730bf 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -2778,9 +2778,9 @@ void sched_start(void) } /* Create kernel threads for basic services */ - kthread_create(init, 0, 2048); - kthread_create(softirqd, KTHREAD_PRI_MAX, 2048); - kthread_create(filesysd, KTHREAD_PRI_MAX - 1, 2048); + kthread_create(init, 0, IDLE_STACK_SIZE); + kthread_create(softirqd, KTHREAD_PRI_MAX, SOFTIRQD_STACK_SIZE); + kthread_create(filesysd, KTHREAD_PRI_MAX - 1, FILESYSD_STACK_SIZE); /* Dequeue thread 0 (Idle) to execute */ running_thread = &threads[0];