libgenwrap.c 812 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 <command.h>
  13. #include <hang.h>
  14. #include <linux/delay.h>
  15. #include <linux/types.h>
  16. #include <api_public.h>
  17. #include "glue.h"
  18. void putc(const char c)
  19. {
  20. ub_putc(c);
  21. }
  22. void puts(const char *s)
  23. {
  24. ub_puts(s);
  25. }
  26. void __udelay(unsigned long usec)
  27. {
  28. ub_udelay(usec);
  29. }
  30. int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
  31. {
  32. ub_reset();
  33. return 0;
  34. }
  35. void *malloc (size_t len)
  36. {
  37. return NULL;
  38. }
  39. void hang(void)
  40. {
  41. while (1) ;
  42. }