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