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