tree: drop last paragraph of GPL copyright header
[coreboot.git] / payloads / bayou / main.c
blobcdccea1072277a14a1700eeeb349ee5d8351ca11
1 /*
2 * This file is part of the bayou project.
4 * Copyright (C) 2008 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include "bayou.h"
18 static void print_banner(void)
20 printf("\e[H\e[JBayou Payload Chooser v0.3\n");
23 int main(void)
25 extern unsigned long _binary_builtin_lar_start;
26 struct LAR *lar;
28 print_banner();
30 lar = openlar((void *)&_binary_builtin_lar_start);
32 if (lar == NULL) {
33 printf("[CHOOSER]: Unable to scan the attached LAR file\n");
34 return -1;
37 get_configuration(lar);
39 if (bayoucfg.n_entries == 0) {
40 printf("[CHOOSER]: No payloads were found in the LAR\n");
41 return -1;
45 * If timeout == 0xFF, then show the menu immediately.
46 * If timeout is zero, then find and run the default item immediately.
47 * If there is no default item, then show the menu.
48 * If timeout is anything else, then show a message and wait for a
49 * keystroke. If there is no keystroke in time then run the default.
50 * If there is no default then show the menu.
52 if (bayoucfg.timeout != 0xFF) {
53 struct payload *d = payload_get_default();
55 if (d != NULL) {
56 if (bayoucfg.timeout == 0)
57 run_payload(d);
58 else
59 run_payload_timeout(d, bayoucfg.timeout);
63 menu();
65 return 0;