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