libgenwrap.c 748 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * (C) Copyright 2007 Semihalf
  3. *
  4. * Written by: Rafal Jaworowski <raj@semihalf.com>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. *
  8. * This is is a set of wrappers/stubs that allow to use certain routines from
  9. * U-Boot's lib in the standalone app. This way way we can re-use
  10. * existing code e.g. operations on strings and similar.
  11. */
  12. #include <common.h>
  13. #include <linux/types.h>
  14. #include <api_public.h>
  15. #include "glue.h"
  16. void putc(const char c)
  17. {
  18. ub_putc(c);
  19. }
  20. void puts(const char *s)
  21. {
  22. ub_puts(s);
  23. }
  24. void __udelay(unsigned long usec)
  25. {
  26. ub_udelay(usec);
  27. }
  28. int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  29. {
  30. ub_reset();
  31. return 0;
  32. }
  33. void *malloc (size_t len)
  34. {
  35. return NULL;
  36. }
  37. void hang (void)
  38. {
  39. while (1) ;
  40. }