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