initplat.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copright (C) 2014 Linaro Ltd.
  3. * Author: Ard Biesheuvel <[email protected]>
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice and this list of conditions, without modification.
  10. * 2. The name of the author may not be used to endorse or promote products
  11. * derived from this software without specific prior written permission.
  12. *
  13. * Alternatively, this software may be distributed under the terms of the
  14. * GNU General Public License as published by the Free Software Foundation;
  15. * either version 2 of the License, or (at your option) any later version.
  16. */
  17. #include "lib.h"
  18. VOID
  19. InitializeLibPlatform (
  20. IN EFI_HANDLE ImageHandle EFI_UNUSED,
  21. IN EFI_SYSTEM_TABLE *SystemTable EFI_UNUSED
  22. )
  23. {
  24. }
  25. /*
  26. * Calls to these functions may be emitted implicitly by GCC even when
  27. * -ffreestanding is in effect.
  28. */
  29. void *memset(void *s, int c, __SIZE_TYPE__ n)
  30. {
  31. unsigned char *p = s;
  32. while (n--)
  33. *p++ = c;
  34. return s;
  35. }
  36. void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n)
  37. {
  38. unsigned char *p = dest;
  39. unsigned char const *q = src;
  40. while (n--)
  41. *p++ = *q++;
  42. return dest;
  43. }
  44. void __div0(void)
  45. {
  46. // TODO handle divide by zero fault
  47. while (1);
  48. }