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>
This commit is contained in:
Dawei Li 2024-03-04 16:54:55 +08:00 committed by Geert Uytterhoeven
parent 4cece76496
commit 70d830e337

View File

@ -12,14 +12,15 @@
*/
#if PAGE_SHIFT < 13
#ifdef CONFIG_4KSTACKS
#define THREAD_SIZE 4096
#define THREAD_SIZE_ORDER 0
#else
#define THREAD_SIZE 8192
#define THREAD_SIZE_ORDER 1
#endif
#else
#define THREAD_SIZE PAGE_SIZE
#define THREAD_SIZE_ORDER 0
#endif
#define THREAD_SIZE_ORDER ((THREAD_SIZE / PAGE_SIZE) - 1)
#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
#ifndef __ASSEMBLY__