Skip to content

Commit 92a10d3

Browse files
thejharndb
authored andcommitted
runtime constants: move list of constants to vmlinux.lds.h
Refactor the list of constant variables into a macro. This should make it easier to add more constants in the future. Signed-off-by: Jann Horn <jannh@google.com> Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Will Deacon <will@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 7193b5c commit 92a10d3

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

arch/arm64/kernel/vmlinux.lds.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ SECTIONS
264264
EXIT_DATA
265265
}
266266

267-
RUNTIME_CONST(shift, d_hash_shift)
268-
RUNTIME_CONST(ptr, dentry_hashtable)
267+
RUNTIME_CONST_VARIABLES
269268

270269
PERCPU_SECTION(L1_CACHE_BYTES)
271270
HYPERVISOR_PERCPU_SECTION

arch/s390/kernel/vmlinux.lds.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ SECTIONS
191191
. = ALIGN(PAGE_SIZE);
192192
INIT_DATA_SECTION(0x100)
193193

194-
RUNTIME_CONST(shift, d_hash_shift)
195-
RUNTIME_CONST(ptr, dentry_hashtable)
194+
RUNTIME_CONST_VARIABLES
196195

197196
PERCPU_SECTION(0x100)
198197

arch/x86/kernel/vmlinux.lds.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,7 @@ SECTIONS
357357
PERCPU_SECTION(INTERNODE_CACHE_BYTES)
358358
#endif
359359

360-
RUNTIME_CONST(shift, d_hash_shift)
361-
RUNTIME_CONST(ptr, dentry_hashtable)
360+
RUNTIME_CONST_VARIABLES
362361

363362
. = ALIGN(PAGE_SIZE);
364363

include/asm-generic/vmlinux.lds.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,10 @@
918918

919919
#define RUNTIME_CONST(t,x) NAMED_SECTION(runtime_##t##_##x)
920920

921+
#define RUNTIME_CONST_VARIABLES \
922+
RUNTIME_CONST(shift, d_hash_shift) \
923+
RUNTIME_CONST(ptr, dentry_hashtable)
924+
921925
/* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */
922926
#define KUNIT_TABLE() \
923927
. = ALIGN(8); \

0 commit comments

Comments
 (0)