]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2004, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | CommonLib.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Common library assistance routines.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef _EFI_COMMON_LIB_H\r | |
23 | #define _EFI_COMMON_LIB_H\r | |
24 | \r | |
ce53a8c3 | 25 | #include <Common/UefiBaseTypes.h>\r |
878ddf1f | 26 | \r |
27 | #ifndef _MAX_PATH\r | |
28 | #define _MAX_PATH 500\r | |
29 | #endif\r | |
30 | \r | |
31 | #define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination\r | |
32 | //\r | |
33 | // Function declarations\r | |
34 | //\r | |
35 | VOID\r | |
36 | PeiZeroMem (\r | |
37 | IN VOID *Buffer,\r | |
38 | IN UINTN Size\r | |
39 | )\r | |
40 | ;\r | |
41 | \r | |
42 | VOID\r | |
43 | PeiCopyMem (\r | |
44 | IN VOID *Destination,\r | |
45 | IN VOID *Source,\r | |
46 | IN UINTN Length\r | |
47 | )\r | |
48 | ;\r | |
49 | \r | |
50 | VOID\r | |
51 | ZeroMem (\r | |
52 | IN VOID *Buffer,\r | |
53 | IN UINTN Size\r | |
54 | )\r | |
55 | ;\r | |
56 | \r | |
57 | VOID\r | |
58 | CopyMem (\r | |
59 | IN VOID *Destination,\r | |
60 | IN VOID *Source,\r | |
61 | IN UINTN Length\r | |
62 | )\r | |
63 | ;\r | |
64 | \r | |
65 | INTN\r | |
66 | CompareGuid (\r | |
67 | IN EFI_GUID *Guid1,\r | |
68 | IN EFI_GUID *Guid2\r | |
69 | )\r | |
70 | ;\r | |
71 | \r | |
72 | EFI_STATUS\r | |
73 | GetFileImage (\r | |
74 | IN CHAR8 *InputFileName,\r | |
75 | OUT CHAR8 **InputFileImage,\r | |
76 | OUT UINT32 *BytesRead\r | |
77 | )\r | |
78 | ;\r | |
79 | \r | |
80 | UINT8\r | |
81 | CalculateChecksum8 (\r | |
82 | IN UINT8 *Buffer,\r | |
83 | IN UINTN Size\r | |
84 | )\r | |
85 | ;\r | |
86 | \r | |
87 | UINT8\r | |
88 | CalculateSum8 (\r | |
89 | IN UINT8 *Buffer,\r | |
90 | IN UINTN Size\r | |
91 | )\r | |
92 | ;\r | |
93 | \r | |
94 | UINT16\r | |
95 | CalculateChecksum16 (\r | |
96 | IN UINT16 *Buffer,\r | |
97 | IN UINTN Size\r | |
98 | )\r | |
99 | ;\r | |
100 | \r | |
101 | UINT16\r | |
102 | CalculateSum16 (\r | |
103 | IN UINT16 *Buffer,\r | |
104 | IN UINTN Size\r | |
105 | )\r | |
106 | ;\r | |
107 | \r | |
108 | EFI_STATUS\r | |
109 | PrintGuid (\r | |
110 | IN EFI_GUID *Guid\r | |
111 | )\r | |
112 | ;\r | |
113 | \r | |
114 | #define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination\r | |
115 | EFI_STATUS\r | |
116 | PrintGuidToBuffer (\r | |
117 | IN EFI_GUID *Guid,\r | |
118 | IN OUT UINT8 *Buffer,\r | |
119 | IN UINT32 BufferLen,\r | |
120 | IN BOOLEAN Uppercase\r | |
121 | )\r | |
122 | ;\r | |
123 | \r | |
d2ec0d9e | 124 | #define ASSERT(x) assert(x)\r |
125 | \r | |
e0c56f04 | 126 | #ifdef __GNUC__\r |
fec76338 | 127 | #include <stdio.h>\r |
128 | #include <sys/stat.h>\r | |
e0c56f04 | 129 | #define stricmp strcasecmp\r |
fec76338 | 130 | #define _stricmp strcasecmp\r |
c9af24ef | 131 | #define strnicmp strncasecmp\r |
e0c56f04 | 132 | #define strcmpi strcasecmp\r |
fec76338 | 133 | size_t _filelength(FILE *file);\r |
17b23c78 | 134 | #ifndef __CYGWIN__\r |
135 | char *strlwr(char *s);\r | |
136 | #endif\r | |
e0c56f04 | 137 | #endif\r |
878ddf1f | 138 | \r |
139 | #endif\r |