From 6132623dbf3076da11cdb85c494fadd7ee0f0a93 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 2 Dec 2024 21:02:35 +0100 Subject: Share the same stack everywhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As documented in the code, we are not implementing any kind of memory protection, so in theory any process (regardless if running in user or kernel space) would be able to tamper with other processes' stack. Hence, don't even pretend that we are separating stacks and share the same global stack everywhere. This simplifies things a bit. Signed-off-by: Miquel Sabaté Solà --- test/test_initrd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/test_initrd.c') diff --git a/test/test_initrd.c b/test/test_initrd.c index 314bd25..3d07b67 100644 --- a/test/test_initrd.c +++ b/test/test_initrd.c @@ -6,13 +6,13 @@ #include #include -unsigned long stack[4][THREAD_SIZE / sizeof(unsigned long)]; +unsigned long stack[THREAD_SIZE / sizeof(unsigned long)]; struct task_struct tasks[4] = { - [TASK_INIT] = { .stack = stack[0], .entry_addr = NULL, }, - [TASK_FIZZ] = { .stack = stack[1], .entry_addr = NULL, }, - [TASK_BUZZ] = { .stack = stack[2], .entry_addr = NULL, }, - [TASK_FIZZBUZZ] = { .stack = stack[3], .entry_addr = NULL, }, + [TASK_INIT] = { .stack = stack, .entry_addr = NULL, }, + [TASK_FIZZ] = { .stack = stack, .entry_addr = NULL, }, + [TASK_BUZZ] = { .stack = stack, .entry_addr = NULL, }, + [TASK_FIZZBUZZ] = { .stack = stack, .entry_addr = NULL, }, }; int main(void) -- cgit v1.2.3