<p>Denis 'GNUtoo' Carikli has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/23244">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/blobtool: move declaration to their own header<br><br>Change-Id: I556a122753e8a35c4ed32df460a5e12fa85de7f7<br>Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org><br>---<br>A util/bincfg/bincfg.h<br>M util/bincfg/bincfg.y<br>2 files changed, 51 insertions(+), 32 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/23244/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/bincfg/bincfg.h b/util/bincfg/bincfg.h</span><br><span>new file mode 100644</span><br><span>index 0000000..35c6e9f</span><br><span>--- /dev/null</span><br><span>+++ b/util/bincfg/bincfg.h</span><br><span>@@ -0,0 +1,50 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * bincfg - Compiler/Decompiler for data blobs with specs</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2017 Damien Zammit <damien@zamaudio.com></span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2018 Denis 'GNUtoo' Carikli <GNUtoo@no-log.org></span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software: you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation, either version 3 of the License, or</span><br><span style="color: hsl(120, 100%, 40%);">+ * (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#ifndef __BINCFG_H</span><br><span style="color: hsl(120, 100%, 40%);">+#define __BINCFG_H</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#define VALID_BIT 0x80</span><br><span style="color: hsl(120, 100%, 40%);">+#define MAX_WIDTH 32</span><br><span style="color: hsl(120, 100%, 40%);">+#define CHECKSUM_SIZE 16</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+struct field {</span><br><span style="color: hsl(120, 100%, 40%);">+  char *name;</span><br><span style="color: hsl(120, 100%, 40%);">+   unsigned int width;</span><br><span style="color: hsl(120, 100%, 40%);">+   unsigned int value;</span><br><span style="color: hsl(120, 100%, 40%);">+   struct field *next;</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Bit array intermediary representation */</span><br><span style="color: hsl(120, 100%, 40%);">+struct blob {</span><br><span style="color: hsl(120, 100%, 40%);">+ unsigned int bloblen;</span><br><span style="color: hsl(120, 100%, 40%);">+ unsigned char *blb;</span><br><span style="color: hsl(120, 100%, 40%);">+   unsigned short checksum;</span><br><span style="color: hsl(120, 100%, 40%);">+      unsigned char *actualblob;</span><br><span style="color: hsl(120, 100%, 40%);">+    unsigned int lenactualblob;</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static struct field *putsym (char const *, unsigned int);</span><br><span style="color: hsl(120, 100%, 40%);">+static struct field *getsym (char const *);</span><br><span style="color: hsl(120, 100%, 40%);">+static void yyerror (char const *);</span><br><span style="color: hsl(120, 100%, 40%);">+int yylex (void);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static FILE* fp;</span><br><span style="color: hsl(120, 100%, 40%);">+static struct blob *binary;</span><br><span style="color: hsl(120, 100%, 40%);">+static struct field *sym_table;</span><br><span style="color: hsl(120, 100%, 40%);">+static struct field *sym_table_tail;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* __BINCFG_H */</span><br><span>diff --git a/util/bincfg/bincfg.y b/util/bincfg/bincfg.y</span><br><span>index 701de6f..0b4a881 100644</span><br><span>--- a/util/bincfg/bincfg.y</span><br><span>+++ b/util/bincfg/bincfg.y</span><br><span>@@ -18,39 +18,8 @@</span><br><span> #include <inttypes.h></span><br><span> #include <stdlib.h></span><br><span> #include <string.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include "bincfg.h"</span><br><span> //#define YYDEBUG 1</span><br><span style="color: hsl(0, 100%, 40%);">-int yylex (void);</span><br><span style="color: hsl(0, 100%, 40%);">-static void yyerror (char const *);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-struct field {</span><br><span style="color: hsl(0, 100%, 40%);">- char *name;</span><br><span style="color: hsl(0, 100%, 40%);">-     unsigned int width;</span><br><span style="color: hsl(0, 100%, 40%);">-     unsigned int value;</span><br><span style="color: hsl(0, 100%, 40%);">-     struct field *next;</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static struct field *sym_table;</span><br><span style="color: hsl(0, 100%, 40%);">-static struct field *putsym (char const *, unsigned int);</span><br><span style="color: hsl(0, 100%, 40%);">-static struct field *getsym (char const *);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static struct field *sym_table_tail;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static FILE* fp;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/* Bit array intermediary representation */</span><br><span style="color: hsl(0, 100%, 40%);">-struct blob {</span><br><span style="color: hsl(0, 100%, 40%);">-    unsigned int bloblen;</span><br><span style="color: hsl(0, 100%, 40%);">-   unsigned char *blb;</span><br><span style="color: hsl(0, 100%, 40%);">-     unsigned short checksum;</span><br><span style="color: hsl(0, 100%, 40%);">-        unsigned char *actualblob;</span><br><span style="color: hsl(0, 100%, 40%);">-      unsigned int lenactualblob;</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#define VALID_BIT 0x80</span><br><span style="color: hsl(0, 100%, 40%);">-#define MAX_WIDTH 32</span><br><span style="color: hsl(0, 100%, 40%);">-#define CHECKSUM_SIZE 16</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static struct blob *binary;</span><br><span> </span><br><span> static void check_pointer (void *ptr)</span><br><span> {</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/23244">change 23244</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/23244"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I556a122753e8a35c4ed32df460a5e12fa85de7f7 </div>
<div style="display:none"> Gerrit-Change-Number: 23244 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> </div>