util: add helper APIs for dealing with inotify in portable manner
[qemu/ar7.git] / scripts / tracetool / format / tcg_helper_h.py
blob6b184b641b565d66e1f48ed2fbe9cafa2e689e72
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-2016, 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 *
18 import tracetool.vcpu
21 def generate(events, backend, group):
22 events = [e for e in events
23 if "disable" not in e.properties]
25 out('/* This file is autogenerated by tracetool, do not edit. */',
26 '',
29 for e in events:
30 if "tcg-exec" not in e.properties:
31 continue
33 # TCG helper proxy declaration
34 fmt = "DEF_HELPER_FLAGS_%(argc)d(%(name)s, %(flags)svoid%(types)s)"
35 e_args = tracetool.vcpu.transform_args("tcg_helper_c", e.original, "header")
36 args = e_args.transform(HOST_2_TCG_COMPAT, HOST_2_TCG,
37 TCG_2_TCG_HELPER_DECL)
38 types = ", ".join(args.types())
39 if types != "":
40 types = ", " + types
42 flags = "TCG_CALL_NO_RWG, "
44 out(fmt,
45 flags=flags,
46 argc=len(args),
47 name=e.api() + "_proxy",
48 types=types,