BinderFuncs.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /** @file
  2. Binder function implementations for ANSI C libraries.
  3. Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #include "BinderFuncs.h"
  7. #include "CommonLib.h"
  8. #include <stdlib.h>
  9. #include <string.h>
  10. //
  11. // Binder Function Implementations
  12. //
  13. VOID *
  14. CommonLibBinderAllocate (
  15. IN UINTN Size
  16. )
  17. {
  18. return (VOID *) malloc (Size);
  19. }
  20. VOID
  21. CommonLibBinderFree (
  22. IN VOID *Pointer
  23. )
  24. {
  25. free (Pointer);
  26. }
  27. VOID
  28. CommonLibBinderCopyMem (
  29. IN VOID *Destination,
  30. IN VOID *Source,
  31. IN UINTN Length
  32. )
  33. {
  34. memmove (Destination, Source, Length);
  35. }
  36. VOID
  37. CommonLibBinderSetMem (
  38. IN VOID *Destination,
  39. IN UINTN Length,
  40. IN UINT8 Value
  41. )
  42. {
  43. memset (Destination, Value, Length);
  44. }
  45. INTN
  46. CommonLibBinderCompareMem (
  47. IN VOID *MemOne,
  48. IN VOID *MemTwo,
  49. IN UINTN Length
  50. )
  51. {
  52. return memcmp (MemOne, MemTwo, Length);
  53. }
  54. BOOLEAN
  55. CommonLibBinderCompareGuid (
  56. IN EFI_GUID *Guid1,
  57. IN EFI_GUID *Guid2
  58. )
  59. {
  60. return CompareGuid (Guid1, Guid2) ? FALSE : TRUE;
  61. }