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