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