cleanup & fix qemu/header_gen.py

This commit is contained in:
Nguyen Anh Quynh 2020-05-27 14:43:12 +08:00
parent 5b25f3f53e
commit 17e7c80eba
17 changed files with 63 additions and 19 deletions

0
README.md Executable file → Normal file
View File

View File

@ -28,6 +28,3 @@ UNICORN_STATIC ?= yes
# a shared library.
UNICORN_SHARED ?= yes
#CFLAGS += -g

View File

@ -191,7 +191,6 @@ struct uc_struct {
void **l1_map; // qemu/translate-all.c
size_t l1_map_size;
/* code generation context */
// void *tcg_ctx; // for "TCGContext tcg_ctx" in qemu/translate-all.c
TCGContext *tcg_ctx;
/* memory.c */
unsigned memory_region_transaction_depth;

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_aarch64
#define gen_helper_exception_internal gen_helper_exception_internal_aarch64
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_aarch64
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_aarch64
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_aarch64
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_aarch64
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_aarch64
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_aarch64
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_aarch64
#define helper_exception_return helper_exception_return_aarch64
#define helper_exception_with_syndrome helper_exception_with_syndrome_aarch64
#define helper_float32_to_float64 helper_float32_to_float64_aarch64
#define helper_float64_to_float32 helper_float64_to_float32_aarch64
#define helper_get_cp_reg helper_get_cp_reg_aarch64
#define helper_get_cp_reg64 helper_get_cp_reg64_aarch64
#define helper_get_r13_banked helper_get_r13_banked_aarch64
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_aarch64
#define object_class_foreach object_class_foreach_aarch64
#define object_class_foreach_tramp object_class_foreach_tramp_aarch64
#define object_class_get_list object_class_get_list_aarch64
#define object_class_get_list_tramp object_class_get_list_tramp_aarch64
#define object_class_get_parent object_class_get_parent_aarch64
#define object_deinit object_deinit_aarch64

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_aarch64eb
#define gen_helper_exception_internal gen_helper_exception_internal_aarch64eb
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_aarch64eb
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_aarch64eb
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_aarch64eb
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_aarch64eb
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_aarch64eb
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_aarch64eb
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_aarch64eb
#define helper_exception_return helper_exception_return_aarch64eb
#define helper_exception_with_syndrome helper_exception_with_syndrome_aarch64eb
#define helper_float32_to_float64 helper_float32_to_float64_aarch64eb
#define helper_float64_to_float32 helper_float64_to_float32_aarch64eb
#define helper_get_cp_reg helper_get_cp_reg_aarch64eb
#define helper_get_cp_reg64 helper_get_cp_reg64_aarch64eb
#define helper_get_r13_banked helper_get_r13_banked_aarch64eb
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_aarch64eb
#define object_class_foreach object_class_foreach_aarch64eb
#define object_class_foreach_tramp object_class_foreach_tramp_aarch64eb
#define object_class_get_list object_class_get_list_aarch64eb
#define object_class_get_list_tramp object_class_get_list_tramp_aarch64eb
#define object_class_get_parent object_class_get_parent_aarch64eb
#define object_deinit object_deinit_aarch64eb

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_arm
#define gen_helper_exception_internal gen_helper_exception_internal_arm
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_arm
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_arm
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_arm
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_arm
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_arm
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_arm
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_arm
#define helper_exception_return helper_exception_return_arm
#define helper_exception_with_syndrome helper_exception_with_syndrome_arm
#define helper_float32_to_float64 helper_float32_to_float64_arm
#define helper_float64_to_float32 helper_float64_to_float32_arm
#define helper_get_cp_reg helper_get_cp_reg_arm
#define helper_get_cp_reg64 helper_get_cp_reg64_arm
#define helper_get_r13_banked helper_get_r13_banked_arm
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_arm
#define object_class_foreach object_class_foreach_arm
#define object_class_foreach_tramp object_class_foreach_tramp_arm
#define object_class_get_list object_class_get_list_arm
#define object_class_get_list_tramp object_class_get_list_tramp_arm
#define object_class_get_parent object_class_get_parent_arm
#define object_deinit object_deinit_arm

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_armeb
#define gen_helper_exception_internal gen_helper_exception_internal_armeb
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_armeb
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_armeb
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_armeb
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_armeb
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_armeb
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_armeb
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_armeb
#define helper_exception_return helper_exception_return_armeb
#define helper_exception_with_syndrome helper_exception_with_syndrome_armeb
#define helper_float32_to_float64 helper_float32_to_float64_armeb
#define helper_float64_to_float32 helper_float64_to_float32_armeb
#define helper_get_cp_reg helper_get_cp_reg_armeb
#define helper_get_cp_reg64 helper_get_cp_reg64_armeb
#define helper_get_r13_banked helper_get_r13_banked_armeb
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_armeb
#define object_class_foreach object_class_foreach_armeb
#define object_class_foreach_tramp object_class_foreach_tramp_armeb
#define object_class_get_list object_class_get_list_armeb
#define object_class_get_list_tramp object_class_get_list_tramp_armeb
#define object_class_get_parent object_class_get_parent_armeb
#define object_deinit object_deinit_armeb

View File

@ -4060,6 +4060,11 @@ sparc_symbols = (
'helper_divs',
'helper_fsqrt')
ppc_symbols = (
'helper_fsqrt',
'helper_divs',
)
if __name__ == '__main__':
arch = sys.argv[1]
@ -4087,5 +4092,9 @@ if __name__ == '__main__':
for s in sparc_symbols:
print("#define %s %s_%s" %(s, s, arch))
if 'ppc' in arch:
for s in ppc_symbols:
print("#define %s %s_%s" %(s, s, arch))
print("#endif")

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_m68k
#define gen_helper_exception_internal gen_helper_exception_internal_m68k
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_m68k
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_m68k
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_m68k
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_m68k
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_m68k
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_m68k
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_m68k
#define helper_exception_return helper_exception_return_m68k
#define helper_exception_with_syndrome helper_exception_with_syndrome_m68k
#define helper_float32_to_float64 helper_float32_to_float64_m68k
#define helper_float64_to_float32 helper_float64_to_float32_m68k
#define helper_get_cp_reg helper_get_cp_reg_m68k
#define helper_get_cp_reg64 helper_get_cp_reg64_m68k
#define helper_get_r13_banked helper_get_r13_banked_m68k
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_m68k
#define object_class_foreach object_class_foreach_m68k
#define object_class_foreach_tramp object_class_foreach_tramp_m68k
#define object_class_get_list object_class_get_list_m68k
#define object_class_get_list_tramp object_class_get_list_tramp_m68k
#define object_class_get_parent object_class_get_parent_m68k
#define object_deinit object_deinit_m68k

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_mips
#define gen_helper_exception_internal gen_helper_exception_internal_mips
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_mips
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_mips
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_mips
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_mips
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_mips
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_mips
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_mips
#define helper_exception_return helper_exception_return_mips
#define helper_exception_with_syndrome helper_exception_with_syndrome_mips
#define helper_float32_to_float64 helper_float32_to_float64_mips
#define helper_float64_to_float32 helper_float64_to_float32_mips
#define helper_get_cp_reg helper_get_cp_reg_mips
#define helper_get_cp_reg64 helper_get_cp_reg64_mips
#define helper_get_r13_banked helper_get_r13_banked_mips
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_mips
#define object_class_foreach object_class_foreach_mips
#define object_class_foreach_tramp object_class_foreach_tramp_mips
#define object_class_get_list object_class_get_list_mips
#define object_class_get_list_tramp object_class_get_list_tramp_mips
#define object_class_get_parent object_class_get_parent_mips
#define object_deinit object_deinit_mips

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_mips64
#define gen_helper_exception_internal gen_helper_exception_internal_mips64
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_mips64
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_mips64
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_mips64
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_mips64
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_mips64
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_mips64
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_mips64
#define helper_exception_return helper_exception_return_mips64
#define helper_exception_with_syndrome helper_exception_with_syndrome_mips64
#define helper_float32_to_float64 helper_float32_to_float64_mips64
#define helper_float64_to_float32 helper_float64_to_float32_mips64
#define helper_get_cp_reg helper_get_cp_reg_mips64
#define helper_get_cp_reg64 helper_get_cp_reg64_mips64
#define helper_get_r13_banked helper_get_r13_banked_mips64
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_mips64
#define object_class_foreach object_class_foreach_mips64
#define object_class_foreach_tramp object_class_foreach_tramp_mips64
#define object_class_get_list object_class_get_list_mips64
#define object_class_get_list_tramp object_class_get_list_tramp_mips64
#define object_class_get_parent object_class_get_parent_mips64
#define object_deinit object_deinit_mips64

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_mips64el
#define gen_helper_exception_internal gen_helper_exception_internal_mips64el
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_mips64el
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_mips64el
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_mips64el
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_mips64el
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_mips64el
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_mips64el
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_mips64el
#define helper_exception_return helper_exception_return_mips64el
#define helper_exception_with_syndrome helper_exception_with_syndrome_mips64el
#define helper_float32_to_float64 helper_float32_to_float64_mips64el
#define helper_float64_to_float32 helper_float64_to_float32_mips64el
#define helper_get_cp_reg helper_get_cp_reg_mips64el
#define helper_get_cp_reg64 helper_get_cp_reg64_mips64el
#define helper_get_r13_banked helper_get_r13_banked_mips64el
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_mips64el
#define object_class_foreach object_class_foreach_mips64el
#define object_class_foreach_tramp object_class_foreach_tramp_mips64el
#define object_class_get_list object_class_get_list_mips64el
#define object_class_get_list_tramp object_class_get_list_tramp_mips64el
#define object_class_get_parent object_class_get_parent_mips64el
#define object_deinit object_deinit_mips64el

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_mipsel
#define gen_helper_exception_internal gen_helper_exception_internal_mipsel
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_mipsel
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_mipsel
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_mipsel
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_mipsel
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_mipsel
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_mipsel
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_mipsel
#define helper_exception_return helper_exception_return_mipsel
#define helper_exception_with_syndrome helper_exception_with_syndrome_mipsel
#define helper_float32_to_float64 helper_float32_to_float64_mipsel
#define helper_float64_to_float32 helper_float64_to_float32_mipsel
#define helper_get_cp_reg helper_get_cp_reg_mipsel
#define helper_get_cp_reg64 helper_get_cp_reg64_mipsel
#define helper_get_r13_banked helper_get_r13_banked_mipsel
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_mipsel
#define object_class_foreach object_class_foreach_mipsel
#define object_class_foreach_tramp object_class_foreach_tramp_mipsel
#define object_class_get_list object_class_get_list_mipsel
#define object_class_get_list_tramp object_class_get_list_tramp_mipsel
#define object_class_get_parent object_class_get_parent_mipsel
#define object_deinit object_deinit_mipsel

View File

@ -1,8 +1,6 @@
/* Autogen header for Unicorn Engine - DONOT MODIFY */
#ifndef UNICORN_AUTOGEN_PPC_H
#define UNICORN_AUTOGEN_PPC_H
#define helper_divs helper_divs_ppc
#define helper_fsqrt helper_fsqrt_ppc
#define arm_release arm_release_ppc
#define aarch64_tb_set_jmp_target aarch64_tb_set_jmp_target_ppc
#define ppc_tb_set_jmp_target ppc_tb_set_jmp_target_ppc
@ -2120,7 +2118,6 @@
#define object_child_foreach object_child_foreach_ppc
#define object_class_foreach object_class_foreach_ppc
#define object_class_foreach_tramp object_class_foreach_tramp_ppc
//#define object_class_get_list object_class_get_list_ppc
#define object_class_get_list_tramp object_class_get_list_tramp_ppc
#define object_class_get_parent object_class_get_parent_ppc
#define object_deinit object_deinit_ppc
@ -3023,4 +3020,6 @@
#define xpsr_write xpsr_write_ppc
#define xscale_cpar_write xscale_cpar_write_ppc
#define xscale_cp_reginfo xscale_cp_reginfo_ppc
#define helper_fsqrt helper_fsqrt_ppc
#define helper_divs helper_divs_ppc
#endif

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_sparc
#define gen_helper_exception_internal gen_helper_exception_internal_sparc
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_sparc
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_sparc
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_sparc
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_sparc
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_sparc
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_sparc
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_sparc
#define helper_exception_return helper_exception_return_sparc
#define helper_exception_with_syndrome helper_exception_with_syndrome_sparc
#define helper_float32_to_float64 helper_float32_to_float64_sparc
#define helper_float64_to_float32 helper_float64_to_float32_sparc
#define helper_get_cp_reg helper_get_cp_reg_sparc
#define helper_get_cp_reg64 helper_get_cp_reg64_sparc
#define helper_get_r13_banked helper_get_r13_banked_sparc
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_sparc
#define object_class_foreach object_class_foreach_sparc
#define object_class_foreach_tramp object_class_foreach_tramp_sparc
#define object_class_get_list object_class_get_list_sparc
#define object_class_get_list_tramp object_class_get_list_tramp_sparc
#define object_class_get_parent object_class_get_parent_sparc
#define object_deinit object_deinit_sparc
@ -3089,4 +3092,6 @@
#define cpu_cwp_dec cpu_cwp_dec_sparc
#define helper_save helper_save_sparc
#define helper_restore helper_restore_sparc
#define helper_divs helper_divs_sparc
#define helper_fsqrt helper_fsqrt_sparc
#endif

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_sparc64
#define gen_helper_exception_internal gen_helper_exception_internal_sparc64
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_sparc64
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_sparc64
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_sparc64
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_sparc64
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_sparc64
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_sparc64
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_sparc64
#define helper_exception_return helper_exception_return_sparc64
#define helper_exception_with_syndrome helper_exception_with_syndrome_sparc64
#define helper_float32_to_float64 helper_float32_to_float64_sparc64
#define helper_float64_to_float32 helper_float64_to_float32_sparc64
#define helper_get_cp_reg helper_get_cp_reg_sparc64
#define helper_get_cp_reg64 helper_get_cp_reg64_sparc64
#define helper_get_r13_banked helper_get_r13_banked_sparc64
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_sparc64
#define object_class_foreach object_class_foreach_sparc64
#define object_class_foreach_tramp object_class_foreach_tramp_sparc64
#define object_class_get_list object_class_get_list_sparc64
#define object_class_get_list_tramp object_class_get_list_tramp_sparc64
#define object_class_get_parent object_class_get_parent_sparc64
#define object_deinit object_deinit_sparc64
@ -3089,4 +3092,6 @@
#define cpu_cwp_dec cpu_cwp_dec_sparc64
#define helper_save helper_save_sparc64
#define helper_restore helper_restore_sparc64
#define helper_divs helper_divs_sparc64
#define helper_fsqrt helper_fsqrt_sparc64
#endif

View File

@ -656,6 +656,8 @@
#define gen_helper_double_saturate gen_helper_double_saturate_x86_64
#define gen_helper_exception_internal gen_helper_exception_internal_x86_64
#define gen_helper_exception_with_syndrome gen_helper_exception_with_syndrome_x86_64
#define gen_helper_float64_to_float32 gen_helper_float64_to_float32_x86_64
#define gen_helper_float32_to_float64 gen_helper_float32_to_float64_x86_64
#define gen_helper_get_cp_reg gen_helper_get_cp_reg_x86_64
#define gen_helper_get_cp_reg64 gen_helper_get_cp_reg64_x86_64
#define gen_helper_get_r13_banked gen_helper_get_r13_banked_x86_64
@ -1376,6 +1378,8 @@
#define helper_exception_internal helper_exception_internal_x86_64
#define helper_exception_return helper_exception_return_x86_64
#define helper_exception_with_syndrome helper_exception_with_syndrome_x86_64
#define helper_float32_to_float64 helper_float32_to_float64_x86_64
#define helper_float64_to_float32 helper_float64_to_float32_x86_64
#define helper_get_cp_reg helper_get_cp_reg_x86_64
#define helper_get_cp_reg64 helper_get_cp_reg64_x86_64
#define helper_get_r13_banked helper_get_r13_banked_x86_64
@ -2114,7 +2118,6 @@
#define object_child_foreach object_child_foreach_x86_64
#define object_class_foreach object_class_foreach_x86_64
#define object_class_foreach_tramp object_class_foreach_tramp_x86_64
#define object_class_get_list object_class_get_list_x86_64
#define object_class_get_list_tramp object_class_get_list_tramp_x86_64
#define object_class_get_parent object_class_get_parent_x86_64
#define object_deinit object_deinit_x86_64