[coreboot-gerrit] Change in coreboot[master]: util/blobtool: move declaration to their own header
Denis 'GNUtoo' Carikli (Code Review)
gerrit at coreboot.org
Fri Jan 12 15:22:31 CET 2018
Denis 'GNUtoo' Carikli has uploaded this change for review. ( https://review.coreboot.org/23244
Change subject: util/blobtool: move declaration to their own header
......................................................................
util/blobtool: move declaration to their own header
Change-Id: I556a122753e8a35c4ed32df460a5e12fa85de7f7
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
---
A util/bincfg/bincfg.h
M util/bincfg/bincfg.y
2 files changed, 51 insertions(+), 32 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/23244/1
diff --git a/util/bincfg/bincfg.h b/util/bincfg/bincfg.h
new file mode 100644
index 0000000..35c6e9f
--- /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 at zamaudio.com>
+ * Copyright (C) 2018 Denis 'GNUtoo' Carikli <GNUtoo at 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 */
diff --git a/util/bincfg/bincfg.y b/util/bincfg/bincfg.y
index 701de6f..0b4a881 100644
--- a/util/bincfg/bincfg.y
+++ b/util/bincfg/bincfg.y
@@ -18,39 +18,8 @@
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
+#include "bincfg.h"
//#define YYDEBUG 1
-int yylex (void);
-static void yyerror (char const *);
-
-struct field {
- char *name;
- unsigned int width;
- unsigned int value;
- struct field *next;
-};
-
-static struct field *sym_table;
-static struct field *putsym (char const *, unsigned int);
-static struct field *getsym (char const *);
-
-static struct field *sym_table_tail;
-
-static FILE* fp;
-
-/* Bit array intermediary representation */
-struct blob {
- unsigned int bloblen;
- unsigned char *blb;
- unsigned short checksum;
- unsigned char *actualblob;
- unsigned int lenactualblob;
-};
-
-#define VALID_BIT 0x80
-#define MAX_WIDTH 32
-#define CHECKSUM_SIZE 16
-
-static struct blob *binary;
static void check_pointer (void *ptr)
{
--
To view, visit https://review.coreboot.org/23244
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I556a122753e8a35c4ed32df460a5e12fa85de7f7
Gerrit-Change-Number: 23244
Gerrit-PatchSet: 1
Gerrit-Owner: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180112/08b9e5b5/attachment.html>
More information about the coreboot-gerrit
mailing list