]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
arm64: clean up THREAD_* definitions
authorMark Rutland <mark.rutland@arm.com>
Fri, 14 Jul 2017 15:39:21 +0000 (16:39 +0100)
committerMark Rutland <mark.rutland@arm.com>
Tue, 15 Aug 2017 17:35:07 +0000 (18:35 +0100)
Currently we define THREAD_SIZE and THREAD_SIZE_ORDER separately, with
the latter dependent on particular CONFIG_ARM64_*K_PAGES definitions.
This is somewhat opaque, and will get in the way of future modifications
to THREAD_SIZE.

This patch cleans this up, defining both in terms of a common
THREAD_SHIFT, and using PAGE_SHIFT to calculate THREAD_SIZE_ORDER,
rather than using a number of definitions dependent on config symbols.
Subsequent patches will make use of this to alter the stack size used in
some configurations.

At the same time, these are moved into <asm/memory.h>, which will avoid
circular include issues in subsequent patches. To ensure that existing
code isn't adversely affected, <asm/thread_info.h> is updated to
transitively include these definitions.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
arch/arm64/include/asm/memory.h
arch/arm64/include/asm/thread_info.h

index 77d55dcfb86cb949e10dd50693f97dd576ff193f..8ab4774e2616ee194fc77e50965a85405ed8f0f0 100644 (file)
 #define KASAN_SHADOW_SIZE      (0)
 #endif
 
+#define THREAD_SHIFT           14
+
+#if THREAD_SHIFT >= PAGE_SHIFT
+#define THREAD_SIZE_ORDER      (THREAD_SHIFT - PAGE_SHIFT)
+#endif
+
+#define THREAD_SIZE            (UL(1) << THREAD_SHIFT)
+
 /*
  * Memory types available.
  */
index b29ab0e12e609776f11769f9a4971e555d5327b0..aa04b733b349efa1c58337c4c65e028038c99a99 100644 (file)
 
 #include <linux/compiler.h>
 
-#ifdef CONFIG_ARM64_4K_PAGES
-#define THREAD_SIZE_ORDER      2
-#elif defined(CONFIG_ARM64_16K_PAGES)
-#define THREAD_SIZE_ORDER      0
-#endif
-
-#define THREAD_SIZE            16384
-
 #ifndef __ASSEMBLY__
 
 struct task_struct;
 
+#include <asm/memory.h>
 #include <asm/stack_pointer.h>
 #include <asm/types.h>