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