tcg_helper_h.py (1335B)
1# -*- coding: utf-8 -*- 2 3""" 4Generate trace/generated-helpers.h. 5""" 6 7__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" 8__copyright__ = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>" 9__license__ = "GPL version 2 or (at your option) any later version" 10 11__maintainer__ = "Stefan Hajnoczi" 12__email__ = "stefanha@redhat.com" 13 14 15from tracetool import out 16from tracetool.transform import * 17import tracetool.vcpu 18 19 20def generate(events, backend, group): 21 events = [e for e in events 22 if "disable" not in e.properties] 23 24 out('/* This file is autogenerated by tracetool, do not edit. */', 25 '', 26 ) 27 28 for e in events: 29 if "tcg-exec" not in e.properties: 30 continue 31 32 # TCG helper proxy declaration 33 fmt = "DEF_HELPER_FLAGS_%(argc)d(%(name)s, %(flags)svoid%(types)s)" 34 e_args = tracetool.vcpu.transform_args("tcg_helper_c", e.original, "header") 35 args = e_args.transform(HOST_2_TCG_COMPAT, HOST_2_TCG, 36 TCG_2_TCG_HELPER_DECL) 37 types = ", ".join(args.types()) 38 if types != "": 39 types = ", " + types 40 41 flags = "TCG_CALL_NO_RWG, " 42 43 out(fmt, 44 flags=flags, 45 argc=len(args), 46 name=e.api() + "_proxy", 47 types=types, 48 )