Skip to content

Commit 70d830e

Browse files
Dawei Ligeertu
authored andcommitted
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 <[email protected]> Signed-off-by: Dawei Li <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 4cece76 commit 70d830e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arch/m68k/include/asm/thread_info.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
*/
1313
#if PAGE_SHIFT < 13
1414
#ifdef CONFIG_4KSTACKS
15-
#define THREAD_SIZE 4096
15+
#define THREAD_SIZE_ORDER 0
1616
#else
17-
#define THREAD_SIZE 8192
17+
#define THREAD_SIZE_ORDER 1
1818
#endif
1919
#else
20-
#define THREAD_SIZE PAGE_SIZE
20+
#define THREAD_SIZE_ORDER 0
2121
#endif
22-
#define THREAD_SIZE_ORDER ((THREAD_SIZE / PAGE_SIZE) - 1)
22+
23+
#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
2324

2425
#ifndef __ASSEMBLY__
2526

0 commit comments

Comments
 (0)