ANDROID: GKI: Put vendor_data_pad behind CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE

vendor_data_pad uses CONFIG_GKI_TASK_STRUCT_VENDOR_SIZE_MAX, which is
only defined when CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE is enabled,
resulting in build failures when it is not:

  In file included from arch/arm/kernel/asm-offsets.c:12:
  In file included from include/linux/mm.h:1120:
  In file included from include/linux/huge_mm.h:8:
  In file included from include/linux/fs.h:33:
  In file included from include/linux/percpu-rwsem.h:7:
  In file included from include/linux/rcuwait.h:6:
  In file included from include/linux/sched/signal.h:9:
  include/linux/sched/task.h:59:28: error: use of undeclared identifier 'CONFIG_GKI_TASK_STRUCT_VENDOR_SIZE_MAX'
     59 | extern u64 vendor_data_pad[CONFIG_GKI_TASK_STRUCT_VENDOR_SIZE_MAX / sizeof(u64)];
        |                            ^
  1 error generated.

Place all instances of vendor_data_pad behind
CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE to address the build failures.

Fixes: 1827ee5e5a ("ANDROID: GKI: Add padding after init_task structure")
Fixes: 5e9a8cb714 ("ANDROID: GKI: Add to task_struct size via cmdline")
Change-Id: I7f5dcdd0aaffc5af3063a1b2ca4c1a3517043378
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This commit is contained in:
Nathan Chancellor
2024-10-16 09:12:52 -07:00
committed by Todd Kjos
parent 224c2243d1
commit 2282ad09ee
3 changed files with 6 additions and 0 deletions
+2
View File
@@ -226,8 +226,10 @@ struct task_struct init_task __aligned(L1_CACHE_BYTES) = {
};
EXPORT_SYMBOL(init_task);
#ifdef CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE
u64 vendor_data_pad[CONFIG_GKI_TASK_STRUCT_VENDOR_SIZE_MAX / sizeof(u64)];
EXPORT_SYMBOL_GPL(vendor_data_pad);
#endif
/*
* Initial thread structure. Alignment of this is handled by a special