aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2019-07-22 17:02:56 -0700
committerRichard Henderson <richard.henderson@linaro.org>2019-08-19 08:03:41 -0700
commit94597b6146f30f949f2c454f424082a2b0f55a0e (patch)
tree5436bccd14b058534d76aa5e0999d54c678bbe3c /docs
parent3fbd3405d2b0604ea530fc7a1828f19da1e95ff9 (diff)
downloadqemu-94597b6146f30f949f2c454f424082a2b0f55a0e.zip
qemu-94597b6146f30f949f2c454f424082a2b0f55a0e.tar.gz
qemu-94597b6146f30f949f2c454f424082a2b0f55a0e.tar.bz2
decodetree: Allow !function with no input bits
Call this form a "parameter", returning a value extracted from the DisasContext. Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/devel/decodetree.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/devel/decodetree.rst b/docs/devel/decodetree.rst
index 44ac621..ce7f523 100644
--- a/docs/devel/decodetree.rst
+++ b/docs/devel/decodetree.rst
@@ -23,7 +23,7 @@ Fields
Syntax::
- field_def := '%' identifier ( unnamed_field )+ ( !function=identifier )?
+ field_def := '%' identifier ( unnamed_field )* ( !function=identifier )?
unnamed_field := number ':' ( 's' ) number
For *unnamed_field*, the first number is the least-significant bit position
@@ -34,6 +34,12 @@ present, they are concatenated. In this way one can define disjoint fields.
If ``!function`` is specified, the concatenated result is passed through the
named function, taking and returning an integral value.
+One may use ``!function`` with zero ``unnamed_fields``. This case is called
+a *parameter*, and the named function is only passed the ``DisasContext``
+and returns an integral value extracted from there.
+
+A field with no ``unnamed_fields`` and no ``!function`` is in error.
+
FIXME: the fields of the structure into which this result will be stored
is restricted to ``int``. Which means that we cannot expand 64-bit items.