wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 1 | /* |
2 | * (C) Copyright 2000 | ||||
3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | ||||
4 | * | ||||
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 6 | */ |
7 | |||||
8 | #include <common.h> | ||||
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 9 | #include <exports.h> |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 10 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 11 | int hello_world (int argc, char * const argv[]) |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 12 | { |
13 | int i; | ||||
14 | |||||
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 15 | /* Print the ABI version */ |
16 | app_startup(argv); | ||||
17 | printf ("Example expects ABI version %d\n", XF_VERSION); | ||||
18 | printf ("Actual U-Boot ABI version %d\n", (int)get_version()); | ||||
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 19 | |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 20 | printf ("Hello World\n"); |
21 | |||||
22 | printf ("argc = %d\n", argc); | ||||
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 23 | |
24 | for (i=0; i<=argc; ++i) { | ||||
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 25 | printf ("argv[%d] = \"%s\"\n", |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 26 | i, |
27 | argv[i] ? argv[i] : "<NULL>"); | ||||
28 | } | ||||
29 | |||||
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 30 | printf ("Hit any key to exit ... "); |
31 | while (!tstc()) | ||||
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 32 | ; |
33 | /* consume input */ | ||||
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 34 | (void) getc(); |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 35 | |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 36 | printf ("\n\n"); |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 37 | return (0); |
38 | } |