xref: /openbmc/u-boot/examples/api/libgenwrap.c (revision baefb63a)
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 
13 #include <common.h>
14 #include <linux/types.h>
15 #include <api_public.h>
16 
17 #include "glue.h"
18 
19 void putc(const char c)
20 {
21 	ub_putc(c);
22 }
23 
24 void puts(const char *s)
25 {
26 	ub_puts(s);
27 }
28 
29 void __udelay(unsigned long usec)
30 {
31 	ub_udelay(usec);
32 }
33 
34 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
35 {
36 	ub_reset();
37 	return 0;
38 }
39 
40 void *malloc (size_t len)
41 {
42 	return NULL;
43 }
44 
45 void hang (void)
46 {
47 	while (1) ;
48 }
49