Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl2/dtc/dist Merge conflicts



details:   https://anonhg.NetBSD.org/src/rev/3207b15ea607
branches:  trunk
changeset: 847412:3207b15ea607
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Dec 22 12:38:24 2019 +0000

description:
Merge conflicts

diffstat:

 external/gpl2/dtc/dist/data.c                   |   23 +--
 external/gpl2/dtc/dist/dtc-lexer.l              |   30 +--
 external/gpl2/dtc/dist/dtc-parser.y             |  125 ++++++++++++----
 external/gpl2/dtc/dist/dtc.h                    |   67 +++++---
 external/gpl2/dtc/dist/fdtdump.c                |   52 ++++---
 external/gpl2/dtc/dist/fdtput.c                 |   26 +--
 external/gpl2/dtc/dist/flattree.c               |   29 +---
 external/gpl2/dtc/dist/srcpos.c                 |  176 +++++++++++++++++++----
 external/gpl2/dtc/dist/tests/mangle-layout.c    |   25 +--
 external/gpl2/dtc/dist/tests/mangle-layout.supp |    7 -
 external/gpl2/dtc/dist/tests/move_and_save.c    |   17 +--
 external/gpl2/dtc/dist/tests/open_pack.supp     |    7 -
 external/gpl2/dtc/dist/tests/sw_tree1.supp      |   18 --
 external/gpl2/dtc/dist/tests/tests.h            |   37 ++--
 external/gpl2/dtc/dist/tests/tests.sh           |   62 --------
 external/gpl2/dtc/dist/util.h                   |   53 ++-----
 16 files changed, 371 insertions(+), 383 deletions(-)

diffs (truncated from 1417 to 300 lines):

diff -r 548e5890a0c0 -r 3207b15ea607 external/gpl2/dtc/dist/data.c
--- a/external/gpl2/dtc/dist/data.c     Sun Dec 22 12:34:02 2019 +0000
+++ b/external/gpl2/dtc/dist/data.c     Sun Dec 22 12:38:24 2019 +0000
@@ -1,23 +1,8 @@
-/*     $NetBSD: data.c,v 1.3 2017/06/08 16:00:40 skrll Exp $   */
+/*     $NetBSD: data.c,v 1.4 2019/12/22 12:38:24 skrll Exp $   */
 
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * (C) Copyright David Gibson <dwg%au1.ibm.com@localhost>, IBM Corporation.  2005.
- *
- *
- * 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 2 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.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
- *                                                                   USA
  */
 
 #include "dtc.h"
@@ -76,7 +61,8 @@
        struct data d;
        char *q;
 
