From b1b52872fcddcc175a5b5fd0c1a21bf2f0cc0f35 Mon Sep 17 00:00:00 2001 From: Cyber Knight Date: Sat, 15 Nov 2025 20:54:11 +0800 Subject: [PATCH] ANDROID: Retain ABI compatibility with CONFIG_SYSVIPC=y - This is done by utilizing the reserved padding variables 2, 3 and 4 at the end of struct task_struct. - Two padding variables are utilized for struct sysv_shm as the struct instance is insufficient to be utilized with one padding variable. - Retain default behavior for !CONFIG_ANDROID. - This patch was inspired by [1]. [1]: 4c961b9302a7ca76a3f3dc6cdafafa62ca2b80dd Change-Id: I1b9e2435ebd915ee7981a9b88aa54690666ea79a Signed-off-by: Cyber Knight --- include/linux/sched.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 07f0d8bbedc7..fac4c1d9e482 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -970,7 +970,7 @@ struct task_struct { struct nameidata *nameidata; -#ifdef CONFIG_SYSVIPC +#if defined(CONFIG_SYSVIPC) && !defined(CONFIG_ANDROID) struct sysv_sem sysvsem; struct sysv_shm sysvshm; #endif @@ -1381,9 +1381,15 @@ struct task_struct { /* PF_IO_WORKER */ ANDROID_KABI_USE(1, void *pf_io_worker); +#if defined(CONFIG_SYSVIPC) && defined(CONFIG_ANDROID) + ANDROID_KABI_USE(2, struct sysv_sem sysvsem); + _ANDROID_KABI_REPLACE(ANDROID_KABI_RESERVE(3); ANDROID_KABI_RESERVE(4), + struct sysv_shm sysvshm); +#else ANDROID_KABI_RESERVE(2); ANDROID_KABI_RESERVE(3); ANDROID_KABI_RESERVE(4); +#endif ANDROID_KABI_RESERVE(5); ANDROID_KABI_RESERVE(6); ANDROID_KABI_RESERVE(7); -- 2.51.2