Commit 70d830e3 authored by Dawei Li's avatar Dawei Li Committed by Geert Uytterhoeven

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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarDawei Li <dawei.li@shingroup.cn>
Reviewed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20240304085455.125063-1-dawei.li@shingroup.cnSigned-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent 4cece764
......@@ -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__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment