2 * Copyright (C) 2013, Intel Corporation
3 * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
5 * SPDX-License-Identifier: Intel
8 #ifndef __FSP_TYPES_H__
9 #define __FSP_TYPES_H__
11 /* 128 bit buffer containing a unique identifier value */
20 * Returns a 16-bit signature built from 2 ASCII characters.
22 * This macro returns a 16-bit value built from the two ASCII characters
23 * specified by A and B.
25 * @A: The first ASCII character.
26 * @B: The second ASCII character.
28 * @return: A 16-bit value built from the two ASCII characters specified by
31 #define SIGNATURE_16(A, B) ((A) | (B << 8))
34 * Returns a 32-bit signature built from 4 ASCII characters.
36 * This macro returns a 32-bit value built from the four ASCII characters
37 * specified by A, B, C, and D.
39 * @A: The first ASCII character.
40 * @B: The second ASCII character.
41 * @C: The third ASCII character.
42 * @D: The fourth ASCII character.
44 * @return: A 32-bit value built from the two ASCII characters specified by
47 #define SIGNATURE_32(A, B, C, D) \
48 (SIGNATURE_16(A, B) | (SIGNATURE_16(C, D) << 16))
51 * Returns a 64-bit signature built from 8 ASCII characters.
53 * This macro returns a 64-bit value built from the eight ASCII characters
54 * specified by A, B, C, D, E, F, G,and H.
56 * @A: The first ASCII character.
57 * @B: The second ASCII character.
58 * @C: The third ASCII character.
59 * @D: The fourth ASCII character.
60 * @E: The fifth ASCII character.
61 * @F: The sixth ASCII character.
62 * @G: The seventh ASCII character.
63 * @H: The eighth ASCII character.
65 * @return: A 64-bit value built from the two ASCII characters specified by
66 * A, B, C, D, E, F, G and H.
68 #define SIGNATURE_64(A, B, C, D, E, F, G, H) \
69 (SIGNATURE_32(A, B, C, D) | ((u64)(SIGNATURE_32(E, F, G, H)) << 32))
72 * Define FSP API return status code.
73 * Compatiable with EFI_STATUS defined in PI Spec.
76 #define FSP_INVALID_PARAM 0x80000002
77 #define FSP_UNSUPPORTED 0x80000003
78 #define FSP_DEVICE_ERROR 0x80000007
79 #define FSP_NOT_FOUND 0x8000000E
80 #define FSP_ALREADY_STARTED 0x80000014