1 /* SPDX-License-Identifier: Intel */
3 * Copyright (C) 2013, Intel Corporation
4 * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
7 #ifndef __FSP_TYPES_H__
8 #define __FSP_TYPES_H__
10 /* 128 bit buffer containing a unique identifier value */
19 * Returns a 16-bit signature built from 2 ASCII characters.
21 * This macro returns a 16-bit value built from the two ASCII characters
22 * specified by A and B.
24 * @A: The first ASCII character.
25 * @B: The second ASCII character.
27 * @return: A 16-bit value built from the two ASCII characters specified by
30 #define SIGNATURE_16(A, B) ((A) | (B << 8))
33 * Returns a 32-bit signature built from 4 ASCII characters.
35 * This macro returns a 32-bit value built from the four ASCII characters
36 * specified by A, B, C, and D.
38 * @A: The first ASCII character.
39 * @B: The second ASCII character.
40 * @C: The third ASCII character.
41 * @D: The fourth ASCII character.
43 * @return: A 32-bit value built from the two ASCII characters specified by
46 #define SIGNATURE_32(A, B, C, D) \
47 (SIGNATURE_16(A, B) | (SIGNATURE_16(C, D) << 16))
50 * Returns a 64-bit signature built from 8 ASCII characters.
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.
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.
64 * @return: A 64-bit value built from the two ASCII characters specified by
65 * A, B, C, D, E, F, G and H.
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))