blob: 94e03f00464ea951a6d44f50b01c238ec46731c2 [file] [log] [blame]
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Todd Kjos <tkjos@google.com>
Date: Mon, 11 May 2020 13:27:22 -0700
Subject: NOUPSTREAM: ANDROID: GKI: add android_vendor.h
This header file is to be used for various macros to help add
vendor specific fields to kernel data structures to enable
value-added features implemented in vendor modules.
They are to be used before the freeze (to anticipate places where
vendor-specific data is required).
[CPNOTE: 27/05/21] Lee: Vendor related code - maintain forever
Bug: 156285741
Update: add macros to create OEM data fields
Adds ANDROID_OEM_DATA and ANDROID_OEM_DATA_ARRAY macros
to add OEM-specific fields to kernel data structures
to enable value-added features implemented in vendor modules.
Fields defined with these macros must not be used by
SoC vendors who must use the ANDROID_VENDOR_DATA* macros
to add vendor fields.
Bug: 156285741
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Ic23b2760ece93facdc51cc35718a4154aba810f9
[ebiggers: folded in fix from commit dc419bab7424
("ANDROID: fix copyright notice")]
Signed-off-by: Eric Biggers <ebiggers@google.com>
Lee: Squash in small subsequent commit and provide Update:]
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Lee Jones <joneslee@google.com>
---
include/linux/android_vendor.h | 35 ++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 include/linux/android_vendor.h
diff --git a/include/linux/android_vendor.h b/include/linux/android_vendor.h
new file mode 100644
--- /dev/null
+++ b/include/linux/android_vendor.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * android_vendor.h - Android vendor data
+ *
+ * Copyright 2020 Google LLC
+ *
+ * These macros are to be used to reserve space in kernel data structures
+ * for use by vendor modules.
+ *
+ * These macros should be used before the kernel abi is "frozen".
+ * Fields can be added to various kernel structures that need space
+ * for functionality implemented in vendor modules. The use of
+ * these fields is vendor specific.
+ */
+#ifndef _ANDROID_VENDOR_H
+#define _ANDROID_VENDOR_H
+
+/*
+ * ANDROID_VENDOR_DATA
+ * Reserve some "padding" in a structure for potential future use.
+ * This normally placed at the end of a structure.
+ * number: the "number" of the padding variable in the structure. Start with
+ * 1 and go up.
+ *
+ * ANDROID_VENDOR_DATA_ARRAY
+ * Same as ANDROID_VENDOR_DATA but allocates an array of u64 with
+ * the specified size
+ */
+#define ANDROID_VENDOR_DATA(n) u64 android_vendor_data##n
+#define ANDROID_VENDOR_DATA_ARRAY(n, s) u64 android_vendor_data##n[s]
+
+#define ANDROID_OEM_DATA(n) u64 android_oem_data##n
+#define ANDROID_OEM_DATA_ARRAY(n, s) u64 android_oem_data##n[s]
+
+#endif /* _ANDROID_VENDOR_H */