blob: e903bd165dcb62b6cd94707b1a8a1d489a180b49 [file] [log] [blame]
Uwe Hermann7eb845e2008-11-02 17:01:06 +00001/*
2 * This file is part of the bayou project.
3 *
4 * Copyright (C) 2008 Advanced Micro Devices, Inc.
5 *
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.
9 *
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.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
Paul Menzela46a7122013-02-23 18:37:27 +010017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Uwe Hermann7eb845e2008-11-02 17:01:06 +000018 */
19
20#include <stdio.h>
21
22#ifndef PBUILDER_H_
23#define PBUILDER_H_
24
25#include <stdint.h>
26#include <stdio.h>
27
28#define warn(fmt, args...) fprintf(stderr, fmt, ##args)
29#define die(fmt, args...) \
30 do { fprintf(stderr, fmt, ##args); exit(-1); } \
31 while(0)
32
33struct pentry {
34 uint8_t index;
35 uint8_t parent;
36 uint8_t type;
37 uint8_t flags;
38 uint8_t title[64];
39 char *file;
40 char *larname;
41};
42
43struct config {
44 int timeout;
45 int n_entries;
46 struct pentry **entries;
47};
48
49struct bpt_config {
50 uint32_t id;
51 uint8_t timeout;
52 uint8_t entries;
53 uint8_t padding[10];
54};
55
56struct bpt_pentry {
57 uint8_t index;
58 uint8_t parent;
59 uint8_t type;
60 uint8_t flags;
61 uint8_t title[64];
62 uint8_t nlen;
63};
64
65#define BPT_ID 0x30545042
66#define BPT_TYPE_CHOOSER 0x01
67#define BPT_TYPE_CHAIN 0x02
68#define BPT_TYPE_SUBCHAIN 0x03
69
70#define BPT_FLAG_DEFAULT 0x01
71#define BPT_FLAG_NOSHOW 0x02
72
73int pbuilder_show_lar(const char *input);
74int create_lar_from_config(const char *input, const char *output);
75void parseconfig(FILE * stream, struct config *config);
76
77#endif