2 # -*- coding: utf-8 -*-
5 Generate trace/generated-helpers.c.
8 __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
9 __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
10 __license__ = "GPL version 2 or (at your option) any later version"
12 __maintainer__ = "Stefan Hajnoczi"
13 __email__ = "stefanha@linux.vnet.ibm.com"
16 from tracetool import out
17 from tracetool.transform import *
20 def generate(events, backend):
21 events = [e for e in events
22 if "disable" not in e.properties]
24 out('/* This file is autogenerated by tracetool, do not edit. */',
26 '#include "qemu-common.h"',
28 '#include "exec/helper-proto.h"',
33 if "tcg-exec" not in e.properties:
36 # tracetool.generate always transforms types to host
37 e_args = e.original.args
39 values = ["(%s)%s" % (t, n)
40 for t, n in e.args.transform(TCG_2_TCG_HELPER_DEF)]
42 out('void %(name_tcg)s(%(args)s)',
44 ' %(name)s(%(values)s);',
46 name_tcg="helper_%s_proxy" % e.api(),
48 args=e_args.transform(HOST_2_TCG_COMPAT, TCG_2_TCG_HELPER_DEF),
49 values=", ".join(values),