initplat.c 1008 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * aarch64/initplat.c
  3. *
  4. * Copright (C) 2014 Linaro Ltd.
  5. * Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the Free
  9. * Software Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. */
  12. #include "lib.h"
  13. VOID
  14. InitializeLibPlatform (
  15. IN EFI_HANDLE ImageHandle,
  16. IN EFI_SYSTEM_TABLE *SystemTable
  17. )
  18. {
  19. }
  20. /*
  21. * Calls to these functions may be emitted implicitly by GCC even when
  22. * -ffreestanding is in effect.
  23. */
  24. void *memset(void *s, int c, __SIZE_TYPE__ n)
  25. {
  26. unsigned char *p = s;
  27. while (n--)
  28. *p++ = c;
  29. return s;
  30. }
  31. void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n)
  32. {
  33. unsigned char *p = dest;
  34. unsigned char const *q = src;
  35. while (n--)
  36. *p++ = *q++;
  37. return dest;
  38. }
  39. void __div0(void)
  40. {
  41. // TODO handle divide by zero fault
  42. while (1);
  43. }