libgenwrap.c 745 B

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