Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m68k: Calculate THREAD_SIZE from THREAD_SIZE_ORDER

Current THREAD_SIZE_ORDER implementation is not generic.

Improve it by:
- Defining THREAD_SIZE_ORDER based on the specific platform config,
- Calculating THREAD_SIZE from THREAD_SIZE_ORDER.

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dawei Li <dawei.li@shingroup.cn>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20240304085455.125063-1-dawei.li@shingroup.cn
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Dawei Li and committed by
Geert Uytterhoeven
70d830e3 4cece764

+5 -4
+5 -4
arch/m68k/include/asm/thread_info.h
··· 12 12 */ 13 13 #if PAGE_SHIFT < 13 14 14 #ifdef CONFIG_4KSTACKS 15 - #define THREAD_SIZE 4096 15 + #define THREAD_SIZE_ORDER 0 16 16 #else 17 - #define THREAD_SIZE 8192 17 + #define THREAD_SIZE_ORDER 1 18 18 #endif 19 19 #else 20 - #define THREAD_SIZE PAGE_SIZE 20 + #define THREAD_SIZE_ORDER 0 21 21 #endif 22 - #define THREAD_SIZE_ORDER ((THREAD_SIZE / PAGE_SIZE) - 1) 22 + 23 + #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) 23 24 24 25 #ifndef __ASSEMBLY__ 25 26