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 | |||||
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 7 | #include <exports.h> |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 8 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 9 | int hello_world(int argc, char *const argv[]) |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 10 | { |
11 | int i; | ||||
12 | |||||
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 13 | /* Print the ABI version */ |
14 | app_startup(argv); | ||||
15 | printf ("Example expects ABI version %d\n", XF_VERSION); | ||||
16 | printf ("Actual U-Boot ABI version %d\n", (int)get_version()); | ||||
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 17 | |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 18 | printf ("Hello World\n"); |
19 | |||||
20 | printf ("argc = %d\n", argc); | ||||
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 21 | |
22 | for (i=0; i<=argc; ++i) { | ||||
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 23 | printf ("argv[%d] = \"%s\"\n", |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 24 | i, |
25 | argv[i] ? argv[i] : "<NULL>"); | ||||
26 | } | ||||
27 | |||||
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 28 | printf ("Hit any key to exit ... "); |
29 | while (!tstc()) | ||||
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 30 | ; |
31 | /* consume input */ | ||||
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 32 | (void) getc(); |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 33 | |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 34 | printf ("\n\n"); |
wdenk | 3b285da | 2002-10-07 16:54:55 +0000 | [diff] [blame] | 35 | return (0); |
36 | } |