]> git.sur5r.net Git - u-boot/blob - arch/x86/include/asm/fsp/fsp_types.h
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / arch / x86 / include / asm / fsp / fsp_types.h
1 /* SPDX-License-Identifier: Intel */
2 /*
3  * Copyright (C) 2013, Intel Corporation
4  * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
5  */
6
7 #ifndef __FSP_TYPES_H__
8 #define __FSP_TYPES_H__
9
10 /* 128 bit buffer containing a unique identifier value */
11 struct efi_guid {
12         u32     data1;
13         u16     data2;
14         u16     data3;
15         u8      data4[8];
16 };
17
18 /**
19  * Returns a 16-bit signature built from 2 ASCII characters.
20  *
21  * This macro returns a 16-bit value built from the two ASCII characters
22  * specified by A and B.
23  *
24  * @A: The first ASCII character.
25  * @B: The second ASCII character.
26  *
27  * @return: A 16-bit value built from the two ASCII characters specified by
28  *          A and B.
29  */
30 #define SIGNATURE_16(A, B)      ((A) | (B << 8))
31
32 /**
33  * Returns a 32-bit signature built from 4 ASCII characters.
34  *
35  * This macro returns a 32-bit value built from the four ASCII characters
36  * specified by A, B, C, and D.
37  *
38  * @A: The first ASCII character.
39  * @B: The second ASCII character.
40  * @C: The third ASCII character.
41  * @D: The fourth ASCII character.
42  *
43  * @return: A 32-bit value built from the two ASCII characters specified by
44  *          A, B, C and D.
45  */
46 #define SIGNATURE_32(A, B, C, D)        \
47         (SIGNATURE_16(A, B) | (SIGNATURE_16(C, D) << 16))
48
49 /**
50  * Returns a 64-bit signature built from 8 ASCII characters.
51  *
52  * This macro returns a 64-bit value built from the eight ASCII characters
53  * specified by A, B, C, D, E, F, G,and H.
54  *
55  * @A: The first ASCII character.
56  * @B: The second ASCII character.
57  * @C: The third ASCII character.
58  * @D: The fourth ASCII character.
59  * @E: The fifth ASCII character.
60  * @F: The sixth ASCII character.
61  * @G: The seventh ASCII character.
62  * @H: The eighth ASCII character.
63  *
64  * @return: A 64-bit value built from the two ASCII characters specified by
65  *          A, B, C, D, E, F, G and H.
66  */
67 #define SIGNATURE_64(A, B, C, D, E, F, G, H)    \
68         (SIGNATURE_32(A, B, C, D) | ((u64)(SIGNATURE_32(E, F, G, H)) << 32))
69
70 #endif