]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/Common/BinderFuncs.c
Check In tool source code based on Build tool project revision r1655.
[mirror_edk2.git] / BaseTools / Source / C / Common / BinderFuncs.c
CommitLineData
30fdf114
LG
1/** @file\r
2\r
3Copyright (c) 1999 - 2008, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12Module Name:\r
13\r
14 BinderFuncs.c\r
15\r
16Abstract:\r
17\r
18 Binder function implementations for ANSI C libraries.\r
19\r
20**/\r
21\r
22#include "BinderFuncs.h"\r
23#include "CommonLib.h"\r
24#include <stdlib.h>\r
25#include <string.h>\r
26\r
27//\r
28// Binder Function Implementations\r
29//\r
30\r
31VOID *\r
32CommonLibBinderAllocate (\r
33 IN UINTN Size\r
34 )\r
35{\r
36 return (VOID *) malloc (Size);\r
37}\r
38\r
39VOID\r
40CommonLibBinderFree (\r
41 IN VOID *Pointer\r
42 )\r
43{\r
44 free (Pointer);\r
45}\r
46\r
47VOID\r
48CommonLibBinderCopyMem (\r
49 IN VOID *Destination,\r
50 IN VOID *Source,\r
51 IN UINTN Length\r
52 )\r
53{\r
54 memmove (Destination, Source, Length);\r
55}\r
56\r
57VOID\r
58CommonLibBinderSetMem (\r
59 IN VOID *Destination,\r
60 IN UINTN Length,\r
61 IN UINT8 Value\r
62 )\r
63{\r
64 memset (Destination, Value, Length);\r
65}\r
66\r
67INTN\r
68CommonLibBinderCompareMem (\r
69 IN VOID *MemOne,\r
70 IN VOID *MemTwo,\r
71 IN UINTN Length\r
72 )\r
73{\r
74 return memcmp (MemOne, MemTwo, Length);\r
75}\r
76\r
77BOOLEAN\r
78CommonLibBinderCompareGuid (\r
79 IN EFI_GUID *Guid1,\r
80 IN EFI_GUID *Guid2\r
81 )\r
82{\r
83 return CompareGuid (Guid1, Guid2) ? FALSE : TRUE;\r
84}\r
85\r
86\r
87\r