summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawei Li <dawei.li@shingroup.cn>2024-03-04 11:54:55 +0300
committerGeert Uytterhoeven <geert@linux-m68k.org>2024-04-02 10:33:21 +0300
commit70d830e337f999ad186d0093e973805eaf6fb8ca (patch)
tree444b9bce30c2e072db13d9eb0fe3a9062d140829
parent4cece764965020c22cff7665b18a012006359095 (diff)
downloadlinux-70d830e337f999ad186d0093e973805eaf6fb8ca.tar.xz
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>
-rw-r--r--arch/m68k/include/asm/thread_info.h9
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__