• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * android_vendor.h - Android vendor data
4  *
5  * Copyright 2020 Google LLC
6  *
7  * These macros are to be used to reserve space in kernel data structures
8  * for use by vendor modules.
9  *
10  * These macros should be used before the kernel abi is "frozen".
11  * Fields can be added to various kernel structures that need space
12  * for functionality implemented in vendor modules. The use of
13  * these fields is vendor specific.
14  */
15 #ifndef _ANDROID_VENDOR_H
16 #define _ANDROID_VENDOR_H
17 
18 /*
19  * ANDROID_VENDOR_DATA
20  *   Reserve some "padding" in a structure for potential future use.
21  *   This normally placed at the end of a structure.
22  *   number: the "number" of the padding variable in the structure.  Start with
23  *   1 and go up.
24  *
25  * ANDROID_VENDOR_DATA_ARRAY
26  *   Same as ANDROID_VENDOR_DATA but allocates an array of u64 with
27  *   the specified size
28  */
29 #ifdef CONFIG_ANDROID_VENDOR_OEM_DATA
30 #define ANDROID_VENDOR_DATA(n)		u64 android_vendor_data##n
31 #define ANDROID_VENDOR_DATA_ARRAY(n, s)	u64 android_vendor_data##n[s]
32 
33 #define ANDROID_OEM_DATA(n)		u64 android_oem_data##n
34 #define ANDROID_OEM_DATA_ARRAY(n, s)	u64 android_oem_data##n[s]
35 
36 #define android_init_vendor_data(p, n) \
37 	memset(&p->android_vendor_data##n, 0, sizeof(p->android_vendor_data##n))
38 #define android_init_oem_data(p, n) \
39 	memset(&p->android_oem_data##n, 0, sizeof(p->android_oem_data##n))
40 #else
41 #define ANDROID_VENDOR_DATA(n)
42 #define ANDROID_VENDOR_DATA_ARRAY(n, s)
43 #define ANDROID_OEM_DATA(n)
44 #define ANDROID_OEM_DATA_ARRAY(n, s)
45 
46 #define android_init_vendor_data(p, n)
47 #define android_init_oem_data(p, n)
48 #endif
49 
50 #endif /* _ANDROID_VENDOR_H */
51