summaryrefslogtreecommitdiffstats
path: root/util/bincfg/bincfg.h
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2018-01-12 04:04:30 +0100
committerMartin Roth <martinroth@google.com>2018-01-23 05:21:28 +0000
commitfa0bdfc1207b6675bb1f46708e02aa1462a5ec1d (patch)
treeb1ca03d7a093eb329b5ac781b2534d59808f3c96 /util/bincfg/bincfg.h
parent3cb25bbbc31ec1a53149c2c8f3dc6d70bda0c335 (diff)
downloadcoreboot-fa0bdfc1207b6675bb1f46708e02aa1462a5ec1d.tar.gz
coreboot-fa0bdfc1207b6675bb1f46708e02aa1462a5ec1d.tar.bz2
coreboot-fa0bdfc1207b6675bb1f46708e02aa1462a5ec1d.zip
util/blobtool: move declaration to their own header
Change-Id: I556a122753e8a35c4ed32df460a5e12fa85de7f7 Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Reviewed-on: https://review.coreboot.org/23244 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/bincfg/bincfg.h')
-rw-r--r--util/bincfg/bincfg.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/util/bincfg/bincfg.h b/util/bincfg/bincfg.h
new file mode 100644
index 000000000000..35c6e9f17c3b
--- /dev/null
+++ b/util/bincfg/bincfg.h
@@ -0,0 +1,50 @@
+/*
+ * bincfg - Compiler/Decompiler for data blobs with specs
+ * Copyright (C) 2017 Damien Zammit <damien@zamaudio.com>
+ * Copyright (C) 2018 Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __BINCFG_H
+#define __BINCFG_H
+
+#define VALID_BIT 0x80
+#define MAX_WIDTH 32
+#define CHECKSUM_SIZE 16
+
+struct field {
+ char *name;
+ unsigned int width;
+ unsigned int value;
+ struct field *next;
+};
+
+/* Bit array intermediary representation */
+struct blob {
+ unsigned int bloblen;
+ unsigned char *blb;
+ unsigned short checksum;
+ unsigned char *actualblob;
+ unsigned int lenactualblob;
+};
+
+static struct field *putsym (char const *, unsigned int);
+static struct field *getsym (char const *);
+static void yyerror (char const *);
+int yylex (void);
+
+static FILE* fp;
+static struct blob *binary;
+static struct field *sym_table;
+static struct field *sym_table_tail;
+
+#endif /* __BINCFG_H */