summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Henderson2019-03-21 03:21:31 +0100
committerRichard Henderson2019-05-06 20:18:34 +0200
commit451e4ffdb0003ab5ed0d98bd37b385c076aba183 (patch)
treea44e43ec7a72ee85d3c1d4b29fb09024311c87bf /scripts
parentdecodetree: Expand a decode_load function (diff)
downloadqemu-451e4ffdb0003ab5ed0d98bd37b385c076aba183.tar.gz
qemu-451e4ffdb0003ab5ed0d98bd37b385c076aba183.tar.xz
qemu-451e4ffdb0003ab5ed0d98bd37b385c076aba183.zip
decodetree: Add DisasContext argument to !function expanders
This does require adjusting all existing users. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/decodetree.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index 4536e3a63d..81874e22cc 100755
--- a/scripts/decodetree.py
+++ b/scripts/decodetree.py
@@ -256,7 +256,7 @@ class FunctionField:
return self.func + '(' + str(self.base) + ')'
def str_extract(self):
- return self.func + '(' + self.base.str_extract() + ')'
+ return self.func + '(ctx, ' + self.base.str_extract() + ')'
def __eq__(self, other):
return self.func == other.func and self.base == other.base
@@ -318,7 +318,7 @@ class Format(General):
return decode_function + '_extract_' + self.name
def output_extract(self):
- output('static void ', self.extract_name(), '(',
+ output('static void ', self.extract_name(), '(DisasContext *ctx, ',
self.base.struct_name(), ' *a, ', insntype, ' insn)\n{\n')
for n, f in self.fields.items():
output(' a->', n, ' = ', f.str_extract(), ';\n')
@@ -343,7 +343,8 @@ class Pattern(General):
arg = self.base.base.name
output(ind, '/* ', self.file, ':', str(self.lineno), ' */\n')
if not extracted:
- output(ind, self.base.extract_name(), '(&u.f_', arg, ', insn);\n')
+ output(ind, self.base.extract_name(),
+ '(ctx, &u.f_', arg, ', insn);\n')
for n, f in self.fields.items():
output(ind, 'u.f_', arg, '.', n, ' = ', f.str_extract(), ';\n')
output(ind, 'if (', translate_prefix, '_', self.name,
@@ -894,7 +895,7 @@ class Tree:
# extract the fields now.
if not extracted and self.base:
output(ind, self.base.extract_name(),
- '(&u.f_', self.base.base.name, ', insn);\n')
+ '(ctx, &u.f_', self.base.base.name, ', insn);\n')
extracted = True
# Attempt to aid the compiler in producing compact switch statements.