-       d = data_grow_for(empty_data, len + 1);
+       d = data_add_marker(empty_data, TYPE_STRING, NULL);
+       d = data_grow_for(d, len + 1);
 
        q = d.val;
        while (i < len) {
@@ -96,6 +82,7 @@
 {
        struct data d = empty_data;
 
+       d = data_add_marker(d, TYPE_NONE, NULL);
        while (!feof(f) && (d.len < maxlen)) {
                size_t chunksize, ret;
 
diff -r 548e5890a0c0 -r 3207b15ea607 external/gpl2/dtc/dist/dtc-lexer.l
--- a/external/gpl2/dtc/dist/dtc-lexer.l        Sun Dec 22 12:34:02 2019 +0000
+++ b/external/gpl2/dtc/dist/dtc-lexer.l        Sun Dec 22 12:38:24 2019 +0000
@@ -1,23 +1,8 @@
-/*     $NetBSD: dtc-lexer.l,v 1.3 2017/06/08 16:00:40 skrll Exp $      */
+/*     $NetBSD: dtc-lexer.l,v 1.4 2019/12/22 12:38:24 skrll Exp $      */
 
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * (C) Copyright David Gibson <dwg%au1.ibm.com@localhost>, IBM Corporation.  2005.
- *
- *
- * 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 2 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.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
- *                                                                   USA
  */
 
 %option noyywrap nounput noinput never-interactive
@@ -155,6 +140,13 @@
                        return DT_DEL_NODE;
                }
 
+<*>"/omit-if-no-ref/"  {
+                       DPRINT("Keyword: /omit-if-no-ref/\n");
+                       DPRINT("<PROPNODENAME>\n");
+                       BEGIN(PROPNODENAME);
+                       return DT_OMIT_NO_REF;
+               }
+
 <*>{LABEL}:    {
                        DPRINT("Label: %s\n", yytext);
                        yylval.labelref = xstrdup(yytext);
@@ -208,14 +200,14 @@
 <*>\&{LABEL}   {       /* label reference */
                        DPRINT("Ref: %s\n", yytext+1);
                        yylval.labelref = xstrdup(yytext+1);
-                       return DT_REF;
+                       return DT_LABEL_REF;
                }
 
 <*>"&{/"{PATHCHAR}*\}  {       /* new-style path reference */
                        yytext[yyleng-1] = '\0';
                        DPRINT("Ref: %s\n", yytext+2);
                        yylval.labelref = xstrdup(yytext+2);
-                       return DT_REF;
+                       return DT_PATH_REF;
                }
 
 <BYTESTRING>[0-9a-fA-F]{2} {
diff -r 548e5890a0c0 -r 3207b15ea607 external/gpl2/dtc/dist/dtc-parser.y
--- a/external/gpl2/dtc/dist/dtc-parser.y       Sun Dec 22 12:34:02 2019 +0000
+++ b/external/gpl2/dtc/dist/dtc-parser.y       Sun Dec 22 12:38:24 2019 +0000
@@ -1,23 +1,8 @@
-/*     $NetBSD: dtc-parser.y,v 1.3 2017/06/08 16:00:40 skrll Exp $     */
+/*     $NetBSD: dtc-parser.y,v 1.4 2019/12/22 12:38:24 skrll Exp $     */
 
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * (C) Copyright David Gibson <dwg%au1.ibm.com@localhost>, IBM Corporation.  2005.
- *
- *
- * 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 2 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.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
- *                                                                   USA
  */
 %{
 #include <stdio.h>
@@ -69,13 +54,15 @@
 %token DT_BITS
 %token DT_DEL_PROP
 %token DT_DEL_NODE
+%token DT_OMIT_NO_REF
 %token <propnodename> DT_PROPNODENAME
 %token <integer> DT_LITERAL
 %token <integer> DT_CHAR_LITERAL
 %token <byte> DT_BYTE
 %token <data> DT_STRING
 %token <labelref> DT_LABEL
-%token <labelref> DT_REF
+%token <labelref> DT_LABEL_REF
+%token <labelref> DT_PATH_REF
 %token DT_INCBIN
 
 %type <data> propdata
@@ -88,6 +75,7 @@
 %type <data> bytestring
 %type <prop> propdef
 %type <proplist> proplist
+%type <labelref> dt_ref
 
 %type <node> devicetree
 %type <node> nodedef
@@ -163,6 +151,8 @@
                }
        ;
 
+dt_ref: DT_LABEL_REF | DT_PATH_REF;
+
 devicetree:
          '/' nodedef
                {
@@ -172,8 +162,21 @@
                {
                        $$ = merge_nodes($1, $3);
                }
-
-       | devicetree DT_LABEL DT_REF nodedef
+       | dt_ref nodedef
+               {
+                       /*
+                        * We rely on the rule being always:
+                        *   versioninfo plugindecl memreserves devicetree
+                        * so $-1 is what we want (plugindecl)
+                        */
+                       if (!($<flags>-1 & DTSF_PLUGIN))
+                               ERROR(&@2, "Label or path %s not found", $1);
+                       $$ = add_orphan_node(
+                                       name_node(build_node(NULL, NULL, NULL),
+                                                 ""),
+                                       $2, $1);
+               }
+       | devicetree DT_LABEL dt_ref nodedef
                {
                        struct node *target = get_node_by_ref($1, $3);
 
@@ -184,17 +187,45 @@
                                ERROR(&@3, "Label or path %s not found", $3);
                        $$ = $1;
                }
-       | devicetree DT_REF nodedef
+       | devicetree DT_PATH_REF nodedef
+               {
+                       /*
+                        * We rely on the rule being always:
+                        *   versioninfo plugindecl memreserves devicetree
+                        * so $-1 is what we want (plugindecl)
+                        */
+                       if ($<flags>-1 & DTSF_PLUGIN) {
+                               add_orphan_node($1, $3, $2);
+                       } else {
+                               struct node *target = get_node_by_ref($1, $2);
+
+                               if (target)
+                                       merge_nodes(target, $3);
+                               else
+                                       ERROR(&@2, "Label or path %s not found", $2);
+                       }
+                       $$ = $1;
+               }
+       | devicetree DT_LABEL_REF nodedef
                {
                        struct node *target = get_node_by_ref($1, $2);
 
-                       if (target)
+                       if (target) {
                                merge_nodes(target, $3);
-                       else
-                               ERROR(&@2, "Label or path %s not found", $2);
+                       } else {
+                               /*
+                                * We rely on the rule being always:
+                                *   versioninfo plugindecl memreserves devicetree
+                                * so $-1 is what we want (plugindecl)
+                                */
+                               if ($<flags>-1 & DTSF_PLUGIN)
+                                       add_orphan_node($1, $3, $2);
+                               else
+                                       ERROR(&@2, "Label or path %s not found", $2);
+                       }
                        $$ = $1;
                }
-       | devicetree DT_DEL_NODE DT_REF ';'
+       | devicetree DT_DEL_NODE dt_ref ';'
                {
                        struct node *target = get_node_by_ref($1, $3);
 
@@ -206,12 +237,24 @@
 
                        $$ = $1;
                }
+       | devicetree DT_OMIT_NO_REF dt_ref ';'
+               {
+                       struct node *target = get_node_by_ref($1, $3);
+
+                       if (target)
+                               omit_node_if_unused(target);
+                       else
+                               ERROR(&@3, "Label or path %s not found", $3);
+
+
+                       $$ = $1;
+               }
        ;
 
 nodedef:
          '{' proplist subnodes '}' ';'
                {
-                       $$ = build_node($2, $3);
+                       $$ = build_node($2, $3, &@$);
                }
        ;
 
@@ -229,11 +272,11 @@
 propdef:
          DT_PROPNODENAME '=' propdata ';'
                {
-                       $$ = build_property($1, $3);
+                       $$ = build_property($1, $3, &@$);
                }
        | DT_PROPNODENAME ';'
                {
-                       $$ = build_property($1, empty_data);
+                       $$ = build_property($1, empty_data, &@$);
                }
        | DT_DEL_PROP DT_PROPNODENAME ';'
                {
@@ -259,8 +302,9 @@
                {
                        $$ = data_merge($1, $3);
                }
-       | propdataprefix DT_REF
+       | propdataprefix dt_ref
                {
+                       $1 = data_add_marker($1, TYPE_STRING, $2);
                        $$ = data_add_marker($1, REF_PATH, $2);
                }
        | propdataprefix DT_INCBIN '(' DT_STRING ',' integer_prim ',' integer_prim ')'
@@ -314,22 +358,27 @@
        DT_BITS DT_LITERAL '<'
                {
                        unsigned long long bits;



Home | Main Index | Thread Index | Old Index