From caa7efa117e132709cd68f04f034fad83da1b40e Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Sun, 19 Aug 2012 01:04:51 +0200 Subject: [PATCH] kernel: rely on alignment directive for stacks . unnecessary to do it manually with ELF . also makes 1 extra alignment page unnecessary --- kernel/arch/i386/arch_system.c | 8 ++------ kernel/arch/i386/mpx.S | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/kernel/arch/i386/arch_system.c b/kernel/arch/i386/arch_system.c index 7cc9f4157..08204541b 100644 --- a/kernel/arch/i386/arch_system.c +++ b/kernel/arch/i386/arch_system.c @@ -244,12 +244,8 @@ void cpu_identify(void) void arch_init(void) { - /* FIXME stupid a.out - * align the stacks in the stack are to the K_STACK_SIZE which is a - * power of 2 - */ - k_stacks = (void*) (((vir_bytes)&k_stacks_start + K_STACK_SIZE - 1) & - ~(K_STACK_SIZE - 1)); + k_stacks = (void*) &k_stacks_start; + assert(!((vir_bytes) k_stacks % K_STACK_SIZE)); #ifndef CONFIG_SMP /* diff --git a/kernel/arch/i386/mpx.S b/kernel/arch/i386/mpx.S index fa39e74a6..44af169d0 100644 --- a/kernel/arch/i386/mpx.S +++ b/kernel/arch/i386/mpx.S @@ -521,7 +521,7 @@ LABEL(k_boot_stktop) /* top of kernel stack */ LABEL(k_stacks_start) /* two pages for each stack, one for data, other as a sandbox */ -.space 2 * (K_STACK_SIZE * (CONFIG_MAX_CPUS + 1)) +.space 2 * (K_STACK_SIZE * CONFIG_MAX_CPUS) LABEL(k_stacks_end) -- 2.44.0