input_filter: rm input selection in output node

This patch largely reverts the feature of selecting parts of input nodes
from within the output node (as originally introduced by commit
7263cae5a18b4f1f2293d031f9bafcf05ba51146). The selection of content
should be consistently performed by input nodes instead. The principle
ability of copying input nodes verbatim into the output stays available.

Issue #2691
This commit is contained in:
Norman Feske 2018-04-11 11:52:18 +02:00 committed by Christian Helmuth
parent afadbbbb04
commit 6389434222
3 changed files with 8 additions and 19 deletions

View File

@ -36,8 +36,8 @@ The '<output>' node can contain the following sub nodes:
nodes as the '<output>' node.
:'<input>':
Copies all sub nodes named by the 'sub_node' attribute of the input ROM
specified by the 'name' attribute to the output node.
Copies the content of the input specified by the 'name' attribute to the
output node.
:'<attribute>':
Adds an attribute with the specified 'name' and 'value'. If the node

View File

@ -429,18 +429,17 @@ class Rom_filter::Input_rom_registry
}
/**
* Lookup content of input with specified name
* Generate content of the specifed input
*
* \throw Nonexistent_input_value
* \throw Nonexistent_input_node
*/
Xml_node xml(Input_name const &input_name) const
void gen_xml(Input_name const &input_name, Genode::Xml_generator &xml)
{
Entry const *e = _lookup_entry_by_name(input_name);
if (!e)
throw Nonexistent_input_node();
return e->node();
xml.append(e->node().addr(), e->node().size());
}
};

View File

@ -345,23 +345,13 @@ void Rom_filter::Main::_evaluate_node(Xml_node node, Xml_generator &xml)
} else
if (node.has_type("input")) {
typedef Genode::String<128> String;
Input_name const input_name =
node.attribute_value("name", Input_name());
String const sub_node =
node.attribute_value("sub_node", String());
if (!sub_node.valid())
return;
try {
Xml_node input_node = _input_rom_registry.xml(input_name);
input_node.for_each_sub_node(sub_node.string(),
[&] (Xml_node node) { xml.append(node.addr(), node.size()); });
} catch (...) { }
_input_rom_registry.gen_xml(input_name, xml); }
catch (...) { }
}
};