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