diff --git a/include/linux/android_kabi.h b/include/linux/android_kabi.h index 95cdb96e8692..f5cc7c48477e 100644 --- a/include/linux/android_kabi.h +++ b/include/linux/android_kabi.h @@ -42,11 +42,14 @@ * Worker macros, don't use these, use the ones without a leading '_' */ -#define _ANDROID_KABI_RULE(hint, target, value) \ +#define __ANDROID_KABI_RULE(hint, target, value) \ static const char CONCATENATE(__gendwarfksyms_rule_, \ __COUNTER__)[] __used __aligned(1) \ __section(".discard.gendwarfksyms.kabi_rules") = \ - "1\0" #hint "\0" #target "\0" #value + "1\0" #hint "\0" target "\0" value + +#define _ANDROID_KABI_RULE(hint, target, value) \ + __ANDROID_KABI_RULE(hint, #target, #value) #define _ANDROID_KABI_NORMAL_SIZE_ALIGN(_orig, _new) \ union { \ @@ -120,6 +123,22 @@ #define ANDROID_KABI_ENUMERATOR_VALUE(fqn, field, value) \ _ANDROID_KABI_RULE(enumerator_value, fqn field, value) +/* + * ANDROID_KABI_BYTE_SIZE(fqn, value) + * Set the byte_size attribute for the struct/union/enum fqn to + * value bytes. + */ +#define ANDROID_KABI_BYTE_SIZE(fqn, value) \ + _ANDROID_KABI_RULE(byte_size, fqn, value) + +/* + * ANDROID_KABI_TYPE_STRING(type, str) + * For the given type, override the type string used in symtypes + * output and version calculation with str. + */ +#define ANDROID_KABI_TYPE_STRING(type, str) \ + __ANDROID_KABI_RULE(type_string, type, str) + /* * ANDROID_KABI_IGNORE * Add a new field that's ignored in versioning.