hw/arm/virt-acpi-build: Add SPCR table
[qemu/ar7.git] / scripts / tracetool / format / tcg_helper_h.py
bloba8ba7ba8e36337889449b709a6040d8b3150dd0f
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 """
5 Generate trace/generated-helpers.h.
6 """
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. */',
25 '',
28 for e in events:
29 if "tcg-exec" not in e.properties:
30 continue
32 # tracetool.generate always transforms types to host
33 e_args = e.original.args
35 # TCG helper proxy declaration
36 fmt = "DEF_HELPER_FLAGS_%(argc)d(%(name)s, %(flags)svoid%(types)s)"
37 args = e_args.transform(HOST_2_TCG_COMPAT, HOST_2_TCG,
38 TCG_2_TCG_HELPER_DECL)
39 types = ", ".join(args.types())
40 if types != "":
41 types = ", " + types
43 flags = "TCG_CALL_NO_RWG, "
45 out(fmt,
46 flags=flags,
47 argc=len(args),
48 name=e.api() + "_proxy",
49 types=types,