diff options
author | Dawei Li <dawei.li@shingroup.cn> | 2024-03-04 16:54:55 +0800 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2024-04-02 09:33:21 +0200 |
commit | 70d830e337f999ad186d0093e973805eaf6fb8ca (patch) | |
tree | 444b9bce30c2e072db13d9eb0fe3a9062d140829 /arch/m68k | |
parent | 4cece764965020c22cff7665b18a012006359095 (diff) |
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>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/include/asm/thread_info.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h index 31be2ad999ca..3e31adbddc75 100644 --- a/arch/m68k/include/asm/thread_info.h +++ b/arch/m68k/include/asm/thread_info.h @@ -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__ |