summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schauer Marin Rodrigues <josch@mister-muffin.de>2023-08-25 23:45:03 +0200
committerJohannes Schauer Marin Rodrigues <josch@mister-muffin.de>2023-08-25 23:45:03 +0200
commit86ed2d621cef7e82183b7f16b9ac1078ec418645 (patch)
tree6eca7b05c772bbe48d08c8c57832f11eafd9895d
parent914dac603defe61168d6ee6a4bc0c2a055be86bc (diff)
parentd66ecf0cbcc1d5734bb882746a2c45a712b4b9b3 (diff)
Update upstream source from tag 'upstream/0.2.4+dfsg'
Update to upstream version '0.2.4+dfsg' with Debian dir 5f289320867a4643f766e06cbc68955bdd565aea
-rw-r--r--.gitignore67
-rw-r--r--[-rwxr-xr-x]CMakeLists.txt200
-rw-r--r--README.md (renamed from docs/README.md)27
-rw-r--r--README_CN.md113
-rw-r--r--README_UK.md119
-rw-r--r--docs/CHANGELOG.md41
-rw-r--r--[-rwxr-xr-x]docs/COMPILE.md173
-rw-r--r--docs/README_CN.md119
-rw-r--r--[-rwxr-xr-x]docs/USAGE.md31
-rw-r--r--docs/box64.pod465
-rw-r--r--[-rwxr-xr-x]docs/img/Box64Icon.pngbin63691 -> 63691 bytes
-rw-r--r--[-rwxr-xr-x]docs/img/Box64Logo.pngbin184304 -> 184304 bytes
-rwxr-xr-xrebuild_wrappers.py91
-rw-r--r--[-rwxr-xr-x]runTest.cmake0
-rw-r--r--[-rwxr-xr-x]src/box64context.c92
-rw-r--r--[-rwxr-xr-x]src/box64version.h2
-rw-r--r--[-rwxr-xr-x]src/build_info.c0
-rw-r--r--[-rwxr-xr-x]src/build_info.h2
-rw-r--r--src/custommem.c238
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/arm64_emitter.h158
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/arm64_epilog.S0
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/arm64_lock.S30
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/arm64_lock.h30
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/arm64_next.S0
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/arm64_printer.c214
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/arm64_prolog.S0
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_00.c676
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_0f.c375
-rw-r--r--src/dynarec/arm64/dynarec_arm64_64.c179
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_66.c311
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_660f.c702
-rw-r--r--src/dynarec/arm64/dynarec_arm64_6664.c21
-rw-r--r--src/dynarec/arm64/dynarec_arm64_66f0.c63
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_67.c215
-rw-r--r--src/dynarec/arm64/dynarec_arm64_d8.c34
-rw-r--r--src/dynarec/arm64/dynarec_arm64_d9.c46
-rw-r--r--src/dynarec/arm64/dynarec_arm64_db.c41
-rw-r--r--src/dynarec/arm64/dynarec_arm64_dc.c34
-rw-r--r--src/dynarec/arm64/dynarec_arm64_dd.c32
-rw-r--r--src/dynarec/arm64/dynarec_arm64_de.c37
-rw-r--r--src/dynarec/arm64/dynarec_arm64_df.c166
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_emit_logic.c2
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_emit_math.c4
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_emit_shift.c4
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_emit_tests.c19
-rw-r--r--src/dynarec/arm64/dynarec_arm64_f0.c184
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_f20f.c102
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_f30f.c96
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_functions.c579
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_functions.h71
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_helper.c504
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_helper.h239
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_pass0.h9
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_pass1.h0
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_pass2.h12
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_pass3.h70
-rw-r--r--[-rwxr-xr-x]src/dynarec/arm64/dynarec_arm64_private.h51
-rw-r--r--[-rwxr-xr-x]src/dynarec/dynablock.c157
-rw-r--r--[-rwxr-xr-x]src/dynarec/dynablock_private.h5
-rw-r--r--[-rwxr-xr-x]src/dynarec/dynarec.c215
-rw-r--r--[-rwxr-xr-x]src/dynarec/dynarec_arch.h33
-rw-r--r--[-rwxr-xr-x]src/dynarec/dynarec_helper.h2
-rw-r--r--[-rwxr-xr-x]src/dynarec/dynarec_native.c193
-rw-r--r--src/dynarec/dynarec_native_functions.c481
-rw-r--r--src/dynarec/dynarec_native_functions.h66
-rw-r--r--[-rwxr-xr-x]src/dynarec/dynarec_native_pass.c173
-rw-r--r--src/dynarec/dynarec_next.h11
-rw-r--r--[-rwxr-xr-x]src/dynarec/dynarec_private.h0
-rw-r--r--[-rwxr-xr-x]src/dynarec/native_lock.h44
-rw-r--r--src/dynarec/rv64/dynarec_rv64_00.c41
-rw-r--r--src/dynarec/rv64/dynarec_rv64_00_0.c497
-rw-r--r--src/dynarec/rv64/dynarec_rv64_00_1.c297
-rw-r--r--src/dynarec/rv64/dynarec_rv64_00_2.c845
-rw-r--r--src/dynarec/rv64/dynarec_rv64_00_3.c1198
-rw-r--r--src/dynarec/rv64/dynarec_rv64_0f.c1742
-rw-r--r--src/dynarec/rv64/dynarec_rv64_64.c496
-rw-r--r--src/dynarec/rv64/dynarec_rv64_66.c1020
-rw-r--r--src/dynarec/rv64/dynarec_rv64_660f.c2644
-rw-r--r--src/dynarec/rv64/dynarec_rv64_6664.c105
-rw-r--r--src/dynarec/rv64/dynarec_rv64_66f0.c195
-rw-r--r--src/dynarec/rv64/dynarec_rv64_67.c631
-rw-r--r--src/dynarec/rv64/dynarec_rv64_d8.c182
-rw-r--r--src/dynarec/rv64/dynarec_rv64_d9.c426
-rw-r--r--src/dynarec/rv64/dynarec_rv64_db.c303
-rw-r--r--src/dynarec/rv64/dynarec_rv64_dc.c119
-rw-r--r--src/dynarec/rv64/dynarec_rv64_dd.c179
-rw-r--r--src/dynarec/rv64/dynarec_rv64_de.c177
-rw-r--r--src/dynarec/rv64/dynarec_rv64_df.c244
-rw-r--r--src/dynarec/rv64/dynarec_rv64_emit_logic.c478
-rw-r--r--src/dynarec/rv64/dynarec_rv64_emit_math.c1441
-rw-r--r--src/dynarec/rv64/dynarec_rv64_emit_shift.c618
-rw-r--r--src/dynarec/rv64/dynarec_rv64_emit_tests.c349
-rw-r--r--src/dynarec/rv64/dynarec_rv64_f0.c691
-rw-r--r--src/dynarec/rv64/dynarec_rv64_f20f.c377
-rw-r--r--src/dynarec/rv64/dynarec_rv64_f30f.c522
-rw-r--r--src/dynarec/rv64/dynarec_rv64_functions.c564
-rw-r--r--src/dynarec/rv64/dynarec_rv64_functions.h52
-rw-r--r--src/dynarec/rv64/dynarec_rv64_helper.c2174
-rw-r--r--src/dynarec/rv64/dynarec_rv64_helper.h1348
-rw-r--r--src/dynarec/rv64/dynarec_rv64_jmpnext.c19
-rw-r--r--src/dynarec/rv64/dynarec_rv64_pass0.h55
-rw-r--r--src/dynarec/rv64/dynarec_rv64_pass1.h15
-rw-r--r--src/dynarec/rv64/dynarec_rv64_pass2.h18
-rw-r--r--src/dynarec/rv64/dynarec_rv64_pass3.h23
-rw-r--r--src/dynarec/rv64/dynarec_rv64_private.h150
-rw-r--r--src/dynarec/rv64/rv64_emitter.h654
-rw-r--r--src/dynarec/rv64/rv64_epilog.S65
-rw-r--r--src/dynarec/rv64/rv64_lock.S232
-rw-r--r--src/dynarec/rv64/rv64_lock.h60
-rw-r--r--src/dynarec/rv64/rv64_next.S51
-rw-r--r--src/dynarec/rv64/rv64_printer.c1450
-rw-r--r--src/dynarec/rv64/rv64_printer.h8
-rw-r--r--src/dynarec/rv64/rv64_prolog.S66
-rw-r--r--src/elfs/elfdwarf_private.c10
-rw-r--r--[-rwxr-xr-x]src/elfs/elfload_dump.c0
-rw-r--r--[-rwxr-xr-x]src/elfs/elfloader.c332
-rw-r--r--[-rwxr-xr-x]src/elfs/elfloader_private.h6
-rw-r--r--[-rwxr-xr-x]src/elfs/elfparser.c56
-rw-r--r--src/emu/modrm.h37
-rw-r--r--[-rwxr-xr-x]src/emu/x64emu.c182
-rw-r--r--[-rwxr-xr-x]src/emu/x64emu_private.h43
-rw-r--r--[-rwxr-xr-x]src/emu/x64int3.c29
-rw-r--r--[-rwxr-xr-x]src/emu/x64primop.c0
-rw-r--r--[-rwxr-xr-x]src/emu/x64primop.h0
-rw-r--r--[-rwxr-xr-x]src/emu/x64run.c707
-rw-r--r--src/emu/x64run0f.c181
-rw-r--r--src/emu/x64run64.c177
-rw-r--r--src/emu/x64run66.c236
-rw-r--r--src/emu/x64run660f.c351
-rw-r--r--src/emu/x64run6664.c32
-rw-r--r--src/emu/x64run66d9.c9
-rw-r--r--src/emu/x64run66dd.c9
-rw-r--r--src/emu/x64run66f0.c279
-rw-r--r--src/emu/x64run67.c34
-rw-r--r--src/emu/x64run670f.c44
-rw-r--r--src/emu/x64run6764_32.c67
-rw-r--r--src/emu/x64run6766.c31
-rw-r--r--src/emu/x64run67660f.c8
-rw-r--r--src/emu/x64run67_32.c100
-rw-r--r--[-rwxr-xr-x]src/emu/x64run_private.c428
-rw-r--r--[-rwxr-xr-x]src/emu/x64run_private.h117
-rw-r--r--src/emu/x64rund8.c23
-rw-r--r--src/emu/x64rund9.c19
-rw-r--r--src/emu/x64runda.c23
-rw-r--r--src/emu/x64rundb.c25
-rw-r--r--src/emu/x64rundc.c9
-rw-r--r--src/emu/x64rundd.c32
-rw-r--r--src/emu/x64runde.c7
-rw-r--r--src/emu/x64rundf.c22
-rw-r--r--src/emu/x64runf0.c189
-rw-r--r--src/emu/x64runf20f.c41
-rw-r--r--src/emu/x64runf30f.c47
-rw-r--r--[-rwxr-xr-x]src/emu/x64syscall.c46
-rw-r--r--src/emu/x64test.c160
-rw-r--r--[-rwxr-xr-x]src/emu/x64tls.c185
-rw-r--r--[-rwxr-xr-x]src/emu/x64trace.c19
-rwxr-xr-xsrc/emu/x86syscall.c284
-rw-r--r--[-rwxr-xr-x]src/emu/x86zydis.h0
-rw-r--r--[-rwxr-xr-x]src/emu/x87emu_private.c4
-rw-r--r--[-rwxr-xr-x]src/emu/x87emu_private.h6
-rw-r--r--[-rwxr-xr-x]src/include/auxval.h0
-rw-r--r--src/include/bitutils.h10
-rw-r--r--[-rwxr-xr-x]src/include/box64context.h51
-rw-r--r--[-rwxr-xr-x]src/include/box64stack.h9
-rw-r--r--[-rwxr-xr-x]src/include/bridge.h10
-rw-r--r--[-rwxr-xr-x]src/include/callback.h7
-rw-r--r--src/include/complext.h33
-rw-r--r--[-rwxr-xr-x]src/include/cpu_info.h0
-rw-r--r--src/include/custommem.h14
-rw-r--r--[-rwxr-xr-x]src/include/debug.h10
-rw-r--r--[-rwxr-xr-x]src/include/dictionnary.h2
-rw-r--r--[-rwxr-xr-x]src/include/dynablock.h8
-rw-r--r--[-rwxr-xr-x]src/include/dynarec.h3
-rw-r--r--[-rwxr-xr-x]src/include/dynarec_native.h15
-rw-r--r--src/include/dynarec_rv64.h10
-rw-r--r--[-rwxr-xr-x]src/include/elfload_dump.h0
-rw-r--r--[-rwxr-xr-x]src/include/elfloader.h14
-rw-r--r--[-rwxr-xr-x]src/include/fileutils.h4
-rw-r--r--[-rwxr-xr-x]src/include/globalsymbols.h16
-rw-r--r--[-rwxr-xr-x]src/include/gtkclass.h217
-rw-r--r--[-rwxr-xr-x]src/include/khash.h0
-rw-r--r--[-rwxr-xr-x]src/include/librarian.h22
-rw-r--r--[-rwxr-xr-x]src/include/library.h15
-rw-r--r--[-rwxr-xr-x]src/include/myalign.h15
-rw-r--r--[-rwxr-xr-x]src/include/pathcoll.h0
-rw-r--r--src/include/rcfile.h2
-rw-r--r--[-rwxr-xr-x]src/include/regs.h6
-rw-r--r--[-rwxr-xr-x]src/include/sdl1rwops.h2
-rw-r--r--[-rwxr-xr-x]src/include/sdl2rwops.h2
-rw-r--r--[-rwxr-xr-x]src/include/signals.h3
-rw-r--r--src/include/symbols.h7
-rw-r--r--[-rwxr-xr-x]src/include/threads.h12
-rw-r--r--[-rwxr-xr-x]src/include/wine_tools.h4
-rw-r--r--[-rwxr-xr-x]src/include/wrappedlibs.h2
-rw-r--r--[-rwxr-xr-x]src/include/x64emu.h19
-rw-r--r--[-rwxr-xr-x]src/include/x64run.h6
-rw-r--r--[-rwxr-xr-x]src/include/x64tls.h6
-rw-r--r--[-rwxr-xr-x]src/include/x64trace.h5
-rw-r--r--[-rwxr-xr-x]src/librarian/dictionnary.c0
-rw-r--r--[-rwxr-xr-x]src/librarian/globalsymbols.c92
-rw-r--r--[-rwxr-xr-x]src/librarian/librarian.c315
-rw-r--r--[-rwxr-xr-x]src/librarian/librarian_private.h0
-rw-r--r--[-rwxr-xr-x]src/librarian/library.c331
-rw-r--r--[-rwxr-xr-x]src/librarian/library_private.h8
-rw-r--r--src/librarian/symbols.c15
-rw-r--r--[-rwxr-xr-x]src/library_list.h16
-rw-r--r--[-rwxr-xr-x]src/libtools/auxval.c0
-rw-r--r--[-rwxr-xr-x]src/libtools/myalign.c6
-rw-r--r--[-rwxr-xr-x]src/libtools/obstack.c6
-rw-r--r--[-rwxr-xr-x]src/libtools/sdl1rwops.c10
-rw-r--r--[-rwxr-xr-x]src/libtools/sdl2rwops.c41
-rw-r--r--[-rwxr-xr-x]src/libtools/signals.c403
-rw-r--r--[-rwxr-xr-x]src/libtools/threads.c103
-rw-r--r--[-rwxr-xr-x]src/main.c126
-rw-r--r--src/mallochook.c208
-rw-r--r--src/rv64detect.c70
-rw-r--r--src/tools/bitutils.c22
-rw-r--r--[-rwxr-xr-x]src/tools/box64stack.c101
-rw-r--r--[-rwxr-xr-x]src/tools/bridge.c63
-rw-r--r--[-rwxr-xr-x]src/tools/bridge_private.h0
-rw-r--r--[-rwxr-xr-x]src/tools/callback.c110
-rw-r--r--[-rwxr-xr-x]src/tools/fileutils.c0
-rw-r--r--[-rwxr-xr-x]src/tools/gtkclass.c1621
-rw-r--r--src/tools/my_cpuid.c8
-rw-r--r--[-rwxr-xr-x]src/tools/pathcoll.c0
-rw-r--r--src/tools/rcfile.c17
-rw-r--r--[-rwxr-xr-x]src/tools/wine_tools.c4
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedalure.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedalure_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedalut.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedalut_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedatk.c33
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedatk_private.h260
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedatkbridge.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedatkbridge_private.h0
-rw-r--r--src/wrapped/wrappedatomic_private.h8
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedatspi.c78
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedatspi_private.h46
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedbz2.c4
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedbz2_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedcairo.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedcairo_private.h250
-rw-r--r--src/wrapped/wrappedcairogobject_private.h66
-rw-r--r--src/wrapped/wrappedcap.c18
-rw-r--r--src/wrapped/wrappedcap_private.h62
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedcrashhandler.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedcrashhandler_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedcrypto.c292
-rw-r--r--src/wrapped/wrappedcrypto3.c466
-rw-r--r--src/wrapped/wrappedcrypto3_private.h3893
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedcrypto_private.h128
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedcurl.c22
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedcurl_private.h0
-rw-r--r--src/wrapped/wrappedd3dadapter9.c10
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappeddbus.c144
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappeddbus_private.h24
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappeddbusglib1.c48
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappeddbusglib1_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedexpat.c188
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedexpat_private.h2
-rw-r--r--src/wrapped/wrappedfaudio.c120
-rw-r--r--src/wrapped/wrappedfaudio_private.h14
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedflac.c118
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedflac_private.h164
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedfontconfig.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedfontconfig_private.h144
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedfreetype.c86
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedfreetype_private.h55
-rw-r--r--src/wrapped/wrappedgconf2.c67
-rw-r--r--src/wrapped/wrappedgconf2_private.h208
-rw-r--r--src/wrapped/wrappedgcrypt_private.h2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgdk3.c67
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgdk3_private.h105
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgdkpixbuf2.c8
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgdkpixbuf2_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgdkx112.c14
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgdkx112_private.h164
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgio2.c163
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgio2_private.h1562
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedglib2.c253
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedglib2_private.h558
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgmodule2.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgmodule2_private.h2
-rw-r--r--src/wrapped/wrappedgmp.c138
-rw-r--r--src/wrapped/wrappedgmp_private.h100
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgnutls.c24
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgnutls_private.h7
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgobject2.c164
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgobject2_private.h122
-rw-r--r--src/wrapped/wrappedgomp.c18
-rw-r--r--src/wrapped/wrappedgomp_private.h477
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgssapi.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgssapi_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgssapikrb5.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgssapikrb5_private.h0
-rw-r--r--src/wrapped/wrappedgstapp_private.h2
-rw-r--r--src/wrapped/wrappedgstaudio_private.h112
-rw-r--r--src/wrapped/wrappedgstbase_private.h144
-rw-r--r--src/wrapped/wrappedgstgl_private.h106
-rw-r--r--src/wrapped/wrappedgstreamer.c142
-rw-r--r--src/wrapped/wrappedgstreamer_private.h930
-rw-r--r--src/wrapped/wrappedgstvideo_private.h242
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgthread2.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgthread2_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgtk3.c180
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgtk3_private.h1323
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgtkx112.c256
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedgtkx112_private.h1222
-rw-r--r--src/wrapped/wrappedicui18n67.c29
-rw-r--r--src/wrapped/wrappedicui18n67_private.h100
-rw-r--r--src/wrapped/wrappedicui18n72.c29
-rw-r--r--src/wrapped/wrappedicui18n72_private.h103
-rw-r--r--src/wrapped/wrappedicuuc67.c28
-rw-r--r--src/wrapped/wrappedicuuc67_private.h86
-rw-r--r--src/wrapped/wrappedicuuc72.c28
-rw-r--r--src/wrapped/wrappedicuuc72_private.h86
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedkrb5.c8
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedkrb5_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlber.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlber_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedldapr.c8
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedldapr_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedldlinux.c14
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedldlinux_private.h2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlib_init.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibasound.c35
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibasound_private.h9
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibc.c377
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibc_private.h271
-rw-r--r--src/wrapped/wrappedlibcmusl.c35
-rw-r--r--src/wrapped/wrappedlibcmusl_private.h4
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibcrypt.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibcrypt_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibcups.c49
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibcups_private.h34
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibdl.c207
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibdl_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibdrm.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibdrm_private.h18
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibegl.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibegl_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibfuse.c294
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibfuse_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibgl.c12
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibgl_private.h5656
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibglu.c6
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibglu_private.h0
-rw-r--r--src/wrapped/wrappedlibharfbuzz.c1217
-rw-r--r--src/wrapped/wrappedlibharfbuzz_private.h443
-rw-r--r--src/wrapped/wrappedlibibus.c2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibice.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibice_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibm.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibm_private.h83
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibncurses.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibncurses6.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibncurses6_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibncurses_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibncursesw.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibncursesw6.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibncursesw6_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibncursesw_private.h0
-rw-r--r--src/wrapped/wrappedlibnuma.c25
-rw-r--r--src/wrapped/wrappedlibnuma_private.h107
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibogg.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibogg_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibpanel.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibpanel_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibpcre.c2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibpcre_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibpthread.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibpthread_private.h119
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibresolv_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibrt.c2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibrt_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibsm.c10
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibsm_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibsndfile.c10
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibsndfile_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibssl.c203
-rw-r--r--src/wrapped/wrappedlibssl3.c367
-rw-r--r--src/wrapped/wrappedlibssl3_private.h605
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibssl_private.h57
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibtinfo.c2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibtinfo6.c2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibtinfo6_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibtinfo_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibusb1.c6
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibusb1_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibuuid.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibuuid_private.h0
-rw-r--r--src/wrapped/wrappedlibva.c69
-rw-r--r--src/wrapped/wrappedlibva_private.h4
-rw-r--r--src/wrapped/wrappedlibvdpau.c24
-rw-r--r--src/wrapped/wrappedlibvdpau_private.h2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibvorbis.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibvorbis_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibx11.c62
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibx11_private.h992
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxau.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxau_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcb.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcb_private.h8
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbdri2.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbdri2_private.h2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbdri3.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbdri3_private.h2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbimage.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbimage_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbkeysyms.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbkeysyms_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbrandr.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbrandr_private.h26
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbshape.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbshape_private.h10
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbshm.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbshm_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbxfixes.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbxfixes_private.h12
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbxtest.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcbxtest_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcomposite.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcomposite_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcursor.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxcursor_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxdamage.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxdamage_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxdmcp.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxdmcp_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxext.c317
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxext_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxfixes.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxfixes_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxft.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxft_private.h16
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxi.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxi_private.h4
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxmu.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxmu_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxpm.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxpm_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxrandr.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxrandr_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxrender.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxrender_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxss.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxss_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxt.c6
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxt_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxtst.c2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxtst_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxxf86vm.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibxxf86vm_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlibz.c71
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlzma.c148
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedlzma_private.h94
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedmpg123.c11
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedmpg123_private.h114
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappednsl.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappednsl_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappednspr4.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappednspr4_private.h318
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappednss3.c33
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappednss3_private.h1054
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappednssutil3.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappednssutil3_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedopenal.c12
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedopenal_private.h26
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpango.c6
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpango_private.h170
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpangocairo.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpangocairo_private.h6
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpangoft2.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpangoft2_private.h2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedplc4.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedplc4_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedplds4.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedplds4_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpng16.c22
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpng16_private.h1
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpulse.c96
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpulse_private.h48
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpulsesimple.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedpulsesimple_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1.c8
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1_private.h56
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1image.c2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1image_private.h6
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1mixer.c10
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1mixer_private.h20
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1net.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1net_private.h2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1sound.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1sound_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1ttf.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl1ttf_private.h10
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl2.c22
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl2_private.h174
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl2image.c2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl2image_private.h8
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl2mixer.c10
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl2mixer_private.h14
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl2net.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl2net_private.h2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl2ttf.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsdl2ttf_private.h12
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsecret1.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsecret1_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedselinux.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedselinux_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsmime3.c54
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsmime3_private.h2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsmpeg.c2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsmpeg2.c2
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsmpeg2_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedsmpeg_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedssl3.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedssl3_private.h0
-rw-r--r--src/wrapped/wrappedtbbbind.c54
-rw-r--r--src/wrapped/wrappedtbbbind_private.h14
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedtcmallocminimal.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedtcmallocminimal_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedudev0.c4
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedudev0_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedudev1.c4
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedudev1_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedutil.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedvorbisfile.c10
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedvorbisfile_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedvulkan.c65
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedvulkan_private.h28
-rw-r--r--src/wrapped/wrappedwaylandclient_private.h26
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedxinerama.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedxinerama_private.h0
-rw-r--r--src/wrapped/wrappedxkbcommon_private.h4
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedxkbcommonx11.c0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedxkbcommonx11_private.h0
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedxml2.c561
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedxml2_private.h80
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedxslt.c76
-rw-r--r--[-rwxr-xr-x]src/wrapped/wrappedxslt_private.h8
-rw-r--r--system/box64.box64rc30
-rw-r--r--[-rwxr-xr-x]system/box64.conf.cmake0
-rw-r--r--[-rwxr-xr-x]tests/benchfloat.c0
-rw-r--r--tests/ref17.txt14
-rw-r--r--tests/ref22.txt1354
-rw-r--r--[-rwxr-xr-x]tests/test05.c0
-rw-r--r--[-rwxr-xr-x]tests/test08.c0
-rw-r--r--[-rwxr-xr-x]tests/test09.c7
-rw-r--r--[-rwxr-xr-x]tests/test12.c0
-rw-r--r--[-rwxr-xr-x]tests/test14.c0
-rw-r--r--tests/test17.c50
-rw-r--r--tests/test18.c1
-rw-r--r--tests/test22.c101
-rw-r--r--wrapperhelper/CMakeLists.txt7
-rw-r--r--wrapperhelper/README.md99
-rw-r--r--wrapperhelper/ast.h189
-rw-r--r--wrapperhelper/gen.cpp1059
-rw-r--r--wrapperhelper/gen.h144
-rw-r--r--wrapperhelper/main.cpp69
-rw-r--r--wrapperhelper/utils.h33
561 files changed, 59497 insertions, 15411 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 3ad793b..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,67 +0,0 @@
-# Prerequisites
-*.d
-
-# Object files
-*.o
-*.ko
-*.obj
-*.elf
-
-# Linker output
-*.ilk
-*.map
-*.exp
-
-# Precompiled Headers
-*.gch
-*.pch
-
-# Libraries
-*.lib
-*.a
-*.la
-*.lo
-
-# Shared objects (inc. Windows DLLs)
-*.dll
-*.so
-*.so.*
-*.dylib
-
-# Executables
-*.exe
-*.out
-*.app
-*.i*86
-*.x86_64
-*.hex
-
-# Debug files
-*.dSYM/
-*.su
-*.idb
-*.pdb
-
-# Kernel Module Compile Results
-*.mod*
-*.cmd
-.tmp_versions/
-modules.order
-Module.symvers
-Mkfile.old
-dkms.conf
-
-# from box86
-build/
-build*/
-.vscode
-.cache
-.gdb_history
-src/git_head.h
-backup/
-
-# LLVMprivateGenerator
-/LLVMprivateGenerator/*
-!/LLVMprivateGenerator/Makefile
-!/LLVMprivateGenerator/main.cpp
-!/LLVMprivateGenerator/registered_structs.cpp
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e48c60..88c8eac 100755..100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,11 +14,13 @@ option(ODROIDN2 "Set to ON if targeting an Odroid-N2 device" ${ODROIDN2})
option(TEGRAX1 "Set to ON if targeting an Tegra X1 based device" ${TEGRAX1})
option(PHYTIUM "Set to ON if targeting an Phytium (D2000 or FT2000/4) based device" ${PHYTIUM})
option(SD845 "Set to ON if targeting a Snapragon 845 based device" ${SD845})
+option(SD888 "Set to ON if targeting a Snapragon 888 based device" ${SD888})
option(M1 "Set to ON if targeting a AppleM1 running on Asahi computer" ${M1})
option(LARCH64 "Set to ON if targeting an Loongarch64 based device" ${LARCH64})
option(RV64 "Set to ON if targeting an RISC-V RV64GC based device" ${RV64})
option(PPC64LE "Set to ON if targeting an PowerPC 64 LE based device" ${PPC64LE})
option(LX2160A "Set to ON if targeting an LX2160A based device" ${LX2160A})
+option(ARM64 "Set to ON if targeting a generic ARM64 based device" ${ARM64})
option(USE_CCACHE "Set to ON to use ccache if present in the system" ${USE_CCACHE})
option(HAVE_TRACE "Set to ON to have Trace ability (needs ZydisInfo library)" ${HAVE_TRACE})
option(NOLOADADDR "Set to ON to avoid fixing the load address of Box64" OFF)
@@ -30,25 +32,29 @@ if(LARCH64)
set(LD80BITS OFF CACHE BOOL "")
set(NOALIGN OFF CACHE BOOL "")
set(ARM_DYNAREC OFF CACHE BOOL "")
+ set(RV64_DYNAREC OFF CACHE BOOL "")
endif()
if(RV64)
set(LD80BITS OFF CACHE BOOL "")
set(NOALIGN OFF CACHE BOOL "")
- set(ARM_DYNAREC OFF CACHE BOOL "")
+ set(ARM_DYNAREC OFF CACHE BOOL "")
+ set(RV64_DYNAREC ON CACHE BOOL "")
set(PAGE16K OFF CACHE BOOL "")
endif()
if(PPC64LE)
set(LD80BITS OFF CACHE BOOL "")
set(NOALIGN OFF CACHE BOOL "")
set(ARM_DYNAREC OFF CACHE BOOL "")
+ set(RV64_DYNAREC OFF CACHE BOOL "")
set(PAGE16K OFF CACHE BOOL "")
endif()
-if(RK3399 OR RK3588 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR LX2160A OR M1)
+if(RK3399 OR RK3588 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR SD888 OR LX2160A OR M1 OR ARM64)
set(LD80BITS OFF CACHE BOOL "")
set(NOALIGN OFF CACHE BOOL "")
set(ARM_DYNAREC ON CACHE BOOL "")
+ set(RV64_DYNAREC OFF CACHE BOOL "")
endif()
-if(RK3399 OR RK3588 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR LX2160A)
+if(RK3399 OR RK3588 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR SD888 OR LX2160A)
set(PAGE16K OFF CACHE BOOL "")
endif()
if(RK3588)
@@ -66,23 +72,26 @@ endif()
option(LD80BITS "Set to ON if host device have 80bits long double (i.e. i386)" ${LD80BITS})
option(NOALIGN "Set to ON if host device doesn't need re-align (i.e. i386)" ${NOALIGN})
option(ARM_DYNAREC "Set to ON to use ARM Dynamic Recompilation" ${ARM_DYNAREC})
+option(RV64_DYNAREC "Set to ON to use RISC-V Dynamic Recompilation" ${RV64_DYNAREC})
option(PAGE8K "Set to ON if host device have PageSize of 8K (instead of 4K)" ${PAGE8K})
option(PAGE16K "Set to ON if host device have PageSize of 16K (instead of 4K)" ${PAGE16K})
option(PAGE64K "Set to ON if host device have PageSize of 64K (instead of 4K)" ${PAGE64K})
option(STATICBUILD "Set to ON to have a static build (Warning, not working)" ${STATICBUILD})
+option(NO_LIB_INSTALL "Set ON to not install a few x86_64 libs that are used by many program" ${NO_LIB_INSTALL})
+option(NO_CONF_INSTALL "Set ON to not install config files" ${NO_CONF_INSTALL})
if(${CMAKE_VERSION} VERSION_LESS "3.12.2")
find_package(PythonInterp 3)
if(NOT PYTHONINTERP_FOUND)
- message( FATAL_ERROR "You need a Python interpretor, CMake will exit." )
+ message( FATAL_ERROR "You need a Python interpreter, CMake will exit." )
endif()
if(${PYTHON_VERSION_MAJOR} LESS 3)
- message( FATAL_ERROR "You need a Python 3 interpretor, CMake will exit." )
+ message( FATAL_ERROR "You need a Python 3 interpreter, CMake will exit." )
endif()
else()
find_package(Python3)
if(NOT Python3_Interpreter_FOUND)
- message( FATAL_ERROR "You need a Python interpretor, CMake will exit." )
+ message( FATAL_ERROR "You need a Python interpreter, CMake will exit." )
endif()
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE INTERNAL "The Python3 executable" FORCE)
endif()
@@ -130,13 +139,17 @@ elseif(TEGRAX1)
add_definitions(-pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a57+crypto)
set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a57+crypto")
elseif(PHYTIUM)
- add_definitions(-DPHYSIUM)
+ add_definitions(-DPHYTIUM)
add_definitions(-pipe -march=armv8.1-a+crc+simd+crypto)
set(CMAKE_ASM_FLAGS "-pipe -march=armv8.1-a+crc+simd+crypto+aes")
elseif(SD845)
add_definitions(-DSD845)
add_definitions(-pipe -march=armv8.2-a+simd+crypto -mtune=cortex-a75.cortex-a55)
set(CMAKE_ASM_FLAGS "-pipe -march=armv8.2-a+simd+crypto -mtune=cortex-a75.cortex-a55")
+elseif(SD888)
+ add_definitions(-DSD888)
+ add_definitions(-pipe -march=armv8.4-a+crypto)
+ set(CMAKE_ASM_FLAGS "-pipe -march=armv8.4-a+crypto")
elseif(M1)
add_definitions(-DM1)
add_definitions(-pipe -march=armv8.5-a+simd+crypto)
@@ -157,6 +170,9 @@ elseif(LX2160A)
set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crypto+crc -mcpu=cortex-a72+crypto")
elseif(SW64)
add_definitions(-DSW64)
+elseif(ARM64)
+ #add_definitions(-pipe -march=native)
+ set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+simd")
elseif(ARM_DYNAREC)
set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crc+simd+crypto")
endif()
@@ -208,6 +224,12 @@ if(ARM_DYNAREC)
enable_language(ASM)
include_directories("${BOX64_ROOT}/src/dynarec/arm64")
set(DYNAREC ON)
+elseif(RV64_DYNAREC)
+ add_definitions(-DDYNAREC)
+ add_definitions(-DRV64)
+ enable_language(ASM)
+ include_directories("${BOX64_ROOT}/src/dynarec/rv64")
+ set(DYNAREC ON)
else()
set(DYNAREC OFF)
endif()
@@ -254,32 +276,9 @@ set(ELFLOADER_SRC
"${BOX64_ROOT}/src/emu/x64int3.c"
"${BOX64_ROOT}/src/emu/x87emu_private.c"
"${BOX64_ROOT}/src/emu/x64primop.c"
- "${BOX64_ROOT}/src/emu/x64run.c"
- "${BOX64_ROOT}/src/emu/x64run0f.c"
- "${BOX64_ROOT}/src/emu/x64run64.c"
- "${BOX64_ROOT}/src/emu/x64run66.c"
- "${BOX64_ROOT}/src/emu/x64run660f.c"
- "${BOX64_ROOT}/src/emu/x64run6664.c"
- "${BOX64_ROOT}/src/emu/x64run66d9.c"
- "${BOX64_ROOT}/src/emu/x64run66dd.c"
- "${BOX64_ROOT}/src/emu/x64run66f0.c"
- "${BOX64_ROOT}/src/emu/x64run67.c"
- "${BOX64_ROOT}/src/emu/x64run670f.c"
- "${BOX64_ROOT}/src/emu/x64run6766.c"
- "${BOX64_ROOT}/src/emu/x64run67660f.c"
- "${BOX64_ROOT}/src/emu/x64rund8.c"
- "${BOX64_ROOT}/src/emu/x64rund9.c"
- "${BOX64_ROOT}/src/emu/x64runda.c"
- "${BOX64_ROOT}/src/emu/x64rundb.c"
- "${BOX64_ROOT}/src/emu/x64rundc.c"
- "${BOX64_ROOT}/src/emu/x64rundd.c"
- "${BOX64_ROOT}/src/emu/x64runde.c"
- "${BOX64_ROOT}/src/emu/x64rundf.c"
- "${BOX64_ROOT}/src/emu/x64runf0.c"
- "${BOX64_ROOT}/src/emu/x64runf20f.c"
- "${BOX64_ROOT}/src/emu/x64runf30f.c"
"${BOX64_ROOT}/src/emu/x64run_private.c"
"${BOX64_ROOT}/src/emu/x64syscall.c"
+ "${BOX64_ROOT}/src/emu/x86syscall.c"
"${BOX64_ROOT}/src/emu/x64tls.c"
"${BOX64_ROOT}/src/emu/x64trace.c"
"${BOX64_ROOT}/src/librarian/librarian.c"
@@ -294,6 +293,7 @@ set(ELFLOADER_SRC
"${BOX64_ROOT}/src/libtools/sdl2rwops.c"
"${BOX64_ROOT}/src/libtools/signals.c"
"${BOX64_ROOT}/src/libtools/threads.c"
+ "${BOX64_ROOT}/src/tools/bitutils.c"
"${BOX64_ROOT}/src/tools/box64stack.c"
"${BOX64_ROOT}/src/tools/bridge.c"
"${BOX64_ROOT}/src/tools/callback.c"
@@ -306,6 +306,35 @@ set(ELFLOADER_SRC
"${BOX64_ROOT}/src/wrapped/generated/wrapper.c"
)
+set(INTERPRETER
+ "${BOX64_ROOT}/src/emu/x64run.c"
+ "${BOX64_ROOT}/src/emu/x64run0f.c"
+ "${BOX64_ROOT}/src/emu/x64run64.c"
+ "${BOX64_ROOT}/src/emu/x64run66.c"
+ "${BOX64_ROOT}/src/emu/x64run660f.c"
+ "${BOX64_ROOT}/src/emu/x64run6664.c"
+ "${BOX64_ROOT}/src/emu/x64run66d9.c"
+ "${BOX64_ROOT}/src/emu/x64run66dd.c"
+ "${BOX64_ROOT}/src/emu/x64run66f0.c"
+ "${BOX64_ROOT}/src/emu/x64run67.c"
+ "${BOX64_ROOT}/src/emu/x64run67_32.c"
+ "${BOX64_ROOT}/src/emu/x64run6764_32.c"
+ "${BOX64_ROOT}/src/emu/x64run670f.c"
+ "${BOX64_ROOT}/src/emu/x64run6766.c"
+ "${BOX64_ROOT}/src/emu/x64run67660f.c"
+ "${BOX64_ROOT}/src/emu/x64rund8.c"
+ "${BOX64_ROOT}/src/emu/x64rund9.c"
+ "${BOX64_ROOT}/src/emu/x64runda.c"
+ "${BOX64_ROOT}/src/emu/x64rundb.c"
+ "${BOX64_ROOT}/src/emu/x64rundc.c"
+ "${BOX64_ROOT}/src/emu/x64rundd.c"
+ "${BOX64_ROOT}/src/emu/x64runde.c"
+ "${BOX64_ROOT}/src/emu/x64rundf.c"
+ "${BOX64_ROOT}/src/emu/x64runf0.c"
+ "${BOX64_ROOT}/src/emu/x64runf20f.c"
+ "${BOX64_ROOT}/src/emu/x64runf30f.c"
+)
+
set(WRAPPEDS
"${BOX64_ROOT}/src/wrapped/wrappedalure.c"
"${BOX64_ROOT}/src/wrapped/wrappedalut.c"
@@ -314,10 +343,12 @@ set(WRAPPEDS
"${BOX64_ROOT}/src/wrapped/wrappedatomic.c"
"${BOX64_ROOT}/src/wrapped/wrappedatspi.c"
"${BOX64_ROOT}/src/wrapped/wrappedbz2.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedcap.c"
"${BOX64_ROOT}/src/wrapped/wrappedcairo.c"
"${BOX64_ROOT}/src/wrapped/wrappedcairogobject.c"
"${BOX64_ROOT}/src/wrapped/wrappedcrashhandler.c"
"${BOX64_ROOT}/src/wrapped/wrappedcrypto.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedcrypto3.c"
"${BOX64_ROOT}/src/wrapped/wrappedcurl.c"
"${BOX64_ROOT}/src/wrapped/wrappeddbus.c"
"${BOX64_ROOT}/src/wrapped/wrappeddbusglib1.c"
@@ -339,6 +370,7 @@ set(WRAPPEDS
"${BOX64_ROOT}/src/wrapped/wrappedgmp.c"
"${BOX64_ROOT}/src/wrapped/wrappedgnutls.c"
"${BOX64_ROOT}/src/wrapped/wrappedgobject2.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedgomp.c"
"${BOX64_ROOT}/src/wrapped/wrappedgssapi.c"
"${BOX64_ROOT}/src/wrapped/wrappedgssapikrb5.c"
"${BOX64_ROOT}/src/wrapped/wrappedgstapp.c"
@@ -355,6 +387,7 @@ set(WRAPPEDS
"${BOX64_ROOT}/src/wrapped/wrappedldlinux.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibasound.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibc.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedlibcmusl.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibcrypt.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibcups.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibdl.c"
@@ -366,6 +399,7 @@ set(WRAPPEDS
"${BOX64_ROOT}/src/wrapped/wrappedlibgl.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibglu.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibglx.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedlibharfbuzz.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibibus.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibice.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibm.c"
@@ -373,6 +407,7 @@ set(WRAPPEDS
"${BOX64_ROOT}/src/wrapped/wrappedlibncurses6.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibncursesw.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibncursesw6.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedlibnuma.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibogg.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibpanel.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibpci.c"
@@ -383,6 +418,7 @@ set(WRAPPEDS
"${BOX64_ROOT}/src/wrapped/wrappedlibsm.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibsndfile.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibssl.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedlibssl3.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibtinfo.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibtinfo6.c"
"${BOX64_ROOT}/src/wrapped/wrappedlibusb1.c"
@@ -467,6 +503,7 @@ set(WRAPPEDS
"${BOX64_ROOT}/src/wrapped/wrappedsmime3.c"
"${BOX64_ROOT}/src/wrapped/wrappedsmpeg2.c"
"${BOX64_ROOT}/src/wrapped/wrappedssl3.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedtbbbind.c"
"${BOX64_ROOT}/src/wrapped/wrappedtbbmalloc.c"
"${BOX64_ROOT}/src/wrapped/wrappedtbbmallocproxy.c"
"${BOX64_ROOT}/src/wrapped/wrappedtcmallocminimal.c"
@@ -488,6 +525,10 @@ set(WRAPPEDS
"${BOX64_ROOT}/src/wrapped/wrappedvulkan.c"
"${BOX64_ROOT}/src/wrapped/wrappedxshmfence.c"
"${BOX64_ROOT}/src/wrapped/wrappedd3dadapter9.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedicuuc67.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedicui18n67.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedicuuc72.c"
+ "${BOX64_ROOT}/src/wrapped/wrappedicui18n72.c"
)
# If BOX64_ROOT contains a ".c", the build breaks...
@@ -529,6 +570,8 @@ if(DYNAREC)
set(DYNAREC_SRC
"${BOX64_ROOT}/src/dynarec/dynablock.c"
"${BOX64_ROOT}/src/dynarec/dynarec_native.c"
+ "${BOX64_ROOT}/src/dynarec/dynarec_native_functions.c"
+ "${BOX64_ROOT}/src/emu/x64test.c"
)
endif()
@@ -575,9 +618,57 @@ if(ARM_DYNAREC)
)
endif()
+if(RV64_DYNAREC)
+ set(DYNAREC_SRC
+ ${DYNAREC_SRC}
+
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_functions.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/rv64_printer.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_jmpnext.c"
+ "${BOX64_ROOT}/src/rv64detect.c"
+
+ "${BOX64_ROOT}/src/dynarec/rv64/rv64_prolog.S"
+ "${BOX64_ROOT}/src/dynarec/rv64/rv64_epilog.S"
+ "${BOX64_ROOT}/src/dynarec/rv64/rv64_next.S"
+ "${BOX64_ROOT}/src/dynarec/rv64/rv64_lock.S"
+ )
+
+ set(DYNAREC_PASS
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_helper.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_emit_tests.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_emit_math.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_emit_logic.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_emit_shift.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_00.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_00_0.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_00_1.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_00_2.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_00_3.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_0f.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_64.c"
+ #"${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_65.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_66.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_67.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_d8.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_d9.c"
+ #"${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_da.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_db.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_dc.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_dd.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_de.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_df.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_f0.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_660f.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_6664.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_66f0.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_f20f.c"
+ "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_f30f.c"
+ )
+endif()
+
if(DYNAREC)
- set(DYNAREC_PASS
- "${BOX64_ROOT}/src/wrapped/generated/wrapper.h"
+ set(DYNAREC_PASS
+ "${BOX64_ROOT}/src/wrapped/generated/wrapper.h"
${DYNAREC_PASS}
"${BOX64_ROOT}/src/dynarec/dynarec_native_pass.c"
)
@@ -592,6 +683,8 @@ if(DYNAREC)
set_target_properties(native_pass2 PROPERTIES COMPILE_FLAGS "-DSTEP=2")
add_library(native_pass3 OBJECT ${DYNAREC_PASS})
set_target_properties(native_pass3 PROPERTIES COMPILE_FLAGS "-DSTEP=3")
+ add_library(test_interpreter OBJECT ${INTERPRETER})
+ set_target_properties(test_interpreter PROPERTIES COMPILE_FLAGS "-DTEST_INTERPRETER")
add_dependencies(native_pass0 WRAPPERS)
add_dependencies(native_pass1 WRAPPERS)
add_dependencies(native_pass2 WRAPPERS)
@@ -603,6 +696,7 @@ if(DYNAREC)
$<TARGET_OBJECTS:native_pass1>
$<TARGET_OBJECTS:native_pass2>
$<TARGET_OBJECTS:native_pass3>
+ $<TARGET_OBJECTS:test_interpreter>
)
endif()
@@ -611,16 +705,18 @@ if(DYNAREC)
add_custom_command(
OUTPUT "${BOX64_ROOT}/src/git_head.h"
COMMAND sh -c "echo \\\#define GITREV \\\"$(git rev-parse --short HEAD)\\\">\"${BOX64_ROOT}/src/git_head.h\""
- DEPENDS dynarec ${ELFLOADER_SRC} ${WRAPPEDS}
+ DEPENDS dynarec ${ELFLOADER_SRC} ${INTERPRETER} ${WRAPPEDS}
VERBATIM)
else()
add_custom_command(
OUTPUT "${BOX64_ROOT}/src/git_head.h"
COMMAND sh -c "echo \\\#define GITREV \\\"$(git rev-parse --short HEAD)\\\">\"${BOX64_ROOT}/src/git_head.h\""
- DEPENDS ${ELFLOADER_SRC} ${WRAPPEDS}
+ DEPENDS ${ELFLOADER_SRC} ${INTERPRETER} ${WRAPPEDS}
VERBATIM)
endif()
+add_library(interpreter OBJECT ${INTERPRETER})
+
add_executable(${BOX64} ${ELFLOADER_SRC} ${WRAPPEDS} "${BOX64_ROOT}/src/git_head.h")
set_target_properties(${BOX64} PROPERTIES ENABLE_EXPORTS ON)
add_dependencies(${BOX64} WRAPPERS)
@@ -634,6 +730,7 @@ endif()
if(DYNAREC)
target_link_libraries(${BOX64} dynarec)
endif()
+target_link_libraries(${BOX64} interpreter)
if(${CMAKE_VERSION} VERSION_LESS "3.13")
if(NOT NOLOADADDR)
@@ -654,9 +751,10 @@ else()
endif()
endif()
-string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "i686" _x86)
-string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "x86_64" _x86_64)
-string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "aarch64" _aarch64)
+string(COMPARE EQUAL "${CMAKE_SYSTEM_PROCESSOR}" "i686" _x86)
+string(COMPARE EQUAL "${CMAKE_SYSTEM_PROCESSOR}" "x86_64" _x86_64)
+string(COMPARE EQUAL "${CMAKE_SYSTEM_PROCESSOR}" "aarch64" _aarch64)
+string(COMPARE EQUAL "${CMAKE_SYSTEM_PROCESSOR}" "riscv64" _riscv64)
if(_x86_64 OR _aarch64)
add_definitions(-DCONFIG_64BIT)
@@ -665,13 +763,17 @@ endif()
if(NOT _x86 AND NOT _x86_64)
install(TARGETS ${BOX64}
RUNTIME DESTINATION bin)
- configure_file(system/box64.conf.cmake system/box64.conf)
- install(FILES ${CMAKE_BINARY_DIR}/system/box64.conf DESTINATION /etc/binfmt.d/)
- install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libstdc++.so.5 DESTINATION /usr/lib/x86_64-linux-gnu/)
- install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libstdc++.so.6 DESTINATION /usr/lib/x86_64-linux-gnu/)
- install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libgcc_s.so.1 DESTINATION /usr/lib/x86_64-linux-gnu/)
- install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libpng12.so.0 DESTINATION /usr/lib/x86_64-linux-gnu/)
- install(FILES ${CMAKE_SOURCE_DIR}/system/box64.box64rc DESTINATION /etc/)
+ if(NOT NO_CONF_INSTALL)
+ configure_file(system/box64.conf.cmake system/box64.conf)
+ install(FILES ${CMAKE_BINARY_DIR}/system/box64.conf DESTINATION /etc/binfmt.d/)
+ install(FILES ${CMAKE_SOURCE_DIR}/system/box64.box64rc DESTINATION /etc/)
+ endif()
+ if(NOT NO_LIB_INSTALL)
+ install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libstdc++.so.5 DESTINATION /usr/lib/x86_64-linux-gnu/)
+ install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libstdc++.so.6 DESTINATION /usr/lib/x86_64-linux-gnu/)
+ install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libgcc_s.so.1 DESTINATION /usr/lib/x86_64-linux-gnu/)
+ install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libpng12.so.0 DESTINATION /usr/lib/x86_64-linux-gnu/)
+ endif()
endif()
if(NOT TARGET uninstall)
@@ -705,6 +807,8 @@ set(CPACK_PACKAGE_VERSION_PATCH ${BOX64_REVISION})
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst")
if(_aarch64)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
+elseif(__riscv64)
+ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "riscv64")
elseif(_x86_64)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "x86_64")
else()
@@ -795,14 +899,14 @@ add_test(sse_asm ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64}
-P ${CMAKE_SOURCE_DIR}/runTest.cmake )
set_tests_properties(sse_asm PROPERTIES ENVIRONMENT "BOX64_DYNAREC_FASTROUND=0")
-
+
add_test(sse_intrinsics ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64}
-D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test17 -D TEST_OUTPUT=tmpfile17.txt
-D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref17.txt
-P ${CMAKE_SOURCE_DIR}/runTest.cmake )
set_tests_properties(sse_intrinsics PROPERTIES ENVIRONMENT "BOX64_DYNAREC_FASTNAN=0;BOX64_DYNAREC_FASTROUND=0")
-
+
add_test(aes ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64}
-D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test18 -D TEST_OUTPUT=tmpfile18.txt
-D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref18.txt
@@ -828,6 +932,8 @@ add_test(irelative_reloc ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${
-D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref22.txt
-P ${CMAKE_SOURCE_DIR}/runTest.cmake )
+ set_tests_properties(x87 PROPERTIES ENVIRONMENT "BOX64_DYNAREC_FASTROUND=0")
+
file(GLOB extension_tests "${CMAKE_SOURCE_DIR}/tests/extensions/*.c")
foreach(file ${extension_tests})
get_filename_component(testname "${file}" NAME_WE)
diff --git a/docs/README.md b/README.md
index ea1c5b4..a604c05 100644
--- a/docs/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-![Official logo](img/Box64Logo.png "Official Logo")
+![Official logo](docs/img/Box64Logo.png "Official Logo")
Linux Userspace x86_64 Emulator with a twist
-[View changelog](https://github.com/ptitSeb/box64/blob/main/docs/CHANGELOG.md) | [中文](https://github.com/ptitSeb/box64/blob/main/docs/README_CN.md) | [Report an error](https://github.com/ptitSeb/box64/issues/new)
+[View changelog](https://github.com/ptitSeb/box64/blob/main/docs/CHANGELOG.md) | [中文](https://github.com/ptitSeb/box64/blob/main/README_CN.md) | [Українська](https://github.com/ptitSeb/box64/blob/main/README_UK.md) | [Report an error](https://github.com/ptitSeb/box64/issues/new)
![build](https://app.travis-ci.com/ptitSeb/box64.svg?branch=main) ![stars](https://img.shields.io/github/stars/ptitSeb/box64) ![forks](https://img.shields.io/github/forks/ptitSeb/box64) ![contributors](https://img.shields.io/github/contributors/ptitSeb/box64) ![prs](https://img.shields.io/github/issues-pr/ptitSeb/box64) ![issues](https://img.shields.io/github/issues/ptitSeb/box64)
@@ -14,11 +14,11 @@ You can find many Box64 videos on the [MicroLinux](https://www.youtube.com/chann
Since Box64 uses the native versions of some "system" libraries, like libc, libm, SDL, and OpenGL, it's easy to integrate and use with most applications, and performance can be surprisingly high in many cases. Take a look at thoses bench analysis for an example [here](https://box86.org/index.php/2021/06/game-performances/).
-Box64 integrates with DynaRec (dynamic recompiler) for the ARM64 platform, providing a speed boost between 5 to 10 times faster than using only the interpreter. Some high level information on how DynaRec works can be found [here](https://box86.org/2021/07/inner-workings-a-high%e2%80%91level-view-of-box86-and-a-low%e2%80%91level-view-of-the-dynarec/).
+Box64 integrates with DynaRec (dynamic recompiler) for the ARM64 and RV64 platform, providing a speed boost between 5 to 10 times faster than using only the interpreter. Some high level information on how DynaRec works can be found [here](https://box86.org/2021/07/inner-workings-a-high%e2%80%91level-view-of-box86-and-a-low%e2%80%91level-view-of-the-dynarec/).
-Some x64 internal opcodes use parts of "Realmode X86 Emulator Library", see [x64primop.c](../src/emu/x64primop.c) for copyright details
+Some x64 internal opcodes use parts of "Realmode X86 Emulator Library", see [x64primop.c](src/emu/x64primop.c) for copyright details
-<img src="img/Box64Icon.png" width="96" height="96">
+<img src="docs/img/Box64Icon.png" width="96" height="96">
Logo and Icon made by @grayduck, thanks!
@@ -29,7 +29,7 @@ Usage
There are a few environment variables to control the behaviour of Box64.
-See [here](USAGE.md) for all the environment variables and what they do.
+See [here](docs/USAGE.md) for all the environment variables and what they do.
Note: Box64's Dynarec uses a mechanism with Memory Protection and a SegFault signal handler to handle JIT code. In simpler terms, if you want to use GDB to debug a running program that use JIT'd code (like mono/Unity3D), you will still have many "normal" segfaults triggering. It is suggested to use something like `handle SIGSEGV nostop` in GDB to not stop at each segfault, and maybe put a breakpoint inside `my_memprotectionhandler` in `signals.c` if you want to trap SegFaults.
@@ -37,14 +37,15 @@ Note: Box64's Dynarec uses a mechanism with Memory Protection and a SegFault sig
Compiling/Installation
----
-> Compilation instructions can be found [here](COMPILE.md).
+> Compilation instructions can be found [here](docs/COMPILE.md)\
+> Instructions for installing Wine for Box64 can be found [here](docs/X64WINE.md)
----
Version history/Change log
----
-The change log is available [here](CHANGELOG.md).
+The change log is available [here](docs/CHANGELOG.md).
----
@@ -85,23 +86,22 @@ GTK libraries are now wrapped on box64, both gtk2 and gtk3.
Notes about Steam
----
-Note that Steam is a hybrid 32-bit / 64-bit. You NEED box86 to run Steam, as the client app is a 32-bit binary. It also uses a 64-bit local server binaries, but like most stuff using libcef/chromium, it's not working correctly on box64 for now.
-So, no Steam for now on box64.
+Note that Steam is a hybrid 32-bit / 64-bit. You NEED box86 to run Steam, as the client app is a 32-bit binary. It also uses a 64-bit local server binaries, and that steamwebhelper process is now mendatory, even on the "small mode". And that process will eat lots of memory. So machine with less the 6Gb of RAM will need a swapfile tp use Steam.
----
Notes about Wine
----
-Wine64 is supported on box64. Proton should also work. Be aware that 64-bit Wine also includes 32-bit components, to be able to run 32-bit Windows programs. The 32-bit apps will need box86 and will not run without it. On a system where both box64 and box86 are present and working, a wine 64-bit setup can run both 32-bit and 64-bit Windows programs (just use `wine` and `wine64` respectively).
-Note that the new 32bits PE in 64bits process that the Wine time in currently implementing in Wine 7.+ is not yet supported. I tested Wine 7.5 64bits and it worked, but more recent version will probably just not work yet.
+Wine64 is supported on box64. Proton too. Be aware that 64-bit Wine also includes 32-bit components, to be able to run 32-bit Windows programs. The 32-bit apps will need box86 and will not run without it. On a system where both box64 and box86 are present and working, a wine 64-bit setup can run both 32-bit and 64-bit Windows programs (just use `wine` and `wine64` respectively).
+Note that the new 32bits PE in 64bits process that the Wine time in currently implementing in Wine 7.+ is now supported, but the support is quite young so there might be some residual issues.
----
Notes about Vulkan
----
-Box64 wraps Vulkan libraries, but note that it as only been tested with a RX550 card, so some extensions may be missing depending on your graphics card.
+Box64 wraps Vulkan libraries, but note that it as mostly been tested with a AMD RX550 card and on the Freedreno driver, so some extensions may be missing depending on your graphics card.
----
@@ -114,6 +114,7 @@ So, in no particular order, I want to thank:
* For their major code contribution: rajdakin, mogery
* For their major financial contribution: FlyingFathead, stormchaser3000, dennis1248, sll00, [libre-computer-project](https://libre.computer/)
* For hardware contribution and LoongArch migration: [xiaoji](https://www.linuxgame.cn/), Deepin Beijing Develop Team
+ * For their major code contribution on the RV64 Dynarec: ksco, xctan
* For their hardware contribution: [Radxa](https://rockpi.org/), [Pine64](https://www.pine64.org/), [StarFive](https://rvspace.org/)
* For their continous advertisement of box64 project: salva ([microLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)), [PILab](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)/[TwisterOS](https://twisteros.com/) team, [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA), [NicoD](https://www.youtube.com/channel/UCpv7NFr0-9AB5xoklh3Snhg), ekianjo ([Boilingsteam](https://boilingsteam.com/))
diff --git a/README_CN.md b/README_CN.md
new file mode 100644
index 0000000..caeb24e
--- /dev/null
+++ b/README_CN.md
@@ -0,0 +1,113 @@
+# box64
+
+![Official logo](docs/img/Box64Logo.png "Official Logo")
+Linux 上用户空间的 x86_64 应用模拟器(支持运行原生库)
+
+----
+![box64 build status](https://app.travis-ci.com/ptitSeb/box64.svg?branch=main)
+
+[English](docs/README.md) | [Українська](https://github.com/ptitSeb/box64/blob/main/README_UK.md)
+
+Box64 可以在非 x86_64 Linux 系统(比如 ARM64)上运行 x86_64 Linux 程序(比如游戏),注意主机系统需要是 64 位小端。
+
+您可以在 [MicroLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)、[Pi Labs](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g) 和 [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA) YouTube 频道上找到许多 Box64 视频。
+
+由于 Box64 使用一些“系统”库的原生版本,如 libc、libm、SDL 和 OpenGL 等,因此很容易与大多数应用程序集成和使用,并且在许多情况下性能会相当不错。可以在[这里](https://box86.org/index.php/2021/06/game-performances/)查看一些性能测试的样例。
+
+Box64 集成了适用于 ARM64 平台的 DynaRec(动态重编译器),速度可以比纯解释模式快 5 到 10 倍。可以在[这里](https://box86.org/2021/07/inner-workings-a-high%E2%80%91level-view-of-box86-and-a-low%E2%80%91level-view-of-the-dynarec/)找到有关 DynaRec 工作原理的一些信息。
+
+一些 x64 内部操作码使用 “Realmode X86 Emulator Library” 的部分内容,有关版权详细信息,请参见 [x64primop.c](../src/emu/x64primop.c)。
+
+<img src="docs/img/Box64Icon.png" width="96" height="96">
+
+LOGO 由 @grayduck 制作,感谢!
+
+----
+
+使用方法
+----
+
+有若干环境变量可以控制 Box64 的行为。
+
+可在[这里](docs/USAGE.md)查看所有环境变量及其作用。
+
+注意:Box64 的 Dynarec 使用具有内存保护和段错误信号处理的机制来执行 JIT 代码。所以,如果想使用 GDB 调试使用 JIT 代码的程序(如 Mono/Unity3D),这会触发许多“正常”的段错误。建议在 GDB 中使用类似 `handle SIGSEGV nostop` 来防止它每个段错误处停止。如果你想捕获段错误,可以在 `signals.c` 的 `my_memprotectionhandler` 中设置断点。
+
+----
+
+编译/安装
+----
+
+编译说明可以在[这里](docs/COMPILE.md)查看。
+
+----
+
+版本历史
+----
+
+版本日志在[这里](docs/CHANGELOG.md)。
+
+----
+
+32位平台的注意事项
+----
+
+因为 Box64 的工作原理是直接将函数调用从 x86_64 转换为主机系统,所以主机系统(运行 Box64 的系统)需要有 64 位库。Box64 不包含任何 64 位 <-> 32 位的转换。
+
+所以 box64 只能运行 64 位的 Linux 二进制。对于 32 位二进制则需要使用 box86 来运行(它在 64 位操作系统上使用了 multiarch 和 proot 等技巧来实现运行)。请注意,许多(基于 mojo 的)安装程序在检测到 ARM64 操作系统时将回退到 “x86”,因此即使存在 x86_64 版本,也会尝试使用 box86。这时你可以使用一个假的 `uname`,当它的参数为 `-m` 时返回 `x86_64`。
+
+----
+
+关于 Unity 游戏模拟的注意事项
+----
+
+运行 Unity 游戏应该没什么问题,但还应该注意,许多 Unity3D 游戏需要 OpenGL 3+,这在 ARM SBC 上可能会比较棘手。同时许多较新的 Unity3D游戏(如 KSP)也使用 BC7 压缩纹理,很多 ARM 的集成显卡并不支持。
+
+> 提示:如果游戏开始后没有显示任何东西就退出了,在 Pi4 上可以使用 `MESA_GL_VERSION_OVERRIDE=3.2`,在 Panfrost 上则可以使用 `PAN_MESA_DEBUG=gl3` 来使用更高的配置。
+
+----
+
+关于GTK程序的注意事项
+----
+
+box64 封装了 GTK,包括 gtk2 和 gtk3。
+
+----
+
+关于 Steam 的注意事项
+----
+
+请注意,Steam 是 32/64 位的混合体,所以还需要 box86 才能运行,因为客户端应用程序是 32 位的。它还使用 64 位本地服务器,但与大多数使用 libcef/chromium 的东西一样,它目前无法在 box64 上正常工作。所以,现在 box64 上暂时不能运行 Steam。
+
+----
+
+关于 Wine 的注意事项
+----
+
+box64 支持 Wine64,Proton 应该也能运行。请注意,64 位 Wine 包含有 32 位组件,以便能够运行 32 位 Windows 程序。32 位应用程序需要 box86,否则无法运行。在 box64 和 box86 都存在并工作的系统上,64 位的 Wine 可以同时运行 32 位和 64 位 Windows 程序(分别使用 `wine` 和 `wine64`)。请注意,目前在 Wine 7.+ 中实现的 Wine 时间在 64 位进程中的新 32bit PE 尚不支持。我测试了 Wine 7.5 64 位可以正常工作,但是更新的版本可能还不行。
+
+----
+
+关于 Vulkan 注意事项
+----
+
+Box64 封装了 Vulkan 库,但请注意,它仅在 RX550 显卡上进行过测试,因此根据您的显卡,某些扩展可能会丢失。
+
+----
+
+结语
+----
+
+我要感谢所有为 box64 开发做出贡献的人。
+贡献方式有很多种:代码贡献、财务帮助、捐赠捐赠和广告合作!
+以下感谢不分先后:
+
+ * 代码贡献:rajdakin, mogery
+ * 财务帮助:FlyingFathead, stormchaser3000, dennis1248, sll00, [libre-computer-project](https://libre.computer/)
+ * 硬件捐赠和 LoongArch 迁移:[xiaoji](https://www.linuxgame.cn/), Deepin Beijing Develop Team
+ * 硬件捐赠:[Radxa](https://rockpi.org/), [Pine64](https://www.pine64.org/), [StarFive](https://rvspace.org/)
+ * 为本项目持续的宣传:salva ([microLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)), [PILab](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)/[TwisterOS](https://twisteros.com/) team, [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA), [NicoD](https://www.youtube.com/channel/UCpv7NFr0-9AB5xoklh3Snhg), ekianjo ([Boilingsteam](https://boilingsteam.com/))
+
+我还要感谢很多人,即使他们只参与了一次本项目。
+
+(如果你的项目中使用了Box64,请不要忘记提及!)
diff --git a/README_UK.md b/README_UK.md
new file mode 100644
index 0000000..a56624e
--- /dev/null
+++ b/README_UK.md
@@ -0,0 +1,119 @@
+![Official logo](docs/img/Box64Logo.png "Official Logo")
+
+Емулятор простіра користувача x86_64 із родзинкою
+
+[Дивитись журнал змін](https://github.com/ptitSeb/box64/blob/main/docs/CHANGELOG.md) | [中文](https://github.com/ptitSeb/box64/blob/main/README_CN.md) | [Українська](https://github.com/ptitSeb/box64/blob/main/README_UK.md) | [Повідомити про помилку](https://github.com/ptitSeb/box64/issues/new)
+
+![build](https://app.travis-ci.com/ptitSeb/box64.svg?branch=main) ![stars](https://img.shields.io/github/stars/ptitSeb/box64) ![forks](https://img.shields.io/github/forks/ptitSeb/box64) ![contributors](https://img.shields.io/github/contributors/ptitSeb/box64) ![prs](https://img.shields.io/github/issues-pr/ptitSeb/box64) ![issues](https://img.shields.io/github/issues/ptitSeb/box64)
+
+----
+
+Box64 дозволяє запускати x86_64 Linux програми (наприклад, ігри) на системах Linux відмінних від x86_64, наприклад ARM (хост-система має мати 64-розрядний порядок редагування).
+
+Ви можете знайти багато відео про Box64 в YouTube каналах [MicroLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ), [Pi Labs](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g) або [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA)
+
+Оскільки Box64 використовує рідні версії деяких «системних» бібліотек, таких як libc, libm, SDL і OpenGL, його легко інтегрувати та використовувати з більшістю програм, а продуктивність у багатьох випадках може бути напрочуд високою. Подивіться на цей стендовий аналіз для прикладу [тут](https://box86.org/index.php/2021/06/game-performances/).
+
+Box64 інтегрується з DynaRec (динамічний рекомпілятор) для платформ ARM64 і RV64 забезпечуючи підвищення швидкості в 5-10 разів, ніж використання лише інтерпретатора. Деякі високорівневі відомості про те, як працює DynaRec, можна знайти [тут](https://box86.org/2021/07/inner-workings-a-high%e2%80%91level-view-of-box86-and-a-low%e2%80%91level-view-of-the-dynarec/).
+
+Деякі внутрішні коди операцій x64 використовують частини «Бібліотеки емулятора Realmode X86», дивіться [x64primop.c](src/emu/x64primop.c) для детальної інформації про авторські права.
+
+<img src="docs/img/Box64Icon.png" width="96" height="96">
+
+Логотип і піктограма зроблені @grayduck, дякую!
+
+----
+
+Використання
+----
+
+Є кілька змінних середовища для керування поведінкою Box64.
+
+Дивіться [тут](docs/USAGE.md) для перегляду всіх змінних середовища та того, що вони роблять.
+
+Примітка: Dynarec від Box64 використовує механізм із захистом пам’яті та обробником сигналу помилки сегментів для обробки JIT коду. Простіше кажучи, якщо ви хочете використовувати GDB для налагодження запущеної програми, яка використовує JIT-код (наприклад, mono/Unity3D), ви все одно матимете багато «звичайних» помилок сегментів. Пропонується використовувати щось на зразок `handle SIGSEGV nostop` в GDB, щоб не зупинятися на кожній помилці сегмента, і, можливо, поставити точку зупину всередині `my_memprotectionhandler` в `signals.c`, якщо ви хочете перехопити помилки сегментів.
+
+----
+Компіляція/Встановлення
+----
+> Інструкцію зі складання Box64 можна знайти [тут](docs/COMPILE.md).\
+> Інструкцію з встановлення Wine для Box64 можна знайти [тут](docs/X64WINE.md).
+
+----
+
+Історія версій/Журнал змін
+----
+
+Історія версій доступна [тут](docs/CHANGELOG.md).
+
+----
+
+Примітки щодо 32 бітних платформ
+----
+Оскільки Box64 працює шляхом прямого перекладу викликів функцій з x86_64 на хост-систему, хост-система (та, на якій працює Box64) повинна мати 64-розрядні бібліотеки. Box64 не містить 64-біт <-> 32-біт перекладу.
+
+Також розумійте що Box64 запускатиме лише 64-розрядні двійкові Linux файли. Для 32-розрядних двійкових файлів вам потрібен Box86 (з усіма хитрощами з мультиархітектурною системою або корінними правами). Зауважте, що багато інсталяторів (на основі mojo) повертаються до "x86" при виявленні ОС ARM64, і тому намагатимуться використовувати Box86 для налаштування, навіть якщо існує версія x86_64. Ви можете зламати свій шлях за допомогою фальшивого "uname", який повертає "x86_64", коли аргумент "-m"
+
+----
+
+Примітки щодо конфігурації Box64
+----
+
+Обидва файли мають однаковий синтаксис і в основному є файлами ini. Розділ у квадратних дужках визначає назву процесу, а решта — встановлють змінну середовища. Подивіться [використання](USAGE.md), щоб дізнатися, які параметри можна завдати. Box64 поставляється з файлом за замовчуванням, який слід встановити для кращої стабільності. Файл знаходиться в `system/box64.box64rc` і має бути встановлен в `/etc/box64.box64rc`. Якщо з певних причин ви не хочете встановлювати цей файл у `/etc`, принаймні скопіюйте його в `~/.box64rc` або гра може не працювати належним чином. Зауважте, що пріоритетом є: `~/.bashrc` > `/etc/box64.box64rc` > командний рядок
+Таким чином, ваші налаштування в `~/.bashrc` можуть замінити налаштування з вашого командного рядка...
+
+----
+
+Примітки щодо емуляції ігор Unity
+----
+
+Запуск ігор Unity має працювати, але ви також повинні зауважити, що для багатьох ігор Unity3D потрібен OpenGL 3+, який може бути складно забезпечити на ARM SBC (одноплатних комп’ютерах). Крім того, багато нових ігор Unity3D (наприклад, KSP) використовують стиснуті текстури BC7, які не підтримуються багатьма інтегрованими GPU ARM.
+Підказка: в Pi4 використовуйте `MESA_GL_VERSION_OVERRIDE=3.2`, а в Panfrost — `PAN_MESA_DEBUG=gl3`, щоб використовувати вищий профіль, якщо гра запускається, а потім завершується, перш ніж щось показує.
+
+----
+
+Примітки щодо програм GTK
+----
+
+Бібліотеки GTK2 і GTK3 тепер використовуються в Box64.
+
+----
+
+Примітки щодо Steam
+----
+
+Зауважте, що Steam є гібридом 32-біт / 64-біт. Вам ПОТРІБЕН box86, щоб запустити Steam, оскільки клієнта є 32-розрядною двійковою програмою. Він також використовує 64-розрядні двійкові файли локального сервера, і цей процес steamwebhelper тепер є обов’язковим навіть у «малому режимі». І цей процес з’їсть багато оперативної пам’яті, таким чином машині з 6 Гб оперативної пам’яті знадобиться файл підкачки для використання Steam.
+
+----
+
+Примітки щодо Wine
+----
+
+Wine64 підтримується Box64, Proton теж. Майте на увазі, що 64-розрядний Wine також містить 32-розрядні компоненти щоб мати можливість запускати 32-розрядні програми Windows. Для 32-розрядних програм потрібен Box86, і вони не працюватимуть без нього. У системі, де присутні і працюють Box64, і Box86, 64-розрядне встановлення Wine може запускати як 32-розрядні, так і 64-розрядні програми Windows (просто використовуйте `wine` і `wine64` відповідно).
+Зауважте, що новий 32-бітний PE в 64-бітному процесі, який Wine зараз реалізує у Wine 7+ тепер підтримується, але підтримка є досить молодою тому можуть виникнути деякі проблеми.
+
+----
+
+Примітки щодо Vulkan
+----
+
+Box64 використовує бібліотеки Vulkan, але зауважте що він тестувався з картою AMD Radeon RX550 і драйвером Freedreno, тому деякі розширення можуть бути відсутні залежно від вашої відеокарти.
+
+----
+
+Останнє слово
+----
+
+Я хочу подякувати всім, хто зробив внесок у розвиток box64.
+Є багато способів зробити внесок: внесок коду, фінансовий внесок, апаратне забезпечення та реклама!
+Отже, без особливого порядку, я хочу подякувати:
+* За основний внесок у код: rajdakin, mogery
+* За великий фінансовий внесок: FlyingFathead, stormchaser3000, dennis1248, sll00, [libre-computer-project](https://libre.computer/)
+* За апаратне забезпечення та міграцію LoongArch: [xiaoji](https://www.linuxgame.cn/), команда розробників Deepin Beijing
+* За основний внесок у код RV64 Dynarec: ksco, xctan
+* За внесок у апаратне забезпечення: [Radxa](https://rockpi.org/), [Pine64](https://www.pine64.org/), [StarFive](https://rvspace.org/)
+* За безперервну рекламу Box64: salva ([microLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)), [PILab](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)/Команда [TwisterOS](https://twisteros.com/), [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA), [NicoD](https://www.youtube.com/channel/UCpv7NFr0-9AB5xoklh3Snhg), ekianjo ([Boilingsteam](https://boilingsteam.com/))
+
+І я також дякую багатьом іншим людям, які хоч раз брали участь у цьому проекті.
+
+(Якщо ви використовуєте Box64 у своєму проекті, будь ласка, не забудьте згадати про це!)
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 5ba0203..65bbb35 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -1,6 +1,31 @@
+v0.2.4
+======
+* Added Dynarec for RISC-V
+* Added partial 32 bits support (WoW64 works)
+* Changed cpuid to display box64
+* Fixed steam, again
+* Improved hacked version for overridden malloc/free functions
+* More wrapped libs
+* More wrapped functions and syscalls
+* Reduced memory footprint
+* Added support for the BIND_NOW flags in ELF files
+* Added RTLD_NOLOAD support
+* Fixed some typos and general cleanup, again
+* Added a cosimulation mode (to compare the behaviour of the dynarec with the interpreter)
+* Added FASTNAN/FASTROUND handling for more opcodes
+* Better float/double/long double handling
+* Better dlopen/dlclose handling
+* More games in the rc file
+* Added BOX64_DYNAREC_MISSING to show only missing opcode, independantly of the log level
+* Added BOX64_RESERVE_HIGH to reserve addresses above 47bits
+* Improved multitreading support
+* Ukrainian translation of the README
+=> Dynarec now support RISC-V, large speedup on RISC-V 64, were games are now playable (like Stardew Valley on a Vision Five 2)
+=> Improved compatibility with more fixes in elf handling, more wrapped libs and functiond, more fixed opcodes and refined profile
+
v0.2.2
======
-* Added a hacked version for overriden malloc/free functions, enabling libcef (and derivative) to work.
+* Added a hacked version for overridden malloc/free functions, enabling libcef (and derivative) to work.
=> Steam Large mode and new BigPicture are working
=> Heroic Launcher is working
* Added rcfile handling: box64 now read `/etc/box64.box64rc` and `~/.box64rc` and apply per process parameters
@@ -22,7 +47,7 @@ v0.2.2
* Some special cases fixes for dlopen (fixes deadcells, maybe others too)
* Improved mmap mapping, espcially with MAP_32BITS flag
* More wrapped functions and syscalls
-* Lots of improvment in the Rounding of float & double (Dynarec and Interpretor), and proper handling of denormals when converting to/from 80 bits long double
+* Lots of improvment in the Rounding of float & double (Dynarec and Interpreter), and proper handling of denormals when converting to/from 80 bits long double
* Added specific suppport for RK3588 board (needed some hack in signal handling, probably due to the use of a non mainlined kernel)
* More support on the RV64 port
* More support to build under musl environment
@@ -30,7 +55,7 @@ v0.2.2
v0.2.0
======
* Wrapped more vulkan function, dxvk 2.0 now works
-* Added support for overriden malloc/free functions
+* Added support for overridden malloc/free functions
* Refactor Dynarec memory management, reducing memory footprint (from 20% to 40% of Dynarec size)
* Improved elf loader
* Improved dlsym handling with RTLD_NEXT
@@ -80,8 +105,8 @@ v0.1.8
* Don't quit on unsupported syscall, return -1 / ENOSYS error
* Added some more Syscall
* Wrapped Vulkan library. Vulkan and dxvk now supported!
-* Support building on PPC64LE (interpretor only)
-* Added support for Risc-V (interpretor only)
+* Support building on PPC64LE (interpreter only)
+* Added support for Risc-V (interpreter only)
v0.1.6
======
@@ -97,7 +122,7 @@ v0.1.6
* Some residual fixes on thread attribute handling
* Better handling of app that want 32bits jumps, like unity3d/mono (thanks mogery)
* More ARM hardware option in CMake (Phytium, NX...)
-* Added loongarch64 support (interpretor only)
+* Added loongarch64 support (interpreter only)
* Some fixes to elfloader
* Added a mecanism to cancel a Dynarec block construction if it triggers a segfault (instead of a crash)
@@ -120,7 +145,7 @@ v0.1.4
v0.1.2
======
* OpenSource!
-* A few more opcode added to the Interpretor and the Dynarec
+* A few more opcode added to the Interpreter and the Dynarec
* Improved Native Function calling
* Added some function to limit allocated memory to 47bits space (for Wine)
* Improved and Fixed the functions to limit allocated memory to 32bits space
@@ -134,7 +159,7 @@ v0.1.0
* Some fixes to a few function signature
* Improvement to Signal handling, and internal mutex handling
* A few fixes to some dynarec opcodes
-* A few fixes to some interpretor opcodes
+* A few fixes to some interpreter opcodes
v0.0.8
======
diff --git a/docs/COMPILE.md b/docs/COMPILE.md
index f0dd088..a14292c 100755..100644
--- a/docs/COMPILE.md
+++ b/docs/COMPILE.md
@@ -1,45 +1,57 @@
Compiling/Installing
----
-#### Debian-based Linux
+### Debian-based Linux
You can use [@ryanfortner](https://github.com/ryanfortner)'s apt repository to install precompiled box64 debs, updated every 24 hours.
```
sudo wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list
-wget -O- https://ryanfortner.github.io/box64-debs/KEY.gpg | sudo gpg --dearmor -o /usr/share/keyrings/box64-debs-archive-keyring.gpg
-sudo apt update && sudo apt install box64 -y
+wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg
+sudo apt update && sudo apt install box64-arm64 -y
```
Alternatively, you can generate your own package using the [instructions below](https://github.com/ptitSeb/box64/blob/main/docs/COMPILE.md#debian-packaging).
-#### for RK3399
+----
-Using a 64bit OS:
+### The general approach is:
```
git clone https://github.com/ptitSeb/box64
cd box64
-mkdir build; cd build; cmake .. -DRK3399=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j4
+mkdir build; cd build; cmake .. ${OPTIONS}
+make -j4
sudo make install
```
If it's the first install, you also need:
```
sudo systemctl restart systemd-binfmt
```
+- You can use `make -j1`, `make -j2` to prevent running out of memory
+- You can also add `-DBAD_SIGNAL=ON` to the cmake command if you are on Linux Kernel mixed with Android, like on RK3588 or maybe Termux
-#### for RK3588 / RK3588S
-
-Using a 64bit OS:
+#### For instance, if you want to build box64 for Generic ARM64 Linux platforms, it would look like this:
```
git clone https://github.com/ptitSeb/box64
cd box64
-mkdir build; cd build; cmake .. -DRK3588=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
+mkdir build; cd build; cmake .. -D ARM_DYNAREC=ON -D CMAKE_BUILD_TYPE=RelWithDebInfo
make -j4
sudo make install
+sudo systemctl restart systemd-binfmt
```
-If it's the first install, you also need:
+----
+
+#### for RK3399
+
+Using a 64bit OS:
```
-sudo systemctl restart systemd-binfmt
+-D RK3399=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
+```
+
+#### for RK3588 / RK3588S
+
+Using a 64bit OS:
+```
+-D RK3588=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
#### for Raspberry Pi 3
@@ -55,16 +67,8 @@ run out of memory at some point and need to run the build again.
Still, this can be faster if your build is attended.
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DRPI3ARM64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
+-D RPI3ARM64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
make
-# or e.g. make -j4
-sudo make install
-```
-If it's the first install, you also need:
-```
-sudo systemctl restart systemd-binfmt
```
#### for Raspberry Pi 4
@@ -72,15 +76,7 @@ sudo systemctl restart systemd-binfmt
Warning, you need a 64bit OS:
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DRPI4ARM64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j4
-sudo make install
-```
-If it's the first install, you also need:
-```
-sudo systemctl restart systemd-binfmt
+-D RPI4ARM64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
#### for TEGRA X1
@@ -88,31 +84,16 @@ sudo systemctl restart systemd-binfmt
Using a 64bit OS:
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DTEGRAX1=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j4
-sudo make install
-```
-If it's the first install, you also need:
-```
-sudo systemctl restart systemd-binfmt
+-D TEGRAX1=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
+
#### for ODROID N2/N2+
Using a 64bit OS:
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DODROIDN2=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j4
-sudo make install
-```
-If it's the first install, you also need:
-```
-sudo systemctl restart systemd-binfmt
+-D ODROIDN2=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
#### for Snapdragon 845
@@ -120,32 +101,21 @@ sudo systemctl restart systemd-binfmt
Using a 64bit OS:
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DSD845=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j4
-sudo make install
-```
-If it's the first install, you also need:
-```
-sudo systemctl restart systemd-binfmt
+-D SD845=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
-
-----
#### for Phytium
Using a 64bit OS:
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DPHYTIUM=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j4
-sudo make install
+-D PHYTIUM=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
-If it's the first install, you also need:
+
+#### for a generic ARM64 machine
+
+Using a 64bit OS:
```
-sudo systemctl restart systemd-binfmt
+-D ARM64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
#### for M1
@@ -153,38 +123,15 @@ sudo systemctl restart systemd-binfmt
Only test on Asahi for now, using the default "16K page" kernel
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DM1=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j4
-sudo make install
-```
-If it's the first install, you also need:
-```
-sudo systemctl restart systemd-binfmt
+-D M1=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
-
-#### for Other ARM64 Linux platforms
-
- `mkdir build; cd build; cmake .. -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo; make -j$(nproc)`
-
-You can also add `-DBAD_SIGNAL=ON` to the cmake command if you are on Linux Kernel mixed with Android, like on RK3588 or maybe Termux
-
#### for LoongArch
Using a 64bit OS:
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DLARCH64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j4
-sudo make install
-```
-If it's the first install, you also need:
-```
-sudo systemctl restart systemd-binfmt
+-D LARCH64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
#### for RISC-V
@@ -192,15 +139,7 @@ sudo systemctl restart systemd-binfmt
Using a 64bit OS:
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DRV64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j`nproc`
-sudo make install
-```
-If it's the first install, you also need:
-```
-sudo systemctl restart systemd-binfmt
+-D RV64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
#### for PowerPC 64 LE
@@ -208,15 +147,7 @@ sudo systemctl restart systemd-binfmt
Using a 64bit OS:
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DPPC64LE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j4
-sudo make install
-```
-If it's the first install, you also need:
-```
-sudo systemctl restart systemd-binfmt
+-D PPC64LE=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
#### for LX2160A
@@ -224,22 +155,16 @@ sudo systemctl restart systemd-binfmt
Using a 64bit OS:
```
-git clone https://github.com/ptitSeb/box64
-cd box64
-mkdir build; cd build; cmake .. -DLX2160A=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-make -j$(nproc)
-sudo make install
-```
-If it's the first install, you also need:
-```
-sudo systemctl restart systemd-binfmt
+-D LX2160A=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
```
#### for x86_64 Linux
+```
+-D LD80BITS=1 -D NOALIGN=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
+```
+If you encounter some linking errors, try using `NOLOADADDR=ON` (`cmake -D NOLOADADDR=ON; make -j$(nproc)`).
- `mkdir build; cd build; cmake .. -DLD80BITS=1 -DNOALIGN=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo; make -j$(nproc)`
-
-If you encounter some linking errors, try using `NOLOADADDR=ON` (`cmake -DNOLOADADDR=ON; make -j$(nproc)`).
+----
### use ccmake
@@ -257,7 +182,7 @@ The `-DCMAKE_BUILD_TYPE=RelWithDebInfo` argument makes a build that is both opti
#### To have a Trace Enabled build
-To have a trace enabled build (***the interpreter will be slightly slower***), add `-DHAVE_TRACE=1`. But you will need to have the [Zydis library](https://github.com/zyantific/zydis) in your `LD_LIBRARY_PATH` or in the system library folders at runtime.
+To have a trace enabled build (***the interpreter will be slightly slower***), add `-DHAVE_TRACE=1`. But you will need to have the [Zydis library](https://github.com/zyantific/zydis) in your `LD_LIBRARY_PATH` or in the system library folders at runtime. Use version v3.2.1, as later version changed the API and will no longer work with box64
#### To have ARM Dynarec
@@ -282,4 +207,4 @@ The tests are very basic and only tests some functionality for now.
Debian Packaging
----
-Box64 can also be packaged into a .deb file with `DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -us -uc -nc`.
+Box64 can also be packaged into a .deb file ***using the source code zip from the releases page*** with `DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -us -uc -nc`. Configure any additional cmake options you might want in `debian/rules`.
diff --git a/docs/README_CN.md b/docs/README_CN.md
deleted file mode 100644
index 1d10853..0000000
--- a/docs/README_CN.md
+++ /dev/null
@@ -1,119 +0,0 @@
-# box64
-
-![Official logo](img/Box64Logo.png "Official Logo")
-Linux上用户空间的x86_64应用模拟器
-
-----
-![box64 build status](https://app.travis-ci.com/ptitSeb/box64.svg?branch=main)
-
-[English](README.md)
-
-在ARM或其他非X86_64架构的Linux操作系统上,使用Box64可以运行x86_64 Linux程序(例如游戏),请注意,主机系统需要**64位小端**。
-
-您可以在Youtube的[MicroLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)、[Pi Labs](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)或[The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA)频道找到更多Box64视频。
-
-Box64使用了一些“系统”库的原生版本,例如libc、libm、SDL和OpenGL,所以它很容易与大多数应用程序集成和使用,并且在很多情况下性能会出奇的高。点击[此处](https://box86.org/index.php/2021/06/game-performances/)查看示例的基准测试分析。
-
-Box64为ARM64平台集成了DynaRec(动态重编译器),比仅使用解释器提升5到10倍性能。关于Dynarec如何工作的更多信息,可以在[这里](https://box86.org/2021/07/inner-workings-a-high%e2%80%91level-view-of-box86-and-a-low%e2%80%91level-view-of-the-dynarec/)找到。
-
-注:DynaRec需要针对不同平台编写一部分汇编代码,目前仅支持ARM64。
-
-一些x64内部操作码使用“Realmode X86 Emulator Library”的部分内容,请参阅[x64primop.c](../src/emu/x64primop.c)了解版权详情
-
-<img src="img/Box64Icon.png" width="96" height="96">
-
-Logo和图标由grayduck制作,感谢!
-
-----
-
-使用方法
-----
-
-若干环境变量可以设置Box64的行为。
-
-点击[这里](USAGE.md)了解所有的环境变量和它们的作用。
-
-请注意:Box64的Dynarec提供了一种机制来处理JIT代码,包含内存保护和段错误信号处理程序。简单地说,如果您想用GDB来调试一个使用JIT代码的运行程序(比如mono/Unity3D),您仍然会触发很多“正常”的段错误。建议在GDB中使用类似于`handle SIGSEGV nostop`的东西,不要在每个段错误时都停止,如果您想捕获段错误,可以在`signals.c`中的`my_memprotectionhandler`中放置一个断点。
-
-----
-
-编译/安装
-----
-> 编译说明可以在[这里](COMPILE.md)查看。
-
-----
-
-版本历史
-----
-
-版本日志在[这里](CHANGELOG.md)。
-
-----
-
-32位平台的注意事项
-----
-
-Box64的工作原理是直接将函数调用从x86_64转换到主机系统,主机系统(Box64运行的系统)需要有64位的库。Box64并不包括任何64位<->32位的转换。
-
-所以请理解,Box64只能运行64位的Linux二进制文件。对于32位的二进制文件,需要Box86(在64位的操作系统上需要所有的multiarch库或一些proot技巧)。
-
-请注意,许多(基于mojo的)安装程序,即使存在x86_64版本,但在检测到架构为ARM64时会退回到"x86",这时会尝试使用(如果有)box86进行安装。这时你可以使用一个假的"uname",当它的参数为"-m"时返回"x86_64"。
-
-----
-
-关于Unity游戏模拟的注意事项
-----
-
-当前Unity游戏模拟是一件碰运气的事情。Unity使用Mono(它的信号表示,并不总能100%成功模拟)。
-
-您还应该注意,一些Unity3D游戏需要OpenGL 3+,目前在ARM SBC(单板计算机)上提供OpenGL 3+是很棘手的。
-
-所以,并不是所有的Unity游戏都能工作,而且可能需要很高的OpenGL配置,但现在很多游戏都能工作。
-
-提示:如果游戏开始后在显示任何东西之前退出,在Pi4上使用`MESA_GL_VERSION_OVERRIDE=3.2`,在Panfrost上使用`PAN_MESA_DEBUG=gl3`来使用更高的配置文件。
-
-----
-
-关于GTK程序的注意事项
-----
-
-GTK 庫現在包裝在 box64 上,但只有 gtk2,而不是 gtk3(與 box86 相反)。
-
-----
-
-关于Steam的注意事项
-----
-
-Steam并不是32位/64位混合的,而是32位的,因此您需要Box86才能运行Steam。Steam也使用64位的本地服务器程序,但像大多数使用libcef/chromium的程序一样,在box64上暂时无法正常工作。
-所以:目前在box64上无法运行Steam。
-----
-
-关于Wine的注意事项
-----
-
-box64支持64位Wine,但请注意,64位的Wine还包含32位的组件,以便能够运行32位的Windws程序。32位程序需要Box86,没有它就不能运行。在Box64和Box86共存的系统上,设置64位Wine可以同时运行32位和64位windows程序(只需分别使用 `wine` 和 `wine64`)。
-
-----
-
-关于Vulkan注意事项
-----
-
-Box64 包裝 Vulkan 庫。但請注意,它僅使用 RX550 卡進行了測試,根據您的圖形卡,可能會缺少某些擴展。
-
-----
-
-结语
-----
-
-我要感谢所有为 box64 开发做出贡献的人。
-贡献方式有很多种:代码贡献、财务帮助、捐赠捐赠和广告合作!
-以下感谢不分先后:
- * 代码贡献:rajdakin, mogery
- * 财务帮助:FlyingFathead, stormchaser3000, dennis1248, sll00, [libre-computer-project](https://libre.computer/)
- * 硬件捐赠:[Radxa](https://rockpi.org/), [Pine64](https://www.pine64.org/), [StarFive](https://rvspace.org/)
- * 硬件捐赠和LoongArch迁移:[xiaoji](https://www.linuxgame.cn)
- * 为本项目持续的宣传:salva ([microLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)), [PILab](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)/[TwisterOS](https://twisteros.com/) team, [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA), [NicoD](https://www.youtube.com/channel/UCpv7NFr0-9AB5xoklh3Snhg), ekianjo ([Boilingsteam](https://boilingsteam.com/))
-
-我还要感谢很多人,即使他们只参与了一次本项目。
-
-(如果你的项目中使用了Box64,请不要忘记提及!)
diff --git a/docs/USAGE.md b/docs/USAGE.md
index 67a43f0..5c67f0f 100755..100644
--- a/docs/USAGE.md
+++ b/docs/USAGE.md
@@ -38,7 +38,7 @@ Enables/Disables the logging of `dlsym` errors.
#### BOX64_TRACE_FILE *
Send all log and trace to a file instead of `stdout`
Also, if name contains `%pid` then this is replaced by the actual PID of box64 instance
-End the filename with `+` to have thetrace appended instead of overwriten
+End the filename with `+` to have thetrace appended instead of overwritten
Use `stderr` to use this instead of default `stdout`
#### BOX64_TRACE *
@@ -130,9 +130,14 @@ Enables/Disables trace for generated code.
* 1 : Enable trace for generated code (like regular Trace, this will slow down the program a lot and generate huge logs).
#### BOX64_NODYNAREC *
-Forbid dynablock creation in the interval specified (helpfull for debugging behaviour difference between Dynarec and Interpretor)
+Forbid dynablock creation in the interval specified (helpfull for debugging behaviour difference between Dynarec and Interpreter)
* 0xXXXXXXXX-0xYYYYYYYY : define the interval where dynablock cannot start (inclusive-exclusive)
+#### BOX64_DYNAREC_TEST *
+Dynarec will compare it's execution with the interpreter (super slow, only for testing)
+ * 0 : No comparison
+ * 1 : Each opcode runs on interepter and on Dynarec, and regs and memory are compared and print if different
+
#### BOX64_DYNAREC_BIGBLOCK *
Enables/Disables Box64's Dynarec building BigBlock.
* 0 : Don't try to build block as big as possible (can help program using lots of thread and a JIT, like C#/Unity) (Default when libmonobdwgc-2.0.so is loaded)
@@ -178,12 +183,12 @@ Optimisation of CALL/RET opcodes (not compatible with jit/dynarec/smc)
* 1 : Try to optimized CALL/RET, skipping the use of the JumpTable when possible (will crash if blacks are invalidate, so probably incompatible with JIT/Dynarec)
#### BOX64_DYNAREC_HOTPAGE *
-Handling of HotPage (Page beeing both executed and writen)
-* 0 : Don't track hotpage
-* 1-255 : Track HotPage, and disable execution of a page beeing writen for N attempts (default is 4)
+Handling of HotPage (Page being both executed and written)
+* 0 : Don't track hotpage (Default)
+* 1-255 : Track HotPage, and disable execution of a page being written for N attempts
#### BOX64_DYNAREC_FASTPAGE *
-Will use a faster handling of HotPage (Page beeing both executed and writen)
+Will use a faster handling of HotPage (Page being both executed and written)
* 0 : use regular hotpage (Default)
* 1 : Use faster hotpage, taking the risk of running obsolete JIT code (might be faster, but more prone to crash)
@@ -192,11 +197,21 @@ Detect MonoBleedingEdge and apply conservative settings
* 0 : Don't detect MonoBleedingEdge
* 1 : Detect MonoBleedingEdge, and apply BIGBLOCK=0 STRONGMEM=1 if detected (Default)
+#### BOX64_DYNAREC_JVM *
+Detect libjvm and apply conservative settings
+* 0 : Don't detect libjvm
+* 1 : Detect libjvm, and apply BIGBLOCK=0 STRONGMEM=1 if detected (Default)
+
#### BOX64_DYNAREC_WAIT *
Behavior with FillBlock is not availble (FillBlock build Dynarec blocks and is not multithreaded)
* 0 : Dynarec will not wait for FillBlock to ready and use Interpreter instead (might speedup a bit massive multithread or JIT programs)
* 1 : Dynarec will wait for FillBlock to be ready (Default)
+#### BOX64_DYNAREC_MISSING *
+Dynarec print the missing opcodes
+* 0 : not print the missing opcode (Default, unless DYNAREC_LOG>=1 or DYNAREC_DUMP>=1 is used)
+* 1 : Will print the missing opcodes
+
#### BOX64_SSE_FLUSHTO0 *
Handling of SSE Flush to 0 flags
* 0 : Just track the flag (Default)
@@ -306,3 +321,7 @@ Those variables are only valid inside a rcfile:
#### BOX64_EXIT
* 0 : Nothing special
* 1 : Just exit, don't try to run the program
+
+#### BOX64_RESERVE_HIGH
+* 0 : Don't try to pe-reserve high memory (beyond 47bits) (Default)
+* 1 : Try to reserve (without allocating it) memory beyond 47bits (seems unstable)
diff --git a/docs/box64.pod b/docs/box64.pod
new file mode 100644
index 0000000..b5c89f5
--- /dev/null
+++ b/docs/box64.pod
@@ -0,0 +1,465 @@
+=head1 NAME
+
+box64 - Linux Userspace x86_64 Emulator with a twist
+
+=head1 SYNOPSIS
+
+B<box64> [B<--help>] [B<--version>] I<executable>
+
+=head1 DESCRIPTION
+
+B<Box64> lets you run x86_64 Linux programs (such as games) on non-x86_64 Linux
+systems, like ARM (host system needs to be 64-bit little-endian). Since B<Box64>
+uses the native versions of some "system" libraries, like libc, libm, SDL, and
+OpenGL, it's easy to integrate and use with most applications, and performance
+can be surprisingly high in many cases. B<Box64> integrates with DynaRec (dynamic
+recompiler) for the ARM64 platform, providing a speed boost between 5 to 10
+times faster than using only the interpreter.
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<-h,--help>
+
+Print box64 help and quit.
+
+=item B<-v,--version>
+
+Print box64 version and quit.
+
+=back
+
+=head1 CONFIGURATION FILE
+
+B<Box64> now have configurations files. There are 2 files loaded.
+F</etc/box4.box64rc> and F<~/.box64rc>. Both files have the same syntax, and is
+basically an ini files. Section in square brackets define the process name, and
+the rest is the environment variable. B<Box64> comes with a default file that
+should be installed for better stability. Note that the priority is:
+F<~/.bashrc> > F</etc/box64.box64rc> > command line So, your settings in
+F<~/.bashrc> may override the setting from your command line. Example:
+
+ [factorio]
+ BOX64_DYNAREC_SAFEFLAGS=0
+ BOX64_DYNAREC_BIGBLOCK=2
+ BOX64_DYNAREC_FORWARD=1024
+ BOX64_DYNAREC_CALLRET=1
+
+=head1 VARIABLES FOR RCFILE ONLY
+
+=over 8
+
+=item B<BOX64_NOSANDBOX=0|1>
+
+When set to 1, add C<--no-sandbox> to command line arguments (useful for chrome
+based programs).
+
+=item B<BOX64_EXIT>=I<0|1>
+
+When set to 1, just exit, don't try to run the program.
+
+=back
+
+=head1 VARIABLES ONLY FOR ENVIRONMENT AND NOT RCFILE
+
+=over 8
+
+=item B<BOX64_NOBANNER>=I<0|1>
+
+When set to 1, don't prints the banner including version and build.
+
+=item B<BOX64_LD_PRELOAD>=I<lib1>[:I<lib2>:...]
+
+Force loading libraries with the binary. PreLoaded libs can be emulated or
+native, and are treated the same way as if they were comming from the binary.
+
+=item B<BOX64_ENV>=I<env=val>
+
+Add an variable with value to the environment.
+
+=item B<BOX64_ENV1>=I<env=val> B<BOX64_ENV2>=I<env=val> ...
+
+Add arbitrary many variables using B<BOX64_ENV1>, B<BOX64_ENV2>, ...
+
+=item B<BOX64_NORCFILES>
+
+No rc files (like F</etc/box64.box64rc> and F<~/.box64rc>) will be loaded.
+
+=back
+
+=head1 VARIABLES FOR BOTH ENVIRONMENT AND RCFILE
+
+=over 8
+
+=item B<BOX64_LOG>=I<0|NONE|1|INFO|2|DEBUG|3|DUMP>
+
+Controls the Verbosity level of the logs
+
+ * 0 or NONE : No message (except some fatal error). (Default.)
+ * 1 or INFO : Show some minimum log (Example: libraries not found)
+ * 2 or DEBUG : Details a lot of stuff (Example: relocations or functions called).
+ * 3 or DUMP : All DEBUG plus DUMP of all ELF Info.
+
+=item B<BOX64_ROLLING_LOG>=I<0|1|N>
+
+Show last few wrapped function call when a Signal is caught. Incompatible with
+B<BOX64_LOG> > 1 (may need B<BOX64_SHOWSEGV=1> also)
+
+ * 0: No last function call printed (Default.)
+ * 1: Last 16 wrapped functions calls printed when a signal is printed.
+ * N: Last N wrapped functions calls printed when a signal is printed.
+
+=item B<BOX64_LD_LIBRARY_PATH>=I</path/to/libs>
+
+Path to look for x86_64 libraries. Default is current folder and C<lib> in
+current folder. Also, F</usr/lib/x86_64-linux-gnu> and
+F</lib/x86_64-linux-gnu> are added if they exist.
+
+=item B<BOX64_PATH>=I</path/to/bins>
+
+Path to look for x86_64 executable. Default is current folder and C<bin> in
+current folder.
+
+=item B<BOX64_DLSYM_ERROR>=I<0|1>
+
+Enables/Disables the logging of `dlsym` errors.
+
+ * 0 : Don't log `dlsym` errors. (Default.)
+ * 1 : Log dlsym errors.
+
+=item B<BOX64_TRACE_FILE>=I</path/to/file>
+
+Send all log and trace to a file instead of C<stdout>. Also, if name contains
+C<%pid> then this is replaced by the actual C<PID> of B<box64> instance. End
+the filename with `+` to have thetrace appended instead of overwritten Use
+C<stderr> to use this instead of default C<stdout>.
+
+=item B<BOX64_TRACE>=I<0|1|symbolname|0xXXXXXXX-0xYYYYYYY>
+
+Only on build with trace enabled. Trace allow the logging of all instruction executed, along with register dump
+
+ * 0 : No trace. (Default.)
+ * 1 : Trace enabled. Trace start after the initialisation of all depending libraries is done.
+ * symbolname : Trace only `symbolname` (trace is disable if the symbol is not found).
+ * 0xXXXXXXX-0xYYYYYYY : Trace only between the 2 addresses.
+
+=item B<BOX64_TRACE_INIT>=I<0|1>
+
+Use B<BOX64_TRACE_INIT> instead of B<BOX_TRACE> to start trace before the
+initialization of libraries and the running program
+
+ * 0 : No trace. (Default.)
+ * 1 : Trace enabled. The trace start with the initialisation of all depending libraries is done.
+
+=item B<BOX64_TRACE_START>=I<NNNNNNN>
+
+Only on builds with trace enabled. Start trace only after I<NNNNNNNN> opcode
+execute (number is an `uint64_t`).
+
+=item B<BOX64_TRACE_XMM>=I<0|1>
+
+Only on builds with trace enabled.
+
+ * 0 : The XMM (i.e. SSE/SSE2) register will not be logged with the general and x86 registers. (Default.)
+ * 1 : Dump the XMM registers.
+
+=item B<BOX64_TRACE_EMM>=I<0|1>
+
+Only on builds with trace enabled.
+
+ * 0 : The EMM (i.e. MMX) register will not be logged with the general and x86 registers. (Default.)
+ * 1 : Dump the EMM registers.
+
+=item B<BOX64_TRACE_COLOR>=I<0|1>
+
+Only on builds with trace enabled.
+
+ * 0 : The general registers will always be the default white color. (Default.)
+ * 1 : The general registers will change color in the dumps when they changed value.
+
+=item B<BOX64_LOAD_ADDR>=I<0xXXXXXXXX>
+
+Try to load at C<0xXXXXXX> main binary (if binary is a PIE).
+
+=item B<BOX64_NOSIGSEGV>=I<0|1>
+
+Disable handling of SigSEGV. (Very useful for debugging.)
+
+ * 0 : Let the x86 program set sighandler for SEGV (Default.)
+ * 1 : Disable the handling of SigSEGV.
+
+=item B<BOX64_NOSIGILL>=I<0|1>
+
+Disable handling of SigILL (to ease debugging mainly).
+
+ * 0 : Let x86 program set sighandler for Illegal Instruction
+ * 1 : Disables the handling of SigILL
+
+=item B<BOX64_SHOWSEGV>=I<0|1>
+
+Show Segfault signal even if a signal handler is present
+
+ * 0 : Don"t force show the SIGSEGV analysis (Default.)
+ * 1 : Show SIGSEGV detail, even if a signal handler is present
+
+=item B<BOX64_SHOWBT>=I<0|1>
+
+Show some Backtrace (Nativ e and Emulated) whgen a signal (SEGV, ILL or BUS) is caught
+
+ * 0 : Don"t show backtraces (Default.)
+ * 1 : Show Backtrace detail (for native, box64 is rename as the x86_64 binary run)
+
+=item B<BOX64_X11THREADS>=I<0|1>
+
+Call XInitThreads when loading X11. (This is mostly for old Loki games with the Loki_Compat library.)
+
+ * 0 : Don't force call XInitThreads. (Default.)
+ * 1 : Call XInitThreads as soon as libX11 is loaded.
+
+=item B<BOX64_X11GLX>=I<0|1>
+
+Force libX11's GLX extension to be present.
+
+ * 0 : Do not force libX11's GLX extension to be present.
+ * 1 : GLX will always be present when using XQueryExtension. (Default.)
+
+=item B<BOX64_DYNAREC_DUMP>=I<0|1|2>
+
+Enables/disables Box64's Dynarec's dump.
+
+ * 0 : Disable Dynarec's blocks dump. (Default.)
+ * 1 : Enable Dynarec's blocks dump.
+ * 2 : Enable Dynarec's blocks dump with some colors.
+
+=item B<BOX64_DYNAREC_LOG>=I<0|1|2|3>
+
+Set the level of DynaRec's logs.
+
+ * 0 : NONE : No Logs for DynaRec. (Default.)
+ * 1 :INFO : Minimum Dynarec Logs (only unimplemented OpCode).
+ * 2 : DEBUG : Debug Logs for Dynarec (with details on block created / executed).
+ * 3 : VERBOSE : All of the above plus more.
+
+=item B<BOX64_DYNAREC>=I<0|1>
+
+Enables/Disables Box64's Dynarec.
+
+ * 0 : Disables Dynarec.
+ * 1 : Enable Dynarec. (Default.)
+
+=item B<BOX64_DYNAREC_TRACE>=I<0|1>
+
+Enables/Disables trace for generated code. Like regular Trace, this will slow
+down the program a lot and generate huge logs.
+
+ * 0 : Disable trace for generated code. (Default.)
+ * 1 : Enable trace for generated code
+
+=item B<BOX64_NODYNAREC>=I<0xXXXXXXXX-0xYYYYYYYY>
+
+Forbid dynablock creation in the interval specified (helpfull for debugging
+behaviour difference between Dynarec and Interpretor)
+
+=item B<BOX64_DYNAREC_TEST>=I<0|1>
+
+Enables/Disables test for generated code. This will run interpreter along the Dynacrec, so this will slow
+down the program a lot.
+
+ * 0 : No test for generated code. (Default.)
+ * 1 : Enable Tests for generated code
+
+=item B<BOX64_DYNAREC_BIGBLOCK>=I<0|1|2|3>
+
+Enables/Disables Box64's Dynarec building BigBlock.
+
+ * 0 : Don't try to build block as big as possible (can help program using lots of thread and a JIT, like C#/Unity) (Default when libmonobdwgc-2.0.so is loaded)
+ * 1 : Build Dynarec block as big as possible (Default.)
+ * 2 : Build Dynarec block bigger (don't stop when block overlaps, but only for blocks in elf memory)
+ * 3 : Build Dynarec block bigger (don't stop when block overlaps, for all type of memory)
+
+=item B<BOX64_DYNAREC_FORWARD>=I<0|XXX>
+
+Define Box64's Dynarec max allowed forward value when building Block.
+
+ * 0 : No forward value. When current block end, don't try to go further even if there are previous forward jumps
+ * XXX : Allow up to XXXX bytes of gap when building a Block after the block end to next forward jump (Default: 128)
+
+=item B<BOX64_DYNAREC_STRONGMEM>=I<0|1|2>
+
+Enable/Disable simulation of Strong Memory model
+
+ * 0 : Don't try anything special (Default.)
+ * 1 : Enable some Memory Barrier when reading from memory (on some MOV opcode) to simulate Strong Memory Model while trying to limit performance impact (Default when libmonobdwgc-2.0.so is loaded)
+ * 2 : Enable some Memory Barrier when reading from memory (on some MOV opcode) to simulate Strong Memory Model
+
+=item B<BOX64_DYNAREC_X87DOUBLE>=I<0|1>
+
+Force the use of Double for x87 emulation
+
+ * 0 : Try to use float when possible for x87 emulation (default, faster)
+ * 1 : Only use Double for x87 emulation (slower, may be needed for some specific games, like Crysis)
+
+=item B<BOX64_DYNAREC_FASTNAN>=I<0|1>
+
+Enable/Disable generation of -NAN
+
+ * 0 : Generate -NAN like on x86
+ * 1 : Don't do anything special with NAN, to go as fast as possible (default, faster)
+
+=item B<BOX64_DYNAREC_FASTROUND>=I<0|1>
+
+Enable/Disable generation of precise x86 rounding
+
+ * 0 : Generate float/double -> int rounding like on x86
+ * 1 : Don't do anything special with edge case Rounding, to go as fast as possible (no INF/NAN/Overflow -> MIN_INT conversion) (default, faster)
+
+=item B<BOX64_DYNAREC_SAFEFLAGS>=I<0|1|2>
+
+Handling of flags on CALL/RET opcodes
+
+ * 0 : Treat CALL/RET as if it never needs any flags (faster but not advised)
+ * 1 : most of RET will need flags, most of CALLS will not (Default)
+ * 2 : All CALL/RET will need flags (slower, but might be needed. Automatically enabled for Vara.exe)
+
+=item B<BOX64_DYNAREC_CALLRET>=I<0|1>
+
+Optimisation of CALL/RET opcodes (not compatible with jit/dynarec/smc)
+
+ * 0 : Don't optimize CALL/RET, use Jump Table for boths (Default)
+ * 1 : Try to optimized CALL/RET, skipping the use of the JumpTable when possible (will crash if blacks are invalidate, so probably incompatible with JIT/Dynarec)
+
+=item B<BOX64_DYNAREC_HOTPAGE>=I<0|1-255>
+
+Handling of HotPage (Page beeing both executed and writen)
+
+ * 0 : Don't track hotpage
+ * 1-255 : Track HotPage, and disable execution of a page beeing writen for N attempts (default is 4)
+
+=item B<BOX64_DYNAREC_FASTPAGE>=I<0|1>
+
+Will use a faster handling of HotPage (Page beeing both executed and writen)
+
+ * 0 : use regular hotpage (Default)
+ * 1 : Use faster hotpage, taking the risk of running obsolete JIT code (might be faster, but more prone to crash)
+
+=item B<BOX64_DYNAREC_BLEEDING_EDGE>=I<0|1>
+
+Detect MonoBleedingEdge and apply conservative settings
+
+ * 0 : Don't detect MonoBleedingEdge
+ * 1 : Detect MonoBleedingEdge, and apply BIGBLOCK=0 STRONGMEM=1 if detected (Default)
+
+=item B<BOX64_DYNAREC_WAIT>=I<0|1>
+
+Behavior with FillBlock is not availble (FillBlock build Dynarec blocks and is not multithreaded)
+
+ * 0 : Dynarec will not wait for FillBlock to ready and use Interpreter instead (might speedup a bit massive multithread or JIT programs)
+ * 1 : Dynarec will wait for FillBlock to be ready (Default)
+
+=item B<BOX64_SSE_FLUSHTO0>=I<0|1>
+
+Handling of SSE Flush to 0 flags
+
+ * 0 : Just track the flag (Default)
+ * 1 : Direct apply of SSE Flush to 0 flag
+
+=item B<BOX64_X87_NO80BITS>=I<0|1>
+
+Handling of x87 80bits long double
+
+ * 0 : Try to handle 80bits long double as precise as possible (Default)
+ * 1 : Handle them as double
+
+=item B<BOX64_LIBCEF>=I<0|1>
+
+Detect libcef and apply malloc_hack settings
+
+ * 0 : Don't detect libcef
+ * 1 : Detect libcef, and apply MALLOC_HACK=2 if detected (Default)
+
+=item B<BOX64_LIBGL>=I<libXXXX|/PATH/TO/libGLXXX>
+
+You can also use B<SDL_VIDEO_GL_DRIVER>
+
+ * libXXXX set the name for libGL (defaults to libGL.so.1).
+ * /PATH/TO/libGLXXX : Sets the name and path for libGL
+
+=item B<BOX64_EMULATED_LIBS>=I<XXXX[:YYYY:...]>
+
+Force lib XXXX (and YYYY...) to be emulated (and not wrapped) Some games uses
+an old version of some libraries, with an ABI incompatible with native version.
+Note that LittleInferno for example is auto detected, and libvorbis.so.0 is
+automatical added to emulated libs, and same for Don't Starve (and Together /
+Server variant) that use an old SDL2 too
+
+=item B<BOX64_ALLOWMISSINGLIBS>=I<0|1>
+
+Allow Box64 to continue even if a library is missing.
+
+ * 0 : Box64 will stop if a library cannot be loaded. (Default.)
+ * 1 : Continue even if a needed library cannot be loaded. Unadvised, this will, in most cases, crash later on.
+
+=item B<BOX64_PREFER_WRAPPED>=I<0|1>
+
+Box64 will use wrapped libs even if the lib is specified with absolute path
+
+ * 0 : Try to use emulated libs when they are defined with absolute path (Default.)
+ * 1 : Use Wrapped native libs even if path is absolute
+
+=item B<BOX64_PREFER_EMULATED>=I<0|1>
+
+Box64 will prefer emulated libs first (execpt for glibc, alsa, pulse, GL,
+vulkan and X11
+
+ * 0 : Native libs are prefered (Default.)
+ * 1 : Emulated libs are prefered (Default for program running inside pressure-vessel)
+
+=item B<BOX64_CRASHHANDLER>=I<0|1>
+
+Box64 will use a dummy crashhandler.so library
+
+ * 0 : Use Emulated crashhandler.so library if needed
+ * 1 : Use an internal dummy (completly empty) crashhandler.so library (defaut)
+
+=item B<BOX64_MALLOC_HACK>=I<0|1|2>
+
+How Box64 will handle hooking of malloc operators
+
+ * 0 : Don't allow malloc operator to be redirected, rewriting code to use regular function (Default)
+ * 1 : Allow malloc operator to be redirected (not advised)
+ * 2 : Like 0, but track special mmap / free (some redirected functions were inlined and cannot be redirected)
+
+=item B<BOX64_NOPULSE>=I<0|1>
+
+Disables the load of pulseaudio libraries.
+
+ * 0 : Load pulseaudio libraries if found. (Default.)
+ * 1 : Disables the load of pulse audio libraries (libpulse and libpulse-simple), both the native library and the x86 library
+
+=item B<BOX64_NOGTK>=I<0|1>
+
+Disables the loading of wrapped GTK libraries.
+
+ * 0 : Load wrapped GTK libraries if found. (Default.)
+ * 1 : Disables loading wrapped GTK libraries.
+
+=item B<BOX64_NOVULKAN>=I<0|1>
+
+Disables the load of vulkan libraries.
+
+ * 0 : Load vulkan libraries if found.
+ * 1 : Disables the load of vulkan libraries, both the native and the i386 version (can be useful on Pi4, where the vulkan driver is not quite there yet.)
+
+=item B<BOX64_BASH>=I<yyyy>
+
+Define x86_64 bash to launch script. Will use yyyy as x86_64 bash to launch
+script. yyyy needs to be a full path to a valid x86_64 version of bash
+
+=item B<BOX64_JITGDB>=I<0|1|2>
+
+ * 0 : Just print the Segfault message on segfault (default)
+ * 1 : Launch `gdb` when a segfault, bus error or illegal instruction signal is trapped, attached to the offending process and go in an endless loop, waiting. When in gdb, you need to find the correct thread yourself (the one with `my_box64signalhandler` in is stack) then probably need to `finish` 1 or 2 functions (inside `usleep(..)`) and then you'll be in `my_box64signalhandler`, just before the printf of the Segfault message. Then simply `set waiting=0` to exit the infinite loop.
+ * 2 : Launch `gdbserver` when a segfault, bus error or illegal instruction signal is trapped, attached to the offending process, and go in an endless loop, waiting. Use `gdb /PATH/TO/box64` and then `target remote 127.0.0.1:1234` to connect to the gdbserver (or use actual IP if not on the machine). After that, the procedure is the same as with ` BOX64_JITGDB=1`. This mode can be usefullwhen programs redirect all console output to a file (like Unity3D Games)
+
+=cut
diff --git a/docs/img/Box64Icon.png b/docs/img/Box64Icon.png
index 8b3c7a9..8b3c7a9 100755..100644
--- a/docs/img/Box64Icon.png
+++ b/docs/img/Box64Icon.png
Binary files differ
diff --git a/docs/img/Box64Logo.png b/docs/img/Box64Logo.png
index bac2f54..bac2f54 100755..100644
--- a/docs/img/Box64Logo.png
+++ b/docs/img/Box64Logo.png
Binary files differ
diff --git a/rebuild_wrappers.py b/rebuild_wrappers.py
index edd40ec..0bd25f0 100755
--- a/rebuild_wrappers.py
+++ b/rebuild_wrappers.py
@@ -152,10 +152,10 @@ class FunctionConvention(object):
self.values = valid_chars
# Free letters: B FG J QR T XYZab e gh jk mno qrst xyz
conventions = {
- 'F': FunctionConvention('F', "System V", ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'M', 'H', 'P', 'A']),
+ 'F': FunctionConvention('F', "System V", ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'M', 'H', 'P', 'A', 'x', 'X']),
'W': FunctionConvention('W', "Windows", ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'K', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'M', 'P', 'A'])
}
-sortedvalues = ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'M', 'H', 'P', 'A', '0', '1']
+sortedvalues = ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'M', 'H', 'P', 'A', 'x', 'X', '0', '1']
assert(all(all(c not in conv.values[:i] and c in sortedvalues for i, c in enumerate(conv.values)) for conv in conventions.values()))
class FunctionType(str):
@@ -384,7 +384,7 @@ def readFiles(files: Iterable[Filename]) -> Tuple[JumbledGlobals, JumbledRedirec
# If you find no problem, comment the error below, add a "pass" line (so python is happy)
# and open a ticket so I can fix this.
raise NotImplementedError("Some functions are only implemented under one condition (probably) ({0}:{1})"
- .format(k, filename) + " [extra note in the script]")
+ .format(k, filename) + " [extra note in the script]\nProblematic function{}: {}".format(("" if len(funsname[k]) == 1 else "s"), funsname[k]))
for f in funsname[k]:
if f in ['_fini', '_init', '__bss_start', '__data_start', '_edata', '_end']:
continue # Always allow those symbols [TODO: check if OK]
@@ -824,13 +824,18 @@ def main(root: str, files: Iterable[Filename], ver: str):
allowed_regs : str = "cCwWiuIUlLp"
allowed_fpr : str = "fd"
+ # Detect functions which return in an x87 register
+ retx87_wraps: Dict[ClausesStr, List[FunctionType]] = {}
+ return_x87: str = "DK"
+
# Sanity checks
- forbidden_simple: str = "EDKVOSNMHPA"
+ forbidden_simple: str = "EDKVOSNMHPAxX"
assert(len(allowed_simply) + len(allowed_regs) + len(allowed_fpr) + len(forbidden_simple) == len(allowed_conv.values))
assert(all(c not in allowed_regs for c in allowed_simply))
assert(all(c not in allowed_simply + allowed_regs for c in allowed_fpr))
assert(all(c not in allowed_simply + allowed_regs + allowed_fpr for c in forbidden_simple))
assert(all(c in allowed_simply + allowed_regs + allowed_fpr + forbidden_simple for c in allowed_conv.values))
+ assert(all(c in allowed_conv.values for c in return_x87))
def check_simple(v: FunctionType) -> Optional[int]:
regs_count: int = 0
@@ -867,6 +872,15 @@ def main(root: str, files: Iterable[Filename], ver: str):
simple_wraps[k] = tmp
simple_idxs = sorted(simple_wraps.keys(), key=lambda x: Clauses(x).splitdef())
+ def check_return_x87(v: FunctionType) -> bool:
+ return v[0] in return_x87
+
+ for k in gbls:
+ tmp = [v for v in gbls[k] if check_return_x87(v)]
+ if tmp:
+ retx87_wraps[k] = tmp
+ retx87_idxs = sorted(retx87_wraps.keys(), key=lambda x: Clauses(x).splitdef())
+
# Now the files rebuilding part
# File headers and guards
files_header = {
@@ -880,6 +894,8 @@ def main(root: str, files: Iterable[Filename], ver: str):
#include "emu/x87emu_private.h"
#include "regs.h"
#include "x64emu.h"
+ #define COMPLEX_IMPL
+ #include "complext.h"
extern void* my__IO_2_1_stdin_ ;
extern void* my__IO_2_1_stdout_;
@@ -908,12 +924,14 @@ def main(root: str, files: Iterable[Filename], ver: str):
#define __WRAPPER_H_
#include <stdint.h>
#include <string.h>
+ #include "complext.h"
typedef struct x64emu_s x64emu_t;
// the generic wrapper pointer functions
typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
-
+
+
// list of defined wrapper
// E = current x86emu struct
// v = void
@@ -933,6 +951,8 @@ def main(root: str, files: Iterable[Filename], ver: str):
// M = ... automatically sending 2 args
// A = va_list
// 0 = constant 0, 1 = constant 1
+ // x = float complex
+ // X = double complex
""",
"fntypes.h": """
@@ -994,10 +1014,10 @@ def main(root: str, files: Iterable[Filename], ver: str):
# Rewrite the wrapper.c file:
# i and u should only be 32 bits
td_types = {
- # E v c w i I C W u U f d D K l L p V O S N M H P A
- 'F': ["x64emu_t*", "void", "int8_t", "int16_t", "int64_t", "int64_t", "uint8_t", "uint16_t", "uint64_t", "uint64_t", "float", "double", "long double", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "...", "...", "unsigned __int128", "void*", "void*"],
+ # E v c w i I C W u U f d D K l L p V O S N M H P A x X
+ 'F': ["x64emu_t*", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "long double", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "...", "...", "unsigned __int128", "void*", "void*", "complexf_t", "complex_t"],
# E v c w i I C W u U f d K l L p V O S N M P A
- 'W': ["x64emu_t*", "void", "int8_t", "int16_t", "int64_t", "int64_t", "uint8_t", "uint16_t", "uint64_t", "uint64_t", "float", "double", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "...", "...", "void*", "void*"]
+ 'W': ["x64emu_t*", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "...", "...", "void*", "void*"]
}
assert(all(k in conventions for k in td_types))
for k in conventions:
@@ -1032,11 +1052,11 @@ def main(root: str, files: Iterable[Filename], ver: str):
"fn({0});", # v
"R_RAX=fn({0});", # c
"R_RAX=fn({0});", # w
- "R_RAX=(int64_t)fn({0});", # i should be int32_t
+ "R_RAX=(int32_t)fn({0});", # i
"R_RAX=(int64_t)fn({0});", # I
"R_RAX=(unsigned char)fn({0});", # C
"R_RAX=(unsigned short)fn({0});", # W
- "R_RAX=(uint64_t)fn({0});", # u should be uint32_t
+ "R_RAX=(uint32_t)fn({0});", # u
"R_RAX=fn({0});", # U
"emu->xmm[0].f[0]=fn({0});", # f
"emu->xmm[0].d[0]=fn({0});", # d
@@ -1053,17 +1073,19 @@ def main(root: str, files: Iterable[Filename], ver: str):
"unsigned __int128 u128 = fn({0}); R_RAX=(u128&0xFFFFFFFFFFFFFFFFL); R_RDX=(u128>>64)&0xFFFFFFFFFFFFFFFFL;", # H
"\n#error Invalid return type: pointer in the stack\n", # P
"\n#error Invalid return type: va_list\n", # A
+ 'from_complexf(emu, fn({0})));', # x
+ 'from_complex(emu, fn({0})));' # X
],
conventions['W']: [
"\n#error Invalid return type: emulator\n", # E
"fn({0});", # v
"R_RAX=fn({0});", # c
"R_RAX=fn({0});", # w
- "R_RAX=(int64_t)fn({0});", # i should be int32_t
+ "R_RAX=(int32_t)fn({0});", # i
"R_RAX=(int64_t)fn({0});", # I
"R_RAX=(unsigned char)fn({0});", # C
"R_RAX=(unsigned short)fn({0});", # W
- "R_RAX=(uint64_t)fn({0});", # u should be uint32_t
+ "R_RAX=(uint32_t)fn({0});", # u
"R_RAX=fn({0});", # U
"emu->xmm[0].f[0]=fn({0});", # f
"emu->xmm[0].d[0]=fn({0});", # d
@@ -1082,27 +1104,27 @@ def main(root: str, files: Iterable[Filename], ver: str):
}
# vreg: value is in a general register
- # E v c w i I C W u U f d D K l L p V O S N M H P A
- vreg = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1]
+ # E v c w i I C W u U f d D K l L p V O S N M H P A x X
+ vreg = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1, 0, 0]
# vxmm: value is in a XMM register
- # E v c w i I C W u U f d D K l L p V O S N M H P A
- vxmm = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ # E v c w i I C W u U f d D K l L p V O S N M H P A x X
+ vxmm = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2]
# vother: value is elsewere
- # E v c w i I C W u U f d D K l L p V O S N M H P A
- vother = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
+ # E v c w i I C W u U f d D K l L p V O S N M H P A x X
+ vother = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
# vstack: value is on the stack (or out of register)
- # E v c w i I C W u U f d D K l L p V O S N M H P A
- vstack = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 0, 1, 1, 1, 2, 2, 1, 1]
+ # E v c w i I C W u U f d D K l L p V O S N M H P A x X
+ vstack = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 0, 1, 1, 1, 2, 2, 1, 1, 1, 2]
arg_r = [
"", # E
"", # v
"(int8_t){p}, ", # c
"(int16_t){p}, ", # w
- "(int64_t){p}, ", # i should int32_t
+ "(int32_t){p}, ", # i
"(int64_t){p}, ", # I
"(uint8_t){p}, ", # C
"(uint16_t){p}, ", # W
- "(uint64_t){p}, ", # u should uint32_t
+ "(uint32_t){p}, ", # u
"(uint64_t){p}, ", # U
"", # f
"", # d
@@ -1119,6 +1141,8 @@ def main(root: str, files: Iterable[Filename], ver: str):
"\n#error Use pp instead\n", # H
"", # P
"(void*){p}, ", # A
+ "", # x
+ "", # X
]
arg_x = [
"", # E
@@ -1146,6 +1170,8 @@ def main(root: str, files: Iterable[Filename], ver: str):
"", # H
"", # P
"", # A
+ "to_complexf(emu, {p}),",# x
+ "to_complex(emu, {p})," # X
]
arg_o = [
"emu, ", # E
@@ -1173,17 +1199,19 @@ def main(root: str, files: Iterable[Filename], ver: str):
"", # H
"", # P
"", # A
+ "", # x
+ "", # X
]
arg_s = [
"", # E
"", # v
"*(int8_t*)(R_RSP + {p}), ", # c
"*(int16_t*)(R_RSP + {p}), ", # w
- "*(int64_t*)(R_RSP + {p}), ", # i should be int32_t
+ "*(int32_t*)(R_RSP + {p}), ", # i
"*(int64_t*)(R_RSP + {p}), ", # I
"*(uint8_t*)(R_RSP + {p}), ", # C
"*(uint16_t*)(R_RSP + {p}), ", # W
- "*(uint64_t*)(R_RSP + {p}), ", # u should be uint32_t
+ "*(uint32_t*)(R_RSP + {p}), ", # u
"*(uint64_t*)(R_RSP + {p}), ", # U
"*(float*)(R_RSP + {p}), ", # f
"*(double*)(R_RSP + {p}), ", # d
@@ -1200,6 +1228,8 @@ def main(root: str, files: Iterable[Filename], ver: str):
"*(unsigned __int128)(R_RSP + {p}), ", # H
"*(void**)(R_RSP + {p}), ", # P
"*(void**)(R_RSP + {p}), ", # A
+ "*(complexf_t*)(R_RSP + {p}), ", # x
+ "*(complex_t*)(R_RSP + {p}), ", # X
]
# Asserts
@@ -1365,6 +1395,17 @@ def main(root: str, files: Iterable[Filename], ver: str):
file.write("#endif\n")
file.write("\treturn 0;\n}\n")
+ # Write the isRetX87Wrapper function
+ file.write("\nint isRetX87Wrapper(wrapper_t fun) {\n")
+ for k in retx87_idxs:
+ if k != str(Clauses()):
+ file.write("#if " + k + "\n")
+ for vf in retx87_wraps[k]:
+ file.write("\tif (fun == &" + vf + ") return 1;\n")
+ if k != str(Clauses()):
+ file.write("#endif\n")
+ file.write("\treturn 0;\n}\n")
+
file.write(files_guard["wrapper.c"].format(lbr="{", rbr="}", version=ver))
# Rewrite the wrapper.h file:
@@ -1438,6 +1479,6 @@ if __name__ == '__main__':
if v == "--":
limit.append(i)
Define.defines = list(map(DefineType, sys.argv[2:limit[0]]))
- if main(sys.argv[1], sys.argv[limit[0]+1:], "2.2.0.16") != 0:
+ if main(sys.argv[1], sys.argv[limit[0]+1:], "2.2.0.18") != 0:
exit(2)
exit(0)
diff --git a/runTest.cmake b/runTest.cmake
index 11ab75f..11ab75f 100755..100644
--- a/runTest.cmake
+++ b/runTest.cmake
diff --git a/src/box64context.c b/src/box64context.c
index 95b4a5b..234657c 100755..100644
--- a/src/box64context.c
+++ b/src/box64context.c
@@ -76,7 +76,7 @@ int unlockMutex()
{
int ret = unlockCustommemMutex();
int i;
- #ifdef DYNAREC
+ #ifdef USE_CUSTOM_MUTEX
uint32_t tid = (uint32_t)GetTID();
#define GO(A, B) \
i = (native_lock_storeifref2_d(&A, 0, tid)==tid); \
@@ -138,11 +138,24 @@ static void init_mutexes(box64context_t* context)
pthread_mutexattr_destroy(&attr);
#else
+ #ifdef USE_CUSTOM_MUTEX
native_lock_store(&context->mutex_trace, 0);
native_lock_store(&context->mutex_tls, 0);
native_lock_store(&context->mutex_thread, 0);
native_lock_store(&context->mutex_bridge, 0);
native_lock_store(&context->mutex_dyndump, 0);
+ #else
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
+ pthread_mutex_init(&context->mutex_trace, &attr);
+ pthread_mutex_init(&context->mutex_tls, &attr);
+ pthread_mutex_init(&context->mutex_thread, &attr);
+ pthread_mutex_init(&context->mutex_bridge, &attr);
+ pthread_mutex_init(&context->mutex_dyndump, &attr);
+ pthread_mutexattr_destroy(&attr);
+ #endif
+ pthread_mutex_init(&context->mutex_lock, NULL);
#endif
}
@@ -191,7 +204,7 @@ box64context_t *NewBox64Context(int argc)
initCycleLog(context);
- context->deferedInit = 1;
+ context->deferredInit = 1;
context->sel_serial = 1;
init_custommem_helper(context);
@@ -200,8 +213,7 @@ box64context_t *NewBox64Context(int argc)
context->local_maplib = NewLibrarian(context, 1);
context->versym = NewDictionnary();
context->system = NewBridge();
- context->globaldefver = NewDefaultVersion();
- context->weakdefver = NewDefaultVersion();
+ // Cannot use Bridge name as the map is not initialized yet
// create vsyscall
context->vsyscall = AddBridge(context->system, vFEv, x64Syscall, 0, NULL);
// create the vsyscalls
@@ -212,6 +224,8 @@ box64context_t *NewBox64Context(int argc)
addAlternate((void*)0xffffffffff600000, (void*)context->vsyscalls[0]);
addAlternate((void*)0xffffffffff600400, (void*)context->vsyscalls[1]);
addAlternate((void*)0xffffffffff600800, (void*)context->vsyscalls[2]);
+ // create exit bridge
+ context->exit_bridge = AddBridge(context->system, NULL, NULL, 0, NULL);
// get handle to box64 itself
context->box64lib = dlopen(NULL, RTLD_NOW|RTLD_GLOBAL);
context->dlprivate = NewDLPrivate();
@@ -229,6 +243,24 @@ box64context_t *NewBox64Context(int argc)
context->canary[getrand(4)] = 0;
printf_log(LOG_DEBUG, "Setting up canary (for Stack protector) at FS:0x28, value:%08X\n", *(uint32_t*)context->canary);
+ // init segments
+ for(int i=0; i<16; i++) {
+ context->segtls[i].limit = (uintptr_t)-1LL;
+ }
+ context->segtls[10].key_init = 0; // 0x53 selector
+ context->segtls[10].present = 1;
+ context->segtls[8].key_init = 0; // 0x43 selector
+ context->segtls[8].present = 1;
+ context->segtls[6].key_init = 0; // 0x33 selector
+ context->segtls[6].present = 1;
+ context->segtls[5].key_init = 0; // 0x2b selector
+ context->segtls[5].present = 1;
+ context->segtls[4].key_init = 0; // 0x23 selector
+ context->segtls[4].present = 1;
+ context->segtls[4].is32bits = 1;
+
+ context->globdata = NewMapSymbols();
+
initAllHelpers(context);
return context;
@@ -251,8 +283,6 @@ void FreeBox64Context(box64context_t** context)
if(ctx->maplib)
FreeLibrarian(&ctx->maplib, NULL);
FreeDictionnary(&ctx->versym);
- FreeDefaultVersion(&ctx->globaldefver);
- FreeDefaultVersion(&ctx->weakdefver);
for(int i=0; i<ctx->elfsize; ++i) {
FreeElfHeader(&ctx->elfs[i]);
@@ -265,11 +295,13 @@ void FreeBox64Context(box64context_t** context)
// stop trace now
if(ctx->dec)
DeleteX64TraceDecoder(&ctx->dec);
+ if(ctx->dec32)
+ DeleteX86TraceDecoder(&ctx->dec32);
if(ctx->zydis)
DeleteX64Trace(ctx);
- if(ctx->deferedInitList)
- box_free(ctx->deferedInitList);
+ if(ctx->deferredInitList)
+ box_free(ctx->deferredInitList);
/*box_free(ctx->argv);*/
@@ -323,9 +355,13 @@ void FreeBox64Context(box64context_t** context)
if(ctx->emu_sig)
FreeX64Emu(&ctx->emu_sig);
+ FreeMapSymbols(&ctx->globdata);
+
finiAllHelpers(ctx);
-#ifndef DYNAREC
+#ifdef DYNAREC
+ pthread_mutex_destroy(&ctx->mutex_lock);
+#else
pthread_mutex_destroy(&ctx->mutex_trace);
pthread_mutex_destroy(&ctx->mutex_lock);
pthread_mutex_destroy(&ctx->mutex_tls);
@@ -339,20 +375,44 @@ void FreeBox64Context(box64context_t** context)
}
int AddElfHeader(box64context_t* ctx, elfheader_t* head) {
- int idx = ctx->elfsize;
- if(idx==ctx->elfcap) {
- // resize...
- ctx->elfcap += 16;
- ctx->elfs = (elfheader_t**)box_realloc(ctx->elfs, sizeof(elfheader_t*) * ctx->elfcap);
+ int idx = 0;
+ while(idx<ctx->elfsize && ctx->elfs[idx]) idx++;
+ if(idx == ctx->elfsize) {
+ if(idx==ctx->elfcap) {
+ // resize...
+ ctx->elfcap += 16;
+ ctx->elfs = (elfheader_t**)box_realloc(ctx->elfs, sizeof(elfheader_t*) * ctx->elfcap);
+ }
+ ctx->elfs[idx] = head;
+ ctx->elfsize++;
+ } else {
+ ctx->elfs[idx] = head;
}
- ctx->elfs[idx] = head;
- ctx->elfsize++;
printf_log(LOG_DEBUG, "Adding \"%s\" as #%d in elf collection\n", ElfName(head), idx);
return idx;
}
+void RemoveElfHeader(box64context_t* ctx, elfheader_t* head) {
+ if(GetTLSBase(head)) {
+ // should remove the tls info
+ int tlsbase = GetTLSBase(head);
+ /*if(tlsbase == -ctx->tlssize) {
+ // not really correct, but will do for now
+ ctx->tlssize -= GetTLSSize(head);
+ if(!(++ctx->sel_serial))
+ ++ctx->sel_serial;
+ }*/
+ }
+ for(int i=0; i<ctx->elfsize; ++i)
+ if(ctx->elfs[i] == head) {
+ ctx->elfs[i] = NULL;
+ return;
+ }
+}
+
int AddTLSPartition(box64context_t* context, int tlssize) {
int oldsize = context->tlssize;
+ // should in fact first try to map a hole, but rewinding all elfs and checking filled space, like with the mapmem utilities
context->tlssize += tlssize;
context->tlsdata = box_realloc(context->tlsdata, context->tlssize);
memmove(context->tlsdata+tlssize, context->tlsdata, oldsize); // move to the top, using memmove as regions will probably overlap
diff --git a/src/box64version.h b/src/box64version.h
index c6defd1..ea108de 100755..100644
--- a/src/box64version.h
+++ b/src/box64version.h
@@ -3,6 +3,6 @@
#define BOX64_MAJOR 0
#define BOX64_MINOR 2
-#define BOX64_REVISION 2
+#define BOX64_REVISION 4
#endif //__BOX64_VERSION_H_
diff --git a/src/build_info.c b/src/build_info.c
index 02c19b4..02c19b4 100755..100644
--- a/src/build_info.c
+++ b/src/build_info.c
diff --git a/src/build_info.h b/src/build_info.h
index 45182a0..18456a4 100755..100644
--- a/src/build_info.h
+++ b/src/build_info.h
@@ -1,6 +1,6 @@
#ifndef __BUILD_INFO_H__
#define __BUILD_INFO_H__
-void PrintBox64Version();
+void PrintBox64Version(void);
#endif //__BUILD_INFO_H__ \ No newline at end of file
diff --git a/src/custommem.c b/src/custommem.c
index 633e15f..a92f983 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -26,6 +26,7 @@
#include "threads.h"
#ifdef DYNAREC
#include "dynablock.h"
+#include "dynarec/dynablock_private.h"
#include "dynarec/native_lock.h"
#include "dynarec/dynarec_next.h"
@@ -41,12 +42,17 @@ static uintptr_t box64_jmptbldefault0[1<<JMPTABL_SHIFT0];
// lock addresses
KHASH_SET_INIT_INT64(lockaddress)
static kh_lockaddress_t *lockaddress = NULL;
+#ifdef USE_CUSTOM_MUTEX
static uint32_t mutex_prot;
static uint32_t mutex_blocks;
#else
static pthread_mutex_t mutex_prot;
static pthread_mutex_t mutex_blocks;
#endif
+#else
+static pthread_mutex_t mutex_prot;
+static pthread_mutex_t mutex_blocks;
+#endif
#if defined(PAGE64K)
#define MEMPROT_SHIFT 16
#define MEMPROT_SHIFT2 (16+16)
@@ -110,14 +116,14 @@ typedef struct blockmark_s {
#define PREV_BLOCK(b) (blockmark_t*)(((uintptr_t)(b) - (b)->prev.size) - sizeof(blockmark_t))
#define LAST_BLOCK(b, s) (blockmark_t*)(((uintptr_t)(b)+(s))-sizeof(blockmark_t))
-static void printBlock(blockmark_t* b, void* start)
+void printBlock(blockmark_t* b, void* start)
{
- printf_log(LOG_INFO, "========== Block is:\n");
+ printf_log(LOG_NONE, "========== Block is:\n");
do {
- printf_log(LOG_INFO, "%c%p, fill=%d, size=0x%x (prev=%d/0x%x)\n", b==start?'*':' ', b, b->next.fill, b->next.size, b->prev.fill, b->prev.size);
+ printf_log(LOG_NONE, "%c%p, fill=%d, size=0x%x (prev=%d/0x%x)\n", b==start?'*':' ', b, b->next.fill, b->next.size, b->prev.fill, b->prev.size);
b = NEXT_BLOCK(b);
} while(b->next.x32);
- printf_log(LOG_INFO, "===================\n");
+ printf_log(LOG_NONE, "===================\n");
}
// get first subblock free in block. Return NULL if no block, else first subblock free (mark included), filling size
@@ -181,6 +187,8 @@ static size_t getMaxFreeBlock(void* block, size_t block_size, void* start)
}
}
+#define THRESHOLD (128-2*sizeof(blockmark_t))
+
static void* allocBlock(void* block, void *sub, size_t size, void** pstart)
{
(void)block;
@@ -190,25 +198,26 @@ static void* allocBlock(void* block, void *sub, size_t size, void** pstart)
s->next.fill = 1;
// check if a new mark is worth it
- if(s->next.size>size+2*sizeof(blockmark_t))
+ if(s->next.size>size+2*sizeof(blockmark_t)+THRESHOLD) {
+ size_t old_size = s->next.size;
s->next.size = size;
- blockmark_t *m = NEXT_BLOCK(s); // this is new n
- m->prev.fill = 1;
- if(n!=m) {
- // new mark
+ blockmark_t *m = NEXT_BLOCK(s);
+ m->prev.fill = 1;
m->prev.size = s->next.size;
m->next.fill = 0;
- m->next.size = ((uintptr_t)n - (uintptr_t)m) - sizeof(blockmark_t);
+ m->next.size = old_size - (size + sizeof(blockmark_t));
n->prev.fill = 0;
n->prev.size = m->next.size;
+ n = m;
+ } else {
+ n->prev.fill = 1;
}
if(pstart && sub==*pstart) {
// get the next free block
- m = (blockmark_t*)*pstart;
- while(m->next.fill)
- m = NEXT_BLOCK(m);
- *pstart = (void*)m;
+ while(n->next.fill)
+ n = NEXT_BLOCK(n);
+ *pstart = (void*)n;
}
return (void*)((uintptr_t)sub + sizeof(blockmark_t));
}
@@ -222,7 +231,7 @@ static size_t freeBlock(void *block, void* sub, void** pstart)
s->next.fill = 0;
n->prev.fill = 0;
// check if merge with previous
- if (s->prev.x32 && !s->prev.fill) {
+ if (m!=s && s->prev.x32 && !s->prev.fill) {
// remove s...
m->next.size += s->next.size + sizeof(blockmark_t);
n->prev.size = m->next.size;
@@ -235,7 +244,7 @@ static size_t freeBlock(void *block, void* sub, void** pstart)
s->next.size += n->next.size + sizeof(blockmark_t);
n2->prev.size = s->next.size;
}
- if(pstart && (uintptr_t)*pstart>(uintptr_t)sub) {
+ if(pstart && (uintptr_t)*pstart>(uintptr_t)s) {
*pstart = (void*)s;
}
// return free size at current block (might be bigger)
@@ -258,7 +267,7 @@ static int expandBlock(void* block, void* sub, size_t newsize)
if((size_t)(s->next.size + n->next.size + sizeof(blockmark_t)) < newsize)
return 0; // free space too short
// ok, doing the alloc!
- if((s->next.size+n->next.size+sizeof(blockmark_t))-newsize<2*sizeof(blockmark_t))
+ if((s->next.size+n->next.size+sizeof(blockmark_t))-newsize<THRESHOLD+2*sizeof(blockmark_t))
s->next.size += n->next.size+sizeof(blockmark_t);
else
s->next.size = newsize+sizeof(blockmark_t);
@@ -283,7 +292,61 @@ static size_t sizeBlock(void* sub)
return s->next.size;
}
-#define THRESHOLD (128-2*sizeof(blockmark_t))
+// return 1 if block is coherent, 0 if not (and printf the issues)
+int printBlockCoherent(int i)
+{
+ if(i<0 || i>=n_blocks) {
+ printf_log(LOG_NONE, "Error, %d should be between 0 and %d\n", i, n_blocks);
+ return 0;
+ }
+ int ret = 1;
+ blockmark_t* m = (blockmark_t*)p_blocks[i].block;
+ // check if first is correct
+ blockmark_t* first = getNextFreeBlock(m);
+ if(p_blocks[i].first && p_blocks[i].first!=first) {printf_log(LOG_NONE, "First %p and stored first %p differs for block %d\n", first, p_blocks[i].first, i); ret = 0;}
+ // check if maxfree is correct, with no hint
+ size_t maxfree = getMaxFreeBlock(m, p_blocks[i].size, NULL);
+ if(maxfree != p_blocks[i].maxfree) {printf_log(LOG_NONE, "Maxfree without hint %zd and stored maxfree %zd differs for block %d\n", maxfree, p_blocks[i].maxfree, i); ret = 0;}
+ // check if maxfree from first is correct
+ maxfree = getMaxFreeBlock(m, p_blocks[i].size, p_blocks[i].first);
+ if(maxfree != p_blocks[i].maxfree) {printf_log(LOG_NONE, "Maxfree with hint %zd and stored maxfree %zd differs for block %d\n", maxfree, p_blocks[i].maxfree, i); ret = 0;}
+ // check chain
+ blockmark_t* last = (blockmark_t*)(((uintptr_t)m)+p_blocks[i].size-sizeof(blockmark_t));
+ while(m<last) {
+ blockmark_t* n = NEXT_BLOCK(m);
+ if(!m->next.fill && !n->next.fill && n!=last) {
+ printf_log(LOG_NONE, "Chain contains 2 subsequent free blocks %p (%d) and %p (%d) for block %d\n", m, m->next.size, n, n->next.size, i);
+ ret = 0;
+ }
+ m = n;
+ }
+ if(m!=last) {
+ printf_log(LOG_NONE, "Last block %p is behond expexted block %p for block %d\n", m, last, i);
+ ret = 0;
+ }
+
+ return ret;
+}
+
+void testAllBlocks()
+{
+ size_t total = 0;
+ size_t fragmented_free = 0;
+ size_t max_free = 0;
+ for(int i=0; i<n_blocks; ++i) {
+ printBlockCoherent(i);
+ total += p_blocks[i].size;
+ if(max_free<p_blocks[i].maxfree)
+ max_free = p_blocks[i].maxfree;
+ blockmark_t* m = (blockmark_t*)p_blocks[i].block;
+ while(m->next.x32) {
+ if(!m->next.fill)
+ fragmented_free += m->next.size;
+ m = NEXT_BLOCK(m);
+ }
+ }
+ printf_log(LOG_NONE, "Total %d blocks, for %zd allocated memory, max_free %zd, toatal fragmented free %zd\n", n_blocks, total, max_free, fragmented_free);
+}
static size_t roundSize(size_t size)
{
@@ -314,9 +377,7 @@ void* customMalloc(size_t size)
if(sub) {
if(rsize-size<THRESHOLD)
size = rsize;
- void* ret = allocBlock(p_blocks[i].block, sub, size, NULL);
- if(sub==p_blocks[i].first)
- p_blocks[i].first = getNextFreeBlock(sub);
+ void* ret = allocBlock(p_blocks[i].block, sub, size, &p_blocks[i].first);
if(rsize==p_blocks[i].maxfree)
p_blocks[i].maxfree = getMaxFreeBlock(p_blocks[i].block, p_blocks[i].size, p_blocks[i].first);
mutex_unlock(&mutex_blocks);
@@ -353,8 +414,8 @@ void* customMalloc(size_t size)
n->prev.fill = 0;
n->prev.size = m->next.size;
// alloc 1st block
- void* ret = allocBlock(p_blocks[i].block, p, size, NULL);
- p_blocks[i].maxfree = getMaxFreeBlock(p_blocks[i].block, p_blocks[i].size, NULL);
+ void* ret = allocBlock(p_blocks[i].block, p, size, &p_blocks[i].first);
+ p_blocks[i].maxfree = getMaxFreeBlock(p_blocks[i].block, p_blocks[i].size, p_blocks[i].first);
mutex_unlock(&mutex_blocks);
return ret;
}
@@ -377,7 +438,7 @@ void* customRealloc(void* p, size_t size)
&& (addr<((uintptr_t)p_blocks[i].block+p_blocks[i].size))) {
void* sub = (void*)(addr-sizeof(blockmark_t));
if(expandBlock(p_blocks[i].block, sub, size)) {
- if(sub<p_blocks[i].first && p+size<p_blocks[i].first)
+ if(sub<p_blocks[i].first && p+size>=p_blocks[i].first)
p_blocks[i].first = getNextFreeBlock(sub);
p_blocks[i].maxfree = getMaxFreeBlock(p_blocks[i].block, p_blocks[i].size, p_blocks[i].first);
mutex_unlock(&mutex_blocks);
@@ -405,10 +466,7 @@ void customFree(void* p)
if ((addr>(uintptr_t)p_blocks[i].block)
&& (addr<((uintptr_t)p_blocks[i].block+p_blocks[i].size))) {
void* sub = (void*)(addr-sizeof(blockmark_t));
- void* n = NEXT_BLOCK((blockmark_t*)sub);
- size_t newfree = freeBlock(p_blocks[i].block, sub, NULL);
- if(sub<=p_blocks[i].first)
- p_blocks[i].first = getPrevFreeBlock(n);
+ size_t newfree = freeBlock(p_blocks[i].block, sub, &p_blocks[i].first);
if(p_blocks[i].maxfree < newfree) p_blocks[i].maxfree = newfree;
mutex_unlock(&mutex_blocks);
return;
@@ -557,10 +615,7 @@ void FreeDynarecMap(uintptr_t addr)
if ((addr>(uintptr_t)list->chunks[i].block)
&& (addr<((uintptr_t)list->chunks[i].block+list->chunks[i].size))) {
void* sub = (void*)(addr-sizeof(blockmark_t));
- void* n = NEXT_BLOCK((blockmark_t*)sub);
- size_t newfree = freeBlock(list->chunks[i].block, sub, NULL);
- if(sub<=list->chunks[i].first)
- list->chunks[i].first = getPrevFreeBlock(n);
+ size_t newfree = freeBlock(list->chunks[i].block, sub, &list->chunks[i].first);
if(list->chunks[i].maxfree < newfree)
list->chunks[i].maxfree = newfree;
return;
@@ -589,6 +644,7 @@ static uintptr_t getDBSize(uintptr_t addr, size_t maxsize, dynablock_t** db)
uintptr_t* block = box64_jmptbl3[idx3][idx2][idx1];
if(block == box64_jmptbldefault0)
return (((addr>>JMPTABL_START1)+1)<<JMPTABL_START1);
+ maxsize+=idx0; // need to adjust maxsize to "end in current block"
if (maxsize>JMPTABLE_MASK0)
maxsize = JMPTABLE_MASK0;
while(block[idx0]==(uintptr_t)native_next) {
@@ -770,6 +826,28 @@ dynablock_t* getDB(uintptr_t addr)
return *(dynablock_t**)(ret - sizeof(void*));
}
+int getNeedTest(uintptr_t addr)
+{
+ uintptr_t idx3, idx2, idx1, idx0;
+ idx3 = ((addr)>>JMPTABL_START3)&JMPTABLE_MASK3;
+ idx2 = ((addr)>>JMPTABL_START2)&JMPTABLE_MASK2;
+ idx1 = ((addr)>>JMPTABL_START1)&JMPTABLE_MASK1;
+ idx0 = ((addr) )&JMPTABLE_MASK0;
+ uintptr_t ret = (uintptr_t)box64_jmptbl3[idx3][idx2][idx1][idx0];
+ dynablock_t* db = *(dynablock_t**)(ret - sizeof(void*));
+ return db?((ret!=(uintptr_t)db->block)?1:0):0;
+}
+
+uintptr_t getJumpAddress64(uintptr_t addr)
+{
+ uintptr_t idx3, idx2, idx1, idx0;
+ idx3 = ((addr)>>JMPTABL_START3)&JMPTABLE_MASK3;
+ idx2 = ((addr)>>JMPTABL_START2)&JMPTABLE_MASK2;
+ idx1 = ((addr)>>JMPTABL_START1)&JMPTABLE_MASK1;
+ idx0 = ((addr) )&JMPTABLE_MASK0;
+ return (uintptr_t)box64_jmptbl3[idx3][idx2][idx1][idx0];
+}
+
// Remove the Write flag from an adress range, so DB can be executed safely
void protectDB(uintptr_t addr, uintptr_t size)
{
@@ -795,14 +873,16 @@ void protectDB(uintptr_t addr, uintptr_t size)
uint32_t prot = memprot[i>>16].prot[i&0xffff];
uint32_t dyn = prot&PROT_DYN;
uint32_t mapped = prot&PROT_MMAP;
- prot&=~PROT_CUSTOM;
if(!prot)
prot = PROT_READ | PROT_WRITE | PROT_EXEC; // comes from malloc & co, so should not be able to execute
- if((prot&PROT_WRITE)) {
- if(!dyn) mprotect((void*)(i<<MEMPROT_SHIFT), 1<<MEMPROT_SHIFT, prot&~PROT_WRITE);
- memprot[i>>16].prot[i&0xffff] = prot|mapped|PROT_DYNAREC; // need to use atomic exchange?
- } else
- memprot[i>>16].prot[i&0xffff] = prot|mapped|PROT_DYNAREC_R;
+ prot&=~PROT_CUSTOM;
+ if(!(dyn&PROT_NOPROT)) {
+ if(prot&PROT_WRITE) {
+ if(!dyn) mprotect((void*)(i<<MEMPROT_SHIFT), 1<<MEMPROT_SHIFT, prot&~PROT_WRITE);
+ memprot[i>>16].prot[i&0xffff] = prot|mapped|PROT_DYNAREC; // need to use atomic exchange?
+ } else
+ memprot[i>>16].prot[i&0xffff] = prot|mapped|PROT_DYNAREC_R;
+ }
}
mutex_unlock(&mutex_prot);
}
@@ -824,14 +904,16 @@ void unprotectDB(uintptr_t addr, size_t size, int mark)
i=(((i>>16)+1)<<16)-1; // next block
} else {
uint32_t prot = memprot[i>>16].prot[i&0xffff];
- if(prot&PROT_DYNAREC) {
- prot&=~PROT_DYN;
- if(mark)
- cleanDBFromAddressRange((i<<MEMPROT_SHIFT), 1<<MEMPROT_SHIFT, 0);
- mprotect((void*)(i<<MEMPROT_SHIFT), 1<<MEMPROT_SHIFT, prot&~PROT_MMAP);
- memprot[i>>16].prot[i&0xffff] = prot; // need to use atomic exchange?
- } else if(prot&PROT_DYNAREC_R)
- memprot[i>>16].prot[i&0xffff] = prot&~PROT_CUSTOM;
+ if(!(prot&PROT_NOPROT)) {
+ if(prot&PROT_DYNAREC) {
+ prot&=~PROT_DYN;
+ if(mark)
+ cleanDBFromAddressRange((i<<MEMPROT_SHIFT), 1<<MEMPROT_SHIFT, 0);
+ mprotect((void*)(i<<MEMPROT_SHIFT), 1<<MEMPROT_SHIFT, prot&~PROT_MMAP);
+ memprot[i>>16].prot[i&0xffff] = prot; // need to use atomic exchange?
+ } else if(prot&PROT_DYNAREC_R)
+ memprot[i>>16].prot[i&0xffff] = prot&~PROT_CUSTOM;
+ }
}
}
mutex_unlock(&mutex_prot);
@@ -977,11 +1059,13 @@ void updateProtection(uintptr_t addr, size_t size, uint32_t prot)
uint32_t old_prot = memprot[i>>16].prot[i&0xffff];
uint32_t dyn=(old_prot&PROT_DYN);
uint32_t mapped=(old_prot&PROT_MMAP);
- if(dyn && (prot&PROT_WRITE)) { // need to remove the write protection from this block
- dyn = PROT_DYNAREC;
- mprotect((void*)(i<<MEMPROT_SHIFT), 1<<MEMPROT_SHIFT, prot&~PROT_WRITE);
- } else if(dyn && !(prot&PROT_WRITE)) {
- dyn = PROT_DYNAREC_R;
+ if(!(dyn&PROT_NOPROT)) {
+ if(dyn && (prot&PROT_WRITE)) { // need to remove the write protection from this block
+ dyn = PROT_DYNAREC;
+ mprotect((void*)(i<<MEMPROT_SHIFT), 1<<MEMPROT_SHIFT, prot&~PROT_WRITE);
+ } else if(dyn && !(prot&PROT_WRITE)) {
+ dyn = PROT_DYNAREC_R;
+ }
}
memprot[i>>16].prot[i&0xffff] = prot|dyn|mapped;
}
@@ -1017,7 +1101,13 @@ void setProtection(uintptr_t addr, size_t size, uint32_t prot)
void setProtection_mmap(uintptr_t addr, size_t size, uint32_t prot)
{
- setProtection(addr, size, prot|PROT_MMAP);
+ if(prot)
+ setProtection(addr, size, prot|PROT_MMAP);
+ else {
+ mutex_lock(&mutex_prot);
+ addMapMem(addr, addr+size-1);
+ mutex_unlock(&mutex_prot);
+ }
}
void refreshProtection(uintptr_t addr)
@@ -1026,8 +1116,10 @@ void refreshProtection(uintptr_t addr)
uintptr_t idx = (addr>>MEMPROT_SHIFT);
if(memprot[idx>>16].prot!=memprot_default) {
int prot = memprot[idx>>16].prot[idx&0xffff];
- int ret = mprotect((void*)(idx<<MEMPROT_SHIFT), box64_pagesize, prot&~PROT_CUSTOM);
+ if(!(prot&PROT_DYNAREC)) {
+ int ret = mprotect((void*)(idx<<MEMPROT_SHIFT), box64_pagesize, prot&~PROT_CUSTOM);
printf_log(LOG_INFO, "refreshProtection(%p): %p/0x%x (ret=%d/%s)\n", (void*)addr, (void*)(idx<<MEMPROT_SHIFT), prot, ret, ret?strerror(errno):"ok");
+ }
}
mutex_unlock(&mutex_prot);
}
@@ -1279,7 +1371,7 @@ int unlockCustommemMutex()
{
int ret = 0;
int i = 0;
- #ifdef DYNAREC
+ #ifdef USE_CUSTOM_MUTEX
uint32_t tid = (uint32_t)GetTID();
#define GO(A, B) \
i = (native_lock_storeifref2_d(&A, 0, tid)==tid); \
@@ -1312,7 +1404,7 @@ void relockCustommemMutex(int locks)
static void init_mutexes(void)
{
- #ifdef DYNAREC
+ #ifdef USE_CUSTOM_MUTEX
native_lock_store(&mutex_blocks, 0);
native_lock_store(&mutex_prot, 0);
#else
@@ -1332,6 +1424,34 @@ static void atfork_child_custommem(void)
init_mutexes();
}
+void reserveHighMem()
+{
+ char* p = getenv("BOX64_RESERVE_HIGH");
+ if(!p || p[0]=='0')
+ return; // don't reserve by default
+ intptr_t cur = 1LL<<47;
+ mapmem_t* m = mapmem;
+ while(m && (m->end<cur)) {
+ m = m->next;
+ }
+ while (m) {
+ uintptr_t addr = 0, end = 0;
+ if(m->begin>cur) {
+ void* ret = mmap64((void*)cur, m->begin-cur, 0, MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE|MAP_NORESERVE, -1, 0);
+ printf_log(LOG_DEBUG, "Reserve %p-%p => %p (%s)\n", (void*)cur, m->begin, ret, strerror(errno));
+ printf_log(LOG_DEBUG, "mmap %p-%p\n", m->begin, m->end);
+ if(ret!=(void*)-1) {
+ addr = cur;
+ end = m->begin;
+ }
+ }
+ cur = m->end + 1;
+ m = m->next;
+ if(addr)
+ addMapMem(addr, end);
+ }
+}
+
void init_custommem_helper(box64context_t* ctx)
{
(void)ctx;
@@ -1343,7 +1463,7 @@ void init_custommem_helper(box64context_t* ctx)
memprot[i].prot = memprot_default;
init_mutexes();
#ifdef DYNAREC
- if(box64_dynarec)
+ if(box64_dynarec) {
for(int i=0; i<(1<<JMPTABL_SHIFT3); ++i)
box64_jmptbl3[i] = box64_jmptbldefault2;
for(int i=0; i<(1<<JMPTABL_SHIFT2); ++i)
@@ -1352,6 +1472,7 @@ void init_custommem_helper(box64context_t* ctx)
box64_jmptbldefault1[i] = box64_jmptbldefault0;
for(int i=0; i<(1<<JMPTABL_SHIFT0); ++i)
box64_jmptbldefault0[i] = (uintptr_t)native_next;
+ }
lockaddress = kh_init(lockaddress);
#endif
pthread_atfork(NULL, NULL, atfork_child_custommem);
@@ -1360,9 +1481,10 @@ void init_custommem_helper(box64context_t* ctx)
mapmem->begin = 0x0;
mapmem->end = (uintptr_t)LOWEST - 1;
loadProtectionFromMap();
+ reserveHighMem();
// check if PageSize is correctly defined
if(box64_pagesize != (1<<MEMPROT_SHIFT)) {
- printf_log(LOG_NONE, "Error: PageSize configuation is wrong: configured with %d, but got %zd\n", 1<<MEMPROT_SHIFT, box64_pagesize);
+ printf_log(LOG_NONE, "Error: PageSize configuration is wrong: configured with %d, but got %zd\n", 1<<MEMPROT_SHIFT, box64_pagesize);
exit(-1); // abort or let it continue?
}
}
@@ -1446,7 +1568,7 @@ void fini_custommem_helper(box64context_t *ctx)
box_free(p_blocks[i].block);
#endif
box_free(p_blocks);
- #ifndef DYNAREC
+ #ifndef USE_CUSTOM_MUTEX
pthread_mutex_destroy(&mutex_prot);
pthread_mutex_destroy(&mutex_blocks);
#endif
diff --git a/src/dynarec/arm64/arm64_emitter.h b/src/dynarec/arm64/arm64_emitter.h
index 5a44052..02ba209 100755..100644
--- a/src/dynarec/arm64/arm64_emitter.h
+++ b/src/dynarec/arm64/arm64_emitter.h
@@ -130,6 +130,7 @@
}
#define MOV64xw(Rd, imm64) if(rex.w) {MOV64x(Rd, imm64);} else {MOV32w(Rd, imm64);}
+#define MOV64z(Rd, imm64) if(rex.is32bits) {MOV32w(Rd, imm64);} else {MOV64x(Rd, imm64);}
// ADD / SUB
@@ -141,6 +142,7 @@
#define ADDSw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(0, 0, 1, 0b00, Rm, 0, Rn, Rd))
#define ADDw_REG_LSL(Rd, Rn, Rm, lsl) EMIT(ADDSUB_REG_gen(0, 0, 0, 0b00, Rm, lsl, Rn, Rd))
#define ADDxw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.w, 0, 0, 0b00, Rm, 0, Rn, Rd))
+#define ADDz_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.is32bits?0:1, 0, 0, 0b00, Rm, 0, Rn, Rd))
#define ADDSxw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.w, 0, 1, 0b00, Rm, 0, Rn, Rd))
#define ADDxw_REG_LSR(Rd, Rn, Rm, lsr) EMIT(ADDSUB_REG_gen(rex.w, 0, 0, 0b01, Rm, lsr, Rn, Rd))
@@ -151,6 +153,7 @@
#define ADDSw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(0, 0, 1, 0b00, (imm12)&0xfff, Rn, Rd))
#define ADDxw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.w, 0, 0, 0b00, (imm12)&0xfff, Rn, Rd))
#define ADDSxw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.w, 0, 1, 0b00, (imm12)&0xfff, Rn, Rd))
+#define ADDz_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.is32bits?0:1, 0, 0, 0b00, (imm12)&0xfff, Rn, Rd))
#define SUBx_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(1, 1, 0, 0b00, Rm, 0, Rn, Rd))
#define SUBSx_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(1, 1, 1, 0b00, Rm, 0, Rn, Rd))
@@ -160,6 +163,7 @@
#define SUBSw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(0, 1, 1, 0b00, Rm, 0, Rn, Rd))
#define SUBSw_REG_LSL(Rd, Rn, Rm, lsl) EMIT(ADDSUB_REG_gen(0, 1, 1, 0b00, Rm, lsl, Rn, Rd))
#define SUBxw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.w, 1, 0, 0b00, Rm, 0, Rn, Rd))
+#define SUBz_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.is32bits?0:1, 1, 0, 0b00, Rm, 0, Rn, Rd))
#define SUBSxw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.w, 1, 1, 0b00, Rm, 0, Rn, Rd))
#define CMPSx_REG(Rn, Rm) SUBSx_REG(xZR, Rn, Rm)
#define CMPSw_REG(Rn, Rm) SUBSw_REG(wZR, Rn, Rm)
@@ -176,6 +180,7 @@
#define SUBw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(0, 1, 0, 0b00, (imm12)&0xfff, Rn, Rd))
#define SUBSw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(0, 1, 1, 0b00, (imm12)&0xfff, Rn, Rd))
#define SUBxw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.w, 1, 0, 0b00, (imm12)&0xfff, Rn, Rd))
+#define SUBz_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.is32bits?0:1, 1, 0, 0b00, (imm12)&0xfff, Rn, Rd))
#define SUBSxw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.w, 1, 1, 0b00, (imm12)&0xfff, Rn, Rd))
#define CMPSx_U12(Rn, imm12) SUBSx_U12(xZR, Rn, imm12)
#define CMPSw_U12(Rn, imm12) SUBSw_U12(wZR, Rn, imm12)
@@ -221,6 +226,7 @@
#define LDRB_U12(Rt, Rn, imm12) EMIT(LD_gen(0b00, 0b01, ((uint32_t)((imm12)))&0xfff, Rn, Rt))
#define LDRH_U12(Rt, Rn, imm12) EMIT(LD_gen(0b01, 0b01, ((uint32_t)((imm12)>>1))&0xfff, Rn, Rt))
#define LDRxw_U12(Rt, Rn, imm12) EMIT(LD_gen((rex.w)?0b11:0b10, 0b01, ((uint32_t)((imm12)>>(2+rex.w)))&0xfff, Rn, Rt))
+#define LDRz_U12(Rt, Rn, imm12) EMIT(LD_gen((rex.is32bits)?0b10:0b11, 0b01, ((uint32_t)((imm12)>>(rex.is32bits?2:3)))&0xfff, Rn, Rt))
#define LDS_gen(size, op1, imm12, Rn, Rt) ((size)<<30 | 0b111<<27 | (op1)<<24 | 0b10<<22 | (imm12)<<10 | (Rn)<<5 | (Rt))
#define LDRSW_U12(Rt, Rn, imm12) EMIT(LDS_gen(0b10, 0b01, ((uint32_t)((imm12)>>2))&0xfff, Rn, Rt))
@@ -232,6 +238,7 @@
#define LDRw_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b10, Rm, 0b011, 0, Rn, Rt))
#define LDRw_REG_LSL2(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b10, Rm, 0b011, 1, Rn, Rt))
#define LDRxw_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b10+rex.w, Rm, 0b011, 0, Rn, Rt))
+#define LDRz_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(rex.is32bits?0b10:0b11, Rm, 0b011, 0, Rn, Rt))
#define LDRB_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b00, Rm, 0b011, 0, Rn, Rt))
#define LDRH_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b01, Rm, 0b011, 0, Rn, Rt))
@@ -249,6 +256,41 @@
#define LDR_PC_gen(opc, imm19, Rt) ((opc)<<30 | 0b011<<27 | (imm19)<<5 | (Rt))
#define LDRx_literal(Rt, imm19) EMIT(LDR_PC_gen(0b01, ((imm19)>>2)&0x7FFFF, Rt))
+#define LDU_gen(size, opc, imm9, Rn, Rt) ((size)<<30 | 0b111<<27 | (opc)<<22 | ((imm9)&0x1ff)<<12 | (Rn)<<5 | (Rt))
+#define LDURx_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b11, 0b01, imm9, Rn, Rt))
+#define LDURw_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b10, 0b01, imm9, Rn, Rt))
+#define LDURxw_I9(Rt, Rn, imm9) EMIT(LDU_gen((rex.w)?0b11:0b10, 0b01, imm9, Rn, Rt))
+#define LDURz_I9(Rt, Rn, imm9) EMIT(LDU_gen((rex.is32bits)?0b10:0b11, 0b01, imm9, Rn, Rt))
+#define LDURH_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b01, 0b01, imm9, Rn, Rt))
+#define LDURB_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b00, 0b01, imm9, Rn, Rt))
+#define LDURSW_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b10, 0b10, imm9, Rn, Rt))
+#define LDURSHw_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b01, 0b11, imm9, Rn, Rt))
+#define LDURSHx_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b01, 0b10, imm9, Rn, Rt))
+#define LDURSHxw_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b01, (rex.w)?0b10:0b11, imm9, Rn, Rt))
+#define LDURSBw_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b00, 0b11, imm9, Rn, Rt))
+#define LDURSBx_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b00, 0b10, imm9, Rn, Rt))
+#define LDURSBxw_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b00, (rex.w)?0b10:0b11, imm9, Rn, Rt))
+
+#define LDxw(A, B, C) if(unscaled) {LDURxw_I9(A, B, C);} else {LDRxw_U12(A, B, C);}
+#define LDz(A, B, C) if(unscaled) {LDURz_I9(A, B, C);} else {LDRz_U12(A, B, C);}
+#define LDx(A, B, C) if(unscaled) {LDURx_I9(A, B, C);} else {LDRx_U12(A, B, C);}
+#define LDW(A, B, C) if(unscaled) {LDURw_I9(A, B, C);} else {LDRw_U12(A, B, C);}
+#define LDH(A, B, C) if(unscaled) {LDURH_I9(A, B, C);} else {LDRH_U12(A, B, C);}
+#define LDB(A, B, C) if(unscaled) {LDURB_I9(A, B, C);} else {LDRB_U12(A, B, C);}
+#define LDSW(A, B, C) if(unscaled) {LDURSW_I9(A, B, C);} else {LDRSW_U12(A, B, C);}
+#define LDSHxw(A, B, C) if(unscaled) {LDURSHxw_I9(A, B, C);} else {LDRSHxw_U12(A, B, C);}
+#define LDSHx(A, B, C) if(unscaled) {LDURSHx_I9(A, B, C);} else {LDRSHx_U12(A, B, C);}
+#define LDSHw(A, B, C) if(unscaled) {LDURSHw_I9(A, B, C);} else {LDRSHw_U12(A, B, C);}
+#define LDSBxw(A, B, C) if(unscaled) {LDURSBxw_I9(A, B, C);} else {LDRSBxw_U12(A, B, C);}
+#define LDSBx(A, B, C) if(unscaled) {LDURSBx_I9(A, B, C);} else {LDRSBx_U12(A, B, C);}
+#define LDSBw(A, B, C) if(unscaled) {LDURSBw_I9(A, B, C);} else {LDRSBw_U12(A, B, C);}
+#define STxw(A, B, C) if(unscaled) {STURxw_I9(A, B, C);} else {STRxw_U12(A, B, C);}
+#define STz(A, B, C) if(unscaled) {STURz_I9(A, B, C);} else {STRz_U12(A, B, C);}
+#define STx(A, B, C) if(unscaled) {STURx_I9(A, B, C);} else {STRx_U12(A, B, C);}
+#define STW(A, B, C) if(unscaled) {STURw_I9(A, B, C);} else {STRw_U12(A, B, C);}
+#define STH(A, B, C) if(unscaled) {STURH_I9(A, B, C);} else {STRH_U12(A, B, C);}
+#define STB(A, B, C) if(unscaled) {STURB_I9(A, B, C);} else {STRB_U12(A, B, C);}
+
// STR
#define STR_gen(size, op1, imm9, op2, Rn, Rt) ((size)<<30 | 0b111<<27 | (op1)<<24 | 0b00<<22 | (imm9)<<12 | (op2)<<10 | (Rn)<<5 | (Rt))
#define STRx_S9_postindex(Rt, Rn, imm9) EMIT(STR_gen(0b11, 0b00, (imm9)&0x1ff, 0b01, Rn, Rt))
@@ -257,6 +299,7 @@
#define STRw_S9_preindex(Rt, Rn, imm9) EMIT(STR_gen(0b10, 0b00, (imm9)&0x1ff, 0b11, Rn, Rt))
#define STRxw_S9_postindex(Rt, Rn, imm9) EMIT(STR_gen(rex.w?0b11:0b10, 0b00, (imm9)&0x1ff, 0b01, Rn, Rt))
#define STRB_S9_postindex(Rt, Rn, imm9) EMIT(STR_gen(0b00, 0b00, (imm9)&0x1ff, 0b01, Rn, Rt))
+#define STRH_S9_preindex(Rt, Rn, imm9) EMIT(STR_gen(0b01, 0b00, (imm9)&0x1ff, 0b11, Rn, Rt))
#define STRH_S9_postindex(Rt, Rn, imm9) EMIT(STR_gen(0b01, 0b00, (imm9)&0x1ff, 0b01, Rn, Rt))
#define ST_gen(size, op1, imm12, Rn, Rt) ((size)<<30 | 0b111<<27 | (op1)<<24 | 0b00<<22 | (imm12)<<10 | (Rn)<<5 | (Rt))
@@ -265,11 +308,13 @@
#define STRB_U12(Rt, Rn, imm12) EMIT(ST_gen(0b00, 0b01, ((uint32_t)((imm12)))&0xfff, Rn, Rt))
#define STRH_U12(Rt, Rn, imm12) EMIT(ST_gen(0b01, 0b01, ((uint32_t)((imm12)>>1))&0xfff, Rn, Rt))
#define STRxw_U12(Rt, Rn, imm12) EMIT(ST_gen((rex.w)?0b11:0b10, 0b01, ((uint32_t)((imm12)>>(2+rex.w)))&0xfff, Rn, Rt))
+#define STRz_U12(Rt, Rn, imm12) EMIT(ST_gen((rex.is32bits)?0b10:0b11, 0b01, ((uint32_t)((imm12)>>(rex.is32bits?2:3)))&0xfff, Rn, Rt))
#define STU_gen(size, opc, imm9, Rn, Rt) ((size)<<30 | 0b111<<27 | (opc)<<22 | ((imm9)&0x1ff)<<12 | (Rn)<<5 | (Rt))
#define STURx_I9(Rt, Rn, imm9) EMIT(STU_gen(0b11, 0b00, imm9, Rn, Rt))
#define STURw_I9(Rt, Rn, imm9) EMIT(STU_gen(0b10, 0b00, imm9, Rn, Rt))
#define STURxw_I9(Rt, Rn, imm9) EMIT(STU_gen((rex.w)?0b11:0b10, 0b00, imm9, Rn, Rt))
+#define STURz_I9(Rt, Rn, imm9) EMIT(STU_gen((rex.is32bits)?0b10:0b11, 0b00, imm9, Rn, Rt))
#define STURH_I9(Rt, Rn, imm9) EMIT(STU_gen(0b01, 0b00, imm9, Rn, Rt))
#define STURB_I9(Rt, Rn, imm9) EMIT(STU_gen(0b00, 0b00, imm9, Rn, Rt))
@@ -282,6 +327,7 @@
#define STRB_REG(Rt, Rn, Rm) EMIT(STR_REG_gen(0b00, Rm, 0b011, 0, Rn, Rt))
#define STRH_REG(Rt, Rn, Rm) EMIT(STR_REG_gen(0b01, Rm, 0b011, 0, Rn, Rt))
#define STRxw_REG(Rt, Rn, Rm) EMIT(STR_REG_gen(rex.w?0b11:0b10, Rm, 0b011, 0, Rn, Rt))
+#define STRz_REG(Rt, Rn, Rm) EMIT(STR_REG_gen(rex.is32bits?0b10:0b11, Rm, 0b011, 0, Rn, Rt))
// LOAD/STORE PAIR
#define MEMPAIR_gen(size, L, op2, imm7, Rt2, Rn, Rt) ((size)<<31 | 0b101<<27 | (op2)<<23 | (L)<<22 | (imm7)<<15 | (Rt2)<<10 | (Rn)<<5 | (Rt))
@@ -309,6 +355,21 @@
// PUSH / POP helper
#define POP1(reg) LDRx_S9_postindex(reg, xRSP, 8)
#define PUSH1(reg) STRx_S9_preindex(reg, xRSP, -8)
+#define POP2(reg1, reg2) LDPx_S7_postindex(reg1, reg2, xRSP, 16)
+#define PUSH2(reg1, reg2) STPx_S7_preindex(reg2, reg1, xRSP, -16)
+
+#define POP1_32(reg) LDRw_S9_postindex(reg, xRSP, 4)
+#define PUSH1_32(reg) STRw_S9_preindex(reg, xRSP, -4)
+#define POP2_32(reg1, reg2) LDPw_S7_postindex(reg1, reg2, xRSP, 8)
+#define PUSH2_32(reg1, reg2) STPw_S7_preindex(reg2, reg1, xRSP, -8)
+
+#define POP1_16(reg) LDRH_S9_postindex(reg, xRSP, 2)
+#define PUSH1_16(reg) STRH_S9_preindex(reg, xRSP, -2)
+
+#define POP1z(reg) if(rex.is32bits) {POP1_32(reg);} else {POP1(reg);}
+#define PUSH1z(reg) if(rex.is32bits) {PUSH1_32(reg);} else {PUSH1(reg);}
+#define POP2z(reg1, reg2) if(rex.is32bits) {POP2_32(reg1, reg2);} else {POP2(reg1, reg2);}
+#define PUSH2z(reg1, reg2) if(rex.is32bits) {PUSH2_32(reg1, reg2);} else {PUSH2(reg1, reg2);}
// LOAD/STORE Acquire Exclusive
#define MEMAX_gen(size, L, Rs, Rn, Rt) ((size)<<30 | 0b001000<<24 | (L)<<22 | (Rs)<<16 | 1<<15 | 0b11111<<10 | (Rn)<<5 | (Rt))
@@ -380,9 +441,11 @@
#define CBNZx(Rt, imm19) EMIT(CB_gen(1, 1, ((imm19)>>2)&0x7FFFF, Rt))
#define CBNZw(Rt, imm19) EMIT(CB_gen(0, 1, ((imm19)>>2)&0x7FFFF, Rt))
#define CBNZxw(Rt, imm19) EMIT(CB_gen(rex.w, 1, ((imm19)>>2)&0x7FFFF, Rt))
+#define CBNZz(Rt, imm19) EMIT(CB_gen(rex.is32bits?0:1, 1, ((imm19)>>2)&0x7FFFF, Rt))
#define CBZx(Rt, imm19) EMIT(CB_gen(1, 0, ((imm19)>>2)&0x7FFFF, Rt))
#define CBZw(Rt, imm19) EMIT(CB_gen(0, 0, ((imm19)>>2)&0x7FFFF, Rt))
#define CBZxw(Rt, imm19) EMIT(CB_gen(rex.w, 0, ((imm19)>>2)&0x7FFFF, Rt))
+#define CBZz(Rt, imm19) EMIT(CB_gen(rex.is32bits?0:1, 0, ((imm19)>>2)&0x7FFFF, Rt))
#define TB_gen(b5, op, b40, imm14, Rt) ((b5)<<31 | 0b011011<<25 | (op)<<24 | (b40)<<19 | (imm14)<<5 | (Rt))
#define TBZ(Rt, bit, imm16) EMIT(TB_gen(((bit)>>5)&1, 0, (bit)&0x1f, ((imm16)>>2)&0x3FFF, Rt))
@@ -427,9 +490,9 @@
#define CSNEGx(Rd, Rn, Rm, cond) EMIT(CSNEG_gen(1, Rm, cond, Rn, Rd))
#define CSNEGw(Rd, Rn, Rm, cond) EMIT(CSNEG_gen(0, Rm, cond, Rn, Rd))
#define CSNEGxw(Rd, Rn, Rm, cond) EMIT(CSNEG_gen(rex.w, Rm, cond, Rn, Rd))
-#define CNEGx(Rd, Rn, cond) CSNEGx(Rn, Rn, Rn, invCond(cond))
-#define CNEGw(Rd, Rn, cond) CSNEGw(Rn, Rn, Rn, invCond(cond))
-#define CNEGxw(Rd, Rn, cond) CSNEGxw(Rn, Rn, Rn, invCond(cond))
+#define CNEGx(Rd, Rn, cond) CSNEGx(Rn, Rn, Rd, invCond(cond))
+#define CNEGw(Rd, Rn, cond) CSNEGw(Rn, Rn, Rd, invCond(cond))
+#define CNEGxw(Rd, Rn, cond) CSNEGxw(Rn, Rn, Rd, invCond(cond))
// AND / ORR
#define LOGIC_gen(sf, opc, N, immr, imms, Rn, Rd) ((sf)<<31 | (opc)<<29 | 0b100100<<23 | (N)<<22 | (immr)<<16 | (imms)<<10 | (Rn)<<5 | Rd)
@@ -474,9 +537,19 @@
#define EORx_REG_LSR(Rd, Rn, Rm, lsr) EMIT(LOGIC_REG_gen(1, 0b10, 0b01, 0, Rm, lsr, Rn, Rd))
#define EORw_REG_LSR(Rd, Rn, Rm, lsr) EMIT(LOGIC_REG_gen(0, 0b10, 0b01, 0, Rm, lsr, Rn, Rd))
#define EORxw_REG_LSR(Rd, Rn, Rm, lsr) EMIT(LOGIC_REG_gen(rex.w, 0b10, 0b01, 0, Rm, lsr, Rn, Rd))
+#define EONx_REG(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(1, 0b10, 0b00, 1, Rm, 0, Rn, Rd))
+#define EONw_REG(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(0, 0b10, 0b00, 1, Rm, 0, Rn, Rd))
+#define EONxw_REG(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(rex.w, 0b10, 0b00, 1, Rm, 0, Rn, Rd))
+#define EONx_REG_LSL(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(1, 0b10, 0b00, 1, Rm, lsl, Rn, Rd))
+#define EONw_REG_LSL(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(0, 0b10, 0b00, 1, Rm, lsl, Rn, Rd))
+#define EONxw_REG_LSL(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(rex.w, 0b10, 0b00, 1, Rm, lsl, Rn, Rd))
+#define EONx_REG_LSR(Rd, Rn, Rm, lsr) EMIT(LOGIC_REG_gen(1, 0b10, 0b01, 1, Rm, lsr, Rn, Rd))
+#define EONw_REG_LSR(Rd, Rn, Rm, lsr) EMIT(LOGIC_REG_gen(0, 0b10, 0b01, 1, Rm, lsr, Rn, Rd))
+#define EONxw_REG_LSR(Rd, Rn, Rm, lsr) EMIT(LOGIC_REG_gen(rex.w, 0b10, 0b01, 1, Rm, lsr, Rn, Rd))
#define MOVx_REG(Rd, Rm) ORRx_REG(Rd, xZR, Rm)
#define MOVw_REG(Rd, Rm) ORRw_REG(Rd, xZR, Rm)
#define MOVxw_REG(Rd, Rm) ORRxw_REG(Rd, xZR, Rm)
+#define MOVz_REG(Rd, Rm) if(rex.is32bits) {MOVw_REG(Rd, Rm);} else {MOVx_REG(Rd, Rm);}
#define LSLw_IMM(Rd, Rm, lsl) ORRw_REG_LSL(Rd, xZR, Rm, lsl)
#define LSLx_IMM(Rd, Rm, lsl) ORRx_REG_LSL(Rd, xZR, Rm, lsl)
#define LSLxw_IMM(Rd, Rm, lsl) ORRxw_REG_LSL(Rd, xZR, Rm, lsl)
@@ -499,6 +572,12 @@
#define BICx_REG BICx
#define BICw_REG BICw
#define BICxw_REG BICxw
+#define BICx_REG_LSL(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(1, 0b00, 0b00, 1, Rm, lsl, Rn, Rd))
+#define BICw_REG_LSL(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(0, 0b00, 0b00, 1, Rm, lsl, Rn, Rd))
+#define BICxw_REG_LSL(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(rex.w, 0b00, 0b00, 1, Rm, lsl, Rn, Rd))
+#define BICx_REG_LSR(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(1, 0b00, 0b01, 1, Rm, lsl, Rn, Rd))
+#define BICw_REG_LSR(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(0, 0b00, 0b01, 1, Rm, lsl, Rn, Rd))
+#define BICxw_REG_LSR(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(rex.w, 0b00, 0b01, 1, Rm, lsl, Rn, Rd))
#define TSTx_REG(Rn, Rm) ANDSx_REG(xZR, Rn, Rm)
#define TSTw_REG(Rn, Rm) ANDSw_REG(wZR, Rn, Rm)
#define TSTxw_REG(Rn, Rm) ANDSxw_REG(xZR, Rn, Rm)
@@ -726,6 +805,15 @@
#define VSTR64_I9(Vt, Rn, imm9) EMIT(VMEMUR_vector(0b11, 0b00, (imm9)&0b111111111, Rn, Vt))
#define VSTR128_I9(Vt, Rn, imm9) EMIT(VMEMUR_vector(0b00, 0b10, (imm9)&0b111111111, Rn, Vt))
+#define VLD128(A, B, C) if(unscaled) {VLDR128_I9(A, B, C);} else {VLDR128_U12(A, B, C);}
+#define VLD64(A, B, C) if(unscaled) {VLDR64_I9(A, B, C);} else {VLDR64_U12(A, B, C);}
+#define VLD32(A, B, C) if(unscaled) {VLDR32_I9(A, B, C);} else {VLDR32_U12(A, B, C);}
+#define VLD16(A, B, C) if(unscaled) {VLDR16_I9(A, B, C);} else {VLDR16_U12(A, B, C);}
+#define VST128(A, B, C) if(unscaled) {VSTR128_I9(A, B, C);} else {VSTR128_U12(A, B, C);}
+#define VST64(A, B, C) if(unscaled) {VSTR64_I9(A, B, C);} else {VSTR64_U12(A, B, C);}
+#define VST32(A, B, C) if(unscaled) {VSTR32_I9(A, B, C);} else {VSTR32_U12(A, B, C);}
+#define VST16(A, B, C) if(unscaled) {VSTR16_I9(A, B, C);} else {VSTR16_U12(A, B, C);}
+
#define VMEMW_gen(size, opc, imm9, op2, Rn, Rt) ((size)<<30 | 0b111<<27 | 1<<26 | (opc)<<22 | (imm9)<<12 | (op2)<<10 | 0b01<<10 | (Rn)<<5 | (Rt))
#define VLDR64_S9_postindex(Rt, Rn, imm9) EMIT(VMEMW_gen(0b11, 0b01, (imm9)&0x1ff, 0b01, Rn, Rt))
#define VLDR64_S9_preindex(Rt, Rn, imm9) EMIT(VMEMW_gen(0b11, 0b01, (imm9)&0x1ff, 0b11, Rn, Rt))
@@ -880,6 +968,10 @@
#define VSUB_16(Vd, Vn, Vm) EMIT(ADDSUB_vector(0, 1, 0b01, Vm, Vn, Vd))
#define VSUB_32(Vd, Vn, Vm) EMIT(ADDSUB_vector(0, 1, 0b10, Vm, Vn, Vd))
+#define ADDSUB_scalar(U, size, Rm, Rn, Rd) (01<<30 | (U)<<29 | 0b11110<<24 | (size)<<22 | 1<<21 | (Rm)<<16 | 0b10000<<11 | 1<<10 | (Rn)<<5 | (Rd))
+#define ADD_64(Vd, Vn, Vm) EMIT(ADDSUB_scalar(0, 0b11, Vm, Vn, Vd))
+#define SUB_64(Vd, Vn, Vm) EMIT(ADDSUB_scalar(1, 0b11, Vm, Vn, Vd))
+
#define NEGABS_vector(Q, U, size, Rn, Rd) ((Q)<<30 | (U)<<29 | 0b01110<<24 | (size)<<22 | 0b10000<<17 | 0b01011<<12 | 0b10<<10 | (Rn)<<5 | (Rd))
#define NEG_8(Vd, Vn) EMIT(NEGABS_vector(0, 1, 0b00, Vn, Vd))
#define NEG_16(Vd, Vn) EMIT(NEGABS_vector(0, 1, 0b01, Vn, Vd))
@@ -1025,7 +1117,7 @@
#define FMLA_vector(Q, op, sz, Rm, Rn, Rd) ((Q)<<30 | 0b01110<<24 | (op)<<23 | (sz)<<22 | 1<<21 | (Rm)<<16 | 0b11001<<11 | 1<<10 | (Rn)<<5 | (Rd))
#define VFMLAS(Sd, Sn, Sm) EMIT(FMLA_vector(0, 0, 0, Sm, Sn, Sd))
#define VFMLAQS(Sd, Sn, Sm) EMIT(FMLA_vector(1, 0, 0, Sm, Sn, Sd))
-#define CFMLAQD(Dd, Dn, Dm) EMIT(FMLA_vector(1, 0, 1, Dm, Dn, Dd))
+#define VFMLAQD(Dd, Dn, Dm) EMIT(FMLA_vector(1, 0, 1, Dm, Dn, Dd))
// DIV
#define FDIV_vector(Q, sz, Rm, Rn, Rd) ((Q)<<30 | 1<<29 | 0b01110<<24 | (sz)<<22 | 1<<21 | (Rm)<<16 | 0b11111<<11 | 1<<10 | (Rn)<<5 | (Rd))
@@ -1223,6 +1315,12 @@
#define FCVT_D_S(Dd, Sn) EMIT(FCVT_precision(0b00, 0b01, Sn, Dd))
#define FCVT_S_D(Sd, Dn) EMIT(FCVT_precision(0b01, 0b00, Dn, Sd))
+#define FCVTN_vector(Q, sz, Rn, Rd) ((Q)<<30 | 0<<29 | 0b01110<<24 | (sz)<<22 | 0b10000<<17 | 0b10110<<12 | 0b10<<10 | (Rn)<<5 | (Rd))
+// Convert Vn from 2*Double to lower Vd as 2*float and clears the upper half, use FPCR rounding
+#define FCVTN(Vd, Vn) EMIT(FCVTN_vector(0, 1, Vn, Vd))
+// Convert Vn from 2*Double to higher Vd as 2*float, use FPCR rounding
+#define FCVTN2(Vd, Vn) EMIT(FCVTN_vector(1, 1, Vn, Vd))
+
#define FCVTXN_vector(Q, sz, Rn, Rd) ((Q)<<30 | 1<<29 | 0b01110<<24 | (sz)<<22 | 0b10000<<17 | 0b10110<<12 | 0b10<<10 | (Rn)<<5 | (Rd))
// Convert Vn from 2*Double to lower Vd as 2*float and clears the upper half
#define FCVTXN(Vd, Vn) EMIT(FCVTXN_vector(0, 1, Vn, Vd))
@@ -1258,6 +1356,10 @@
#define VFRINTIS(Vd,Vn) EMIT(FRINT_vector(0, 1, 1, 0, 1, Vn, Vd))
#define VFRINTISQ(Vd,Vn) EMIT(FRINT_vector(1, 1, 1, 0, 1, Vn, Vd))
#define VFRINTIDQ(Vd,Vn) EMIT(FRINT_vector(1, 1, 1, 1, 1, Vn, Vd))
+// round with mode, mode is 0 = TieEven, 1=+inf, 2=-inf, 3=zero
+#define VFRINTRDQ(Vd,Vn, mode) EMIT(FRINT_vector(1, 0, (mode)&1, 1, ((mode)>>1)&1, Vn, Vd))
+// round with mode, mode is 0 = TieEven, 1=+inf, 2=-inf, 3=zero
+#define VFRINTRSQ(Vd,Vn, mode) EMIT(FRINT_vector(1, 0, (mode)&1, 0, ((mode)>>1)&1, Vn, Vd))
#define FRINTI_scalar(type, Rn, Rd) (0b11110<<24 | (type)<<22 | 1<<21 | 0b001<<18 | 0b111<<15 | 0b10000<<10 | (Rn)<<5 | (Rd))
#define FRINTIS(Sd, Sn) EMIT(FRINTI_scalar(0b00, Sn, Sd))
@@ -1344,14 +1446,23 @@
#define VUZP1Q_64(Rt, Rn, Rm) EMIT(UZP_gen(1, 0b11, Rm, 0, Rn, Rt))
#define VUZP2Q_64(Rt, Rn, Rm) EMIT(UZP_gen(1, 0b11, Rm, 1, Rn, Rt))
-#define DUP_gen(Q, imm5, Rn, Rd) ((Q)<<30 | 0b01110000<<21 | (imm5)<<16 | 1<<10 | (Rn)<<5 | (Rd))
-#define VDUP_8(Vd, Vn, idx) EMIT(DUP_gen(0, ((idx)<<1|1), Vn, Vd))
-#define VDUPQ_8(Vd, Vn, idx) EMIT(DUP_gen(1, ((idx)<<1|1), Vn, Vd))
-#define VDUP_16(Vd, Vn, idx) EMIT(DUP_gen(0, ((idx)<<2|0b10), Vn, Vd))
-#define VDUPQ_16(Vd, Vn, idx) EMIT(DUP_gen(1, ((idx)<<2|0b10), Vn, Vd))
-#define VDUP_32(Vd, Vn, idx) EMIT(DUP_gen(0, ((idx)<<3|0b100), Vn, Vd))
-#define VDUPQ_32(Vd, Vn, idx) EMIT(DUP_gen(1, ((idx)<<3|0b100), Vn, Vd))
-#define VDUPQ_64(Vd, Vn, idx) EMIT(DUP_gen(1, ((idx)<<4|0b1000), Vn, Vd))
+#define DUP_element(Q, imm5, Rn, Rd) ((Q)<<30 | 0b01110000<<21 | (imm5)<<16 | 1<<10 | (Rn)<<5 | (Rd))
+#define VDUP_8(Vd, Vn, idx) EMIT(DUP_element(0, ((idx)<<1|1), Vn, Vd))
+#define VDUPQ_8(Vd, Vn, idx) EMIT(DUP_element(1, ((idx)<<1|1), Vn, Vd))
+#define VDUP_16(Vd, Vn, idx) EMIT(DUP_element(0, ((idx)<<2|0b10), Vn, Vd))
+#define VDUPQ_16(Vd, Vn, idx) EMIT(DUP_element(1, ((idx)<<2|0b10), Vn, Vd))
+#define VDUP_32(Vd, Vn, idx) EMIT(DUP_element(0, ((idx)<<3|0b100), Vn, Vd))
+#define VDUPQ_32(Vd, Vn, idx) EMIT(DUP_element(1, ((idx)<<3|0b100), Vn, Vd))
+#define VDUPQ_64(Vd, Vn, idx) EMIT(DUP_element(1, ((idx)<<4|0b1000), Vn, Vd))
+
+#define DUP_general(Q, imm5, Rn, Rd) ((Q)<<30 | 0b01110000<<21 | (imm5)<<16 | 0b11<<10 | (Rn)<<5 | (Rd))
+#define VDUPB(Vd, Wn) EMIT(DUP_general(0, 0b1, Wn, Vd))
+#define VDUPQB(Vd, Wn) EMIT(DUP_general(1, 0b1, Wn, Vd))
+#define VDUPH(Vd, Wn) EMIT(DUP_general(0, 0b10, Wn, Vd))
+#define VDUPQH(Vd, Wn) EMIT(DUP_general(1, 0b10, Wn, Vd))
+#define VDUPS(Vd, Wn) EMIT(DUP_general(0, 0b100, Wn, Vd))
+#define VDUPQS(Vd, Wn) EMIT(DUP_general(1, 0b100, Wn, Vd))
+#define VDUPQD(Vd, Xn) EMIT(DUP_general(1, 0b1000, Xn, Vd))
// TBL
#define TBL_gen(Q, Rm, len, op, Rn, Rd) ((Q)<<30 | 0b001110<<24 | (Rm)<<16 | (len)<<13 | (op)<<12 | (Rn)<<5 | (Rd))
@@ -1638,10 +1749,17 @@
#define UADDLV_16(Rd, Rn) EMIT(ADDLV_vector(0, 1, 0b01, Rn, Rd))
#define UADDLV_32(Rd, Rn) EMIT(ADDLV_vector(0, 1, 0b10, Rn, Rd))
+// Population Count per byte
+#define CNT_vector(Q, size, Rn, Rd) ((Q)<<30 | 0b01110<<24 | (size)<<22 | 0b10000<<17 | 0b00101<<12 | 0b10<<10 | (Rn)<<5 | (Rd))
+#define CNT_8(Rd, Rn) EMIT(CNT_vector(0, 0b00, Rn, Rd))
+#define CNTQ_8(Rd, Rn) EMIT(CNT_vector(1, 0b00, Rn, Rd))
+
// MOV Immediate
#define MOVI_vector(Q, op, abc, cmode, defgh, Rd) ((Q)<<30 | (op)<<29 | 0b0111100000<<19 | (abc)<<16 | (cmode)<<12 | 1<<10 | (defgh)<<5 | (Rd))
#define MOVIQ_8(Rd, imm8) EMIT(MOVI_vector(1, 0, (((imm8)>>5)&0b111), 0b1110, ((imm8)&0b11111), Rd))
#define MOVI_8(Rd, imm8) EMIT(MOVI_vector(0, 0, (((imm8)>>5)&0b111), 0b1110, ((imm8)&0b11111), Rd))
+#define MOVI_16(Rd, imm8) EMIT(MOVI_vector(0, 0, (((imm8)>>5)&0b111), 0b1000, ((imm8)&0b11111), Rd))
+#define MOVI_32(Rd, imm8) EMIT(MOVI_vector(0, 0, (((imm8)>>5)&0b111), 0b0000, ((imm8)&0b11111), Rd))
// SHLL and eXtend Long
#define SHLL_vector(Q, U, immh, immb, Rn, Rd) ((Q)<<30 | (U)<<29 | 0b011110<<23 | (immh)<<19 | (immb)<<16 | 0b10100<<11 | 1<<10 | (Rn)<<5 | (Rd))
@@ -1711,35 +1829,35 @@
#define SMAX_8(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 0, 0b00, Vm, 0, Vn, Vd))
#define SMAX_16(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 0, 0b01, Vm, 0, Vn, Vd))
#define SMAX_32(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 0, 0b10, Vm, 0, Vn, Vd))
-#define SMAX_64(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 0, 0b11, Vm, 0, Vn, Vd))
+//#define SMAX_64(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 0, 0b11, Vm, 0, Vn, Vd))
#define UMAX_8(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 1, 0b00, Vm, 0, Vn, Vd))
#define UMAX_16(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 1, 0b01, Vm, 0, Vn, Vd))
#define UMAX_32(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 1, 0b10, Vm, 0, Vn, Vd))
-#define UMAX_64(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 1, 0b11, Vm, 0, Vn, Vd))
+//#define UMAX_64(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 1, 0b11, Vm, 0, Vn, Vd))
#define SMIN_8(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 0, 0b00, Vm, 1, Vn, Vd))
#define SMIN_16(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 0, 0b01, Vm, 1, Vn, Vd))
#define SMIN_32(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 0, 0b10, Vm, 1, Vn, Vd))
-#define SMIN_64(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 0, 0b11, Vm, 1, Vn, Vd))
+//#define SMIN_64(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 0, 0b11, Vm, 1, Vn, Vd))
#define UMIN_8(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 1, 0b00, Vm, 1, Vn, Vd))
#define UMIN_16(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 1, 0b01, Vm, 1, Vn, Vd))
#define UMIN_32(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 1, 0b10, Vm, 1, Vn, Vd))
-#define UMIN_64(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 1, 0b11, Vm, 1, Vn, Vd))
+//#define UMIN_64(Vd, Vn, Vm) EMIT(MINMAX_vector(0, 1, 0b11, Vm, 1, Vn, Vd))
#define SMAXQ_8(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 0, 0b00, Vm, 0, Vn, Vd))
#define SMAXQ_16(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 0, 0b01, Vm, 0, Vn, Vd))
#define SMAXQ_32(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 0, 0b10, Vm, 0, Vn, Vd))
-#define SMAXQ_64(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 0, 0b11, Vm, 0, Vn, Vd))
+//#define SMAXQ_64(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 0, 0b11, Vm, 0, Vn, Vd))
#define UMAXQ_8(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 1, 0b00, Vm, 0, Vn, Vd))
#define UMAXQ_16(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 1, 0b01, Vm, 0, Vn, Vd))
#define UMAXQ_32(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 1, 0b10, Vm, 0, Vn, Vd))
-#define UMAXQ_64(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 1, 0b11, Vm, 0, Vn, Vd))
+//#define UMAXQ_64(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 1, 0b11, Vm, 0, Vn, Vd))
#define SMINQ_8(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 0, 0b00, Vm, 1, Vn, Vd))
#define SMINQ_16(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 0, 0b01, Vm, 1, Vn, Vd))
#define SMINQ_32(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 0, 0b10, Vm, 1, Vn, Vd))
-#define SMINQ_64(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 0, 0b11, Vm, 1, Vn, Vd))
+//#define SMINQ_64(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 0, 0b11, Vm, 1, Vn, Vd))
#define UMINQ_8(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 1, 0b00, Vm, 1, Vn, Vd))
#define UMINQ_16(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 1, 0b01, Vm, 1, Vn, Vd))
#define UMINQ_32(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 1, 0b10, Vm, 1, Vn, Vd))
-#define UMINQ_64(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 1, 0b11, Vm, 1, Vn, Vd))
+//#define UMINQ_64(Vd, Vn, Vm) EMIT(MINMAX_vector(1, 1, 0b11, Vm, 1, Vn, Vd))
// HADD vector
#define HADD_vector(Q, U, size, Rm, Rn, Rd) ((Q)<<30 | (U)<<29 | 0b01110<<24 | (size)<<22 | 1<<21 | (Rm)<<16 | 1<<10 | (Rn)<<5 | (Rd))
diff --git a/src/dynarec/arm64/arm64_epilog.S b/src/dynarec/arm64/arm64_epilog.S
index 2e18626..2e18626 100755..100644
--- a/src/dynarec/arm64/arm64_epilog.S
+++ b/src/dynarec/arm64/arm64_epilog.S
diff --git a/src/dynarec/arm64/arm64_lock.S b/src/dynarec/arm64/arm64_lock.S
index 8c3c871..b091101 100755..100644
--- a/src/dynarec/arm64/arm64_lock.S
+++ b/src/dynarec/arm64/arm64_lock.S
@@ -15,8 +15,10 @@
.global arm64_lock_write_dd
.global arm64_lock_read_dq
.global arm64_lock_write_dq
-.global arm64_lock_xchg
+.global arm64_lock_xchg_dd
.global arm64_lock_xchg_d
+.global arm64_lock_xchg_h
+.global arm64_lock_xchg_b
.global arm64_lock_storeifnull
.global arm64_lock_storeifnull_d
.global arm64_lock_storeifref
@@ -97,13 +99,13 @@ arm64_lock_write_dq:
ret
-arm64_lock_xchg:
+arm64_lock_xchg_dd:
dmb ish
-arm64_lock_xchg_0:
+arm64_lock_xchg_dd_0:
// address is x0, value is x1, return old value in x0
ldaxr x2, [x0]
stlxr w3, x1, [x0]
- cbnz w3, arm64_lock_xchg_0
+ cbnz w3, arm64_lock_xchg_dd_0
mov x0, x2
ret
@@ -117,6 +119,26 @@ arm64_lock_xchg_d_0:
mov w0, w2
ret
+arm64_lock_xchg_h:
+ dmb ish
+arm64_lock_xchg_h_0:
+ // address is x0, value is x1, return old value in x0
+ ldaxrh w2, [x0]
+ stlxrh w3, w1, [x0]
+ cbnz w3, arm64_lock_xchg_h_0
+ mov w0, w2
+ ret
+
+arm64_lock_xchg_b:
+ dmb ish
+arm64_lock_xchg_b_0:
+ // address is x0, value is x1, return old value in x0
+ ldaxrb w2, [x0]
+ stlxrb w3, w1, [x0]
+ cbnz w3, arm64_lock_xchg_b_0
+ mov w0, w2
+ ret
+
arm64_lock_storeifnull:
dmb ish
1:
diff --git a/src/dynarec/arm64/arm64_lock.h b/src/dynarec/arm64/arm64_lock.h
index 7e303da..118c807 100755..100644
--- a/src/dynarec/arm64/arm64_lock.h
+++ b/src/dynarec/arm64/arm64_lock.h
@@ -27,40 +27,46 @@ extern void arm64_lock_read_dq(uint64_t * a, uint64_t* b, void* addr);
// STLXRD of ADDR, return 0 if ok, 1 if not
extern int arm64_lock_write_dq(uint64_t a, uint64_t b, void* addr);
-// Atomicaly exchange value at [p] with val, return old p
-extern uintptr_t arm64_lock_xchg(void* p, uintptr_t val);
+// Atomically exchange value at [p] with val, return old p
+extern uintptr_t arm64_lock_xchg_dd(void* p, uintptr_t val);
-// Atomicaly exchange value at [p] with val, return old p
+// Atomically exchange value at [p] with val, return old p
extern uint32_t arm64_lock_xchg_d(void* p, uint32_t val);
-// Atomicaly store value to [p] only if [p] is NULL. Return old [p] value
+// Atomically exchange value at [p] with val, return old p
+extern uint32_t arm64_lock_xchg_h(void* p, uint32_t val);
+
+// Atomically exchange value at [p] with val, return old p
+extern uint32_t arm64_lock_xchg_b(void* p, uint32_t val);
+
+// Atomically store value to [p] only if [p] is NULL. Return old [p] value
extern uint32_t arm64_lock_storeifnull_d(void*p, uint32_t val);
-// Atomicaly store value to [p] only if [p] is NULL. Return old [p] value
+// Atomically store value to [p] only if [p] is NULL. Return old [p] value
extern void* arm64_lock_storeifnull(void*p, void* val);
-// Atomicaly store value to [p] only if [p] is ref. Return new [p] value (so val or old)
+// Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old)
extern void* arm64_lock_storeifref(void*p, void* val, void* ref);
-// Atomicaly store value to [p] only if [p] is ref. Return new [p] value (so val or old)
+// Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old)
extern uint32_t arm64_lock_storeifref_d(void*p, uint32_t val, uint32_t ref);
-// Atomicaly store value to [p] only if [p] is ref. Return new [p] value (so val or old)
+// Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old)
extern uint32_t arm64_lock_storeifref2_d(void*p, uint32_t val, uint32_t ref);
-// decrement atomicaly the byte at [p] (but only if p not 0)
+// decrement atomically the byte at [p] (but only if p not 0)
extern void arm64_lock_decifnot0b(void*p);
// atomic store (with memory barrier)
extern void arm64_lock_storeb(void*p, uint8_t b);
-// increment atomicaly the int at [p] only if it was 0. Return the old value of [p]
+// increment atomically the int at [p] only if it was 0. Return the old value of [p]
extern int arm64_lock_incif0(void*p);
-// decrement atomicaly the int at [p] (but only if p not 0)
+// decrement atomically the int at [p] (but only if p not 0)
extern int arm64_lock_decifnot0(void*p);
// atomic store (with memory barrier)
extern void arm64_lock_store(void*p, uint32_t v);
-#endif //__ARM64_LOCK__H__ \ No newline at end of file
+#endif //__ARM64_LOCK__H__
diff --git a/src/dynarec/arm64/arm64_next.S b/src/dynarec/arm64/arm64_next.S
index e900fbe..e900fbe 100755..100644
--- a/src/dynarec/arm64/arm64_next.S
+++ b/src/dynarec/arm64/arm64_next.S
diff --git a/src/dynarec/arm64/arm64_printer.c b/src/dynarec/arm64/arm64_printer.c
index e935677..2806497 100755..100644
--- a/src/dynarec/arm64/arm64_printer.c
+++ b/src/dynarec/arm64/arm64_printer.c
@@ -160,13 +160,60 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
if(isMask(opcode, "1x111000010iiiiiiiii01nnnnnttttt", &a)) {
int size = (opcode>>30)&3;
int offset = signExtend(imm, 9);
- snprintf(buff, sizeof(buff), "LDR %s, [%s], %s0x%x", (size==0b10)?Wt[Rt]:Xt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ snprintf(buff, sizeof(buff), "LDUR %s, [%s], %s0x%x", (size==0b10)?Wt[Rt]:Xt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
return buff;
}
if(isMask(opcode, "1x111000010iiiiiiiii11nnnnnttttt", &a)) {
int size = (opcode>>30)&3;
int offset = signExtend(imm, 9);
- snprintf(buff, sizeof(buff), "LDR %s, [%s, %s0x%x]!", (size==0b10)?Wt[Rt]:Xt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ snprintf(buff, sizeof(buff), "LDUR %s, [%s, %s0x%x]!", (size==0b10)?Wt[Rt]:Xt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ return buff;
+ }
+ if(isMask(opcode, "1x111000010iiiiiiiii00nnnnnttttt", &a)) {
+ int size = (opcode>>30)&3;
+ int offset = signExtend(imm, 9);
+ snprintf(buff, sizeof(buff), "LDUR %s, [%s, %s0x%x]", (size==0b10)?Wt[Rt]:Xt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ return buff;
+ }
+ if(isMask(opcode, "00111000010iiiiiiiii00nnnnnttttt", &a)) {
+ int offset = signExtend(imm, 9);
+ snprintf(buff, sizeof(buff), "LDURB %s, [%s, %s0x%x]", Wt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ return buff;
+ }
+ if(isMask(opcode, "01111000010iiiiiiiii00nnnnnttttt", &a)) {
+ int offset = signExtend(imm, 9);
+ snprintf(buff, sizeof(buff), "LDRUH %s, [%s, %s0x%x]", Wt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ return buff;
+ }
+ if(isMask(opcode, "001110001x0iiiiiiiii00nnnnnttttt", &a)) {
+ int offset = signExtend(imm, 9);
+ snprintf(buff, sizeof(buff), "LDRUSB %s, [%s, %s0x%x]", a.x?Xt[Rt]:Wt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ return buff;
+ }
+ if(isMask(opcode, "011110001x0iiiiiiiii00nnnnnttttt", &a)) {
+ int offset = signExtend(imm, 9);
+ snprintf(buff, sizeof(buff), "LDRUSH %s, [%s, %s0x%x]", a.x?Xt[Rt]:Wt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ return buff;
+ }
+ if(isMask(opcode, "10111000100iiiiiiiii00nnnnnttttt", &a)) {
+ int offset = signExtend(imm, 9);
+ snprintf(buff, sizeof(buff), "LDRUSW %s, [%s, %s0x%x]", Xt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ return buff;
+ }
+ if(isMask(opcode, "1x111000000iiiiiiiii00nnnnnttttt", &a)) {
+ int size = (opcode>>30)&3;
+ int offset = signExtend(imm, 9);
+ snprintf(buff, sizeof(buff), "STUR %s, [%s, %s0x%x]", (size==0b10)?Wt[Rt]:Xt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ return buff;
+ }
+ if(isMask(opcode, "00111000000iiiiiiiii00nnnnnttttt", &a)) {
+ int offset = signExtend(imm, 9);
+ snprintf(buff, sizeof(buff), "STURB %s, [%s, %s0x%x]", Wt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
+ return buff;
+ }
+ if(isMask(opcode, "01111000000iiiiiiiii00nnnnnttttt", &a)) {
+ int offset = signExtend(imm, 9);
+ snprintf(buff, sizeof(buff), "STRUH %s, [%s, %s0x%x]", Wt[Rt], XtSp[Rn], (offset<0)?"-":"", abs(offset));
return buff;
}
if(isMask(opcode, "1x11100101iiiiiiiiiiiinnnnnttttt", &a)) {
@@ -903,6 +950,28 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
snprintf(buff, sizeof(buff), "VCMEQ V%d.%s, V%d.%s, V%d.%s", Rd, Vd, Rn, Vd, Rm, Vd);
return buff;
}
+ // MIN/MAX
+ if(isMask(opcode, "0QU01110ff1mmmmm0110o1nnnnnddddd", &a)) {
+ const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "??", "2D"};
+ const char* Vd = Y[((sf)<<1) | a.Q];
+ snprintf(buff, sizeof(buff), "%c%s V%d.%s, V%d.%s, V%d.%s", a.U?'U':'S', a.o?"MIN":"MAX", Rd, Vd, Rn, Vd, Rm, Vd);
+ return buff;
+ }
+
+ // MOV immediate (not)shifted 8bits
+ if(isMask(opcode, "0Q00111100000iii111001iiiiiddddd", &a)) {
+ const char* Y[] = {"8B", "16B"};
+ const char* Vd = Y[a.Q];
+ snprintf(buff, sizeof(buff), "MOVI V%d.%s, #0x%x", Rd, Vd, imm);
+ return buff;
+ }
+ // MOV immediate (not)shifted 16bits & 32bits
+ if(isMask(opcode, "0Q00111100000iiif00001iiiiiddddd", &a)) {
+ const char* Y[] = {"2S", "4S", "4H", "8H"};
+ const char* Vd = Y[(sf<<1)| a.Q];
+ snprintf(buff, sizeof(buff), "MOVI V%d.%s, #0x%x", Rd, Vd, imm);
+ return buff;
+ }
// Shift
if(isMask(opcode, "0QU011110hhhhrrr000001nnnnnddddd", &a)) {
@@ -1038,6 +1107,84 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
snprintf(buff, sizeof(buff), "FSQRT %c%d, %c%d", s, Rd, s, Rn);
return buff;
}
+ // FPRINTX
+ if(isMask(opcode, "0Q1011100f100001100110nnnnnddddd", &a)) {
+ char s = a.Q?'V':'D';
+ char d = sf?'D':'S';
+ int n = (a.Q && !sf)?4:2;
+ snprintf(buff, sizeof(buff), "VFRINTX %c%d.%d%c, %c%d.%d%c", s, Rd, n, d, s, Rn, n, d);
+ return buff;
+ }
+ if (isMask(opcode, "00011110ff100111010000nnnnnddddd", &a)) {
+ char s = (sf==0)?'S':((sf==1)?'D':'?');
+ snprintf(buff, sizeof(buff), "FRINTX %c%d, %c%d", s, Rd, s, Rn);
+ return buff;
+ }
+ // FRINTI
+ if(isMask(opcode, "0Q1011101f100001100110nnnnnddddd", &a)) {
+ char s = a.Q?'V':'D';
+ char d = sf?'D':'S';
+ int n = (a.Q && !sf)?4:2;
+ snprintf(buff, sizeof(buff), "VFRINTI %c%d.%d%c, %c%d.%d%c", s, Rd, n, d, s, Rn, n, d);
+ return buff;
+ }
+ if(isMask(opcode, "00011110ff100111110000nnnnnddddd", &a)) {
+ char s = (sf==0)?'S':((sf==1)?'D':'?');
+ snprintf(buff, sizeof(buff), "FRINTI %c%d, %c%d", s, Rd, s, Rn);
+ return buff;
+ }
+ // FRINTN
+ if(isMask(opcode, "0Q0011100f100001100010nnnnnddddd", &a)) {
+ char s = a.Q?'V':'D';
+ char d = sf?'D':'S';
+ int n = (a.Q && !sf)?4:2;
+ snprintf(buff, sizeof(buff), "VFRINTN %c%d.%d%c, %c%d.%d%c", s, Rd, n, d, s, Rn, n, d);
+ return buff;
+ }
+ if(isMask(opcode, "000111100f100100010000nnnnnddddd", &a)) {
+ char s = (sf==0)?'S':((sf==1)?'D':'?');
+ snprintf(buff, sizeof(buff), "FRINTN %c%d, %c%d", s, Rd, s, Rn);
+ return buff;
+ }
+ // FRINTM
+ if(isMask(opcode, "0Q0011100f100001100110nnnnnddddd", &a)) {
+ char s = a.Q?'V':'D';
+ char d = sf?'D':'S';
+ int n = (a.Q && !sf)?4:2;
+ snprintf(buff, sizeof(buff), "VFRINTM %c%d.%d%c, %c%d.%d%c", s, Rd, n, d, s, Rn, n, d);
+ return buff;
+ }
+ if(isMask(opcode, "000111100f100101010000nnnnnddddd", &a)) {
+ char s = (sf==0)?'S':((sf==1)?'D':'?');
+ snprintf(buff, sizeof(buff), "FRINTM %c%d, %c%d", s, Rd, s, Rn);
+ return buff;
+ }
+ // FRINTP
+ if(isMask(opcode, "0Q0011101f100001100010nnnnnddddd", &a)) {
+ char s = a.Q?'V':'D';
+ char d = sf?'D':'S';
+ int n = (a.Q && !sf)?4:2;
+ snprintf(buff, sizeof(buff), "VFRINTP %c%d.%d%c, %c%d.%d%c", s, Rd, n, d, s, Rn, n, d);
+ return buff;
+ }
+ if(isMask(opcode, "000111100f100100110000nnnnnddddd", &a)) {
+ char s = (sf==0)?'S':((sf==1)?'D':'?');
+ snprintf(buff, sizeof(buff), "FRINTP %c%d, %c%d", s, Rd, s, Rn);
+ return buff;
+ }
+ // FRINTZ
+ if(isMask(opcode, "0Q0011101f100001100110nnnnnddddd", &a)) {
+ char s = a.Q?'V':'D';
+ char d = sf?'D':'S';
+ int n = (a.Q && !sf)?4:2;
+ snprintf(buff, sizeof(buff), "VFRINTZ %c%d.%d%c, %c%d.%d%c", s, Rd, n, d, s, Rn, n, d);
+ return buff;
+ }
+ if(isMask(opcode, "000111100f100101110000nnnnnddddd", &a)) {
+ char s = (sf==0)?'S':((sf==1)?'D':'?');
+ snprintf(buff, sizeof(buff), "FRINTZ %c%d, %c%d", s, Rd, s, Rn);
+ return buff;
+ }
//CMP
if(isMask(opcode, "00011110ff1mmmmm001000nnnnn0c000", &a)) {
@@ -1048,6 +1195,16 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
snprintf(buff, sizeof(buff), "FCMP %c%d, %c%d", s, Rn, s, Rm);
return buff;
}
+ //FCMP vector
+ if(isMask(opcode, "0QU01110cf1mmmmm111001nnnnnddddd", &a)) {
+ char s = (sf==0)?'S':((sf==1)?'D':'?');
+ int n = (sf==0)?2:1;
+ n *= a.Q?2:1;
+ int op = (a.c<<1) | (a.U);
+ const char* OP[] = {"EQ", "GE", "??", "GT"};
+ snprintf(buff, sizeof(buff), "FCMP%s%s V%d.%d%c, V%d.%d%c, V%d.%d%c", OP[op], a.Q?"Q":"", Rd, n, s, Rn, n, s, Rm, n, s);
+ return buff;
+ }
//FMIN/FMAX
if(isMask(opcode, "00011110ff1mmmmm01oo10nnnnnddddd", &a)) {
char s = (sf==0)?'S':((sf==1)?'D':'?');
@@ -1061,6 +1218,27 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
snprintf(buff, sizeof(buff), "F%sNM%s V%d.%d%c, V%d.%d%c, V%d.%d%c", option?"MIN":"MAX", a.Q?"Q":"", Rd, n, s, Rn, n, s, Rm, n, s);
return buff;
}
+ if(isMask(opcode, "0Q001110of1mmmmm111101nnnnnddddd", &a)) {
+ char s = (sf==0)?'S':((sf==1)?'D':'?');
+ int n = (sf==0)?2:1;
+ n *= a.Q?2:1;
+ snprintf(buff, sizeof(buff), "F%s%s V%d.%d%c, V%d.%d%c, V%d.%d%c", option?"MIN":"MAX", a.Q?"Q":"", Rd, n, s, Rn, n, s, Rm, n, s);
+ return buff;
+ }
+ // NEG
+ if(isMask(opcode, "0Q101110ff100000101110nnnnnddddd", &a)) {
+ const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "??", "2D"};
+ const char* Vd = Y[(sf<<1) | a.Q];
+ snprintf(buff, sizeof(buff), "NEG%s V%d.%s, V%d.%s", a.Q?"Q":"", Rd, Vd, Rn, Vd);
+ return buff;
+ }
+ // SSHL vector
+ if(isMask(opcode, "0QU01110ff1mmmmm010rS1nnnnnddddd", &a)) {
+ const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "??", "2D"};
+ const char* Vd = Y[(sf<<1) | a.Q];
+ snprintf(buff, sizeof(buff), "%c%s%sSHL%s V%d.%s, V%d.%s, V%d.%s", a.U?'U':'S', a.r?"R":"", a.S?"Q":"", a.Q?"Q":"", Rd, Vd, Rn, Vd, Rm, Vd);
+ return buff;
+ }
// FCVT
if(isMask(opcode, "f0011110pp10010U000000nnnnnddddd", &a)) {
@@ -1236,14 +1414,6 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
return buff;
}
- // MOV immediate
- if(isMask(opcode, "0Q00111100000iii111001iiiiiddddd", &a)) {
- const char* Y[] = {"8B", "16B"};
- const char* Vd = Y[a.Q];
- snprintf(buff, sizeof(buff), "MOVI V%d.%s, #0x%x", Rd, Vd, imm);
- return buff;
- }
-
// LD1/ST1 single structure
if(isMask(opcode, "0Q0011010L000000cc0Sffnnnnnttttt", &a)) {
int scale = a.c;
@@ -1272,9 +1442,9 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
sz = 4;
int offset = signExtend(imm, 9);
if(!offset)
- snprintf(buff, sizeof(buff), "%sUR %s%d, [%s]", a.L?"LD":"ST", Y[sz], Rd, XtSp[Rn]);
+ snprintf(buff, sizeof(buff), "%sUR %s%d, [%s]", a.L?"LD":"ST", Y[sz], Rt, XtSp[Rn]);
else
- snprintf(buff, sizeof(buff), "%sUR %s%d, [%s, %+d]", a.L?"LD":"ST", Y[sz], Rd, XtSp[Rn], imm);
+ snprintf(buff, sizeof(buff), "%sUR %s%d, [%s, %s0x%x]", a.L?"LD":"ST", Y[sz], Rt, XtSp[Rn], (offset<0)?"-":"", abs(offset));
return buff;
}
// LDR/STR vector immediate
@@ -1285,9 +1455,9 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
sz = 4;
int offset = imm<<sz;
if(!offset)
- snprintf(buff, sizeof(buff), "%sR %s%d, [%s]", a.L?"LD":"ST", Y[sz], Rd, XtSp[Rn]);
+ snprintf(buff, sizeof(buff), "%sR %s%d, [%s]", a.L?"LD":"ST", Y[sz], Rt, XtSp[Rn]);
else
- snprintf(buff, sizeof(buff), "%sR %s%d, [%s, %+d]", a.L?"LD":"ST", Y[sz], Rd, XtSp[Rn], imm);
+ snprintf(buff, sizeof(buff), "%sR %s%d, [%s, %+d]", a.L?"LD":"ST", Y[sz], Rt, XtSp[Rn], imm);
return buff;
}
@@ -1329,7 +1499,7 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
// DUP
if(isMask(opcode, "0Q001110000iiiii000001nnnnnddddd", &a)) {
- const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "2D", "??"};
+ const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "??", "2D"};
const char* Z[] = {"B", "H", "S", "D"};
int sz = 3;
if((imm&0b0001)==0b0001) sz=0;
@@ -1341,7 +1511,18 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
snprintf(buff, sizeof(buff), "DUP V%d.%s, V%d.%s[%d]", Rd, Vd, Rn, Vn, sh);
return buff;
}
-
+
+ if(isMask(opcode, "0Q001110000iiiii000011nnnnnddddd", &a)) {
+ const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "??", "2D"};
+ int sz = 3;
+ if((imm&0b0001)==0b0001) sz=0;
+ else if((imm&0b0011)==0b0010) sz=1;
+ else if((imm&0b0111)==0b0100) sz=2;
+ const char* Vd = Y[(sz<<1)|a.Q];
+ snprintf(buff, sizeof(buff), "DUP V%d.%s, X%d", Rd, Vd, Rn);
+ return buff;
+ }
+
// AES
if(isMask(opcode, "0100111000101000010f10nnnnnddddd", &a)) {
snprintf(buff, sizeof(buff), "AES%c V%d.16B, V%d.16B", sf?'D':'E', Rd, Rn);
@@ -1365,6 +1546,7 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr)
// DMB ISH
if(isMask(opcode, "11010101000000110011nnnn10111111", &a)) {
snprintf(buff, sizeof(buff), "DMB %s", (Rn==0b1011)?"ISH":"???");
+ return buff;
}
diff --git a/src/dynarec/arm64/arm64_prolog.S b/src/dynarec/arm64/arm64_prolog.S
index 5635fde..5635fde 100755..100644
--- a/src/dynarec/arm64/arm64_prolog.S
+++ b/src/dynarec/arm64/arm64_prolog.S
diff --git a/src/dynarec/arm64/dynarec_arm64_00.c b/src/dynarec/arm64/dynarec_arm64_00.c
index 4f327f5..c434dbd 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_00.c
+++ b/src/dynarec/arm64/dynarec_arm64_00.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include <signal.h>
@@ -26,6 +25,7 @@
#include "dynarec_arm64_helper.h"
int isSimpleWrapper(wrapper_t fun);
+int isRetX87Wrapper(wrapper_t fun);
uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
{
@@ -40,6 +40,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint64_t u64;
uint8_t wback, wb1, wb2, wb;
int64_t fixedaddress;
+ int unscaled;
int lock;
int cacheupd = 0;
@@ -101,7 +102,25 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
i64 = F32S;
emit_add32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5);
break;
-
+ case 0x06:
+ if(rex.is32bits) {
+ INST_NAME("PUSH ES");
+ LDRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_ES]));
+ PUSH1_32(x1);
+ } else {
+ DEFAULT;
+ }
+ break;
+ case 0x07:
+ if(rex.is32bits) {
+ INST_NAME("POP ES");
+ POP1_32(x1);
+ STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_ES]));
+ STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_ES]));
+ } else {
+ DEFAULT;
+ }
+ break;
case 0x08:
INST_NAME("OR Eb, Gb");
SETFLAGS(X_ALL, SF_SET_PENDING);
@@ -277,7 +296,25 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV64xw(x2, i64);
emit_sbb32(dyn, ninst, rex, xRAX, x2, x3, x4);
break;
-
+ case 0x1E:
+ if(rex.is32bits) {
+ INST_NAME("PUSH DS");
+ LDRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_DS]));
+ PUSH1_32(x1);
+ } else {
+ DEFAULT;
+ }
+ break;
+ case 0x1F:
+ if(rex.is32bits) {
+ INST_NAME("POP DS");
+ POP1_32(x1);
+ STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_DS]));
+ STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_DS]));
+ } else {
+ DEFAULT;
+ }
+ break;
case 0x20:
INST_NAME("AND Eb, Gb");
SETFLAGS(X_ALL, SF_SET_PENDING);
@@ -489,6 +526,45 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
emit_cmp32_0(dyn, ninst, rex, xRAX, x3, x4);
break;
+ case 0x3F:
+ if(rex.is32bits) {
+ INST_NAME("AAS");
+ MESSAGE(LOG_DUMP, "Need Optimization AAS\n");
+ READFLAGS(X_AF);
+ SETFLAGS(X_AF|X_CF|X_PF|X_SF|X_ZF, SF_SET);
+ UXTHw(x1, xRAX);
+ CALL_(aas16, x1, 0);
+ BFIx(xRAX, x1, 0, 16);
+ } else {
+ DEFAULT;
+ }
+ break;
+ case 0x40:
+ case 0x41:
+ case 0x42:
+ case 0x43:
+ case 0x44:
+ case 0x45:
+ case 0x46:
+ case 0x47:
+ INST_NAME("INC Reg (32bits)");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ gd = xRAX + (opcode&7);
+ emit_inc32(dyn, ninst, rex, gd, x1, x2);
+ break;
+ case 0x48:
+ case 0x49:
+ case 0x4A:
+ case 0x4B:
+ case 0x4C:
+ case 0x4D:
+ case 0x4E:
+ case 0x4F:
+ INST_NAME("DEC Reg (32bits)");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ gd = xRAX + (opcode&7);
+ emit_dec32(dyn, ninst, rex, gd, x1, x2);
+ break;
case 0x50:
case 0x51:
case 0x52:
@@ -498,12 +574,39 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0x56:
case 0x57:
INST_NAME("PUSH reg");
- gd = xRAX+(opcode&0x07)+(rex.b<<3);
- if(gd==xRSP) {
- MOVx_REG(x1, gd);
- gd = x1;
+ if(dyn->doublepush) {
+ SKIPTEST(x1);
+ dyn->doublepush = 0;
+ } else {
+ gd = xRAX+(opcode&0x07)+(rex.b<<3);
+ u32 = PK(0);
+ i32 = 1;
+ rex.rex = 0;
+ if(!rex.is32bits)
+ while(u32>=0x40 && u32<=0x4f) {
+ rex.rex = u32;
+ u32 = PK(i32);
+ i32++;
+ }
+ if(!box64_dynarec_test && u32>=0x50 && u32<=0x57 && (dyn->size>(ninst+1) && dyn->insts[ninst+1].pred_sz==1) && gd != xRSP) {
+ u32= xRAX+(u32&0x07)+(rex.b<<3);
+ if(u32==xRSP) {
+ PUSH1z(gd);
+ } else {
+ // double push!
+ MESSAGE(LOG_DUMP, "DOUBLE PUSH\n");
+ PUSH2z(gd, u32);
+ dyn->doublepush = 1;
+ }
+ } else {
+ if (gd == xRSP) {
+ MOVz_REG(x1, xRSP);
+ PUSH1z(x1);
+ } else {
+ PUSH1z(gd);
+ }
+ }
}
- PUSH1(gd);
break;
case 0x58:
case 0x59:
@@ -514,34 +617,102 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0x5E:
case 0x5F:
INST_NAME("POP reg");
- gd = xRAX+(opcode&0x07)+(rex.b<<3);
- if(gd == xRSP) {
- POP1(x1);
- MOVx_REG(gd, x1);
+ if(dyn->doublepop) {
+ SKIPTEST(x1);
+ dyn->doublepop = 0;
} else {
- POP1(gd);
+ gd = xRAX+(opcode&0x07)+(rex.b<<3);
+ u32 = PK(0);
+ i32 = 1;
+ rex.rex = 0;
+ if(!rex.is32bits)
+ while(u32>=0x40 && u32<=0x4f) {
+ rex.rex = u32;
+ u32 = PK(i32);
+ i32++;
+ }
+ if(!box64_dynarec_test && (gd!=xRSP) && u32>=0x58 && u32<=0x5f && (dyn->size>(ninst+1) && dyn->insts[ninst+1].pred_sz==1)) {
+ // double pop!
+ u32= xRAX+(u32&0x07)+(rex.b<<3);
+ MESSAGE(LOG_DUMP, "DOUBLE POP\n");
+ if(gd==u32) {
+ ADDz_U12(xRSP, xRSP, rex.is32bits?0x4:0x8);
+ POP1z(gd);
+ } else {
+ POP2z(gd, (u32==xRSP)?x1:u32);
+ if(u32==xRSP) {
+ MOVz_REG(u32, x1);
+ }
+ }
+ dyn->doublepop = 1;
+ SKIPTEST(x1); // disable test for this OP
+ } else {
+ if(gd == xRSP) {
+ POP1z(x1);
+ MOVz_REG(gd, x1);
+ } else {
+ POP1z(gd);
+ }
+ }
+ }
+ break;
+ case 0x60:
+ if(rex.is32bits) {
+ INST_NAME("PUSHAD");
+ MOVw_REG(x1, xRSP);
+ PUSH2_32(xRAX, xRCX);
+ PUSH2_32(xRDX, xRBX);
+ PUSH2_32(x1, xRBP);
+ PUSH2_32(xRSI, xRDI);
+ } else {
+ DEFAULT;
+ }
+ break;
+ case 0x61:
+ if(rex.is32bits) {
+ INST_NAME("POPAD");
+ POP2_32(xRDI, xRSI);
+ POP2_32(xRBP, x1);
+ POP2_32(xRBX, xRDX);
+ POP2_32(xRCX, xRAX);
+ } else {
+ DEFAULT;
+ }
+ break;
+ case 0x62:
+ if(rex.is32bits) {
+ // BOUND here
+ DEFAULT;
+ } else {
+ INST_NAME("BOUND Gd, Ed");
+ nextop = F8;
+ FAKEED(0);
}
break;
-
case 0x63:
- INST_NAME("MOVSXD Gd, Ed");
- nextop = F8;
- GETGD;
- if(rex.w) {
- if(MODREG) { // reg <= reg
- SXTWx(gd, xRAX+(nextop&7)+(rex.b<<3));
- } else { // mem <= reg
- SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- LDRSW_U12(gd, ed, fixedaddress);
- }
+ if(rex.is32bits) {
+ // ARPL here
+ DEFAULT;
} else {
- if(MODREG) { // reg <= reg
- MOVw_REG(gd, xRAX+(nextop&7)+(rex.b<<3));
- } else { // mem <= reg
- SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- LDRw_U12(gd, ed, fixedaddress);
+ INST_NAME("MOVSXD Gd, Ed");
+ nextop = F8;
+ GETGD;
+ if(rex.w) {
+ if(MODREG) { // reg <= reg
+ SXTWx(gd, xRAX+(nextop&7)+(rex.b<<3));
+ } else { // mem <= reg
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ LDSW(gd, ed, fixedaddress);
+ }
+ } else {
+ if(MODREG) { // reg <= reg
+ MOVw_REG(gd, xRAX+(nextop&7)+(rex.b<<3));
+ } else { // mem <= reg
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ LDW(gd, ed, fixedaddress);
+ }
}
}
break;
@@ -564,10 +735,10 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MESSAGE(LOG_DUMP, "PUSH then RET, using indirect\n");
TABLE64(x3, addr-4);
LDRSW_U12(x1, x3, 0);
- PUSH1(x1);
+ PUSH1z(x1);
} else {
- MOV64x(x3, i64);
- PUSH1(x3);
+ MOV64z(x3, i64);
+ PUSH1z(x3);
}
break;
case 0x69:
@@ -606,8 +777,8 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0x6A:
INST_NAME("PUSH Ib");
i64 = F8S;
- MOV64x(x3, i64);
- PUSH1(x3);
+ MOV64z(x3, i64);
+ PUSH1z(x3);
break;
case 0x6B:
INST_NAME("IMUL Gd, Ed, Ib");
@@ -643,6 +814,18 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
break;
+ case 0x6D:
+ INST_NAME("INSD");
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL(xRIP);
+ CALL(native_priv, -1);
+ LOAD_XEMU_CALL(xRIP);
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+
#define GO(GETFLAGS, NO, YES, F) \
READFLAGS(F); \
i8 = F8S; \
@@ -672,7 +855,13 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
GOCOND(0x70, "J", "ib");
#undef GO
-
+
+ case 0x82:
+ if(!rex.is32bits) {
+ DEFAULT;
+ return ip;
+ }
+ // fallthru
case 0x80:
nextop = F8;
switch((nextop>>3)&7) {
@@ -841,7 +1030,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
nextop=F8;
GETGD;
GETED(0);
- emit_test32(dyn, ninst, rex, ed, gd, x3, x5);
+ emit_test32(dyn, ninst, rex, ed, gd, x3, x5, x6);
break;
case 0x86:
INST_NAME("(LOCK)XCHG Eb, Gb");
@@ -865,7 +1054,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
SMDMB();
GETGB(x4);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
// do the swap with exclusive locking
LDAXRB(x1, ed);
@@ -887,7 +1076,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVxw_REG(ed, x1);
} else {
GETGD;
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
SMDMB();
TSTx_mask(ed, 1, 0, 1+rex.w); // mask=3 or 7
B_MARK(cNE);
@@ -932,8 +1121,8 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
BFIx(eb1, gd, eb2*8, 8);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff, 0, rex, &lock, 0, 0);
- STRB_U12(gd, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 0);
+ STB(gd, ed, fixedaddress);
SMWRITELOCK(lock);
}
break;
@@ -944,8 +1133,8 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) { // reg <= reg
MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), gd);
} else { // mem <= reg
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0);
- STRxw_U12(gd, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0);
+ STxw(gd, ed, fixedaddress);
SMWRITELOCK(lock);
}
break;
@@ -976,9 +1165,9 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = wback;
}
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff, 0, rex, &lock, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 0);
SMREADLOCK(lock);
- LDRB_U12(x4, wback, fixedaddress);
+ LDB(x4, wback, fixedaddress);
ed = x4;
}
BFIx(gb1, ed, gb2*8, 8);
@@ -990,20 +1179,21 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) {
MOVxw_REG(gd, xRAX+(nextop&7)+(rex.b<<3));
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0);
SMREADLOCK(lock);
- LDRxw_U12(gd, ed, fixedaddress);
+ LDxw(gd, ed, fixedaddress);
}
break;
case 0x8C:
INST_NAME("MOV Ed, Seg");
nextop=F8;
+ u8 = (nextop&0x38)>>3;
if((nextop&0xC0)==0xC0) { // reg <= seg
- LDRH_U12(xRAX+(nextop&7)+(rex.b<<3), xEmu, offsetof(x64emu_t, segs[(nextop&0x38)>>3]));
+ LDRw_U12(xRAX+(nextop&7)+(rex.b<<3), xEmu, offsetof(x64emu_t, segs[u8]));
} else { // mem <= seg
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, NULL, 0, 0);
- LDRH_U12(x3, xEmu, offsetof(x64emu_t, segs[(nextop&0x38)>>3]));
- STRH_U12(x3, ed, fixedaddress);
+ LDRw_U12(x3, xEmu, offsetof(x64emu_t, segs[u8]));
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ STH(x3, wback, fixedaddress);
SMWRITE2();
}
break;
@@ -1014,11 +1204,11 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) { // reg <= reg? that's an invalid operation
DEFAULT;
} else { // mem <= reg
- addr = geted(dyn, addr, ninst, nextop, &ed, gd, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, gd, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(gd!=ed) { // it's sometimes used as a 3 bytes NOP
MOVxw_REG(gd, ed);
}
- else if(!rex.w) {
+ else if(!rex.w && !rex.is32bits) {
MOVw_REG(gd, gd); //truncate the higher 32bits as asked
}
}
@@ -1026,32 +1216,33 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0x8E:
INST_NAME("MOV Seg,Ew");
nextop = F8;
+ u8 = (nextop&0x38)>>3;
if((nextop&0xC0)==0xC0) {
ed = xRAX+(nextop&7)+(rex.b<<3);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 0, rex, NULL, 0, 0);
- LDRH_U12(x1, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ LDH(x1, wback, fixedaddress);
ed = x1;
}
- STRw_U12(ed, xEmu, offsetof(x64emu_t, segs[(nextop&0x38)>>3]));
- STRw_U12(wZR, xEmu, offsetof(x64emu_t, segs_serial[(nextop&0x38)>>3]));
+ STRw_U12(ed, xEmu, offsetof(x64emu_t, segs[u8]));
+ STRw_U12(wZR, xEmu, offsetof(x64emu_t, segs_serial[u8]));
break;
case 0x8F:
INST_NAME("POP Ed");
nextop = F8;
if(MODREG) {
- POP1(xRAX+(nextop&7)+(rex.b<<3));
+ POP1z(xRAX+(nextop&7)+(rex.b<<3));
} else {
- POP1(x2); // so this can handle POP [ESP] and maybe some variant too
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
+ POP1z(x2); // so this can handle POP [ESP] and maybe some variant too
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
if(ed==xRSP) {
- STRx_U12(x2, ed, fixedaddress);
+ STz(x2, ed, fixedaddress);
} else {
// complicated to just allow a segfault that can be recovered correctly
- SUBx_U12(xRSP, xRSP, 8);
- STRx_U12(x2, ed, fixedaddress);
- ADDx_U12(xRSP, xRSP, 8);
+ SUBz_U12(xRSP, xRSP, rex.is32bits?4:8);
+ STz(x2, ed, fixedaddress);
+ ADDz_U12(xRSP, xRSP, rex.is32bits?4:8);
}
}
break;
@@ -1093,26 +1284,33 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0x9C:
INST_NAME("PUSHF");
READFLAGS(X_ALL);
- PUSH1(xFlags);
+ PUSH1z(xFlags);
break;
case 0x9D:
INST_NAME("POPF");
SETFLAGS(X_ALL, SF_SET);
- POP1(xFlags);
+ POP1z(xFlags);
MOV32w(x1, 0x3F7FD7);
ANDw_REG(xFlags, xFlags, x1);
ORRw_mask(xFlags, xFlags, 0b011111, 0); //mask=0x00000002
SET_DFNONE(x1);
+ if(box64_wine) { // should this be done all the time?
+ TBZ_NEXT(xFlags, F_TF);
+ MOV64x(x1, addr);
+ STORE_XEMU_CALL(x1);
+ CALL(native_singlestep, -1);
+ BFCw(xFlags, F_TF, 1);
+ }
break;
case 0x9E:
INST_NAME("SAHF");
SETFLAGS(X_CF|X_PF|X_AF|X_ZF|X_SF, SF_SUBSET);
MOV32w(x2, 0b11010101);
BICw_REG(xFlags, xFlags, x2);
- UBFXx(x1, xRAX, 8, 8);
+ UBFXw(x1, xRAX, 8, 8);
ANDw_REG(x1, x1, x2);
ORRw_REG(xFlags, xFlags, x1);
- SET_DFNONE(x1);
+ SET_DFNONE(x1);
break;
case 0x9F:
INST_NAME("LAHF");
@@ -1121,28 +1319,42 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 0xA0:
INST_NAME("MOV AL,Ob");
- u64 = F64;
- MOV64x(x1, u64);
+ if(rex.is32bits)
+ u64 = F32;
+ else
+ u64 = F64;
+ MOV64z(x1, u64);
+ SMREAD();
LDRB_U12(x2, x1, 0);
BFIx(xRAX, x2, 0, 8);
break;
case 0xA1:
INST_NAME("MOV EAX,Od");
- u64 = F64;
- MOV64x(x1, u64);
+ if(rex.is32bits)
+ u64 = F32;
+ else
+ u64 = F64;
+ MOV64z(x1, u64);
+ SMREAD();
LDRxw_U12(xRAX, x1, 0);
break;
case 0xA2:
INST_NAME("MOV Ob,AL");
- u64 = F64;
- MOV64x(x1, u64);
+ if(rex.is32bits)
+ u64 = F32;
+ else
+ u64 = F64;
+ MOV64z(x1, u64);
STRB_U12(xRAX, x1, 0);
SMWRITE();
break;
case 0xA3:
INST_NAME("MOV Od,EAX");
- u64 = F64;
- MOV64x(x1, u64);
+ if(rex.is32bits)
+ u64 = F32;
+ else
+ u64 = F64;
+ MOV64z(x1, u64);
STRxw_U12(xRAX, x1, 0);
SMWRITE();
break;
@@ -1237,7 +1449,45 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
}
break;
-
+ case 0xA7:
+ switch(rep) {
+ case 1:
+ case 2:
+ if(rep==1) {INST_NAME("REPNZ CMPSD");} else {INST_NAME("REPZ CMPSD");}
+ MAYSETFLAGS();
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ CBZx_NEXT(xRCX);
+ TBNZ_MARK2(xFlags, F_DF);
+ MARK; // Part with DF==0
+ LDRxw_S9_postindex(x1, xRSI, rex.w?8:4);
+ LDRxw_S9_postindex(x2, xRDI, rex.w?8:4);
+ SUBx_U12(xRCX, xRCX, 1);
+ CMPSxw_REG(x1, x2);
+ B_MARK3((rep==1)?cEQ:cNE);
+ CBNZx_MARK(xRCX);
+ B_MARK3_nocond;
+ MARK2; // Part with DF==1
+ LDRxw_S9_postindex(x1, xRSI, rex.w?-8:-4);
+ LDRxw_S9_postindex(x2, xRDI, rex.w?-8:-4);
+ SUBx_U12(xRCX, xRCX, 1);
+ CMPSxw_REG(x1, x2);
+ B_MARK3((rep==1)?cEQ:cNE);
+ CBNZx_MARK2(xRCX);
+ MARK3; // end
+ emit_cmp32(dyn, ninst, rex, x1, x2, x3, x4, x5);
+ break;
+ default:
+ INST_NAME("CMPSD");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETDIR(x3, rex.w?8:4);
+ LDRxw_U12(x1, xRSI, 0);
+ LDRxw_U12(x2, xRDI, 0);
+ ADDx_REG(xRSI, xRSI, x3);
+ ADDx_REG(xRDI, xRDI, x3);
+ emit_cmp32(dyn, ninst, rex, x1, x2, x3, x4, x5);
+ break;
+ }
+ break;
case 0xA8:
INST_NAME("TEST AL, Ib");
SETFLAGS(X_ALL, SF_SET_PENDING);
@@ -1251,7 +1501,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
SETFLAGS(X_ALL, SF_SET_PENDING);
i64 = F32S;
MOV64xw(x2, i64);
- emit_test32(dyn, ninst, rex, xRAX, x2, x3, x4);
+ emit_test32(dyn, ninst, rex, xRAX, x2, x3, x4, x5);
break;
case 0xAA:
if(rep) {
@@ -1297,26 +1547,42 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ADDx_REG(xRDI, xRDI, x3);
}
break;
-
+ case 0xAC:
+ if(rep) {
+ INST_NAME("REP LODSB");
+ } else {
+ INST_NAME("LODSB");
+ }
+ GETDIR(x1, 1);
+ if(rep) {
+ CBZx_NEXT(xRCX);
+ MARK;
+ }
+ LDRB_U12(x2, xRSI, 0);
+ ADDx_REG(xRSI, xRSI, x1);
+ if(rep) {
+ SUBx_U12(xRCX, xRCX, 1);
+ CBNZx_MARK(xRCX);
+ }
+ BFIx(xRAX, x2, 0, 8);
+ break;
case 0xAD:
if(rep) {
INST_NAME("REP LODSD");
} else {
INST_NAME("LODSD");
}
- LDRxw_U12(xRAX, xRSI, 0);
- BFIw(x2, xFlags, F_DF, 1);
- if(rex.w) {
- MOV32w(x1, 8);
- } else {
- MOV32w(x1, 4);
- }
- EORxw_REG_LSL(x1, x1, x2, rex.w?63:31);
+ GETDIR(x1, rex.w?8:4);
if(rep) {
- MULxw(x1, x1, xRCX);
- EORw_REG(xRCX, xRCX, xRCX);
+ CBZx_NEXT(xRCX);
+ MARK;
}
+ LDRxw_U12(xRAX, xRSI, 0);
ADDx_REG(xRSI, xRSI, x1);
+ if(rep) {
+ SUBx_U12(xRCX, xRCX, 1);
+ CBNZx_MARK(xRCX);
+ }
break;
case 0xAE:
switch(rep) {
@@ -1355,7 +1621,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
}
break;
-
+
case 0xB0:
case 0xB1:
@@ -1585,7 +1851,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
BARRIER(BARRIER_FLOAT);
i32 = F16;
- retn_to_epilog(dyn, ninst, i32);
+ retn_to_epilog(dyn, ninst, rex, i32);
*need_epilog = 0;
*ok = 0;
break;
@@ -1593,10 +1859,10 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("RET");
// SETFLAGS(X_ALL, SF_SET); // Hack, set all flags (to an unknown state...)
if(box64_dynarec_safeflags) {
- READFLAGS(X_PEND); // so instead, force the defered flags, so it's not too slow, and flags are not lost
+ READFLAGS(X_PEND); // so instead, force the deferred flags, so it's not too slow, and flags are not lost
}
BARRIER(BARRIER_FLOAT);
- ret_to_epilog(dyn, ninst);
+ ret_to_epilog(dyn, ninst, rex);
*need_epilog = 0;
*ok = 0;
break;
@@ -1612,15 +1878,19 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
eb2 = (ed&4)>>2; // L or H
} else {
eb1 = xRAX+(nextop&7)+(rex.b<<3);
- eb2 = 0;
+ eb2 = 0;
}
MOV32w(x3, u8);
BFIx(eb1, x3, eb2*8, 8);
} else { // mem <= u8
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff, 0, rex, &lock, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 1);
u8 = F8;
- MOV32w(x3, u8);
- STRB_U12(x3, ed, fixedaddress);
+ if(u8) {
+ MOV32w(x3, u8);
+ ed = x3;
+ } else
+ ed = xZR;
+ STB(ed, wback, fixedaddress);
SMWRITELOCK(lock);
}
break;
@@ -1632,25 +1902,30 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
MOV64xw(ed, i64);
} else { // mem <= i32
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 4);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 4);
i64 = F32S;
- MOV64xw(x3, i64);
- STRxw_U12(x3, ed, fixedaddress);
+ if(i64) {
+ MOV64xw(x3, i64);
+ ed = x3;
+ } else
+ ed = xZR;
+ STxw(ed, wback, fixedaddress);
SMWRITELOCK(lock);
}
break;
case 0xC9:
INST_NAME("LEAVE");
- MOVx_REG(xRSP, xRBP);
- POP1(xRBP);
+ MOVz_REG(xRSP, xRBP);
+ POP1z(xRBP);
break;
case 0xCC:
SETFLAGS(X_ALL, SF_SET); // Hack, set all flags (to an unknown state...)
+ SKIPTEST(x1);
if(PK(0)=='S' && PK(1)=='C') {
addr+=2;
- BARRIER(BARRIER_FLOAT);
+ //BARRIER(BARRIER_FLOAT);
INST_NAME("Special Box64 instruction");
if((PK64(0)==0))
{
@@ -1667,6 +1942,9 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
x87_forget(dyn, ninst, x3, x4, 0);
sse_purge07cache(dyn, ninst, x3);
tmp = isSimpleWrapper(*(wrapper_t*)(addr));
+ if(isRetX87Wrapper(*(wrapper_t*)(addr)))
+ // return value will be on the stack, so the stack depth needs to be updated
+ x87_purgecache(dyn, ninst, 0, x3, x1, x4);
if((box64_log<2 && !cycle_log) && tmp) {
//GETIP(ip+3+8+8); // read the 0xCC
call_n(dyn, ninst, *(void**)(addr+8), tmp);
@@ -1705,6 +1983,45 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
#endif
}
break;
+ case 0xCD:
+ u8 = F8;
+ if(box64_wine && (u8==0x2D || u8==0x2C || u8==0x29)) {
+ INST_NAME("INT 29/2c/2d");
+ // lets do nothing
+ MESSAGE(LOG_INFO, "INT 29/2c/2d Windows interruption\n");
+ GETIP(ip);
+ STORE_XEMU_CALL(xRIP);
+ MOV32w(x1, u8);
+ CALL(native_int, -1);
+ LOAD_XEMU_CALL(xRIP);
+ } else if (u8==0x80) {
+ INST_NAME("32bits SYSCALL");
+ NOTEST(x1);
+ SMEND();
+ GETIP(addr);
+ STORE_XEMU_CALL(xRIP);
+ CALL_S(x86Syscall, -1);
+ LOAD_XEMU_CALL(xRIP);
+ TABLE64(x3, addr); // expected return address
+ CMPSx_REG(xRIP, x3);
+ B_MARK(cNE);
+ LDRw_U12(w1, xEmu, offsetof(x64emu_t, quit));
+ CBZw_NEXT(w1);
+ MARK;
+ LOAD_XEMU_REM();
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ } else {
+ INST_NAME("INT n");
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL(xRIP);
+ CALL(native_priv, -1);
+ LOAD_XEMU_CALL(xRIP);
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ }
+ break;
case 0xCF:
INST_NAME("IRET");
@@ -1892,7 +2209,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV64xw(x4, (rex.w?64:32));
SUBx_REG(x3, x4, x3);
GETED(0);
- if(!rex.w && MODREG) {MOVw_REG(ed, ed);}
+ if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);}
B_NEXT(cEQ);
RORxw_REG(ed, ed, x3);
WBACK;
@@ -1916,7 +2233,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f
}
GETED(0);
- if(!rex.w && MODREG) {MOVw_REG(ed, ed);}
+ if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);}
B_NEXT(cEQ);
RORxw_REG(ed, ed, x3);
WBACK;
@@ -1943,7 +2260,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f
}
GETEDW(x4, x1, 0);
- if(!rex.w && MODREG) {MOVw_REG(ed, ed);}
+ if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);}
B_NEXT(cEQ);
CALL_(rex.w?((void*)rcl64):((void*)rcl32), ed, x4);
WBACK;
@@ -1959,7 +2276,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f
}
GETEDW(x4, x1, 0);
- if(!rex.w && MODREG) {MOVw_REG(ed, ed);}
+ if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);}
B_NEXT(cEQ);
CALL_(rex.w?((void*)rcr64):((void*)rcr32), ed, x4);
WBACK;
@@ -1974,7 +2291,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f
}
GETED(0);
- if(!rex.w && MODREG) {MOVw_REG(ed, ed);}
+ if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);}
B_NEXT(cEQ);
emit_shl32(dyn, ninst, rex, ed, x3, x5, x4);
WBACK;
@@ -1988,7 +2305,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f
}
GETED(0);
- if(!rex.w && MODREG) {MOVw_REG(ed, ed);}
+ if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);}
B_NEXT(cEQ);
emit_shr32(dyn, ninst, rex, ed, x3, x5, x4);
WBACK;
@@ -2002,7 +2319,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f
}
GETED(0);
- if(!rex.w && MODREG) {MOVw_REG(ed, ed);}
+ if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);}
B_NEXT(cEQ);
UFLAG_OP12(ed, x3);
ASRxw_REG(ed, ed, x3);
@@ -2042,7 +2359,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
CHECK_CACHE()) { \
/* out of the block */ \
i32 = dyn->insts[ninst].epilog-(dyn->native_size); \
- if(Z) {CBNZx(xRCX, i32);} else {CBZx(xRCX, i32);}; \
+ if(Z) {CBNZz(xRCX, i32);} else {CBZz(xRCX, i32);}; \
if(dyn->insts[ninst].x64.jmp_insts==-1) { \
if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \
fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \
@@ -2055,28 +2372,28 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else { \
/* inside the block */ \
i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \
- if(Z) {CBZx(xRCX, i32);} else {CBNZx(xRCX, i32);}; \
+ if(Z) {CBZz(xRCX, i32);} else {CBNZz(xRCX, i32);}; \
}
case 0xE0:
INST_NAME("LOOPNZ");
READFLAGS(X_ZF);
i8 = F8S;
- SUBx_U12(xRCX, xRCX, 1);
- TBNZ_NEXT(xFlags, 1<<F_ZF);
+ SUBz_U12(xRCX, xRCX, 1);
+ TBNZ_NEXT(xFlags, F_ZF);
GO(0);
break;
case 0xE1:
INST_NAME("LOOPZ");
READFLAGS(X_ZF);
i8 = F8S;
- SUBx_U12(xRCX, xRCX, 1);
- TBZ_NEXT(xFlags, 1<<F_ZF);
+ SUBz_U12(xRCX, xRCX, 1);
+ TBZ_NEXT(xFlags, F_ZF);
GO(0);
break;
case 0xE2:
INST_NAME("LOOP");
i8 = F8S;
- SUBx_U12(xRCX, xRCX, 1);
+ SUBz_U12(xRCX, xRCX, 1);
GO(0);
break;
case 0xE3:
@@ -2095,9 +2412,9 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
#endif
}
#if STEP < 2
- if(isNativeCall(dyn, addr+i32, &dyn->insts[ninst].natcall, &dyn->insts[ninst].retn))
+ if(!rex.is32bits && isNativeCall(dyn, addr+i32, &dyn->insts[ninst].natcall, &dyn->insts[ninst].retn))
tmp = dyn->insts[ninst].pass2choice = 3;
- else
+ else
tmp = dyn->insts[ninst].pass2choice = 0;
#else
tmp = dyn->insts[ninst].pass2choice;
@@ -2105,7 +2422,6 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
switch(tmp) {
case 3:
SETFLAGS(X_ALL, SF_SET); // Hack to set flags to "dont'care" state
- BARRIER(BARRIER_FULL);
//BARRIER_NEXT(BARRIER_FULL);
if(dyn->last_ip && (addr-dyn->last_ip<0x1000)) {
ADDx_U12(x2, xRIP, addr-dyn->last_ip);
@@ -2114,12 +2430,16 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
PUSH1(x2);
MESSAGE(LOG_DUMP, "Native Call to %s (retn=%d)\n", GetNativeName(GetNativeFnc(dyn->insts[ninst].natcall-1)), dyn->insts[ninst].retn);
+ SKIPTEST(x1); // disable test as this hack dos 2 instructions for 1
// calling a native function
sse_purge07cache(dyn, ninst, x3);
- if((box64_log<2 && !cycle_log) && dyn->insts[ninst].natcall)
+ if((box64_log<2 && !cycle_log) && dyn->insts[ninst].natcall) {
tmp=isSimpleWrapper(*(wrapper_t*)(dyn->insts[ninst].natcall+2));
- else
+ } else
tmp=0;
+ if(dyn->insts[ninst].natcall && isRetX87Wrapper(*(wrapper_t*)(dyn->insts[ninst].natcall+2)))
+ // return value will be on the stack, so the stack depth needs to be updated
+ x87_purgecache(dyn, ninst, 0, x3, x1, x4);
if((box64_log<2 && !cycle_log) && dyn->insts[ninst].natcall && tmp) {
//GETIP(ip+3+8+8); // read the 0xCC
call_n(dyn, ninst, *(void**)(dyn->insts[ninst].natcall+2+8), tmp);
@@ -2165,8 +2485,12 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
*need_epilog = 0;
*ok = 0;
}
- TABLE64(x2, addr);
- PUSH1(x2);
+ if(rex.is32bits) {
+ MOV32w(x2, addr);
+ } else {
+ TABLE64(x2, addr);
+ }
+ PUSH1z(x2);
if(box64_dynarec_callret) {
// Push actual return address
if(addr < (dyn->start+dyn->isize)) {
@@ -2179,13 +2503,11 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
LDRx_U12(x4, x4, 0);
}
STPx_S7_preindex(x4, x2, xSP, -16);
+ } else {
+ *ok = 0;
+ *need_epilog = 0;
}
- if(addr+i32==0) { // self modifying code maybe? so use indirect address fetching
- TABLE64(x4, addr-4);
- LDRx_U12(x4, x4, 0);
- jump_to_next(dyn, 0, x4, ninst);
- } else
- jump_to_next(dyn, addr+i32, 0, ninst);
+ jump_to_next(dyn, addr+i32, 0, ninst);
break;
}
break;
@@ -2199,11 +2521,11 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("JMP Ib");
i32 = F8S;
}
- JUMP(addr+i32, 0);
+ JUMP((uintptr_t)getAlternate((void*)(addr+i32)), 0);
if(dyn->insts[ninst].x64.jmp_insts==-1) {
// out of the block
fpu_purgecache(dyn, ninst, 1, x1, x2, x3);
- jump_to_next(dyn, addr+i32, 0, ninst);
+ jump_to_next(dyn, (uintptr_t)getAlternate((void*)(addr+i32)), 0, ninst);
} else {
// inside the block
CacheTransform(dyn, ninst, CHECK_CACHE(), x1, x2, x3);
@@ -2218,10 +2540,36 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
*ok = 0;
break;
+ case 0xEC: /* IN AL, DX */
+ case 0xED: /* IN EAX, DX */
+ case 0xEE: /* OUT DX, AL */
+ case 0xEF: /* OUT DX, EAX */
+ INST_NAME(opcode==0xEC?"IN AL, DX":(opcode==0xED?"IN EAX, DX":(opcode==0xEE?"OUT DX? AL":"OUT DX, EAX")));
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL(xRIP);
+ CALL(native_priv, -1);
+ LOAD_XEMU_CALL(xRIP);
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+
case 0xF0:
addr = dynarec64_F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
break;
+ case 0xF4:
+ INST_NAME("HLT");
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL(xRIP);
+ CALL(native_priv, -1);
+ LOAD_XEMU_CALL(xRIP);
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
case 0xF5:
INST_NAME("CMC");
READFLAGS(X_CF);
@@ -2282,6 +2630,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 7:
INST_NAME("IDIV Eb");
+ SKIPTEST(x1);
MESSAGE(LOG_DUMP, "Need Optimization\n");
SETFLAGS(X_ALL, SF_SET);
GETEB(x1, 0);
@@ -2299,7 +2648,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
GETEDH(x1, 4);
i64 = F32S;
MOV64xw(x2, i64);
- emit_test32(dyn, ninst, rex, ed, x2, x3, x4);
+ emit_test32(dyn, ninst, rex, ed, x2, x3, x4, x5);
break;
case 2:
INST_NAME("NOT Ed");
@@ -2367,9 +2716,9 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVw_REG(xRAX, x2);
MOVw_REG(xRDX, x4);
} else {
- if(ninst
- && dyn->insts[ninst-1].x64.addr
- && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31
+ if(ninst
+ && dyn->insts[ninst-1].x64.addr
+ && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2) {
SET_DFNONE(x2);
GETED(0);
@@ -2392,6 +2741,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 7:
INST_NAME("IDIV Ed");
+ SKIPTEST(x1);
SETFLAGS(X_ALL, SF_SET);
if(!rex.w) {
SET_DFNONE(x2)
@@ -2404,7 +2754,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVw_REG(xRDX, x4);
} else {
if(ninst && dyn->insts
- && dyn->insts[ninst-1].x64.addr
+ && dyn->insts[ninst-1].x64.addr
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x48
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0x99) {
SET_DFNONE(x2)
@@ -2417,11 +2767,11 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
//Need to see if RDX==0 and RAX not signed
// or RDX==-1 and RAX signed
CBNZx_MARK2(xRDX);
- TBZ_MARK(xRAX, 31);
+ TBZ_MARK(xRAX, 63);
MARK2;
MVNx_REG(x2, xRDX);
CBNZx_MARK3(x2);
- TBNZ_MARK(xRAX, 31);
+ TBNZ_MARK(xRAX, 63);
MARK3;
if(ed!=x1) {MOVx_REG(x1, ed);}
CALL((void*)idiv64, -1);
@@ -2448,7 +2798,18 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
SET_DFNONE(x1);
ORRx_mask(xFlags, xFlags, 1, 0, 0); // xFlags | 1
break;
-
+ case 0xFA: /* STI */
+ case 0xFB: /* CLI */
+ INST_NAME(opcode==0xFA?"CLI":"STI");
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL(xRIP);
+ CALL(native_priv, -1);
+ LOAD_XEMU_CALL(xRIP);
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
case 0xFC:
INST_NAME("CLD");
BFCw(xFlags, F_DF, 1);
@@ -2498,7 +2859,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 2: // CALL Ed
INST_NAME("CALL Ed");
- PASS2IF((box64_dynarec_safeflags>1) ||
+ PASS2IF((box64_dynarec_safeflags>1) ||
((ninst && dyn->insts[ninst-1].x64.set_flags)
|| ((ninst>1) && dyn->insts[ninst-2].x64.set_flags)), 1)
{
@@ -2506,7 +2867,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
SETFLAGS(X_ALL, SF_SET); //Hack to put flag in "don't care" state
}
- GETEDx(0);
+ GETEDz(0);
if(box64_dynarec_callret && box64_dynarec_bigblock>1) {
BARRIER(BARRIER_FULL);
} else {
@@ -2528,22 +2889,41 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
STPx_S7_preindex(x4, xRIP, xSP, -16);
}
- PUSH1(xRIP);
+ PUSH1z(xRIP);
jump_to_next(dyn, 0, ed, ninst);
break;
case 4: // JMP Ed
INST_NAME("JMP Ed");
READFLAGS(X_PEND);
BARRIER(BARRIER_FLOAT);
- GETEDx(0);
+ GETEDz(0);
jump_to_next(dyn, 0, ed, ninst);
*need_epilog = 0;
*ok = 0;
break;
+ case 5: // JMP FAR Ed
+ if(MODREG) {
+ DEFAULT;
+ } else {
+ INST_NAME("JMP FAR Ed");
+ READFLAGS(X_PEND);
+ BARRIER(BARRIER_FLOAT);
+ SMREAD()
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0, 0, rex, NULL, 0, 0);
+ LDxw(x1, wback, 0);
+ ed = x1;
+ LDH(x3, wback, rex.w?8:4);
+ STW(x3, xEmu, offsetof(x64emu_t, segs[_CS]));
+ STW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_CS]));
+ jump_to_epilog(dyn, 0, ed, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ }
+ break;
case 6: // Push Ed
INST_NAME("PUSH Ed");
- GETEDx(0);
- PUSH1(ed);
+ GETEDz(0);
+ PUSH1z(ed);
break;
default:
@@ -2554,6 +2934,6 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
default:
DEFAULT;
}
-
+
return addr;
}
diff --git a/src/dynarec/arm64/dynarec_arm64_0f.c b/src/dynarec/arm64/dynarec_arm64_0f.c
index 8a51ab7..e4aa365 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_0f.c
+++ b/src/dynarec/arm64/dynarec_arm64_0f.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -31,8 +30,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint8_t opcode = F8;
uint8_t nextop, u8;
uint8_t gd, ed;
- uint8_t wback, wb2;
- uint8_t eb1, eb2;
+ uint8_t wback, wb1, wb2;
+ uint8_t eb1, eb2, gb1, gb2;
int32_t i32, i32_;
int cacheupd = 0;
int v0, v1;
@@ -42,9 +41,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint64_t tmp64u;
int64_t j64;
int64_t fixedaddress;
+ int unscaled;
+ MAYUSE(wb1);
MAYUSE(wb2);
MAYUSE(eb1);
MAYUSE(eb2);
+ MAYUSE(gb1);
+ MAYUSE(gb2);
MAYUSE(q0);
MAYUSE(q1);
MAYUSE(d0);
@@ -65,7 +68,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
GETIP(ip);
STORE_XEMU_CALL(xRIP);
- CALL(arm_ud, -1);
+ CALL(native_ud, -1);
LOAD_XEMU_CALL(xRIP);
jump_to_epilog(dyn, 0, xRIP, ninst);
*need_epilog = 0;
@@ -74,6 +77,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0x05:
INST_NAME("SYSCALL");
+ NOTEST(x1);
SMEND();
GETIP(addr);
STORE_XEMU_CALL(xRIP);
@@ -94,7 +98,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
GETIP(ip);
STORE_XEMU_CALL(xRIP);
- CALL(arm_ud, -1);
+ CALL(native_ud, -1);
LOAD_XEMU_CALL(xRIP);
jump_to_epilog(dyn, 0, xRIP, ninst);
*need_epilog = 0;
@@ -106,7 +110,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
GETIP(ip);
STORE_XEMU_CALL(xRIP);
- CALL(arm_ud, -1);
+ CALL(native_ud, -1);
LOAD_XEMU_CALL(xRIP);
jump_to_epilog(dyn, 0, xRIP, ninst);
*need_epilog = 0;
@@ -118,7 +122,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
switch((nextop>>3)&7) {
case 1:
INST_NAME("PREFETCHW");
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff, 7, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0);
PST_L1_STREAM_U12(ed, fixedaddress);
break;
default: //???
@@ -138,8 +142,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
v0 = sse_get_reg_empty(dyn, ninst, x1, gd);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VLDR128_U12(v0, ed, fixedaddress); // no alignment issue with ARMv8 NEON :)
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VLD128(v0, ed, fixedaddress); // no alignment issue with ARMv8 NEON :)
}
break;
case 0x11:
@@ -152,8 +156,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
v1 = sse_get_reg_empty(dyn, ninst, x1, ed);
VMOVQ(v1, v0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VSTR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VST128(v0, ed, fixedaddress);
SMWRITE2();
}
break;
@@ -168,7 +172,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("MOVLPS Gx,Ex");
GETGX(v0, 1);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VLD1_64(v0, 0, ed);
}
break;
@@ -180,7 +184,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1);
VMOVeD(v1, 0, v0, 0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VST1_64(v0, 0, ed); // better to use VST1 than VSTR_64, to avoid NEON->VFPU transfert I assume
SMWRITE2();
}
@@ -212,7 +216,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("MOVHPS Gx,Ex");
SMREAD();
GETGX(v0, 1);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VLD1_64(v0, 1, ed);
}
break;
@@ -224,7 +228,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1);
VMOVeD(v1, 0, v0, 1);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VST1_64(v0, 1, ed);
SMWRITE2();
}
@@ -237,22 +241,22 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
switch((nextop>>3)&7) {
case 0:
INST_NAME("PREFETCHh Ed");
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff, 7, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0);
PLD_L1_STREAM_U12(ed, fixedaddress);
break;
case 1:
INST_NAME("PREFETCHh Ed");
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff, 7, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0);
PLD_L1_KEEP_U12(ed, fixedaddress);
break;
case 2:
INST_NAME("PREFETCHh Ed");
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff, 7, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0);
PLD_L2_KEEP_U12(ed, fixedaddress);
break;
case 3:
INST_NAME("PREFETCHh Ed");
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff, 7, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0);
PLD_L3_KEEP_U12(ed, fixedaddress);
break;
default:
@@ -279,8 +283,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
v0 = sse_get_reg_empty(dyn, ninst, x1, gd);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VLDR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VLD128(v0, ed, fixedaddress);
}
break;
case 0x29:
@@ -293,8 +297,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
v1 = sse_get_reg_empty(dyn, ninst, x1, ed);
VMOVQ(v1, v0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VSTR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VST128(v0, ed, fixedaddress);
SMWRITE2();
}
break;
@@ -309,8 +313,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
v1 = sse_get_reg_empty(dyn, ninst, x1, ed);
VMOVQ(v1, v0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VSTR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VST128(v0, ed, fixedaddress);
}
break;
@@ -321,24 +325,18 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
SETFLAGS(X_ALL, SF_SET);
nextop = F8;
GETGX(v0, 0);
- if(MODREG) {
- s0 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 0);
- } else {
- s0 = fpu_get_scratch(dyn);
- SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(s0, ed, fixedaddress);
- }
+ GETEXSS(s0, 0, 0);
FCMPS(v0, s0);
FCOMI(x1, x2);
break;
case 0x31:
INST_NAME("RDTSC");
+ NOTEST(x1);
MESSAGE(LOG_DUMP, "Need Optimization\n");
- CALL(ReadTSC, xRAX); // will return the u64 in xEAX
- LSRx(xRDX, xRAX, 32);
- MOVw_REG(xRAX, xRAX); // wipe upper part
+ CALL(ReadTSC, x3); // will return the u64 in x3
+ LSRx(xRDX, x3, 32);
+ MOVw_REG(xRAX, x3); // wipe upper part
break;
case 0x38:
@@ -386,8 +384,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
REVxw(gd, xRAX+(nextop&7)+(rex.b<<3));
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
- LDRxw_U12(gd, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
+ LDxw(gd, ed, fixedaddress);
REVxw(gd, gd);
}
break;
@@ -398,9 +396,9 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) { // reg <= reg
REVxw(xRAX+(nextop&7)+(rex.b<<3), gd);
} else { // mem <= reg
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
REVxw(x1, gd);
- STRxw_U12(x1, ed, fixedaddress);
+ STxw(x1, ed, fixedaddress);
SMWRITE2();
}
break;
@@ -420,7 +418,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
GETEM(q1, 1);
u8 = F8;
if(u8>15) {
- VEOR(q0, q0, q0);
+ VEOR(q0, q0, q0);
} else if(u8>7) {
d0 = fpu_get_scratch(dyn);
VEOR(d0, d0, d0);
@@ -443,9 +441,9 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3); \
CSELxw(gd, ed, gd, YES); \
} else { \
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); \
Bcond(NO, +8); \
- LDRxw_U12(gd, ed, fixedaddress); \
+ LDxw(gd, ed, fixedaddress); \
if(!rex.w) {MOVw_REG(gd, gd);} \
}
@@ -472,7 +470,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
// EX is memory
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, (0xfff<<3)-8, 7, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, (0xfff<<3)-8, 7, rex, NULL, 0, 0);
LDRx_U12(x1, ed, fixedaddress+0);
LSRx(x1, x1, 31);
BFIx(gd, x1, 0, 1);
@@ -495,13 +493,14 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0x52:
INST_NAME("RSQRTPS Gx, Ex");
nextop = F8;
+ SKIPTEST(x1);
GETEX(q0, 0, 0);
GETGX_empty(q1);
v0 = fpu_get_scratch(dyn);
// more precise
if(q1==q0)
v1 = fpu_get_scratch(dyn);
- else
+ else
v1 = q1;
VFRSQRTEQS(v0, q0);
VFMULQS(v1, v0, q0);
@@ -511,6 +510,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0x53:
INST_NAME("RCPPS Gx, Ex");
nextop = F8;
+ SKIPTEST(x1);
GETEX(q0, 0, 0);
GETGX_empty(q1);
if(q0 == q1)
@@ -597,6 +597,15 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
nextop = F8;
GETGX(v0, 1);
GETEX(v1, 0, 0);
+ // FMIN/FMAX wll not copy the value if v0[x] is NaN
+ // but x86 will copy if either v0[x] or v1[x] is NaN, so lets force a copy if source is NaN
+ if(!box64_dynarec_fastnan && v0!=v1) {
+ q0 = fpu_get_scratch(dyn);
+ VFCMEQQS(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN
+ VANDQ(v0, v0, q0);
+ VBICQ(q0, v1, q0);
+ VORRQ(v0, v0, q0);
+ }
VFMINQS(v0, v0, v1);
break;
case 0x5E:
@@ -611,6 +620,15 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
nextop = F8;
GETGX(v0, 1);
GETEX(v1, 0, 0);
+ // FMIN/FMAX wll not copy the value if v0[x] is NaN
+ // but x86 will copy if either v0[x] or v1[x] is NaN, so lets force a copy if source is NaN
+ if(!box64_dynarec_fastnan && v0!=v1) {
+ q0 = fpu_get_scratch(dyn);
+ VFCMEQQS(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN
+ VANDQ(v0, v0, q0);
+ VBICQ(q0, v1, q0);
+ VORRQ(v0, v0, q0);
+ }
VFMAXQS(v0, v0, v1);
break;
case 0x60:
@@ -675,7 +693,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
v1 = mmx_get_reg(dyn, ninst, x1, x2, x3, (nextop&7));
VMOVeD(q0, 1, v1, 0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VLD1_64(q0, 1, ed);
}
SQXTUN_8(v0, q0);
@@ -711,7 +729,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
GETEM(v1, 0);
VMOVeD(q0, 1, v1, 0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VLD1_64(q0, 1, ed);
}
SQXTN_16(v0, q0);
@@ -731,12 +749,11 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
FMOVSw(v0, ed);
}
} else {
- v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
if(rex.w) {
- VLDR64_U12(v0, ed, fixedaddress);
+ VLD64(v0, ed, fixedaddress);
} else {
- VLDR32_U12(v0, ed, fixedaddress);
+ VLD32(v0, ed, fixedaddress);
}
}
break;
@@ -750,8 +767,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
VMOVeD(v0, 0, v1, 0);
} else {
v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v0, ed, fixedaddress);
}
break;
case 0x70:
@@ -818,7 +835,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
} else {
v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
u8 = F8;
if (u8) {
i32 = -1;
@@ -997,11 +1014,11 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVxw_REG(ed, ed);
}
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
if(rex.w) {
- VSTR64_U12(v0, ed, fixedaddress);
+ VST64(v0, ed, fixedaddress);
} else {
- VSTR32_U12(v0, ed, fixedaddress);
+ VST32(v0, ed, fixedaddress);
}
SMWRITE2();
}
@@ -1014,8 +1031,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
v1 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, nextop&7);
VMOV(v1, v0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VSTR64_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VST64(v0, ed, fixedaddress);
SMWRITE2();
}
break;
@@ -1065,16 +1082,17 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} \
BFIx(eb1, x3, eb2, 8); \
} else { \
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff, 0, rex, NULL, 0, 0); \
- STRB_U12(x3, ed, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 0); \
+ STB(x3, ed, fixedaddress); \
SMWRITE(); \
}
GOCOND(0x90, "SET", "Eb");
#undef GO
-
+
case 0xA2:
INST_NAME("CPUID");
+ NOTEST(x1);
MOVx_REG(x1, xRAX);
CALL_(my_cpuid, -1, 0);
break;
@@ -1088,10 +1106,10 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
- ASRxw(x1, gd, 5+rex.w); // r1 = (gd>>5)
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
+ ASRx(x1, gd, 5+rex.w); // r1 = (gd>>5)
ADDx_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4;
- LDRxw_U12(x1, x3, fixedaddress);
+ LDxw(x1, x3, fixedaddress);
ed = x1;
}
if(rex.w) {
@@ -1136,10 +1154,10 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wback = 0;
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
- ASRxw(x1, gd, 5+rex.w); // r1 = (gd>>5)
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
+ ASRx(x1, gd, 5+rex.w); // r1 = (gd>>5)
ADDx_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4;
- LDRxw_U12(x1, x3, fixedaddress);
+ LDxw(x1, x3, fixedaddress);
ed = x1;
wback = x3;
}
@@ -1209,7 +1227,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) {
DEFAULT;
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {MOVx_REG(x1, ed);}
CALL(rex.w?((void*)fpu_fxsave64):((void*)fpu_fxsave32), -1);
}
@@ -1221,12 +1239,12 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) {
DEFAULT;
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {MOVx_REG(x1, ed);}
CALL(rex.w?((void*)fpu_fxrstor64):((void*)fpu_fxrstor32), -1);
}
break;
- case 2:
+ case 2:
INST_NAME("LDMXCSR Md");
GETED(0);
STRw_U12(ed, xEmu, offsetof(x64emu_t, mxcsr));
@@ -1241,18 +1259,18 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 3:
INST_NAME("STMXCSR Md");
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
LDRw_U12(x4, xEmu, offsetof(x64emu_t, mxcsr));
- STRw_U12(x4, ed, fixedaddress);
+ STW(x4, ed, fixedaddress);
break;
case 7:
INST_NAME("CLFLUSH Ed");
MESSAGE(LOG_DUMP, "Need Optimization?\n");
- GETED(0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {
MOVx_REG(x1, ed);
}
- CALL_(arm_clflush, -1, 0);
+ CALL_(native_clflush, -1, 0);
break;
default:
DEFAULT;
@@ -1302,10 +1320,10 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wback = 0;
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
- ASRxw(x1, gd, 5+rex.w); // r1 = (gd>>5)
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
+ ASRx(x1, gd, 5+rex.w); // r1 = (gd>>5)
ADDx_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4;
- LDRxw_U12(x1, x3, fixedaddress);
+ LDxw(x1, x3, fixedaddress);
ed = x1;
wback = x3;
}
@@ -1316,15 +1334,14 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
LSRxw_REG(x4, ed, x2);
if(rex.w) {
- ANDSx_mask(x4, x4, 1, 0, 0); //mask=1
+ ANDx_mask(x4, x4, 1, 0, 0); //mask=1
} else {
- ANDSw_mask(x4, x4, 0, 0); //mask=1
+ ANDw_mask(x4, x4, 0, 0); //mask=1
}
BFIw(xFlags, x4, F_CF, 1);
MOV32w(x4, 1);
LSLxw_REG(x4, x4, x2);
- EORxw_REG(x4, ed, x4);
- CSELxw(ed, ed, x4, cEQ);
+ BICxw_REG(ed, ed, x4);
if(wback) {
STRxw_U12(ed, wback, fixedaddress);
SMWRITE();
@@ -1347,8 +1364,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
UBFXxw(gd, eb1, eb2*8, 8);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff, 0, rex, NULL, 0, 0);
- LDRB_U12(gd, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 0);
+ LDB(gd, ed, fixedaddress);
}
break;
case 0xB7:
@@ -1360,8 +1377,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
UBFXxw(gd, ed, 0, 16);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- LDRH_U12(gd, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ LDH(gd, ed, fixedaddress);
}
break;
@@ -1377,8 +1394,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 1);
- LDRxw_U12(x1, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 1);
+ LDxw(x1, wback, fixedaddress);
ed = x1;
}
u8 = F8;
@@ -1394,8 +1411,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wback = 0;
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 1);
- LDRxw_U12(x1, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 1);
+ LDxw(x1, wback, fixedaddress);
ed = x1;
}
u8 = F8;
@@ -1403,9 +1420,9 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0)
TBNZ_MARK3(xFlags, 0); // bit already set, jump to next instruction
MOV32w(x4, 1);
- EORxw_REG_LSL(ed, ed, x4, u8);
+ ORRxw_REG_LSL(ed, ed, x4, u8);
if(wback) {
- STRxw_U12(ed, wback, fixedaddress);
+ STxw(ed, wback, fixedaddress);
SMWRITE();
}
MARK3;
@@ -1419,8 +1436,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wback = 0;
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 1);
- LDRxw_U12(x1, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 1);
+ LDxw(x1, wback, fixedaddress);
ed = x1;
}
u8 = F8;
@@ -1428,9 +1445,9 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0)
TBZ_MARK3(xFlags, 0); // bit already clear, jump to next instruction
MOV32w(x4, 1);
- EORxw_REG_LSL(ed, ed, x4, u8);
+ BICxw_REG_LSL(ed, ed, x4, u8);
if(wback) {
- STRxw_U12(ed, wback, fixedaddress);
+ STxw(ed, wback, fixedaddress);
SMWRITE();
}
MARK3;
@@ -1444,8 +1461,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wback = 0;
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 1);
- LDRxw_U12(x1, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 1);
+ LDxw(x1, wback, fixedaddress);
ed = x1;
}
u8 = F8;
@@ -1454,7 +1471,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV32w(x4, 1);
EORxw_REG_LSL(ed, ed, x4, u8);
if(wback) {
- STRxw_U12(ed, wback, fixedaddress);
+ STxw(ed, wback, fixedaddress);
SMWRITE();
}
MARK3;
@@ -1474,10 +1491,10 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wback = 0;
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
- ASRxw(x1, gd, 5+rex.w); // r1 = (gd>>5)
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
+ ASRx(x1, gd, 5+rex.w); // r1 = (gd>>5)
ADDx_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4;
- LDRxw_U12(x1, x3, fixedaddress);
+ LDxw(x1, x3, fixedaddress);
ed = x1;
wback = x3;
}
@@ -1497,7 +1514,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
LSLxw_REG(x4, x4, x2);
EORxw_REG(ed, ed, x4);
if(wback) {
- STRxw_U12(ed, wback, fixedaddress);
+ STxw(ed, wback, fixedaddress);
SMWRITE();
}
break;
@@ -1548,8 +1565,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
SBFXxw(gd, wback, wb2, 8);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, 0xfff, 0, rex, NULL, 0, 0);
- LDRSBxw_U12(gd, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 0);
+ LDSBxw(gd, ed, fixedaddress);
}
break;
case 0xBF:
@@ -1561,11 +1578,33 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
SXTHxw(gd, ed);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- LDRSHxw_U12(gd, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ LDSHxw(gd, ed, fixedaddress);
}
break;
-
+ case 0xC0:
+ INST_NAME("XADD Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGB(x1);
+ GETEB(x2, 0);
+ gd = x2; ed = x1; // swap gd/ed
+ emit_add8(dyn, ninst, x1, x2, x4, x5);
+ GBBACK; // gb gets x2 (old ed)
+ EBBACK; // eb gets x1 (sum)
+ break;
+ case 0xC1:
+ INST_NAME("XADD Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ MOVxw_REG(x3, ed);
+ MOVxw_REG(ed, gd);
+ MOVxw_REG(gd, x3);
+ emit_add32(dyn, ninst, rex, ed, gd, x4, x5);
+ WBACK;
+ break;
case 0xC2:
INST_NAME("CMPPS Gx, Ex, Ib");
nextop = F8;
@@ -1577,21 +1616,21 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0: VFCMEQQS(v0, v0, v1); break; // Equal
case 1: VFCMGTQS(v0, v1, v0); break; // Less than
case 2: VFCMGEQS(v0, v1, v0); break; // Less or equal
- case 3: VFCMEQQS(v0, v0, v0);
+ case 3: VFCMEQQS(v0, v0, v0);
if(v0!=v1) {
- q0 = fpu_get_scratch(dyn);
- VFCMEQQS(q0, v1, v1);
+ q0 = fpu_get_scratch(dyn);
+ VFCMEQQS(q0, v1, v1);
VANDQ(v0, v0, q0);
}
- VMVNQ(v0, v0);
+ VMVNQ(v0, v0);
break; // NaN (NaN is not equal to himself)
case 4: VFCMEQQS(v0, v0, v1); VMVNQ(v0, v0); break; // Not Equal (or unordered on ARM, not on X86...)
case 5: VFCMGTQS(v0, v1, v0); VMVNQ(v0, v0); break; // Greater or equal or unordered
case 6: VFCMGEQS(v0, v1, v0); VMVNQ(v0, v0); break; // Greater or unordered
- case 7: VFCMEQQS(v0, v0, v0);
+ case 7: VFCMEQQS(v0, v0, v0);
if(v0!=v1) {
- q0 = fpu_get_scratch(dyn);
- VFCMEQQS(q0, v1, v1);
+ q0 = fpu_get_scratch(dyn);
+ VFCMEQQS(q0, v1, v1);
VANDQ(v0, v0, q0);
}
break; // not NaN
@@ -1604,8 +1643,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) { // reg <= reg
MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), gd);
} else { // mem <= reg
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
- STRxw_U12(gd, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0);
+ STxw(gd, ed, fixedaddress);
}
break;
case 0xC4:
@@ -1617,7 +1656,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
VMOVQHfrom(v0, u8, ed);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0, 0, rex, NULL, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
u8 = (F8)&3;
VLD1_16(v0, u8, wback);
}
@@ -1631,7 +1670,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
u8 = (F8)&3;
VMOVHto(gd, v0, u8);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0, 0, rex, NULL, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
u8 = (F8)&3;
LDRH_U12(gd, wback, u8*2);
}
@@ -1641,7 +1680,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
nextop = F8;
GETGX(v0, 1);
if(!MODREG) {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
v1 = -1; // to avoid a warning
} else
v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0);
@@ -1686,7 +1725,56 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
gd = xRAX+(opcode&7)+(rex.b<<3);
REVxw(gd, gd);
break;
-
+ case 0xD1:
+ INST_NAME("PSRLW Gm, Em");
+ nextop = F8;
+ GETGM(d0);
+ GETEM(d1, 0);
+ if(MODREG) {
+ q0 = fpu_get_scratch(dyn);
+ }
+ else {
+ q0 = d1;
+ }
+ q1 = fpu_get_scratch(dyn);
+ VMOVBto(x1, d1, 0);
+ MOVZw(x2, 16);
+ SUBSw_REG(x2, x2, x1);
+ B_MARK(cGT);
+ VMOVQDfrom(d0, 0, xZR);
+ B_NEXT_nocond;
+ MARK;
+ VDUPQS(q1, x2);
+ UXTL_16(q0, d0);
+ USHLQ_32(q0, q0, q1);
+ VUZP2Q_16(q0, q0, q0);
+ VMOVeD(d0, 0, q0, 0);
+ break;
+ case 0xD2:
+ INST_NAME("PSRLD Gm, Em");
+ nextop = F8;
+ GETGM(d0);
+ GETEM(d1, 0);
+ if(MODREG) {
+ q0 = fpu_get_scratch(dyn);
+ }
+ else {
+ q0 = d1;
+ }
+ q1 = fpu_get_scratch(dyn);
+ VMOVBto(x1, d1, 0);
+ MOVZw(x2, 32);
+ SUBSw_REG(x2, x2, x1);
+ B_MARK(cGT);
+ VMOVQDfrom(d0, 0, xZR);
+ B_NEXT_nocond;
+ MARK;
+ VDUPQD(q1, x2);
+ UXTL_32(q0, d0);
+ USHLQ_64(q0, q0, q1);
+ VUZP2Q_32(q0, q0, q0);
+ VMOVeD(d0, 0, q0, 0);
+ break;
case 0xD3:
INST_NAME("PSRLQ Gm,Em");
nextop = F8;
@@ -1699,7 +1787,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
NEG_64(q0, d1);
USHL_R_64(d0, d0, q0);
break;
-
+ case 0xD4:
+ INST_NAME("PADDQ Gm,Em");
+ nextop = F8;
+ GETGM(v0);
+ GETEM(q0, 0);
+ ADD_64(v0, v0, q0);
+ break;
case 0xD5:
INST_NAME("PMULLW Gm, Em");
nextop = F8;
@@ -1723,7 +1817,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
USHL_8(q1, q1, v0); // shift
UADDLV_8(q1, q1); // accumalte
VMOVBto(gd, q1, 0);
- break;
+ break;
case 0xD8:
INST_NAME("PSUBUSB Gm, Em");
nextop = F8;
@@ -1814,8 +1908,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
DEFAULT;
} else {
v0 = mmx_get_reg(dyn, ninst, x1, x2, x3, gd);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VSTR64_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VST64(v0, ed, fixedaddress);
}
break;
case 0xE8:
@@ -1832,7 +1926,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
GETEM(q0, 0);
SQSUB_16(v0, v0, q0);
break;
-
+ case 0xEA:
+ INST_NAME("PMINSW Gx,Ex");
+ nextop = F8;
+ GETGM(v0);
+ GETEM(q0, 0);
+ SMIN_16(v0, v0, q0);
+ break;
case 0xEB:
INST_NAME("POR Gm, Em");
nextop = F8;
@@ -1854,7 +1954,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
GETEM(d1, 0);
SQADD_16(d0, d0, d1);
break;
-
+ case 0xEE:
+ INST_NAME("PMAXSW Gx,Ex");
+ nextop = F8;
+ GETGM(v0);
+ GETEM(q0, 0);
+ SMAX_16(v0, v0, q0);
+ break;
case 0xEF:
INST_NAME("PXOR Gm,Em");
nextop = F8;
@@ -1881,7 +1987,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
SQXTN_32(v0, v0); // 2*q1 in 32bits now
SSHL_32(d0, d0, v0);
break;
-
+ case 0xF4:
+ INST_NAME("PMULUDQ Gx,Ex");
+ nextop = F8;
+ GETGX(v0, 1);
+ GETEX(v1, 0, 0);
+ VUMULL_32(v0, v0, v1);
+ break;
case 0xF5:
INST_NAME("PMADDWD Gm, Em");
nextop = F8;
@@ -1934,6 +2046,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
GETEM(v1, 0);
VADD_8(v0, v0, v1);
break;
+ case 0xFB:
+ INST_NAME("PSUBQ Gm, Em");
+ nextop = F8;
+ GETGM(v0);
+ GETEM(v1, 0);
+ SUB_64(v0, v0, v1);
+ break;
case 0xFD:
INST_NAME("PADDW Gm, Em");
nextop = F8;
diff --git a/src/dynarec/arm64/dynarec_arm64_64.c b/src/dynarec/arm64/dynarec_arm64_64.c
index c6dfb44..d88f3b6 100644
--- a/src/dynarec/arm64/dynarec_arm64_64.c
+++ b/src/dynarec/arm64/dynarec_arm64_64.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -23,8 +22,6 @@
#include "dynarec_arm64_helper.h"
#include "dynarec_arm64_functions.h"
-#define GETG gd = ((nextop&0x38)>>3)+(rex.r<<3)
-
uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog)
{
(void)ip; (void)rep; (void)need_epilog;
@@ -35,10 +32,12 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint8_t gd, ed, eb1, eb2, gb1, gb2;
uint8_t wback, wb1, wb2, wb;
int64_t i64, j64;
+ uint64_t u64;
int v0, v1;
int q0;
int d0;
int64_t fixedaddress;
+ int unscaled;
MAYUSE(eb1);
MAYUSE(eb2);
MAYUSE(wb1);
@@ -55,12 +54,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
rep = opcode-0xF1;
opcode = F8;
}
- // REX prefix before the F0 are ignored
- rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ GETREX();
switch(opcode) {
@@ -93,9 +87,9 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
grab_segdata(dyn, addr, ninst, x4, seg);
v0 = sse_get_reg_empty(dyn, ninst, x1, gd);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
ADDx_REG(x4, x4, ed);
- VLDR64_U12(v0, x4, fixedaddress); // upper part reseted
+ VLD64(v0, x4, fixedaddress); // upper part reseted
}
break;
case 2:
@@ -111,9 +105,9 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
grab_segdata(dyn, addr, ninst, x4, seg);
v0 = sse_get_reg_empty(dyn, ninst, x1, gd);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
ADDx_REG(x4, x4, ed);
- VLDR32_U12(v0, x4, fixedaddress);
+ VLD32(v0, x4, fixedaddress);
}
break;
default:
@@ -133,9 +127,9 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
VMOVQ(v1, v0);
} else {
grab_segdata(dyn, addr, ninst, x4, seg);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
ADDx_REG(x4, x4, ed);
- VSTR128_U12(v0, x4, fixedaddress);
+ VST128(v0, x4, fixedaddress);
SMWRITE2();
}
break;
@@ -150,9 +144,9 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
VMOVeD(d0, 0, v0, 0);
} else {
grab_segdata(dyn, addr, ninst, x4, seg);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
ADDx_REG(x4, x4, ed);
- VSTR64_U12(v0, x4, fixedaddress);
+ VST64(v0, x4, fixedaddress);
SMWRITE2();
}
break;
@@ -167,9 +161,9 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
VMOVeS(q0, 0, v0, 0);
} else {
grab_segdata(dyn, addr, ninst, x4, seg);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
ADDx_REG(x4, x4, ed);
- VSTR32_U12(v0, x4, fixedaddress);
+ VST32(v0, x4, fixedaddress);
SMWRITE2();
}
break;
@@ -191,9 +185,9 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
grab_segdata(dyn, addr, ninst, x4, seg);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
ADDx_REG(x4, x4, ed);
- VLDR128_U12(v0, ed, fixedaddress);
+ VLD128(v0, ed, fixedaddress);
}
break;
default:
@@ -260,7 +254,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
UBFXxw(gd, eb1, eb2*8, 8);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
LDRB_REG(gd, ed, x4);
}
break;
@@ -293,7 +287,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
GETEDO(x4, 0);
emit_xor32(dyn, ninst, rex, gd, ed, x3, x4);
break;
-
+
case 0x39:
INST_NAME("CMP Seg:Ed, Gd");
SETFLAGS(X_ALL, SF_SET_PENDING);
@@ -315,26 +309,31 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 0x63:
- INST_NAME("MOVSXD Gd, Ed");
- nextop = F8;
- GETGD;
- if(rex.w) {
- if(MODREG) { // reg <= reg
- SXTWx(gd, xRAX+(nextop&7)+(rex.b<<3));
- } else { // mem <= reg
- grab_segdata(dyn, addr, ninst, x4, seg);
- SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, NULL, 0, 0);
- LDRSW_REG(gd, ed, x4);
- }
+ if(rex.is32bits) {
+ // ARPL here
+ DEFAULT;
} else {
- if(MODREG) { // reg <= reg
- MOVw_REG(gd, xRAX+(nextop&7)+(rex.b<<3));
- } else { // mem <= reg
- grab_segdata(dyn, addr, ninst, x4, seg);
- SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, NULL, 0, 0);
- LDRw_REG(gd, ed, x4);
+ INST_NAME("MOVSXD Gd, Ed");
+ nextop = F8;
+ GETGD;
+ if(rex.w) {
+ if(MODREG) { // reg <= reg
+ SXTWx(gd, xRAX+(nextop&7)+(rex.b<<3));
+ } else { // mem <= reg
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
+ LDRSW_REG(gd, ed, x4);
+ }
+ } else {
+ if(MODREG) { // reg <= reg
+ MOVw_REG(gd, xRAX+(nextop&7)+(rex.b<<3));
+ } else { // mem <= reg
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
+ LDRw_REG(gd, ed, x4);
+ }
}
}
break;
@@ -535,7 +534,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
grab_segdata(dyn, addr, ninst, x4, seg);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
LDRB_REG(x4, wback, x4);
ed = x4;
}
@@ -549,7 +548,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) { // reg <= reg
MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), gd);
} else { // mem <= reg
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
STRxw_REG(gd, ed, x4);
SMWRITE2();
}
@@ -564,11 +563,71 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVxw_REG(gd, xRAX+(nextop&7)+(rex.b<<3));
} else { // mem <= reg
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
LDRxw_REG(gd, ed, x4);
}
break;
+ case 0x8D:
+ INST_NAME("LEA Gd, Ed");
+ nextop=F8;
+ GETGD;
+ if(MODREG) { // reg <= reg? that's an invalid operation
+ DEFAULT;
+ } else { // mem <= reg
+ addr = geted(dyn, addr, ninst, nextop, &ed, gd, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
+ if(gd!=ed) { // it's sometimes used as a 3 bytes NOP
+ MOVxw_REG(gd, ed);
+ }
+ else if(!rex.w && !rex.is32bits) {
+ MOVw_REG(gd, gd); //truncate the higher 32bits as asked
+ }
+ }
+ break;
+
+ case 0x8F:
+ INST_NAME("POP FS:Ed");
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ nextop = F8;
+ if(MODREG) {
+ POP1z(xRAX+(nextop&7)+(rex.b<<3));
+ } else {
+ POP1z(x2); // so this can handle POP [ESP] and maybe some variant too
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0, 0, rex, NULL, 0, 0);
+ if(ed==xRSP) {
+ STRz_REG(x2, ed, x4);
+ } else {
+ // complicated to just allow a segfault that can be recovered correctly
+ SUBz_U12(xRSP, xRSP, rex.is32bits?4:8);
+ STRz_REG(x2, ed, x4);
+ ADDz_U12(xRSP, xRSP, rex.is32bits?4:8);
+ }
+ }
+ break;
+
+ case 0xA1:
+ INST_NAME("MOV EAX,FS:Od");
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ if(rex.is32bits)
+ u64 = F32;
+ else
+ u64 = F64;
+ MOV64z(x1, u64);
+ LDRxw_REG(xRAX, x1, x4);
+ break;
+
+ case 0xA3:
+ INST_NAME("MOV FS:Od,EAX");
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ if(rex.is32bits)
+ u64 = F32;
+ else
+ u64 = F64;
+ MOV64z(x1, u64);
+ STRxw_REG(xRAX, x1, x4);
+ SMWRITE2();
+ break;
+
case 0xC6:
INST_NAME("MOV Seg:Eb, Ib");
grab_segdata(dyn, addr, ninst, x4, seg);
@@ -581,12 +640,12 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
eb2 = (ed&4)>>2; // L or H
} else {
eb1 = xRAX+(nextop&7)+(rex.b<<3);
- eb2 = 0;
+ eb2 = 0;
}
MOV32w(x3, u8);
BFIx(eb1, x3, eb2*8, 8);
} else { // mem <= u8
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
u8 = F8;
MOV32w(x3, u8);
STRB_REG(x3, ed, x4);
@@ -602,7 +661,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
MOV64xw(ed, i64);
} else { // mem <= i32
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, NULL, 0, 4);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 4);
i64 = F32S;
MOV64xw(x3, i64);
STRxw_REG(x3, ed, x4);
@@ -813,9 +872,10 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
}
break;
-
+
case 0xF7:
nextop = F8;
+ grab_segdata(dyn, addr, ninst, x6, seg);
switch((nextop>>3)&7) {
case 0:
case 1:
@@ -824,7 +884,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
GETEDO(x6, 4);
i64 = F32S;
MOV64xw(x2, i64);
- emit_test32(dyn, ninst, rex, ed, x2, x3, x4);
+ emit_test32(dyn, ninst, rex, ed, x2, x3, x4, x5);
break;
case 2:
INST_NAME("NOT Ed");
@@ -893,8 +953,8 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVw_REG(xRDX, x4);
} else {
if(ninst
- && dyn->insts[ninst-1].x64.addr
- && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31
+ && dyn->insts[ninst-1].x64.addr
+ && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2) {
SET_DFNONE(x2);
GETEDO(x6, 0);
@@ -917,6 +977,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 7:
INST_NAME("IDIV Ed");
+ NOTEST(x1);
SETFLAGS(X_ALL, SF_SET);
if(!rex.w) {
SET_DFNONE(x2)
@@ -929,7 +990,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVw_REG(xRDX, x4);
} else {
if(ninst && dyn->insts
- && dyn->insts[ninst-1].x64.addr
+ && dyn->insts[ninst-1].x64.addr
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x48
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0x99) {
SET_DFNONE(x2)
@@ -955,7 +1016,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
}
break;
-
+
case 0xFF:
nextop = F8;
grab_segdata(dyn, addr, ninst, x6, seg);
@@ -984,7 +1045,7 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
SETFLAGS(X_ALL, SF_SET); //Hack to put flag in "don't care" state
}
- GETEDOx(x6, 0);
+ GETEDOz(x6, 0);
if(box64_dynarec_callret && box64_dynarec_bigblock>1) {
BARRIER(BARRIER_FULL);
} else {
@@ -1006,22 +1067,22 @@ uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
STPx_S7_preindex(x4, xRIP, xSP, -16);
}
- PUSH1(xRIP);
+ PUSH1z(xRIP);
jump_to_next(dyn, 0, ed, ninst);
break;
case 4: // JMP Ed
INST_NAME("JMP Ed");
READFLAGS(X_PEND);
BARRIER(BARRIER_FLOAT);
- GETEDOx(x6, 0);
+ GETEDOz(x6, 0);
jump_to_next(dyn, 0, ed, ninst);
*need_epilog = 0;
*ok = 0;
break;
case 6: // Push Ed
INST_NAME("PUSH Ed");
- GETEDOx(x6, 0);
- PUSH1(ed);
+ GETEDOz(x6, 0);
+ PUSH1z(ed);
break;
default:
diff --git a/src/dynarec/arm64/dynarec_arm64_66.c b/src/dynarec/arm64/dynarec_arm64_66.c
index 951518b..f646a28 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_66.c
+++ b/src/dynarec/arm64/dynarec_arm64_66.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -35,6 +34,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint8_t gd, ed;
uint8_t wback, wb1;
int64_t fixedaddress;
+ int unscaled;
int lock;
MAYUSE(u8);
MAYUSE(u16);
@@ -49,14 +49,9 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
rep = opcode-0xF1;
opcode = F8;
}
- // REX prefix before the 66 are ignored
- rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ GETREX();
- if(rex.w && opcode!=0x0f) // rex.w cancels "66", but not for 66 0f type of prefix
+ if(rex.w && !(opcode==0x0f || opcode==0xf0 || opcode==0x64 || opcode==0x65)) // rex.w cancels "66", but not for 66 0f type of prefix
return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog); // addr-1, to "put back" opcode
switch(opcode) {
@@ -87,7 +82,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
emit_add16(dyn, ninst, x1, x2, x3, x4);
BFIx(xRAX, x1, 0, 16);
break;
-
+
case 0x09:
INST_NAME("OR Ew, Gw");
SETFLAGS(X_ALL, SF_SET_PENDING);
@@ -294,6 +289,113 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
break;
+ case 0x40:
+ case 0x41:
+ case 0x42:
+ case 0x43:
+ case 0x44:
+ case 0x45:
+ case 0x46:
+ case 0x47:
+ INST_NAME("INC Reg16 (32bits)");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ gd = xRAX + (opcode&7);
+ UXTHw(x1, gd);
+ emit_inc16(dyn, ninst, x1, x2, x3);
+ BFIw(gd, x1, 0, 16);
+ break;
+ case 0x48:
+ case 0x49:
+ case 0x4A:
+ case 0x4B:
+ case 0x4C:
+ case 0x4D:
+ case 0x4E:
+ case 0x4F:
+ INST_NAME("DEC Reg16 (32bits)");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ gd = xRAX + (opcode&7);
+ UXTHw(x1, gd);
+ emit_dec16(dyn, ninst, x1, x2, x3);
+ BFIw(gd, x1, 0, 16);
+ break;
+ case 0x50:
+ case 0x51:
+ case 0x52:
+ case 0x53:
+ case 0x54:
+ case 0x55:
+ case 0x56:
+ case 0x57:
+ if(rex.is32bits) {
+ INST_NAME("PUSH reg");
+ gd = xRAX+(opcode&0x07);
+ if (gd == xRSP) {
+ MOVw_REG(x1, xRSP);
+ PUSH1_16(x1);
+ } else {
+ PUSH1_16(gd);
+ }
+ } else {
+ DEFAULT;
+ }
+ break;
+ case 0x58:
+ case 0x59:
+ case 0x5A:
+ case 0x5B:
+ case 0x5C:
+ case 0x5D:
+ case 0x5E:
+ case 0x5F:
+ if(rex.is32bits) {
+ INST_NAME("POP reg");
+ gd = xRAX+(opcode&0x07);
+ POP1_16(x1);
+ BFIw(gd, x1, 0, 16);
+ } else {
+ DEFAULT;
+ }
+ break;
+ case 0x60:
+ if(rex.is32bits) {
+ INST_NAME("PUSHA 16bits (32bits)");
+ MOVw_REG(x1, xRSP);
+ PUSH1_16(xRAX);
+ PUSH1_16(xRCX);
+ PUSH1_16(xRDX);
+ PUSH1_16(xRBX);
+ PUSH1_16(x1);
+ PUSH1_16(xRBP);
+ PUSH1_16(xRSI);
+ PUSH1_16(xRDI);
+ } else {
+ DEFAULT;
+ }
+ break;
+ case 0x61:
+ if(rex.is32bits) {
+ INST_NAME("POPA 16bits (32bits)");
+ POP1_16(x1);
+ BFIw(xRDI, x1, 0, 16);
+ POP1_16(x1);
+ BFIw(xRSI, x1, 0, 16);
+ POP1_16(x1);
+ BFIw(xRBP, x1, 0, 16);
+ POP1_16(x1); // RSP ignored
+ POP1_16(x1);
+ BFIw(xRBX, x1, 0, 16);
+ POP1_16(x1);
+ BFIw(xRDX, x1, 0, 16);
+ POP1_16(x1);
+ BFIw(xRCX, x1, 0, 16);
+ POP1_16(x1);
+ BFIw(xRAX, x1, 0, 16);
+ } else {
+ DEFAULT;
+ }
+ break;
+
case 0x64:
addr = dynarec64_6664(dyn, addr, ip, ninst, rex, _FS, ok, need_epilog);
break;
@@ -424,7 +526,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
}
break;
-
+
case 0x85:
INST_NAME("TEST Ew, Gw");
SETFLAGS(X_ALL, SF_SET_PENDING);
@@ -445,7 +547,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
BFIx(ed, x1, 0, 16);
} else {
GETGD;
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
SMDMB();
TSTx_mask(ed, 1, 0, 0); // mask=1
B_MARK(cNE);
@@ -462,7 +564,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
BFIx(gd, x1, 0, 16);
}
break;
-
+
case 0x89:
INST_NAME("MOV Ew, Gw");
nextop = F8;
@@ -473,8 +575,8 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
BFIx(ed, gd, 0, 16);
}
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<1, 1, rex, &lock, 0, 0);
- STRH_U12(gd, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, &lock, 0, 0);
+ STH(gd, ed, fixedaddress);
SMWRITELOCK(lock);
}
break;
@@ -488,12 +590,25 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
BFIx(gd, ed, 0, 16);
}
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<1, 1, rex, &lock, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, &lock, 0, 0);
SMREADLOCK(lock);
- LDRH_U12(x1, ed, fixedaddress);
+ LDH(x1, ed, fixedaddress);
BFIx(gd, x1, 0, 16);
}
break;
+ case 0x8C:
+ INST_NAME("MOV EW, Seg");
+ nextop=F8;
+ u8 = (nextop&0x38)>>3;
+ LDRw_U12(x3, xEmu, offsetof(x64emu_t, segs[u8]));
+ if((nextop&0xC0)==0xC0) { // reg <= seg
+ UXTHw(xRAX+(nextop&7)+(rex.b<<3), x3);
+ } else { // mem <= seg
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ STH(x3, wback, fixedaddress);
+ SMWRITE2();
+ }
+ break;
case 0x90:
case 0x91:
@@ -517,21 +632,51 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0x98:
INST_NAME("CBW");
SXTBw(x1, xRAX);
- BFIw(xRAX, x1, 0, 16);
+ BFIx(xRAX, x1, 0, 16);
+ break;
+
+ case 0x9C:
+ INST_NAME("PUSHF");
+ READFLAGS(X_ALL);
+ PUSH1_16(xFlags);
+ break;
+ case 0x9D:
+ INST_NAME("POPF");
+ SETFLAGS(X_ALL, SF_SET);
+ POP1_16(x1); // probably not usefull...
+ BFIw(xFlags, x1, 0, 16);
+ MOV32w(x1, 0x3F7FD7);
+ ANDw_REG(xFlags, xFlags, x1);
+ ORRw_mask(xFlags, xFlags, 0b011111, 0); //mask=0x00000002
+ SET_DFNONE(x1);
+ if(box64_wine) { // should this be done all the time?
+ TBZ_NEXT(xFlags, F_TF);
+ MOV64x(x1, addr);
+ STORE_XEMU_CALL(x1);
+ CALL(native_singlestep, -1);
+ BFCw(xFlags, F_TF, 1);
+ }
break;
case 0xA1:
INST_NAME("MOV EAX,Od");
- u64 = F64;
- MOV64x(x1, u64);
+ if(rex.is32bits)
+ u64 = F32;
+ else
+ u64 = F64;
+ MOV64z(x1, u64);
+ SMREAD();
LDRH_U12(x2, x1, 0);
BFIx(xRAX, x2, 0, 16);
break;
case 0xA3:
INST_NAME("MOV Od,EAX");
- u64 = F64;
- MOV64x(x1, u64);
+ if(rex.is32bits)
+ u64 = F32;
+ else
+ u64 = F64;
+ MOV64z(x1, u64);
STRH_U12(xRAX, x1, 0);
SMWRITE();
break;
@@ -563,6 +708,46 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
break;
+ case 0xA7:
+ switch(rep) {
+ case 1:
+ case 2:
+ if(rep==1) {INST_NAME("REPNZ CMPSW");} else {INST_NAME("REPZ CMPSW");}
+ MAYSETFLAGS();
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ CBZx_NEXT(xRCX);
+ TBNZ_MARK2(xFlags, F_DF);
+ MARK; // Part with DF==0
+ LDRH_S9_postindex(x1, xRSI, 2);
+ LDRH_S9_postindex(x2, xRDI, 2);
+ SUBx_U12(xRCX, xRCX, 1);
+ CMPSw_REG(x1, x2);
+ B_MARK3((rep==1)?cEQ:cNE);
+ CBNZx_MARK(xRCX);
+ B_MARK3_nocond;
+ MARK2; // Part with DF==1
+ LDRH_S9_postindex(x1, xRSI, -2);
+ LDRH_S9_postindex(x2, xRDI, -2);
+ SUBx_U12(xRCX, xRCX, 1);
+ CMPSw_REG(x1, x2);
+ B_MARK3((rep==1)?cEQ:cNE);
+ CBNZx_MARK2(xRCX);
+ MARK3; // end
+ emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5);
+ break;
+ default:
+ INST_NAME("CMPSW");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETDIR(x3, 2);
+ LDRH_U12(x1, xRSI, 0);
+ LDRH_U12(x2, xRDI, 0);
+ ADDx_REG(xRSI, xRSI, x3);
+ ADDx_REG(xRDI, xRDI, x3);
+ emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5);
+ break;
+ }
+ break;
+
case 0xA9:
INST_NAME("TEST AX,Iw");
SETFLAGS(X_ALL, SF_SET_PENDING);
@@ -595,6 +780,70 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
break;
+ case 0xAD:
+ if(rep) {
+ INST_NAME("REP LODSW");
+ CBZx_NEXT(xRCX);
+ TBNZ_MARK2(xFlags, F_DF);
+ MARK; // Part with DF==0
+ LDRH_S9_postindex(x2, xRSI, 2);
+ SUBx_U12(xRCX, xRCX, 1);
+ CBNZx_MARK(xRCX);
+ B_MARK3_nocond;
+ MARK2; // Part with DF==1
+ LDRH_S9_postindex(x2, xRSI, -2);
+ SUBx_U12(xRCX, xRCX, 1);
+ CBNZx_MARK2(xRCX);
+ MARK3;
+ BFIx(xRAX, x2, 0, 16);
+ // done
+ } else {
+ INST_NAME("LODSW");
+ GETDIR(x3, 2);
+ LDRH_U12(x2, xRSI, 0);
+ ADDx_REG(xRSI, xRSI, x3);
+ BFIx(xRAX, x2, 0, 16);
+ }
+ break;
+
+ case 0xAF:
+ switch(rep) {
+ case 1:
+ case 2:
+ if(rep==1) {INST_NAME("REPNZ SCASW");} else {INST_NAME("REPZ SCASW");}
+ MAYSETFLAGS();
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ CBZx_NEXT(xRCX);
+ UXTHw(x1, xRAX);
+ TBNZ_MARK2(xFlags, F_DF);
+ MARK; // Part with DF==0
+ LDRH_S9_postindex(x2, xRDI, 2);
+ SUBx_U12(xRCX, xRCX, 1);
+ CMPSw_REG(x1, x2);
+ B_MARK3((rep==1)?cEQ:cNE);
+ CBNZx_MARK(xRCX);
+ B_MARK3_nocond;
+ MARK2; // Part with DF==1
+ LDRH_S9_postindex(x2, xRDI, -2);
+ SUBx_U12(xRCX, xRCX, 1);
+ CMPSw_REG(x1, x2);
+ B_MARK3((rep==1)?cEQ:cNE);
+ CBNZx_MARK2(xRCX);
+ MARK3; // end
+ emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5);
+ break;
+ default:
+ INST_NAME("SCASW");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETDIR(x3, 2);
+ UXTHw(x1, xRAX);
+ LDRH_U12(x2, xRDI, 0);
+ ADDx_REG(xRDI, xRDI, x3);
+ emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5);
+ break;
+ }
+ break;
+
case 0xB8:
case 0xB9:
case 0xBA:
@@ -707,10 +956,10 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV32w(x1, u16);
BFIx(ed, x1, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<1, 1, rex, &lock, 0, 2);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, &lock, 0, 2);
u16 = F16;
MOV32w(x1, u16);
- STRH_U12(x1, ed, fixedaddress);
+ STH(x1, ed, fixedaddress);
SMWRITELOCK(lock);
}
break;
@@ -821,7 +1070,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
}
break;
-
+
case 0xF0:
return dynarec64_66F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
@@ -885,6 +1134,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 7:
INST_NAME("IDIV Ew");
+ NOTEST(x1);
SETFLAGS(X_ALL, SF_SET);
GETSEW(x1, 0);
UXTHw(x2, xRAX);
@@ -896,7 +1146,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
}
break;
-
+
case 0xFF:
nextop = F8;
switch((nextop>>3)&7) {
@@ -914,10 +1164,21 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
emit_dec16(dyn, ninst, x1, x2, x4);
EWBACK;
break;
+ case 6: // Push Ew
+ if(rex.is32bits) {
+ INST_NAME("PUSH Ew");
+ GETEW(x1, 0);
+ PUSH1_16(ed);
+ } else {
+ DEFAULT;
+ }
+ break;
+
default:
DEFAULT;
}
break;
+
default:
DEFAULT;
}
diff --git a/src/dynarec/arm64/dynarec_arm64_660f.c b/src/dynarec/arm64/dynarec_arm64_660f.c
index 01cd736..9f30df5 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_660f.c
+++ b/src/dynarec/arm64/dynarec_arm64_660f.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -38,6 +37,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
int q0, q1;
int d0, d1;
int64_t fixedaddress;
+ int unscaled;
MAYUSE(d0);
MAYUSE(d1);
@@ -48,6 +48,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
MAYUSE(j64);
#if STEP > 1
static const int8_t mask_shift8[] = { -7, -6, -5, -4, -3, -2, -1, 0 };
+ static const int8_t round_round[] = { 0, 2, 1, 3};
#endif
switch(opcode) {
@@ -63,8 +64,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
SMREAD();
v0 = sse_get_reg_empty(dyn, ninst, x1, gd);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VLDR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VLD128(v0, ed, fixedaddress);
}
break;
case 0x11:
@@ -76,8 +77,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3));
VMOVQ(v1, v0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VSTR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VST128(v0, ed, fixedaddress);
SMWRITE2();
}
break;
@@ -91,7 +92,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
return addr;
}
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VLD1_64(v0, 0, ed);
break;
case 0x13:
@@ -103,7 +104,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
DEFAULT;
return addr;
}
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VST1_64(v0, 0, ed);
SMWRITE2();
break;
@@ -116,7 +117,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
VMOVeD(v0, 1, v1, 0);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VLD1_64(v0, 1, ed);
}
break;
@@ -130,7 +131,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
VMOVeD(v0, 1, v1, 1);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
v1 = fpu_get_scratch(dyn);
ADDx_U12(ed, ed, 8);
VLD1_64(v0, 1, ed);
@@ -146,7 +147,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
return addr;
}
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VLD1_64(v0, 1, ed);
break;
case 0x17:
@@ -158,7 +159,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
DEFAULT;
return addr;
}
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VST1_64(v0, 1, ed);
SMWRITE2();
break;
@@ -181,8 +182,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
SMREAD();
v0 = sse_get_reg_empty(dyn, ninst, x1, gd);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VLDR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VLD128(v0, ed, fixedaddress);
}
break;
case 0x29:
@@ -195,8 +196,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
v1 = sse_get_reg_empty(dyn, ninst, x1, ed);
VMOVQ(v1, v0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VSTR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VST128(v0, ed, fixedaddress);
SMWRITE2();
}
break;
@@ -208,7 +209,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
SETFLAGS(X_ALL, SF_SET);
nextop = F8;
GETGX(v0, 0);
- GETEX(q0, 0, 0);
+ GETEXSD(q0, 0, 0);
FCMPD(v0, q0);
FCOMI(x1, x2);
break;
@@ -260,6 +261,36 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
SQXTN2_16(q0, v0);
break;
+ case 0x05:
+ INST_NAME("PHSUBW Gx, Ex");
+ nextop = F8;
+ GETGX(q0, 1);
+ GETEX(q1, 0, 0);
+ v0 = fpu_get_scratch(dyn);
+ VUZP2Q_16(v0, q0, q1);
+ VUZP1Q_16(q0, q0, q1);
+ VSUBQ_16(q0, q0, v0);
+ break;
+ case 0x06:
+ INST_NAME("PHSUBD Gx, Ex");
+ nextop = F8;
+ GETGX(q0, 1);
+ GETEX(q1, 0, 0);
+ v0 = fpu_get_scratch(dyn);
+ VUZP2Q_32(v0, q0, q1);
+ VUZP1Q_32(q0, q0, q1);
+ VSUBQ_32(q0, q0, v0);
+ break;
+ case 0x07:
+ INST_NAME("PHSUBSW Gx, Ex");
+ nextop = F8;
+ GETGX(q0, 1);
+ GETEX(q1, 0, 0);
+ v0 = fpu_get_scratch(dyn);
+ VUZP2Q_16(v0, q0, q1);
+ VUZP1Q_16(q0, q0, q1);
+ SQSUBQ_16(q0, q0, v0);
+ break;
case 0x08:
INST_NAME("PSIGNB Gx, Ex");
nextop = F8;
@@ -328,6 +359,65 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
}
break;
+ case 0x14:
+ INST_NAME("PBLENDVPS Gx,Ex");
+ nextop = F8;
+ GETGX(q0, 1);
+ GETEX(q1, 0, 0);
+ v0 = sse_get_reg(dyn, ninst, x1, 0, 0);
+ v1 = fpu_get_scratch(dyn);
+ if(q0!=q1) {
+ VSSHRQ_32(v1, v0, 31); // bit[31]-> bit[31..0]
+ VBICQ(q0, q0, v1);
+ VANDQ(v1, q1, v1);
+ VORRQ(q0, q0, v1);
+ }
+ break;
+ case 0x15:
+ INST_NAME("PBLENDVPD Gx,Ex");
+ nextop = F8;
+ GETGX(q0, 1);
+ GETEX(q1, 0, 0);
+ v0 = sse_get_reg(dyn, ninst, x1, 0, 0);
+ v1 = fpu_get_scratch(dyn);
+ if(q0!=q1) {
+ VSSHRQ_64(v1, v0, 63); // bit[63]-> bit[63..0]
+ VBICQ(q0, q0, v1);
+ VANDQ(v1, q1, v1);
+ VORRQ(q0, q0, v1);
+ }
+ break;
+
+ case 0x17:
+ INST_NAME("PTEST Gx, Ex");
+ nextop = F8;
+ SETFLAGS(X_ALL, SF_SET);
+ GETGX(q0, 0);
+ GETEX(q1, 0, 0);
+ v1 = fpu_get_scratch(dyn);
+ IFX(X_ZF) {
+ VANDQ(v1, q1, q0);
+ CMEQQ_0_64(v1, v1);
+ UADDLVQ_32(v1, v1);
+ VMOVQDto(x1, v1, 0);
+ UBFXx(x1, x1, 33, 1); // bit33 will only be set if all bits are 1
+ BFIw(xFlags, x1, F_ZF, 1);
+ }
+ IFX(X_CF) {
+ VBICQ(v1, q1, q0);
+ CMEQQ_0_64(v1, v1);
+ UADDLVQ_32(v1, v1);
+ VMOVQDto(x1, v1, 0);
+ UBFXx(x1, x1, 33, 1);
+ BFIw(xFlags, x1, F_CF, 1);
+ }
+ IFX(X_PF|X_AF|X_OF|X_SF) {
+ MOV32w(x1, (1<<F_PF)|(1<<F_AF)|(1<<F_OF)|(1<<F_SF));
+ BICw_REG(xFlags, xFlags, x1);
+ }
+ SET_DFNONE(x1);
+ break;
+
case 0x1C:
INST_NAME("PABSB Gx,Ex");
nextop = F8;
@@ -397,6 +487,55 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
SXTL_32(q0, q1); // 32bits->64bits
break;
+ case 0x28:
+ INST_NAME("PMULDQ Gx, Ex");
+ nextop = F8;
+ GETEX(q1, 0, 0);
+ GETGX(q0, 1);
+ VUZP1Q_32(q0, q0, q0); // needs elem 0 and 2 in lower part
+ if(q0==q1) {
+ v0 = q0;
+ } else {
+ if(MODREG)
+ v0 = fpu_get_scratch(dyn);
+ else
+ v0 = q1;
+ VUZP1Q_32(v0, q1, q1);
+ }
+ VSMULL_32(q0, q0, v0);
+ break;
+ case 0x29:
+ INST_NAME("PCMPEQQ Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETEX(q1, 0, 0);
+ GETGX_empty(q0);
+ VCMEQQ_64(q0, q0, q1);
+ break;
+ case 0x2A:
+ INST_NAME("MOVNTDQA Gx, Ex");
+ nextop = F8;
+ GETEX(q1, 0, 0);
+ GETGX(q0, 1);
+ VMOVQ(q0, q1);
+ break;
+ case 0x2B:
+ INST_NAME("PACKUSDW Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETEX(q1, 0, 0);
+ GETGX(q0, 1);
+ v0 = fpu_get_scratch(dyn);
+ v1 = fpu_get_scratch(dyn);
+ VEORQ(v0, v0, v0);
+ SMAXQ_32(v1, v0, q0); // values < 0 => 0
+ UQXTN_16(q0, v1);
+ if(q0==q1) {
+ VMOVeD(q0, 1, q0, 0);
+ } else {
+ SMAXQ_32(v0, v0, q1);
+ UQXTN2_16(q0, v0);
+ }
+ break;
+
case 0x30:
INST_NAME("PMOVZXBW Gx, Ex"); // SSE4 opcode!
nextop = F8;
@@ -500,6 +639,13 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETGX(q0, 1);
UMAXQ_32(q0, q0, q1);
break;
+ case 0x40:
+ INST_NAME("PMULLD Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETEX(q1, 0, 0);
+ GETGX(q0, 1);
+ VMULQ_32(q0, q0, q1);
+ break;
case 0xDB:
INST_NAME("AESIMC Gx, Ex"); // AES-NI
@@ -516,7 +662,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
}
sse_forget_reg(dyn, ninst, gd);
MOV32w(x1, gd);
- CALL(arm_aesimc, -1);
+ CALL(native_aesimc, -1);
}
break;
case 0xDC:
@@ -534,7 +680,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETG;
sse_forget_reg(dyn, ninst, gd);
MOV32w(x1, gd);
- CALL(arm_aese, -1);
+ CALL(native_aese, -1);
GETGX(q0, 1);
GETEX(q1, 0, 0);
VEORQ(q0, q0, q1);
@@ -554,7 +700,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETG;
sse_forget_reg(dyn, ninst, gd);
MOV32w(x1, gd);
- CALL(arm_aeselast, -1);
+ CALL(native_aeselast, -1);
GETGX(q0, 1);
GETEX(q1, 0, 0);
VEORQ(q0, q0, q1);
@@ -575,7 +721,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETG;
sse_forget_reg(dyn, ninst, gd);
MOV32w(x1, gd);
- CALL(arm_aesd, -1);
+ CALL(native_aesd, -1);
GETGX(q0, 1);
GETEX(q1, 0, 0);
VEORQ(q0, q0, q1);
@@ -595,26 +741,102 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETG;
sse_forget_reg(dyn, ninst, gd);
MOV32w(x1, gd);
- CALL(arm_aesdlast, -1);
+ CALL(native_aesdlast, -1);
GETGX(q0, 1);
GETEX(q1, 0, 0);
VEORQ(q0, q0, q1);
}
break;
-
+ case 0xF0:
+ INST_NAME("MOVBE Gw, Ew");
+ nextop=F8;
+ gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3);
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ REV16x(x1, ed);
+ BFIx(gd, x1, 0, 16);
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0);
+ LDH(x1, ed, fixedaddress);
+ REV16x(x1, x1);
+ BFIx(gd, x1, 0, 16);
+ }
+ break;
+ case 0xF1:
+ INST_NAME("MOVBE Ew, Gw");
+ nextop=F8;
+ gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3);
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ REV16x(x1, gd);
+ BFIx(ed, x1, 0, 16);
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0);
+ REV16x(x1, gd);
+ STH(x1, ed, fixedaddress);
+ }
+ break;
default:
DEFAULT;
}
break;
- case 0x3A: // these are some more SSSE3 opcodes
+ case 0x3A: // these are some more SSSE3+ opcodes
opcode = F8;
switch(opcode) {
+ case 0x08:
+ INST_NAME("ROUNDPS Gx, Ex, Ib");
+ nextop = F8;
+ GETEX(q1, 0, 1);
+ GETGX_empty(q0);
+ u8 = F8;
+ v1 = fpu_get_scratch(dyn);
+ if(u8&4) {
+ u8 = sse_setround(dyn, ninst, x1, x2, x3);
+ VFRINTISQ(q0, q1);
+ x87_restoreround(dyn, ninst, u8);
+ } else {
+ VFRINTRSQ(q0, q1, round_round[u8&3]);
+ }
+ break;
+ case 0x09:
+ INST_NAME("ROUNDPD Gx, Ex, Ib");
+ nextop = F8;
+ GETEX(q1, 0, 1);
+ GETGX_empty(q0);
+ u8 = F8;
+ v1 = fpu_get_scratch(dyn);
+ if(u8&4) {
+ u8 = sse_setround(dyn, ninst, x1, x2, x3);
+ VFRINTIDQ(q0, q1);
+ x87_restoreround(dyn, ninst, u8);
+ } else {
+ VFRINTRDQ(q0, q1, round_round[u8&3]);
+ }
+ break;
+ case 0x0A:
+ INST_NAME("ROUNDSS Gx, Ex, Ib");
+ nextop = F8;
+ GETGX(q0, 1);
+ GETEXSS(q1, 0, 1);
+ u8 = F8;
+ v1 = fpu_get_scratch(dyn);
+ if(u8&4) {
+ u8 = sse_setround(dyn, ninst, x1, x2, x3);
+ FRINTXS(v1, q1);
+ x87_restoreround(dyn, ninst, u8);
+ } else {
+ FRINTRRS(v1, q1, round_round[u8&3]);
+ }
+ VMOVeS(q0, 0, v1, 0);
+ break;
case 0x0B:
INST_NAME("ROUNDSD Gx, Ex, Ib");
nextop = F8;
GETGX(q0, 1);
- GETEX(q1, 0, 1);
+ GETEXSD(q1, 0, 1);
u8 = F8;
v1 = fpu_get_scratch(dyn);
if(u8&4) {
@@ -622,13 +844,62 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
FRINTXD(v1, q1);
x87_restoreround(dyn, ninst, u8);
} else {
- const uint8_t rounds[] = {0, 2, 1, 3};
- MAYUSE(rounds);
- FRINTRRD(v1, q1, rounds[u8&3]);
+ FRINTRRD(v1, q1, round_round[u8&3]);
}
VMOVeD(q0, 0, v1, 0);
break;
+ case 0x0C:
+ INST_NAME("PBLENDPS Gx, Ex, Ib");
+ nextop = F8;
+ GETGX(q0, 1);
+ GETEX(q1, 0, 1);
+ u8 = F8&0b1111;
+ if(u8==0b0011) {
+ VMOVeD(q0, 0, q1, 0);
+ } else if(u8==0b1100) {
+ VMOVeD(q0, 1, q1, 1);
+ } else for(int i=0; i<4; ++i)
+ if(u8&(1<<i)) {
+ VMOVeS(q0, i, q1, i);
+ }
+ break;
+ case 0x0E:
+ INST_NAME("PBLENDW Gx, Ex, Ib");
+ nextop = F8;
+ GETGX(q0, 1);
+ GETEX(q1, 0, 1);
+ u8 = F8;
+ i32 = 0;
+ if(q0!=q1)
+ while(u8) {
+ if(u8&1) {
+ if(!(i32&1) && u8&2) {
+ if(!(i32&3) && (u8&0xf)==0xf) {
+ // whole 64bits
+ VMOVeD(q0, i32>>2, q1, i32>>2);
+ i32+=4;
+ u8>>=4;
+ } else {
+ // 32bits
+ VMOVeS(q0, i32>>1, q1, i32>>1);
+ i32+=2;
+ u8>>=2;
+ }
+ } else {
+ // 16 bits
+ VMOVeH(q0, i32, q1, i32);
+ i32++;
+ u8>>=1;
+ }
+ } else {
+ // nope
+ i32++;
+ u8>>=1;
+ }
+
+ }
+ break;
case 0x0F:
INST_NAME("PALIGNR Gx, Ex, Ib");
nextop = F8;
@@ -646,16 +917,57 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
}
break;
+ case 0x14:
+ INST_NAME("PEXTRB Ed, Gx, Ib");
+ nextop = F8;
+ GETGX(q0, 0);
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ u8 = F8;
+ VMOVBto(ed, q0, (u8&15));
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
+ u8 = F8;
+ VST1_8(q0, (u8&15), wback);
+ SMWRITE2();
+ }
+ break;
+ case 0x15:
+ INST_NAME("PEXTRW Ed, Gx, Ib");
+ nextop = F8;
+ GETGX(q0, 0);
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ u8 = F8;
+ VMOVHto(ed, q0, (u8&7));
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
+ u8 = F8;
+ VST1_16(q0, (u8&7), wback);
+ SMWRITE2();
+ }
+ break;
case 0x16:
if(rex.w) {INST_NAME("PEXTRQ Ed, Gx, Ib");} else {INST_NAME("PEXTRD Ed, Gx, Ib");}
nextop = F8;
GETGX(q0, 0);
- GETED(1);
- u8 = F8;
- if(rex.w) {
- VMOVQDto(ed, q0, (u8&1));
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ u8 = F8;
+ if(rex.w) {
+ VMOVQDto(ed, q0, (u8&1));
+ } else {
+ VMOVSto(ed, q0, (u8&3));
+ }
} else {
- VMOVSto(ed, q0, (u8&3));
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
+ u8 = F8;
+ if(rex.w) {
+ VST1_64(q0, (u8&1), wback);
+ } else {
+ VST1_32(q0, (u8&3), wback);
+ }
+ SMWRITE2();
}
break;
@@ -715,14 +1027,14 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
MOV32w(x3, 0); //p = NULL
} else {
MOV32w(x2, 0);
- addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, 0, 0, rex, NULL, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
if(ed!=x3) {
MOVx_REG(x3, ed);
}
}
u8 = F8;
MOV32w(x4, u8);
- CALL(arm_pclmul, -1);
+ CALL(native_pclmul, -1);
}
break;
@@ -739,14 +1051,14 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
MOV32w(x3, 0); //p = NULL
} else {
MOV32w(x2, 0);
- addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, 0, 0, rex, NULL, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
if(ed!=x3) {
MOVx_REG(x3, ed);
}
}
u8 = F8;
MOV32w(x4, u8);
- CALL(arm_aeskeygenassist, -1);
+ CALL(native_aeskeygenassist, -1);
break;
default:
@@ -763,8 +1075,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
ed = xRAX+(nextop&7)+(rex.b<<3); \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0); \
- LDRH_U12(x1, ed, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); \
+ LDH(x1, ed, fixedaddress); \
ed = x1; \
} \
Bcond(NO, +8); \
@@ -877,17 +1189,44 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
nextop = F8;
GETEX(v1, 0, 0);
GETGX_empty(v0);
- FCVTXN(v0, v1);
+ if(box64_dynarec_fastround) {
+ FCVTXN(v0, v1);
+ } else {
+ u8 = sse_setround(dyn, ninst, x1, x2, x3);
+ FCVTN(v0, v1);
+ x87_restoreround(dyn, ninst, u8);
+ }
break;
case 0x5B:
INST_NAME("CVTPS2DQ Gx, Ex");
nextop = F8;
GETEX(v1, 0, 0);
GETGX_empty(v0);
- u8 = sse_setround(dyn, ninst, x1, x2, x3);
- VFRINTISQ(v0, v1);
- x87_restoreround(dyn, ninst, u8);
- VFCVTZSQS(v0, v0);
+ if(box64_dynarec_fastround) {
+ u8 = sse_setround(dyn, ninst, x1, x2, x3);
+ VFRINTISQ(v0, v1);
+ x87_restoreround(dyn, ninst, u8);
+ VFCVTZSQS(v0, v0);
+ } else {
+ MRS_fpsr(x5);
+ BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ MSR_fpsr(x5);
+ u8 = sse_setround(dyn, ninst, x1, x2, x3);
+ MOV32w(x4, 0x80000000);
+ d0 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ MSR_fpsr(x5);
+ VMOVeS(d0, 0, v1, i);
+ FRINTIS(d0, d0);
+ VFCVTZSs(d0, d0);
+ MRS_fpsr(x5); // get back FPSR to check the IOC bit
+ TBZ(x5, FPSR_IOC, 4+4);
+ VMOVQSfrom(d0, 0, x4);
+ VMOVeS(v0, i, d0, 0);
+ }
+ x87_restoreround(dyn, ninst, u8);
+ }
break;
case 0x5C:
INST_NAME("SUBPD Gx, Ex");
@@ -912,9 +1251,18 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
case 0x5D:
INST_NAME("MINPD Gx, Ex");
nextop = F8;
- GETEX(q0, 0, 0);
GETGX(v0, 1);
- VFMINQD(v0, v0, q0);
+ GETEX(v1, 0, 0);
+ // FMIN/FMAX wll not copy the value if v0[x] is NaN
+ // but x86 will copy if either v0[x] or v1[x] is NaN, so lets force a copy if source is NaN
+ if(!box64_dynarec_fastnan && v0!=v1) {
+ q0 = fpu_get_scratch(dyn);
+ VFCMEQQD(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN
+ VANDQ(v0, v0, q0);
+ VBICQ(q0, v1, q0);
+ VORRQ(v0, v0, q0);
+ }
+ VFMINQD(v0, v0, v1);
break;
case 0x5E:
INST_NAME("DIVPD Gx, Ex");
@@ -939,9 +1287,18 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
case 0x5F:
INST_NAME("MAXPD Gx, Ex");
nextop = F8;
- GETEX(q0, 0, 0);
GETGX(v0, 1);
- VFMAXQD(v0, v0, q0);
+ GETEX(v1, 0, 0);
+ // FMIN/FMAX wll not copy the value if v0[x] is NaN
+ // but x86 will copy if either v0[x] or v1[x] is NaN, so lets force a copy if source is NaN
+ if(!box64_dynarec_fastnan && v0!=v1) {
+ q0 = fpu_get_scratch(dyn);
+ VFCMEQQD(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN
+ VANDQ(v0, v0, q0);
+ VBICQ(q0, v1, q0);
+ VORRQ(v0, v0, q0);
+ }
+ VFMAXQD(v0, v0, v1);
break;
case 0x60:
INST_NAME("PUNPCKLBW Gx,Ex");
@@ -1050,7 +1407,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0);
VMOVeD(v0, 1, v1, 0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VLD1_64(v0, 1, ed);
}
break;
@@ -1061,9 +1418,11 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
VMOVeD(v0, 0, v0, 1);
if(MODREG) {
v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0);
- VMOVeD(v0, 1, v1, 1);
+ if(v0!=v1) {
+ VMOVeD(v0, 1, v1, 1);
+ }
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
ADDSx_U12(x1, ed, 8);
VLD1_64(v0, 1, x1);
}
@@ -1090,8 +1449,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
GETGX_empty(v0);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VLDR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VLD128(v0, ed, fixedaddress);
}
break;
case 0x70:
@@ -1165,7 +1524,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
GETGX_empty(v0);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
u8 = F8;
if (u8) {
for (int i=0; i<4; ++i) {
@@ -1387,8 +1746,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
ed = xRAX + (nextop&7) + (rex.b<<3);
VMOVQDto(ed, v0, 0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VSTR64_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VST64(v0, ed, fixedaddress);
SMWRITE2();
}
} else {
@@ -1396,8 +1755,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
ed = xRAX + (nextop&7) + (rex.b<<3);
VMOVSto(ed, v0, 0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VSTR32_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VST32(v0, ed, fixedaddress);
SMWRITE2();
}
}
@@ -1410,8 +1769,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1);
VMOVQ(v1, v0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VSTR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VST128(v0, ed, fixedaddress);
SMWRITE2();
}
break;
@@ -1426,10 +1785,10 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
ed = xRAX+(nextop&7)+(rex.b<<3);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0);
- SBFXw(x1, gd, 4, 12); // r1 = (gw>>4)
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0);
+ SBFXx(x1, gd, 4, 12); // r1 = (gw>>4)
ADDx_REG_LSL(x3, wback, x1, 1); //(&ed)+=r1*2;
- LDRH_U12(x1, x3, fixedaddress);
+ LDH(x1, x3, fixedaddress);
ed = x1;
}
ANDw_mask(x2, gd, 0, 0b000011); // mask=0x0f
@@ -1467,10 +1826,11 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
ed = xRAX+(nextop&7)+(rex.b<<3);
wback = 0;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0);
- SBFXw(x4, gd, 4, 12); // r1 = (gw>>4)
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0);
+ SBFXx(x4, gd, 4, 12); // r1 = (gw>>4)
ADDx_REG_LSL(x3, wback, x4, 1); //(&ed)+=r1*2;
- LDRH_U12(x4, x3, fixedaddress);
+ LDH(x4, x3, fixedaddress);
+ wback = x3;
ed = x4;
}
ANDw_mask(x2, gd, 0, 0b000011); // mask=0x0f
@@ -1480,7 +1840,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
B_NEXT(cNE);
MOV32w(x1, 1);
LSLxw_REG(x1, x1, x2);
- EORx_REG(ed, ed, x1);
+ ORRx_REG(ed, ed, x1);
if(wback) {
STRH_U12(ed, wback, fixedaddress);
}
@@ -1529,10 +1889,10 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
wback = 0;
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0);
- SBFXw(x4, gd, 4, 12); // r1 = (gw>>4)
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0);
+ SBFXx(x4, gd, 4, 12); // r1 = (gw>>4)
ADDx_REG_LSL(x3, wback, x4, 1); //(&ed)+=r1*2;
- LDRH_U12(x4, x3, fixedaddress);
+ LDH(x4, x3, fixedaddress);
wback = x3;
ed = x4;
}
@@ -1543,9 +1903,9 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
B_NEXT(cEQ);
MOV32w(x1, 1);
LSLxw_REG(x1, x1, x2);
- EORx_REG(ed, ed, x1);
+ BICx_REG(ed, ed, x1);
if(wback) {
- STRH_U12(ed, wback, fixedaddress);
+ STH(ed, wback, fixedaddress);
SMWRITE();
}
break;
@@ -1565,8 +1925,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
UBFXxw(x1, eb1, eb2*8, 8);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff, 0, rex, NULL, 0, 0);
- LDRB_U12(x1, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 0);
+ LDB(x1, ed, fixedaddress);
}
gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); // GETGW
BFIx(gd, x1, 0, 16); // insert in Gw
@@ -1579,14 +1939,71 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
UBFXxw(x1, eb1, 0, 16);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff>>1, 1, rex, NULL, 0, 0);
- LDRH_U12(x1, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff>>1, 1, rex, NULL, 0, 0);
+ LDH(x1, ed, fixedaddress);
}
gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); // GETGW
BFIx(gd, x1, 0, 16); // insert in Gw
break;
+ case 0xBA:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 4:
+ INST_NAME("BT Ew, Ib");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE(x1);
+ gd = x2;
+ GETEW(x1, 1);
+ u8 = F8;
+ u8&=rex.w?0x3f:0x0f;
+ BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0)
+ break;
+ case 5:
+ INST_NAME("BTS Ew, Ib");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE(x1);
+ GETEW(x1, 1);
+ u8 = F8;
+ u8&=(rex.w?0x3f:0x0f);
+ BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0)
+ TBNZ_MARK3(xFlags, 0); // bit already set, jump to next instruction
+ MOV32w(x4, 1);
+ ORRxw_REG_LSL(ed, ed, x4, u8);
+ EWBACK(x1);
+ MARK3;
+ break;
+ case 6:
+ INST_NAME("BTR Ew, Ib");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE(x1);
+ GETEW(x1, 1);
+ u8 = F8;
+ u8&=(rex.w?0x3f:0x0f);
+ BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0)
+ TBZ_MARK3(xFlags, 0); // bit already clear, jump to next instruction
+ MOV32w(x4, 1);
+ BICxw_REG_LSL(ed, ed, x4, u8);
+ EWBACK(x1);
+ MARK3;
+ break;
+ case 7:
+ INST_NAME("BTC Ew, Ib");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE(x1);
+ GETEW(x1, 1);
+ u8 = F8;
+ u8&=(rex.w?0x3f:0x0f);
+ BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0)
+ MOV32w(x4, 1);
+ EORxw_REG_LSL(ed, ed, x4, u8);
+ EWBACK(x1);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
case 0xBB:
INST_NAME("BTC Ew, Gw");
SETFLAGS(X_CF, SF_SUBSET);
@@ -1598,10 +2015,10 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
wback = 0;
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0);
- SBFXw(x4, gd, 4, 12); // r1 = (gw>>4)
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0);
+ SBFXx(x4, gd, 4, 12); // r1 = (gw>>4)
ADDx_REG_LSL(x3, wback, x4, 1); //(&ed)+=r1*2;
- LDRH_U12(x4, x3, fixedaddress);
+ LDH(x4, x3, fixedaddress);
wback = x3;
ed = x4;
}
@@ -1628,7 +2045,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
B_MARK(cEQ);
RBITw(x1, x1); // reverse
CLZw(x2, x1); // x2 gets leading 0 == BSF
- BFIw(gd, x2, 0, 16);
+ BFIx(gd, x2, 0, 16);
MARK;
CSETw(x1, cEQ); //ZF not set
BFIw(xFlags, x1, F_ZF, 1);
@@ -1665,11 +2082,11 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
eb2 = (ed&4)>>2; // L or H
}
- SBFXw(x1, eb1, eb2, 8);
+ SBFXw(x1, eb1, eb2*8, 8);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff, 0, rex, NULL, 0, 0);
- LDRSBw_U12(x1, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 0);
+ LDSBw(x1, ed, fixedaddress);
}
BFIx(gd, x1, 0, 16);
break;
@@ -1716,7 +2133,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
VMOVQHfrom(v0, u8, ed);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0, 0, rex, NULL, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
u8 = (F8)&7;
VLD1_16(v0, u8, wback);
}
@@ -1731,7 +2148,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
VMOVHto(gd, v0, u8);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0, 0, rex, NULL, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1);
u8 = (F8)&7;
LDRH_U12(gd, wback, u8*2);
}
@@ -1781,8 +2198,12 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETGX(q0, 1);
GETEX(q1, 0, 0);
v0 = fpu_get_scratch(dyn);
- VDUPQ_16(v0, q1, 0);
- NEGQ_16(v0, v0); // neg, because SHR
+ v1 = fpu_get_scratch(dyn);
+ UQXTN_32(v0, q1);
+ MOVI_32(v1, 16);
+ UMIN_32(v0, v0, v1); // limit to 0 .. +16 values
+ NEG_32(v0, v0); // neg to do shr
+ VDUPQ_16(v0, v0, 0); // only the low 8bits will be used anyway
USHLQ_16(q0, q0, v0); // SHR x8
break;
case 0xD2:
@@ -1791,8 +2212,12 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETGX(q0, 1);
GETEX(q1, 0, 0);
v0 = fpu_get_scratch(dyn);
- VDUPQ_32(v0, q1, 0);
- NEGQ_32(v0, v0); // neg, because SHR
+ v1 = fpu_get_scratch(dyn);
+ UQXTN_32(v0, q1);
+ MOVI_32(v1, 32);
+ UMIN_32(v0, v0, v1); // limit to 0 .. +32 values
+ NEG_32(v0, v0); // neg to do shr
+ VDUPQ_16(v0, v0, 0); // only the low 8bits will be used anyway
USHLQ_32(q0, q0, v0); // SHR x4
break;
case 0xD3:
@@ -1801,8 +2226,12 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETGX(q0, 1);
GETEX(q1, 0, 0);
v0 = fpu_get_scratch(dyn);
- NEG_64(v0, q1);
- VMOVeD(v0, 1, v0, 0);
+ v1 = fpu_get_scratch(dyn);
+ UQXTN_32(v0, q1);
+ MOVI_32(v1, 64);
+ UMIN_32(v0, v0, v1); // limit to 0 .. +64 values
+ NEG_32(v0, v0); // neg to do shr
+ VDUPQ_16(v0, v0, 0); // only the low 8bits will be used anyway
USHLQ_64(q0, q0, v0);
break;
case 0xD4:
@@ -1827,8 +2256,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7) + (rex.b<<3));
FMOVD(v1, v0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VSTR64_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VST64(v0, ed, fixedaddress);
SMWRITE2();
}
break;
@@ -1926,13 +2355,12 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETGX(q0, 1);
GETEX(q1, 0, 0);
v0 = fpu_get_scratch(dyn);
- VMOVeD(v0, 0, q1, 0);
- VMOVeD(v0, 1, q1, 0);
- SQXTN_32(v0, v0); // 2*q1 in 32bits now
- NEG_32(v0, v0); // because we want SHR and not SHL
- VMOVeD(v0, 1, v0, 0);
- SQXTN_16(v0, v0); // 4*q1 in 32bits now
- VMOVeD(v0, 1, v0, 0);
+ v1 = fpu_get_scratch(dyn);
+ UQXTN_32(v0, q1);
+ MOVI_32(v1, 15);
+ UMIN_32(v0, v0, v1); // limit to -15 .. +15 values
+ NEG_32(v0, v0);
+ VDUPQ_16(v0, v0, 0); // only the low 8bits will be used anyway
SSHLQ_16(q0, q0, v0);
break;
case 0xE2:
@@ -1941,11 +2369,12 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETGX(q0, 1);
GETEX(q1, 0, 0);
v0 = fpu_get_scratch(dyn);
- VMOVeD(v0, 0, q1, 0);
- VMOVeD(v0, 1, q1, 0);
- SQXTN_32(v0, v0); // 2*q1 in 32bits now
- NEG_32(v0, v0); // because we want SHR and not SHL
- VMOVeD(v0, 1, v0, 0);
+ v1 = fpu_get_scratch(dyn);
+ UQXTN_32(v0, q1);
+ MOVI_32(v1, 31);
+ UMIN_32(v0, v0, v1); // limit to 0 .. +31 values
+ NEG_32(v0, v0);
+ VDUPQ_32(v0, v0, 0); // only the low 8bits will be used anyway
SSHLQ_32(q0, q0, v0);
break;
case 0xE3:
@@ -1984,8 +2413,31 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
nextop = F8;
GETEX(v1, 0, 0);
GETGX_empty(v0);
- VFCVTZSQD(v0, v1); // convert double -> int64
- SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part
+ if(box64_dynarec_fastround) {
+ VFCVTZSQD(v0, v1); // convert double -> int64
+ SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part
+ } else {
+ MRS_fpsr(x5);
+ BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ MSR_fpsr(x5);
+ ORRw_mask(x4, xZR, 1, 0); //0x80000000
+ d0 = fpu_get_scratch(dyn);
+ for(int i=0; i<2; ++i) {
+ BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ MSR_fpsr(x5);
+ if(i) {
+ VMOVeD(d0, 0, v1, i);
+ FCVTZSwD(x1, d0);
+ } else {
+ FCVTZSwD(x1, v1);
+ }
+ MRS_fpsr(x5); // get back FPSR to check the IOC bit
+ TBZ(x5, FPSR_IOC, 4+4);
+ MOVw_REG(x1, x4);
+ VMOVQSfrom(v0, i, x1);
+ }
+ VMOVQDfrom(v0, 1, xZR);
+ }
break;
case 0xE7:
INST_NAME("MOVNTDQ Ex, Gx");
@@ -1995,8 +2447,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3));
VMOVQ(v1, v0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VSTR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VST128(v0, ed, fixedaddress);
}
break;
case 0xE8:
@@ -2063,17 +2515,31 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
}
break;
+ case 0xF1:
+ INST_NAME("PSLLW Gx,Ex");
+ nextop = F8;
+ GETGX(q0, 1);
+ GETEX(q1, 0, 0);
+ v0 = fpu_get_scratch(dyn);
+ v1 = fpu_get_scratch(dyn);
+ UQXTN_32(v0, q1);
+ MOVI_32(v1, 16);
+ UMIN_32(v0, v0, v1); // limit to 0 .. +16 values
+ VDUPQ_16(v0, v0, 0); // only the low 8bits will be used anyway
+ USHLQ_16(q0, q0, v0);
+ break;
case 0xF2:
INST_NAME("PSLLD Gx,Ex");
nextop = F8;
GETGX(q0, 1);
GETEX(q1, 0, 0);
v0 = fpu_get_scratch(dyn);
- VMOVeD(v0, 0, q1, 0);
- VMOVeD(v0, 1, q1, 0);
- SQXTN_32(v0, v0); // 2*q1 in 32bits now
- VMOVeD(v0, 1, v0, 0);
- SSHLQ_32(q0, q0, v0);
+ v1 = fpu_get_scratch(dyn);
+ UQXTN_32(v0, q1);
+ MOVI_32(v1, 32);
+ UMIN_32(v0, v0, v1); // limit to 0 .. +32 values
+ VDUPQ_32(v0, v0, 0); // only the low 8bits will be used anyway
+ USHLQ_32(q0, q0, v0);
break;
case 0xF3:
INST_NAME("PSLLQ Gx,Ex");
@@ -2081,8 +2547,12 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
GETGX(q0, 1);
GETEX(q1, 0, 0);
v0 = fpu_get_scratch(dyn);
- VMOVQ(v0, q1);
- VMOVeD(v0, 1, v0, 0);
+ v0 = fpu_get_scratch(dyn);
+ v1 = fpu_get_scratch(dyn);
+ UQXTN_32(v0, q1);
+ MOVI_32(v1, 64);
+ UMIN_32(v0, v0, v1); // limit to 0 .. +64 values
+ VDUPQ_64(v0, v0, 0); // only the low 8bits will be used anyway
USHLQ_64(q0, q0, v0);
break;
case 0xF4:
@@ -2127,7 +2597,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
VMOVeD(q0, 1, d1, 0);
break;
case 0xF7:
- INST_NAME("MASKMOVDQU Gx, Ex")
+ INST_NAME("MASKMOVDQU Gx, Ex");
nextop = F8;
GETGX(q0, 1);
GETEX(q1, 0, 0);
diff --git a/src/dynarec/arm64/dynarec_arm64_6664.c b/src/dynarec/arm64/dynarec_arm64_6664.c
index 92abeac..0fe5947 100644
--- a/src/dynarec/arm64/dynarec_arm64_6664.c
+++ b/src/dynarec/arm64/dynarec_arm64_6664.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -22,8 +21,6 @@
#include "dynarec_arm64_helper.h"
#include "dynarec_arm64_functions.h"
-#define GETG gd = ((nextop&0x38)>>3)+(rex.r<<3)
-
uintptr_t dynarec64_6664(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog)
{
(void)ip; (void)need_epilog;
@@ -34,14 +31,10 @@ uintptr_t dynarec64_6664(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
int64_t j64;
int v0, v1;
int64_t fixedaddress;
+ int unscaled;
MAYUSE(j64);
- // REX prefix before the 66 are ignored
- rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ GETREX();
/*if(rex.w && opcode!=0x0f) { // rex.w cancels "66", but not for 66 0f type of prefix
MESSAGE(LOG_DUMP, "Here!\n");
@@ -66,8 +59,8 @@ uintptr_t dynarec64_6664(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
grab_segdata(dyn, addr, ninst, x4, seg);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
- v1 = fpu_get_scratch(dyn); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
+ v1 = fpu_get_scratch(dyn);
VLDR64_REG(v1, ed, x4);
}
FCMPD(v0, v1);
@@ -83,7 +76,7 @@ uintptr_t dynarec64_6664(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
FMOVD(v1, v0);
} else {
grab_segdata(dyn, addr, ninst, x4, seg);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
VSTR64_REG(v0, ed, x4);
SMWRITE();
}
@@ -109,7 +102,7 @@ uintptr_t dynarec64_6664(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
}
} else {
grab_segdata(dyn, addr, ninst, x4, seg);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(rex.w) {
STRx_REG(gd, ed, x4);
} else {
@@ -135,7 +128,7 @@ uintptr_t dynarec64_6664(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else { // mem <= reg
grab_segdata(dyn, addr, ninst, x4, seg);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(rex.w) {
LDRx_REG(gd, ed, x4);
} else {
diff --git a/src/dynarec/arm64/dynarec_arm64_66f0.c b/src/dynarec/arm64/dynarec_arm64_66f0.c
index 2a436ea..fe32cf9 100644
--- a/src/dynarec/arm64/dynarec_arm64_66f0.c
+++ b/src/dynarec/arm64/dynarec_arm64_66f0.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -34,6 +33,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
int32_t i32;
int64_t i64, j64;
int64_t fixedaddress;
+ int unscaled;
MAYUSE(gb1);
MAYUSE(gb2);
MAYUSE(wb1);
@@ -44,12 +44,8 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
rep = opcode-0xF1;
opcode = F8;
}
- // REX prefix before the F0/66 are ignored
- rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+
+ GETREX();
switch(opcode) {
case 0x09:
@@ -64,7 +60,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_or16(dyn, ninst, x6, x5, x3, x4);
BFIx(ed, x6, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRH(x1, wback);
emit_or16(dyn, ninst, x1, x5, x3, x4);
@@ -93,7 +89,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
B_MARK(cNE);
BFIx(ed, gd, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
TSTx_mask(wback, 1, 0, 0); // mask=1
B_MARK3(cNE);
// Aligned version
@@ -123,7 +119,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
BFIx(xRAX, x1, 0, 16);
SMDMB();
break;
-
+
case 0xC1:
INST_NAME("LOCK XADD Gw, Ew");
SETFLAGS(X_ALL, SF_SET_PENDING);
@@ -137,7 +133,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_add16(dyn, ninst, x5, gd, x3, x4);
BFIx(ed, x5, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRH(x1, wback);
ADDxw_REG(x4, x1, x5);
@@ -156,7 +152,28 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
DEFAULT;
}
break;
-
+ case 0x11:
+ INST_NAME("LOCK ADC Ew, Gw");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x5);
+ SMDMB();
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ UXTHw(x6, ed);
+ emit_adc16(dyn, ninst, x6, x5, x3, x4);
+ BFIx(ed, x6, 0, 16);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LDAXRH(x1, wback);
+ emit_adc16(dyn, ninst, x1, x5, x3, x4);
+ STLXRH(x3, x1, wback);
+ CBNZx_MARKLOCK(x3);
+ }
+ SMDMB();
+ break;
case 0x81:
case 0x83:
nextop = F8;
@@ -177,7 +194,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_add16(dyn, ninst, x6, x5, x3, x4);
BFIx(ed, x6, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
if(opcode==0x81) i32 = F16S; else i32 = F8S;
MOV32w(x5, i32);
TSTx_mask(wback, 1, 0, 0); // mask=1
@@ -188,7 +205,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
STLXRH(x3, x1, wback);
CBNZx_MARKLOCK(x3);
B_NEXT_nocond;
- MARK; // unaligned! also, not enough
+ MARK; // unaligned! also, not enough
LDRH_U12(x1, wback, 0);
LDAXRB(x4, wback);
BFIw(x1, x4, 0, 8); // re-inject
@@ -209,7 +226,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_or16(dyn, ninst, x6, x5, x3, x4);
BFIx(ed, x6, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
if(opcode==0x81) i32 = F16S; else i32 = F8S;
MOV32w(x5, i32);
MARKLOCK;
@@ -231,7 +248,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_adc16(dyn, ninst, x6, x5, x3, x4);
BFIx(ed, x6, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
if(opcode==0x81) i32 = F16S; else i32 = F8S;
MOV32w(x5, i32);
MARKLOCK;
@@ -253,7 +270,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_sbb16(dyn, ninst, x6, x5, x3, x4);
BFIx(ed, x6, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
if(opcode==0x81) i32 = F16S; else i32 = F8S;
MOV32w(x5, i32);
MARKLOCK;
@@ -274,7 +291,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_and16(dyn, ninst, x6, x5, x3, x4);
BFIx(ed, x6, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
if(opcode==0x81) i32 = F16S; else i32 = F8S;
MOV32w(x5, i32);
MARKLOCK;
@@ -295,7 +312,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_sub16(dyn, ninst, x6, x5, x3, x4);
BFIx(ed, x6, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
if(opcode==0x81) i32 = F16S; else i32 = F8S;
MOV32w(x5, i32);
TSTx_mask(wback, 1, 0, 0); // mask=1
@@ -306,7 +323,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
STLXRH(x3, x1, wback);
CBNZx_MARKLOCK(x3);
B_NEXT_nocond;
- MARK; // unaligned! also, not enough
+ MARK; // unaligned! also, not enough
LDRH_U12(x1, wback, 0);
LDAXRB(x4, wback);
BFIw(x1, x4, 0, 8); // re-inject
@@ -327,7 +344,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_xor16(dyn, ninst, x6, x5, x3, x4);
BFIx(ed, x6, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
if(opcode==0x81) i32 = F16S; else i32 = F8S;
MOV32w(x5, i32);
MARKLOCK;
@@ -369,7 +386,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_inc16(dyn, ninst, x6, x5, x3);
BFIx(ed, x6, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRH(x1, wback);
emit_inc16(dyn, ninst, x1, x3, x4);
@@ -388,7 +405,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
emit_dec16(dyn, ninst, x6, x5, x3);
BFIx(ed, x6, 0, 16);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRH(x1, wback);
emit_dec16(dyn, ninst, x1, x3, x4);
diff --git a/src/dynarec/arm64/dynarec_arm64_67.c b/src/dynarec/arm64/dynarec_arm64_67.c
index a68cc36..06e1e93 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_67.c
+++ b/src/dynarec/arm64/dynarec_arm64_67.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -22,14 +21,6 @@
#include "dynarec_arm64_helper.h"
#include "dynarec_arm64_functions.h"
-#define GETGX(a, w) \
- gd = ((nextop&0x38)>>3)+(rex.r<<3); \
- a = sse_get_reg(dyn, ninst, x1, gd, w)
-
-#define GETGM(a) \
- gd = ((nextop&0x38)>>3); \
- a = mmx_get_reg(dyn, ninst, x1, x2, x3, gd)
-
#define GETGm gd = ((nextop&0x38)>>3)
uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
@@ -38,8 +29,9 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint8_t opcode = F8;
uint8_t nextop;
- uint8_t gd, ed, wback, wb, wb1, wb2, gb1, gb2;
+ uint8_t gd, ed, wback, wb, wb1, wb2, gb1, gb2, eb1, eb2;
int64_t fixedaddress;
+ int unscaled;
int8_t i8;
uint8_t u8;
int32_t i32;
@@ -55,12 +47,14 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MAYUSE(lock);
MAYUSE(cacheupd);
- // REX prefix before the 67 are ignored
- rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
+ if(rex.is32bits) {
+ // should do a different file
+ DEFAULT;
+ return addr;
}
+
+ GETREX();
+
rep = 0;
while((opcode==0xF2) || (opcode==0xF3)) {
rep = opcode-0xF1;
@@ -172,6 +166,28 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
opcode=F8;
switch(opcode) {
+ case 0x11:
+ switch(rep) {
+ case 0:
+ INST_NAME("MOVUPS Ex,Gx");
+ nextop = F8;
+ GETG;
+ v0 = sse_get_reg(dyn, ninst, x1, gd, 0);
+ if(MODREG) {
+ ed = (nextop&7)+(rex.b<<3);
+ v1 = sse_get_reg_empty(dyn, ninst, x1, ed);
+ VMOVQ(v1, v0);
+ } else {
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VST128(v0, ed, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
case 0x2E:
// no special check...
case 0x2F:
@@ -186,8 +202,8 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
s0 = fpu_get_scratch(dyn);
SMREAD();
- addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(s0, ed, fixedaddress);
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(s0, ed, fixedaddress);
}
FCMPS(v0, s0);
FCOMI(x1, x2);
@@ -210,8 +226,22 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd);
SMREAD();
- addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v0, ed, fixedaddress);
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v0, ed, fixedaddress);
+ }
+ break;
+ case 2:
+ INST_NAME("MOVDQU Gx,Ex");
+ nextop = F8;
+ if(MODREG) {
+ v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0);
+ GETGX_empty(v0);
+ VMOVQ(v0, v1);
+ } else {
+ GETGX_empty(v0);
+ SMREAD();
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VLD128(v0, ed, fixedaddress);
}
break;
default:
@@ -229,8 +259,8 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
v1 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, nextop&7);
VMOV(v1, v0);
} else {
- addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VSTR64_U12(v0, ed, fixedaddress);
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VST64(v0, ed, fixedaddress);
SMWRITE();
}
break;
@@ -239,6 +269,40 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
break;
+ case 0xB6:
+ INST_NAME("MOVZX Gd, Eb");
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ if(rex.rex) {
+ eb1 = xRAX+(nextop&7)+(rex.b<<3);
+ eb2 = 0; \
+ } else {
+ ed = (nextop&7);
+ eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
+ eb2 = (ed&4)>>2; // L or H
+ }
+ UBFXxw(gd, eb1, eb2*8, 8);
+ } else {
+ SMREAD();
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 0);
+ LDB(gd, ed, fixedaddress);
+ }
+ break;
+ case 0xB7:
+ INST_NAME("MOVZX Gd, Ew");
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ UBFXxw(gd, ed, 0, 16);
+ } else {
+ SMREAD();
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ LDH(gd, ed, fixedaddress);
+ }
+ break;
+
default:
DEFAULT;
}
@@ -563,6 +627,54 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
emit_cmp32_0(dyn, ninst, rex, xRAX, x3, x4);
break;
+ case 0x63:
+ INST_NAME("MOVSXD Gd, Ed");
+ nextop = F8;
+ GETGD;
+ if(rex.w) {
+ if(MODREG) { // reg <= reg
+ SXTWx(gd, xRAX+(nextop&7)+(rex.b<<3));
+ } else { // mem <= reg
+ SMREAD();
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ LDSW(gd, ed, fixedaddress);
+ }
+ } else {
+ if(MODREG) { // reg <= reg
+ MOVw_REG(gd, xRAX+(nextop&7)+(rex.b<<3));
+ } else { // mem <= reg
+ SMREAD();
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ LDW(gd, ed, fixedaddress);
+ }
+ }
+ break;
+
+ case 0x66:
+ opcode=F8;
+ switch(opcode) {
+
+ case 0x89:
+ INST_NAME("MOV Ew, Gw");
+ nextop = F8;
+ GETGD; // don't need GETGW here
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ if(ed!=gd) {
+ BFIx(ed, gd, 0, 16);
+ }
+ } else {
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, &lock, 0, 0);
+ STH(gd, ed, fixedaddress);
+ SMWRITELOCK(lock);
+ }
+ break;
+
+ default:
+ DEFAULT;
+ }
+ break;
+
case 0x81:
case 0x83:
nextop = F8;
@@ -640,7 +752,40 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
}
break;
-
+
+ case 0x88:
+ INST_NAME("MOV Eb, Gb");
+ nextop = F8;
+ gd = ((nextop&0x38)>>3)+(rex.r<<3);
+ if(rex.rex) {
+ gb2 = 0;
+ gb1 = xRAX + gd;
+ } else {
+ gb2 = ((gd&4)>>2);
+ gb1 = xRAX+(gd&3);
+ }
+ if(gb2) {
+ gd = x4;
+ UBFXw(gd, gb1, gb2*8, 8);
+ } else {
+ gd = gb1; // no need to extract
+ }
+ if(MODREG) {
+ ed = (nextop&7) + (rex.b<<3);
+ if(rex.rex) {
+ eb1 = xRAX+ed;
+ eb2 = 0;
+ } else {
+ eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
+ eb2 = ((ed&4)>>2); // L or H
+ }
+ BFIx(eb1, gd, eb2*8, 8);
+ } else {
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 0);
+ STB(gd, ed, fixedaddress);
+ SMWRITELOCK(lock);
+ }
+ break;
case 0x89:
INST_NAME("MOV Ed, Gd");
nextop=F8;
@@ -648,8 +793,8 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) { // reg <= reg
MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), gd);
} else { // mem <= reg
- addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0);
- STRxw_U12(gd, ed, fixedaddress);
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0);
+ STxw(gd, ed, fixedaddress);
SMWRITELOCK(lock);
}
break;
@@ -661,9 +806,9 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) {
MOVxw_REG(gd, xRAX+(nextop&7)+(rex.b<<3));
} else {
- addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0);
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0);
SMREADLOCK(lock);
- LDRxw_U12(gd, ed, fixedaddress);
+ LDxw(gd, ed, fixedaddress);
}
break;
@@ -674,8 +819,7 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(MODREG) { // reg <= reg? that's an invalid operation
DEFAULT;
} else { // mem <= reg
- // should a geted32 be created, to use 32bits regs instead of 64bits?
- addr = geted32(dyn, addr, ninst, nextop, &ed, gd, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted32(dyn, addr, ninst, nextop, &ed, gd, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=gd) {
MOVw_REG(gd, ed);
}
@@ -763,10 +907,10 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
MOV64xw(ed, i64);
} else { // mem <= i32
- addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 4);
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 4);
i64 = F32S;
MOV64xw(x3, i64);
- STRxw_U12(x3, ed, fixedaddress);
+ STxw(x3, ed, fixedaddress);
SMWRITELOCK(lock);
}
break;
@@ -846,7 +990,7 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
GETED32H(x1, 4);
i64 = F32S;
MOV64xw(x2, i64);
- emit_test32(dyn, ninst, rex, ed, x2, x3, x4);
+ emit_test32(dyn, ninst, rex, ed, x2, x3, x4, x5);
break;
case 2:
INST_NAME("NOT Ed");
@@ -914,9 +1058,9 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVw_REG(xRAX, x2);
MOVw_REG(xRDX, x4);
} else {
- if(ninst && dyn->insts
- && dyn->insts[ninst-1].x64.addr
- && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31
+ if(ninst && dyn->insts
+ && dyn->insts[ninst-1].x64.addr
+ && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2) {
SET_DFNONE(x2);
GETED32(0);
@@ -939,6 +1083,7 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 7:
INST_NAME("IDIV Ed");
+ NOTEST(x1);
SETFLAGS(X_ALL, SF_SET);
if(!rex.w) {
SET_DFNONE(x2)
@@ -951,7 +1096,7 @@ uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVw_REG(xRDX, x4);
} else {
if(ninst && dyn->insts
- && dyn->insts[ninst-1].x64.addr
+ && dyn->insts[ninst-1].x64.addr
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x48
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0x99) {
SET_DFNONE(x2)
diff --git a/src/dynarec/arm64/dynarec_arm64_d8.c b/src/dynarec/arm64/dynarec_arm64_d8.c
index 6aef5a9..a363945 100644
--- a/src/dynarec/arm64/dynarec_arm64_d8.c
+++ b/src/dynarec/arm64/dynarec_arm64_d8.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -31,6 +30,7 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint8_t nextop = F8;
uint8_t ed;
int64_t fixedaddress;
+ int unscaled;
int v1, v2;
int s0;
@@ -185,8 +185,8 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FADD ST0, float[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
s0 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(s0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(s0, ed, fixedaddress);
if(ST_IS_F(0)) {
FADDS(v1, v1, s0);
} else {
@@ -198,8 +198,8 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FMUL ST0, float[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
s0 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(s0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(s0, ed, fixedaddress);
if(ST_IS_F(0)) {
FMULS(v1, v1, s0);
} else {
@@ -211,8 +211,8 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FCOM ST0, float[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
s0 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(s0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(s0, ed, fixedaddress);
if(ST_IS_F(0)) {
FCMPS(v1, s0);
} else {
@@ -225,8 +225,8 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FCOMP ST0, float[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
s0 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(s0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(s0, ed, fixedaddress);
if(ST_IS_F(0)) {
FCMPS(v1, s0);
} else {
@@ -240,8 +240,8 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FSUB ST0, float[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
s0 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(s0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(s0, ed, fixedaddress);
if(ST_IS_F(0)) {
FSUBS(v1, v1, s0);
} else {
@@ -253,8 +253,8 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FSUBR ST0, float[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
s0 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(s0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(s0, ed, fixedaddress);
if(ST_IS_F(0)) {
FSUBS(v1, s0, v1);
} else {
@@ -266,8 +266,8 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FDIV ST0, float[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
s0 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(s0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(s0, ed, fixedaddress);
if(ST_IS_F(0)) {
FDIVS(v1, v1, s0);
} else {
@@ -279,8 +279,8 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FDIVR ST0, float[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
s0 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(s0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(s0, ed, fixedaddress);
if(ST_IS_F(0)) {
FDIVS(v1, s0, v1);
} else {
diff --git a/src/dynarec/arm64/dynarec_arm64_d9.c b/src/dynarec/arm64/dynarec_arm64_d9.c
index 25587a9..fcb44d1 100644
--- a/src/dynarec/arm64/dynarec_arm64_d9.c
+++ b/src/dynarec/arm64/dynarec_arm64_d9.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -33,6 +32,7 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint8_t wback, wb1;
uint8_t u8;
int64_t fixedaddress;
+ int unscaled;
int v1, v2;
int s0;
int i1, i2, i3;
@@ -180,21 +180,21 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("F2XM1");
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_forget(dyn, ninst, x1, x2, 0);
- CALL(arm_f2xm1, -1);
+ CALL(native_f2xm1, -1);
break;
case 0xF1:
INST_NAME("FYL2X");
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_forget(dyn, ninst, x1, x2, 0);
x87_forget(dyn, ninst, x1, x2, 1);
- CALL(arm_fyl2x, -1);
+ CALL(native_fyl2x, -1);
x87_do_pop(dyn, ninst, x3);
break;
case 0xF2:
INST_NAME("FPTAN");
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_forget(dyn, ninst, x1, x2, 0);
- CALL(arm_ftan, -1);
+ CALL(native_ftan, -1);
v1 = x87_do_push(dyn, ninst, x1, NEON_CACHE_ST_F);
if(ST_IS_F(0)) {
FMOVS_8(v1, 0b01110000);
@@ -207,7 +207,7 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_forget(dyn, ninst, x1, x2, 0);
x87_forget(dyn, ninst, x1, x2, 1);
- CALL(arm_fpatan, -1);
+ CALL(native_fpatan, -1);
x87_do_pop(dyn, ninst, x3);
break;
case 0xF4:
@@ -215,14 +215,14 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_do_push_empty(dyn, ninst, 0);
x87_forget(dyn, ninst, x1, x2, 1);
- CALL(arm_fxtract, -1);
+ CALL(native_fxtract, -1);
break;
case 0xF5:
INST_NAME("FPREM1");
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_forget(dyn, ninst, x1, x2, 0);
x87_forget(dyn, ninst, x1, x2, 1);
- CALL(arm_fprem1, -1);
+ CALL(native_fprem1, -1);
break;
case 0xF6:
INST_NAME("FDECSTP");
@@ -245,14 +245,14 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_forget(dyn, ninst, x1, x2, 0);
x87_forget(dyn, ninst, x1, x2, 1);
- CALL(arm_fprem, -1);
+ CALL(native_fprem, -1);
break;
case 0xF9:
INST_NAME("FYL2XP1");
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_forget(dyn, ninst, x1, x2, 0);
x87_forget(dyn, ninst, x1, x2, 1);
- CALL(arm_fyl2xp1, -1);
+ CALL(native_fyl2xp1, -1);
x87_do_pop(dyn, ninst, x3);
break;
case 0xFA:
@@ -269,7 +269,7 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_do_push_empty(dyn, ninst, 0);
x87_forget(dyn, ninst, x1, x2, 1);
- CALL(arm_fsincos, -1);
+ CALL(native_fsincos, -1);
break;
case 0xFC:
INST_NAME("FRNDINT");
@@ -277,7 +277,7 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MESSAGE(LOG_DUMP, "Need Optimization\n");
// use C helper for now, nothing staightforward is available
x87_forget(dyn, ninst, x1, x2, 0);
- CALL(arm_frndint, -1);
+ CALL(native_frndint, -1);
#else
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
u8 = x87_setround(dyn, ninst, x1, x2, x3);
@@ -294,19 +294,19 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_forget(dyn, ninst, x1, x2, 0);
x87_forget(dyn, ninst, x1, x2, 1);
- CALL(arm_fscale, -1);
+ CALL(native_fscale, -1);
break;
case 0xFE:
INST_NAME("FSIN");
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_forget(dyn, ninst, x1, x2, 0);
- CALL(arm_fsin, -1);
+ CALL(native_fsin, -1);
break;
case 0xFF:
INST_NAME("FCOS");
MESSAGE(LOG_DUMP, "Need Optimization\n");
x87_forget(dyn, ninst, x1, x2, 0);
- CALL(arm_fcos, -1);
+ CALL(native_fcos, -1);
break;
@@ -328,8 +328,8 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0:
INST_NAME("FLD ST0, float[ED]");
v1 = x87_do_push(dyn, ninst, x1, box64_dynarec_x87double?NEON_CACHE_ST_D:NEON_CACHE_ST_F);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(v1, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(v1, ed, fixedaddress);
if(!ST_IS_F(0)) {
FCVT_D_S(v1, v1);
}
@@ -343,24 +343,24 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
s0 = fpu_get_scratch(dyn);
FCVT_S_D(s0, v1);
}
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VSTR32_U12(s0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VST32(s0, ed, fixedaddress);
break;
case 3:
INST_NAME("FSTP float[ED], ST0");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_F);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
if(!ST_IS_F(0)) {
FCVT_S_D(v1, v1);
}
- VSTR32_U12(v1, ed, fixedaddress);
+ VST32(v1, ed, fixedaddress);
x87_do_pop(dyn, ninst, x3);
break;
case 4:
INST_NAME("FLDENV Ed");
MESSAGE(LOG_DUMP, "Need Optimization\n");
fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE?
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {
MOVx_REG(x1, ed);
}
@@ -376,7 +376,7 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FNSTENV Ed");
MESSAGE(LOG_DUMP, "Need Optimization\n");
fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE?
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {
MOVx_REG(x1, ed);
}
@@ -385,7 +385,7 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 7:
INST_NAME("FNSTCW Ew");
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
ed = x1;
wb1 = 1;
LDRH_U12(x1, xEmu, offsetof(x64emu_t, cw));
diff --git a/src/dynarec/arm64/dynarec_arm64_db.c b/src/dynarec/arm64/dynarec_arm64_db.c
index 4533c83..8974351 100644
--- a/src/dynarec/arm64/dynarec_arm64_db.c
+++ b/src/dynarec/arm64/dynarec_arm64_db.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -33,6 +32,7 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint8_t wback;
uint8_t u8;
int64_t fixedaddress;
+ int unscaled;
int v1, v2;
int s0;
int64_t j64;
@@ -189,15 +189,15 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0:
INST_NAME("FILD ST0, Ed");
v1 = x87_do_push(dyn, ninst, x1, NEON_CACHE_ST_D);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(v1, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(v1, ed, fixedaddress);
SXTL_32(v1, v1); // i32 -> i64
SCVTFDD(v1, v1); // i64 -> double
break;
case 1:
INST_NAME("FISTTP Ed, ST0");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
s0 = fpu_get_scratch(dyn);
#if 0
ed = x1;
@@ -211,11 +211,11 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
FRINTZD(s0, v1);
VFCVTZSd(s0, s0);
SQXTN_S_D(s0, s0);
- VSTR32_U12(s0, wback, fixedaddress);
+ VST32(s0, wback, fixedaddress);
MRS_fpsr(x5); // get back FPSR to check the IOC bit
TBZ_MARK3(x5, FPSR_IOC);
MOV32w(x5, 0x80000000);
- STRw_U12(x5, wback, fixedaddress);
+ STW(x5, wback, fixedaddress);
MARK3;
#endif
x87_do_pop(dyn, ninst, x3);
@@ -224,7 +224,7 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FIST Ed, ST0");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
u8 = x87_setround(dyn, ninst, x1, x2, x4); // x1 have the modified RPSCR reg
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
s0 = fpu_get_scratch(dyn);
#if 0
ed = x1;
@@ -238,11 +238,11 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
FRINTXD(s0, v1);
VFCVTZSd(s0, s0);
SQXTN_S_D(s0, s0);
- VSTR32_U12(s0, wback, fixedaddress);
+ VST32(s0, wback, fixedaddress);
MRS_fpsr(x5); // get back FPSR to check the IOC bit
TBZ_MARK3(x5, FPSR_IOC);
MOV32w(x5, 0x80000000);
- STRw_U12(x5, wback, fixedaddress);
+ STW(x5, wback, fixedaddress);
MARK3;
#endif
x87_restoreround(dyn, ninst, u8);
@@ -251,7 +251,7 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FISTP Ed, ST0");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
u8 = x87_setround(dyn, ninst, x1, x2, x4); // x1 have the modified RPSCR reg
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
s0 = fpu_get_scratch(dyn);
#if 0
ed = x1;
@@ -265,11 +265,11 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
FRINTXD(s0, v1);
VFCVTZSd(s0, s0);
SQXTN_S_D(s0, s0);
- VSTR32_U12(s0, wback, fixedaddress);
+ VST32(s0, wback, fixedaddress);
MRS_fpsr(x5); // get back FPSR to check the IOC bit
TBZ_MARK3(x5, FPSR_IOC);
MOV32w(x5, 0x80000000);
- STRw_U12(x5, wback, fixedaddress);
+ STW(x5, wback, fixedaddress);
MARK3;
#endif
x87_restoreround(dyn, ninst, u8);
@@ -277,7 +277,7 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
break;
case 5:
INST_NAME("FLD tbyte");
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if((PK(0)==0xDB && ((PK(1)>>3)&7)==7) || (PK(0)>=0x40 && PK(0)<=0x4f && PK(1)==0xDB && ((PK(2)>>3)&7)==7)) {
// the FLD is immediatly followed by an FSTP
LDRx_U12(x5, ed, 0);
@@ -291,20 +291,19 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else
rex.rex = 0;
nextop = F8; //modrm
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
STRx_U12(x5, ed, 0);
STRH_U12(x6, ed, 8);
} else {
if(box64_x87_no80bits) {
v1 = x87_do_push(dyn, ninst, x1, NEON_CACHE_ST_D);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
VLDR64_U12(v1, ed, fixedaddress);
} else {
if(ed!=x1) {
MOVx_REG(x1, ed);
}
x87_do_push_empty(dyn, ninst, x3);
- CALL(arm_fld, -1);
+ CALL(native_fld, -1);
}
}
break;
@@ -312,20 +311,20 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FSTP tbyte");
if(box64_x87_no80bits) {
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VSTR64_U12(v1, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VST64(v1, wback, fixedaddress);
} else {
#if 0
x87_forget(dyn, ninst, x1, x3, 0);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {
MOVx_REG(x1, ed);
}
- CALL(arm_fstp, -1);
+ CALL(native_fstp, -1);
#else
// Painfully long, straight conversion from the C code, shoud be optimized
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
FMOVxD(x1, v1);
// do special value first
TSTx_mask(x1, 1, 0b00000, 0b111110); //0x7fffffffffffffffL
diff --git a/src/dynarec/arm64/dynarec_arm64_dc.c b/src/dynarec/arm64/dynarec_arm64_dc.c
index c729ed0..bd6c98d 100644
--- a/src/dynarec/arm64/dynarec_arm64_dc.c
+++ b/src/dynarec/arm64/dynarec_arm64_dc.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -31,6 +30,7 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint8_t nextop = F8;
uint8_t wback;
int64_t fixedaddress;
+ int unscaled;
int v1, v2;
MAYUSE(v2);
@@ -182,24 +182,24 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FADD ST0, double[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v2, wback, fixedaddress);
FADDD(v1, v1, v2);
break;
case 1:
INST_NAME("FMUL ST0, double[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v2, wback, fixedaddress);
FMULD(v1, v1, v2);
break;
case 2:
INST_NAME("FCOM ST0, double[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v2, wback, fixedaddress);
FCMPD(v1, v2);
FCOM(x1, x2, x3);
break;
@@ -207,8 +207,8 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FCOMP ST0, double[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v2, wback, fixedaddress);
FCMPD(v1, v2);
FCOM(x1, x2, x3);
x87_do_pop(dyn, ninst, x3);
@@ -217,32 +217,32 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FSUB ST0, double[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v2, wback, fixedaddress);
FSUBD(v1, v1, v2);
break;
case 5:
INST_NAME("FSUBR ST0, double[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v2, wback, fixedaddress);
FSUBD(v1, v2, v1);
break;
case 6:
INST_NAME("FDIV ST0, double[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v2, wback, fixedaddress);
FDIVD(v1, v1, v2);
break;
case 7:
INST_NAME("FDIVR ST0, double[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v2, wback, fixedaddress);
FDIVD(v1, v2, v1);
break;
}
diff --git a/src/dynarec/arm64/dynarec_arm64_dd.c b/src/dynarec/arm64/dynarec_arm64_dd.c
index dfb1750..b269791 100644
--- a/src/dynarec/arm64/dynarec_arm64_dd.c
+++ b/src/dynarec/arm64/dynarec_arm64_dd.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -31,6 +30,7 @@ uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint8_t nextop = F8;
uint8_t ed;
int64_t fixedaddress;
+ int unscaled;
int v1, v2;
int s0;
int64_t j64;
@@ -161,13 +161,13 @@ uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0:
INST_NAME("FLD double");
v1 = x87_do_push(dyn, ninst, x3, NEON_CACHE_ST_D);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v1, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v1, ed, fixedaddress);
break;
case 1:
INST_NAME("FISTTP i64, ST0");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
s0 = fpu_get_scratch(dyn);
#if 0
// those are ARM 8.5 opcode!
@@ -180,11 +180,11 @@ uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MSR_fpsr(x5);
FRINTRRD(s0, v1, 3);
FCVTZSxD(x2, s0);
- STRx_U12(x2, ed, fixedaddress);
+ STx(x2, ed, fixedaddress);
MRS_fpsr(x5); // get back FPSR to check the IOC bit
TBZ_MARK3(x5, FPSR_IOC);
ORRx_mask(x5, xZR, 1, 1, 0); //0x8000000000000000
- STRw_U12(x5, ed, fixedaddress);
+ STx(x5, ed, fixedaddress);
MARK3;
#endif
x87_do_pop(dyn, ninst, x3);
@@ -192,36 +192,36 @@ uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 2:
INST_NAME("FST double");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VSTR64_U12(v1, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VST64(v1, ed, fixedaddress);
break;
case 3:
INST_NAME("FSTP double");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VSTR64_U12(v1, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VST64(v1, ed, fixedaddress);
x87_do_pop(dyn, ninst, x3);
break;
case 4:
INST_NAME("FRSTOR m108byte");
MESSAGE(LOG_DUMP, "Need Optimization\n");
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {MOVx_REG(x1, ed);}
- CALL(arm_frstor, -1);
+ CALL(native_frstor, -1);
break;
case 6:
INST_NAME("FSAVE m108byte");
MESSAGE(LOG_DUMP, "Need Optimization\n");
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {MOVx_REG(x1, ed);}
- CALL(arm_fsave, -1);
+ CALL(native_fsave, -1);
break;
case 7:
INST_NAME("FNSTSW m2byte");
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
- addr = geted(dyn, addr, ninst, nextop, &ed, x4, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x4, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
LDRw_U12(x2, xEmu, offsetof(x64emu_t, top));
LDRH_U12(x3, xEmu, offsetof(x64emu_t, sw));
if(dyn->n.x87stack) {
@@ -234,7 +234,7 @@ uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ANDw_mask(x2, x2, 0, 2);
}
BFIw(x3, x2, 11, 3); // inject TOP at bit 11 (3 bits)
- STRH_U12(x3, ed, fixedaddress); // store whole sw flags
+ STH(x3, ed, fixedaddress); // store whole sw flags
break;
default:
DEFAULT;
diff --git a/src/dynarec/arm64/dynarec_arm64_de.c b/src/dynarec/arm64/dynarec_arm64_de.c
index ae7fccb..c045d23 100644
--- a/src/dynarec/arm64/dynarec_arm64_de.c
+++ b/src/dynarec/arm64/dynarec_arm64_de.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -31,6 +30,7 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
uint8_t nextop = F8;
uint8_t wback;
int64_t fixedaddress;
+ int unscaled;
int v1, v2;
MAYUSE(v2);
@@ -184,15 +184,16 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0xDD:
case 0xDE:
case 0xDF:
- return 0;
+ DEFAULT;
+ break;
default:
switch((nextop>>3)&7) {
case 0:
INST_NAME("FIADD ST0, word[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- VLDR16_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ VLD16(v2, wback, fixedaddress);
SXTL_16(v2, v2);
SXTL_32(v2, v2);
SCVTFDD(v2, v2);
@@ -202,8 +203,8 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FIMUL ST0, word[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- VLDR16_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ VLD16(v2, wback, fixedaddress);
SXTL_16(v2, v2);
SXTL_32(v2, v2);
SCVTFDD(v2, v2);
@@ -213,8 +214,8 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FICOM ST0, word[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- VLDR16_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ VLD16(v2, wback, fixedaddress);
SXTL_16(v2, v2);
SXTL_32(v2, v2);
SCVTFDD(v2, v2);
@@ -225,8 +226,8 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FICOMP ST0, word[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- VLDR16_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ VLD16(v2, wback, fixedaddress);
SXTL_16(v2, v2);
SXTL_32(v2, v2);
SCVTFDD(v2, v2);
@@ -238,8 +239,8 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FISUB ST0, word[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- VLDR16_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ VLD16(v2, wback, fixedaddress);
SXTL_16(v2, v2);
SXTL_32(v2, v2);
SCVTFDD(v2, v2);
@@ -249,8 +250,8 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FISUBR ST0, word[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- VLDR16_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ VLD16(v2, wback, fixedaddress);
SXTL_16(v2, v2);
SXTL_32(v2, v2);
SCVTFDD(v2, v2);
@@ -260,8 +261,8 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FIDIV ST0, word[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- VLDR16_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ VLD16(v2, wback, fixedaddress);
SXTL_16(v2, v2);
SXTL_32(v2, v2);
SCVTFDD(v2, v2);
@@ -271,8 +272,8 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FIDIVR ST0, word[ED]");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
v2 = fpu_get_scratch(dyn);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- VLDR16_U12(v2, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ VLD16(v2, wback, fixedaddress);
SXTL_16(v2, v2);
SXTL_32(v2, v2);
SCVTFDD(v2, v2);
diff --git a/src/dynarec/arm64/dynarec_arm64_df.c b/src/dynarec/arm64/dynarec_arm64_df.c
index 2cbcfe4..c1ae66a 100644
--- a/src/dynarec/arm64/dynarec_arm64_df.c
+++ b/src/dynarec/arm64/dynarec_arm64_df.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -34,6 +33,7 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
int s0;
int64_t j64;
int64_t fixedaddress;
+ int unscaled;
MAYUSE(s0);
MAYUSE(v2);
@@ -59,7 +59,8 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
LDRw_U12(x2, xEmu, offsetof(x64emu_t, top));
LDRH_U12(x1, xEmu, offsetof(x64emu_t, sw));
BFIw(x1, x2, 11, 3); // inject top
- BFIw(xRAX, x1, 0, 16);
+ STRH_U12(x1, xEmu, offsetof(x64emu_t, sw));
+ BFIx(xRAX, x1, 0, 16);
break;
case 0xE8:
case 0xE9:
@@ -151,8 +152,8 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 0:
INST_NAME("FILD ST0, Ew");
v1 = x87_do_push(dyn, ninst, x1, NEON_CACHE_ST_F);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
- LDRSHw_U12(x1, wback, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
+ LDSHw(x1, wback, fixedaddress);
if(ST_IS_F(0)) {
SCVTFSw(v1, x1);
} else {
@@ -162,7 +163,7 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 1:
INST_NAME("FISTTP Ew, ST0");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_F);
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
ed = x1;
s0 = fpu_get_scratch(dyn);
#if 0
@@ -172,10 +173,11 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
VFCVTZSd(s0, s0);
SQXTN_S_D(s0, s0);
SQXTN_H_S(s0, s0);
- VSTR16_U12(s0, wback, fixedaddress);
+ VST16(s0, wback, fixedaddress);
#else
MRS_fpsr(x5);
BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ BFCw(x5, FPSR_QC, 1); // reset QC bit
MSR_fpsr(x5);
if(ST_IS_F(0)) {
VFCVTZSs(s0, v1);
@@ -183,13 +185,16 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
VFCVTZSd(s0, v1);
SQXTN_S_D(s0, s0);
}
- SQXTN_H_S(s0, s0);
- VSTR16_U12(s0, wback, fixedaddress);
+ VMOVSto(x3, s0, 0);
MRS_fpsr(x5); // get back FPSR to check the IOC bit
- TBZ_MARK3(x5, FPSR_IOC);
- MOV32w(x5, 0x8000);
- STRH_U12(x5, wback, fixedaddress);
+ TBNZ_MARK2(x5, FPSR_IOC);
+ SXTHw(x5, x3); // check if 16bits value is fine
+ SUBw_REG(x5, x5, x3);
+ CBZw_MARK3(x5);
+ MARK2;
+ MOV32w(x3, 0x8000);
MARK3;
+ STH(x3, wback, fixedaddress);
#endif
x87_do_pop(dyn, ninst, x3);
break;
@@ -197,7 +202,7 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FIST Ew, ST0");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_F);
u8 = x87_setround(dyn, ninst, x1, x2, x4);
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
ed = x1;
s0 = fpu_get_scratch(dyn);
#if 0
@@ -206,10 +211,11 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
VFCVTZSd(s0, s0);
SQXTN_S_D(s0, s0);
SQXTN_H_S(s0, s0);
- VSTR16_U12(s0, wback, fixedaddress);
+ VST16(s0, wback, fixedaddress);
#else
MRS_fpsr(x5);
BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ BFCw(x5, FPSR_QC, 1); // reset QC bit
MSR_fpsr(x5);
if(ST_IS_F(0)) {
FRINTXS(s0, v1);
@@ -219,13 +225,16 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
VFCVTZSd(s0, s0);
SQXTN_S_D(s0, s0);
}
- SQXTN_H_S(s0, s0);
- VSTR16_U12(s0, wback, fixedaddress);
+ VMOVSto(x3, s0, 0);
MRS_fpsr(x5); // get back FPSR to check the IOC bit
- TBZ_MARK3(x5, FPSR_IOC);
- MOV32w(x5, 0x8000);
- STRH_U12(x5, wback, fixedaddress);
+ TBNZ_MARK2(x5, FPSR_IOC);
+ SXTHw(x5, x3); // check if 16bits value is fine
+ SUBw_REG(x5, x5, x3);
+ CBZw_MARK3(x5);
+ MARK2;
+ MOV32w(x3, 0x8000);
MARK3;
+ STH(x3, wback, fixedaddress);
#endif
x87_restoreround(dyn, ninst, u8);
break;
@@ -233,7 +242,7 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("FISTP Ew, ST0");
v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_F);
u8 = x87_setround(dyn, ninst, x1, x2, x4);
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<1, 1, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
ed = x1;
s0 = fpu_get_scratch(dyn);
#if 0
@@ -242,7 +251,7 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
VFCVTZSd(s0, s0);
SQXTN_S_D(s0, s0);
SQXTN_H_S(s0, s0);
- VSTR16_U12(s0, wback, fixedaddress);
+ VST16(s0, wback, fixedaddress);
#else
MRS_fpsr(x5);
BFCw(x5, FPSR_IOC, 1); // reset IOC bit
@@ -255,13 +264,16 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
VFCVTZSd(s0, s0);
SQXTN_S_D(s0, s0);
}
- SQXTN_H_S(s0, s0);
- VSTR16_U12(s0, wback, fixedaddress);
+ VMOVSto(x3, s0, 0);
MRS_fpsr(x5); // get back FPSR to check the IOC bit
- TBZ_MARK3(x5, FPSR_IOC);
- MOV32w(x5, 0x8000);
- STRH_U12(x5, wback, fixedaddress);
+ TBNZ_MARK2(x5, FPSR_IOC);
+ SXTHw(x5, x3); // check if 16bits value is fine
+ SUBw_REG(x5, x5, x3);
+ CBZw_MARK3(x5);
+ MARK2;
+ MOV32w(x3, 0x8000);
MARK3;
+ STH(x3, wback, fixedaddress);
#endif
x87_do_pop(dyn, ninst, x3);
x87_restoreround(dyn, ninst, u8);
@@ -269,50 +281,100 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
case 4:
INST_NAME("FBLD ST0, tbytes");
x87_do_push_empty(dyn, ninst, x1);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {MOVx_REG(x1, ed);}
CALL(fpu_fbld, -1);
break;
case 5:
INST_NAME("FILD ST0, i64");
- v1 = x87_do_push(dyn, ninst, x1, NEON_CACHE_ST_D);
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- LDRx_U12(x1, wback, fixedaddress);
- SCVTFDx(v1, x1);
+ v1 = x87_do_push(dyn, ninst, x1, NEON_CACHE_ST_I64);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v1, wback, fixedaddress);
+ if(!ST_IS_I64(0)) {
+ if(rex.is32bits) {
+ // need to also feed the STll stuff...
+ ADDx_U12(x4, xEmu, offsetof(x64emu_t, fpu_ll));
+ LDRw_U12(x1, xEmu, offsetof(x64emu_t, top));
+ int a = 0 - dyn->n.x87stack;
+ if(a) {
+ if(a<0) {
+ SUBw_U12(x1, x1, -a);
+ } else {
+ ADDw_U12(x1, x1, a);
+ }
+ ANDw_mask(x1, x1, 0, 2); //mask=7
+ }
+ ADDx_REG_LSL(x1, x4, x1, 4); // fpu_ll is 2 i64
+ VSTR64_U12(v1, x1, 8); // ll
+ }
+ SCVTFDD(v1, v1);
+ if(rex.is32bits) {
+ VSTR64_U12(v1, x1, 0); // ref
+ }
+ }
break;
case 6:
INST_NAME("FBSTP tbytes, ST0");
x87_forget(dyn, ninst, x1, x2, 0);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0, 0, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {MOVx_REG(x1, ed);}
CALL(fpu_fbst, -1);
x87_do_pop(dyn, ninst, x3);
break;
case 7:
INST_NAME("FISTP i64, ST0");
- v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D);
- u8 = x87_setround(dyn, ninst, x1, x2, x4);
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_I64);
+ if(!ST_IS_I64(0)) {
+ u8 = x87_setround(dyn, ninst, x1, x2, x4);
+ }
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
ed = x1;
s0 = fpu_get_scratch(dyn);
- #if 0
- FRINT64XD(s0, v1);
- VFCVTZSd(s0, s0);
- VSTR64_U12(s0, wback, fixedaddress);
- #else
- MRS_fpsr(x5);
- BFCw(x5, FPSR_IOC, 1); // reset IOC bit
- MSR_fpsr(x5);
- FRINTXD(s0, v1);
- VFCVTZSd(s0, s0);
- VSTR64_U12(s0, wback, fixedaddress);
- MRS_fpsr(x5); // get back FPSR to check the IOC bit
- TBZ_MARK3(x5, FPSR_IOC);
- ORRx_mask(x5, xZR, 1, 1, 0); //0x8000000000000000
- STRx_U12(x5, wback, fixedaddress);
- MARK3;
- #endif
- x87_restoreround(dyn, ninst, u8);
+ if(ST_IS_I64(0)) {
+ VST64(v1, wback, fixedaddress);
+ } else {
+ #if 0
+ FRINT64XD(s0, v1);
+ VFCVTZSd(s0, s0);
+ VSTR64_U12(s0, wback, fixedaddress);
+ #else
+ if(rex.is32bits) {
+ // need to check STll first...
+ ADDx_U12(x5, xEmu, offsetof(x64emu_t, fpu_ll));
+ LDRw_U12(x1, xEmu, offsetof(x64emu_t, top));
+ VMOVQDto(x3, v1, 0);
+ int a = 0 - dyn->n.x87stack;
+ if(a) {
+ if(a<0) {
+ SUBw_U12(x1, x1, -a);
+ } else {
+ ADDw_U12(x1, x1, a);
+ }
+ ANDw_mask(x1, x1, 0, 2); //mask=7
+ }
+ ADDx_REG_LSL(x1, x5, x1, 4); // fpu_ll is 2 i64
+ LDRx_U12(x5, x1, 0); // ref
+ SUBx_REG(x5, x5, x3);
+ CBNZx_MARK2(x5);
+ LDRx_U12(x5, x1, 8); // ll
+ STx(x5, wback, fixedaddress);
+ B_MARK3(c__);
+ MARK2;
+ }
+ MRS_fpsr(x5);
+ BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ MSR_fpsr(x5);
+ FRINTXD(s0, v1);
+ VFCVTZSd(s0, s0);
+ VST64(s0, wback, fixedaddress);
+ MRS_fpsr(x5); // get back FPSR to check the IOC bit
+ TBZ_MARK3(x5, FPSR_IOC);
+ ORRx_mask(x5, xZR, 1, 1, 0); //0x8000000000000000
+ STx(x5, wback, fixedaddress);
+ MARK3;
+ #endif
+ x87_restoreround(dyn, ninst, u8);
+ }
x87_do_pop(dyn, ninst, x3);
break;
default:
diff --git a/src/dynarec/arm64/dynarec_arm64_emit_logic.c b/src/dynarec/arm64/dynarec_arm64_emit_logic.c
index 668713a..e8af51f 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_emit_logic.c
+++ b/src/dynarec/arm64/dynarec_arm64_emit_logic.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -16,7 +15,6 @@
#include "emu/x64run_private.h"
#include "x64trace.h"
#include "dynarec_native.h"
-#include "../tools/bridge_private.h"
#include "arm64_printer.h"
#include "dynarec_arm64_private.h"
diff --git a/src/dynarec/arm64/dynarec_arm64_emit_math.c b/src/dynarec/arm64/dynarec_arm64_emit_math.c
index 8d952d5..f391f3a 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_emit_math.c
+++ b/src/dynarec/arm64/dynarec_arm64_emit_math.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -16,7 +15,6 @@
#include "emu/x64run_private.h"
#include "x64trace.h"
#include "dynarec_native.h"
-#include "../tools/bridge_private.h"
#include "arm64_printer.h"
#include "dynarec_arm64_private.h"
@@ -432,7 +430,7 @@ void emit_sub8c(dynarec_arm_t* dyn, int ninst, int s1, int c, int s3, int s4, in
}
IFX(X_PEND) {
STRB_U12(s1, xEmu, offsetof(x64emu_t, op1));
- STRB_U12(s3, xEmu, offsetof(x64emu_t, op2));
+ STRB_U12(s5, xEmu, offsetof(x64emu_t, op2));
SET_DF(s3, d_sub8);
} else IFX(X_ALL) {
SET_DFNONE(s3);
diff --git a/src/dynarec/arm64/dynarec_arm64_emit_shift.c b/src/dynarec/arm64/dynarec_arm64_emit_shift.c
index 45add1f..007002f 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_emit_shift.c
+++ b/src/dynarec/arm64/dynarec_arm64_emit_shift.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -16,7 +15,6 @@
#include "emu/x64run_private.h"
#include "x64trace.h"
#include "dynarec_native.h"
-#include "../tools/bridge_private.h"
#include "arm64_printer.h"
#include "dynarec_arm64_private.h"
@@ -327,7 +325,7 @@ void emit_ror32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, i
if(c==1) {
LSRxw(s3, s1, rex.w?62:30);
EORxw_REG_LSR(s3, s3, s3, 1);
- BFIw(xFlags, s4, F_OF, 1);
+ BFIw(xFlags, s3, F_OF, 1);
}
}
}
diff --git a/src/dynarec/arm64/dynarec_arm64_emit_tests.c b/src/dynarec/arm64/dynarec_arm64_emit_tests.c
index 4d032e0..bf19058 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_emit_tests.c
+++ b/src/dynarec/arm64/dynarec_arm64_emit_tests.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -16,7 +15,6 @@
#include "emu/x64run_private.h"
#include "x64trace.h"
#include "dynarec_native.h"
-#include "../tools/bridge_private.h"
#include "arm64_printer.h"
#include "dynarec_arm64_private.h"
@@ -267,8 +265,8 @@ void emit_cmp8_0(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4)
}
}
-// emit TEST32 instruction, from test s1, s2, using s3 and s4 as scratch
-void emit_test32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4)
+// emit TEST32 instruction, from test s1, s2, using s3, s4 and s5 as scratch
+void emit_test32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5)
{
MAYUSE(s1); MAYUSE(s2); MAYUSE(s3); MAYUSE(s4);
IFX_PENDOR0 {
@@ -294,18 +292,11 @@ void emit_test32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s
}
// PF: (((emu->x64emu_parity_tab[(res) / 32] >> ((res) % 32)) & 1) == 0)
IFX(X_PF) {
- ANDw_mask(s3, s3, 0b011011, 0b000010); // 0xE0
- LSRw(s3, s3, 5);
- MOV64x(s4, (uintptr_t)GetParityTab());
- LDRw_REG_LSL2(s4, s4, s3);
- ANDw_mask(s3, s1, 0, 0b000100); // 0x1f
- LSRw_REG(s4, s4, s3);
- MVNx_REG(s4, s4);
- BFIw(xFlags, s4, F_PF, 1);
+ emit_pf(dyn, ninst, s3, s4, s5);
}
}
-// emit TEST16 instruction, from test s1, s2, using s3 and s4 as scratch
+// emit TEST16 instruction, from test s1, s2, using s3, s4 and s5 as scratch
void emit_test16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
{
MAYUSE(s1); MAYUSE(s2);
@@ -336,7 +327,7 @@ void emit_test16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4,
}
}
-// emit TEST8 instruction, from test s1, s2, using s3 and s4 as scratch
+// emit TEST8 instruction, from test s1, s2, using s3, s4 and s5 as scratch
void emit_test8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
{
MAYUSE(s1); MAYUSE(s2);
diff --git a/src/dynarec/arm64/dynarec_arm64_f0.c b/src/dynarec/arm64/dynarec_arm64_f0.c
index dbfc4cc..07e4b76 100644
--- a/src/dynarec/arm64/dynarec_arm64_f0.c
+++ b/src/dynarec/arm64/dynarec_arm64_f0.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -34,6 +33,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
int32_t i32;
int64_t i64, j64;
int64_t fixedaddress;
+ int unscaled;
MAYUSE(eb1);
MAYUSE(eb2);
MAYUSE(gb1);
@@ -46,12 +46,8 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
rep = opcode-0xF1;
opcode = F8;
}
- // REX prefix before the F0 are ignored
- rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+
+ GETREX();
switch(opcode) {
case 0x00:
@@ -65,15 +61,15 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wback = xRAX + (nextop&7) + (rex.b<<3);
wb2 = 0;
} else {
- wback = (nextop&7);
- wb2 = (wback>>2);
+ wback = (nextop&7);
+ wb2 = (wback>>2);
wback = xRAX+(wback&3);
}
- UBFXw(x1, wback, wb2*8, 8);
+ UBFXw(x1, wback, wb2*8, 8);
emit_add8(dyn, ninst, x1, x2, x4, x3);
BFIx(wback, x1, wb2*8, 8);
- } else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRB(x1, wback);
emit_add8(dyn, ninst, x1, x2, x4, x5);
@@ -92,7 +88,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
emit_add32(dyn, ninst, rex, ed, gd, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRxw(x1, wback);
emit_add32(dyn, ninst, rex, x1, gd, x3, x4);
@@ -113,15 +109,15 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wback = xRAX + (nextop&7) + (rex.b<<3);
wb2 = 0;
} else {
- wback = (nextop&7);
- wb2 = (wback>>2);
+ wback = (nextop&7);
+ wb2 = (wback>>2);
wback = xRAX+(wback&3);
}
- UBFXw(x1, wback, wb2*8, 8);
+ UBFXw(x1, wback, wb2*8, 8);
emit_or8(dyn, ninst, x1, x2, x4, x3);
BFIx(wback, x1, wb2*8, 8);
- } else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRB(x1, wback);
emit_or8(dyn, ninst, x1, x2, x4, x5);
@@ -140,7 +136,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
emit_or32(dyn, ninst, rex, ed, gd, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRxw(x1, wback);
emit_or32(dyn, ninst, rex, x1, gd, x3, x4);
@@ -177,8 +173,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
BFIw(xFlags, x4, F_CF, 1);
MOV32w(x4, 1);
LSLxw_REG(x4, x4, x2);
- EORxw_REG(x4, ed, x4);
- CSELxw(ed, ed, x4, cNE);
+ ORRxw_REG(ed, ed, x4);
} else {
// Will fetch only 1 byte, to avoid alignment issue
if(rex.w) {
@@ -187,7 +182,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ANDw_mask(x2, gd, 0, 0b00010); //mask=0x000000007
}
SMDMB();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
ASRxw(x1, gd, 3); // r1 = (gd>>3)
ADDx_REG_LSL(x3, wback, x1, 0); //(&ed)+=r1;
MARKLOCK;
@@ -195,12 +190,11 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = x1;
wback = x3;
LSRw_REG(x4, ed, x2);
- ANDSw_mask(x4, x4, 0, 0); //mask=1
+ ANDw_mask(x4, x4, 0, 0); //mask=1
BFIw(xFlags, x4, F_CF, 1);
MOV32w(x4, 1);
LSLw_REG(x4, x4, x2);
- EORw_REG(x4, ed, x4);
- CSELw(ed, ed, x4, cNE);
+ ORRw_REG(ed, ed, x4);
STLXRB(x4, ed, wback);
CBNZw_MARKLOCK(x4);
SMDMB();
@@ -219,11 +213,11 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
if(rex.rex) {
wback = xRAX+(nextop&7)+(rex.b<<3);
wb2 = 0;
- } else {
+ } else {
wback = (nextop&7);
wb2 = (wback>>2)*8;
wback = xRAX+(wback&3);
- }
+ }
UBFXx(x2, wback, wb2, 8);
wb1 = 0;
ed = x2;
@@ -236,7 +230,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
BFIx(xRAX, x2, 0, 8);
B_NEXT_nocond;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRB(x2, wback);
CMPSxw_REG(x6, x2);
@@ -246,7 +240,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
CBNZx_MARKLOCK(x4);
// done
MARK;
- UFLAG_IF {emit_cmp32(dyn, ninst, rex, x6, x2, x3, x4, x5);}
+ UFLAG_IF {emit_cmp8(dyn, ninst, x6, x2, x3, x4, x5);}
BFIx(xRAX, x2, 0, 8);
}
SMDMB();
@@ -275,7 +269,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVxw_REG(xRAX, x1);
B_NEXT_nocond;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
TSTx_mask(wback, 1, 0, 1+rex.w); // mask=3 or 7
B_MARK3(cNE);
// Aligned version
@@ -326,15 +320,14 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
LSRxw_REG(x4, ed, x2);
if(rex.w) {
- ANDSx_mask(x4, x4, 1, 0, 0); //mask=1
+ ANDx_mask(x4, x4, 1, 0, 0); //mask=1
} else {
- ANDSw_mask(x4, x4, 0, 0); //mask=1
+ ANDw_mask(x4, x4, 0, 0); //mask=1
}
BFIw(xFlags, x4, F_CF, 1);
MOV32w(x4, 1);
LSLxw_REG(x4, x4, x2);
- EORxw_REG(x4, ed, x4);
- CSELxw(ed, ed, x4, cEQ);
+ BICxw_REG(ed, ed, x4);
} else {
// Will fetch only 1 byte, to avoid alignment issue
if(rex.w) {
@@ -343,20 +336,19 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ANDw_mask(x2, gd, 0, 0b00010); //mask=0x000000007
}
SMDMB();
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
- ASRxw(x1, gd, 3); // r1 = (gd>>3)
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
+ ASRx(x1, gd, 3); // r1 = (gd>>3)
ADDx_REG_LSL(x3, wback, x1, 0); //(&ed)+=r1;
MARKLOCK;
LDAXRB(x1, wback);
ed = x1;
wback = x3;
LSRw_REG(x4, ed, x2);
- ANDSw_mask(x4, x4, 0, 0); //mask=1
+ ANDw_mask(x4, x4, 0, 0); //mask=1
BFIw(xFlags, x4, F_CF, 1);
MOV32w(x4, 1);
LSLw_REG(x4, x4, x2);
- EORw_REG(x4, ed, x4);
- CSELw(ed, ed, x4, cEQ);
+ ORRw_REG(ed, ed, x4);
STLXRB(x4, ed, wback);
CBNZw_MARKLOCK(x4);
SMDMB();
@@ -378,7 +370,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVxw_REG(gd, x1);
emit_add32(dyn, ninst, rex, ed, gd, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
TSTx_mask(wback, 1, 0, 1+rex.w); // mask=3 or 7
B_MARK(cNE); // unaligned
MARKLOCK;
@@ -415,7 +407,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
INST_NAME("LOCK CMPXCHG8B Gq, Eq");
SETFLAGS(X_ZF, SF_SUBSET);
nextop = F8;
- addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
SMDMB();
MARKLOCK;
LDAXPxw(x2, x3, wback);
@@ -444,7 +436,55 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
DEFAULT;
}
break;
-
+ case 0x10:
+ INST_NAME("LOCK ADC Eb, Gb");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ SMDMB();
+ GETGB(x2);
+ if((nextop&0xC0)==0xC0) {
+ if(rex.rex) {
+ wback = xRAX + (nextop&7) + (rex.b<<3);
+ wb2 = 0;
+ } else {
+ wback = (nextop&7);
+ wb2 = (wback>>2);
+ wback = xRAX+(wback&3);
+ }
+ UBFXw(x1, wback, wb2*8, 8);
+ emit_adc8(dyn, ninst, x1, x2, x4, x5);
+ BFIx(wback, x1, wb2*8, 8);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LDAXRB(x1, wback);
+ emit_adc8(dyn, ninst, x1, x2, x4, x5);
+ STLXRB(x4, x1, wback);
+ CBNZx_MARKLOCK(x4);
+ }
+ SMDMB();
+ break;
+ case 0x11:
+ INST_NAME("LOCK ADC Ed, Gd");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ SMDMB();
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_adc32(dyn, ninst, rex, ed, gd, x3, x4);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LDAXRxw(x1, wback);
+ emit_adc32(dyn, ninst, rex, x1, gd, x4, x5);
+ STLXRxw(x4, x1, wback);
+ CBNZx_MARKLOCK(x4);
+ }
+ SMDMB();
+ break;
case 0x21:
INST_NAME("LOCK AND Ed, Gd");
SETFLAGS(X_ALL, SF_SET_PENDING);
@@ -455,7 +495,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
emit_and32(dyn, ninst, rex, ed, gd, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRxw(x1, wback);
emit_and32(dyn, ninst, rex, x1, gd, x3, x4);
@@ -464,7 +504,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
SMDMB();
break;
-
+
case 0x29:
INST_NAME("LOCK SUB Ed, Gd");
SETFLAGS(X_ALL, SF_SET_PENDING);
@@ -475,7 +515,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
emit_sub32(dyn, ninst, rex, ed, gd, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRxw(x1, wback);
emit_sub32(dyn, ninst, rex, x1, gd, x3, x4);
@@ -502,7 +542,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wb1 = 0;
EBBACK;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1);
u8 = F8;
wb1 = 1;
MARKLOCK;
@@ -522,7 +562,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wb1 = 0;
EBBACK;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1);
u8 = F8;
wb1 = 1;
MARKLOCK;
@@ -543,7 +583,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wb1 = 0;
EBBACK;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1);
u8 = F8;
wb1 = 1;
MARKLOCK;
@@ -564,7 +604,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wb1 = 0;
EBBACK;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1);
u8 = F8;
wb1 = 1;
MARKLOCK;
@@ -584,7 +624,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wb1 = 0;
EBBACK;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1);
u8 = F8;
wb1 = 1;
MARKLOCK;
@@ -604,7 +644,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wb1 = 0;
EBBACK;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1);
u8 = F8;
wb1 = 1;
MARKLOCK;
@@ -624,7 +664,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
wb1 = 0;
EBBACK;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1);
u8 = F8;
wb1 = 1;
MARKLOCK;
@@ -669,7 +709,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV64xw(x5, i64);
emit_add32(dyn, ninst, rex, ed, x5, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
TSTx_mask(wback, 1, 0, 1+rex.w); // mask=3 or 7
B_MARK(cNE);
@@ -680,7 +720,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
CBNZx_MARKLOCK(x3);
SMDMB();
B_NEXT_nocond;
- MARK; // unaligned! also, not enough
+ MARK; // unaligned! also, not enough
LDRxw_U12(x1, wback, 0);
LDAXRB(x4, wback);
BFIxw(x1, x4, 0, 8); // re-inject
@@ -699,7 +739,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV64xw(x5, i64);
emit_or32(dyn, ninst, rex, ed, x5, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
MOV64xw(x5, i64);
MARKLOCK;
@@ -719,7 +759,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV64xw(x5, i64);
emit_adc32(dyn, ninst, rex, ed, x5, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
MOV64xw(x5, i64);
MARKLOCK;
@@ -739,7 +779,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV64xw(x5, i64);
emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
MOV64xw(x5, i64);
MARKLOCK;
@@ -758,7 +798,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV64xw(x5, i64);
emit_and32(dyn, ninst, rex, ed, x5, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
MOV64xw(x5, i64);
MARKLOCK;
@@ -777,7 +817,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV64xw(x5, i64);
emit_sub32(dyn, ninst, rex, ed, x5, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
TSTx_mask(wback, 1, 0, 1+rex.w); // mask=3 or 7
B_MARK(cNE);
@@ -788,7 +828,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
CBNZx_MARKLOCK(x3);
SMDMB();
B_NEXT_nocond;
- MARK; // unaligned! also, not enough
+ MARK; // unaligned! also, not enough
LDRxw_U12(x1, wback, 0);
LDAXRB(x4, wback);
BFIxw(x1, x4, 0, 8); // re-inject
@@ -807,7 +847,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV64xw(x5, i64);
emit_xor32(dyn, ninst, rex, ed, x5, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
MOV64xw(x5, i64);
MARKLOCK;
@@ -833,7 +873,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
}
SMDMB();
break;
-
+
case 0x86:
INST_NAME("LOCK XCHG Eb, Gb");
// Do the swap
@@ -856,7 +896,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
SMDMB();
GETGB(x4);
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
// do the swap with exclusive locking
LDAXRB(x1, ed);
@@ -879,7 +919,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
} else {
GETGD;
SMDMB();
- addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
TSTx_mask(ed, 1, 0, 1+rex.w); // mask=3 or 7
B_MARK(cNE);
MARKLOCK;
@@ -895,7 +935,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOVxw_REG(gd, x1);
}
break;
-
+
case 0xF6:
nextop = F8;
switch((nextop>>3)&7) {
@@ -917,7 +957,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
EBBACK;
} else {
SMDMB();
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRB(x1, wback);
MVNw_REG(x1, x1);
@@ -930,7 +970,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
DEFAULT;
}
break;
-
+
case 0xFE:
nextop = F8;
switch((nextop>>3)&7)
@@ -944,7 +984,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
emit_inc8(dyn, ninst, x1, x2, x4);
EBBACK;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRB(x1, wback);
emit_inc8(dyn, ninst, x1, x3, x4);
@@ -962,7 +1002,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
emit_dec8(dyn, ninst, x1, x2, x4);
EBBACK;
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
MARKLOCK;
LDAXRB(x1, wback);
emit_dec8(dyn, ninst, x1, x3, x4);
@@ -987,7 +1027,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
emit_inc32(dyn, ninst, rex, ed, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
TSTx_mask(wback, 1, 0, 1+rex.w); // mask=3 or 7
B_MARK(cNE); // unaligned
MARKLOCK;
@@ -1016,7 +1056,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
ed = xRAX+(nextop&7)+(rex.b<<3);
emit_dec32(dyn, ninst, rex, ed, x3, x4);
} else {
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0);
TSTx_mask(wback, 1, 0, 1+rex.w); // mask=3 or 7
B_MARK(cNE); // unaligned
MARKLOCK;
@@ -1041,7 +1081,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
DEFAULT;
}
break;
-
+
default:
DEFAULT;
}
diff --git a/src/dynarec/arm64/dynarec_arm64_f20f.c b/src/dynarec/arm64/dynarec_arm64_f20f.c
index 746225a..c2d8a46 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_f20f.c
+++ b/src/dynarec/arm64/dynarec_arm64_f20f.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -36,6 +35,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
int q0;
int d0, d1;
int64_t fixedaddress;
+ int unscaled;
MAYUSE(d0);
MAYUSE(d1);
@@ -57,8 +57,8 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
SMREAD();
v0 = sse_get_reg_empty(dyn, ninst, x1, gd);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v0, ed, fixedaddress); // upper part reseted
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v0, ed, fixedaddress); // upper part reseted
}
break;
case 0x11:
@@ -71,8 +71,8 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
d0 = sse_get_reg(dyn, ninst, x1, ed, 1);
VMOVeD(d0, 0, v0, 0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VSTR64_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VST64(v0, ed, fixedaddress);
SMWRITE2();
}
break;
@@ -87,8 +87,8 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
SMREAD();
v0 = sse_get_reg_empty(dyn, ninst, x1, gd);
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v0, ed, fixedaddress);
}
VMOVeD(v0, 1, v0, 0);
break;
@@ -154,6 +154,42 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
}
break;
+ case 0x38: // these are some more SSSE4.2+ opcodes
+ opcode = F8;
+ switch(opcode) {
+
+ case 0xF0:
+ INST_NAME("(unsupported) CRC32 Gd, Eb)");
+ nextop = F8;
+ addr = fakeed(dyn, addr, ninst, nextop);
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL(xRIP);
+ CALL(native_ud, -1);
+ LOAD_XEMU_CALL(xRIP);
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+ case 0xF1:
+ INST_NAME("(unsupported) CRC32 Gd, Ed)");
+ nextop = F8;
+ addr = fakeed(dyn, addr, ninst, nextop);
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL(xRIP);
+ CALL(native_ud, -1);
+ LOAD_XEMU_CALL(xRIP);
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+
+ default:
+ DEFAULT;
+ }
+ break;
+
case 0x51:
INST_NAME("SQRTSD Gx, Ex");
@@ -261,7 +297,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
VMOVeD(v0, 0, d0, 0); // to not erase uper part
#else
FCMPD(v0, v1);
- B_NEXT(cLS); //Less than or equal
+ B_NEXT(cCC); //Less than
VMOVeD(v0, 0, v1, 0); // to not erase uper part
#endif
break;
@@ -299,7 +335,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
VMOVeD(v0, 0, d0, 0); // to not erase uper part
#else
FCMPD(v0, v1);
- B_NEXT(cGE); //Greater than or equal
+ B_NEXT(cGT); //Greater than
VMOVeD(v0, 0, v1, 0); // to not erase uper part
#endif
break;
@@ -334,9 +370,9 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
if(MODREG) {
v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
v1 = fpu_get_scratch(dyn);
- VLDR128_U12(v1, ed, fixedaddress);
+ VLD128(v1, ed, fixedaddress);
}
VFADDPQS(v0, v0, v1);
break;
@@ -365,7 +401,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
INST_NAME("ADDSUBPS Gx, Ex");
nextop = F8;
GETGX(v0, 1);
- GETEXSD(v1, 0, 0);
+ GETEX(v1, 0, 0);
q0 = fpu_get_scratch(dyn);
static float addsubps[4] = {-1.f, 1.f, -1.f, 1.f};
MAYUSE(addsubps);
@@ -385,13 +421,39 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
case 0xE6:
INST_NAME("CVTPD2DQ Gx, Ex");
nextop = F8;
- GETEXSD(v1, 0, 0);
+ GETEX(v1, 0, 0);
GETGX_empty(v0);
- u8 = sse_setround(dyn, ninst, x1, x2, x3);
- VFRINTIDQ(v0, v1);
- x87_restoreround(dyn, ninst, u8);
- VFCVTNSQD(v0, v0); // convert double -> int64
- SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part
+ if(box64_dynarec_fastround) {
+ u8 = sse_setround(dyn, ninst, x1, x2, x3);
+ VFRINTIDQ(v0, v1);
+ x87_restoreround(dyn, ninst, u8);
+ VFCVTNSQD(v0, v0); // convert double -> int64
+ SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part
+ } else {
+ u8 = sse_setround(dyn, ninst, x1, x2, x3);
+ MRS_fpsr(x5);
+ BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ MSR_fpsr(x5);
+ ORRw_mask(x4, xZR, 1, 0); //0x80000000
+ d0 = fpu_get_scratch(dyn);
+ for(int i=0; i<2; ++i) {
+ BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ MSR_fpsr(x5);
+ if(i) {
+ VMOVeD(d0, 0, v1, i);
+ FRINTID(d0, d0);
+ } else {
+ FRINTID(d0, v1);
+ }
+ FCVTZSwD(x1, d0);
+ MRS_fpsr(x5); // get back FPSR to check the IOC bit
+ TBZ(x5, FPSR_IOC, 4+4);
+ MOVw_REG(x1, x4);
+ VMOVQSfrom(v0, i, x1);
+ }
+ x87_restoreround(dyn, ninst, u8);
+ VMOVQDfrom(v0, 1, xZR);
+ }
break;
case 0xF0:
@@ -405,8 +467,8 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
v0 = sse_get_reg_empty(dyn, ninst, x1, gd);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 7, rex, NULL, 0, 0);
- VLDR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 7, rex, NULL, 0, 0);
+ VLD128(v0, ed, fixedaddress);
}
break;
diff --git a/src/dynarec/arm64/dynarec_arm64_f30f.c b/src/dynarec/arm64/dynarec_arm64_f30f.c
index 2d0b8c6..d57d3c8 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_f30f.c
+++ b/src/dynarec/arm64/dynarec_arm64_f30f.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include "debug.h"
@@ -35,6 +34,7 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
int q0, q1;
int d0, d1;
int64_t fixedaddress;
+ int unscaled;
int64_t j64;
MAYUSE(d0);
@@ -58,8 +58,8 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
v0 = sse_get_reg_empty(dyn, ninst, x1, gd);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VLDR32_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VLD32(v0, ed, fixedaddress);
}
break;
case 0x11:
@@ -71,8 +71,8 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
q0 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 1);
VMOVeS(q0, 0, v0, 0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, 0);
- VSTR32_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
+ VST32(v0, ed, fixedaddress);
SMWRITE2();
}
break;
@@ -83,9 +83,9 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
q1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
q1 = fpu_get_scratch(dyn);
- VLDR128_U12(q1, ed, fixedaddress);
+ VLD128(q1, ed, fixedaddress);
}
GETGX_empty(q0);
VTRNQ1_32(q0, q1, q1);
@@ -98,9 +98,9 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
q1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
q1 = fpu_get_scratch(dyn);
- VLDR128_U12(q1, ed, fixedaddress);
+ VLD128(q1, ed, fixedaddress);
}
GETGX_empty(q0);
VTRNQ2_32(q0, q1, q1);
@@ -143,7 +143,7 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
if(rex.w) {
ORRx_mask(gd, xZR, 1, 1, 0); //0x8000000000000000
} else {
- MOV32w(gd, 0x80000000);
+ ORRw_mask(gd, xZR, 1, 0); //0x80000000
}
}
break;
@@ -168,7 +168,7 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
if(rex.w) {
ORRx_mask(gd, xZR, 1, 1, 0); //0x8000000000000000
} else {
- MOV32w(gd, 0x80000000);
+ ORRw_mask(gd, xZR, 1, 0); //0x80000000
}
}
break;
@@ -239,9 +239,27 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
case 0x5B:
INST_NAME("CVTTPS2DQ Gx, Ex");
nextop = F8;
- GETEX(d0, 0, 0) ;
+ GETEX(v1, 0, 0) ;
GETGX_empty(v0);
- VFCVTZSQS(v0, d0);
+ if(box64_dynarec_fastround) {
+ VFCVTZSQS(v0, v1);
+ } else {
+ MRS_fpsr(x5);
+ BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ MSR_fpsr(x5);
+ ORRw_mask(x4, xZR, 1, 0); //0x80000000
+ d0 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ BFCw(x5, FPSR_IOC, 1); // reset IOC bit
+ MSR_fpsr(x5);
+ VMOVeS(d0, 0, v1, i);
+ VFCVTZSs(d0, d0);
+ MRS_fpsr(x5); // get back FPSR to check the IOC bit
+ TBZ(x5, FPSR_IOC, 4+4);
+ VMOVQSfrom(d0, 0, x4);
+ VMOVeS(v0, i, d0, 0);
+ }
+ }
break;
case 0x5C:
@@ -305,8 +323,8 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
GETGX_empty(v0);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VLDR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VLD128(v0, ed, fixedaddress);
}
break;
case 0x70:
@@ -341,8 +359,8 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
} else {
GETGX_empty(v0);
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v0, ed, fixedaddress);
}
break;
case 0x7F:
@@ -353,12 +371,48 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7) + (rex.b<<3));
VMOVQ(v1, v0);
} else {
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, 0);
- VSTR128_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
+ VST128(v0, ed, fixedaddress);
SMWRITE2();
}
break;
+ case 0xB8:
+ INST_NAME("POPCNT Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET);
+ SET_DFNONE(x1);
+ nextop = F8;
+ v1 = fpu_get_scratch(dyn);
+ GETGD;
+ if(MODREG) {
+ GETED(0);
+ if(rex.w)
+ VMOVQDfrom(v1, 0, ed);
+ else {
+ MOVxw_REG(x1, ed); // need to clear uper part
+ VMOVQDfrom(v1, 0, x1);
+ }
+ } else {
+ if(rex.w) {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v1, ed, fixedaddress);
+ } else {
+ GETED(0); // just load and clear the upper part
+ VMOVQDfrom(v1, 0, ed);
+ }
+ }
+ CNT_8(v1, v1);
+ UADDLV_8(v1, v1);
+ VMOVQDto(gd, v1, 0);
+ IFX(X_ALL) {
+ MOV32w(x1, (1<<F_OF) | (1<<F_SF) | (1<<F_ZF) | (1<<F_AF) | (1<<F_CF) | (1<<F_PF));
+ BICw(xFlags, xFlags, x1);
+ CBNZx(gd, 4+4);
+ BFIw(xFlags, xFlags, F_ZF, 1);
+ }
+ break;
+
case 0xBC:
INST_NAME("TZCNT Gd, Ed");
SETFLAGS(X_CF|X_ZF, SF_SUBSET);
@@ -421,8 +475,8 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
VMOV(v0, v1);
} else {
SMREAD();
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, 0);
- VLDR64_U12(v0, ed, fixedaddress);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
+ VLD64(v0, ed, fixedaddress);
}
break;
diff --git a/src/dynarec/arm64/dynarec_arm64_functions.c b/src/dynarec/arm64/dynarec_arm64_functions.c
index 2c6ebb3..6944b78 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_functions.c
+++ b/src/dynarec/arm64/dynarec_arm64_functions.c
@@ -1,7 +1,6 @@
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
-#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <math.h>
@@ -13,7 +12,6 @@
#include "box64context.h"
#include "dynarec.h"
#include "emu/x64emu_private.h"
-#include "tools/bridge_private.h"
#include "x64run.h"
#include "x64emu.h"
#include "box64stack.h"
@@ -28,332 +26,6 @@
#include "custommem.h"
#include "bridge.h"
-void arm_fstp(x64emu_t* emu, void* p)
-{
- if(ST0.q!=STld(0).uref)
- D2LD(&ST0.d, p);
- else
- memcpy(p, &STld(0).ld, 10);
-}
-
-void arm_print_armreg(x64emu_t* emu, uintptr_t reg, uintptr_t n)
-{
- (void)emu;
- dynarec_log(LOG_DEBUG, "R%lu=0x%lx (%lu)\n", n, reg, reg);
-}
-
-void arm_f2xm1(x64emu_t* emu)
-{
- ST0.d = exp2(ST0.d) - 1.0;
-}
-void arm_fyl2x(x64emu_t* emu)
-{
- ST(1).d = log2(ST0.d)*ST(1).d;
-}
-void arm_ftan(x64emu_t* emu)
-{
- ST0.d = tan(ST0.d);
- emu->sw.f.F87_C2 = 0;
-}
-void arm_fpatan(x64emu_t* emu)
-{
- ST1.d = atan2(ST1.d, ST0.d);
-}
-void arm_fxtract(x64emu_t* emu)
-{
- int32_t tmp32s = (ST1.q&0x7ff0000000000000LL)>>52;
- tmp32s -= 1023;
- ST1.d /= exp2(tmp32s);
- ST0.d = tmp32s;
-}
-void arm_fprem(x64emu_t* emu)
-{
- int32_t tmp32s = ST0.d / ST1.d;
- ST0.d -= ST1.d * tmp32s;
- emu->sw.f.F87_C2 = 0;
- emu->sw.f.F87_C0 = (tmp32s&1);
- emu->sw.f.F87_C3 = ((tmp32s>>1)&1);
- emu->sw.f.F87_C1 = ((tmp32s>>2)&1);
-}
-void arm_fyl2xp1(x64emu_t* emu)
-{
- ST(1).d = log2(ST0.d + 1.0)*ST(1).d;
-}
-void arm_fsincos(x64emu_t* emu)
-{
- sincos(ST1.d, &ST1.d, &ST0.d);
- emu->sw.f.F87_C2 = 0;
-}
-void arm_frndint(x64emu_t* emu)
-{
- ST0.d = fpu_round(emu, ST0.d);
-}
-void arm_fscale(x64emu_t* emu)
-{
- if(ST0.d!=0.0)
- ST0.d *= exp2(trunc(ST1.d));
-}
-void arm_fsin(x64emu_t* emu)
-{
- ST0.d = sin(ST0.d);
- emu->sw.f.F87_C2 = 0;
-}
-void arm_fcos(x64emu_t* emu)
-{
- ST0.d = cos(ST0.d);
- emu->sw.f.F87_C2 = 0;
-}
-
-void arm_fbld(x64emu_t* emu, uint8_t* ed)
-{
- fpu_fbld(emu, ed);
-}
-
-void arm_fild64(x64emu_t* emu, int64_t* ed)
-{
- int64_t tmp;
- memcpy(&tmp, ed, sizeof(tmp));
- ST0.d = tmp;
- STll(0).sq = tmp;
- STll(0).sref = ST0.sq;
-}
-
-void arm_fbstp(x64emu_t* emu, uint8_t* ed)
-{
- fpu_fbst(emu, ed);
-}
-
-void arm_fistp64(x64emu_t* emu, int64_t* ed)
-{
- // used of memcpy to avoid aligments issues
- if(STll(0).sref==ST(0).sq) {
- memcpy(ed, &STll(0).sq, sizeof(int64_t));
- } else {
- int64_t tmp;
- if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, (double)(int64_t)0x8000000000000000LL) || !isfinite(ST0.d))
- tmp = 0x8000000000000000LL;
- else
- tmp = fpu_round(emu, ST0.d);
- memcpy(ed, &tmp, sizeof(tmp));
- }
-}
-
-void arm_fistt64(x64emu_t* emu, int64_t* ed)
-{
- // used of memcpy to avoid aligments issues
- int64_t tmp = ST0.d;
- memcpy(ed, &tmp, sizeof(tmp));
-}
-
-void arm_fld(x64emu_t* emu, uint8_t* ed)
-{
- memcpy(&STld(0).ld, ed, 10);
- LD2D(&STld(0), &ST(0).d);
- STld(0).uref = ST0.q;
-}
-
-void arm_ud(x64emu_t* emu)
-{
- emit_signal(emu, SIGILL, (void*)R_RIP, 0);
-}
-
-void arm_priv(x64emu_t* emu)
-{
- emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
-}
-
-void arm_fsave(x64emu_t* emu, uint8_t* ed)
-{
- fpu_savenv(emu, (char*)ed, 0);
-
- uint8_t* p = ed;
- p += 28;
- for (int i=0; i<8; ++i) {
- LD2D(p, &ST(i).d);
- p+=10;
- }
-}
-void arm_frstor(x64emu_t* emu, uint8_t* ed)
-{
- fpu_loadenv(emu, (char*)ed, 0);
-
- uint8_t* p = ed;
- p += 28;
- for (int i=0; i<8; ++i) {
- D2LD(&ST(i).d, p);
- p+=10;
- }
-
-}
-
-void arm_fprem1(x64emu_t* emu)
-{
- // simplified version
- int32_t tmp32s = round(ST0.d / ST1.d);
- ST0.d -= ST1.d*tmp32s;
- emu->sw.f.F87_C2 = 0;
- emu->sw.f.F87_C0 = (tmp32s&1);
- emu->sw.f.F87_C3 = ((tmp32s>>1)&1);
- emu->sw.f.F87_C1 = ((tmp32s>>2)&1);
-}
-
-static uint8_t ff_mult(uint8_t a, uint8_t b)
-{
- int retval = 0;
-
- for(int i = 0; i < 8; i++) {
- if((b & 1) == 1)
- retval ^= a;
-
- if((a & 0x80)) {
- a <<= 1;
- a ^= 0x1b;
- } else {
- a <<= 1;
- }
-
- b >>= 1;
- }
-
- return retval;
-}
-
-void arm_aesimc(x64emu_t* emu, int xmm)
-{
- sse_regs_t eax1 = emu->xmm[xmm];
-
- for(int j=0; j<4; ++j) {
- emu->xmm[xmm].ub[0+j*4] = ff_mult(0x0E, eax1.ub[0+j*4]) ^ ff_mult(0x0B, eax1.ub[1+j*4]) ^ ff_mult(0x0D, eax1.ub[2+j*4]) ^ ff_mult(0x09, eax1.ub[3+j*4]);
- emu->xmm[xmm].ub[1+j*4] = ff_mult(0x09, eax1.ub[0+j*4]) ^ ff_mult(0x0E, eax1.ub[1+j*4]) ^ ff_mult(0x0B, eax1.ub[2+j*4]) ^ ff_mult(0x0D, eax1.ub[3+j*4]);
- emu->xmm[xmm].ub[2+j*4] = ff_mult(0x0D, eax1.ub[0+j*4]) ^ ff_mult(0x09, eax1.ub[1+j*4]) ^ ff_mult(0x0E, eax1.ub[2+j*4]) ^ ff_mult(0x0B, eax1.ub[3+j*4]);
- emu->xmm[xmm].ub[3+j*4] = ff_mult(0x0B, eax1.ub[0+j*4]) ^ ff_mult(0x0D, eax1.ub[1+j*4]) ^ ff_mult(0x09, eax1.ub[2+j*4]) ^ ff_mult(0x0E, eax1.ub[3+j*4]);
- }
-}
-void arm_aesmc(x64emu_t* emu, int xmm)
-{
- sse_regs_t eax1 = emu->xmm[xmm];
-
- for(int j=0; j<4; ++j) {
- emu->xmm[xmm].ub[0+j*4] = ff_mult(0x02, eax1.ub[0+j*4]) ^ ff_mult(0x03, eax1.ub[1+j*4]) ^ eax1.ub[2+j*4] ^ eax1.ub[3+j*4] ;
- emu->xmm[xmm].ub[1+j*4] = eax1.ub[0+j*4] ^ ff_mult(0x02, eax1.ub[1+j*4]) ^ ff_mult(0x03, eax1.ub[2+j*4]) ^ eax1.ub[3+j*4] ;
- emu->xmm[xmm].ub[2+j*4] = eax1.ub[0+j*4] ^ eax1.ub[1+j*4] ^ ff_mult(0x02, eax1.ub[2+j*4]) ^ ff_mult(0x03, eax1.ub[3+j*4]);
- emu->xmm[xmm].ub[3+j*4] = ff_mult(0x03, eax1.ub[0+j*4]) ^ eax1.ub[1+j*4] ^ eax1.ub[2+j*4] ^ ff_mult(0x02, eax1.ub[3+j*4]);
- }
-}
-void arm_aesdlast(x64emu_t* emu, int xmm)
-{
- // A0 B1 C2 D3 E4 F5 G6 H7 I8 J9 Ka Lb Mc Nd Oe Pf
- // A N K H E B O L I F C P M J G D
- const uint8_t invshiftrows[] = {0,13,10, 7, 4, 1,14,11, 8, 5, 2,15,12, 9, 6, 3};
- const uint8_t invsubbytes[256] = {
- 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
- 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
- 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
- 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
- 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
- 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
- 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
- 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
- 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
- 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
- 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
- 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
- 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
- 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
- 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
- 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d,
- };
-
- sse_regs_t eax1;
- for(int i=0; i<16; ++i)
- eax1.ub[i] = emu->xmm[xmm].ub[invshiftrows[i]];
- //STATE ← InvSubBytes( STATE );
- for(int i=0; i<16; ++i)
- emu->xmm[xmm].ub[i] = invsubbytes[eax1.ub[i]];
-
-}
-static const uint8_t shiftrows[] = {0, 5,10,15, 4, 9,14, 3, 8,13, 2, 7,12, 1, 6,11};
-static const uint8_t subbytes[256] = {
- 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
- 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
- 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
- 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
- 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
- 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
- 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
- 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
- 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
- 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
- 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
- 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
- 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
- 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
- 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
- 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16,
-};
-void arm_aeselast(x64emu_t* emu, int xmm)
-{
- // A0 B1 C2 D3 E4 F5 G6 H7 I8 J9 Ka Lb Mc Nd Oe Pf
- // A F K P E J O D I N C H M B G L
- sse_regs_t eax1;
- for(int i=0; i<16; ++i)
- eax1.ub[i] = emu->xmm[xmm].ub[shiftrows[i]];
- //STATE ← SubBytes( STATE );
- for(int i=0; i<16; ++i)
- emu->xmm[xmm].ub[i] = subbytes[eax1.ub[i]];
-}
-void arm_aesd(x64emu_t* emu, int xmm)
-{
- arm_aesdlast(emu, xmm);
- arm_aesimc(emu, xmm);
-}
-void arm_aese(x64emu_t* emu, int xmm)
-{
- arm_aeselast(emu, xmm);
- arm_aesmc(emu, xmm);
-}
-void arm_aeskeygenassist(x64emu_t* emu, int gx, int ex, void* p, uint32_t u8)
-{
- sse_regs_t *EX = p?((sse_regs_t*)p):&emu->xmm[ex];
- sse_regs_t *GX = &emu->xmm[gx];
- for (int i = 4; i < 8; ++i)
- GX->ub[i] = subbytes[EX->ub[i]];
- for (int i = 12; i < 16; ++i)
- GX->ub[i] = subbytes[EX->ub[i]];
- GX->ud[0] = GX->ud[1];
- uint8_t tmp8u = GX->ub[4];
- GX->ud[1] = GX->ud[1] >> 8;
- GX->ub[7] = tmp8u;
- GX->ud[1] ^= u8;
- GX->ud[2] = GX->ud[3];
- tmp8u = GX->ub[12];
- GX->ud[3] = GX->ud[3] >> 8;
- GX->ub[15] = tmp8u;
- GX->ud[3] ^= u8;
-}
-
-void arm_pclmul(x64emu_t* emu, int gx, int ex, void* p, uint32_t u8)
-{
- sse_regs_t *EX = p?((sse_regs_t*)p):&emu->xmm[ex];
- sse_regs_t *GX = &emu->xmm[gx];
- int g = (u8&1)?1:0;
- int e = (u8&0b10000)?1:0;
- __int128 result = 0;
- __int128 op2 = EX->q[e];
- for (int i=0; i<64; ++i)
- if(GX->q[g]&(1LL<<i))
- result ^= (op2<<i);
-
- GX->q[0] = result&0xffffffffffffffffLL;
- GX->q[1] = (result>>64)&0xffffffffffffffffLL;
-}
-
-void arm_clflush(x64emu_t* emu, void* p)
-{
- cleanDBFromAddressRange((uintptr_t)p, 8, 0);
-}
-
-
#define XMM0 0
#define XMM8 16
#define X870 8
@@ -386,7 +58,7 @@ void fpu_free_reg(dynarec_arm_t* dyn, int reg)
{
// TODO: check upper limit?
dyn->n.fpuused[reg] = 0;
- if(dyn->n.neoncache[reg].t!=NEON_CACHE_ST_F && dyn->n.neoncache[reg].t!=NEON_CACHE_ST_D)
+ if(dyn->n.neoncache[reg].t!=NEON_CACHE_ST_F && dyn->n.neoncache[reg].t!=NEON_CACHE_ST_D && dyn->n.neoncache[reg].t!=NEON_CACHE_ST_I64)
dyn->n.neoncache[reg].v = 0;
}
// Get an MMX double reg
@@ -434,7 +106,8 @@ int neoncache_get_st(dynarec_arm_t* dyn, int ninst, int a)
}
for(int i=0; i<24; ++i)
if((dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_F
- || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_D)
+ || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_D
+ || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_I64)
&& dyn->insts[ninst].n.neoncache[i].n==a)
return dyn->insts[ninst].n.neoncache[i].t;
// not in the cache yet, so will be fetched...
@@ -448,7 +121,8 @@ int neoncache_get_current_st(dynarec_arm_t* dyn, int ninst, int a)
return NEON_CACHE_ST_D;
for(int i=0; i<24; ++i)
if((dyn->n.neoncache[i].t==NEON_CACHE_ST_F
- || dyn->n.neoncache[i].t==NEON_CACHE_ST_D)
+ || dyn->n.neoncache[i].t==NEON_CACHE_ST_D
+ || dyn->n.neoncache[i].t==NEON_CACHE_ST_I64)
&& dyn->n.neoncache[i].n==a)
return dyn->n.neoncache[i].t;
// not in the cache yet, so will be fetched...
@@ -466,6 +140,17 @@ int neoncache_get_st_f(dynarec_arm_t* dyn, int ninst, int a)
return i;
return -1;
}
+int neoncache_get_st_f_i64(dynarec_arm_t* dyn, int ninst, int a)
+{
+ /*if(a+dyn->insts[ninst].n.stack_next-st<0)
+ // The STx has been pushed at the end of instructon, so stop going back
+ return -1;*/
+ for(int i=0; i<24; ++i)
+ if((dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_I64 || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_F)
+ && dyn->insts[ninst].n.neoncache[i].n==a)
+ return i;
+ return -1;
+}
int neoncache_get_st_f_noback(dynarec_arm_t* dyn, int ninst, int a)
{
for(int i=0; i<24; ++i)
@@ -474,6 +159,14 @@ int neoncache_get_st_f_noback(dynarec_arm_t* dyn, int ninst, int a)
return i;
return -1;
}
+int neoncache_get_st_f_i64_noback(dynarec_arm_t* dyn, int ninst, int a)
+{
+ for(int i=0; i<24; ++i)
+ if((dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_I64 || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_F)
+ && dyn->insts[ninst].n.neoncache[i].n==a)
+ return i;
+ return -1;
+}
int neoncache_get_current_st_f(dynarec_arm_t* dyn, int a)
{
for(int i=0; i<24; ++i)
@@ -482,6 +175,14 @@ int neoncache_get_current_st_f(dynarec_arm_t* dyn, int a)
return i;
return -1;
}
+int neoncache_get_current_st_f_i64(dynarec_arm_t* dyn, int a)
+{
+ for(int i=0; i<24; ++i)
+ if((dyn->n.neoncache[i].t==NEON_CACHE_ST_I64 || dyn->n.neoncache[i].t==NEON_CACHE_ST_F)
+ && dyn->n.neoncache[i].n==a)
+ return i;
+ return -1;
+}
static void neoncache_promote_double_forward(dynarec_arm_t* dyn, int ninst, int maxinst, int a);
static void neoncache_promote_double_internal(dynarec_arm_t* dyn, int ninst, int maxinst, int a);
static void neoncache_promote_double_combined(dynarec_arm_t* dyn, int ninst, int maxinst, int a)
@@ -491,7 +192,7 @@ static void neoncache_promote_double_combined(dynarec_arm_t* dyn, int ninst, int
a = dyn->insts[ninst].n.combined2;
} else
a = dyn->insts[ninst].n.combined1;
- int i = neoncache_get_st_f_noback(dyn, ninst, a);
+ int i = neoncache_get_st_f_i64_noback(dyn, ninst, a);
//if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_combined, ninst=%d combined%c %d i=%d (stack:%d/%d)\n", ninst, (a == dyn->insts[ninst].n.combined2)?'2':'1', a ,i, dyn->insts[ninst].n.stack_push, -dyn->insts[ninst].n.stack_pop);
if(i>=0) {
dyn->insts[ninst].n.neoncache[i].t = NEON_CACHE_ST_D;
@@ -510,7 +211,7 @@ static void neoncache_promote_double_internal(dynarec_arm_t* dyn, int ninst, int
return;
while(ninst>=0) {
a+=dyn->insts[ninst].n.stack_pop; // adjust Stack depth: add pop'd ST (going backward)
- int i = neoncache_get_st_f(dyn, ninst, a);
+ int i = neoncache_get_st_f_i64(dyn, ninst, a);
//if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_internal, ninst=%d, a=%d st=%d:%d, i=%d\n", ninst, a, dyn->insts[ninst].n.stack, dyn->insts[ninst].n.stack_next, i);
if(i<0) return;
dyn->insts[ninst].n.neoncache[i].t = NEON_CACHE_ST_D;
@@ -545,7 +246,7 @@ static void neoncache_promote_double_forward(dynarec_arm_t* dyn, int ninst, int
else if (a==dyn->insts[ninst].n.combined2)
a = dyn->insts[ninst].n.combined1;
}
- int i = neoncache_get_st_f_noback(dyn, ninst, a);
+ int i = neoncache_get_st_f_i64_noback(dyn, ninst, a);
//if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_forward, ninst=%d, a=%d st=%d:%d(%d/%d), i=%d\n", ninst, a, dyn->insts[ninst].n.stack, dyn->insts[ninst].n.stack_next, dyn->insts[ninst].n.stack_push, -dyn->insts[ninst].n.stack_pop, i);
if(i<0) return;
dyn->insts[ninst].n.neoncache[i].t = NEON_CACHE_ST_D;
@@ -566,7 +267,7 @@ static void neoncache_promote_double_forward(dynarec_arm_t* dyn, int ninst, int
void neoncache_promote_double(dynarec_arm_t* dyn, int ninst, int a)
{
- int i = neoncache_get_current_st_f(dyn, a);
+ int i = neoncache_get_current_st_f_i64(dyn, a);
//if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double, ninst=%d a=%d st=%d i=%d\n", ninst, a, dyn->n.stack, i);
if(i<0) return;
dyn->n.neoncache[i].t = NEON_CACHE_ST_D;
@@ -599,31 +300,23 @@ int neoncache_combine_st(dynarec_arm_t* dyn, int ninst, int a, int b)
if( neoncache_get_current_st(dyn, ninst, a)==NEON_CACHE_ST_F
&& neoncache_get_current_st(dyn, ninst, b)==NEON_CACHE_ST_F )
return NEON_CACHE_ST_F;
+ // don't combine i64, it's only for load/store
+ /*if( neoncache_get_current_st(dyn, ninst, a)==NEON_CACHE_ST_I64
+ && neoncache_get_current_st(dyn, ninst, b)==NEON_CACHE_ST_I64 )
+ return NEON_CACHE_ST_I64;*/
return NEON_CACHE_ST_D;
}
-int isPred(dynarec_arm_t* dyn, int ninst, int pred) {
- for(int i=0; i<dyn->insts[ninst].pred_sz; ++i)
- if(dyn->insts[ninst].pred[i]==pred)
- return pred;
- return -1;
-}
-int getNominalPred(dynarec_arm_t* dyn, int ninst) {
- if((ninst<=0) || !dyn->insts[ninst].pred_sz)
- return -1;
- if(isPred(dyn, ninst, ninst-1)!=-1)
- return ninst-1;
- return dyn->insts[ninst].pred[0];
-}
-
-int isCacheEmpty(dynarec_arm_t* dyn, int ninst) {
+static int isCacheEmpty(dynarec_native_t* dyn, int ninst) {
if(dyn->insts[ninst].n.stack_next) {
return 0;
}
for(int i=0; i<24; ++i)
if(dyn->insts[ninst].n.neoncache[i].v) { // there is something at ninst for i
if(!(
- (dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_F || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_D)
+ (dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_F
+ || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_D
+ || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_I64)
&& dyn->insts[ninst].n.neoncache[i].n<dyn->insts[ninst].n.stack_pop))
return 0;
}
@@ -631,7 +324,7 @@ int isCacheEmpty(dynarec_arm_t* dyn, int ninst) {
}
-static int fpuCacheNeedsTransform(dynarec_arm_t* dyn, int ninst) {
+int fpuCacheNeedsTransform(dynarec_arm_t* dyn, int ninst) {
int i2 = dyn->insts[ninst].x64.jmp_insts;
if(i2<0)
return 1;
@@ -646,7 +339,9 @@ static int fpuCacheNeedsTransform(dynarec_arm_t* dyn, int ninst) {
for(int i=0; i<24 && !ret; ++i)
if(dyn->insts[ninst].n.neoncache[i].v) { // there is something at ninst for i
if(!(
- (dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_F || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_D)
+ (dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_F
+ || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_D
+ || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_I64)
&& dyn->insts[ninst].n.neoncache[i].n<dyn->insts[ninst].n.stack_pop))
ret = 1;
}
@@ -678,48 +373,6 @@ static int fpuCacheNeedsTransform(dynarec_arm_t* dyn, int ninst) {
return ret;
}
-static int flagsCacheNeedsTransform(dynarec_arm_t* dyn, int ninst) {
- int jmp = dyn->insts[ninst].x64.jmp_insts;
- if(jmp<0)
- return 0;
- if(dyn->insts[ninst].f_exit.dfnone) // flags are fully known, nothing we can do more
- return 0;
-/* if((dyn->f.pending!=SF_SET)
- && (dyn->f.pending!=SF_SET_PENDING)) {
- if(dyn->f.pending!=SF_PENDING) {*/
- switch (dyn->insts[jmp].f_entry.pending) {
- case SF_UNKNOWN: return 0;
- case SF_SET:
- if(dyn->insts[ninst].f_exit.pending!=SF_SET && dyn->insts[ninst].f_exit.pending!=SF_SET_PENDING)
- return 1;
- else
- return 0;
- case SF_SET_PENDING:
- if(dyn->insts[ninst].f_exit.pending!=SF_SET
- && dyn->insts[ninst].f_exit.pending!=SF_SET_PENDING
- && dyn->insts[ninst].f_exit.pending!=SF_PENDING)
- return 1;
- else
- return 0;
- case SF_PENDING:
- if(dyn->insts[ninst].f_exit.pending!=SF_SET
- && dyn->insts[ninst].f_exit.pending!=SF_SET_PENDING
- && dyn->insts[ninst].f_exit.pending!=SF_PENDING)
- return 1;
- else
- return (dyn->insts[jmp].f_entry.dfnone == dyn->insts[ninst].f_exit.dfnone)?0:1;
- }
- if(dyn->insts[jmp].f_entry.dfnone && !dyn->insts[ninst].f_exit.dfnone)
- return 1;
- return 0;
-}
-int CacheNeedsTransform(dynarec_arm_t* dyn, int ninst) {
- int ret = 0;
- if (fpuCacheNeedsTransform(dyn, ninst)) ret|=1;
- if (flagsCacheNeedsTransform(dyn, ninst)) ret|=2;
- return ret;
-}
-
void neoncacheUnwind(neoncache_t* cache)
{
if(cache->swapped) {
@@ -727,7 +380,7 @@ void neoncacheUnwind(neoncache_t* cache)
int a = -1;
int b = -1;
for(int j=0; j<24 && ((a==-1) || (b==-1)); ++j)
- if((cache->neoncache[j].t == NEON_CACHE_ST_D || cache->neoncache[j].t == NEON_CACHE_ST_F)) {
+ if((cache->neoncache[j].t == NEON_CACHE_ST_D || cache->neoncache[j].t == NEON_CACHE_ST_F || cache->neoncache[j].t == NEON_CACHE_ST_I64)) {
if(cache->neoncache[j].n == cache->combined1)
a = j;
else if(cache->neoncache[j].n == cache->combined2)
@@ -751,7 +404,7 @@ void neoncacheUnwind(neoncache_t* cache)
if(cache->stack_push) {
// unpush
for(int j=0; j<24; ++j) {
- if((cache->neoncache[j].t == NEON_CACHE_ST_D || cache->neoncache[j].t == NEON_CACHE_ST_F)) {
+ if((cache->neoncache[j].t == NEON_CACHE_ST_D || cache->neoncache[j].t == NEON_CACHE_ST_F || cache->neoncache[j].t == NEON_CACHE_ST_I64)) {
if(cache->neoncache[j].n<cache->stack_push)
cache->neoncache[j].v = 0;
else
@@ -796,6 +449,7 @@ void neoncacheUnwind(neoncache_t* cache)
break;
case NEON_CACHE_ST_F:
case NEON_CACHE_ST_D:
+ case NEON_CACHE_ST_I64:
cache->x87cache[x87reg] = cache->neoncache[i].n;
cache->x87reg[x87reg] = i;
++x87reg;
@@ -813,7 +467,6 @@ void neoncacheUnwind(neoncache_t* cache)
}
#define F8 *(uint8_t*)(addr++)
-#define F32 *(uint32_t*)(addr+=4, addr-4)
#define F32S64 (uint64_t)(int64_t)*(int32_t*)(addr+=4, addr-4)
// Get if ED will have the correct parity. Not emiting anything. Parity is 2 for DWORD or 3 for QWORD
int getedparity(dynarec_arm_t* dyn, int ninst, uintptr_t addr, uint8_t nextop, int parity, int delta)
@@ -853,64 +506,8 @@ int getedparity(dynarec_arm_t* dyn, int ninst, uintptr_t addr, uint8_t nextop, i
return 0; //Form [reg1 + reg2<<N + XXXXXX]
}
}
-
-// Do the GETED, but don't emit anything...
-uintptr_t fakeed(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop)
-{
- (void)dyn; (void)addr; (void)ninst;
-
- if((nextop&0xC0)==0xC0)
- return addr;
- if(!(nextop&0xC0)) {
- if((nextop&7)==4) {
- uint8_t sib = F8;
- if((sib&0x7)==5) {
- addr+=4;
- }
- } else if((nextop&7)==5) {
- addr+=4;
- }
- } else {
- if((nextop&7)==4) {
- ++addr;
- }
- if(nextop&0x80) {
- addr+=4;
- } else {
- ++addr;
- }
- }
- return addr;
-}
#undef F8
-#undef F32
-
-int isNativeCall(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t* calladdress, int* retn)
-{
- (void)dyn;
-
-#define PK(a) *(uint8_t*)(addr+a)
-#define PK32(a) *(int32_t*)(addr+a)
-
- if(!addr || !getProtection(addr))
- return 0;
- if(PK(0)==0xff && PK(1)==0x25) { // "absolute" jump, maybe the GOT (well, RIP relative in fact)
- uintptr_t a1 = addr + 6 + (PK32(2)); // need to add a check to see if the address is from the GOT !
- addr = (uintptr_t)getAlternate(*(void**)a1);
- }
- if(!addr || !getProtection(addr))
- return 0;
- onebridge_t *b = (onebridge_t*)(addr);
- if(b->CC==0xCC && b->S=='S' && b->C=='C' && b->w!=(wrapper_t)0 && b->f!=(uintptr_t)PltResolver) {
- // found !
- if(retn) *retn = (b->C3==0xC2)?b->N:0;
- if(calladdress) *calladdress = addr+1;
- return 1;
- }
- return 0;
-#undef PK32
-#undef PK
-}
+#undef F32S64
const char* getCacheName(int t, int n)
{
@@ -918,6 +515,7 @@ const char* getCacheName(int t, int n)
switch(t) {
case NEON_CACHE_ST_D: sprintf(buff, "ST%d", n); break;
case NEON_CACHE_ST_F: sprintf(buff, "st%d", n); break;
+ case NEON_CACHE_ST_I64: sprintf(buff, "STi%d", n); break;
case NEON_CACHE_MM: sprintf(buff, "MM%d", n); break;
case NEON_CACHE_XMMW: sprintf(buff, "XMM%d", n); break;
case NEON_CACHE_XMMR: sprintf(buff, "xmm%d", n); break;
@@ -927,20 +525,59 @@ const char* getCacheName(int t, int n)
return buff;
}
-// is inst clean for a son branch?
-int isInstClean(dynarec_arm_t* dyn, int ninst)
-{
- // check flags cache
- if(dyn->insts[ninst].f_entry.dfnone || dyn->insts[ninst].f_entry.pending)
- return 0;
- if(dyn->insts[ninst].x64.state_flags)
- return 0;
- // check neoncache
- neoncache_t* n = &dyn->insts[ninst].n;
- if(n->news || n->stack || n->stack_next)
- return 0;
- for(int i=0; i<24; ++i)
- if(n->neoncache[i].v)
- return 0;
- return 1;
+void inst_name_pass3(dynarec_native_t* dyn, int ninst, const char* name, rex_t rex)
+{
+ if(box64_dynarec_dump) {
+ printf_x64_instruction(rex.is32bits?my_context->dec32:my_context->dec, &dyn->insts[ninst].x64, name);
+ dynarec_log(LOG_NONE, "%s%p: %d emitted opcodes, inst=%d, barrier=%d state=%d/%d(%d), %s=%X/%X, use=%X, need=%X/%X, sm=%d/%d",
+ (box64_dynarec_dump>1)?"\e[32m":"",
+ (void*)(dyn->native_start+dyn->insts[ninst].address),
+ dyn->insts[ninst].size/4,
+ ninst,
+ dyn->insts[ninst].x64.barrier,
+ dyn->insts[ninst].x64.state_flags,
+ dyn->f.pending,
+ dyn->f.dfnone,
+ dyn->insts[ninst].x64.may_set?"may":"set",
+ dyn->insts[ninst].x64.set_flags,
+ dyn->insts[ninst].x64.gen_flags,
+ dyn->insts[ninst].x64.use_flags,
+ dyn->insts[ninst].x64.need_before,
+ dyn->insts[ninst].x64.need_after,
+ dyn->smread, dyn->smwrite);
+ if(dyn->insts[ninst].pred_sz) {
+ dynarec_log(LOG_NONE, ", pred=");
+ for(int ii=0; ii<dyn->insts[ninst].pred_sz; ++ii)
+ dynarec_log(LOG_NONE, "%s%d", ii?"/":"", dyn->insts[ninst].pred[ii]);
+ }
+ if(dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts>=0)
+ dynarec_log(LOG_NONE, ", jmp=%d", dyn->insts[ninst].x64.jmp_insts);
+ if(dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts==-1)
+ dynarec_log(LOG_NONE, ", jmp=out");
+ if(dyn->last_ip)
+ dynarec_log(LOG_NONE, ", last_ip=%p", (void*)dyn->last_ip);
+ for(int ii=0; ii<24; ++ii) {
+ switch(dyn->insts[ninst].n.neoncache[ii].t) {
+ case NEON_CACHE_ST_D: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break;
+ case NEON_CACHE_ST_F: dynarec_log(LOG_NONE, " S%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break;
+ case NEON_CACHE_ST_I64: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break;
+ case NEON_CACHE_MM: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break;
+ case NEON_CACHE_XMMW: dynarec_log(LOG_NONE, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break;
+ case NEON_CACHE_XMMR: dynarec_log(LOG_NONE, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break;
+ case NEON_CACHE_SCR: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break;
+ case NEON_CACHE_NONE:
+ default: break;
+ }
+ }
+ if(dyn->n.stack || dyn->insts[ninst].n.stack_next || dyn->insts[ninst].n.x87stack)
+ dynarec_log(LOG_NONE, " X87:%d/%d(+%d/-%d)%d", dyn->n.stack, dyn->insts[ninst].n.stack_next, dyn->insts[ninst].n.stack_push, dyn->insts[ninst].n.stack_pop, dyn->insts[ninst].n.x87stack);
+ if(dyn->insts[ninst].n.combined1 || dyn->insts[ninst].n.combined2)
+ dynarec_log(LOG_NONE, " %s:%d/%d", dyn->insts[ninst].n.swapped?"SWP":"CMB", dyn->insts[ninst].n.combined1, dyn->insts[ninst].n.combined2);
+ dynarec_log(LOG_NONE, "%s\n", (box64_dynarec_dump>1)?"\e[m":"");
+ }
}
+
+void print_opcode(dynarec_native_t* dyn, int ninst, uint32_t opcode)
+{
+ dynarec_log(LOG_NONE, "\t%08x\t%s\n", opcode, arm64_print(opcode, (uintptr_t)dyn->block));
+} \ No newline at end of file
diff --git a/src/dynarec/arm64/dynarec_arm64_functions.h b/src/dynarec/arm64/dynarec_arm64_functions.h
index f8d5d12..db31887 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_functions.h
+++ b/src/dynarec/arm64/dynarec_arm64_functions.h
@@ -1,46 +1,7 @@
#ifndef __DYNAREC_ARM_FUNCTIONS_H__
#define __DYNAREC_ARM_FUNCTIONS_H__
-typedef struct x64emu_s x64emu_t;
-
-void arm_fstp(x64emu_t* emu, void* p);
-
-void arm_print_armreg(x64emu_t* emu, uintptr_t reg, uintptr_t n);
-
-void arm_f2xm1(x64emu_t* emu);
-void arm_fyl2x(x64emu_t* emu);
-void arm_ftan(x64emu_t* emu);
-void arm_fpatan(x64emu_t* emu);
-void arm_fxtract(x64emu_t* emu);
-void arm_fprem(x64emu_t* emu);
-void arm_fyl2xp1(x64emu_t* emu);
-void arm_fsincos(x64emu_t* emu);
-void arm_frndint(x64emu_t* emu);
-void arm_fscale(x64emu_t* emu);
-void arm_fsin(x64emu_t* emu);
-void arm_fcos(x64emu_t* emu);
-void arm_fbld(x64emu_t* emu, uint8_t* ed);
-void arm_fild64(x64emu_t* emu, int64_t* ed);
-void arm_fbstp(x64emu_t* emu, uint8_t* ed);
-void arm_fistp64(x64emu_t* emu, int64_t* ed);
-void arm_fistt64(x64emu_t* emu, int64_t* ed);
-void arm_fld(x64emu_t* emu, uint8_t* ed);
-void arm_fsave(x64emu_t* emu, uint8_t* ed);
-void arm_frstor(x64emu_t* emu, uint8_t* ed);
-void arm_fprem1(x64emu_t* emu);
-
-void arm_aesd(x64emu_t* emu, int xmm);
-void arm_aese(x64emu_t* emu, int xmm);
-void arm_aesdlast(x64emu_t* emu, int xmm);
-void arm_aeselast(x64emu_t* emu, int xmm);
-void arm_aesimc(x64emu_t* emu, int xmm);
-void arm_aeskeygenassist(x64emu_t* emu, int gx, int ex, void* p, uint32_t u8);
-void arm_pclmul(x64emu_t* emu, int gx, int ex, void* p, uint32_t u8);
-
-void arm_clflush(x64emu_t* emu, void* p);
-
-void arm_ud(x64emu_t* emu);
-void arm_priv(x64emu_t* emu);
+#include "../dynarec_native_functions.h"
// Get an FPU scratch reg
int fpu_get_scratch(dynarec_arm_t* dyn);
@@ -60,38 +21,32 @@ void fpu_reset_reg(dynarec_arm_t* dyn);
// ---- Neon cache functions
// Get type for STx
int neoncache_get_st(dynarec_arm_t* dyn, int ninst, int a);
-// Get if STx is FLOAT or DOUBLE
+// Get if STx is FLOAT
int neoncache_get_st_f(dynarec_arm_t* dyn, int ninst, int a);
+// Get if STx is FLOAT or I64
+int neoncache_get_st_f_i64(dynarec_arm_t* dyn, int ninst, int a);
// Get actual type for STx
int neoncache_get_current_st(dynarec_arm_t* dyn, int ninst, int a);
-// Get actual STx is FLOAT or DOUBLE
+// Get actual STx is FLOAT
int neoncache_get_current_st_f(dynarec_arm_t* dyn, int a);
+// Get actual STx is FLOAT or I64
+int neoncache_get_current_st_f_i64(dynarec_arm_t* dyn, int a);
// Back-propagate a change float->double
void neoncache_promote_double(dynarec_arm_t* dyn, int ninst, int a);
// Combine and propagate if needed (pass 1 only)
int neoncache_combine_st(dynarec_arm_t* dyn, int ninst, int a, int b); // with stack current dyn->n_stack*
-// FPU Cache transformation (for loops)
-int CacheNeedsTransform(dynarec_arm_t* dyn, int i1);
+// FPU Cache transformation (for loops) // Specific, need to be written by backend
+int fpuCacheNeedsTransform(dynarec_arm_t* dyn, int ninst);
// Undo the changes of a neoncache to get the status before the instruction
void neoncacheUnwind(neoncache_t* cache);
-// is inst clean for a son branch?
-int isInstClean(dynarec_arm_t* dyn, int ninst);
-
-// predecessor access
-int isPred(dynarec_arm_t* dyn, int ninst, int pred);
-int getNominalPred(dynarec_arm_t* dyn, int ninst);
-
// Get if ED will have the correct parity. Not emiting anything. Parity is 2 for DWORD or 3 for QWORD
-int getedparity(dynarec_arm_t* dyn, int ninst, uintptr_t addr, uint8_t nextop, int parity, int delta);
-// Do the GETED, but don't emit anything...
-uintptr_t fakeed(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop);
-
-// Is what pointed at addr a native call? And if yes, to what function?
-int isNativeCall(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t* calladdress, int* retn);
+int getedparity(dynarec_native_t* dyn, int ninst, uintptr_t addr, uint8_t nextop, int parity, int delta);
const char* getCacheName(int t, int n);
-#endif //__DYNAREC_ARM_FUNCTIONS_H__ \ No newline at end of file
+void inst_name_pass3(dynarec_native_t* dyn, int ninst, const char* name, rex_t rex);
+void print_opcode(dynarec_native_t* dyn, int ninst, uint32_t opcode);
+#endif //__DYNAREC_ARM_FUNCTIONS_H__
diff --git a/src/dynarec/arm64/dynarec_arm64_helper.c b/src/dynarec/arm64/dynarec_arm64_helper.c
index aa09934..13b5835 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_helper.c
+++ b/src/dynarec/arm64/dynarec_arm64_helper.c
@@ -1,9 +1,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include <assert.h>
+#include <string.h>
#include "debug.h"
#include "box64context.h"
@@ -18,7 +18,6 @@
#include "x64trace.h"
#include "dynarec_native.h"
#include "../dynablock_private.h"
-#include "../tools/bridge_private.h"
#include "custommem.h"
#include "arm64_printer.h"
@@ -26,12 +25,19 @@
#include "dynarec_arm64_functions.h"
#include "dynarec_arm64_helper.h"
+static uintptr_t geted_32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, int* l, int s);
+
/* setup r2 to address pointed by ED, also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */
-uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int absmax, uint32_t mask, rex_t rex, int *l, int s, int delta)
+uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, rex_t rex, int *l, int s, int delta)
{
MAYUSE(dyn); MAYUSE(ninst); MAYUSE(delta);
+ if(rex.is32bits)
+ return geted_32(dyn, addr, ninst, nextop, ed, hint, fixaddress, unscaled, absmax, mask, l, s);
+
int lock = l?((l==LOCK_LOCK)?1:2):0;
+ if(unscaled)
+ *unscaled = 0;
if(lock==2)
*l = 0;
uint8_t ret = x2;
@@ -49,11 +55,16 @@ uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, u
if((sib&0x7)==5) {
int64_t tmp = F32S;
if (sib_reg!=4) {
- if(tmp && ((tmp<absmin) || (tmp>absmax) || (tmp&mask))) {
+ if(tmp && (!((tmp>=absmin) && (tmp<=absmax) && !(tmp&mask))) || !(unscaled && (tmp>-256) && (tmp<256))) {
MOV64x(scratch, tmp);
ADDx_REG_LSL(ret, scratch, xRAX+sib_reg, (sib>>6));
} else {
- LSLx(ret, xRAX+sib_reg, (sib>>6));
+ if(sib>>6) {
+ LSLx(ret, xRAX+sib_reg, (sib>>6));
+ } else
+ ret = xRAX+sib_reg;
+ if(unscaled && (tmp>-256) && (tmp<256))
+ *unscaled = 1;
*fixaddress = tmp;
}
} else {
@@ -71,14 +82,22 @@ uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, u
}
}
} else if((nextop&7)==5) {
- uint64_t tmp = F32S64;
+ int64_t tmp = F32S64;
if((tmp>=absmin) && (tmp<=absmax) && !(tmp&mask)) {
GETIP(addr+delta);
ret = xRIP;
*fixaddress = tmp;
- } else if(tmp<0x1000) {
+ } else if(unscaled && (tmp>-256) && (tmp<256)) {
+ GETIP(addr+delta);
+ ret = xRIP;
+ *fixaddress = tmp;
+ *unscaled = 1;
+ } else if(tmp>0 && tmp<0x1000) {
GETIP(addr+delta);
ADDx_U12(ret, xRIP, tmp);
+ } else if(tmp<0 && tmp>-0x1000) {
+ GETIP(addr+delta);
+ SUBx_U12(ret, xRIP, -tmp);
} else if(tmp+addr+delta<0x1000000000000LL) { // 3 opcodes to load immediate is cheap enough
MOV64x(ret, tmp+addr+delta);
} else {
@@ -103,10 +122,12 @@ uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, u
}
if(nextop&0x80)
i64 = F32S;
- else
+ else
i64 = F8S;
- if(i64==0 || ((i64>=absmin) && (i64<=absmax) && !(i64&mask))) {
+ if(i64==0 || ((i64>=absmin) && (i64<=absmax) && !(i64&mask)) || (unscaled && (i64>-256) && (i64<256))) {
*fixaddress = i64;
+ if(unscaled && (i64>-256) && (i64<256))
+ *unscaled = 1;
if((nextop&7)==4) {
if (sib_reg!=4) {
ADDx_REG_LSL(ret, xRAX+(sib&0x07)+(rex.b<<3), xRAX+sib_reg, (sib>>6));
@@ -165,12 +186,149 @@ uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, u
return addr;
}
+static uintptr_t geted_32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, int* l, int s)
+{
+ MAYUSE(dyn); MAYUSE(ninst);
+
+ int lock = l?((l==LOCK_LOCK)?1:2):0;
+ if(unscaled)
+ *unscaled = 0;
+ if(lock==2)
+ *l = 0;
+ uint8_t ret = x2;
+ uint8_t scratch = x2;
+ *fixaddress = 0;
+ if(hint>0) ret = hint;
+ if(hint>0 && hint<xRAX) scratch = hint;
+ int absmin = 0;
+ if(s) absmin=-absmax;
+ MAYUSE(scratch);
+ if(!(nextop&0xC0)) {
+ if((nextop&7)==4) {
+ uint8_t sib = F8;
+ int sib_reg = (sib>>3)&7;
+ if((sib&0x7)==5) {
+ int64_t tmp = F32S;
+ if (sib_reg!=4) {
+ if(tmp && (!((tmp>=absmin) && (tmp<=absmax) && !(tmp&mask))) || !(unscaled && (tmp>-256) && (tmp<256))) {
+ MOV32w(scratch, tmp);
+ ADDw_REG_LSL(ret, scratch, xRAX+sib_reg, (sib>>6));
+ } else {
+ LSLw(ret, xRAX+sib_reg, (sib>>6));
+ *fixaddress = tmp;
+ if(unscaled && (tmp>-256) && (tmp<256))
+ *unscaled = 1;
+ }
+ } else {
+ switch(lock) {
+ case 1: addLockAddress((int32_t)tmp); break;
+ case 2: if(isLockAddress((int32_t)tmp)) *l=1; break;
+ }
+ MOV32w(ret, tmp);
+ }
+ } else {
+ if (sib_reg!=4) {
+ ADDw_REG_LSL(ret, xRAX+(sib&0x7), xRAX+sib_reg, (sib>>6));
+ } else {
+ ret = xRAX+(sib&0x7);
+ }
+ }
+ } else if((nextop&7)==5) {
+ uint64_t tmp = F32;
+ MOV32w(ret, tmp);
+ switch(lock) {
+ case 1: addLockAddress(tmp); break;
+ case 2: if(isLockAddress(tmp)) *l=1; break;
+ }
+ } else {
+ ret = xRAX+(nextop&7);
+ if(ret==hint) {
+ MOVw_REG(hint, ret); //to clear upper part
+ }
+ }
+ } else {
+ int64_t i32;
+ uint8_t sib = 0;
+ int sib_reg = 0;
+ if((nextop&7)==4) {
+ sib = F8;
+ sib_reg = (sib>>3)&7;
+ }
+ if(nextop&0x80)
+ i32 = F32S;
+ else
+ i32 = F8S;
+ if(i32==0 || ((i32>=absmin) && (i32<=absmax) && !(i32&mask)) || (unscaled && (i32>-256) && (i32<256))) {
+ *fixaddress = i32;
+ if(unscaled && (i32>-256) && (i32<256))
+ *unscaled = 1;
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ ADDw_REG_LSL(ret, xRAX+(sib&0x07), xRAX+sib_reg, (sib>>6));
+ } else {
+ ret = xRAX+(sib&0x07);
+ }
+ } else {
+ ret = xRAX+(nextop&0x07);
+ }
+ } else {
+ int64_t sub = (i32<0)?1:0;
+ if(sub) i32 = -i32;
+ if(i32<0x1000) {
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ ADDw_REG_LSL(scratch, xRAX+(sib&0x07), xRAX+sib_reg, (sib>>6));
+ } else {
+ scratch = xRAX+(sib&0x07);
+ }
+ } else
+ scratch = xRAX+(nextop&0x07);
+ if(sub) {
+ SUBw_U12(ret, scratch, i32);
+ } else {
+ ADDw_U12(ret, scratch, i32);
+ }
+ } else {
+ MOV32w(scratch, i32);
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ if(sub) {
+ SUBw_REG(scratch, xRAX+(sib&0x07), scratch);
+ } else {
+ ADDw_REG(scratch, scratch, xRAX+(sib&0x07));
+ }
+ ADDw_REG_LSL(ret, scratch, xRAX+sib_reg, (sib>>6));
+ } else {
+ PASS3(int tmp = xRAX+(sib&0x07));
+ if(sub) {
+ SUBw_REG(ret, tmp, scratch);
+ } else {
+ ADDw_REG(ret, tmp, scratch);
+ }
+ }
+ } else {
+ PASS3(int tmp = xRAX+(nextop&0x07));
+ if(sub) {
+ SUBw_REG(ret, tmp, scratch);
+ } else {
+ ADDw_REG(ret, tmp, scratch);
+ }
+ }
+ }
+ }
+ }
+ *ed = ret;
+ return addr;
+}
+
/* setup r2 to address pointed by ED, also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */
-uintptr_t geted32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int absmax, uint32_t mask, rex_t rex, int* l, int s, int delta)
+uintptr_t geted32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, rex_t rex, int* l, int s, int delta)
{
MAYUSE(dyn); MAYUSE(ninst); MAYUSE(delta);
int lock = l?((l==LOCK_LOCK)?1:2):0;
+ if(unscaled)
+ *unscaled = 0;
if(lock==2)
*l = 0;
uint8_t ret = x2;
@@ -188,12 +346,14 @@ uintptr_t geted32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop,
if((sib&0x7)==5) {
int64_t tmp = F32S;
if (sib_reg!=4) {
- if(tmp && ((tmp<absmin) || (tmp>absmax) || (tmp&mask))) {
+ if(tmp && (!((tmp>=absmin) && (tmp<=absmax) && !(tmp&mask))) || !(unscaled && (tmp>-256) && (tmp<256))) {
MOV64x(scratch, tmp);
ADDw_REG_LSL(ret, scratch, xRAX+sib_reg, (sib>>6));
} else {
LSLw(ret, xRAX+sib_reg, (sib>>6));
*fixaddress = tmp;
+ if(unscaled && (tmp>-256) && (tmp<256))
+ *unscaled = 1;
}
} else {
switch(lock) {
@@ -234,10 +394,12 @@ uintptr_t geted32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop,
}
if(nextop&0x80)
i64 = F32S;
- else
+ else
i64 = F8S;
- if(i64==0 || ((i64>=absmin) && (i64<=absmax) && !(i64&mask))) {
+ if(i64==0 || ((i64>=absmin) && (i64<=absmax) && !(i64&mask)) || (unscaled && (i64>-256) && (i64<256))) {
*fixaddress = i64;
+ if(unscaled && (i64>-256) && (i64<256))
+ *unscaled = 1;
if((nextop&7)==4) {
if (sib_reg!=4) {
ADDw_REG_LSL(ret, xRAX+(sib&0x07)+(rex.b<<3), xRAX+sib_reg, (sib>>6));
@@ -298,10 +460,12 @@ uintptr_t geted32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop,
}
/* setup r2 to address pointed by ED, r3 as scratch also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */
-uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int absmax, uint32_t mask, int s)
+uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, int s)
{
MAYUSE(dyn); MAYUSE(ninst);
+ if(unscaled)
+ *unscaled = 0;
uint8_t ret = x2;
uint8_t scratch = x3;
*fixaddress = 0;
@@ -313,8 +477,8 @@ uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop,
int64_t offset = 0;
int absmin = 0;
if(s) absmin = -absmax;
- if(!n && m==6) {
- offset = F16;
+ if(!n && (m&7)==6) {
+ offset = F16S;
MOVZw(ret, offset);
} else {
switch(n) {
@@ -322,7 +486,11 @@ uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop,
case 1: offset = F8S; break;
case 2: offset = F16S; break;
}
- if(offset && (offset>absmax || offset<absmin || (offset&mask))) {
+ if(offset && (offset>=absmax && offset<=absmin && !(offset&mask))) {
+ *fixaddress = offset;
+ offset = 0;
+ }
+ if(offset && (unscaled && offset>-256 && offset<256)) {
*fixaddress = offset;
offset = 0;
}
@@ -388,6 +556,7 @@ void jump_to_epilog(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst)
} else {
GETIP_(ip);
}
+ NOTEST(x2);
TABLE64(x2, (uintptr_t)arm64_epilog);
SMEND();
BR(x2);
@@ -402,6 +571,7 @@ void jump_to_next(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst)
if(reg!=xRIP) {
MOVx_REG(xRIP, reg);
}
+ NOTEST(x2);
uintptr_t tbl = getJumpTable64();
MAYUSE(tbl);
TABLE64(x3, tbl);
@@ -414,6 +584,7 @@ void jump_to_next(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst)
UBFXx(x2, xRIP, JMPTABL_START0, JMPTABL_SHIFT0);
LDRx_REG_LSL3(x2, x3, x2);
} else {
+ NOTEST(x2);
uintptr_t p = getJumpTableAddress64(ip);
MAYUSE(p);
TABLE64(x3, p);
@@ -425,18 +596,18 @@ void jump_to_next(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst)
}
CLEARIP();
#ifdef HAVE_TRACE
- //MOVx(x3, 15); no access to PC reg
+ //MOVx(x3, 15); no access to PC reg
#endif
SMEND();
BLR(x2); // save LR...
}
-void ret_to_epilog(dynarec_arm_t* dyn, int ninst)
+void ret_to_epilog(dynarec_arm_t* dyn, int ninst, rex_t rex)
{
MAYUSE(dyn); MAYUSE(ninst);
MESSAGE(LOG_DUMP, "Ret to epilog\n");
- POP1(xRIP);
- MOVx_REG(x1, xRIP);
+ POP1z(xRIP);
+ MOVz_REG(x1, xRIP);
SMEND();
if(box64_dynarec_callret) {
// pop the actual return address for ARM stack
@@ -449,6 +620,7 @@ void ret_to_epilog(dynarec_arm_t* dyn, int ninst)
// not the correct return address, regular jump
}
uintptr_t tbl = getJumpTable64();
+ NOTEST(x2);
MOV64x(x2, tbl);
UBFXx(x3, xRIP, JMPTABL_START3, JMPTABL_SHIFT3);
LDRx_REG_LSL3(x2, x2, x3);
@@ -462,18 +634,18 @@ void ret_to_epilog(dynarec_arm_t* dyn, int ninst)
CLEARIP();
}
-void retn_to_epilog(dynarec_arm_t* dyn, int ninst, int n)
+void retn_to_epilog(dynarec_arm_t* dyn, int ninst, rex_t rex, int n)
{
MAYUSE(dyn); MAYUSE(ninst);
MESSAGE(LOG_DUMP, "Retn to epilog\n");
- POP1(xRIP);
+ POP1z(xRIP);
if(n>0xfff) {
MOV32w(w1, n);
- ADDx_REG(xRSP, xRSP, x1);
+ ADDz_REG(xRSP, xRSP, x1);
} else {
- ADDx_U12(xRSP, xRSP, n);
+ ADDz_U12(xRSP, xRSP, n);
}
- MOVx_REG(x1, xRIP);
+ MOVz_REG(x1, xRIP);
SMEND();
if(box64_dynarec_callret) {
// pop the actual return address for ARM stack
@@ -486,6 +658,7 @@ void retn_to_epilog(dynarec_arm_t* dyn, int ninst, int n)
// not the correct return address, regular jump
}
uintptr_t tbl = getJumpTable64();
+ NOTEST(x2);
MOV64x(x2, tbl);
UBFXx(x3, xRIP, JMPTABL_START3, JMPTABL_SHIFT3);
LDRx_REG_LSL3(x2, x2, x3);
@@ -505,24 +678,35 @@ void iret_to_epilog(dynarec_arm_t* dyn, int ninst, int is64bits)
MAYUSE(ninst);
MESSAGE(LOG_DUMP, "IRet to epilog\n");
// POP IP
- POP1(xRIP);
- // POP CS
- POP1(x2);
+ NOTEST(x2);
+ if(is64bits) {
+ POP1(xRIP);
+ POP1(x2);
+ POP1(xFlags);
+ } else {
+ POP1_32(xRIP);
+ POP1_32(x2);
+ POP1_32(xFlags);
+ }
+ // x2 is CS
STRH_U12(x2, xEmu, offsetof(x64emu_t, segs[_CS]));
- MOVZw(x1, 0);
- STRx_U12(x1, xEmu, offsetof(x64emu_t, segs_serial[_CS]));
- STRx_U12(x1, xEmu, offsetof(x64emu_t, segs_serial[_SS]));
- // POP EFLAGS
- POP1(xFlags);
+ STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_CS]));
+ // clean EFLAGS
MOV32w(x1, 0x3F7FD7);
ANDx_REG(xFlags, xFlags, x1);
- ORRx_mask(xFlags, xFlags, 1, 0b111111, 0);
+ ORRx_mask(xFlags, xFlags, 1, 0b111111, 0); // xFlags | 0b10
SET_DFNONE(x1);
// POP RSP
- POP1(x3);
+ if(is64bits) {
+ POP1(x3); //rsp
+ POP1(x2); //ss
+ } else {
+ POP1_32(x3); //rsp
+ POP1_32(x2); //ss
+ }
// POP SS
- POP1(x2);
STRH_U12(x2, xEmu, offsetof(x64emu_t, segs[_SS]));
+ STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_SS]));
// set new RSP
MOVx_REG(xRSP, x3);
// Ret....
@@ -662,7 +846,9 @@ static void x87_reset(dynarec_arm_t* dyn)
dyn->n.swapped = 0;
dyn->n.barrier = 0;
for(int i=0; i<24; ++i)
- if(dyn->n.neoncache[i].t == NEON_CACHE_ST_F || dyn->n.neoncache[i].t == NEON_CACHE_ST_D)
+ if(dyn->n.neoncache[i].t == NEON_CACHE_ST_F
+ || dyn->n.neoncache[i].t == NEON_CACHE_ST_D
+ || dyn->n.neoncache[i].t == NEON_CACHE_ST_I64)
dyn->n.neoncache[i].v = 0;
}
@@ -723,7 +909,9 @@ int x87_do_push(dynarec_arm_t* dyn, int ninst, int s1, int t)
dyn->n.stack_push+=1;
// move all regs in cache, and find a free one
for(int j=0; j<24; ++j)
- if((dyn->n.neoncache[j].t == NEON_CACHE_ST_D) || (dyn->n.neoncache[j].t == NEON_CACHE_ST_F))
+ if((dyn->n.neoncache[j].t == NEON_CACHE_ST_D)
+ ||(dyn->n.neoncache[j].t == NEON_CACHE_ST_F)
+ ||(dyn->n.neoncache[j].t == NEON_CACHE_ST_I64))
++dyn->n.neoncache[j].n;
int ret = -1;
for(int i=0; i<8; ++i)
@@ -732,13 +920,7 @@ int x87_do_push(dynarec_arm_t* dyn, int ninst, int s1, int t)
else if(ret==-1) {
dyn->n.x87cache[i] = 0;
ret=dyn->n.x87reg[i]=fpu_get_reg_x87(dyn, t, 0);
- #if STEP == 1
- // need to check if reg is compatible with float
- if((ret>15) && (t == NEON_CACHE_ST_F))
- dyn->n.neoncache[ret].t = NEON_CACHE_ST_D;
- #else
dyn->n.neoncache[ret].t = X87_ST0;
- #endif
}
return ret;
}
@@ -752,7 +934,9 @@ void x87_do_push_empty(dynarec_arm_t* dyn, int ninst, int s1)
dyn->n.stack_push+=1;
// move all regs in cache
for(int j=0; j<24; ++j)
- if((dyn->n.neoncache[j].t == NEON_CACHE_ST_D) || (dyn->n.neoncache[j].t == NEON_CACHE_ST_F))
+ if((dyn->n.neoncache[j].t == NEON_CACHE_ST_D)
+ ||(dyn->n.neoncache[j].t == NEON_CACHE_ST_F)
+ ||(dyn->n.neoncache[j].t == NEON_CACHE_ST_I64))
++dyn->n.neoncache[j].n;
for(int i=0; i<8; ++i)
if(dyn->n.x87cache[i]!=-1)
@@ -874,10 +1058,29 @@ void x87_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1, int s2, int
MESSAGE(LOG_DUMP, "\t---Purge x87 Cache and Synch Stackcount\n");
}
-#ifdef HAVE_TRACE
static void x87_reflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3)
{
- x87_stackcount(dyn, ninst, s1);
+ // Synch top & stack counter
+ int a = dyn->n.x87stack;
+ if(a) {
+ // Add x87stack to emu fpu_stack
+ LDRw_U12(s2, xEmu, offsetof(x64emu_t, fpu_stack));
+ if(a>0) {
+ ADDw_U12(s2, s2, a);
+ } else {
+ SUBw_U12(s2, s2, -a);
+ }
+ STRw_U12(s2, xEmu, offsetof(x64emu_t, fpu_stack));
+ // Sub x87stack to top, with and 7
+ LDRw_U12(s2, xEmu, offsetof(x64emu_t, top));
+ if(a>0) {
+ SUBw_U12(s2, s2, a);
+ } else {
+ ADDw_U12(s2, s2, -a);
+ }
+ ANDw_mask(s2, s2, 0, 2); //mask=7
+ STRw_U12(s2, xEmu, offsetof(x64emu_t, top));
+ }
int ret = 0;
for (int i=0; (i<8) && (!ret); ++i)
if(dyn->n.x87cache[i] != -1)
@@ -887,7 +1090,9 @@ static void x87_reflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int
// prepare offset to fpu => s1
ADDx_U12(s1, xEmu, offsetof(x64emu_t, x87));
// Get top
- LDRw_U12(s2, xEmu, offsetof(x64emu_t, top));
+ if(!a) {
+ LDRw_U12(s2, xEmu, offsetof(x64emu_t, top));
+ }
// loop all cache entries
for (int i=0; i<8; ++i)
if(dyn->n.x87cache[i]!=-1) {
@@ -896,7 +1101,31 @@ static void x87_reflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int
VSTR64_REG_LSL3(dyn->n.x87reg[i], s1, s3);
}
}
-#endif
+
+static void x87_unreflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3)
+{
+ // go back with the top & stack counter
+ int a = dyn->n.x87stack;
+ if(a) {
+ // Sub x87stack to emu fpu_stack
+ LDRw_U12(s2, xEmu, offsetof(x64emu_t, fpu_stack));
+ if(a>0) {
+ SUBw_U12(s2, s2, a);
+ } else {
+ ADDw_U12(s2, s2, -a);
+ }
+ STRw_U12(s2, xEmu, offsetof(x64emu_t, fpu_stack));
+ // Add x87stack to top, with and 7
+ LDRw_U12(s2, xEmu, offsetof(x64emu_t, top));
+ if(a>0) {
+ ADDw_U12(s2, s2, a);
+ } else {
+ SUBw_U12(s2, s2, -a);
+ }
+ ANDw_mask(s2, s2, 0, 2); //mask=7
+ STRw_U12(s2, xEmu, offsetof(x64emu_t, top));
+ }
+}
int x87_get_current_cache(dynarec_arm_t* dyn, int ninst, int st, int t)
{
@@ -904,7 +1133,9 @@ int x87_get_current_cache(dynarec_arm_t* dyn, int ninst, int st, int t)
for (int i=0; i<8; ++i) {
if(dyn->n.x87cache[i]==st) {
#if STEP == 1
- if(t==NEON_CACHE_ST_D && (dyn->n.neoncache[dyn->n.x87reg[i]].t==NEON_CACHE_ST_F))
+ if(t==NEON_CACHE_ST_D && (dyn->n.neoncache[dyn->n.x87reg[i]].t==NEON_CACHE_ST_F || dyn->n.neoncache[dyn->n.x87reg[i]].t==NEON_CACHE_ST_I64))
+ neoncache_promote_double(dyn, ninst, st);
+ else if(t==NEON_CACHE_ST_F && (dyn->n.neoncache[dyn->n.x87reg[i]].t==NEON_CACHE_ST_I64))
neoncache_promote_double(dyn, ninst, st);
#endif
return i;
@@ -950,7 +1181,9 @@ int x87_get_cache(dynarec_arm_t* dyn, int ninst, int populate, int s1, int s2, i
int x87_get_neoncache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int st)
{
for(int ii=0; ii<24; ++ii)
- if((dyn->n.neoncache[ii].t == NEON_CACHE_ST_F || dyn->n.neoncache[ii].t == NEON_CACHE_ST_D)
+ if((dyn->n.neoncache[ii].t == NEON_CACHE_ST_F
+ || dyn->n.neoncache[ii].t == NEON_CACHE_ST_D
+ || dyn->n.neoncache[ii].t == NEON_CACHE_ST_I64)
&& dyn->n.neoncache[ii].n==st)
return ii;
assert(0);
@@ -988,6 +1221,9 @@ void x87_refresh(dynarec_arm_t* dyn, int ninst, int s1, int s2, int st)
if(dyn->n.neoncache[dyn->n.x87reg[ret]].t==NEON_CACHE_ST_F) {
FCVT_D_S(31, dyn->n.x87reg[ret]);
VSTR64_REG_LSL3(31, s1, s2);
+ } else if(dyn->n.neoncache[dyn->n.x87reg[ret]].t==NEON_CACHE_ST_I64) {
+ SCVTFDD(31, dyn->n.x87reg[ret]);
+ VSTR64_REG_LSL3(31, s1, s2);
} else {
VSTR64_REG_LSL3(dyn->n.x87reg[ret], s1, s2);
}
@@ -1005,7 +1241,7 @@ void x87_forget(dynarec_arm_t* dyn, int ninst, int s1, int s2, int st)
return;
MESSAGE(LOG_DUMP, "\tForget x87 Cache for ST%d\n", st);
#if STEP == 1
- if(dyn->n.neoncache[dyn->n.x87reg[ret]].t==NEON_CACHE_ST_F)
+ if(dyn->n.neoncache[dyn->n.x87reg[ret]].t==NEON_CACHE_ST_F || dyn->n.neoncache[dyn->n.x87reg[ret]].t==NEON_CACHE_ST_I64)
neoncache_promote_double(dyn, ninst, st);
#endif
// prepare offset to fpu => s1
@@ -1036,7 +1272,7 @@ void x87_reget_st(dynarec_arm_t* dyn, int ninst, int s1, int s2, int st)
// refresh the value
MESSAGE(LOG_DUMP, "\tRefresh x87 Cache for ST%d\n", st);
#if STEP == 1
- if(dyn->n.neoncache[dyn->n.x87reg[i]].t==NEON_CACHE_ST_F)
+ if(dyn->n.neoncache[dyn->n.x87reg[i]].t==NEON_CACHE_ST_F || dyn->n.neoncache[dyn->n.x87reg[i]].t==NEON_CACHE_ST_I64)
neoncache_promote_double(dyn, ninst, st);
#endif
ADDx_U12(s1, xEmu, offsetof(x64emu_t, x87));
@@ -1197,7 +1433,7 @@ void mmx_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1)
MESSAGE(LOG_DUMP, "\t------ Purge MMX Cache\n");
}
}
-#ifdef HAVE_TRACE
+
static void mmx_reflectcache(dynarec_arm_t* dyn, int ninst, int s1)
{
for (int i=0; i<8; ++i)
@@ -1205,7 +1441,6 @@ static void mmx_reflectcache(dynarec_arm_t* dyn, int ninst, int s1)
VLDR64_U12(dyn->n.mmxcache[i], xEmu, offsetof(x64emu_t, mmx[i]));
}
}
-#endif
// SSE / SSE2 helpers
@@ -1297,7 +1532,7 @@ static void sse_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1)
MESSAGE(LOG_DUMP, "\t------ Purge SSE Cache\n");
}
}
-#ifdef HAVE_TRACE
+
static void sse_reflectcache(dynarec_arm_t* dyn, int ninst, int s1)
{
for (int i=0; i<16; ++i)
@@ -1305,7 +1540,6 @@ static void sse_reflectcache(dynarec_arm_t* dyn, int ninst, int s1)
VSTR128_U12(dyn->n.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
}
}
-#endif
void fpu_pushcache(dynarec_arm_t* dyn, int ninst, int s1, int not07)
{
@@ -1364,10 +1598,20 @@ static int findCacheSlot(dynarec_arm_t* dyn, int ninst, int t, int n, neoncache_
case NEON_CACHE_ST_F:
if (t==NEON_CACHE_ST_D)
return i;
+ if (t==NEON_CACHE_ST_I64)
+ return i;
break;
case NEON_CACHE_ST_D:
if (t==NEON_CACHE_ST_F)
return i;
+ if (t==NEON_CACHE_ST_I64)
+ return i;
+ break;
+ case NEON_CACHE_ST_I64:
+ if (t==NEON_CACHE_ST_F)
+ return i;
+ if (t==NEON_CACHE_ST_D)
+ return i;
break;
case NEON_CACHE_XMMR:
if(t==NEON_CACHE_XMMW)
@@ -1392,7 +1636,7 @@ static void swapCache(dynarec_arm_t* dyn, int ninst, int i, int j, neoncache_t *
quad =1;
if(cache->neoncache[j].t==NEON_CACHE_XMMR || cache->neoncache[j].t==NEON_CACHE_XMMW)
quad =1;
-
+
if(!cache->neoncache[i].v) {
// a mov is enough, no need to swap
MESSAGE(LOG_DUMP, "\t - Moving %d <- %d\n", i, j);
@@ -1407,7 +1651,7 @@ static void swapCache(dynarec_arm_t* dyn, int ninst, int i, int j, neoncache_t *
}
// SWAP
neon_cache_t tmp;
- MESSAGE(LOG_DUMP, "\t - Swaping %d <-> %d\n", i, j);
+ MESSAGE(LOG_DUMP, "\t - Swapping %d <-> %d\n", i, j);
// There is no VSWP in Arm64 NEON to swap 2 register contents!
// so use a scratch...
#define SCRATCH 31
@@ -1452,12 +1696,13 @@ static void loadCache(dynarec_arm_t* dyn, int ninst, int stack_cnt, int s1, int
VLDR128_U12(i, xEmu, offsetof(x64emu_t, xmm[n]));
break;
case NEON_CACHE_MM:
- MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n));
+ MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n));
VLDR64_U12(i, xEmu, offsetof(x64emu_t, mmx[i]));
break;
case NEON_CACHE_ST_D:
case NEON_CACHE_ST_F:
- MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n));
+ case NEON_CACHE_ST_I64:
+ MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n));
if((*s3_top) == 0xffff) {
LDRw_U12(s3, xEmu, offsetof(x64emu_t, top));
*s3_top = 0;
@@ -1478,12 +1723,15 @@ static void loadCache(dynarec_arm_t* dyn, int ninst, int stack_cnt, int s1, int
if(t==NEON_CACHE_ST_F) {
FCVT_S_D(i, i);
}
- break;
+ if(t==NEON_CACHE_ST_I64) {
+ VFCVTZSQD(i, i);
+ }
+ break;
case NEON_CACHE_NONE:
case NEON_CACHE_SCR:
default: /* nothing done */
MESSAGE(LOG_DUMP, "\t - ignoring %s\n", getCacheName(t, n));
- break;
+ break;
}
cache->neoncache[i].n = n;
cache->neoncache[i].t = t;
@@ -1500,12 +1748,13 @@ static void unloadCache(dynarec_arm_t* dyn, int ninst, int stack_cnt, int s1, in
VSTR128_U12(i, xEmu, offsetof(x64emu_t, xmm[n]));
break;
case NEON_CACHE_MM:
- MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n));
+ MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n));
VSTR64_U12(i, xEmu, offsetof(x64emu_t, mmx[n]));
break;
case NEON_CACHE_ST_D:
case NEON_CACHE_ST_F:
- MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n));
+ case NEON_CACHE_ST_I64:
+ MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n));
if((*s3_top)==0xffff) {
LDRw_U12(s3, xEmu, offsetof(x64emu_t, top));
*s3_top = 0;
@@ -1524,14 +1773,16 @@ static void unloadCache(dynarec_arm_t* dyn, int ninst, int stack_cnt, int s1, in
*s2_val = 0;
if(t==NEON_CACHE_ST_F) {
FCVT_D_S(i, i);
+ } else if (t==NEON_CACHE_ST_I64) {
+ SCVTFDD(i, i);
}
VSTR64_U12(i, s2, offsetof(x64emu_t, x87));
- break;
+ break;
case NEON_CACHE_NONE:
case NEON_CACHE_SCR:
default: /* nothing done */
MESSAGE(LOG_DUMP, "\t - ignoring %s\n", getCacheName(t, n));
- break;
+ break;
}
cache->neoncache[i].v = 0;
}
@@ -1653,6 +1904,23 @@ static void fpuCacheTransform(dynarec_arm_t* dyn, int ninst, int s1, int s2, int
MESSAGE(LOG_DUMP, "\t - Convert %s\n", getCacheName(cache.neoncache[i].t, cache.neoncache[i].n));
FCVT_D_S(i, i);
cache.neoncache[i].t = NEON_CACHE_ST_D;
+ } else if(cache.neoncache[i].t == NEON_CACHE_ST_D && cache_i2.neoncache[i].t == NEON_CACHE_ST_I64) {
+ MESSAGE(LOG_DUMP, "\t - Convert %s\n", getCacheName(cache.neoncache[i].t, cache.neoncache[i].n));
+ VFCVTZSQD(i, i);
+ cache.neoncache[i].t = NEON_CACHE_ST_I64;
+ } else if(cache.neoncache[i].t == NEON_CACHE_ST_F && cache_i2.neoncache[i].t == NEON_CACHE_ST_I64) {
+ MESSAGE(LOG_DUMP, "\t - Convert %s\n", getCacheName(cache.neoncache[i].t, cache.neoncache[i].n));
+ VFCVTZSQS(i, i);
+ cache.neoncache[i].t = NEON_CACHE_ST_D;
+ } else if(cache.neoncache[i].t == NEON_CACHE_ST_I64 && cache_i2.neoncache[i].t == NEON_CACHE_ST_F) {
+ MESSAGE(LOG_DUMP, "\t - Convert %s\n", getCacheName(cache.neoncache[i].t, cache.neoncache[i].n));
+ SCVTFDD(i, i);
+ FCVT_S_D(i, i);
+ cache.neoncache[i].t = NEON_CACHE_ST_F;
+ } else if(cache.neoncache[i].t == NEON_CACHE_ST_I64 && cache_i2.neoncache[i].t == NEON_CACHE_ST_D) {
+ MESSAGE(LOG_DUMP, "\t - Convert %s\n", getCacheName(cache.neoncache[i].t, cache.neoncache[i].n));
+ SCVTFDD(i, i);
+ cache.neoncache[i].t = NEON_CACHE_ST_D;
} else if(cache.neoncache[i].t == NEON_CACHE_XMMR && cache_i2.neoncache[i].t == NEON_CACHE_XMMW)
{ cache.neoncache[i].t = NEON_CACHE_XMMW; }
else if(cache.neoncache[i].t == NEON_CACHE_XMMW && cache_i2.neoncache[i].t == NEON_CACHE_XMMR) {
@@ -1680,18 +1948,18 @@ static void flagsCacheTransform(dynarec_arm_t* dyn, int ninst, int s1)
int go = 0;
switch (dyn->insts[jmp].f_entry.pending) {
case SF_UNKNOWN: break;
- case SF_SET:
- if(dyn->f.pending!=SF_SET && dyn->f.pending!=SF_SET_PENDING)
- go = 1;
+ case SF_SET:
+ if(dyn->f.pending!=SF_SET && dyn->f.pending!=SF_SET_PENDING)
+ go = 1;
break;
case SF_SET_PENDING:
- if(dyn->f.pending!=SF_SET
+ if(dyn->f.pending!=SF_SET
&& dyn->f.pending!=SF_SET_PENDING
- && dyn->f.pending!=SF_PENDING)
- go = 1;
+ && dyn->f.pending!=SF_PENDING)
+ go = 1;
break;
case SF_PENDING:
- if(dyn->f.pending!=SF_SET
+ if(dyn->f.pending!=SF_SET
&& dyn->f.pending!=SF_SET_PENDING
&& dyn->f.pending!=SF_PENDING)
go = 1;
@@ -1704,32 +1972,34 @@ static void flagsCacheTransform(dynarec_arm_t* dyn, int ninst, int s1)
if(go) {
if(dyn->f.pending!=SF_PENDING) {
LDRw_U12(s1, xEmu, offsetof(x64emu_t, df));
- j64 = (GETMARK3)-(dyn->native_size);
+ j64 = (GETMARKF2)-(dyn->native_size);
CBZw(s1, j64);
}
CALL_(UpdateFlags, -1, 0);
- MARK3;
+ MARKF2;
}
#endif
}
void CacheTransform(dynarec_arm_t* dyn, int ninst, int cacheupd, int s1, int s2, int s3) {
- if(cacheupd&1)
- fpuCacheTransform(dyn, ninst, s1, s2, s3);
if(cacheupd&2)
+ fpuCacheTransform(dyn, ninst, s1, s2, s3);
+ if(cacheupd&1)
flagsCacheTransform(dyn, ninst, s1);
}
-#ifdef HAVE_TRACE
void fpu_reflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3)
{
x87_reflectcache(dyn, ninst, s1, s2, s3);
- if(trace_emm)
- mmx_reflectcache(dyn, ninst, s1);
- if(trace_xmm)
- sse_reflectcache(dyn, ninst, s1);
+ mmx_reflectcache(dyn, ninst, s1);
+ sse_reflectcache(dyn, ninst, s1);
+}
+
+void fpu_unreflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3)
+{
+ // need to undo some things on the x87 tracking
+ x87_unreflectcache(dyn, ninst, s1, s2, s3);
}
-#endif
void fpu_reset(dynarec_arm_t* dyn)
{
@@ -1753,3 +2023,67 @@ void emit_pf(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4)
MVNw_REG(s4, s4);
BFIw(xFlags, s4, F_PF, 1);
}
+
+
+void fpu_reset_cache(dynarec_arm_t* dyn, int ninst, int reset_n)
+{
+ MESSAGE(LOG_DEBUG, "Reset Caches with %d\n",reset_n);
+ #if STEP > 1
+ // for STEP 2 & 3, just need to refrest with current, and undo the changes (push & swap)
+ dyn->n = dyn->insts[ninst].n;
+ neoncacheUnwind(&dyn->n);
+ #ifdef HAVE_TRACE
+ if(box64_dynarec_dump)
+ if(memcmp(&dyn->n, &dyn->insts[reset_n].n, sizeof(neon_cache_t))) {
+ MESSAGE(LOG_DEBUG, "Warning, difference in neoncache: reset=");
+ for(int i=0; i<24; ++i)
+ if(dyn->insts[reset_n].n.neoncache[i].v)
+ MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->insts[reset_n].n.neoncache[i].t, dyn->insts[reset_n].n.neoncache[i].n));
+ if(dyn->insts[reset_n].n.combined1 || dyn->insts[reset_n].n.combined2)
+ MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[reset_n].n.swapped?"SWP":"CMB", dyn->insts[reset_n].n.combined1, dyn->insts[reset_n].n.combined2);
+ if(dyn->insts[reset_n].n.stack_push || dyn->insts[reset_n].n.stack_pop)
+ MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->insts[reset_n].n.stack_push, -dyn->insts[reset_n].n.stack_pop);
+ MESSAGE(LOG_DEBUG, " ==> ");
+ for(int i=0; i<24; ++i)
+ if(dyn->insts[ninst].n.neoncache[i].v)
+ MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->insts[ninst].n.neoncache[i].t, dyn->insts[ninst].n.neoncache[i].n));
+ if(dyn->insts[ninst].n.combined1 || dyn->insts[ninst].n.combined2)
+ MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[ninst].n.swapped?"SWP":"CMB", dyn->insts[ninst].n.combined1, dyn->insts[ninst].n.combined2);
+ if(dyn->insts[ninst].n.stack_push || dyn->insts[ninst].n.stack_pop)
+ MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->insts[ninst].n.stack_push, -dyn->insts[ninst].n.stack_pop);
+ MESSAGE(LOG_DEBUG, " -> ");
+ for(int i=0; i<24; ++i)
+ if(dyn->n.neoncache[i].v)
+ MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->n.neoncache[i].t, dyn->n.neoncache[i].n));
+ if(dyn->n.combined1 || dyn->n.combined2)
+ MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->n.swapped?"SWP":"CMB", dyn->n.combined1, dyn->n.combined2);
+ if(dyn->n.stack_push || dyn->n.stack_pop)
+ MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->n.stack_push, -dyn->n.stack_pop);
+ MESSAGE(LOG_DEBUG, "\n");
+ }
+ #endif //HAVE_TRACE
+ #else
+ dyn->n = dyn->insts[reset_n].n;
+ #endif
+}
+
+// propagate ST stack state, especial stack pop that are deferred
+void fpu_propagate_stack(dynarec_arm_t* dyn, int ninst)
+{
+ if(dyn->n.stack_pop) {
+ for(int j=0; j<24; ++j)
+ if((dyn->n.neoncache[j].t == NEON_CACHE_ST_D
+ || dyn->n.neoncache[j].t == NEON_CACHE_ST_F
+ || dyn->n.neoncache[j].t == NEON_CACHE_ST_I64)) {
+ if(dyn->n.neoncache[j].n<dyn->n.stack_pop)
+ dyn->n.neoncache[j].v = 0;
+ else
+ dyn->n.neoncache[j].n-=dyn->n.stack_pop;
+ }
+ dyn->n.stack_pop = 0;
+ }
+ dyn->n.stack = dyn->n.stack_next;
+ dyn->n.news = 0;
+ dyn->n.stack_push = 0;
+ dyn->n.swapped = 0;
+} \ No newline at end of file
diff --git a/src/dynarec/arm64/dynarec_arm64_helper.h b/src/dynarec/arm64/dynarec_arm64_helper.h
index f13331a..5c7c21f 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_helper.h
+++ b/src/dynarec/arm64/dynarec_arm64_helper.h
@@ -34,12 +34,12 @@
// Strong mem emulation helpers
// Sequence of Read will trigger a DMB on "first" read if strongmem is 2
-// Squence of Write will trigger a DMB on "last" write if strongmem is 1
+// Sequence of Write will trigger a DMB on "last" write if strongmem is 1
// Opcode will read
#define SMREAD() if(!dyn->smread && box64_dynarec_strongmem>1) {SMDMB();}
// Opcode will read with option forced lock
#define SMREADLOCK(lock) if(lock || (!dyn->smread && box64_dynarec_strongmem>1)) {SMDMB();}
-// Opcode migh read (depend on nextop)
+// Opcode might read (depend on nextop)
#define SMMIGHTREAD() if(!MODREG) {SMREAD();}
// Opcode has wrote
#define SMWRITE() dyn->smwrite=1
@@ -47,7 +47,7 @@
#define SMWRITE2() if(box64_dynarec_strongmem>1) dyn->smwrite=1
// Opcode has wrote with option forced lock
#define SMWRITELOCK(lock) if(lock) {SMDMB();} else dyn->smwrite=1
-// Opcode migh have wrote (depend on nextop)
+// Opcode might have wrote (depend on nextop)
#define SMMIGHTWRITE() if(!MODREG) {SMWRITE();}
// Start of sequence
#define SMSTART() SMEND()
@@ -67,8 +67,8 @@
wback = 0; \
} else { \
SMREAD() \
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
- LDRxw_U12(x1, wback, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
+ LDxw(x1, wback, fixedaddress); \
ed = x1; \
}
#define GETEDx(D) if(MODREG) { \
@@ -76,8 +76,17 @@
wback = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, D); \
- LDRx_U12(x1, wback, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, D); \
+ LDx(x1, wback, fixedaddress); \
+ ed = x1; \
+ }
+#define GETEDz(D) if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ wback = 0; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, D); \
+ LDz(x1, wback, fixedaddress); \
ed = x1; \
}
#define GETEDw(D) if((nextop&0xC0)==0xC0) { \
@@ -85,8 +94,8 @@
wback = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL,0, D); \
- LDRw_U12(x1, wback, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL,0, D); \
+ LDW(x1, wback, fixedaddress); \
ed = x1; \
}
#define GETSEDw(D) if((nextop&0xC0)==0xC0) { \
@@ -96,8 +105,8 @@
wback = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, D); \
- LDRSW_U12(x1, wback, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, D); \
+ LDSW(x1, wback, fixedaddress); \
wb = ed = x1; \
}
#define GETED32(D) if(MODREG) { \
@@ -105,8 +114,8 @@
wback = 0; \
} else { \
SMREAD(); \
- addr = geted32(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
- LDRxw_U12(x1, wback, fixedaddress); \
+ addr = geted32(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
+ LDxw(x1, wback, fixedaddress); \
ed = x1; \
}
#define GETSED32w(D) if((nextop&0xC0)==0xC0) { \
@@ -116,8 +125,8 @@
wback = 0; \
} else { \
SMREAD(); \
- addr = geted32(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, D); \
- LDRSW_U12(x1, wback, fixedaddress); \
+ addr = geted32(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, D); \
+ LDSW(x1, wback, fixedaddress); \
wb = ed = x1; \
}
//GETEDH can use hint for ed, and r1 or r2 for wback (depending on hint). wback is 0 if ed is xEAX..xEDI
@@ -126,18 +135,18 @@
wback = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, (hint==x2)?x1:x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
- LDRxw_U12(hint, wback, fixedaddress); \
- ed = hint; \
+ addr = geted(dyn, addr, ninst, nextop, &wback, (hint==x2)?x1:x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
+ LDxw(hint, wback, fixedaddress); \
+ ed = hint; \
}
#define GETED32H(hint, D) if(MODREG) { \
ed = xRAX+(nextop&7)+(rex.b<<3); \
wback = 0; \
} else { \
SMREAD(); \
- addr = geted32(dyn, addr, ninst, nextop, &wback, (hint==x2)?x1:x2, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
- LDRxw_U12(hint, wback, fixedaddress); \
- ed = hint; \
+ addr = geted32(dyn, addr, ninst, nextop, &wback, (hint==x2)?x1:x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
+ LDxw(hint, wback, fixedaddress); \
+ ed = hint; \
}
//GETEDW can use hint for wback and ret for ed. wback is 0 if ed is xEAX..xEDI
#define GETEDW(hint, ret, D) if(MODREG) { \
@@ -146,9 +155,9 @@
wback = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, hint, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, hint, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
ed = ret; \
- LDRxw_U12(ed, wback, fixedaddress); \
+ LDxw(ed, wback, fixedaddress); \
}
#define GETED32W(hint, ret, D) if(MODREG) { \
ed = xRAX+(nextop&7)+(rex.b<<3); \
@@ -156,23 +165,23 @@
wback = 0; \
} else { \
SMREAD(); \
- addr = geted32(dyn, addr, ninst, nextop, &wback, hint, &fixedaddress, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
+ addr = geted32(dyn, addr, ninst, nextop, &wback, hint, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \
ed = ret; \
- LDRxw_U12(ed, wback, fixedaddress); \
+ LDxw(ed, wback, fixedaddress); \
}
// Write back ed in wback (if wback not 0)
-#define WBACK if(wback) {STRxw_U12(ed, wback, fixedaddress); SMWRITE();}
+#define WBACK if(wback) {STxw(ed, wback, fixedaddress); SMWRITE();}
// Write back ed in wback (if wback not 0)
-#define WBACKx if(wback) {STRx_U12(ed, wback, fixedaddress); SMWRITE();}
+#define WBACKx if(wback) {STx(ed, wback, fixedaddress); SMWRITE();}
// Write back ed in wback (if wback not 0)
-#define WBACKw if(wback) {STRw_U12(ed, wback, fixedaddress); SMWRITE();}
+#define WBACKw if(wback) {STW(ed, wback, fixedaddress); SMWRITE();}
//GETEDO can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI
#define GETEDO(O, D) if(MODREG) { \
ed = xRAX+(nextop&7)+(rex.b<<3); \
wback = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, NULL, 0, D); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, D); \
LDRxw_REG(x1, wback, O); \
ed = x1; \
}
@@ -183,10 +192,20 @@
wback = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, NULL, 0, D); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, D); \
LDRx_REG(x1, wback, O); \
ed = x1; \
}
+//GETEDOz can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI
+#define GETEDOz(O, D) if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ wback = 0; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, D); \
+ LDRz_REG(x1, wback, O); \
+ ed = x1; \
+ }
#define GETSEDOw(O, D) if((nextop&0xC0)==0xC0) { \
ed = xRAX+(nextop&7)+(rex.b<<3); \
SXTWx(x1, ed); \
@@ -194,7 +213,7 @@
wback = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 0, 0, rex, NULL, 0, D); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, D); \
LDRSW_REG(x1, wback, O); \
wb = ed = x1; \
}
@@ -214,8 +233,8 @@
wb1 = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, w, &fixedaddress, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \
- LDRH_U12(i, wback, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, w, &fixedaddress, &unscaled, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \
+ LDH(i, wback, fixedaddress);\
ed = i; \
wb1 = 1; \
}
@@ -227,8 +246,8 @@
wb1 = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \
- LDRH_U12(i, wback, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \
+ LDH(i, wback, fixedaddress); \
ed = i; \
wb1 = 1; \
}
@@ -240,15 +259,15 @@
wb1 = 0; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \
- LDRSHx_U12(i, wback, fixedaddress);\
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \
+ LDSHw(i, wback, fixedaddress); \
ed = i; \
wb1 = 1; \
}
// Write ed back to original register / memory
-#define EWBACK if(wb1) {STRH_U12(ed, wback, fixedaddress); SMWRITE();} else {BFIx(wback, ed, 0, 16);}
+#define EWBACK EWBACKW(ed)
// Write w back to original register / memory
-#define EWBACKW(w) if(wb1) {STRH_U12(w, wback, fixedaddress); SMWRITE();} else {BFIx(wback, w, 0, 16);}
+#define EWBACKW(w) if(wb1) {STH(w, wback, fixedaddress); SMWRITE();} else {BFIx(wback, w, 0, 16);}
// Write back gd in correct register
#define GWBACK BFIx((xRAX+((nextop&0x38)>>3)+(rex.r<<3)), gd, 0, 16);
//GETEB will use i for ed, and can use r3 for wback.
@@ -266,8 +285,8 @@
ed = i; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff, 0, rex, NULL, 0, D); \
- LDRB_U12(i, wback, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \
+ LDB(i, wback, fixedaddress);\
wb1 = 1; \
ed = i; \
}
@@ -286,10 +305,10 @@
ed = i; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff, 0, rex, NULL, 0, D); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \
ADDx_REG(x3, wback, i); \
if(wback!=x3) wback = x3; \
- LDRB_U12(i, wback, fixedaddress); \
+ LDB(i, wback, fixedaddress);\
wb1 = 1; \
ed = i; \
}
@@ -308,8 +327,8 @@
ed = i; \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff, 0, rex, NULL, 0, D); \
- LDRSBx_U12(i, wback, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \
+ LDSBx(i, wback, fixedaddress); \
wb1 = 1; \
ed = i; \
}
@@ -328,31 +347,31 @@
ed = i; \
} else { \
SMREAD(); \
- addr = geted32(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, 0xfff, 0, rex, NULL, 0, D); \
- LDRB_U12(i, wback, fixedaddress); \
+ addr = geted32(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \
+ LDB(i, wback, fixedaddress);\
wb1 = 1; \
ed = i; \
}
// Write eb (ed) back to original register / memory
-#define EBBACK if(wb1) {STRB_U12(ed, wback, fixedaddress); SMWRITE();} else {BFIx(wback, ed, wb2, 8);}
+#define EBBACK if(wb1) {STB(ed, wback, fixedaddress); SMWRITE();} else {BFIx(wback, ed, wb2, 8);}
//GETGB will use i for gd
#define GETGB(i) if(rex.rex) { \
gb1 = xRAX+((nextop&0x38)>>3)+(rex.r<<3); \
gb2 = 0; \
} else { \
gd = (nextop&0x38)>>3; \
- gb2 = ((gd&4)>>2); \
+ gb2 = ((gd&4)<<1); \
gb1 = xRAX+(gd&3); \
} \
gd = i; \
- UBFXx(gd, gb1, gb2*8, 8);
-//GETSGB signe extend GB, will use i for gd
+ UBFXx(gd, gb1, gb2, 8);
+//GETSGB sign extend GB, will use i for gd
#define GETSGB(i) if(rex.rex) { \
gb1 = xRAX+((nextop&0x38)>>3)+(rex.r<<3); \
gb2 = 0; \
} else { \
gd = (nextop&0x38)>>3; \
- gb2 = ((gd&4)>>2); \
+ gb2 = ((gd&4)<<1); \
gb1 = xRAX+(gd&3); \
} \
gd = i; \
@@ -379,15 +398,15 @@
a = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), w); \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<4, 15, rex, NULL, 0, D); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, D); \
a = fpu_get_scratch(dyn); \
- VLDR128_U12(a, ed, fixedaddress); \
+ VLD128(a, ed, fixedaddress); \
}
// Put Back EX if it was a memory and not an emm register
#define PUTEX(a) \
if(!MODREG) { \
- VSTR128_U12(a, ed, fixedaddress); \
+ VST128(a, ed, fixedaddress); \
SMWRITE2(); \
}
@@ -399,8 +418,8 @@
} else { \
SMREAD(); \
a = fpu_get_scratch(dyn); \
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, D); \
- VLDR64_U12(a, ed, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, D); \
+ VLD64(a, ed, fixedaddress); \
}
// Get Ex as a single, not a quad (warning, x1 get used)
@@ -410,8 +429,8 @@
} else { \
SMREAD(); \
a = fpu_get_scratch(dyn); \
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<2, 3, rex, NULL, 0, D); \
- VLDR32_U12(a, ed, fixedaddress); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, D); \
+ VLD32(a, ed, fixedaddress); \
}
// Get GM, might use x1, x2 and x3
@@ -425,15 +444,15 @@
a = mmx_get_reg(dyn, ninst, x1, x2, x3, (nextop&7)); \
} else { \
SMREAD(); \
- addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, 0xfff<<3, 7, rex, NULL, 0, D); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, D); \
a = fpu_get_scratch(dyn); \
- VLDR64_U12(a, ed, fixedaddress); \
+ VLD64(a, ed, fixedaddress); \
}
// Put Back EM if it was a memory and not an emm register
#define PUTEM(a) \
if(!MODREG) { \
- VSTR64_U12(a, ed, fixedaddress); \
+ VST64(a, ed, fixedaddress); \
SMWRITE2(); \
}
@@ -455,17 +474,19 @@
// R0 will not be pushed/popd if ret is -2. Flags are not save/restored
#define CALL_S(F, ret) call_c(dyn, ninst, F, x7, ret, 0, 0)
-#define MARK dyn->insts[ninst].mark = dyn->native_size
-#define GETMARK dyn->insts[ninst].mark
-#define MARK2 dyn->insts[ninst].mark2 = dyn->native_size
-#define GETMARK2 dyn->insts[ninst].mark2
-#define MARK3 dyn->insts[ninst].mark3 = dyn->native_size
-#define GETMARK3 dyn->insts[ninst].mark3
-#define MARKF dyn->insts[ninst].markf = dyn->native_size
-#define GETMARKF dyn->insts[ninst].markf
-#define MARKSEG dyn->insts[ninst].markseg = dyn->native_size
-#define GETMARKSEG dyn->insts[ninst].markseg
-#define MARKLOCK dyn->insts[ninst].marklock = dyn->native_size
+#define MARK dyn->insts[ninst].mark = dyn->native_size
+#define GETMARK dyn->insts[ninst].mark
+#define MARK2 dyn->insts[ninst].mark2 = dyn->native_size
+#define GETMARK2 dyn->insts[ninst].mark2
+#define MARK3 dyn->insts[ninst].mark3 = dyn->native_size
+#define GETMARK3 dyn->insts[ninst].mark3
+#define MARKF dyn->insts[ninst].markf = dyn->native_size
+#define GETMARKF dyn->insts[ninst].markf
+#define MARKF2 dyn->insts[ninst].markf2 = dyn->native_size
+#define GETMARKF2 dyn->insts[ninst].markf2
+#define MARKSEG dyn->insts[ninst].markseg = dyn->native_size
+#define GETMARKSEG dyn->insts[ninst].markseg
+#define MARKLOCK dyn->insts[ninst].marklock = dyn->native_size
#define GETMARKLOCK dyn->insts[ninst].marklock
// Branch to MARK if cond (use j64)
@@ -504,6 +525,10 @@
#define B_MARK2_nocond \
j64 = GETMARK2-(dyn->native_size); \
B(j64)
+// Branch to MARK2 if reg is 0 (use j64)
+#define CBZx_MARK2(reg) \
+ j64 = GETMARK2-(dyn->native_size); \
+ CBZx(reg, j64)
// Branch to MARK2 if reg is not 0 (use j64)
#define CBNZx_MARK2(reg) \
j64 = GETMARK2-(dyn->native_size); \
@@ -717,7 +742,7 @@
LDP_REGS(R12, R13); \
LDP_REGS(R14, R15)
-#define SET_DFNONE(S) if(!dyn->f.dfnone) {MOVZw(S, d_none); STRw_U12(S, xEmu, offsetof(x64emu_t, df)); dyn->f.dfnone=1;}
+#define SET_DFNONE(S) if(!dyn->f.dfnone) {STRw_U12(wZR, xEmu, offsetof(x64emu_t, df)); dyn->f.dfnone=1;}
#define SET_DF(S, N) if((N)!=d_none) {MOVZw(S, (N)); STRw_U12(S, xEmu, offsetof(x64emu_t, df)); dyn->f.dfnone=0;} else SET_DFNONE(S)
#define SET_NODF() dyn->f.dfnone = 0
#define SET_DFOK() dyn->f.dfnone = 1
@@ -759,17 +784,17 @@
} else dyn->f.pending = SF_SET
#endif
#ifndef JUMP
-#define JUMP(A, C)
+#define JUMP(A, C)
#endif
#ifndef BARRIER
-#define BARRIER(A)
+#define BARRIER(A)
#endif
#ifndef BARRIER_NEXT
#define BARRIER_NEXT(A)
#endif
#define UFLAG_OP1(A) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A, xEmu, offsetof(x64emu_t, op1));}
#define UFLAG_OP2(A) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A, xEmu, offsetof(x64emu_t, op2));}
-#define UFLAG_OP12(A1, A2) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A1, xEmu, offsetof(x64emu_t, op1));STRxw_U12(A2, 0, offsetof(x64emu_t, op2));}
+#define UFLAG_OP12(A1, A2) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A1, xEmu, offsetof(x64emu_t, op1));STRxw_U12(A2, xEmu, offsetof(x64emu_t, op2));}
#define UFLAG_RES(A) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A, xEmu, offsetof(x64emu_t, res));}
#define UFLAG_DF(r, A) if(dyn->insts[ninst].x64.gen_flags) {SET_DF(r, A)}
#define UFLAG_IF if(dyn->insts[ninst].x64.gen_flags)
@@ -786,6 +811,10 @@
#define FTABLE64(A, V)
#endif
+#define ARCH_INIT() \
+ dyn->doublepush = 0; \
+ dyn->doublepop = 0;
+
#if STEP < 2
#define GETIP(A)
#define GETIP_(A)
@@ -828,7 +857,7 @@
#define MODREG ((nextop&0xC0)==0xC0)
-void arm64_epilog();
+void arm64_epilog(void);
void* arm64_next(x64emu_t* emu, uintptr_t addr);
#ifndef STEPNAME
@@ -969,30 +998,31 @@ void* arm64_next(x64emu_t* emu, uintptr_t addr);
#define fpu_pushcache STEPNAME(fpu_pushcache)
#define fpu_popcache STEPNAME(fpu_popcache)
#define fpu_reset STEPNAME(fpu_reset)
+#define fpu_reset_cache STEPNAME(fpu_reset_cache)
+#define fpu_propagate_stack STEPNAME(fpu_propagate_stack)
#define fpu_purgecache STEPNAME(fpu_purgecache)
#define mmx_purgecache STEPNAME(mmx_purgecache)
#define x87_purgecache STEPNAME(x87_purgecache)
-#ifdef HAVE_TRACE
#define fpu_reflectcache STEPNAME(fpu_reflectcache)
-#endif
+#define fpu_unreflectcache STEPNAME(fpu_unreflectcache)
#define CacheTransform STEPNAME(CacheTransform)
/* setup r2 to address pointed by */
-uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int absmax, uint32_t mask, rex_t rex, int* l, int s, int delta);
+uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, rex_t rex, int* l, int s, int delta);
/* setup r2 to address pointed by */
-uintptr_t geted32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int absmax, uint32_t mask, rex_t rex, int* l, int s, int delta);
+uintptr_t geted32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, rex_t rex, int* l, int s, int delta);
/* setup r2 to address pointed by */
-uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int absmax, uint32_t mask, int s);
+uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, int s);
// generic x64 helper
void jump_to_epilog(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst);
void jump_to_next(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst);
-void ret_to_epilog(dynarec_arm_t* dyn, int ninst);
-void retn_to_epilog(dynarec_arm_t* dyn, int ninst, int n);
+void ret_to_epilog(dynarec_arm_t* dyn, int ninst, rex_t rex);
+void retn_to_epilog(dynarec_arm_t* dyn, int ninst, rex_t rex, int n);
void iret_to_epilog(dynarec_arm_t* dyn, int ninst, int is64bits);
void call_c(dynarec_arm_t* dyn, int ninst, void* fnc, int reg, int ret, int saveflags, int save_reg);
void call_n(dynarec_arm_t* dyn, int ninst, void* fnc, int w);
@@ -1005,7 +1035,7 @@ void emit_cmp16_0(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4);
void emit_cmp32_0(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4);
void emit_test8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
void emit_test16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
-void emit_test32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4);
+void emit_test32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5);
void emit_add32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4);
void emit_add32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4, int s5);
void emit_add8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4);
@@ -1070,7 +1100,7 @@ void emit_shld32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, uint
void emit_pf(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4);
// x87 helper
-// cache of the local stack counter, to avoid upadte at every call
+// cache of the local stack counter, to avoid update at every call
void x87_stackcount(dynarec_arm_t* dyn, int ninst, int scratch);
// fpu push. Return the Dd value to be used
int x87_do_push(dynarec_arm_t* dyn, int ninst, int s1, int t);
@@ -1116,16 +1146,19 @@ int neoncache_st_coherency(dynarec_arm_t* dyn, int ninst, int a, int b);
#if STEP == 0
#define ST_IS_F(A) 0
+#define ST_IS_I64(A) 0
#define X87_COMBINE(A, B) NEON_CACHE_ST_D
#define X87_ST0 NEON_CACHE_ST_D
#define X87_ST(A) NEON_CACHE_ST_D
#elif STEP == 1
#define ST_IS_F(A) (neoncache_get_current_st(dyn, ninst, A)==NEON_CACHE_ST_F)
+#define ST_IS_I64(A) (neoncache_get_current_st(dyn, ninst, A)==NEON_CACHE_ST_I64)
#define X87_COMBINE(A, B) neoncache_combine_st(dyn, ninst, A, B)
#define X87_ST0 neoncache_get_current_st(dyn, ninst, 0)
#define X87_ST(A) neoncache_get_current_st(dyn, ninst, A)
#else
#define ST_IS_F(A) (neoncache_get_st(dyn, ninst, A)==NEON_CACHE_ST_F)
+#define ST_IS_I64(A) (neoncache_get_st(dyn, ninst, A)==NEON_CACHE_ST_I64)
#if STEP == 3
#define X87_COMBINE(A, B) neoncache_st_coherency(dyn, ninst, A, B)
#else
@@ -1154,15 +1187,18 @@ void sse_purge07cache(dynarec_arm_t* dyn, int ninst, int s1);
// common coproc helpers
// reset the cache
void fpu_reset(dynarec_arm_t* dyn);
+// reset the cache with n
+void fpu_reset_cache(dynarec_arm_t* dyn, int ninst, int reset_n);
+// propagate stack state
+void fpu_propagate_stack(dynarec_arm_t* dyn, int ninst);
// purge the FPU cache (needs 3 scratch registers)
void fpu_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1, int s2, int s3);
// purge MMX cache
void mmx_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1);
// purge x87 cache
void x87_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1, int s2, int s3);
-#ifdef HAVE_TRACE
void fpu_reflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3);
-#endif
+void fpu_unreflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3);
void fpu_pushcache(dynarec_arm_t* dyn, int ninst, int s1, int not07);
void fpu_popcache(dynarec_arm_t* dyn, int ninst, int s1, int not07);
@@ -1202,7 +1238,7 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
#if STEP < 3
#define MAYUSE(A) (void)A
#else
-#define MAYUSE(A)
+#define MAYUSE(A)
#endif
#define GOCOND(B, T1, T2) \
@@ -1295,4 +1331,27 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
, cNE, cEQ, X_SF|X_OF|X_ZF) \
break
+#define NOTEST(s1) \
+ if(box64_dynarec_test) { \
+ STRw_U12(xZR, xEmu, offsetof(x64emu_t, test.test)); \
+ STRw_U12(xZR, xEmu, offsetof(x64emu_t, test.clean));\
+ }
+#define SKIPTEST(s1) \
+ if(box64_dynarec_test) { \
+ STRw_U12(xZR, xEmu, offsetof(x64emu_t, test.clean));\
+ }
+#define GOTEST(s1, s2) \
+ if(box64_dynarec_test) { \
+ MOV32w(s2, 1); \
+ STRw_U12(s2, xEmu, offsetof(x64emu_t, test.test)); \
+ }
+
+#define GETREX() \
+ rex.rex = 0; \
+ if(!rex.is32bits) \
+ while(opcode>=0x40 && opcode<=0x4f) { \
+ rex.rex = opcode; \
+ opcode = F8; \
+ }
+
#endif //__DYNAREC_ARM64_HELPER_H__
diff --git a/src/dynarec/arm64/dynarec_arm64_pass0.h b/src/dynarec/arm64/dynarec_arm64_pass0.h
index 61eb1bc..774d13d 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_pass0.h
+++ b/src/dynarec/arm64/dynarec_arm64_pass0.h
@@ -22,7 +22,7 @@
#define NEW_INST \
++dyn->size; \
if(dyn->size+3>=dyn->cap) { \
- dyn->insts = (instruction_native_t*)customRealloc(dyn->insts, sizeof(instruction_native_t)*dyn->cap*2);\
+ dyn->insts = (instruction_native_t*)dynaRealloc(dyn->insts, sizeof(instruction_native_t)*dyn->cap*2);\
memset(&dyn->insts[dyn->cap], 0, sizeof(instruction_native_t)*dyn->cap); \
dyn->cap *= 2; \
} \
@@ -40,9 +40,10 @@
#define DEFAULT \
--dyn->size; \
*ok = -1; \
- if(box64_dynarec_log>=LOG_INFO) {\
- dynarec_log(LOG_NONE, "%p: Dynarec stopped because of Opcode %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", \
- (void*)ip, PKip(0), \
+ if(box64_dynarec_log>=LOG_INFO || box64_dynarec_dump || box64_dynarec_missing) {\
+ dynarec_log(LOG_NONE, "%p: Dynarec stopped because of %sOpcode %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", \
+ (void*)ip, rex.is32bits?"32bits ":"",\
+ PKip(0), \
PKip(1), PKip(2), PKip(3), \
PKip(4), PKip(5), PKip(6), \
PKip(7), PKip(8), PKip(9), \
diff --git a/src/dynarec/arm64/dynarec_arm64_pass1.h b/src/dynarec/arm64/dynarec_arm64_pass1.h
index 6cf92fe..6cf92fe 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_pass1.h
+++ b/src/dynarec/arm64/dynarec_arm64_pass1.h
diff --git a/src/dynarec/arm64/dynarec_arm64_pass2.h b/src/dynarec/arm64/dynarec_arm64_pass2.h
index edc43ae..512e441 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_pass2.h
+++ b/src/dynarec/arm64/dynarec_arm64_pass2.h
@@ -2,19 +2,17 @@
#define FINI \
if(ninst) { \
dyn->insts[ninst].address = (dyn->insts[ninst-1].address+dyn->insts[ninst-1].size); \
- dyn->insts_size += 1+((dyn->insts[ninst].x64.size>dyn->insts[ninst].size)?dyn->insts[ninst].x64.size:dyn->insts[ninst].size)/15; \
+ dyn->insts_size += 1+((dyn->insts[ninst].x64.size>(dyn->insts[ninst].size/4))?dyn->insts[ninst].x64.size:(dyn->insts[ninst].size/4))/15; \
}
#define MESSAGE(A, ...)
-#define EMIT(A) dyn->insts[ninst].size+=4; dyn->native_size+=4
+#define EMIT(A) do{dyn->insts[ninst].size+=4; dyn->native_size+=4;}while(0)
#define NEW_INST \
if(ninst) { \
dyn->insts[ninst].address = (dyn->insts[ninst-1].address+dyn->insts[ninst-1].size); \
- if(isInstClean(dyn, ninst) && dyn->last_ip!=ip) \
- dyn->last_ip = 0; \
- dyn->insts_size += 1+((dyn->insts[ninst-1].x64.size>dyn->insts[ninst-1].size)?dyn->insts[ninst-1].x64.size:dyn->insts[ninst-1].size)/15; \
+ dyn->insts_size += 1+((dyn->insts[ninst-1].x64.size>(dyn->insts[ninst-1].size/4))?dyn->insts[ninst-1].x64.size:(dyn->insts[ninst-1].size/4))/15; \
}
#define INST_EPILOG dyn->insts[ninst].epilog = dyn->native_size;
#define INST_NAME(name)
-#define TABLE64(A, V) {Table64(dyn, (V)); EMIT(0);}
-#define FTABLE64(A, V) {mmx87_regs_t v = {.d = V}; Table64(dyn, v.q); EMIT(0);} \ No newline at end of file
+#define TABLE64(A, V) {Table64(dyn, (V), 2); EMIT(0);}
+#define FTABLE64(A, V) {mmx87_regs_t v = {.d = V}; Table64(dyn, v.q, 2); EMIT(0);} \ No newline at end of file
diff --git a/src/dynarec/arm64/dynarec_arm64_pass3.h b/src/dynarec/arm64/dynarec_arm64_pass3.h
index ae79c11..875e8af 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_pass3.h
+++ b/src/dynarec/arm64/dynarec_arm64_pass3.h
@@ -3,68 +3,20 @@
if(ninst) \
addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst].x64.size, dyn->insts[ninst].size/4); \
addInst(dyn->instsize, &dyn->insts_size, 0, 0);
-#define EMIT(A) \
- if(box64_dynarec_dump) {dynarec_log(LOG_NONE, "\t%08x\t%s\n", (uint32_t)(A), arm64_print(A, (uintptr_t)dyn->block));} \
- *(uint32_t*)(dyn->block) = (uint32_t)(A); \
- dyn->block += 4; dyn->native_size += 4; \
- dyn->insts[ninst].size2 += 4
+#define EMIT(A) \
+ do{ \
+ if(box64_dynarec_dump) print_opcode(dyn, ninst, (uint32_t)(A)); \
+ if((uintptr_t)dyn->block<dyn->tablestart) \
+ *(uint32_t*)(dyn->block) = (uint32_t)(A); \
+ dyn->block += 4; dyn->native_size += 4; \
+ dyn->insts[ninst].size2 += 4; \
+ }while(0)
#define MESSAGE(A, ...) if(box64_dynarec_dump) dynarec_log(LOG_NONE, __VA_ARGS__)
#define NEW_INST \
- if(ninst && isInstClean(dyn, ninst)) { \
- if(dyn->last_ip!=ip) dyn->last_ip = 0; \
- } \
if(ninst) \
addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst-1].x64.size, dyn->insts[ninst-1].size/4);
#define INST_EPILOG
-#define INST_NAME(name) \
- if(box64_dynarec_dump) {\
- printf_x64_instruction(my_context->dec, &dyn->insts[ninst].x64, name); \
- dynarec_log(LOG_NONE, "%s%p: %d emited opcodes, inst=%d, barrier=%d state=%d/%d(%d), %s=%X/%X, use=%X, need=%X/%X, sm=%d/%d", \
- (box64_dynarec_dump>1)?"\e[32m":"", \
- (void*)(dyn->native_start+dyn->insts[ninst].address), \
- dyn->insts[ninst].size/4, \
- ninst, \
- dyn->insts[ninst].x64.barrier, \
- dyn->insts[ninst].x64.state_flags, \
- dyn->f.pending, \
- dyn->f.dfnone, \
- dyn->insts[ninst].x64.may_set?"may":"set", \
- dyn->insts[ninst].x64.set_flags, \
- dyn->insts[ninst].x64.gen_flags, \
- dyn->insts[ninst].x64.use_flags, \
- dyn->insts[ninst].x64.need_before, \
- dyn->insts[ninst].x64.need_after, \
- dyn->smread, dyn->smwrite); \
- if(dyn->insts[ninst].pred_sz) { \
- dynarec_log(LOG_NONE, ", pred="); \
- for(int ii=0; ii<dyn->insts[ninst].pred_sz; ++ii)\
- dynarec_log(LOG_NONE, "%s%d", ii?"/":"", dyn->insts[ninst].pred[ii]);\
- } \
- if(dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts>=0)\
- dynarec_log(LOG_NONE, ", jmp=%d", dyn->insts[ninst].x64.jmp_insts);\
- if(dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts==-1)\
- dynarec_log(LOG_NONE, ", jmp=out"); \
- if(dyn->last_ip) \
- dynarec_log(LOG_NONE, ", last_ip=%p", (void*)dyn->last_ip);\
- for(int ii=0; ii<24; ++ii) { \
- switch(dyn->insts[ninst].n.neoncache[ii].t) { \
- case NEON_CACHE_ST_D: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; \
- case NEON_CACHE_ST_F: dynarec_log(LOG_NONE, " S%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; \
- case NEON_CACHE_MM: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; \
- case NEON_CACHE_XMMW: dynarec_log(LOG_NONE, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; \
- case NEON_CACHE_XMMR: dynarec_log(LOG_NONE, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; \
- case NEON_CACHE_SCR: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; \
- case NEON_CACHE_NONE: \
- default: break; \
- } \
- } \
- if(dyn->n.stack || dyn->insts[ninst].n.stack_next || dyn->insts[ninst].n.x87stack) \
- dynarec_log(LOG_NONE, " X87:%d/%d(+%d/-%d)%d", dyn->n.stack, dyn->insts[ninst].n.stack_next, dyn->insts[ninst].n.stack_push, dyn->insts[ninst].n.stack_pop, dyn->insts[ninst].n.x87stack); \
- if(dyn->insts[ninst].n.combined1 || dyn->insts[ninst].n.combined2) \
- dynarec_log(LOG_NONE, " %s:%d/%d", dyn->insts[ninst].n.swapped?"SWP":"CMB", dyn->insts[ninst].n.combined1, dyn->insts[ninst].n.combined2); \
- dynarec_log(LOG_NONE, "%s\n", (box64_dynarec_dump>1)?"\e[m":""); \
- }
-
-#define TABLE64(A, V) {int val64offset = Table64(dyn, (V)); MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); LDRx_literal(A, val64offset);}
-#define FTABLE64(A, V) {mmx87_regs_t v = {.d = V}; int val64offset = Table64(dyn, v.q); MESSAGE(LOG_DUMP, " FTable64: %g\n", v.d); VLDR64_literal(A, val64offset);}
+#define INST_NAME(name) inst_name_pass3(dyn, ninst, name, rex)
+#define TABLE64(A, V) {int val64offset = Table64(dyn, (V), 3); MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); LDRx_literal(A, val64offset);}
+#define FTABLE64(A, V) {mmx87_regs_t v = {.d = V}; int val64offset = Table64(dyn, v.q, 3); MESSAGE(LOG_DUMP, " FTable64: %g\n", v.d); VLDR64_literal(A, val64offset);}
diff --git a/src/dynarec/arm64/dynarec_arm64_private.h b/src/dynarec/arm64/dynarec_arm64_private.h
index d0ca7c9..6ac79d7 100755..100644
--- a/src/dynarec/arm64/dynarec_arm64_private.h
+++ b/src/dynarec/arm64/dynarec_arm64_private.h
@@ -9,13 +9,14 @@ typedef struct instsize_s instsize_t;
#define BARRIER_MAYBE 8
-#define NEON_CACHE_NONE 0
-#define NEON_CACHE_ST_D 1
-#define NEON_CACHE_ST_F 2
-#define NEON_CACHE_MM 3
-#define NEON_CACHE_XMMW 4
-#define NEON_CACHE_XMMR 5
-#define NEON_CACHE_SCR 6
+#define NEON_CACHE_NONE 0
+#define NEON_CACHE_ST_D 1
+#define NEON_CACHE_ST_F 2
+#define NEON_CACHE_ST_I64 3
+#define NEON_CACHE_MM 4
+#define NEON_CACHE_XMMW 5
+#define NEON_CACHE_XMMR 6
+#define NEON_CACHE_SCR 7
typedef union neon_cache_s {
int8_t v;
struct {
@@ -57,27 +58,27 @@ typedef struct neoncache_s {
typedef struct flagcache_s {
int pending; // is there a pending flags here, or to check?
- int dfnone; // if defered flags is already set to df_none
+ int dfnone; // if deferred flags is already set to df_none
} flagcache_t;
typedef struct instruction_arm64_s {
instruction_x64_t x64;
- uintptr_t address; // (start) address of the arm emited instruction
+ uintptr_t address; // (start) address of the arm emitted instruction
uintptr_t epilog; // epilog of current instruction (can be start of next, or barrier stuff)
- int size; // size of the arm emited instruction
- int size2; // size of the arm emited instrucion after pass2
+ int size; // size of the arm emitted instruction
+ int size2; // size of the arm emitted instrucion after pass2
int pred_sz; // size of predecessor list
int *pred; // predecessor array
uintptr_t mark, mark2, mark3;
- uintptr_t markf;
+ uintptr_t markf, markf2;
uintptr_t markseg;
uintptr_t marklock;
int pass2choice;// value for choices that are fixed on pass2 for pass3
uintptr_t natcall;
int retn;
int barrier_maybe;
- flagcache_t f_exit; // flags status at end of intruction
- neoncache_t n; // neoncache at end of intruction (but before poping)
+ flagcache_t f_exit; // flags status at end of instruction
+ neoncache_t n; // neoncache at end of instruction (but before poping)
flagcache_t f_entry; // flags status before the instruction begin
} instruction_arm64_t;
@@ -86,15 +87,16 @@ typedef struct dynarec_arm_s {
int32_t size;
int32_t cap;
uintptr_t start; // start of the block
- uint32_t isize; // size in byte of x64 instructions included
- void* block; // memory pointer where next instruction is emited
+ uint32_t isize; // size in bytes of x64 instructions included
+ void* block; // memory pointer where next instruction is emitted
uintptr_t native_start; // start of the arm code
size_t native_size; // size of emitted arm code
uintptr_t last_ip; // last set IP in RIP (or NULL if unclean state) TODO: move to a cache something
- uint64_t* table64; // table of 64bits value
+ uint64_t* table64; // table of 64bits values
int table64size;// size of table (will be appended at end of executable code)
int table64cap;
uintptr_t tablestart;
+ uintptr_t jmp_next; // address of the jump_next address
flagcache_t f;
neoncache_t n; // cache for the 8..31 double reg from fpu, plus x87 stack delta
uintptr_t* next; // variable array of "next" jump address
@@ -104,12 +106,15 @@ typedef struct dynarec_arm_s {
dynablock_t* dynablock;
instsize_t* instsize;
size_t insts_size; // size of the instruction size array (calculated)
- uint8_t smread; // for strongmem model emulation
+ uint8_t smread; // for strongmem model emulation
uint8_t smwrite; // for strongmem model emulation
uintptr_t forward; // address of the last end of code while testing forward
uintptr_t forward_to; // address of the next jump to (to check if everything is ok)
int32_t forward_size; // size at the forward point
int forward_ninst; // ninst at the forward point
+ uint8_t doublepush;
+ uint8_t doublepop;
+ uint8_t always_test;
} dynarec_arm_t;
void add_next(dynarec_arm_t *dyn, uintptr_t addr);
@@ -117,16 +122,16 @@ uintptr_t get_closest_next(dynarec_arm_t *dyn, uintptr_t addr);
int is_nops(dynarec_arm_t *dyn, uintptr_t addr, int n);
int is_instructions(dynarec_arm_t *dyn, uintptr_t addr, int n);
-int Table64(dynarec_arm_t *dyn, uint64_t val); // add a value to etable64 (if needed) and gives back the imm19 to use in LDR_literal
+int Table64(dynarec_arm_t *dyn, uint64_t val, int pass); // add a value to table64 (if needed) and gives back the imm19 to use in LDR_literal
void CreateJmpNext(void* addr, void* next);
-#define GO_TRACE() \
- GETIP_(ip); \
+#define GO_TRACE(A, B) \
+ GETIP(addr); \
MOVx_REG(x1, xRIP); \
STORE_XEMU_CALL(xRIP); \
- MOV32w(x2, 1); \
- CALL(PrintTrace, -1); \
+ MOV32w(x2, B); \
+ CALL(A, -1); \
LOAD_XEMU_CALL(xRIP)
#endif //__DYNAREC_ARM_PRIVATE_H_
diff --git a/src/dynarec/dynablock.c b/src/dynarec/dynablock.c
index 59530ae..114479b 100755..100644
--- a/src/dynarec/dynablock.c
+++ b/src/dynarec/dynablock.c
@@ -1,6 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
-#include <pthread.h>
#include <errno.h>
#include <setjmp.h>
#include <sys/mman.h>
@@ -9,7 +8,6 @@
#include "box64context.h"
#include "dynarec.h"
#include "emu/x64emu_private.h"
-#include "tools/bridge_private.h"
#include "x64run.h"
#include "x64emu.h"
#include "box64stack.h"
@@ -37,6 +35,39 @@ uint32_t X31_hash_code(void* addr, int len)
return (uint32_t)h;
}
+dynablock_t* InvalidDynablock(dynablock_t* db, int need_lock)
+{
+ if(db) {
+ if(db->gone)
+ return NULL; // already in the process of deletion!
+ dynarec_log(LOG_DEBUG, "InvalidDynablock(%p), db->block=%p x64=%p:%p already gone=%d\n", db, db->block, db->x64_addr, db->x64_addr+db->x64_size-1, db->gone);
+ if(need_lock)
+ mutex_lock(&my_context->mutex_dyndump);
+ // remove jumptable
+ setJumpTableDefault64(db->x64_addr);
+ db->done = 0;
+ db->gone = 1;
+ if(need_lock)
+ mutex_unlock(&my_context->mutex_dyndump);
+ }
+ return db;
+}
+
+void FreeInvalidDynablock(dynablock_t* db, int need_lock)
+{
+ if(db) {
+ if(!db->gone)
+ return; // already in the process of deletion!
+ dynarec_log(LOG_DEBUG, "FreeInvalidDynablock(%p), db->block=%p x64=%p:%p already gone=%d\n", db, db->block, db->x64_addr, db->x64_addr+db->x64_size-1, db->gone);
+ if(need_lock)
+ mutex_lock(&my_context->mutex_dyndump);
+ FreeDynarecMap((uintptr_t)db->actual_block);
+ customFree(db);
+ if(need_lock)
+ mutex_unlock(&my_context->mutex_dyndump);
+ }
+}
+
void FreeDynablock(dynablock_t* db, int need_lock)
{
if(db) {
@@ -50,6 +81,8 @@ void FreeDynablock(dynablock_t* db, int need_lock)
dynarec_log(LOG_DEBUG, " -- FreeDyrecMap(%p, %d)\n", db->actual_block, db->size);
db->done = 0;
db->gone = 1;
+ if(db->previous)
+ FreeInvalidDynablock(db->previous, 0);
FreeDynarecMap((uintptr_t)db->actual_block);
customFree(db);
if(need_lock)
@@ -57,14 +90,26 @@ void FreeDynablock(dynablock_t* db, int need_lock)
}
}
+
+
void MarkDynablock(dynablock_t* db)
{
if(db) {
- if(db->need_test)
- return; // already done
dynarec_log(LOG_DEBUG, "MarkDynablock %p %p-%p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1);
- db->need_test = 1;
- setJumpTableIfRef64(db->x64_addr, db->jmpnext, db->block);
+ if(!setJumpTableIfRef64(db->x64_addr, db->jmpnext, db->block)) {
+ dynablock_t* old = db;
+ db = getDB((uintptr_t)old->x64_addr);
+ if(!old->gone && db!=old) {
+ printf_log(LOG_INFO, "Warning, couldn't mark block as dirty for %p, block=%p, current_block=%p\n", old->x64_addr, old, db);
+ // the block is lost, need to invalidate it...
+ old->gone = 1;
+ old->done = 0;
+ if(!db || db->previous)
+ FreeInvalidDynablock(old, 1);
+ else
+ db->previous = old;
+ }
+ }
}
}
@@ -78,7 +123,7 @@ static int IntervalIntersects(uintptr_t start1, uintptr_t end1, uintptr_t start2
static int MarkedDynablock(dynablock_t* db)
{
if(db) {
- if(db->need_test)
+ if(getNeedTest((uintptr_t)db->x64_addr))
return 1; // already done
}
return 0;
@@ -90,9 +135,8 @@ void MarkRangeDynablock(dynablock_t* db, uintptr_t addr, uintptr_t size)
if(!db)
return;
dynarec_log(LOG_DEBUG, "MarkRangeDynablock %p-%p .. startdb=%p, sizedb=%p\n", (void*)addr, (void*)addr+size-1, (void*)db->x64_addr, (void*)db->x64_size);
- if(!MarkedDynablock(db))
- if(IntervalIntersects((uintptr_t)db->x64_addr, (uintptr_t)db->x64_addr+db->x64_size-1, addr, addr+size+1))
- MarkDynablock(db);
+ if(IntervalIntersects((uintptr_t)db->x64_addr, (uintptr_t)db->x64_addr+db->x64_size-1, addr, addr+size+1))
+ MarkDynablock(db);
}
int FreeRangeDynablock(dynablock_t* db, uintptr_t addr, uintptr_t size)
@@ -138,7 +182,7 @@ void cancelFillBlock()
return NULL if block is not found / cannot be created.
Don't create if create==0
*/
-static dynablock_t* internalDBGetBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr, int create, int need_lock)
+static dynablock_t* internalDBGetBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr, int create, int need_lock, int is32bits)
{
if(hasAlternate((void*)addr))
return NULL;
@@ -153,13 +197,11 @@ static dynablock_t* internalDBGetBlock(x64emu_t* emu, uintptr_t addr, uintptr_t
if(mutex_trylock(&my_context->mutex_dyndump)) // FillBlock not available for now
return NULL;
}
- }
-
- block = getDB(addr); // just in case
- if(block) {
- if(need_lock)
+ block = getDB(addr); // just in case
+ if(block) {
mutex_unlock(&my_context->mutex_dyndump);
- return block;
+ return block;
+ }
}
block = AddNewDynablock(addr);
@@ -167,26 +209,28 @@ static dynablock_t* internalDBGetBlock(x64emu_t* emu, uintptr_t addr, uintptr_t
// fill the block
block->x64_addr = (void*)addr;
if(sigsetjmp(&dynarec_jmpbuf, 1)) {
- printf_log(LOG_INFO, "FillBlock at %p triggered a segfault, cancelling\n", (void*)addr);
+ printf_log(LOG_INFO, "FillBlock at %p triggered a segfault, canceling\n", (void*)addr);
+ FreeDynablock(block, 0);
if(need_lock)
mutex_unlock(&my_context->mutex_dyndump);
return NULL;
}
- void* ret = FillBlock64(block, filladdr);
+ void* ret = FillBlock64(block, filladdr, (addr==filladdr)?0:1, is32bits);
if(!ret) {
dynarec_log(LOG_DEBUG, "Fillblock of block %p for %p returned an error\n", block, (void*)addr);
customFree(block);
block = NULL;
}
// check size
- if(block && (block->x64_size || (!block->x64_size && !block->done))) {
+ if(block) {
int blocksz = block->x64_size;
if(blocksz>my_context->max_db_size)
my_context->max_db_size = blocksz;
// fill-in jumptable
- if(!addJumpTableIfDefault64(block->x64_addr, block->block)) {
+ if(!addJumpTableIfDefault64(block->x64_addr, block->dirty?block->jmpnext:block->block)) {
FreeDynablock(block, 0);
block = getDB(addr);
+ MarkDynablock(block); // just in case...
} else {
if(block->x64_size)
block->done = 1; // don't validate the block if the size is null, but keep the block
@@ -200,15 +244,20 @@ static dynablock_t* internalDBGetBlock(x64emu_t* emu, uintptr_t addr, uintptr_t
return block;
}
-dynablock_t* DBGetBlock(x64emu_t* emu, uintptr_t addr, int create)
+dynablock_t* DBGetBlock(x64emu_t* emu, uintptr_t addr, int create, int is32bits)
{
- dynablock_t *db = internalDBGetBlock(emu, addr, addr, create, 1);
- if(db && db->done && db->block && db->need_test) {
+ dynablock_t *db = internalDBGetBlock(emu, addr, addr, create, 1, is32bits);
+ if(db && db->done && db->block && getNeedTest(addr)) {
+ if(db->always_test)
+ sched_yield(); // just calm down...
if(AreaInHotPage((uintptr_t)db->x64_addr, (uintptr_t)db->x64_addr + db->x64_size - 1)) {
+ emu->test.test = 0;
if(box64_dynarec_fastpage) {
uint32_t hash = X31_hash_code(db->x64_addr, db->x64_size);
- if(hash==db->hash) // seems ok, run it without reprotecting it
+ if(hash==db->hash) { // seems ok, run it without reprotecting it
+ setJumpTableIfRef64(db->x64_addr, db->block, db->jmpnext);
return db;
+ }
db->done = 0; // invalidating the block, it's already not good
dynarec_log(LOG_DEBUG, "Invalidating block %p from %p:%p (hash:%X/%X) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1, hash, db->hash, (void*)addr);
// Free db, it's now invalid!
@@ -220,52 +269,70 @@ dynablock_t* DBGetBlock(x64emu_t* emu, uintptr_t addr, int create)
}
}
uint32_t hash = X31_hash_code(db->x64_addr, db->x64_size);
- if(mutex_trylock(&my_context->mutex_dyndump)) {
- dynarec_log(LOG_DEBUG, "mutex_dyndump not available when trying to validate block %p from %p:%p (hash:%X) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1, db->hash, (void*)addr);
- return NULL;
- }
+ int need_lock = mutex_trylock(&my_context->mutex_dyndump);
if(hash!=db->hash) {
db->done = 0; // invalidating the block
dynarec_log(LOG_DEBUG, "Invalidating block %p from %p:%p (hash:%X/%X) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1, hash, db->hash, (void*)addr);
// Free db, it's now invalid!
- FreeDynablock(db, 0);
+ dynablock_t* old = InvalidDynablock(db, need_lock);
// start again... (will create a new block)
- db = internalDBGetBlock(emu, addr, addr, create, 0);
+ db = internalDBGetBlock(emu, addr, addr, create, need_lock, is32bits);
+ if(db) {
+ if(db->previous)
+ FreeInvalidDynablock(db->previous, need_lock);
+ db->previous = old;
+ } else
+ FreeInvalidDynablock(old, need_lock);
} else {
- db->need_test = 0;
dynarec_log(LOG_DEBUG, "Validating block %p from %p:%p (hash:%X) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1, db->hash, (void*)addr);
protectDB((uintptr_t)db->x64_addr, db->x64_size);
// fill back jumptable
- setJumpTableIfRef64(db->x64_addr, db->block, db->jmpnext);
+ if(isprotectedDB((uintptr_t)db->x64_addr, db->x64_size) && !db->always_test) {
+ setJumpTableIfRef64(db->x64_addr, db->block, db->jmpnext);
+ }
}
- mutex_unlock(&my_context->mutex_dyndump);
+ if(!need_lock)
+ mutex_unlock(&my_context->mutex_dyndump);
}
+ if(!db || !db->block || !db->done)
+ emu->test.test = 0;
return db;
}
-dynablock_t* DBAlternateBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr)
+dynablock_t* DBAlternateBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr, int is32bits)
{
- dynarec_log(LOG_DEBUG, "Creating AlternateBlock at %p for %p\n", (void*)addr, (void*)filladdr);
+ dynarec_log(LOG_DEBUG, "Creating AlternateBlock at %p for %p%s\n", (void*)addr, (void*)filladdr, is32bits?" 32bits":"");
int create = 1;
- dynablock_t *db = internalDBGetBlock(emu, addr, filladdr, create, 1);
- if(db && db->done && db->block && db->need_test) {
- if(mutex_trylock(&my_context->mutex_dyndump))
- return NULL;
+ dynablock_t *db = internalDBGetBlock(emu, addr, filladdr, create, 1, is32bits);
+ if(db && db->done && db->block && getNeedTest(filladdr)) {
+ if(db->always_test)
+ sched_yield(); // just calm down...
+ int need_lock = mutex_trylock(&my_context->mutex_dyndump);
uint32_t hash = X31_hash_code(db->x64_addr, db->x64_size);
if(hash!=db->hash) {
db->done = 0; // invalidating the block
dynarec_log(LOG_DEBUG, "Invalidating alt block %p from %p:%p (hash:%X/%X) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size, hash, db->hash, (void*)addr);
// Free db, it's now invalid!
- FreeDynablock(db, 0);
+ dynablock_t* old = InvalidDynablock(db, need_lock);
// start again... (will create a new block)
- db = internalDBGetBlock(emu, addr, filladdr, create, 0);
+ db = internalDBGetBlock(emu, addr, filladdr, create, need_lock, is32bits);
+ if(db) {
+ if(db->previous)
+ FreeInvalidDynablock(db->previous, need_lock);
+ db->previous = old;
+ } else
+ FreeInvalidDynablock(old, need_lock);
} else {
- db->need_test = 0;
protectDB((uintptr_t)db->x64_addr, db->x64_size);
// fill back jumptable
- addJumpTableIfDefault64(db->x64_addr, db->block);
+ if(isprotectedDB((uintptr_t)db->x64_addr, db->x64_size) && !db->always_test) {
+ setJumpTableIfRef64(db->x64_addr, db->block, db->jmpnext);
+ }
}
- mutex_unlock(&my_context->mutex_dyndump);
+ if(!need_lock)
+ mutex_unlock(&my_context->mutex_dyndump);
}
+ if(!db || !db->block || !db->done)
+ emu->test.test = 0;
return db;
}
diff --git a/src/dynarec/dynablock_private.h b/src/dynarec/dynablock_private.h
index dbe8c50..18666e0 100755..100644
--- a/src/dynarec/dynablock_private.h
+++ b/src/dynarec/dynablock_private.h
@@ -9,14 +9,15 @@ typedef struct instsize_s {
typedef struct dynablock_s {
void* block; // block-sizeof(void*) == self
void* actual_block; // the actual start of the block (so block-sizeof(void*))
+ struct dynablock_s* previous; // a previous block that might need to be freed
int size;
void* x64_addr;
uintptr_t x64_size;
uint32_t hash;
- uint8_t need_test;
uint8_t done;
uint8_t gone;
- uint8_t dummy;
+ uint8_t always_test;
+ uint8_t dirty; // if need to be tested as soon as it's created
int isize;
instsize_t* instsize;
void* jmpnext; // a branch jmpnext code when block is marked
diff --git a/src/dynarec/dynarec.c b/src/dynarec/dynarec.c
index 24d1d1b..bb6b3ba 100755..100644
--- a/src/dynarec/dynarec.c
+++ b/src/dynarec/dynarec.c
@@ -1,6 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
-#include <pthread.h>
#include <errno.h>
#include <setjmp.h>
@@ -8,7 +7,6 @@
#include "box64context.h"
#include "dynarec.h"
#include "emu/x64emu_private.h"
-#include "tools/bridge_private.h"
#include "x64run.h"
#include "x64emu.h"
#include "box64stack.h"
@@ -31,6 +29,7 @@ uintptr_t getX64Address(dynablock_t* db, uintptr_t arm_addr);
void* LinkNext(x64emu_t* emu, uintptr_t addr, void* x2, uintptr_t* x3)
{
+ int is32bits = (R_CS == 0x23);
#ifdef HAVE_TRACE
if(!addr) {
dynablock_t* db = FindDynablockFromNativeAddress(x2-4);
@@ -38,27 +37,28 @@ void* LinkNext(x64emu_t* emu, uintptr_t addr, void* x2, uintptr_t* x3)
}
#endif
void * jblock;
- dynablock_t* block = DBGetBlock(emu, addr, 1);
+ dynablock_t* block = NULL;
+ if(hasAlternate((void*)addr)) {
+ printf_log(LOG_DEBUG, "Jmp address has alternate: %p", (void*)addr);
+ if(box64_log<LOG_DEBUG) dynarec_log(LOG_INFO, "Jmp address has alternate: %p", (void*)addr);
+ uintptr_t old_addr = addr;
+ addr = (uintptr_t)getAlternate((void*)addr); // set new address
+ R_RIP = addr; // but also new RIP!
+ *x3 = addr; // and the RIP in x27 register
+ printf_log(LOG_DEBUG, " -> %p\n", (void*)addr);
+ block = DBAlternateBlock(emu, old_addr, addr, is32bits);
+ } else
+ block = DBGetBlock(emu, addr, 1, is32bits);
if(!block) {
- // no block, let link table as is...
- if(hasAlternate((void*)addr)) {
- printf_log(LOG_DEBUG, "Jmp address has alternate: %p", (void*)addr);
- if(box64_log<LOG_DEBUG) dynarec_log(LOG_INFO, "Jmp address has alternate: %p", (void*)addr);
- addr = (uintptr_t)getAlternate((void*)addr); // set new address
- R_RIP = addr; // but also new RIP!
- *x3 = addr; // and the RIP in x27 register
- printf_log(LOG_DEBUG, " -> %p\n", (void*)addr);
- block = DBGetBlock(emu, addr, 1);
- }
- if(!block) {
- #ifdef HAVE_TRACE
+ #ifdef HAVE_TRACE
+ if(LOG_INFO<=box64_dynarec_log) {
dynablock_t* db = FindDynablockFromNativeAddress(x2-4);
elfheader_t* h = FindElfAddress(my_context, (uintptr_t)x2-4);
dynarec_log(LOG_INFO, "Warning, jumping to a no-block address %p from %p (db=%p, x64addr=%p(elf=%s))\n", (void*)addr, x2-4, db, db?(void*)getX64Address(db, (uintptr_t)x2-4):NULL, h?ElfName(h):"(none)");
- #endif
- //tableupdate(native_epilog, addr, table);
- return native_epilog;
}
+ #endif
+ //tableupdate(native_epilog, addr, table);
+ return native_epilog;
}
if(!block->done) {
// not finished yet... leave linker
@@ -73,127 +73,77 @@ void* LinkNext(x64emu_t* emu, uintptr_t addr, void* x2, uintptr_t* x3)
}
#endif
-#ifdef __GNUC__
-// Disable "clobbered" warnings
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wclobbered"
-#endif
void DynaCall(x64emu_t* emu, uintptr_t addr)
{
- // prepare setjump for signal handling
- emu_jmpbuf_t *ejb = NULL;
- int jmpbuf_reset = 0;
- if(emu->type == EMUTYPE_MAIN) {
- ejb = GetJmpBuf();
- if(!ejb->jmpbuf_ok) {
- ejb->emu = emu;
- ejb->jmpbuf_ok = 1;
- jmpbuf_reset = 1;
- if(sigsetjmp((struct __jmp_buf_tag*)ejb->jmpbuf, 1)) {
- printf_log(LOG_DEBUG, "Setjmp DynaCall, fs=0x%x\n", ejb->emu->segs[_FS]);
- addr = R_RIP; // not sure if it should still be inside DynaCall!
- }
- }
- }
-#ifdef DYNAREC
- if(!box64_dynarec)
-#endif
- EmuCall(emu, addr);
-#ifdef DYNAREC
- else {
- uint64_t old_rsp = R_RSP;
- uint64_t old_rbx = R_RBX;
- uint64_t old_rdi = R_RDI;
- uint64_t old_rsi = R_RSI;
- uint64_t old_rbp = R_RBP;
- uint64_t old_rip = R_RIP;
- PushExit(emu);
- R_RIP = addr;
- emu->df = d_none;
- while(!emu->quit) {
- dynablock_t* block = DBGetBlock(emu, R_RIP, 1);
- if(!block || !block->block || !block->done) {
- // no block, of block doesn't have DynaRec content (yet, temp is not null)
- // Use interpreter (should use single instruction step...)
- dynarec_log(LOG_DEBUG, "%04d|Calling Interpretor @%p, emu=%p\n", GetTID(), (void*)R_RIP, emu);
- Run(emu, 1);
- } else {
- dynarec_log(LOG_DEBUG, "%04d|Calling DynaRec Block @%p (%p) of %d x64 instructions emu=%p\n", GetTID(), (void*)R_RIP, block->block, block->isize ,emu);
- CHECK_FLAGS(emu);
- // block is here, let's run it!
- native_prolog(emu, block->block);
- }
- if(emu->fork) {
- int forktype = emu->fork;
- emu->quit = 0;
- emu->fork = 0;
- emu = x64emu_fork(emu, forktype);
- if(emu->type == EMUTYPE_MAIN) {
- ejb = GetJmpBuf();
- ejb->emu = emu;
- ejb->jmpbuf_ok = 1;
- jmpbuf_reset = 1;
- if(sigsetjmp((struct __jmp_buf_tag*)ejb->jmpbuf, 1)) {
- printf_log(LOG_DEBUG, "Setjmp inner DynaCall, fs=0x%x\n", ejb->emu->segs[_FS]);
- addr = R_RIP;
- }
- }
- }
- }
- emu->quit = 0; // reset Quit flags...
- emu->df = d_none;
- if(emu->quitonlongjmp && emu->longjmp) {
- if(emu->quitonlongjmp==1)
- emu->longjmp = 0; // don't change anything because of the longjmp
- } else {
- R_RBX = old_rbx;
- R_RDI = old_rdi;
- R_RSI = old_rsi;
- R_RBP = old_rbp;
- R_RSP = old_rsp;
- R_RIP = old_rip; // and set back instruction pointer
- }
+ uint64_t old_rsp = R_RSP;
+ uint64_t old_rbx = R_RBX;
+ uint64_t old_rdi = R_RDI;
+ uint64_t old_rsi = R_RSI;
+ uint64_t old_rbp = R_RBP;
+ uint64_t old_rip = R_RIP;
+ PushExit(emu);
+ R_RIP = addr;
+ emu->df = d_none;
+ DynaRun(emu);
+ emu->quit = 0; // reset Quit flags...
+ emu->df = d_none;
+ if(emu->flags.quitonlongjmp && emu->flags.longjmp) {
+ if(emu->flags.quitonlongjmp==1)
+ emu->flags.longjmp = 0; // don't change anything because of the longjmp
+ } else {
+ R_RBX = old_rbx;
+ R_RDI = old_rdi;
+ R_RSI = old_rsi;
+ R_RBP = old_rbp;
+ R_RSP = old_rsp;
+ R_RIP = old_rip; // and set back instruction pointer
}
-#endif
- // clear the setjmp
- if(ejb && jmpbuf_reset)
- ejb->jmpbuf_ok = 0;
}
-int DynaRun(x64emu_t* emu)
+void DynaRun(x64emu_t* emu)
{
// prepare setjump for signal handling
- emu_jmpbuf_t *ejb = NULL;
-#ifdef DYNAREC
- int jmpbuf_reset = 1;
-#endif
- if(emu->type == EMUTYPE_MAIN) {
- ejb = GetJmpBuf();
- if(!ejb->jmpbuf_ok) {
- ejb->emu = emu;
- ejb->jmpbuf_ok = 1;
-#ifdef DYNAREC
- jmpbuf_reset = 1;
-#endif
- if(sigsetjmp((struct __jmp_buf_tag*)ejb->jmpbuf, 1))
- printf_log(LOG_DEBUG, "Setjmp DynaRun, fs=0x%x\n", ejb->emu->segs[_FS]);
+ struct __jmp_buf_tag jmpbuf[1] = {0};
+ int skip = 0;
+ struct __jmp_buf_tag *old_jmpbuf = emu->jmpbuf;
+ emu->flags.jmpbuf_ready = 0;
+
+ while(!(emu->quit)) {
+ if(!emu->jmpbuf || (emu->flags.need_jmpbuf && emu->jmpbuf!=jmpbuf)) {
+ emu->jmpbuf = jmpbuf;
+ emu->flags.jmpbuf_ready = 1;
+ if((skip=sigsetjmp(emu->jmpbuf, 1))) {
+ printf_log(LOG_DEBUG, "Setjmp DynaRun, fs=0x%x\n", emu->segs[_FS]);
+ #ifdef DYNAREC
+ if(box64_dynarec_test) {
+ if(emu->test.clean)
+ x64test_check(emu, R_RIP);
+ emu->test.clean = 0;
+ }
+ #endif
+ }
}
- }
+ if(emu->flags.need_jmpbuf)
+ emu->flags.need_jmpbuf = 0;
+
#ifdef DYNAREC
- if(!box64_dynarec)
+ if(!box64_dynarec)
#endif
- return Run(emu, 0);
+ Run(emu, 0);
#ifdef DYNAREC
- else {
- while(!emu->quit) {
- dynablock_t* block = DBGetBlock(emu, R_RIP, 1);
+ else {
+ int is32bits = (emu->segs[_CS]==0x23);
+ dynablock_t* block = (skip)?NULL:DBGetBlock(emu, R_RIP, 1, is32bits);
if(!block || !block->block || !block->done) {
+ skip = 0;
// no block, of block doesn't have DynaRec content (yet, temp is not null)
// Use interpreter (should use single instruction step...)
- dynarec_log(LOG_DEBUG, "%04d|Running Interpretor @%p, emu=%p\n", GetTID(), (void*)R_RIP, emu);
+ dynarec_log(LOG_DEBUG, "%04d|Running Interpreter @%p, emu=%p\n", GetTID(), (void*)R_RIP, emu);
+ if(box64_dynarec_test)
+ emu->test.clean = 0;
Run(emu, 1);
} else {
- dynarec_log(LOG_DEBUG, "%04d|Running DynaRec Block @%p (%p) of %d x64 insts emu=%p\n", GetTID(), (void*)R_RIP, block->block, block->isize, emu);
+ dynarec_log(LOG_DEBUG, "%04d|Running DynaRec Block @%p (%p) of %d x64 insts (hash=0x%x) emu=%p\n", GetTID(), (void*)R_RIP, block->block, block->isize, block->hash, emu);
// block is here, let's run it!
native_prolog(emu, block->block);
}
@@ -202,23 +152,12 @@ int DynaRun(x64emu_t* emu)
emu->quit = 0;
emu->fork = 0;
emu = x64emu_fork(emu, forktype);
- if(emu->type == EMUTYPE_MAIN) {
- ejb = GetJmpBuf();
- ejb->emu = emu;
- ejb->jmpbuf_ok = 1;
- jmpbuf_reset = 1;
- if(sigsetjmp((struct __jmp_buf_tag*)ejb->jmpbuf, 1))
- printf_log(LOG_DEBUG, "Setjmp inner DynaRun, fs=0x%x\n", ejb->emu->segs[_FS]);
- }
}
}
+#endif
+ if(emu->flags.need_jmpbuf)
+ emu->quit = 0;
}
// clear the setjmp
- if(ejb && jmpbuf_reset)
- ejb->jmpbuf_ok = 0;
- return 0;
-#endif
+ emu->jmpbuf = old_jmpbuf;
}
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
diff --git a/src/dynarec/dynarec_arch.h b/src/dynarec/dynarec_arch.h
index e5e9865..51e74d4 100755..100644
--- a/src/dynarec/dynarec_arch.h
+++ b/src/dynarec/dynarec_arch.h
@@ -2,22 +2,45 @@
#define __DYNAREC_ARCH__H_
#ifdef ARM64
-#include "arm64/arm64_printer.h"
-#include "arm64/dynarec_arm64_private.h"
-#include "arm64/dynarec_arm64_functions.h"
#define instruction_native_t instruction_arm64_t
#define dynarec_native_t dynarec_arm_t
+#define ADDITIONNAL_DEFINITION() \
+ int fpuCacheNeedsTransform(dynarec_native_t* dyn, int ninst);
+
+#define OTHER_CACHE() \
+ if (fpuCacheNeedsTransform(dyn, ninst)) ret|=2;
+
+#include "arm64/arm64_printer.h"
+#include "arm64/dynarec_arm64_private.h"
+#include "arm64/dynarec_arm64_functions.h"
#elif defined(LA464)
+
+#define instruction_native_t instruction_la464_t
+#define dynarec_native_t dynarec_la464_t
+
+#define ADDITIONNAL_DEFINITION()
+
+#define OTHER_CACHE()
+
#include "la464/la464_printer.h"
#include "la464/dynarec_la464_private.h"
#include "la464/dynarec_la464_functions.h"
+#elif defined(RV64)
-#define instruction_native_t instruction_la464_t
-#define dynarec_native_t dynarec_la464_t
+#define instruction_native_t instruction_rv64_t
+#define dynarec_native_t dynarec_rv64_t
+
+#define ADDITIONNAL_DEFINITION() \
+ int fpuCacheNeedsTransform(dynarec_native_t* dyn, int ninst);
+#define OTHER_CACHE() \
+ if (fpuCacheNeedsTransform(dyn, ninst)) ret|=2;
+#include "rv64/rv64_printer.h"
+#include "rv64/dynarec_rv64_private.h"
+#include "rv64/dynarec_rv64_functions.h"
#else
#error Unsupported platform
#endif
diff --git a/src/dynarec/dynarec_helper.h b/src/dynarec/dynarec_helper.h
index 19f48dc..2f4b82f 100755..100644
--- a/src/dynarec/dynarec_helper.h
+++ b/src/dynarec/dynarec_helper.h
@@ -5,6 +5,8 @@
#include "arm64/dynarec_arm64_helper.h"
#elif defined(LA464)
#include "la464/dynarec_la464_helper.h"
+#elif defined(RV64)
+#include "rv64/dynarec_rv64_helper.h"
#else
#error Unsupported architecture
#endif
diff --git a/src/dynarec/dynarec_native.c b/src/dynarec/dynarec_native.c
index c3f01ff..2aade27 100755..100644
--- a/src/dynarec/dynarec_native.c
+++ b/src/dynarec/dynarec_native.c
@@ -1,6 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
-#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
@@ -10,7 +9,6 @@
#include "custommem.h"
#include "dynarec.h"
#include "emu/x64emu_private.h"
-#include "tools/bridge_private.h"
#include "x64run.h"
#include "x64emu.h"
#include "box64stack.h"
@@ -75,20 +73,22 @@ void add_next(dynarec_native_t *dyn, uintptr_t addr) {
// add slots
if(dyn->next_sz == dyn->next_cap) {
dyn->next_cap += 64;
- dyn->next = (uintptr_t*)customRealloc(dyn->next, dyn->next_cap*sizeof(uintptr_t));
+ dyn->next = (uintptr_t*)dynaRealloc(dyn->next, dyn->next_cap*sizeof(uintptr_t));
}
dyn->next[dyn->next_sz++] = addr;
}
uintptr_t get_closest_next(dynarec_native_t *dyn, uintptr_t addr) {
- // get closest, but no addresses befores
+ // get closest, but no addresses before
uintptr_t best = 0;
int i = 0;
while((i<dyn->next_sz) && (best!=addr)) {
- if(dyn->next[i]<addr) { // remove the address, it's before current address
- dyn->next[i] = 0;
- } else {
- if((dyn->next[i]<best) || !best)
- best = dyn->next[i];
+ if(dyn->next[i]) {
+ if(dyn->next[i]<addr) { // remove the address, it's before current address
+ dyn->next[i] = 0;
+ } else {
+ if((dyn->next[i]<best) || !best)
+ best = dyn->next[i];
+ }
}
++i;
}
@@ -124,8 +124,8 @@ int is_nops(dynarec_native_t *dyn, uintptr_t addr, int n)
return 0;
}
-// return size of next instuciton, -1 is unknown
-// not all instrction are setup
+// return size of next instruction, -1 is unknown
+// not all instructions are setup
int next_instruction(dynarec_native_t *dyn, uintptr_t addr)
{
uint8_t opcode = PK(0);
@@ -265,7 +265,7 @@ void addInst(instsize_t* insts, size_t* size, int x64_size, int native_size)
}
// add a value to table64 (if needed) and gives back the imm19 to use in LDR_literal
-int Table64(dynarec_native_t *dyn, uint64_t val)
+int Table64(dynarec_native_t *dyn, uint64_t val, int pass)
{
// find the value if already present
int idx = -1;
@@ -276,10 +276,14 @@ int Table64(dynarec_native_t *dyn, uint64_t val)
if(idx==-1) {
if(dyn->table64size == dyn->table64cap) {
dyn->table64cap+=16;
- dyn->table64 = (uint64_t*)customRealloc(dyn->table64, dyn->table64cap * sizeof(uint64_t));
+ if(pass<3) // do not resize on pass3, it's not the same type of memory anymore
+ dyn->table64 = (uint64_t*)dynaRealloc(dyn->table64, dyn->table64cap * sizeof(uint64_t));
}
idx = dyn->table64size++;
- dyn->table64[idx] = val;
+ if(idx < dyn->table64cap)
+ dyn->table64[idx] = val;
+ else
+ printf_log(LOG_NONE, "Warning, table64 bigger than expected %d vs %d\n", idx, dyn->table64cap);
}
// calculate offset
int delta = dyn->tablestart + idx*sizeof(uint64_t) - (uintptr_t)dyn->block;
@@ -289,7 +293,7 @@ int Table64(dynarec_native_t *dyn, uint64_t val)
static void fillPredecessors(dynarec_native_t* dyn)
{
int pred_sz = 1; // to be safe
- // compute total size of predecessor to alocate the array
+ // compute total size of predecessor to allocate the array
// first compute the jumps
for(int i=0; i<dyn->size; ++i) {
if(dyn->insts[i].x64.jmp && (dyn->insts[i].x64.jmp_insts!=-1)) {
@@ -297,6 +301,13 @@ static void fillPredecessors(dynarec_native_t* dyn)
dyn->insts[dyn->insts[i].x64.jmp_insts].pred_sz++;
}
}
+ // remove "has_next" from orphan branch
+ for(int i=0; i<dyn->size-1; ++i) {
+ if(!dyn->insts[i].x64.has_next) {
+ if(dyn->insts[i+1].x64.has_next && !dyn->insts[i+1].pred_sz)
+ dyn->insts[i+1].x64.has_next = 0;
+ }
+ }
// second the "has_next"
for(int i=0; i<dyn->size-1; ++i) {
if(dyn->insts[i].x64.has_next) {
@@ -304,7 +315,8 @@ static void fillPredecessors(dynarec_native_t* dyn)
dyn->insts[i+1].pred_sz++;
}
}
- dyn->predecessor = (int*)customMalloc(pred_sz*sizeof(int));
+ int alloc_size = pred_sz;
+ dyn->predecessor = (int*)dynaMalloc(pred_sz*sizeof(int));
// fill pred pointer
int* p = dyn->predecessor;
for(int i=0; i<dyn->size; ++i) {
@@ -321,11 +333,10 @@ static void fillPredecessors(dynarec_native_t* dyn)
dyn->insts[j].pred[dyn->insts[j].pred_sz++] = i;
}
}
-
}
-// updateNeed goes backward, from last intruction to top
-static int updateNeed(dynarec_arm_t* dyn, int ninst, uint8_t need) {
+// updateNeed goes backward, from last instruction to top
+static int updateNeed(dynarec_native_t* dyn, int ninst, uint8_t need) {
while (ninst>=0) {
// need pending but instruction is only a subset: remove pend and use an X_ALL instead
need |= dyn->insts[ninst].x64.need_after;
@@ -364,9 +375,9 @@ static int updateNeed(dynarec_arm_t* dyn, int ninst, uint8_t need) {
else
updateNeed(dyn, dyn->insts[ninst].pred[i], need);
}
- if(!ok)
- return ninst - 1;
--ninst;
+ if(!ok)
+ return ninst;
}
return ninst;
}
@@ -379,27 +390,25 @@ void CancelBlock64(int need_lock)
mutex_lock(&my_context->mutex_dyndump);
dynarec_native_t* helper = (dynarec_native_t*)current_helper;
current_helper = NULL;
- if(!helper) {
- if(need_lock)
- mutex_unlock(&my_context->mutex_dyndump);
- return;
+ if(helper) {
+ dynaFree(helper->next);
+ dynaFree(helper->insts);
+ dynaFree(helper->predecessor);
+ if(helper->table64 && (helper->table64!=(uint64_t*)helper->tablestart))
+ dynaFree(helper->table64);
+ if(helper->dynablock && helper->dynablock->actual_block) {
+ FreeDynarecMap((uintptr_t)helper->dynablock->actual_block);
+ helper->dynablock->actual_block = NULL;
+ }
}
- customFree(helper->next);
- customFree(helper->insts);
- customFree(helper->predecessor);
- customFree(helper->table64);
- if(helper->dynablock && helper->dynablock->actual_block)
- FreeDynarecMap((uintptr_t)helper->dynablock->actual_block);
- else if(helper->dynablock && helper->block)
- FreeDynarecMap((uintptr_t)helper->block-sizeof(void*));
if(need_lock)
mutex_unlock(&my_context->mutex_dyndump);
}
-uintptr_t native_pass0(dynarec_native_t* dyn, uintptr_t addr);
-uintptr_t native_pass1(dynarec_native_t* dyn, uintptr_t addr);
-uintptr_t native_pass2(dynarec_native_t* dyn, uintptr_t addr);
-uintptr_t native_pass3(dynarec_native_t* dyn, uintptr_t addr);
+uintptr_t native_pass0(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits);
+uintptr_t native_pass1(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits);
+uintptr_t native_pass2(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits);
+uintptr_t native_pass3(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits);
void* CreateEmptyBlock(dynablock_t* block, uintptr_t addr) {
block->isize = 0;
@@ -408,7 +417,7 @@ void* CreateEmptyBlock(dynablock_t* block, uintptr_t addr) {
void* actual_p = (void*)AllocDynarecMap(sz);
void* p = actual_p + sizeof(void*);
if(actual_p==NULL) {
- dynarec_log(LOG_INFO, "AllocDynarecMap(%p, %zu) failed, cancelling block\n", block, sz);
+ dynarec_log(LOG_INFO, "AllocDynarecMap(%p, %zu) failed, canceling block\n", block, sz);
CancelBlock64(0);
return NULL;
}
@@ -419,13 +428,12 @@ void* CreateEmptyBlock(dynablock_t* block, uintptr_t addr) {
*(dynablock_t**)actual_p = block;
*(void**)(p+2*sizeof(void*)) = native_epilog;
CreateJmpNext(block->jmpnext, p+2*sizeof(void*));
- block->need_test = 0;
// all done...
__clear_cache(actual_p, actual_p+sz); // need to clear the cache before execution...
return block;
}
-void* FillBlock64(dynablock_t* block, uintptr_t addr) {
+void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bits) {
/*
A Block must have this layout:
@@ -436,11 +444,11 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr) {
B+8 .. B+15 : 2 Native code for jmpnext (or jmp epilog in case of empty block)
B+16 .. B+23 : jmpnext (or jmp_epilog) address
B+24 .. B+31 : empty (in case an architecture needs more than 2 opcodes)
- B+32 .. B+32+sz : instsize (compressed array with each instruction lenght on x64 and native side)
+ B+32 .. B+32+sz : instsize (compressed array with each instruction length on x64 and native side)
*/
if(IsInHotPage(addr)) {
- dynarec_log(LOG_DEBUG, "Cancelling dynarec FillBlock on hotpage for %p\n", (void*)addr);
+ dynarec_log(LOG_DEBUG, "Canceling dynarec FillBlock on hotpage for %p\n", (void*)addr);
return NULL;
}
if(addr>=box64_nodynarec_start && addr<box64_nodynarec_end) {
@@ -448,7 +456,7 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr) {
return CreateEmptyBlock(block, addr);
}
if(current_helper) {
- dynarec_log(LOG_DEBUG, "Cancelling dynarec FillBlock at %p as anothor one is going on\n", (void*)addr);
+ dynarec_log(LOG_DEBUG, "Canceling dynarec FillBlock at %p as another one is going on\n", (void*)addr);
return NULL;
}
// protect the 1st page
@@ -460,18 +468,18 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr) {
helper.start = addr;
uintptr_t start = addr;
helper.cap = 128;
- helper.insts = (instruction_native_t*)customCalloc(helper.cap, sizeof(instruction_native_t));
+ helper.insts = (instruction_native_t*)dynaCalloc(helper.cap, sizeof(instruction_native_t));
// pass 0, addresses, x64 jump addresses, overall size of the block
- uintptr_t end = native_pass0(&helper, addr);
+ uintptr_t end = native_pass0(&helper, addr, alternate, is32bits);
// no need for next anymore
- customFree(helper.next);
+ dynaFree(helper.next);
helper.next_sz = helper.next_cap = 0;
helper.next = NULL;
// basic checks
if(!helper.size) {
dynarec_log(LOG_INFO, "Warning, null-sized dynarec block (%p)\n", (void*)addr);
CancelBlock64(0);
- return CreateEmptyBlock(block, addr);;
+ return CreateEmptyBlock(block, addr);
}
if(!isprotectedDB(addr, 1)) {
dynarec_log(LOG_INFO, "Warning, write on current page on pass0, aborting dynablock creation (%p)\n", (void*)addr);
@@ -489,6 +497,8 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr) {
if(helper.insts[i].x64.jmp) {
uintptr_t j = helper.insts[i].x64.jmp;
if(j<start || j>=end || j==helper.insts[i].x64.addr) {
+ if(j==helper.insts[i].x64.addr) // if there is a loop on some opcode, make the block "always to tested"
+ helper.always_test = 1;
helper.insts[i].x64.jmp_insts = -1;
helper.insts[i].x64.need_after |= X_PEND;
} else {
@@ -510,96 +520,103 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr) {
while (pos>=0)
pos = updateNeed(&helper, pos, 0);
- // pass 1, float optimisations, first pass for flags
- native_pass1(&helper, addr);
+ // pass 1, float optimizations, first pass for flags
+ native_pass1(&helper, addr, alternate, is32bits);
// pass 2, instruction size
- native_pass2(&helper, addr);
+ native_pass2(&helper, addr, alternate, is32bits);
// keep size of instructions for signal handling
size_t insts_rsize = (helper.insts_size+2)*sizeof(instsize_t);
insts_rsize = (insts_rsize+7)&~7; // round the size...
+ size_t native_size = (helper.native_size+7)&~7; // round the size...
// ok, now allocate mapped memory, with executable flag on
- size_t sz = sizeof(void*) + helper.native_size + helper.table64size*sizeof(uint64_t) + 4*sizeof(void*) + insts_rsize;
- // dynablock_t* block (arm insts) table64 jmpnext code instsize
+ size_t sz = sizeof(void*) + native_size + helper.table64size*sizeof(uint64_t) + 4*sizeof(void*) + insts_rsize;
+ // dynablock_t* block (arm insts) table64 jmpnext code instsize
void* actual_p = (void*)AllocDynarecMap(sz);
- void* p = actual_p + sizeof(void*);
- void* next = p + helper.native_size + helper.table64size*sizeof(uint64_t);
+ void* p = (void*)(((uintptr_t)actual_p) + sizeof(void*));
+ void* tablestart = p + native_size;
+ void* next = tablestart + helper.table64size*sizeof(uint64_t);
void* instsize = next + 4*sizeof(void*);
if(actual_p==NULL) {
- dynarec_log(LOG_INFO, "AllocDynarecMap(%p, %zu) failed, cancelling block\n", block, sz);
+ dynarec_log(LOG_INFO, "AllocDynarecMap(%p, %zu) failed, canceling block\n", block, sz);
CancelBlock64(0);
return NULL;
}
helper.block = p;
+ block->actual_block = actual_p;
helper.native_start = (uintptr_t)p;
- helper.tablestart = helper.native_start + helper.native_size;
- helper.insts_size = 0; // reset
+ helper.tablestart = (uintptr_t)tablestart;
+ helper.jmp_next = (uintptr_t)next+sizeof(void*);
helper.instsize = (instsize_t*)instsize;
*(dynablock_t**)actual_p = block;
+ helper.table64cap = helper.table64size;
+ dynaFree(helper.table64);
+ helper.table64 = (uint64_t*)helper.tablestart;
// pass 3, emit (log emit native opcode)
if(box64_dynarec_dump) {
- dynarec_log(LOG_NONE, "%s%04d|Emitting %zu bytes for %u x64 bytes", (box64_dynarec_dump>1)?"\e[01;36m":"", GetTID(), helper.native_size, helper.isize);
+ dynarec_log(LOG_NONE, "%s%04d|Emitting %zu bytes for %u %s bytes", (box64_dynarec_dump>1)?"\e[01;36m":"", GetTID(), helper.native_size, helper.isize, is32bits?"x86":"x64");
printFunctionAddr(helper.start, " => ");
dynarec_log(LOG_NONE, "%s\n", (box64_dynarec_dump>1)?"\e[m":"");
}
int oldtable64size = helper.table64size;
size_t oldnativesize = helper.native_size;
+ size_t oldinstsize = helper.insts_size;
helper.native_size = 0;
helper.table64size = 0; // reset table64 (but not the cap)
- native_pass3(&helper, addr);
- if((oldnativesize!=helper.native_size) || (oldtable64size<helper.table64size)) {
- printf_log(LOG_NONE, "BOX64: Warning, size difference in block between pass2 (%zu) & pass3 (%zu)!\n", sz, helper.native_size+helper.table64size*8);
- uint8_t *dump = (uint8_t*)helper.start;
- printf_log(LOG_NONE, "Dump of %d x64 opcodes:\n", helper.size);
- for(int i=0; i<helper.size; ++i) {
- printf_log(LOG_NONE, "%p:", dump);
- for(; dump<(uint8_t*)helper.insts[i+1].x64.addr; ++dump)
- printf_log(LOG_NONE, " %02X", *dump);
- printf_log(LOG_NONE, "\t%d -> %d\n", helper.insts[i].size2, helper.insts[i].size);
- }
- printf_log(LOG_NONE, "Table64 \t%d -> %d\n", oldtable64size*8, helper.table64size*8);
- printf_log(LOG_NONE, " ------------\n");
- //TODO: Cancel block and return empty one
- }
- // add table64 if needed
- if(helper.table64size) {
- memcpy((void*)helper.tablestart, helper.table64, helper.table64size*8);
- }
+ helper.insts_size = 0; // reset
+ native_pass3(&helper, addr, alternate, is32bits);
// keep size of instructions for signal handling
block->instsize = instsize;
// ok, free the helper now
- customFree(helper.insts);
+ dynaFree(helper.insts);
helper.insts = NULL;
- customFree(helper.table64);
helper.table64 = NULL;
helper.instsize = NULL;
- customFree(helper.predecessor);
+ dynaFree(helper.predecessor);
helper.predecessor = NULL;
block->size = sz;
block->isize = helper.size;
- block->actual_block = actual_p;
block->block = p;
block->jmpnext = next+sizeof(void*);
+ block->always_test = helper.always_test;
+ block->dirty = block->always_test;
*(dynablock_t**)next = block;
- *(void**)(next+2*sizeof(void*)) = native_next;
- CreateJmpNext(block->jmpnext, next+2*sizeof(void*));
- block->need_test = 0;
+ *(void**)(next+3*sizeof(void*)) = native_next;
+ CreateJmpNext(block->jmpnext, next+3*sizeof(void*));
//block->x64_addr = (void*)start;
block->x64_size = end-start;
// all done...
__clear_cache(actual_p, actual_p+sz); // need to clear the cache before execution...
block->hash = X31_hash_code(block->x64_addr, block->x64_size);
- // Check if something changed, to abbort if it as
+ // Check if something changed, to abort if it is
if((block->hash != hash)) {
- dynarec_log(LOG_DEBUG, "Warning, a block changed while beeing processed hash(%p:%ld)=%x/%x\n", block->x64_addr, block->x64_size, block->hash, hash);
+ dynarec_log(LOG_DEBUG, "Warning, a block changed while being processed hash(%p:%ld)=%x/%x\n", block->x64_addr, block->x64_size, block->hash, hash);
AddHotPage(addr);
CancelBlock64(0);
return NULL;
}
+ if((oldnativesize!=helper.native_size) || (oldtable64size<helper.table64size)) {
+ printf_log(LOG_NONE, "BOX64: Warning, size difference in block between pass2 (%zu) & pass3 (%zu)!\n", sz, helper.native_size+helper.table64size*8);
+ uint8_t *dump = (uint8_t*)helper.start;
+ printf_log(LOG_NONE, "Dump of %d x64 opcodes:\n", helper.size);
+ for(int i=0; i<helper.size; ++i) {
+ printf_log(LOG_NONE, "%p:", dump);
+ for(; dump<(uint8_t*)helper.insts[i+1].x64.addr; ++dump)
+ printf_log(LOG_NONE, " %02X", *dump);
+ printf_log(LOG_NONE, "\t%d -> %d\n", helper.insts[i].size2, helper.insts[i].size);
+ }
+ printf_log(LOG_NONE, "Table64 \t%d -> %d\n", oldtable64size*8, helper.table64size*8);
+ printf_log(LOG_NONE, " ------------\n");
+ CancelBlock64(0);
+ return NULL;
+ }
+ if(insts_rsize/sizeof(instsize_t)<helper.insts_size) {
+ printf_log(LOG_NONE, "BOX64: Warning, insts_size difference in block between pass2 (%zu) and pass3 (%zu), allocated: %zu\n", oldinstsize, helper.insts_size, insts_rsize/sizeof(instsize_t));
+ }
if(!isprotectedDB(addr, end-addr)) {
- dynarec_log(LOG_DEBUG, "Warning, block unprotected while beeing processed %p:%ld, cancelling\n", block->x64_addr, block->x64_size);
+ dynarec_log(LOG_DEBUG, "Warning, block unprotected while being processed %p:%ld, marking as need_test\n", block->x64_addr, block->x64_size);
AddHotPage(addr);
- block->need_test = 1;
+ block->dirty = 1;
//protectDB(addr, end-addr);
}
current_helper = NULL;
diff --git a/src/dynarec/dynarec_native_functions.c b/src/dynarec/dynarec_native_functions.c
new file mode 100644
index 0000000..7f4ec40
--- /dev/null
+++ b/src/dynarec/dynarec_native_functions.c
@@ -0,0 +1,481 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <math.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "tools/bridge_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "emu/x87emu_private.h"
+#include "x64trace.h"
+#include "signals.h"
+#include "dynarec_native.h"
+#include "custommem.h"
+#include "bridge.h"
+#include "dynarec_native_functions.h"
+
+void native_fstp(x64emu_t* emu, void* p)
+{
+ if(ST0.q!=STld(0).uref)
+ D2LD(&ST0.d, p);
+ else
+ memcpy(p, &STld(0).ld, 10);
+}
+
+void native_print_armreg(x64emu_t* emu, uintptr_t reg, uintptr_t n)
+{
+ (void)emu;
+ dynarec_log(LOG_DEBUG, "R%lu=0x%lx (%lu)\n", n, reg, reg);
+}
+
+void native_f2xm1(x64emu_t* emu)
+{
+ ST0.d = exp2(ST0.d) - 1.0;
+}
+void native_fyl2x(x64emu_t* emu)
+{
+ ST(1).d = log2(ST0.d)*ST(1).d;
+}
+void native_ftan(x64emu_t* emu)
+{
+ ST0.d = tan(ST0.d);
+ emu->sw.f.F87_C2 = 0;
+}
+void native_fpatan(x64emu_t* emu)
+{
+ ST1.d = atan2(ST1.d, ST0.d);
+}
+void native_fxtract(x64emu_t* emu)
+{
+ int32_t tmp32s = (ST1.q&0x7ff0000000000000LL)>>52;
+ tmp32s -= 1023;
+ ST1.d /= exp2(tmp32s);
+ ST0.d = tmp32s;
+}
+void native_fprem(x64emu_t* emu)
+{
+ int32_t tmp32s = ST0.d / ST1.d;
+ ST0.d -= ST1.d * tmp32s;
+ emu->sw.f.F87_C2 = 0;
+ emu->sw.f.F87_C1 = (tmp32s&1);
+ emu->sw.f.F87_C3 = ((tmp32s>>1)&1);
+ emu->sw.f.F87_C0 = ((tmp32s>>2)&1);
+}
+void native_fyl2xp1(x64emu_t* emu)
+{
+ ST(1).d = log2(ST0.d + 1.0)*ST(1).d;
+}
+void native_fsincos(x64emu_t* emu)
+{
+ sincos(ST1.d, &ST1.d, &ST0.d);
+ emu->sw.f.F87_C2 = 0;
+}
+void native_frndint(x64emu_t* emu)
+{
+ ST0.d = fpu_round(emu, ST0.d);
+}
+void native_fscale(x64emu_t* emu)
+{
+ if(ST0.d!=0.0)
+ ST0.d *= exp2(trunc(ST1.d));
+}
+void native_fsin(x64emu_t* emu)
+{
+ ST0.d = sin(ST0.d);
+ emu->sw.f.F87_C2 = 0;
+}
+void native_fcos(x64emu_t* emu)
+{
+ ST0.d = cos(ST0.d);
+ emu->sw.f.F87_C2 = 0;
+}
+
+void native_fbld(x64emu_t* emu, uint8_t* ed)
+{
+ fpu_fbld(emu, ed);
+}
+
+void native_fild64(x64emu_t* emu, int64_t* ed)
+{
+ int64_t tmp;
+ memcpy(&tmp, ed, sizeof(tmp));
+ ST0.d = tmp;
+ STll(0).sq = tmp;
+ STll(0).sref = ST0.sq;
+}
+
+void native_fbstp(x64emu_t* emu, uint8_t* ed)
+{
+ fpu_fbst(emu, ed);
+}
+
+void native_fistp64(x64emu_t* emu, int64_t* ed)
+{
+ // used of memcpy to avoid aligments issues
+ if(STll(0).sref==ST(0).sq) {
+ memcpy(ed, &STll(0).sq, sizeof(int64_t));
+ } else {
+ int64_t tmp;
+ if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, (double)(int64_t)0x8000000000000000LL) || !isfinite(ST0.d))
+ tmp = 0x8000000000000000LL;
+ else
+ tmp = fpu_round(emu, ST0.d);
+ memcpy(ed, &tmp, sizeof(tmp));
+ }
+}
+
+void native_fistt64(x64emu_t* emu, int64_t* ed)
+{
+ // used of memcpy to avoid alignments issues
+ int64_t tmp = ST0.d;
+ memcpy(ed, &tmp, sizeof(tmp));
+}
+
+void native_fld(x64emu_t* emu, uint8_t* ed)
+{
+ memcpy(&STld(0).ld, ed, 10);
+ LD2D(&STld(0), &ST(0).d);
+ STld(0).uref = ST0.q;
+}
+
+void native_ud(x64emu_t* emu)
+{
+ if(box64_dynarec_test)
+ emu->test.test = 0;
+ emit_signal(emu, SIGILL, (void*)R_RIP, 0);
+}
+
+void native_priv(x64emu_t* emu)
+{
+ emu->test.test = 0;
+ emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
+}
+
+void native_int(x64emu_t* emu, int num)
+{
+ emu->test.test = 0;
+ emit_interruption(emu, num, (void*)R_RIP);
+}
+
+void native_singlestep(x64emu_t* emu)
+{
+ emit_signal(emu, SIGTRAP, (void*)R_RIP, 1);
+}
+
+void native_fsave(x64emu_t* emu, uint8_t* ed)
+{
+ fpu_savenv(emu, (char*)ed, 0);
+
+ uint8_t* p = ed;
+ p += 28;
+ for (int i=0; i<8; ++i) {
+ LD2D(p, &ST(i).d);
+ p+=10;
+ }
+}
+void native_frstor(x64emu_t* emu, uint8_t* ed)
+{
+ fpu_loadenv(emu, (char*)ed, 0);
+
+ uint8_t* p = ed;
+ p += 28;
+ for (int i=0; i<8; ++i) {
+ D2LD(&ST(i).d, p);
+ p+=10;
+ }
+
+}
+
+void native_fprem1(x64emu_t* emu)
+{
+ // simplified version
+ int32_t tmp32s = round(ST0.d / ST1.d);
+ ST0.d -= ST1.d*tmp32s;
+ emu->sw.f.F87_C2 = 0;
+ emu->sw.f.F87_C1 = (tmp32s&1);
+ emu->sw.f.F87_C3 = ((tmp32s>>1)&1);
+ emu->sw.f.F87_C0 = ((tmp32s>>2)&1);
+}
+
+static uint8_t ff_mult(uint8_t a, uint8_t b)
+{
+ int retval = 0;
+
+ for(int i = 0; i < 8; i++) {
+ if((b & 1) == 1)
+ retval ^= a;
+
+ if((a & 0x80)) {
+ a <<= 1;
+ a ^= 0x1b;
+ } else {
+ a <<= 1;
+ }
+
+ b >>= 1;
+ }
+
+ return retval;
+}
+
+void native_aesimc(x64emu_t* emu, int xmm)
+{
+ sse_regs_t eax1 = emu->xmm[xmm];
+
+ for(int j=0; j<4; ++j) {
+ emu->xmm[xmm].ub[0+j*4] = ff_mult(0x0E, eax1.ub[0+j*4]) ^ ff_mult(0x0B, eax1.ub[1+j*4]) ^ ff_mult(0x0D, eax1.ub[2+j*4]) ^ ff_mult(0x09, eax1.ub[3+j*4]);
+ emu->xmm[xmm].ub[1+j*4] = ff_mult(0x09, eax1.ub[0+j*4]) ^ ff_mult(0x0E, eax1.ub[1+j*4]) ^ ff_mult(0x0B, eax1.ub[2+j*4]) ^ ff_mult(0x0D, eax1.ub[3+j*4]);
+ emu->xmm[xmm].ub[2+j*4] = ff_mult(0x0D, eax1.ub[0+j*4]) ^ ff_mult(0x09, eax1.ub[1+j*4]) ^ ff_mult(0x0E, eax1.ub[2+j*4]) ^ ff_mult(0x0B, eax1.ub[3+j*4]);
+ emu->xmm[xmm].ub[3+j*4] = ff_mult(0x0B, eax1.ub[0+j*4]) ^ ff_mult(0x0D, eax1.ub[1+j*4]) ^ ff_mult(0x09, eax1.ub[2+j*4]) ^ ff_mult(0x0E, eax1.ub[3+j*4]);
+ }
+}
+void native_aesmc(x64emu_t* emu, int xmm)
+{
+ sse_regs_t eax1 = emu->xmm[xmm];
+
+ for(int j=0; j<4; ++j) {
+ emu->xmm[xmm].ub[0+j*4] = ff_mult(0x02, eax1.ub[0+j*4]) ^ ff_mult(0x03, eax1.ub[1+j*4]) ^ eax1.ub[2+j*4] ^ eax1.ub[3+j*4] ;
+ emu->xmm[xmm].ub[1+j*4] = eax1.ub[0+j*4] ^ ff_mult(0x02, eax1.ub[1+j*4]) ^ ff_mult(0x03, eax1.ub[2+j*4]) ^ eax1.ub[3+j*4] ;
+ emu->xmm[xmm].ub[2+j*4] = eax1.ub[0+j*4] ^ eax1.ub[1+j*4] ^ ff_mult(0x02, eax1.ub[2+j*4]) ^ ff_mult(0x03, eax1.ub[3+j*4]);
+ emu->xmm[xmm].ub[3+j*4] = ff_mult(0x03, eax1.ub[0+j*4]) ^ eax1.ub[1+j*4] ^ eax1.ub[2+j*4] ^ ff_mult(0x02, eax1.ub[3+j*4]);
+ }
+}
+void native_aesdlast(x64emu_t* emu, int xmm)
+{
+ // A0 B1 C2 D3 E4 F5 G6 H7 I8 J9 Ka Lb Mc Nd Oe Pf
+ // A N K H E B O L I F C P M J G D
+ const uint8_t invshiftrows[] = {0,13,10, 7, 4, 1,14,11, 8, 5, 2,15,12, 9, 6, 3};
+ const uint8_t invsubbytes[256] = {
+ 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
+ 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
+ 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
+ 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
+ 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
+ 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
+ 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
+ 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
+ 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
+ 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
+ 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
+ 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
+ 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
+ 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
+ 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
+ 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d,
+ };
+
+ sse_regs_t eax1;
+ for(int i=0; i<16; ++i)
+ eax1.ub[i] = emu->xmm[xmm].ub[invshiftrows[i]];
+ //STATE ← InvSubBytes( STATE );
+ for(int i=0; i<16; ++i)
+ emu->xmm[xmm].ub[i] = invsubbytes[eax1.ub[i]];
+
+}
+static const uint8_t shiftrows[] = {0, 5,10,15, 4, 9,14, 3, 8,13, 2, 7,12, 1, 6,11};
+static const uint8_t subbytes[256] = {
+ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
+ 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
+ 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
+ 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
+ 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
+ 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
+ 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
+ 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
+ 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
+ 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
+ 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
+ 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
+ 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
+ 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
+ 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
+ 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16,
+};
+void native_aeselast(x64emu_t* emu, int xmm)
+{
+ // A0 B1 C2 D3 E4 F5 G6 H7 I8 J9 Ka Lb Mc Nd Oe Pf
+ // A F K P E J O D I N C H M B G L
+ sse_regs_t eax1;
+ for(int i=0; i<16; ++i)
+ eax1.ub[i] = emu->xmm[xmm].ub[shiftrows[i]];
+ //STATE ← SubBytes( STATE );
+ for(int i=0; i<16; ++i)
+ emu->xmm[xmm].ub[i] = subbytes[eax1.ub[i]];
+}
+void native_aesd(x64emu_t* emu, int xmm)
+{
+ native_aesdlast(emu, xmm);
+ native_aesimc(emu, xmm);
+}
+void native_aese(x64emu_t* emu, int xmm)
+{
+ native_aeselast(emu, xmm);
+ native_aesmc(emu, xmm);
+}
+void native_aeskeygenassist(x64emu_t* emu, int gx, int ex, void* p, uint32_t u8)
+{
+ sse_regs_t *EX = p?((sse_regs_t*)p):&emu->xmm[ex];
+ sse_regs_t *GX = &emu->xmm[gx];
+ for (int i = 4; i < 8; ++i)
+ GX->ub[i] = subbytes[EX->ub[i]];
+ for (int i = 12; i < 16; ++i)
+ GX->ub[i] = subbytes[EX->ub[i]];
+ GX->ud[0] = GX->ud[1];
+ uint8_t tmp8u = GX->ub[4];
+ GX->ud[1] = GX->ud[1] >> 8;
+ GX->ub[7] = tmp8u;
+ GX->ud[1] ^= u8;
+ GX->ud[2] = GX->ud[3];
+ tmp8u = GX->ub[12];
+ GX->ud[3] = GX->ud[3] >> 8;
+ GX->ub[15] = tmp8u;
+ GX->ud[3] ^= u8;
+}
+
+void native_pclmul(x64emu_t* emu, int gx, int ex, void* p, uint32_t u8)
+{
+ sse_regs_t *EX = p?((sse_regs_t*)p):&emu->xmm[ex];
+ sse_regs_t *GX = &emu->xmm[gx];
+ int g = (u8&1)?1:0;
+ int e = (u8&0b10000)?1:0;
+ __int128 result = 0;
+ __int128 op2 = EX->q[e];
+ for (int i=0; i<64; ++i)
+ if(GX->q[g]&(1LL<<i))
+ result ^= (op2<<i);
+
+ GX->q[0] = result&0xffffffffffffffffLL;
+ GX->q[1] = (result>>64)&0xffffffffffffffffLL;
+}
+
+void native_clflush(x64emu_t* emu, void* p)
+{
+ cleanDBFromAddressRange((uintptr_t)p, 8, 0);
+}
+
+static int flagsCacheNeedsTransform(dynarec_native_t* dyn, int ninst) {
+ int jmp = dyn->insts[ninst].x64.jmp_insts;
+ if(jmp<0)
+ return 0;
+ if(dyn->insts[ninst].f_exit.dfnone) // flags are fully known, nothing we can do more
+ return 0;
+/* if((dyn->f.pending!=SF_SET)
+ && (dyn->f.pending!=SF_SET_PENDING)) {
+ if(dyn->f.pending!=SF_PENDING) {*/
+ switch (dyn->insts[jmp].f_entry.pending) {
+ case SF_UNKNOWN: return 0;
+ case SF_SET:
+ if(dyn->insts[ninst].f_exit.pending!=SF_SET && dyn->insts[ninst].f_exit.pending!=SF_SET_PENDING)
+ return 1;
+ else
+ return 0;
+ case SF_SET_PENDING:
+ if(dyn->insts[ninst].f_exit.pending!=SF_SET
+ && dyn->insts[ninst].f_exit.pending!=SF_SET_PENDING
+ && dyn->insts[ninst].f_exit.pending!=SF_PENDING)
+ return 1;
+ else
+ return 0;
+ case SF_PENDING:
+ if(dyn->insts[ninst].f_exit.pending!=SF_SET
+ && dyn->insts[ninst].f_exit.pending!=SF_SET_PENDING
+ && dyn->insts[ninst].f_exit.pending!=SF_PENDING)
+ return 1;
+ else
+ return (dyn->insts[jmp].f_entry.dfnone == dyn->insts[ninst].f_exit.dfnone)?0:1;
+ }
+ if(dyn->insts[jmp].f_entry.dfnone && !dyn->insts[ninst].f_exit.dfnone)
+ return 1;
+ return 0;
+}
+
+int CacheNeedsTransform(dynarec_native_t* dyn, int ninst) {
+ int ret = 0;
+ if (flagsCacheNeedsTransform(dyn, ninst)) ret|=1;
+ OTHER_CACHE()
+ return ret;
+}
+
+int isPred(dynarec_native_t* dyn, int ninst, int pred) {
+ for(int i=0; i<dyn->insts[ninst].pred_sz; ++i)
+ if(dyn->insts[ninst].pred[i]==pred)
+ return pred;
+ return -1;
+}
+int getNominalPred(dynarec_native_t* dyn, int ninst) {
+ if((ninst<=0) || !dyn->insts[ninst].pred_sz)
+ return -1;
+ if(isPred(dyn, ninst, ninst-1)!=-1)
+ return ninst-1;
+ return dyn->insts[ninst].pred[0];
+}
+
+#define F8 *(uint8_t*)(addr++)
+// Do the GETED, but don't emit anything...
+uintptr_t fakeed(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nextop)
+{
+ (void)dyn; (void)addr; (void)ninst;
+
+ if((nextop&0xC0)==0xC0)
+ return addr;
+ if(!(nextop&0xC0)) {
+ if((nextop&7)==4) {
+ uint8_t sib = F8;
+ if((sib&0x7)==5) {
+ addr+=4;
+ }
+ } else if((nextop&7)==5) {
+ addr+=4;
+ }
+ } else {
+ if((nextop&7)==4) {
+ ++addr;
+ }
+ if(nextop&0x80) {
+ addr+=4;
+ } else {
+ ++addr;
+ }
+ }
+ return addr;
+}
+#undef F8
+
+int isNativeCall(dynarec_native_t* dyn, uintptr_t addr, uintptr_t* calladdress, int* retn)
+{
+ (void)dyn;
+
+#define PK(a) *(uint8_t*)(addr+a)
+#define PK32(a) *(int32_t*)(addr+a)
+
+ if(!addr || !getProtection(addr))
+ return 0;
+ if(PK(0)==0xff && PK(1)==0x25) { // "absolute" jump, maybe the GOT (well, RIP relative in fact)
+ uintptr_t a1 = addr + 6 + (PK32(2)); // need to add a check to see if the address is from the GOT !
+ addr = (uintptr_t)getAlternate(*(void**)a1);
+ }
+ if(!addr || !getProtection(addr))
+ return 0;
+ onebridge_t *b = (onebridge_t*)(addr);
+ if(b->CC==0xCC && b->S=='S' && b->C=='C' && b->w!=(wrapper_t)0 && b->f!=(uintptr_t)PltResolver) {
+ // found !
+ if(retn) *retn = (b->C3==0xC2)?b->N:0;
+ if(calladdress) *calladdress = addr+1;
+ return 1;
+ }
+ return 0;
+#undef PK32
+#undef PK
+}
diff --git a/src/dynarec/dynarec_native_functions.h b/src/dynarec/dynarec_native_functions.h
new file mode 100644
index 0000000..ed6d0f7
--- /dev/null
+++ b/src/dynarec/dynarec_native_functions.h
@@ -0,0 +1,66 @@
+#ifndef __DYNAREC_NATIVE_FUNCTIONS_H__
+#define __DYNAREC_NATIVE_FUNCTIONS_H__
+
+#include <stdint.h>
+
+#include "dynarec_arch.h"
+
+typedef struct x64emu_s x64emu_t;
+
+void native_fstp(x64emu_t* emu, void* p);
+
+void native_print_armreg(x64emu_t* emu, uintptr_t reg, uintptr_t n);
+
+void native_f2xm1(x64emu_t* emu);
+void native_fyl2x(x64emu_t* emu);
+void native_ftan(x64emu_t* emu);
+void native_fpatan(x64emu_t* emu);
+void native_fxtract(x64emu_t* emu);
+void native_fprem(x64emu_t* emu);
+void native_fyl2xp1(x64emu_t* emu);
+void native_fsincos(x64emu_t* emu);
+void native_frndint(x64emu_t* emu);
+void native_fscale(x64emu_t* emu);
+void native_fsin(x64emu_t* emu);
+void native_fcos(x64emu_t* emu);
+void native_fbld(x64emu_t* emu, uint8_t* ed);
+void native_fild64(x64emu_t* emu, int64_t* ed);
+void native_fbstp(x64emu_t* emu, uint8_t* ed);
+void native_fistp64(x64emu_t* emu, int64_t* ed);
+void native_fistt64(x64emu_t* emu, int64_t* ed);
+void native_fld(x64emu_t* emu, uint8_t* ed);
+void native_fsave(x64emu_t* emu, uint8_t* ed);
+void native_frstor(x64emu_t* emu, uint8_t* ed);
+void native_fprem1(x64emu_t* emu);
+
+void native_aesd(x64emu_t* emu, int xmm);
+void native_aese(x64emu_t* emu, int xmm);
+void native_aesdlast(x64emu_t* emu, int xmm);
+void native_aeselast(x64emu_t* emu, int xmm);
+void native_aesimc(x64emu_t* emu, int xmm);
+void native_aeskeygenassist(x64emu_t* emu, int gx, int ex, void* p, uint32_t u8);
+void native_pclmul(x64emu_t* emu, int gx, int ex, void* p, uint32_t u8);
+
+void native_clflush(x64emu_t* emu, void* p);
+
+void native_ud(x64emu_t* emu);
+void native_priv(x64emu_t* emu);
+void native_singlestep(x64emu_t* emu);
+void native_int(x64emu_t* emu, int num);
+
+// Caches transformation (for loops) // Specific, need to be written par backend
+int CacheNeedsTransform(dynarec_native_t* dyn, int i1);
+
+// predecessor access
+int isPred(dynarec_native_t* dyn, int ninst, int pred);
+int getNominalPred(dynarec_native_t* dyn, int ninst);
+
+// Do the GETED, but don't emit anything...
+uintptr_t fakeed(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nextop);
+
+// Is what pointed at addr a native call? And if yes, to what function?
+int isNativeCall(dynarec_native_t* dyn, uintptr_t addr, uintptr_t* calladdress, int* retn);
+
+ADDITIONNAL_DEFINITION()
+
+#endif //__DYNAREC_NATIVE_FUNCTIONS_H__
diff --git a/src/dynarec/dynarec_native_pass.c b/src/dynarec/dynarec_native_pass.c
index ca8da16..f5ee250 100755..100644
--- a/src/dynarec/dynarec_native_pass.c
+++ b/src/dynarec/dynarec_native_pass.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <pthread.h>
#include <errno.h>
#include <string.h>
@@ -27,7 +26,7 @@
#error No STEP defined
#endif
-uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
+uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits)
{
int ok = 1;
int ninst = 0;
@@ -45,9 +44,10 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
dyn->forward_size = 0;
dyn->forward_ninst = 0;
fpu_reset(dyn);
+ ARCH_INIT();
int reset_n = -1;
- dyn->last_ip = (dyn->insts && dyn->insts[0].pred_sz)?0:ip; // RIP is always set at start of block unless there is a predecessor!
- int stopblock = 2+(FindElfAddress(my_context, addr)?0:1); // if block is in elf_memory, it can be extended with bligblocks==2, else it needs 3
+ dyn->last_ip = (alternate || (dyn->insts && dyn->insts[0].pred_sz))?0:ip; // RIP is always set at start of block unless there is a predecessor!
+ int stopblock = 2+(FindElfAddress(my_context, addr)?0:1); // if block is in elf_memory, it can be extended with box64_dynarec_bigblock==2, else it needs 3
// ok, go now
INIT;
while(ok) {
@@ -60,44 +60,7 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
dyn->f.pending = 0;
fpu_reset(dyn);
} else {
- MESSAGE(LOG_DEBUG, "Reset Caches with %d\n",reset_n);
- #if STEP > 1
- // for STEP 2 & 3, just need to refrest with current, and undo the changes (push & swap)
- dyn->n = dyn->insts[ninst].n;
- neoncacheUnwind(&dyn->n);
- #ifdef HAVE_TRACE
- if(box64_dynarec_dump)
- if(memcmp(&dyn->n, &dyn->insts[reset_n].n, sizeof(neon_cache_t))) {
- MESSAGE(LOG_DEBUG, "Warning, difference in neoncache: reset=");
- for(int i=0; i<24; ++i)
- if(dyn->insts[reset_n].n.neoncache[i].v)
- MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->insts[reset_n].n.neoncache[i].t, dyn->insts[reset_n].n.neoncache[i].n));
- if(dyn->insts[reset_n].n.combined1 || dyn->insts[reset_n].n.combined2)
- MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[reset_n].n.swapped?"SWP":"CMB", dyn->insts[reset_n].n.combined1, dyn->insts[reset_n].n.combined2);
- if(dyn->insts[reset_n].n.stack_push || dyn->insts[reset_n].n.stack_pop)
- MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->insts[reset_n].n.stack_push, -dyn->insts[reset_n].n.stack_pop);
- MESSAGE(LOG_DEBUG, " ==> ");
- for(int i=0; i<24; ++i)
- if(dyn->insts[ninst].n.neoncache[i].v)
- MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->insts[ninst].n.neoncache[i].t, dyn->insts[ninst].n.neoncache[i].n));
- if(dyn->insts[ninst].n.combined1 || dyn->insts[ninst].n.combined2)
- MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[ninst].n.swapped?"SWP":"CMB", dyn->insts[ninst].n.combined1, dyn->insts[ninst].n.combined2);
- if(dyn->insts[ninst].n.stack_push || dyn->insts[ninst].n.stack_pop)
- MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->insts[ninst].n.stack_push, -dyn->insts[ninst].n.stack_pop);
- MESSAGE(LOG_DEBUG, " -> ");
- for(int i=0; i<24; ++i)
- if(dyn->n.neoncache[i].v)
- MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->n.neoncache[i].t, dyn->n.neoncache[i].n));
- if(dyn->n.combined1 || dyn->n.combined2)
- MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->n.swapped?"SWP":"CMB", dyn->n.combined1, dyn->n.combined2);
- if(dyn->n.stack_push || dyn->n.stack_pop)
- MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->n.stack_push, -dyn->n.stack_pop);
- MESSAGE(LOG_DEBUG, "\n");
- }
- #endif //HAVE_TRACE
- #else
- dyn->n = dyn->insts[reset_n].n;
- #endif
+ fpu_reset_cache(dyn, ninst, reset_n);
dyn->f = dyn->insts[reset_n].f_exit;
if(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT) {
MESSAGE(LOG_DEBUG, "Apply Barrier Float\n");
@@ -110,36 +73,33 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
}
}
reset_n = -1;
- } else if(ninst && (dyn->insts[ninst].pred_sz!=1 || dyn->insts[ninst].pred[0]!=ninst-1))
- dyn->last_ip = 0; // reset IP if some jump are comming here
- // propagate ST stack state, especial stack pop that are defered
- if(dyn->n.stack_pop) {
- for(int j=0; j<24; ++j)
- if((dyn->n.neoncache[j].t == NEON_CACHE_ST_D || dyn->n.neoncache[j].t == NEON_CACHE_ST_F)) {
- if(dyn->n.neoncache[j].n<dyn->n.stack_pop)
- dyn->n.neoncache[j].v = 0;
- else
- dyn->n.neoncache[j].n-=dyn->n.stack_pop;
- }
- dyn->n.stack_pop = 0;
- }
- dyn->n.stack = dyn->n.stack_next;
- dyn->n.news = 0;
- dyn->n.stack_push = 0;
- dyn->n.swapped = 0;
+ } else if(ninst && (dyn->insts[ninst].pred_sz>1 || (dyn->insts[ninst].pred_sz==1 && dyn->insts[ninst].pred[0]!=ninst-1)))
+ dyn->last_ip = 0; // reset IP if some jump are coming here
+ fpu_propagate_stack(dyn, ninst);
NEW_INST;
+ if(!ninst) {
+ GOTEST(x1, x2);
+ }
if(dyn->insts[ninst].pred_sz>1) {SMSTART();}
fpu_reset_scratch(dyn);
if((dyn->insts[ninst].x64.need_before&~X_PEND) && !dyn->insts[ninst].pred_sz) {
READFLAGS(dyn->insts[ninst].x64.need_before&~X_PEND);
}
+ if(box64_dynarec_test) {
+ MESSAGE(LOG_DUMP, "TEST INIT ----\n");
+ fpu_reflectcache(dyn, ninst, x1, x2, x3);
+ GO_TRACE(x64test_init, 1);
+ fpu_unreflectcache(dyn, ninst, x1, x2, x3);
+ MESSAGE(LOG_DUMP, "----------\n");
+ }
#ifdef HAVE_TRACE
- if(my_context->dec && box64_dynarec_trace) {
+ else if(my_context->dec && box64_dynarec_trace) {
if((trace_end == 0)
|| ((ip >= trace_start) && (ip < trace_end))) {
MESSAGE(LOG_DUMP, "TRACE ----\n");
fpu_reflectcache(dyn, ninst, x1, x2, x3);
- GO_TRACE();
+ GO_TRACE(PrintTrace, 1);
+ fpu_unreflectcache(dyn, ninst, x1, x2, x3);
MESSAGE(LOG_DUMP, "----------\n");
}
}
@@ -157,11 +117,13 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
pk = PK(0);
}
rex.rex = 0;
- while(pk>=0x40 && pk<=0x4f) {
- rex.rex = pk;
- ++addr;
- pk = PK(0);
- }
+ rex.is32bits = is32bits;
+ if(!rex.is32bits)
+ while(pk>=0x40 && pk<=0x4f) {
+ rex.rex = pk;
+ ++addr;
+ pk = PK(0);
+ }
addr = dynarec64_00(dyn, addr, ip, ninst, rex, rep, &ok, &need_epilog);
@@ -189,12 +151,22 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
ok = 1;
// we use the 1st predecessor here
int ii = ninst+1;
- while(ii<dyn->size && !dyn->insts[ii].pred_sz)
- ++ii;
+ if(ii<dyn->size && !dyn->insts[ii].pred_sz) {
+ while(ii<dyn->size && (!dyn->insts[ii].pred_sz || (dyn->insts[ii].pred_sz==1 && dyn->insts[ii].pred[0]==ii-1))) {
+ // may need to skip opcodes to advance
+ ++ninst;
+ NEW_INST;
+ MESSAGE(LOG_DEBUG, "Skipping unused opcode\n");
+ INST_NAME("Skipped opcode");
+ INST_EPILOG;
+ addr += dyn->insts[ii].x64.size;
+ ++ii;
+ }
+ }
if((dyn->insts[ii].x64.barrier&BARRIER_FULL)==BARRIER_FULL)
reset_n = -2; // hack to say Barrier!
else {
- reset_n = getNominalPred(dyn, ii); // may get -1 if no predecessor are availble
+ reset_n = getNominalPred(dyn, ii); // may get -1 if no predecessor are available
if(reset_n==-1) {
reset_n = -2;
MESSAGE(LOG_DEBUG, "Warning, Reset Caches mark not found\n");
@@ -211,7 +183,7 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
dyn->forward_size = 0;
dyn->forward_ninst = 0;
ok = 1; // in case it was 0
- } else if ((dyn->forward_to < addr) || !ok) {
+ } else if ((dyn->forward_to < addr) || ok<=0) {
// something when wrong! rollback
if(box64_dynarec_dump) dynarec_log(LOG_NONE, "Could not forward extend block for %d bytes %p -> %p\n", dyn->forward_to-dyn->forward, (void*)dyn->forward, (void*)dyn->forward_to);
ok = 0;
@@ -241,16 +213,47 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
}
if(box64_dynarec_dump) dynarec_log(LOG_NONE, "Extend block %p, %p -> %p (ninst=%d, jump from %d)\n", dyn, (void*)addr, (void*)next, ninst, reset_n);
} else if(next && (next-addr)<box64_dynarec_forward && (getProtection(next)&PROT_READ)/*box64_dynarec_bigblock>=stopblock*/) {
- dyn->forward = addr;
- dyn->forward_to = next;
- dyn->forward_size = dyn->size;
- dyn->forward_ninst = ninst;
- reset_n = -2;
- ok = 1;
+ if(!((box64_dynarec_bigblock<stopblock) && !isJumpTableDefault64((void*)next))) {
+ if(dyn->forward) {
+ if(next<dyn->forward_to)
+ dyn->forward_to = next;
+ reset_n = -2;
+ ok = 1;
+ } else {
+ dyn->forward = addr;
+ dyn->forward_to = next;
+ dyn->forward_size = dyn->size;
+ dyn->forward_ninst = ninst;
+ reset_n = -2;
+ ok = 1;
+ }
+ }
}
}
#endif
- if(ok<0) {ok = 0; need_epilog=1;}
+ if(ok<0) {
+ ok = 0; need_epilog=1;
+ #if STEP == 0
+ if(ninst) {
+ --ninst;
+ if(!dyn->insts[ninst].x64.barrier) {
+ BARRIER(BARRIER_FLOAT);
+ }
+ dyn->insts[ninst].x64.need_after |= X_PEND;
+ ++ninst;
+ }
+ if(dyn->forward) {
+ // stopping too soon
+ dyn->size = dyn->forward_size;
+ ninst = dyn->forward_ninst+1;
+ addr = dyn->forward;
+ dyn->forward = 0;
+ dyn->forward_to = 0;
+ dyn->forward_size = 0;
+ dyn->forward_ninst = 0;
+ }
+ #endif
+ }
++ninst;
#if STEP == 0
if(ok && (((box64_dynarec_bigblock<stopblock) && !isJumpTableDefault64((void*)addr))
@@ -259,6 +262,18 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
if(ok && (ninst==dyn->size))
#endif
{
+ #if STEP == 0
+ if(dyn->forward) {
+ // stopping too soon
+ dyn->size = dyn->forward_size;
+ ninst = dyn->forward_ninst+1;
+ addr = dyn->forward;
+ dyn->forward = 0;
+ dyn->forward_to = 0;
+ dyn->forward_size = 0;
+ dyn->forward_ninst = 0;
+ }
+ #endif
int j32;
MAYUSE(j32);
MESSAGE(LOG_DEBUG, "Stopping block %p (%d / %d)\n",(void*)init_addr, ninst, dyn->size);
@@ -272,14 +287,16 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr)
dyn->insts[ninst].x64.need_after |= X_PEND;
#endif
++ninst;
+ NOTEST(x3);
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
jump_to_next(dyn, addr, 0, ninst);
ok=0; need_epilog=0;
}
}
if(need_epilog) {
+ NOTEST(x3);
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
- jump_to_epilog(dyn, ip, 0, ninst); // no linker here, it's an unknow instruction
+ jump_to_epilog(dyn, ip, 0, ninst); // no linker here, it's an unknown instruction
}
FINI;
MESSAGE(LOG_DUMP, "---- END OF BLOCK ---- (%d)\n", dyn->size);
diff --git a/src/dynarec/dynarec_next.h b/src/dynarec/dynarec_next.h
index 19d426b..dc37aad 100644
--- a/src/dynarec/dynarec_next.h
+++ b/src/dynarec/dynarec_next.h
@@ -4,17 +4,24 @@
#ifdef ARM64
void arm64_next(void) EXPORTDYN;
void arm64_prolog(x64emu_t* emu, void* addr) EXPORTDYN;
-void arm64_epilog() EXPORTDYN;
+void arm64_epilog(void) EXPORTDYN;
#define native_next arm64_next
#define native_prolog arm64_prolog
#define native_epilog arm64_epilog
#elif defined(LA464)
void la464_next(void) EXPORTDYN;
void la464_prolog(x64emu_t* emu, void* addr) EXPORTDYN;
-void la464_epilog() EXPORTDYN;
+void la464_epilog(void) EXPORTDYN;
#define native_next la464_next
#define native_prolog la464_prolog
#define native_epilog la464_epilog
+#elif defined(RV64)
+void rv64_next(void) EXPORTDYN;
+void rv64_prolog(x64emu_t* emu, void* addr) EXPORTDYN;
+void rv64_epilog(void) EXPORTDYN;
+#define native_next rv64_next
+#define native_prolog rv64_prolog
+#define native_epilog rv64_epilog
#else
#error Unsupported architecture
#endif
diff --git a/src/dynarec/dynarec_private.h b/src/dynarec/dynarec_private.h
index 0ab21df..0ab21df 100755..100644
--- a/src/dynarec/dynarec_private.h
+++ b/src/dynarec/dynarec_private.h
diff --git a/src/dynarec/native_lock.h b/src/dynarec/native_lock.h
index 32cf56f..dd2f3b6 100755..100644
--- a/src/dynarec/native_lock.h
+++ b/src/dynarec/native_lock.h
@@ -14,8 +14,10 @@
#define native_lock_write_dd(A, B) arm64_lock_write_dd(A, B)
#define native_lock_read_dq(A, B, C) arm64_lock_read_dq(A, B, C)
#define native_lock_write_dq(A, B, C) arm64_lock_write_dq(A, B, C)
-#define native_lock_xchg(A, B) arm64_lock_xchg(A, B)
+#define native_lock_xchg_dd(A, B) arm64_lock_xchg_dd(A, B)
#define native_lock_xchg_d(A, B) arm64_lock_xchg_d(A, B)
+#define native_lock_xchg_h(A, B) arm64_lock_xchg_h(A, B)
+#define native_lock_xchg_b(A, B) arm64_lock_xchg_b(A, B)
#define native_lock_storeifref(A, B, C) arm64_lock_storeifref(A, B, C)
#define native_lock_storeifref_d(A, B, C) arm64_lock_storeifref_d(A, B, C)
#define native_lock_storeifref2_d(A, B, C) arm64_lock_storeifref2_d(A, B, C)
@@ -27,6 +29,46 @@
#define native_lock_decifnot0(A) arm64_lock_decifnot0(A)
#define native_lock_store(A, B) arm64_lock_store(A, B)
+#elif defined(RV64)
+#include "rv64/rv64_lock.h"
+
+#define USE_CAS
+// RV64 is quite strict (or at least strongly recommand) on what you can do between an LD.A and an SD.A
+// That basicaly forbid to call a function, so there cannot be READ / WRITE separated
+// And so need to use a Compare and Swap mecanism instead
+
+// no byte or 2-bytes atomic access on RISC-V
+#define native_lock_xchg_dd(A, B) rv64_lock_xchg_dd(A, B)
+#define native_lock_xchg_d(A, B) rv64_lock_xchg_d(A, B)
+#define native_lock_storeifref(A, B, C) rv64_lock_storeifref(A, B, C)
+#define native_lock_storeifref_d(A, B, C) rv64_lock_storeifref_d(A, B, C)
+#define native_lock_storeifref2_d(A, B, C) rv64_lock_storeifref2_d(A, B, C)
+#define native_lock_storeifnull(A, B) rv64_lock_storeifnull(A, B)
+#define native_lock_storeifnull_d(A, B) rv64_lock_storeifnull_d(A, B)
+#define native_lock_decifnot0b(A) rv64_lock_decifnot0b(A)
+#define native_lock_storeb(A, B) rv64_lock_storeb(A, B)
+#define native_lock_incif0(A) rv64_lock_incif0(A)
+#define native_lock_decifnot0(A) rv64_lock_decifnot0(A)
+#define native_lock_store(A, B) rv64_lock_store(A, B)
+#define native_lock_cas_d(A, B, C) rv64_lock_cas_d(A, B, C)
+#define native_lock_cas_dd(A, B, C) rv64_lock_cas_dd(A, B, C)
+
+#define native_lock_xchg_b(A, B) rv64_lock_xchg_b(A, B)
+#define native_lock_cas_b(A, B, C) rv64_lock_cas_b(A, B, C)
+#define native_lock_cas_h(A, B, C) rv64_lock_cas_h(A, B, C)
+
+#define native_lock_read_b(A) tmpcas=*(uint8_t*)(A)
+#define native_lock_write_b(A, B) rv64_lock_cas_b(A, tmpcas, B)
+#define native_lock_read_h(A) tmpcas=*(uint16_t*)(A)
+#define native_lock_write_h(A, B) rv64_lock_cas_h(A, tmpcas, B)
+#define native_lock_read_d(A) tmpcas=*(uint32_t*)(A)
+#define native_lock_write_d(A, B) rv64_lock_cas_d(A, tmpcas, B)
+#define native_lock_read_dd(A) tmpcas=*(uint64_t*)(A)
+#define native_lock_write_dd(A, B) rv64_lock_cas_dd(A, tmpcas, B)
+// there is no atomic move on 16bytes, so faking it
+#define native_lock_read_dq(A, B, C) *A=tmpcas=((uint64_t*)(C))[0]; *B=((uint64_t*)(C))[1];
+#define native_lock_write_dq(A, B, C) rv64_lock_cas_dq(C, A, tmpcas, B);
+
#else
#error Unsupported architecture
#endif
diff --git a/src/dynarec/rv64/dynarec_rv64_00.c b/src/dynarec/rv64/dynarec_rv64_00.c
new file mode 100644
index 0000000..5f529fb
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_00.c
@@ -0,0 +1,41 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+#include <signal.h>
+#include <assert.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "bridge.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+#include "custommem.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+uintptr_t dynarec64_00(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ uint8_t opcode;
+
+ opcode = PK(0);
+ switch(opcode) {
+ case 0x00 ... 0x3f: addr = dynarec64_00_0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); break;
+ case 0x40 ... 0x7f: addr = dynarec64_00_1(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); break;
+ case 0x80 ... 0xbf: addr = dynarec64_00_2(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); break;
+ case 0xc0 ... 0xff: addr = dynarec64_00_3(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); break;
+ }
+
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_00_0.c b/src/dynarec/rv64/dynarec_rv64_00_0.c
new file mode 100644
index 0000000..4971849
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_00_0.c
@@ -0,0 +1,497 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+#include <signal.h>
+#include <assert.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "bridge.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+#include "custommem.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ uint8_t nextop, opcode;
+ uint8_t gd, ed;
+ int8_t i8;
+ int32_t i32, tmp;
+ int64_t i64, j64;
+ uint8_t u8;
+ uint8_t gb1, gb2, eb1, eb2;
+ uint32_t u32;
+ uint64_t u64;
+ uint8_t wback, wb1, wb2, wb;
+ int64_t fixedaddress;
+ int lock;
+ int cacheupd = 0;
+
+ opcode = F8;
+ MAYUSE(eb1);
+ MAYUSE(eb2);
+ MAYUSE(j64);
+ MAYUSE(wb);
+ MAYUSE(lock);
+ MAYUSE(cacheupd);
+
+ switch(opcode) {
+ case 0x00:
+ INST_NAME("ADD Eb, Gb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_add8(dyn, ninst, x1, x2, x4, x5);
+ EBBACK(x5, 0);
+ break;
+ case 0x01:
+ INST_NAME("ADD Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_add32(dyn, ninst, rex, ed, gd, x3, x4, x5);
+ WBACK;
+ break;
+ case 0x02:
+ INST_NAME("ADD Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_add8(dyn, ninst, x2, x1, x4, x5);
+ GBBACK(x5);
+ break;
+ case 0x03:
+ INST_NAME("ADD Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_add32(dyn, ninst, rex, gd, ed, x3, x4, x5);
+ break;
+ case 0x04:
+ INST_NAME("ADD AL, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ u8 = F8;
+ ANDI(x1, xRAX, 0xff);
+ emit_add8c(dyn, ninst, x1, u8, x3, x4, x5);
+ ANDI(xRAX, xRAX, ~0xff);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x05:
+ INST_NAME("ADD EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ emit_add32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5, x6);
+ break;
+ case 0x08:
+ INST_NAME("OR Eb, Gb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_or8(dyn, ninst, x1, x2, x4, x5);
+ EBBACK(x5, 0);
+ break;
+ case 0x09:
+ INST_NAME("OR Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_or32(dyn, ninst, rex, ed, gd, x3, x4);
+ WBACK;
+ break;
+
+ case 0x0A:
+ INST_NAME("OR Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_or8(dyn, ninst, x2, x1, x4, x5);
+ GBBACK(x5);
+ break;
+ case 0x0B:
+ INST_NAME("OR Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_or32(dyn, ninst, rex, gd, ed, x3, x4);
+ break;
+ case 0x0C:
+ INST_NAME("OR AL, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ u8 = F8;
+ ANDI(x1, xRAX, 0xff);
+ emit_or8c(dyn, ninst, x1, u8, x3, x4, x5);
+ ANDI(xRAX, xRAX, ~0xff);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x0D:
+ INST_NAME("OR EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ emit_or32c(dyn, ninst, rex, xRAX, i64, x3, x4);
+ break;
+
+ case 0x0F:
+ switch(rep) {
+ case 0:
+ addr = dynarec64_0F(dyn, addr, ip, ninst, rex, ok, need_epilog);
+ break;
+ case 1:
+ addr = dynarec64_F20F(dyn, addr, ip, ninst, rex, ok, need_epilog);
+ break;
+ case 2:
+ addr = dynarec64_F30F(dyn, addr, ip, ninst, rex, ok, need_epilog);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0x10:
+ INST_NAME("ADC Eb, Gb");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_adc8(dyn, ninst, x1, x2, x4, x5, x3);
+ EBBACK(x5, 0);
+ break;
+ case 0x11:
+ INST_NAME("ADC Ed, Gd");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_adc32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6);
+ WBACK;
+ break;
+ case 0x12:
+ INST_NAME("ADC Gb, Eb");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x2, 0);
+ GETGB(x1);
+ emit_adc8(dyn, ninst, x1, x2, x4, x3, x5);
+ GBBACK(x5);
+ break;
+ case 0x13:
+ INST_NAME("ADC Gd, Ed");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_adc32(dyn, ninst, rex, gd, ed, x3, x4, x5, x6);
+ break;
+ case 0x14:
+ INST_NAME("ADC AL, Ib");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ u8 = F8;
+ ANDI(x1, xRAX, 0xff);
+ emit_adc8c(dyn, ninst, x1, u8, x3, x4, x5, x6);
+ ANDI(xRAX, xRAX, -256);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x15:
+ INST_NAME("ADC EAX, Id");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ MOV64xw(x1, i64);
+ emit_adc32(dyn, ninst, rex, xRAX, x1, x3, x4, x5, x6);
+ break;
+ case 0x18:
+ INST_NAME("SBB Eb, Gb");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_sbb8(dyn, ninst, x1, x2, x4, x5, x6);
+ EBBACK(x5, 0);
+ break;
+ case 0x19:
+ INST_NAME("SBB Ed, Gd");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_sbb32(dyn, ninst, rex, ed, gd, x3, x4, x5);
+ WBACK;
+ break;
+ case 0x1A:
+ INST_NAME("SBB Gb, Eb");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x2, 0);
+ GETGB(x1);
+ emit_sbb8(dyn, ninst, x1, x2, x3, x4, x5);
+ GBBACK(x5);
+ break;
+ case 0x1B:
+ INST_NAME("SBB Gd, Ed");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_sbb32(dyn, ninst, rex, gd, ed, x3, x4, x5);
+ break;
+ case 0x1C:
+ INST_NAME("SBB AL, Ib");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ u8 = F8;
+ ANDI(x1, xRAX, 0xff);
+ emit_sbb8c(dyn, ninst, x1, u8, x3, x4, x5, x6);
+ ANDI(xRAX, xRAX, ~0xff);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x1D:
+ INST_NAME("SBB EAX, Id");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ MOV64xw(x2, i64);
+ emit_sbb32(dyn, ninst, rex, xRAX, x2, x3, x4, x5);
+ break;
+
+ case 0x20:
+ INST_NAME("AND Eb, Gb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_and8(dyn, ninst, x1, x2, x4, x5);
+ EBBACK(x4, 0);
+ break;
+ case 0x21:
+ INST_NAME("AND Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_and32(dyn, ninst, rex, ed, gd, x3, x4);
+ WBACK;
+ break;
+ case 0x22:
+ INST_NAME("AND Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_and8(dyn, ninst, x2, x1, x4, x5);
+ GBBACK(x5);
+ break;
+ case 0x23:
+ INST_NAME("AND Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_and32(dyn, ninst, rex, gd, ed, x3, x4);
+ break;
+ case 0x24:
+ INST_NAME("AND AL, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ u8 = F8;
+ ANDI(x1, xRAX, 0xff);
+ emit_and8c(dyn, ninst, x1, u8, x3, x4);
+ ANDI(xRAX, xRAX, ~0xff);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x25:
+ INST_NAME("AND EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ emit_and32c(dyn, ninst, rex, xRAX, i64, x3, x4);
+ break;
+ case 0x28:
+ INST_NAME("SUB Eb, Gb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_sub8(dyn, ninst, x1, x2, x4, x5, x6);
+ EBBACK(x5, 0);
+ break;
+ case 0x29:
+ INST_NAME("SUB Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_sub32(dyn, ninst, rex, ed, gd, x3, x4, x5);
+ WBACK;
+ break;
+ case 0x2A:
+ INST_NAME("SUB Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_sub8(dyn, ninst, x2, x1, x4, x5, x6);
+ GBBACK(x5);
+ break;
+ case 0x2B:
+ INST_NAME("SUB Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_sub32(dyn, ninst, rex, gd, ed, x3, x4, x5);
+ break;
+ case 0x2C:
+ INST_NAME("SUB AL, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ u8 = F8;
+ ANDI(x1, xRAX, 0xff);
+ emit_sub8c(dyn, ninst, x1, u8, x2, x3, x4, x5);
+ ANDI(xRAX, xRAX, ~0xff);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x2D:
+ INST_NAME("SUB EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ emit_sub32c(dyn, ninst, rex, xRAX, i64, x2, x3, x4, x5);
+ break;
+ case 0x30:
+ INST_NAME("XOR Eb, Gb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_xor8(dyn, ninst, x1, x2, x4, x5);
+ EBBACK(x5, 0);
+ break;
+ case 0x31:
+ INST_NAME("XOR Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_xor32(dyn, ninst, rex, ed, gd, x3, x4);
+ if(ed!=gd) {
+ WBACK;
+ }
+ break;
+ case 0x32:
+ INST_NAME("XOR Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_xor8(dyn, ninst, x2, x1, x4, x5);
+ GBBACK(x5);
+ break;
+ case 0x33:
+ INST_NAME("XOR Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_xor32(dyn, ninst, rex, gd, ed, x3, x4);
+ break;
+ case 0x34:
+ INST_NAME("XOR AL, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ u8 = F8;
+ ANDI(x1, xRAX, 0xff);
+ emit_xor8c(dyn, ninst, x1, u8, x3, x4);
+ ANDI(xRAX, xRAX, ~0xff);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x35:
+ INST_NAME("XOR EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ emit_xor32c(dyn, ninst, rex, xRAX, i64, x3, x4);
+ break;
+ case 0x38:
+ INST_NAME("CMP Eb, Gb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ break;
+ case 0x39:
+ INST_NAME("CMP Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_cmp32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6);
+ break;
+ case 0x3A:
+ INST_NAME("CMP Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_cmp8(dyn, ninst, x2, x1, x3, x4, x5, x6);
+ break;
+ case 0x3B:
+ INST_NAME("CMP Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ emit_cmp32(dyn, ninst, rex, gd, ed, x3, x4, x5, x6);
+ break;
+ case 0x3C:
+ INST_NAME("CMP AL, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ u8 = F8;
+ ANDI(x1, xRAX, 0xff);
+ if(u8) {
+ MOV32w(x2, u8);
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ } else {
+ emit_cmp8_0(dyn, ninst, x1, x3, x4);
+ }
+ break;
+ case 0x3D:
+ INST_NAME("CMP EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ if(i64) {
+ MOV64xw(x2, i64);
+ emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5, x6);
+ } else
+ emit_cmp32_0(dyn, ninst, rex, xRAX, x3, x4);
+ break;
+
+ default:
+ DEFAULT;
+ }
+
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_00_1.c b/src/dynarec/rv64/dynarec_rv64_00_1.c
new file mode 100644
index 0000000..54ca28f
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_00_1.c
@@ -0,0 +1,297 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+#include <signal.h>
+#include <assert.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "bridge.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+#include "custommem.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+int isSimpleWrapper(wrapper_t fun);
+
+uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ uint8_t nextop, opcode;
+ uint8_t gd, ed;
+ int8_t i8;
+ int32_t i32, tmp;
+ int64_t i64, j64;
+ uint8_t u8;
+ uint8_t gb1, gb2, eb1, eb2;
+ uint32_t u32;
+ uint64_t u64;
+ uint8_t wback, wb1, wb2, wb;
+ int64_t fixedaddress;
+ int lock;
+ int cacheupd = 0;
+
+ opcode = F8;
+ MAYUSE(eb1);
+ MAYUSE(eb2);
+ MAYUSE(j64);
+ MAYUSE(wb);
+ MAYUSE(lock);
+ MAYUSE(cacheupd);
+
+ switch(opcode) {
+ case 0x40:
+ case 0x41:
+ case 0x42:
+ case 0x43:
+ case 0x44:
+ case 0x45:
+ case 0x46:
+ case 0x47:
+ INST_NAME("INC Reg (32bits)");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ gd = xRAX + (opcode&7);
+ emit_inc32(dyn, ninst, rex, gd, x1, x2, x3, x4);
+ break;
+ case 0x48:
+ case 0x49:
+ case 0x4A:
+ case 0x4B:
+ case 0x4C:
+ case 0x4D:
+ case 0x4E:
+ case 0x4F:
+ INST_NAME("DEC Reg (32bits)");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ gd = xRAX + (opcode&7);
+ emit_dec32(dyn, ninst, rex, gd, x1, x2, x3, x4);
+ break;
+ case 0x50:
+ case 0x51:
+ case 0x52:
+ case 0x53:
+ case 0x54:
+ case 0x55:
+ case 0x56:
+ case 0x57:
+ INST_NAME("PUSH reg");
+ gd = xRAX+(opcode&0x07)+(rex.b<<3);
+ PUSH1z(gd);
+ break;
+ case 0x58:
+ case 0x59:
+ case 0x5A:
+ case 0x5B:
+ case 0x5C:
+ case 0x5D:
+ case 0x5E:
+ case 0x5F:
+ INST_NAME("POP reg");
+ gd = xRAX+(opcode&0x07)+(rex.b<<3);
+ POP1z(gd);
+ break;
+
+ case 0x60:
+ if(rex.is32bits) {
+ INST_NAME("PUSHAD");
+ AND(x1, xRSP, xMASK);
+ PUSH1_32(xRAX);
+ PUSH1_32(xRCX);
+ PUSH1_32(xRDX);
+ PUSH1_32(xRBX);
+ PUSH1_32(x1);
+ PUSH1_32(xRBP);
+ PUSH1_32(xRSI);
+ PUSH1_32(xRDI);
+ } else {
+ DEFAULT;
+ }
+ break;
+ case 0x61:
+ if(rex.is32bits) {
+ INST_NAME("POPAD");
+ POP1_32(xRDI);
+ POP1_32(xRSI);
+ POP1_32(xRBP);
+ POP1_32(x1);
+ POP1_32(xRBX);
+ POP1_32(xRDX);
+ POP1_32(xRCX);
+ POP1_32(xRAX);
+ } else {
+ DEFAULT;
+ }
+ break;
+
+ case 0x63:
+ if(rex.is32bits) {
+ // this is ARPL opcode
+ DEFAULT;
+ } else {
+ INST_NAME("MOVSXD Gd, Ed");
+ nextop = F8;
+ GETGD;
+ if(rex.w) {
+ if(MODREG) { // reg <= reg
+ ADDIW(gd, xRAX+(nextop&7)+(rex.b<<3), 0);
+ } else { // mem <= reg
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ LW(gd, ed, fixedaddress);
+ }
+ } else {
+ if(MODREG) { // reg <= reg
+ AND(gd, xRAX+(nextop&7)+(rex.b<<3), xMASK);
+ } else { // mem <= reg
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ LWU(gd, ed, fixedaddress);
+ }
+ }
+ }
+ break;
+ case 0x64:
+ addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _FS, ok, need_epilog);
+ break;
+ case 0x65:
+ addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _GS, ok, need_epilog);
+ break;
+ case 0x66:
+ addr = dynarec64_66(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+ case 0x67:
+ addr = dynarec64_67(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+ case 0x68:
+ INST_NAME("PUSH Id");
+ i64 = F32S;
+ if(PK(0)==0xC3) {
+ MESSAGE(LOG_DUMP, "PUSH then RET, using indirect\n");
+ TABLE64(x3, addr-4);
+ LW(x1, x3, 0);
+ PUSH1z(x1);
+ } else {
+ MOV64z(x3, i64);
+ PUSH1z(x3);
+ }
+ break;
+ case 0x69:
+ INST_NAME("IMUL Gd, Ed, Id");
+ SETFLAGS(X_ALL, SF_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(4);
+ i64 = F32S;
+ MOV64xw(x4, i64);
+ if(rex.w) {
+ // 64bits imul
+ UFLAG_IF {
+ MULH(x3, ed, x4);
+ MUL(gd, ed, x4);
+ UFLAG_OP1(x3);
+ UFLAG_RES(gd);
+ UFLAG_DF(x3, d_imul64);
+ } else {
+ MULxw(gd, ed, x4);
+ }
+ } else {
+ // 32bits imul
+ UFLAG_IF {
+ MUL(gd, ed, x4);
+ UFLAG_RES(gd);
+ SRLI(x3, gd, 32);
+ UFLAG_OP1(x3);
+ UFLAG_DF(x3, d_imul32);
+ } else {
+ MULxw(gd, ed, x4);
+ }
+ ZEROUP(gd);
+ }
+ break;
+ case 0x6A:
+ INST_NAME("PUSH Ib");
+ i64 = F8S;
+ MOV64z(x3, i64);
+ PUSH1z(x3);
+ break;
+ case 0x6B:
+ INST_NAME("IMUL Gd, Ed, Ib");
+ SETFLAGS(X_ALL, SF_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(1);
+ i64 = F8S;
+ MOV64xw(x4, i64);
+ if(rex.w) {
+ // 64bits imul
+ UFLAG_IF {
+ MULH(x3, ed, x4);
+ MUL(gd, ed, x4);
+ UFLAG_OP1(x3);
+ UFLAG_RES(gd);
+ UFLAG_DF(x3, d_imul64);
+ } else {
+ MUL(gd, ed, x4);
+ }
+ } else {
+ // 32bits imul
+ UFLAG_IF {
+ MUL(gd, ed, x4);
+ UFLAG_RES(gd);
+ SRLI(x3, gd, 32);
+ UFLAG_OP1(x3);
+ UFLAG_DF(x3, d_imul32);
+ } else {
+ MULW(gd, ed, x4);
+ }
+ ZEROUP(gd);
+ }
+ break;
+
+ #define GO(GETFLAGS, NO, YES, F) \
+ READFLAGS(F); \
+ i8 = F8S; \
+ BARRIER(BARRIER_MAYBE); \
+ JUMP(addr+i8, 1); \
+ GETFLAGS; \
+ if(dyn->insts[ninst].x64.jmp_insts==-1 || \
+ CHECK_CACHE()) { \
+ /* out of the block */ \
+ i32 = dyn->insts[ninst].epilog-(dyn->native_size); \
+ B##NO##_safe(x1, i32); \
+ if(dyn->insts[ninst].x64.jmp_insts==-1) { \
+ if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \
+ fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \
+ jump_to_next(dyn, addr+i8, 0, ninst); \
+ } else { \
+ CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \
+ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size);\
+ B(i32); \
+ } \
+ } else { \
+ /* inside the block */ \
+ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \
+ B##YES##_safe(x1, i32); \
+ }
+
+ GOCOND(0x70, "J", "ib");
+
+ #undef GO
+ default:
+ DEFAULT;
+ }
+
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_00_2.c b/src/dynarec/rv64/dynarec_rv64_00_2.c
new file mode 100644
index 0000000..20333f9
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_00_2.c
@@ -0,0 +1,845 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+#include <signal.h>
+#include <assert.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "bridge.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+#include "custommem.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ uint8_t nextop, opcode;
+ uint8_t gd, ed;
+ int8_t i8;
+ int32_t i32, tmp;
+ int64_t i64, j64;
+ uint8_t u8;
+ uint8_t gb1, gb2, eb1, eb2;
+ uint32_t u32;
+ uint64_t u64;
+ uint8_t wback, wb1, wb2, wb;
+ int64_t fixedaddress;
+ int lock;
+ int cacheupd = 0;
+
+ opcode = F8;
+ MAYUSE(eb1);
+ MAYUSE(eb2);
+ MAYUSE(j64);
+ MAYUSE(wb);
+ MAYUSE(lock);
+ MAYUSE(cacheupd);
+
+ switch(opcode) {
+ case 0x80:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0: // ADD
+ INST_NAME("ADD Eb, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEB(x1, 1);
+ u8 = F8;
+ emit_add8c(dyn, ninst, x1, u8, x2, x4, x5);
+ EBBACK(x5, 0);
+ break;
+ case 1: // OR
+ INST_NAME("OR Eb, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEB(x1, 1);
+ u8 = F8;
+ emit_or8c(dyn, ninst, x1, u8, x2, x4, x5);
+ EBBACK(x5, 0);
+ break;
+ case 2: // ADC
+ INST_NAME("ADC Eb, Ib");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEB(x1, 1);
+ u8 = F8;
+ emit_adc8c(dyn, ninst, x1, u8, x2, x4, x5, x6);
+ EBBACK(x5, 0);
+ break;
+ case 3: // SBB
+ INST_NAME("SBB Eb, Ib");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEB(x1, 1);
+ u8 = F8;
+ emit_sbb8c(dyn, ninst, x1, u8, x2, x4, x5, x6);
+ EBBACK(x5, 0);
+ break;
+ case 4: // AND
+ INST_NAME("AND Eb, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEB(x1, 1);
+ u8 = F8;
+ emit_and8c(dyn, ninst, x1, u8, x2, x4);
+ EBBACK(x5, 0);
+ break;
+ case 5: // SUB
+ INST_NAME("SUB Eb, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEB(x1, 1);
+ u8 = F8;
+ emit_sub8c(dyn, ninst, x1, u8, x2, x4, x5, x6);
+ EBBACK(x5, 0);
+ break;
+ case 6: // XOR
+ INST_NAME("XOR Eb, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEB(x1, 1);
+ u8 = F8;
+ emit_xor8c(dyn, ninst, x1, u8, x2, x4);
+ EBBACK(x5, 0);
+ break;
+ case 7: // CMP
+ INST_NAME("CMP Eb, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEB(x1, 1);
+ u8 = F8;
+ if(u8) {
+ ADDI(x2, xZR, u8);
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ } else {
+ emit_cmp8_0(dyn, ninst, x1, x3, x4);
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0x81:
+ case 0x83:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0: // ADD
+ if(opcode==0x81) {INST_NAME("ADD Ed, Id");} else {INST_NAME("ADD Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6);
+ WBACK;
+ break;
+ case 1: // OR
+ if(opcode==0x81) {INST_NAME("OR Ed, Id");} else {INST_NAME("OR Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_or32c(dyn, ninst, rex, ed, i64, x3, x4);
+ WBACK;
+ break;
+ case 2: // ADC
+ if(opcode==0x81) {INST_NAME("ADC Ed, Id");} else {INST_NAME("ADC Ed, Ib");}
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ MOV64xw(x5, i64);
+ emit_adc32(dyn, ninst, rex, ed, x5, x3, x4, x6, x9);
+ WBACK;
+ break;
+ case 3: // SBB
+ if(opcode==0x81) {INST_NAME("SBB Ed, Id");} else {INST_NAME("SBB Ed, Ib");}
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ MOV64xw(x5, i64);
+ emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4, x6);
+ WBACK;
+ break;
+ case 4: // AND
+ if(opcode==0x81) {INST_NAME("AND Ed, Id");} else {INST_NAME("AND Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_and32c(dyn, ninst, rex, ed, i64, x3, x4);
+ WBACK;
+ break;
+ case 5: // SUB
+ if(opcode==0x81) {INST_NAME("SUB Ed, Id");} else {INST_NAME("SUB Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6);
+ WBACK;
+ break;
+ case 6: // XOR
+ if(opcode==0x81) {INST_NAME("XOR Ed, Id");} else {INST_NAME("XOR Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4);
+ WBACK;
+ break;
+ case 7: // CMP
+ if(opcode==0x81) {INST_NAME("CMP Ed, Id");} else {INST_NAME("CMP Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ if(i64) {
+ MOV64xw(x2, i64);
+ emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5, x6);
+ } else {
+ if(!rex.w && MODREG) {
+ AND(x1, ed, xMASK);
+ ed = x1;
+ }
+ emit_cmp32_0(dyn, ninst, rex, ed, x3, x4);
+ }
+ break;
+ }
+ break;
+ case 0x84:
+ INST_NAME("TEST Eb, Gb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop=F8;
+ GETEB(x1, 0);
+ GETGB(x2);
+ emit_test8(dyn, ninst, x1, x2, x3, x4, x5);
+ break;
+ case 0x85:
+ INST_NAME("TEST Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop=F8;
+ GETGD;
+ GETED(0);
+ emit_test32(dyn, ninst, rex, ed, gd, x3, x4, x5);
+ break;
+ case 0x86:
+ INST_NAME("(LOCK)XCHG Eb, Gb");
+ nextop = F8;
+ if(MODREG) {
+ GETGB(x1);
+ GETEB(x2, 0);
+ MV(x4, gd);
+ MV(gd, ed);
+ MV(ed, x4);
+ GBBACK(x4);
+ EBBACK(x4, 0);
+ } else {
+ GETGB(x3);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ SMDMB();
+ LBU(x1, ed, 0);
+ SB(gd, ed, 0);
+ SMDMB();
+ gd = x1;
+ GBBACK(x3);
+ }
+ break;
+ case 0x87:
+ INST_NAME("(LOCK)XCHG Ed, Gd");
+ nextop = F8;
+ if(MODREG) {
+ GETGD;
+ GETED(0);
+ MVxw(x1, gd);
+ MVxw(gd, ed);
+ MVxw(ed, x1);
+ } else {
+ GETGD;
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ SMDMB();
+ ANDI(x3, ed, (1<<(2+rex.w))-1);
+ BNE_MARK(x3, xZR);
+ MARKLOCK;
+ LRxw(x1, ed, 1, 0);
+ SCxw(x3, gd, ed, 0, 1);
+ BNE_MARKLOCK(x3, xZR);
+ B_MARK2_nocond;
+ MARK;
+ LDxw(x1, ed, 0);
+ SDxw(gd, ed, 0);
+ MARK2;
+ SMDMB();
+ MVxw(gd, x1);
+ }
+ break;
+ case 0x88:
+ INST_NAME("MOV Eb, Gb");
+ nextop = F8;
+ gd = ((nextop&0x38)>>3)+(rex.r<<3);
+ if(rex.rex) {
+ gb2 = 0;
+ gb1 = xRAX + gd;
+ } else {
+ gb2 = ((gd&4)>>2);
+ gb1 = xRAX+(gd&3);
+ }
+ gd = x4;
+ if(gb2) {
+ SRLI(x4, gb1, 8);
+ gb1 = x4;
+ }
+ if(MODREG) {
+ ed = (nextop&7) + (rex.b<<3);
+ if(rex.rex) {
+ eb1 = xRAX+ed;
+ eb2 = 0;
+ } else {
+ eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
+ eb2 = ((ed&4)>>2); // L or H
+ }
+ ANDI(gd, gb1, 0xff);
+ if(eb2) {
+ MOV64x(x1, 0xffffffffffff00ffLL);
+ AND(x1, eb1, x1);
+ SLLI(gd, gd, 8);
+ OR(eb1, x1, gd);
+ } else {
+ ANDI(x1, eb1, ~0xff);
+ OR(eb1, x1, gd);
+ }
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0);
+ SB(gb1, ed, fixedaddress);
+ SMWRITELOCK(lock);
+ }
+ break;
+ case 0x89:
+ INST_NAME("MOV Ed, Gd");
+ nextop=F8;
+ GETGD;
+ if(MODREG) { // reg <= reg
+ MVxw(xRAX+(nextop&7)+(rex.b<<3), gd);
+ } else { // mem <= reg
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0);
+ SDxw(gd, ed, fixedaddress);
+ SMWRITELOCK(lock);
+ }
+ break;
+ case 0x8A:
+ INST_NAME("MOV Gb, Eb");
+ nextop = F8;
+ gd = ((nextop&0x38)>>3)+(rex.r<<3);
+ if(rex.rex) {
+ gb2 = 0;
+ gb1 = xRAX + gd;
+ } else {
+ gb2 = ((gd&4)>>2);
+ gb1 = xRAX+(gd&3);
+ }
+ gd = x4;
+ if(MODREG) {
+ ed = (nextop&7) + (rex.b<<3);
+ if(rex.rex) {
+ eb1 = xRAX+ed;
+ eb2 = 0;
+ } else {
+ eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
+ eb2 = ((ed&4)>>2); // L or H
+ }
+ if(eb2) {
+ SRLI(x1, eb1, 8);
+ ANDI(x1, x1, 0xff);
+ } else {
+ ANDI(x1, eb1, 0xff);
+ }
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0);
+ SMREADLOCK(lock);
+ LBU(x1, ed, fixedaddress);
+ }
+ if(gb2) {
+ MOV64x(x4, ~0xff00);
+ AND(gb1, gb1, x4);
+ SLLI(x1, x1, 8);
+ } else {
+ ANDI(gb1, gb1, ~0xff);
+ }
+ OR(gb1, gb1, x1);
+ break;
+ case 0x8B:
+ INST_NAME("MOV Gd, Ed");
+ nextop=F8;
+ GETGD;
+ if(MODREG) {
+ MVxw(gd, xRAX+(nextop&7)+(rex.b<<3));
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0);
+ SMREADLOCK(lock);
+ LDxw(gd, ed, fixedaddress);
+ }
+ break;
+ case 0x8C:
+ INST_NAME("MOV Ed, Seg");
+ nextop=F8;
+ if((nextop&0xC0)==0xC0) { // reg <= seg
+ LHU(xRAX+(nextop&7)+(rex.b<<3), xEmu, offsetof(x64emu_t, segs[(nextop&0x38)>>3]));
+ } else { // mem <= seg
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ LHU(x3, xEmu, offsetof(x64emu_t, segs[(nextop&0x38)>>3]));
+ SH(x3, ed, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+ case 0x8D:
+ INST_NAME("LEA Gd, Ed");
+ nextop=F8;
+ GETGD;
+ if(MODREG) { // reg <= reg? that's an invalid operation
+ DEFAULT;
+ } else { // mem <= reg
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 0, 0);
+ MV(gd, ed);
+ if(!rex.w || rex.is32bits) {
+ ZEROUP(gd); // truncate the higher 32bits as asked
+ }
+ }
+ break;
+ case 0x8E:
+ INST_NAME("MOV Seg,Ew");
+ nextop = F8;
+ if((nextop&0xC0)==0xC0) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0);
+ LHU(x1, ed, fixedaddress);
+ ed = x1;
+ }
+ SW(ed, xEmu, offsetof(x64emu_t, segs[(nextop&0x38)>>3]));
+ SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[(nextop&0x38)>>3]));
+ break;
+ case 0x8F:
+ INST_NAME("POP Ed");
+ nextop = F8;
+ if(MODREG) {
+ POP1z(xRAX+(nextop&7)+(rex.b<<3));
+ } else {
+ POP1z(x2); // so this can handle POP [ESP] and maybe some variant too
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, x1, &fixedaddress, rex, &lock, 1, 0);
+ if(ed==xRSP) {
+ SDz(x2, ed, fixedaddress);
+ } else {
+ // complicated to just allow a segfault that can be recovered correctly
+ ADDIz(xRSP, xRSP, rex.is32bits?-4:-8);
+ SDz(x2, ed, fixedaddress);
+ ADDIz(xRSP, xRSP, rex.is32bits?4:8);
+ }
+ }
+ break;
+ case 0x90:
+ case 0x91:
+ case 0x92:
+ case 0x93:
+ case 0x94:
+ case 0x95:
+ case 0x96:
+ case 0x97:
+ gd = xRAX+(opcode&0x07)+(rex.b<<3);
+ if(gd==xRAX) {
+ INST_NAME("NOP");
+ } else {
+ INST_NAME("XCHG EAX, Reg");
+ MVxw(x2, xRAX);
+ MVxw(xRAX, gd);
+ MVxw(gd, x2);
+ }
+ break;
+ case 0x98:
+ INST_NAME("CWDE");
+ if(rex.w) {
+ SEXT_W(xRAX, xRAX);
+ } else {
+ SLLI(xRAX, xRAX, 16);
+ SRAIW(xRAX, xRAX, 16);
+ ZEROUP(xRAX);
+ }
+ break;
+ case 0x99:
+ INST_NAME("CDQ");
+ if(rex.w) {
+ SRAI(xRDX, xRAX, 63);
+ } else {
+ SLLI(xRDX, xRAX, 32);
+ SRAI(xRDX, xRDX, 63);
+ ZEROUP(xRDX);
+ }
+ break;
+ case 0x9B:
+ INST_NAME("FWAIT");
+ break;
+ case 0x9C:
+ INST_NAME("PUSHF");
+ NOTEST(x1);
+ READFLAGS(X_ALL);
+ FLAGS_ADJUST_TO11(x3, xFlags, x2);
+ PUSH1z(x3);
+ break;
+ case 0x9D:
+ INST_NAME("POPF");
+ SETFLAGS(X_ALL, SF_SET);
+ POP1z(xFlags);
+ FLAGS_ADJUST_FROM11(xFlags, x2);
+ MOV32w(x1, 0x3F7FD7);
+ AND(xFlags, xFlags, x1);
+ ORI(xFlags, xFlags, 0x2);
+ SET_DFNONE();
+ if(box64_wine) { // should this be done all the time?
+ ANDI(x1, xFlags, 1 << F_TF);
+ CBZ_NEXT(x1);
+ MOV64x(xRIP, addr);
+ STORE_XEMU_CALL();
+ CALL(native_singlestep, -1);
+ ANDI(xFlags, xFlags, ~(1 << F_TF));
+ }
+ break;
+ case 0x9F:
+ INST_NAME("LAHF");
+ READFLAGS(X_CF|X_PF|X_AF|X_ZF|X_SF);
+ ANDI(x1, xFlags, 0xFF);
+ SLLI(x1, x1, 8);
+ MOV64x(x2, 0xffffffffffff00ffLL);
+ AND(xRAX, xRAX, x2);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0xA0:
+ INST_NAME("MOV AL,Ob");
+ if(rex.is32bits) u64 = F32; else u64 = F64;
+ MOV64z(x1, u64);
+ LBU(x1, x1, 0);
+ ANDI(xRAX, xRAX, ~0xff);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0xA1:
+ INST_NAME("MOV EAX,Od");
+ if(rex.is32bits) u64 = F32; else u64 = F64;
+ MOV64z(x1, u64);
+ LDxw(xRAX, x1, 0);
+ break;
+ case 0xA2:
+ INST_NAME("MOV Ob,AL");
+ if(rex.is32bits) u64 = F32; else u64 = F64;
+ MOV64z(x1, u64);
+ SB(xRAX, x1, 0);
+ SMWRITE();
+ break;
+ case 0xA3:
+ INST_NAME("MOV Od,EAX");
+ if(rex.is32bits) u64 = F32; else u64 = F64;
+ MOV64z(x1, u64);
+ SDxw(xRAX, x1, 0);
+ SMWRITE();
+ break;
+ case 0xA4:
+ if(rep) {
+ INST_NAME("REP MOVSB");
+ CBZ_NEXT(xRCX);
+ ANDI(x1, xFlags, 1<<F_DF);
+ BNEZ_MARK2(x1);
+ MARK; // Part with DF==0
+ LBU(x1, xRSI, 0);
+ SB(x1, xRDI, 0);
+ ADDI(xRSI, xRSI, 1);
+ ADDI(xRDI, xRDI, 1);
+ SUBI(xRCX, xRCX, 1);
+ BNEZ_MARK(xRCX);
+ B_NEXT_nocond;
+ MARK2; // Part with DF==1
+ LBU(x1, xRSI, 0);
+ LBU(x1, xRDI, 0);
+ SUBI(xRSI, xRSI, 1);
+ SUBI(xRDI, xRDI, 1);
+ SUBI(xRCX, xRCX, 1);
+ BNEZ_MARK2(xRCX);
+ // done
+ } else {
+ INST_NAME("MOVSB");
+ GETDIR(x3, x1, 1);
+ LBU(x1, xRSI, 0);
+ SB(x1, xRDI, 0);
+ ADD(xRSI, xRSI, x3);
+ ADD(xRDI, xRDI, x3);
+ }
+ break;
+ case 0xA5:
+ if(rep) {
+ INST_NAME("REP MOVSD");
+ CBZ_NEXT(xRCX);
+ ANDI(x1, xFlags, 1<<F_DF);
+ BNEZ_MARK2(x1);
+ MARK; // Part with DF==0
+ LDxw(x1, xRSI, 0);
+ ADDI(xRSI, xRSI, rex.w?8:4);
+ SDxw(x1, xRDI, 0);
+ ADDI(xRDI, xRDI, rex.w?8:4);
+ SUBI(xRCX, xRCX, 1);
+ BNEZ_MARK(xRCX);
+ B_NEXT_nocond;
+ MARK2; // Part with DF==1
+ LDxw(x1, xRSI, 0);
+ SUBI(xRSI, xRSI, rex.w?8:4);
+ SDxw(x1, xRDI, 0);
+ SUBI(xRDI, xRDI, rex.w?8:4);
+ SUBI(xRCX, xRCX, 1);
+ BNEZ_MARK2(xRCX);
+ // done
+ } else {
+ INST_NAME("MOVSD");
+ GETDIR(x3, x1, rex.w?8:4);
+ LDxw(x1, xRSI, 0);
+ SDxw(x1, xRDI, 0);
+ ADD(xRSI, xRSI, x3);
+ ADD(xRDI, xRDI, x3);
+ }
+ break;
+ case 0xA6:
+ switch(rep) {
+ case 1:
+ case 2:
+ if(rep==1) {INST_NAME("REPNZ CMPSB");} else {INST_NAME("REPZ CMPSB");}
+ MAYSETFLAGS();
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ CBZ_NEXT(xRCX);
+ ANDI(x1, xFlags, 1<<F_DF);
+ BNEZ_MARK2(x1);
+ MARK; // Part with DF==0
+ LBU(x1, xRSI, 0);
+ ADDI(xRSI, xRSI, 1);
+ LBU(x2, xRDI, 0);
+ ADDI(xRDI, xRDI, 1);
+ SUBI(xRCX, xRCX, 1);
+ if (rep==1) {BEQ_MARK3(x1, x2);} else {BNE_MARK3(x1, x2);}
+ BNEZ_MARK(xRCX);
+ B_MARK3_nocond;
+ MARK2; // Part with DF==1
+ LBU(x1, xRSI, 0);
+ SUBI(xRSI, xRSI, 1);
+ LBU(x2, xRDI, 0);
+ SUBI(xRDI, xRDI, 1);
+ SUBI(xRCX, xRCX, 1);
+ if (rep==1) {BEQ_MARK3(x1, x2);} else {BNE_MARK3(x1, x2);}
+ BNEZ_MARK2(xRCX);
+ MARK3; // end
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ break;
+ default:
+ INST_NAME("CMPSB");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETDIR(x3, x1, 1);
+ LBU(x1, xRSI, 0);
+ LBU(x2, xRDI, 0);
+ ADD(xRSI, xRSI, x3);
+ ADD(xRDI, xRDI, x3);
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ break;
+ }
+ break;
+ case 0xA8:
+ INST_NAME("TEST AL, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ ANDI(x1, xRAX, 0xff);
+ u8 = F8;
+ MOV32w(x2, u8);
+ emit_test8(dyn, ninst, x1, x2, x3, x4, x5);
+ break;
+ case 0xA9:
+ INST_NAME("TEST EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ MOV64xw(x2, i64);
+ emit_test32(dyn, ninst, rex, xRAX, x2, x3, x4, x5);
+ break;
+ case 0xAA:
+ if(rep) {
+ INST_NAME("REP STOSB");
+ CBZ_NEXT(xRCX);
+ ANDI(x1, xFlags, 1<<F_DF);
+ BNEZ_MARK2(x1);
+ MARK; // Part with DF==0
+ SB(xRAX, xRDI, 0);
+ ADDI(xRDI, xRDI, 1);
+ ADDI(xRCX, xRCX, -1);
+ BNEZ_MARK(xRCX);
+ B_NEXT_nocond;
+ MARK2; // Part with DF==1
+ SB(xRAX, xRDI, 0);
+ ADDI(xRDI, xRDI, -1);
+ ADDI(xRCX, xRCX, -1);
+ BNEZ_MARK2(xRCX);
+ // done
+ } else {
+ INST_NAME("STOSB");
+ GETDIR(x3, x1, 1);
+ SB(xRAX, xRDI, 0);
+ ADD(xRDI, xRDI, x3);
+ }
+ break;
+ case 0xAB:
+ if(rep) {
+ INST_NAME("REP STOSD");
+ CBZ_NEXT(xRCX);
+ ANDI(x1, xFlags, 1<<F_DF);
+ BNEZ_MARK2(x1);
+ MARK; // Part with DF==0
+ SDxw(xRAX, xRDI, 0);
+ ADDI(xRDI, xRDI, rex.w?8:4);
+ SUBI(xRCX, xRCX, 1);
+ BNEZ_MARK(xRCX);
+ B_NEXT_nocond;
+ MARK2; // Part with DF==1
+ SDxw(xRAX, xRDI, 0);
+ SUBI(xRDI, xRDI, rex.w?8:4);
+ SUBI(xRCX, xRCX, 1);
+ BNEZ_MARK2(xRCX);
+ // done
+ } else {
+ INST_NAME("STOSD");
+ GETDIR(x3, x1, rex.w?8:4);
+ SDxw(xRAX, xRDI, 0);
+ ADD(xRDI, xRDI, x3);
+ }
+ break;
+ case 0xAE:
+ switch (rep) {
+ case 1:
+ case 2:
+ if (rep==1) {INST_NAME("REPNZ SCASB");} else {INST_NAME("REPZ SCASB");}
+ MAYSETFLAGS();
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ CBZ_NEXT(xRCX);
+ ANDI(x1, xRAX, 0xff);
+ ANDI(x2, xFlags, 1<<F_DF);
+ BNEZ_MARK2(x2);
+ MARK; // Part with DF==0
+ LBU(x2, xRDI, 0);
+ ADDI(xRDI, xRDI, 1);
+ SUBI(xRCX, xRCX, 1);
+ if (rep==1) {BEQ_MARK3(x1, x2);} else {BNE_MARK3(x1, x2);}
+ BNE_MARK(xRCX, xZR);
+ B_MARK3_nocond;
+ MARK2; // Part with DF==1
+ LBU(x2, xRDI, 0);
+ SUBI(xRDI, xRDI, 1);
+ SUBI(xRCX, xRCX, 1);
+ if (rep==1) {BEQ_MARK3(x1, x2);} else {BNE_MARK3(x1, x2);}
+ BNE_MARK2(xRCX, xZR);
+ MARK3; // end
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ break;
+ default:
+ INST_NAME("SCASB");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETDIR(x3, x1, 1);
+ ANDI(x1, xRAX, 0xff);
+ LBU(x2, xRDI, 0);
+ ADD(xRDI, xRDI, x3);
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ break;
+ }
+ break;
+ case 0xAF:
+ switch (rep) {
+ case 1:
+ case 2:
+ if (rep==1) {INST_NAME("REPNZ SCASD");} else {INST_NAME("REPZ SCASD");}
+ MAYSETFLAGS();
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ CBZ_NEXT(xRCX);
+ if (rex.w) {MV(x1, xRAX);} else {AND(x1, xRAX, xMASK);}
+ ANDI(x2, xFlags, 1<<F_DF);
+ BNEZ_MARK2(x2);
+ MARK; // Part with DF==0
+ LDxw(x2, xRDI, 0);
+ ADDI(xRDI, xRDI, rex.w?8:4);
+ SUBI(xRCX, xRCX, 1);
+ if (rep==1) {BEQ_MARK3(x1, x2);} else {BNE_MARK3(x1, x2);}
+ BNE_MARK(xRCX, xZR);
+ B_MARK3_nocond;
+ MARK2; // Part with DF==1
+ LDxw(x2, xRDI, 0);
+ SUBI(xRDI, xRDI, rex.w?8:4);
+ SUBI(xRCX, xRCX, 1);
+ if (rep==1) {BEQ_MARK3(x1, x2);} else {BNE_MARK3(x1, x2);}
+ BNE_MARK2(xRCX, xZR);
+ MARK3; // end
+ emit_cmp32(dyn, ninst, rex, x1, x2, x3, x4, x5, x6);
+ break;
+ default:
+ INST_NAME("SCASD");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETDIR(x3, x1, rex.w?8:4);
+ AND(x1, xRAX, xMASK);
+ LDxw(x2, xRDI, 0);
+ ADD(xRDI, xRDI, x3);
+ emit_cmp32(dyn, ninst, rex, x1, x2, x3, x4, x5, x6);
+ break;
+ }
+ break;
+ case 0xB0:
+ case 0xB1:
+ case 0xB2:
+ case 0xB3:
+ INST_NAME("MOV xL, Ib");
+ u8 = F8;
+ if(rex.rex)
+ gb1 = xRAX+(opcode&7)+(rex.b<<3);
+ else
+ gb1 = xRAX+(opcode&3);
+ ANDI(gb1, gb1, ~0xff);
+ ORI(gb1, gb1, u8);
+ break;
+ case 0xB4:
+ case 0xB5:
+ case 0xB6:
+ case 0xB7:
+ INST_NAME("MOV xH, Ib");
+ u8 = F8;
+ if(rex.rex) {
+ gb1 = xRAX+(opcode&7)+(rex.b<<3);
+ ANDI(gb1, gb1, ~0xff);
+ ORI(gb1, gb1, u8);
+ } else {
+ MOV32w(x1, u8);
+ gb1 = xRAX+(opcode&3);
+ MOV64x(x2, 0xffffffffffff00ffLL);
+ AND(gb1, gb1, x2);
+ SLLI(x1, x1, 8);
+ OR(gb1, gb1, x1);
+ }
+ break;
+ case 0xB8:
+ case 0xB9:
+ case 0xBA:
+ case 0xBB:
+ case 0xBC:
+ case 0xBD:
+ case 0xBE:
+ case 0xBF:
+ INST_NAME("MOV Reg, Id");
+ gd = xRAX+(opcode&7)+(rex.b<<3);
+ if(rex.w) {
+ u64 = F64;
+ MOV64x(gd, u64);
+ } else {
+ u32 = F32;
+ MOV32w(gd, u32);
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_00_3.c b/src/dynarec/rv64/dynarec_rv64_00_3.c
new file mode 100644
index 0000000..dece35a
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_00_3.c
@@ -0,0 +1,1198 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+#include <signal.h>
+#include <assert.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "bridge.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+#include "custommem.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+int isSimpleWrapper(wrapper_t fun);
+int isRetX87Wrapper(wrapper_t fun);
+
+uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ uint8_t nextop, opcode;
+ uint8_t gd, ed;
+ int8_t i8;
+ int32_t i32, tmp;
+ int64_t i64, j64;
+ uint8_t u8;
+ uint8_t gb1, gb2, eb1, eb2;
+ uint32_t u32;
+ uint64_t u64;
+ uint8_t wback, wb1, wb2, wb;
+ int64_t fixedaddress;
+ int lock;
+ int cacheupd = 0;
+
+ opcode = F8;
+ MAYUSE(eb1);
+ MAYUSE(eb2);
+ MAYUSE(j64);
+ MAYUSE(wb);
+ MAYUSE(lock);
+ MAYUSE(cacheupd);
+
+ switch(opcode) {
+ case 0xC0:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("ROL Eb, Ib");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ SETFLAGS(X_OF|X_CF, SF_SET);
+ GETEB(x1, 1);
+ u8 = F8;
+ MOV32w(x2, u8);
+ CALL_(rol8, ed, x3);
+ EBBACK(x5, 0);
+ break;
+ case 1:
+ INST_NAME("ROR Eb, Ib");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ SETFLAGS(X_OF|X_CF, SF_SET);
+ GETEB(x1, 1);
+ u8 = F8;
+ MOV32w(x2, u8);
+ CALL_(ror8, ed, x3);
+ EBBACK(x5, 0);
+ break;
+ case 4:
+ case 6:
+ INST_NAME("SHL Eb, Ib");
+ GETEB(x1, 1);
+ u8 = (F8)&0x1f;
+ if(u8) {
+ SETFLAGS(X_ALL, SF_PENDING);
+ UFLAG_IF{
+ MOV32w(x4, u8); UFLAG_OP2(x4);
+ };
+ UFLAG_OP1(ed);
+ SLLIW(ed, ed, u8);
+ EBBACK(x5, 1);
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_shl8);
+ } else {
+ NOP();
+ }
+ break;
+ case 5:
+ INST_NAME("SHR Eb, Ib");
+ GETEB(x1, 1);
+ u8 = (F8)&0x1f;
+ if(u8) {
+ SETFLAGS(X_ALL, SF_PENDING);
+ UFLAG_IF{
+ MOV32w(x4, u8); UFLAG_OP2(x4);
+ };
+ UFLAG_OP1(ed);
+ if(u8) {
+ SRLIW(ed, ed, u8);
+ EBBACK(x5, 1);
+ }
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_shr8);
+ } else {
+ NOP();
+ }
+ break;
+ case 7:
+ INST_NAME("SAR Eb, Ib");
+ GETSEB(x1, 1);
+ u8 = (F8)&0x1f;
+ if(u8) {
+ SETFLAGS(X_ALL, SF_PENDING);
+ UFLAG_IF{
+ MOV32w(x4, u8); UFLAG_OP2(x4);
+ };
+ UFLAG_OP1(ed);
+ if(u8) {
+ SRAIW(ed, ed, u8);
+ EBBACK(x5, 1);
+ }
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_sar8);
+ } else {
+ NOP();
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0xC1:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("ROL Ed, Ib");
+ SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING);
+ GETED(1);
+ u8 = (F8)&(rex.w?0x3f:0x1f);
+ emit_rol32c(dyn, ninst, rex, ed, u8, x3, x4);
+ if(u8) { WBACK; }
+ if(!wback && !rex.w) ZEROUP(ed);
+ break;
+ case 1:
+ INST_NAME("ROR Ed, Ib");
+ SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING);
+ GETED(1);
+ u8 = (F8)&(rex.w?0x3f:0x1f);
+ emit_ror32c(dyn, ninst, rex, ed, u8, x3, x4);
+ if(u8) { WBACK; }
+ if(!wback && !rex.w) ZEROUP(ed);
+ break;
+ case 4:
+ case 6:
+ INST_NAME("SHL Ed, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
+ GETED(1);
+ u8 = (F8)&(rex.w?0x3f:0x1f);
+ emit_shl32c(dyn, ninst, rex, ed, u8, x3, x4, x5);
+ if(u8) WBACK;
+ break;
+ case 5:
+ INST_NAME("SHR Ed, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
+ GETED(1);
+ u8 = (F8)&(rex.w?0x3f:0x1f);
+ emit_shr32c(dyn, ninst, rex, ed, u8, x3, x4);
+ if(u8) { WBACK; }
+ break;
+ case 7:
+ INST_NAME("SAR Ed, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
+ GETED(1);
+ u8 = (F8)&(rex.w?0x3f:0x1f);
+ emit_sar32c(dyn, ninst, rex, ed, u8, x3, x4);
+ if(u8) { WBACK; }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0xC2:
+ INST_NAME("RETN");
+ //SETFLAGS(X_ALL, SF_SET); // Hack, set all flags (to an unknown state...)
+ if(box64_dynarec_safeflags) {
+ READFLAGS(X_PEND); // lets play safe here too
+ }
+ BARRIER(BARRIER_FLOAT);
+ i32 = F16;
+ retn_to_epilog(dyn, ninst, rex, i32);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+ case 0xC3:
+ INST_NAME("RET");
+ // SETFLAGS(X_ALL, SF_SET); // Hack, set all flags (to an unknown state...)
+ if(box64_dynarec_safeflags) {
+ READFLAGS(X_PEND); // so instead, force the deferred flags, so it's not too slow, and flags are not lost
+ }
+ BARRIER(BARRIER_FLOAT);
+ ret_to_epilog(dyn, ninst, rex);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+
+ case 0xC6:
+ INST_NAME("MOV Eb, Ib");
+ nextop=F8;
+ if(MODREG) { // reg <= u8
+ u8 = F8;
+ if(!rex.rex) {
+ ed = (nextop&7);
+ eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
+ eb2 = (ed&4)>>2; // L or H
+ } else {
+ eb1 = xRAX+(nextop&7)+(rex.b<<3);
+ eb2 = 0;
+ }
+
+ if (eb2) {
+ // load a mask to x3 (ffffffffffff00ff)
+ LUI(x3, 0xffff0);
+ ORI(x3, x3, 0xff);
+ // apply mask
+ AND(eb1, eb1, x3);
+ if(u8) {
+ if((u8<<8)<2048) {
+ ADDI(x4, xZR, u8<<8);
+ } else {
+ ADDI(x4, xZR, u8);
+ SLLI(x4, x4, 8);
+ }
+ OR(eb1, eb1, x4);
+ }
+ } else {
+ ANDI(eb1, eb1, 0xf00); // mask ffffffffffffff00
+ ORI(eb1, eb1, u8);
+ }
+ } else { // mem <= u8
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, &lock, 0, 1);
+ u8 = F8;
+ if(u8) {
+ ADDI(x3, xZR, u8);
+ ed = x3;
+ } else
+ ed = xZR;
+ SB(ed, wback, fixedaddress);
+ SMWRITELOCK(lock);
+ }
+ break;
+ case 0xC7:
+ INST_NAME("MOV Ed, Id");
+ nextop=F8;
+ if(MODREG) { // reg <= i32
+ i64 = F32S;
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ MOV64xw(ed, i64);
+ } else { // mem <= i32
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, &lock, 0, 4);
+ i64 = F32S;
+ if(i64) {
+ MOV64xw(x3, i64);
+ ed = x3;
+ } else
+ ed = xZR;
+ SDxw(ed, wback, fixedaddress);
+ SMWRITELOCK(lock);
+ }
+ break;
+
+ case 0xC9:
+ INST_NAME("LEAVE");
+ MVz(xRSP, xRBP);
+ POP1z(xRBP);
+ break;
+
+ case 0xCC:
+ SETFLAGS(X_ALL, SF_SET); // Hack, set all flags (to an unknown state...)
+ SKIPTEST(x1);
+ if(PK(0)=='S' && PK(1)=='C') {
+ addr+=2;
+ BARRIER(BARRIER_FLOAT);
+ INST_NAME("Special Box64 instruction");
+ if((PK64(0)==0))
+ {
+ addr+=8;
+ MESSAGE(LOG_DEBUG, "Exit x64 Emu\n");
+ //GETIP(ip+1+2); // no use
+ //STORE_XEMU_REGS(xRIP); // no need, done in epilog
+ MOV64x(x1, 1);
+ SW(x1, xEmu, offsetof(x64emu_t, quit));
+ *ok = 0;
+ *need_epilog = 1;
+ } else {
+ MESSAGE(LOG_DUMP, "Native Call to %s\n", GetNativeName(GetNativeFnc(ip)));
+ x87_forget(dyn, ninst, x3, x4, 0);
+ sse_purge07cache(dyn, ninst, x3);
+ // disabling isSimpleWrapper because all signed value less than 64bits needs to be sign extended
+ // and return value needs to be cleanned up
+ tmp = 0;//isSimpleWrapper(*(wrapper_t*)(addr));
+ if(isRetX87Wrapper(*(wrapper_t*)(addr)))
+ // return value will be on the stack, so the stack depth needs to be updated
+ x87_purgecache(dyn, ninst, 0, x3, x1, x4);
+ if(tmp<0 || tmp>1)
+ tmp=0; //TODO: removed when FP is in place
+ if((box64_log<2 && !cycle_log) && tmp) {
+ //GETIP(ip+3+8+8); // read the 0xCC
+ call_n(dyn, ninst, *(void**)(addr+8), tmp);
+ addr+=8+8;
+ } else {
+ GETIP(ip+1); // read the 0xCC
+ STORE_XEMU_CALL();
+ ADDI(x1, xEmu, (uint32_t)offsetof(x64emu_t, ip)); // setup addr as &emu->ip
+ CALL_S(x64Int3, -1);
+ LOAD_XEMU_CALL();
+ addr+=8+8;
+ TABLE64(x3, addr); // expected return address
+ BNE_MARK(xRIP, x3);
+ LW(w1, xEmu, offsetof(x64emu_t, quit));
+ CBZ_NEXT(w1);
+ MARK;
+ jump_to_epilog_fast(dyn, 0, xRIP, ninst);
+ }
+ }
+ } else {
+ #if 1
+ INST_NAME("INT 3");
+ // check if TRAP signal is handled
+ LD(x1, xEmu, offsetof(x64emu_t, context));
+ MOV64x(x2, offsetof(box64context_t, signals[SIGTRAP]));
+ ADD(x2, x2, x1);
+ LD(x3, x2, 0);
+ CBNZ_NEXT(x3);
+ MOV64x(x1, SIGTRAP);
+ CALL_(raise, -1, 0);
+ break;
+ #else
+ DEFAULT;
+ #endif
+ }
+ break;
+ case 0xCD:
+ u8 = F8;
+ if (box64_wine && u8 == 0x2D) {
+ INST_NAME("INT 2D");
+ // lets do nothing
+ MESSAGE(LOG_INFO, "INT 2D Windows anti-debug hack\n");
+ } else if (u8 == 0x80) {
+ INST_NAME("32bits SYSCALL");
+ NOTEST(x1);
+ SMEND();
+ GETIP(addr);
+ STORE_XEMU_CALL();
+ CALL_S(x86Syscall, -1);
+ LOAD_XEMU_CALL();
+ TABLE64(x3, addr); // expected return address
+ BNE_MARK(xRIP, x3);
+ LW(x1, xEmu, offsetof(x64emu_t, quit));
+ BEQ_NEXT(x1, xZR);
+ MARK;
+ LOAD_XEMU_REM();
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ } else {
+ INST_NAME("INT n");
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL();
+ CALL(native_priv, -1);
+ LOAD_XEMU_CALL();
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ }
+ break;
+ case 0xCF:
+ INST_NAME("IRET");
+ SETFLAGS(X_ALL, SF_SET); // Not a hack, EFLAGS are restored
+ BARRIER(BARRIER_FLOAT);
+ iret_to_epilog(dyn, ninst, rex.w);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+ case 0xD0:
+ case 0xD2: // TODO: Jump if CL is 0
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ if(opcode==0xD0) {
+ INST_NAME("ROL Eb, 1");
+ MOV32w(x2, 1);
+ } else {
+ INST_NAME("ROL Eb, CL");
+ ANDI(x2, xRCX, 7);
+ }
+ SETFLAGS(X_OF|X_CF, SF_PENDING);
+ GETEB(x1, 0);
+ UFLAG_OP12(ed, x2);
+ SLL(x3, ed, x2);
+ SRLI(x4, x3, 8);
+ OR(ed, x3, x4);
+ EBBACK(x5, 1);
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_rol8);
+ break;
+ case 1:
+ if(opcode==0xD0) {
+ INST_NAME("ROR Eb, 1");
+ MOV32w(x2, 1);
+ } else {
+ INST_NAME("ROR Eb, CL");
+ ANDI(x2, xRCX, 7);
+ }
+ SETFLAGS(X_OF|X_CF, SF_PENDING);
+ GETEB(x1, 0);
+ UFLAG_OP12(ed, x2);
+ SRL(x3, ed, x2);
+ SLLI(x4, ed, 8);
+ SRL(x4, x4, x2);
+ OR(ed, x3, x4);
+ EBBACK(x5, 1);
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_ror8);
+ break;
+ case 4:
+ case 6:
+ if(opcode==0xD0) {
+ INST_NAME("SHL Eb, 1");
+ MOV32w(x2, 1);
+ } else {
+ INST_NAME("SHL Eb, CL");
+ ANDI(x2, xRCX, 7);
+ }
+ SETFLAGS(X_ALL, SF_PENDING);
+ GETEB(x1, 0);
+ UFLAG_OP12(ed, x2)
+ SLL(ed, ed, x2);
+ EBBACK(x5, 1);
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_shl8);
+ break;
+ case 5:
+ if(opcode==0xD0) {
+ INST_NAME("SHR Eb, 1");
+ MOV32w(x4, 1);
+ } else {
+ INST_NAME("SHR Eb, CL");
+ ANDI(x4, xRCX, 0x1F);
+ }
+ SETFLAGS(X_ALL, SF_PENDING);
+ GETEB(x1, 0);
+ UFLAG_OP12(ed, x4);
+ SRLW(ed, ed, x4);
+ EBBACK(x5, 1);
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_shr8);
+ break;
+ case 7:
+ if(opcode==0xD0) {
+ INST_NAME("SAR Eb, 1");
+ MOV32w(x4, 1);
+ } else {
+ INST_NAME("SAR Eb, CL");
+ ANDI(x4, xRCX, 0x1f);
+ }
+ SETFLAGS(X_ALL, SF_PENDING);
+ GETSEB(x1, 0);
+ UFLAG_OP12(ed, x4)
+ SRA(ed, ed, x4);
+ EBBACK(x3, 1);
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_sar8);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0xD1:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("ROL Ed, 1");
+ SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING);
+ GETED(0);
+ emit_rol32c(dyn, ninst, rex, ed, 1, x3, x4);
+ WBACK;
+ if(!wback && !rex.w) ZEROUP(ed);
+ break;
+ case 1:
+ INST_NAME("ROR Ed, 1");
+ SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING);
+ GETED(0);
+ emit_ror32c(dyn, ninst, rex, ed, 1, x3, x4);
+ WBACK;
+ if(!wback && !rex.w) ZEROUP(ed);
+ break;
+ case 3:
+ INST_NAME("RCR Ed, 1");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ READFLAGS(X_CF);
+ SETFLAGS(X_OF|X_CF, SF_SET);
+ MOV32w(x2, 1);
+ GETEDW(x4, x1, 0);
+ CALL_(rex.w?((void*)rcr64):((void*)rcr32), ed, x4);
+ WBACK;
+ break;
+ case 4:
+ case 6:
+ INST_NAME("SHL Ed, 1");
+ SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
+ GETED(0);
+ emit_shl32c(dyn, ninst, rex, ed, 1, x3, x4, x5);
+ WBACK;
+ break;
+ case 5:
+ INST_NAME("SHR Ed, 1");
+ SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
+ GETED(0);
+ emit_shr32c(dyn, ninst, rex, ed, 1, x3, x4);
+ WBACK;
+ break;
+ case 7:
+ INST_NAME("SAR Ed, 1");
+ SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
+ GETED(0);
+ emit_sar32c(dyn, ninst, rex, ed, 1, x3, x4);
+ WBACK;
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
+ case 0xD3:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("ROL Ed, CL");
+ SETFLAGS(X_OF|X_CF, SF_SUBSET);
+ GETED(0);
+ emit_rol32(dyn, ninst, rex, ed, xRCX, x3, x4);
+ WBACK;
+ if(!wback && !rex.w) ZEROUP(ed);
+ break;
+ case 1:
+ INST_NAME("ROR Ed, CL");
+ SETFLAGS(X_OF|X_CF, SF_SUBSET);
+ GETED(0);
+ emit_ror32(dyn, ninst, rex, ed, xRCX, x3, x4);
+ WBACK;
+ if(!wback && !rex.w) ZEROUP(ed);
+ break;
+ case 4:
+ case 6:
+ INST_NAME("SHL Ed, CL");
+ SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
+ ANDI(x3, xRCX, rex.w?0x3f:0x1f);
+ GETED(0);
+ if(!rex.w && MODREG) {ZEROUP(ed);}
+ CBZ_NEXT(x3);
+ emit_shl32(dyn, ninst, rex, ed, x3, x5, x4, x6);
+ WBACK;
+ break;
+ case 5:
+ INST_NAME("SHR Ed, CL");
+ SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
+ ANDI(x3, xRCX, rex.w?0x3f:0x1f);
+ GETED(0);
+ if(!rex.w && MODREG) {ZEROUP(ed);}
+ CBZ_NEXT(x3);
+ emit_shr32(dyn, ninst, rex, ed, x3, x5, x4);
+ WBACK;
+ break;
+ case 7:
+ INST_NAME("SAR Ed, CL");
+ SETFLAGS(X_ALL, SF_PENDING);
+ ANDI(x3, xRCX, rex.w?0x3f:0x1f);
+ GETED(0);
+ if(!rex.w && MODREG) {ZEROUP(ed);}
+ CBZ_NEXT(x3);
+ UFLAG_OP12(ed, x3);
+ SRAxw(ed, ed, x3);
+ WBACK;
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, rex.w?d_sar64:d_sar32);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
+ case 0xD8:
+ addr = dynarec64_D8(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+ case 0xD9:
+ addr = dynarec64_D9(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+
+ case 0xDB:
+ addr = dynarec64_DB(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+ case 0xDC:
+ addr = dynarec64_DC(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+ case 0xDD:
+ addr = dynarec64_DD(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+
+ case 0xDE:
+ addr = dynarec64_DE(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+ case 0xDF:
+ addr = dynarec64_DF(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+ #define GO(Z) \
+ BARRIER(BARRIER_MAYBE); \
+ JUMP(addr+i8, 1); \
+ if(dyn->insts[ninst].x64.jmp_insts==-1 || \
+ CHECK_CACHE()) { \
+ /* out of the block */ \
+ i32 = dyn->insts[ninst].epilog-(dyn->native_size); \
+ if(Z) {BNE(xRCX, xZR, i32);} else {BEQ(xRCX, xZR, i32);}; \
+ if(dyn->insts[ninst].x64.jmp_insts==-1) { \
+ if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \
+ fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \
+ jump_to_next(dyn, addr+i8, 0, ninst); \
+ } else { \
+ CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \
+ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \
+ B(i32); \
+ } \
+ } else { \
+ /* inside the block */ \
+ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \
+ if(Z) {BEQ(xRCX, xZR, i32);} else {BNE(xRCX, xZR, i32);}; \
+ }
+ case 0xE0:
+ INST_NAME("LOOPNZ");
+ READFLAGS(X_ZF);
+ i8 = F8S;
+ SUBI(xRCX, xRCX, 1);
+ ANDI(x1, xFlags, 1 << F_ZF);
+ CBNZ_NEXT(x1);
+ GO(0);
+ break;
+ case 0xE1:
+ INST_NAME("LOOPZ");
+ READFLAGS(X_ZF);
+ i8 = F8S;
+ SUBI(xRCX, xRCX, 1);
+ ANDI(x1, xFlags, 1 << F_ZF);
+ CBZ_NEXT(x1);
+ GO(0);
+ break;
+ case 0xE2:
+ INST_NAME("LOOP");
+ i8 = F8S;
+ SUBI(xRCX, xRCX, 1);
+ GO(0);
+ break;
+ case 0xE3:
+ INST_NAME("JECXZ");
+ i8 = F8S;
+ GO(1);
+ break;
+ #undef GO
+
+ case 0xE8:
+ INST_NAME("CALL Id");
+ i32 = F32S;
+ if(addr+i32==0) {
+ #if STEP == 3
+ printf_log(LOG_INFO, "Warning, CALL to 0x0 at %p (%p)\n", (void*)addr, (void*)(addr-1));
+ #endif
+ }
+ #if STEP < 2
+ if(!rex.is32bits && isNativeCall(dyn, addr+i32, &dyn->insts[ninst].natcall, &dyn->insts[ninst].retn))
+ tmp = dyn->insts[ninst].pass2choice = 3;
+ else
+ tmp = dyn->insts[ninst].pass2choice = 0;
+ #else
+ tmp = dyn->insts[ninst].pass2choice;
+ #endif
+ switch(tmp) {
+ case 3:
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags to "dont'care" state
+ SKIPTEST(x1);
+ BARRIER(BARRIER_FULL);
+ //BARRIER_NEXT(BARRIER_FULL);
+ if(dyn->last_ip && (addr-dyn->last_ip<0x1000)) {
+ ADDI(x2, xRIP, addr-dyn->last_ip);
+ } else {
+ TABLE64(x2, addr);
+ }
+ PUSH1(x2);
+ MESSAGE(LOG_DUMP, "Native Call to %s (retn=%d)\n", GetNativeName(GetNativeFnc(dyn->insts[ninst].natcall-1)), dyn->insts[ninst].retn);
+ // calling a native function
+ sse_purge07cache(dyn, ninst, x3);
+ if((box64_log<2 && !cycle_log) && dyn->insts[ninst].natcall) {
+ // disabling isSimpleWrapper because all signed value less than 64bits needs to be sign extended
+ // and return value needs to be cleanned up
+ tmp=0;//isSimpleWrapper(*(wrapper_t*)(dyn->insts[ninst].natcall+2));
+ if(tmp>1 || tmp<0)
+ tmp=0; // float paramters not ready!
+ } else
+ tmp=0;
+ if(dyn->insts[ninst].natcall && isRetX87Wrapper(*(wrapper_t*)(dyn->insts[ninst].natcall+2)))
+ // return value will be on the stack, so the stack depth needs to be updated
+ x87_purgecache(dyn, ninst, 0, x3, x1, x4);
+ if((box64_log<2 && !cycle_log) && dyn->insts[ninst].natcall && tmp) {
+ //GETIP(ip+3+8+8); // read the 0xCC
+ call_n(dyn, ninst, *(void**)(dyn->insts[ninst].natcall+2+8), tmp);
+ POP1(xRIP); // pop the return address
+ dyn->last_ip = addr;
+ } else {
+ GETIP_(dyn->insts[ninst].natcall); // read the 0xCC already
+ STORE_XEMU_CALL();
+ ADDI(x1, xEmu, (uint32_t)offsetof(x64emu_t, ip)); // setup addr as &emu->ip
+ CALL_S(x64Int3, -1);
+ LOAD_XEMU_CALL();
+ TABLE64(x3, dyn->insts[ninst].natcall);
+ ADDI(x3, x3, 2+8+8);
+ BNE_MARK(xRIP, x3); // Not the expected address, exit dynarec block
+ POP1(xRIP); // pop the return address
+ if(dyn->insts[ninst].retn) {
+ if(dyn->insts[ninst].retn<0x1000) {
+ ADDI(xRSP, xRSP, dyn->insts[ninst].retn);
+ } else {
+ MOV64x(x3, dyn->insts[ninst].retn);
+ ADD(xRSP, xRSP, x3);
+ }
+ }
+ TABLE64(x3, addr);
+ BNE_MARK(xRIP, x3); // Not the expected address again
+ LW(w1, xEmu, offsetof(x64emu_t, quit));
+ CBZ_NEXT(w1);
+ MARK;
+ jump_to_epilog_fast(dyn, 0, xRIP, ninst);
+ dyn->last_ip = addr;
+ }
+ break;
+ default:
+ if((box64_dynarec_safeflags>1) || (ninst && dyn->insts[ninst-1].x64.set_flags)) {
+ READFLAGS(X_PEND); // that's suspicious
+ } else {
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags to "dont'care" state
+ }
+ // regular call
+ //BARRIER_NEXT(1);
+ if(box64_dynarec_callret && box64_dynarec_bigblock>1) {
+ BARRIER(BARRIER_FULL);
+ } else {
+ BARRIER(BARRIER_FLOAT);
+ *need_epilog = 0;
+ *ok = 0;
+ }
+
+ if(rex.is32bits) {
+ MOV32w(x2, addr);
+ } else {
+ TABLE64(x2, addr);
+ }
+ PUSH1z(x2);
+ // TODO: Add support for CALLRET optim
+ /*if(box64_dynarec_callret) {
+ // Push actual return address
+ if(addr < (dyn->start+dyn->isize)) {
+ // there is a next...
+ j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0;
+ ADR_S20(x4, j64);
+ } else {
+ j64 = getJumpTableAddress64(addr);
+ TABLE64(x4, j64);
+ LDR(x4, x4, 0);
+ }
+ PUSH1(x4);
+ PUSH1(x2);
+ } else */ //CALLRET optim disable for now.
+ {
+ *ok = 0;
+ *need_epilog = 0;
+ }
+ jump_to_next(dyn, addr+i32, 0, ninst);
+ break;
+ }
+ break;
+ case 0xE9:
+ case 0xEB:
+ BARRIER(BARRIER_MAYBE);
+ if(opcode==0xE9) {
+ INST_NAME("JMP Id");
+ i32 = F32S;
+ } else {
+ INST_NAME("JMP Ib");
+ i32 = F8S;
+ }
+ JUMP((uintptr_t)getAlternate((void*)(addr+i32)), 0);
+ if(dyn->insts[ninst].x64.jmp_insts==-1) {
+ // out of the block
+ fpu_purgecache(dyn, ninst, 1, x1, x2, x3);
+ jump_to_next(dyn, (uintptr_t)getAlternate((void*)(addr+i32)), 0, ninst);
+ } else {
+ // inside the block
+ CacheTransform(dyn, ninst, CHECK_CACHE(), x1, x2, x3);
+ tmp = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size);
+ MESSAGE(1, "Jump to %d / 0x%x\n", tmp, tmp);
+ if(tmp==4) {
+ NOP();
+ } else {
+ B(tmp);
+ }
+ }
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+ case 0xF0:
+ addr = dynarec64_F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+ case 0xF5:
+ INST_NAME("CMC");
+ READFLAGS(X_CF);
+ SETFLAGS(X_CF, SF_SUBSET);
+ XORI(xFlags, xFlags, 1<<F_CF);
+ break;
+ case 0xF6:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ case 1:
+ INST_NAME("TEST Eb, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEB(x1, 1);
+ u8 = F8;
+ MOV32w(x2, u8);
+ emit_test8(dyn, ninst, x1, x2, x3, x4, x5);
+ break;
+ case 2:
+ INST_NAME("NOT Eb");
+ GETEB(x1, 0);
+ NOT(x1, x1);
+ EBBACK(x5, 1);
+ break;
+ case 3:
+ INST_NAME("NEG Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEB(x1, 0);
+ emit_neg8(dyn, ninst, x1, x2, x4);
+ EBBACK(x5, 0);
+ break;
+ case 4:
+ INST_NAME("MUL AL, Ed");
+ SETFLAGS(X_ALL, SF_PENDING);
+ UFLAG_DF(x1, d_mul8);
+ GETEB(x1, 0);
+ ANDI(x2, xRAX, 0xff);
+ MULW(x1, x2, x1);
+ UFLAG_RES(x1);
+ LUI(x2, 0xffff0);
+ AND(xRAX, xRAX, x2);
+ ZEXTH(x1, x1);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 5:
+ INST_NAME("IMUL AL, Eb");
+ SETFLAGS(X_ALL, SF_PENDING);
+ UFLAG_DF(x1, d_imul8);
+ GETSEB(x1, 0);
+ SLLI(x2, xRAX, 56);
+ SRAI(x2, x2, 56);
+ MULW(x1, x2, x1);
+ UFLAG_RES(x1);
+ LUI(x2, 0xffff0);
+ AND(xRAX, xRAX, x2);
+ ZEXTH(x1, x1);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 6:
+ INST_NAME("DIV Eb");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ SETFLAGS(X_ALL, SF_SET);
+ GETEB(x1, 0);
+ CALL(div8, -1);
+ break;
+ case 7:
+ INST_NAME("IDIV Eb");
+ SKIPTEST(x1);
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ SETFLAGS(X_ALL, SF_SET);
+ GETEB(x1, 0);
+ CALL(idiv8, -1);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0xF7:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ case 1:
+ INST_NAME("TEST Ed, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED(4);
+ i64 = F32S;
+ emit_test32c(dyn, ninst, rex, ed, i64, x3, x4, x5);
+ break;
+ case 2:
+ INST_NAME("NOT Ed");
+ GETED(0);
+ XORI(ed, ed, -1);
+ if(!rex.w && MODREG)
+ ZEROUP(ed);
+ WBACK;
+ break;
+ case 3:
+ INST_NAME("NEG Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED(0);
+ emit_neg32(dyn, ninst, rex, ed, x3, x4);
+ WBACK;
+ break;
+ case 4:
+ INST_NAME("MUL EAX, Ed");
+ SETFLAGS(X_ALL, SF_PENDING);
+ UFLAG_DF(x2, rex.w?d_mul64:d_mul32);
+ GETED(0);
+ if(rex.w) {
+ if(ed==xRDX) gd=x3; else gd=xRDX;
+ MULHU(gd, xRAX, ed);
+ MUL(xRAX, xRAX, ed);
+ if(gd!=xRDX) {MV(xRDX, gd);}
+ } else {
+ AND(x3, xRAX, xMASK);
+ if(MODREG) {
+ AND(x4, ed, xMASK);
+ ed = x4;
+ }
+ MUL(xRDX, x3, ed); //64 <- 32x32
+ AND(xRAX, xRDX, xMASK);
+ SRLI(xRDX, xRDX, 32);
+ }
+ UFLAG_RES(xRAX);
+ UFLAG_OP1(xRDX);
+ break;
+ case 5:
+ INST_NAME("IMUL EAX, Ed");
+ SETFLAGS(X_ALL, SF_PENDING);
+ UFLAG_DF(x2, rex.w?d_imul64:d_imul32);
+ GETSED(0);
+ if(rex.w) {
+ if(ed==xRDX) gd=x3; else gd=xRDX;
+ MULH(gd, xRAX, ed);
+ MUL(xRAX, xRAX, ed);
+ if(gd!=xRDX) {MV(xRDX, gd);}
+ } else {
+ ADDIW(x3, xRAX, 0); // sign extend 32bits-> 64bits
+ MUL(xRDX, x3, ed); //64 <- 32x32
+ AND(xRAX, xRDX, xMASK);
+ SRLI(xRDX, xRDX, 32);
+ }
+ UFLAG_RES(xRAX);
+ UFLAG_OP1(xRDX);
+ break;
+ case 6:
+ INST_NAME("DIV Ed");
+ SETFLAGS(X_ALL, SF_SET);
+ if(!rex.w) {
+ SET_DFNONE();
+ GETED(0);
+ SLLI(x3, xRDX, 32);
+ AND(x2, xRAX, xMASK);
+ OR(x3, x3, x2);
+ if(MODREG) {
+ AND(x4, ed, xMASK);
+ ed = x4;
+ }
+ DIVU(x2, x3, ed);
+ REMU(xRDX, x3, ed);
+ AND(xRAX, x2, xMASK);
+ ZEROUP(xRDX);
+ } else {
+ if(ninst
+ && dyn->insts[ninst-1].x64.addr
+ && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31
+ && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2) {
+ SET_DFNONE();
+ GETED(0);
+ DIVU(x2, xRAX, ed);
+ REMU(xRDX, xRAX, ed);
+ MV(xRAX, x2);
+ } else {
+ GETEDH(x1, 0); // get edd changed addr, so cannot be called 2 times for same op...
+ BEQ_MARK(xRDX, xZR);
+ if(ed!=x1) {MV(x1, ed);}
+ CALL(div64, -1);
+ B_NEXT_nocond;
+ MARK;
+ DIVU(x2, xRAX, ed);
+ REMU(xRDX, xRAX, ed);
+ MV(xRAX, x2);
+ SET_DFNONE();
+ }
+ }
+ break;
+ case 7:
+ INST_NAME("IDIV Ed");
+ SKIPTEST(x1);
+ SETFLAGS(X_ALL, SF_SET);
+ if(!rex.w) {
+ SET_DFNONE()
+ GETSED(0);
+ SLLI(x3, xRDX, 32);
+ AND(x2, xRAX, xMASK);
+ OR(x3, x3, x2);
+ DIV(x2, x3, ed);
+ REM(xRDX, x3, ed);
+ AND(xRAX, x2, xMASK);
+ ZEROUP(xRDX);
+ } else {
+ if(ninst && dyn->insts
+ && dyn->insts[ninst-1].x64.addr
+ && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x48
+ && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0x99) {
+ SET_DFNONE()
+ GETED(0);
+ DIV(x2, xRAX, ed);
+ REM(xRDX, xRAX, ed);
+ MV(xRAX, x2);
+ } else {
+ GETEDH(x1, 0); // get edd changed addr, so cannot be called 2 times for same op...
+ //Need to see if RDX==0 and RAX not signed
+ // or RDX==-1 and RAX signed
+ BNE_MARK2(xRDX, xZR);
+ BGE_MARK(xRAX, xZR);
+ MARK2;
+ NOT(x2, xRDX);
+ BNE_MARK3(x2, xZR);
+ BLT_MARK(xRAX, xZR);
+ MARK3;
+ if(ed!=x1) MV(x1, ed);
+ CALL((void*)idiv64, -1);
+ B_NEXT_nocond;
+ MARK;
+ DIV(x2, xRAX, ed);
+ REM(xRDX, xRAX, ed);
+ MV(xRAX, x2);
+ SET_DFNONE()
+ }
+ }
+ break;
+ default:
+ DEFAULT;
+ };
+ break;
+
+ case 0xF8:
+ INST_NAME("CLC");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE();
+ ANDI(xFlags, xFlags, ~(1 << F_CF));
+ break;
+ case 0xF9:
+ INST_NAME("STC");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE();
+ ORI(xFlags, xFlags, 1 << F_CF);
+ break;
+ case 0xFC:
+ INST_NAME("CLD");
+ ANDI(xFlags, xFlags, ~(1<<F_CF));
+ break;
+ case 0xFE:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("INC Eb");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ GETEB(x1, 0);
+ emit_inc8(dyn, ninst, ed, x2, x4, x5);
+ EBBACK(x5, 0);
+ break;
+ case 1:
+ INST_NAME("DEC Eb");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ GETEB(x1, 0);
+ emit_dec8(dyn, ninst, ed, x2, x4, x5);
+ EBBACK(x5, 0);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0xFF:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0: // INC Ed
+ INST_NAME("INC Ed");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ GETED(0);
+ emit_inc32(dyn, ninst, rex, ed, x3, x4, x5, x6);
+ WBACK;
+ break;
+ case 1: //DEC Ed
+ INST_NAME("DEC Ed");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ GETED(0);
+ emit_dec32(dyn, ninst, rex, ed, x3, x4, x5, x6);
+ WBACK;
+ break;
+ case 2: // CALL Ed
+ INST_NAME("CALL Ed");
+ PASS2IF((box64_dynarec_safeflags>1) ||
+ ((ninst && dyn->insts[ninst-1].x64.set_flags)
+ || ((ninst>1) && dyn->insts[ninst-2].x64.set_flags)), 1)
+ {
+ READFLAGS(X_PEND); // that's suspicious
+ } else {
+ SETFLAGS(X_ALL, SF_SET); //Hack to put flag in "don't care" state
+ }
+ GETEDz(0);
+ if(box64_dynarec_callret && box64_dynarec_bigblock>1) {
+ BARRIER(BARRIER_FULL);
+ } else {
+ BARRIER(BARRIER_FLOAT);
+ *need_epilog = 0;
+ *ok = 0;
+ }
+ GETIP_(addr);
+ // TODO: Add suport for CALLRET optim
+ /*if(box64_dynarec_callret) {
+ // Push actual return address
+ if(addr < (dyn->start+dyn->isize)) {
+ // there is a next...
+ j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0;
+ ADR_S20(x4, j64);
+ } else {
+ j64 = getJumpTableAddress64(addr);
+ TABLE64(x4, j64);
+ LDRx_U12(x4, x4, 0);
+ }
+ STPx_S7_preindex(x4, xRIP, xSP, -16);
+ }*/
+ PUSH1z(xRIP);
+ jump_to_next(dyn, 0, ed, ninst);
+ break;
+ case 4: // JMP Ed
+ INST_NAME("JMP Ed");
+ READFLAGS(X_PEND);
+ BARRIER(BARRIER_FLOAT);
+ GETEDz(0);
+ jump_to_next(dyn, 0, ed, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+ case 5: // JMP FAR Ed
+ if(MODREG) {
+ DEFAULT;
+ } else {
+ INST_NAME("JMP FAR Ed");
+ READFLAGS(X_PEND);
+ BARRIER(BARRIER_FLOAT);
+ SMREAD()
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 0, 0);
+ LDxw(x1, wback, 0);
+ ed = x1;
+ LHU(x3, wback, rex.w?8:4);
+ SW(x3, xEmu, offsetof(x64emu_t, segs[_CS]));
+ SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_CS]));
+ jump_to_epilog(dyn, 0, ed, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ }
+ break;
+ case 6: // Push Ed
+ INST_NAME("PUSH Ed");
+ GETEDz(0);
+ PUSH1z(ed);
+ break;
+
+ default:
+ DEFAULT;
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_0f.c b/src/dynarec/rv64/dynarec_rv64_0f.c
new file mode 100644
index 0000000..199068c
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_0f.c
@@ -0,0 +1,1742 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+#include "my_cpuid.h"
+#include "emu/x87emu_private.h"
+#include "bitutils.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog)
+{
+ (void)ip; (void)need_epilog;
+
+ uint8_t opcode = F8;
+ uint8_t nextop, u8;
+ uint8_t gd, ed;
+ uint8_t wback, wb2, gback;
+ uint8_t eb1, eb2;
+ int32_t i32, i32_;
+ int cacheupd = 0;
+ int v0, v1;
+ int q0, q1;
+ int d0, d1;
+ int s0, s1;
+ uint64_t tmp64u;
+ int64_t j64;
+ int64_t fixedaddress, gdoffset;
+ int unscaled;
+ MAYUSE(wb2);
+ MAYUSE(gback);
+ MAYUSE(eb1);
+ MAYUSE(eb2);
+ MAYUSE(q0);
+ MAYUSE(q1);
+ MAYUSE(d0);
+ MAYUSE(d1);
+ MAYUSE(s0);
+ MAYUSE(j64);
+ MAYUSE(cacheupd);
+
+ switch(opcode) {
+
+ case 0x01:
+ INST_NAME("FAKE xgetbv");
+ nextop = F8;
+ addr = fakeed(dyn, addr, ninst, nextop);
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL();
+ CALL(native_ud, -1);
+ LOAD_XEMU_CALL();
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+
+ case 0x05:
+ INST_NAME("SYSCALL");
+ NOTEST(x1);
+ SMEND();
+ GETIP(addr);
+ STORE_XEMU_CALL();
+ CALL_S(x64Syscall, -1);
+ LOAD_XEMU_CALL();
+ TABLE64(x3, addr); // expected return address
+ BNE_MARK(xRIP, x3);
+ LW(w1, xEmu, offsetof(x64emu_t, quit));
+ CBZ_NEXT(w1);
+ MARK;
+ LOAD_XEMU_REM();
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ break;
+
+ case 0x09:
+ INST_NAME("WBINVD");
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL();
+ CALL(native_ud, -1);
+ LOAD_XEMU_CALL();
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+
+ case 0x0B:
+ INST_NAME("UD2");
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL();
+ CALL(native_ud, -1);
+ LOAD_XEMU_CALL();
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+
+ case 0x0D:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 1:
+ INST_NAME("PREFETCHW");
+ // nop without Zicbom, Zicbop, Zicboz extensions
+ FAKEED;
+ break;
+ default: //???
+ DEFAULT;
+ }
+ break;
+
+ case 0x10:
+ INST_NAME("MOVUPS Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LD(x3, wback, fixedaddress+0);
+ LD(x4, wback, fixedaddress+8);
+ SD(x3, gback, gdoffset+0);
+ SD(x4, gback, gdoffset+8);
+ break;
+ case 0x11:
+ INST_NAME("MOVUPS Ex,Gx");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LD(x3, gback, gdoffset+0);
+ LD(x4, gback, gdoffset+8);
+ SD(x3, wback, fixedaddress+0);
+ SD(x4, wback, fixedaddress+8);
+ if(!MODREG)
+ SMWRITE2();
+ break;
+ case 0x12:
+ nextop = F8;
+ if(MODREG) {
+ INST_NAME("MOVHLPS Gx,Ex");
+ GETGX();
+ GETEX(x2, 0);
+ LD(x3, wback, fixedaddress+8);
+ SD(x3, gback, gdoffset+0);
+ } else {
+ INST_NAME("MOVLPS Gx,Ex");
+ GETEXSD(v0, 0);
+ GETGXSD_empty(v1);
+ FMVD(v1, v0);
+ }
+ break;
+ case 0x13:
+ INST_NAME("MOVLPS Ex,Gx");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LD(x3, gback, gdoffset+0);
+ SD(x3, wback, fixedaddress+0);
+ if(!MODREG)
+ SMWRITE2();
+ break;
+ case 0x14:
+ INST_NAME("UNPCKLPS Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LWU(x5, gback, gdoffset+1*4);
+ LWU(x3, wback, fixedaddress+0);
+ LWU(x4, wback, fixedaddress+4);
+ SW(x4, gback, gdoffset+3*4);
+ SW(x5, gback, gdoffset+2*4);
+ SW(x3, gback, gdoffset+1*4);
+ break;
+ case 0x15:
+ INST_NAME("UNPCKHPS Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LWU(x3, wback, fixedaddress+2*4);
+ LWU(x4, wback, fixedaddress+3*4);
+ LWU(x5, gback, gdoffset+2*4);
+ LWU(x6, gback, gdoffset+3*4);
+ SW(x5, gback, gdoffset+0*4);
+ SW(x3, gback, gdoffset+1*4);
+ SW(x6, gback, gdoffset+2*4);
+ SW(x4, gback, gdoffset+3*4);
+ break;
+ case 0x16:
+ nextop = F8;
+ if(MODREG) {
+ INST_NAME("MOVLHPS Gx,Ex");
+ } else {
+ INST_NAME("MOVHPS Gx,Ex");
+ SMREAD();
+ }
+ GETGX();
+ GETEX(x2, 0);
+ LD(x4, wback, fixedaddress+0);
+ SD(x4, gback, gdoffset+8);
+ break;
+ case 0x17:
+ INST_NAME("MOVHPS Ex,Gx");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LD(x4, gback, gdoffset+8);
+ SD(x4, wback, fixedaddress+0);
+ if(!MODREG)
+ SMWRITE2();
+ break;
+ case 0x18:
+ nextop = F8;
+ if((nextop&0xC0)==0xC0) {
+ INST_NAME("NOP (multibyte)");
+ } else
+ switch((nextop>>3)&7) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ INST_NAME("PREFETCHh Ed");
+ FAKEED;
+ break;
+ default:
+ INST_NAME("NOP (multibyte)");
+ FAKEED;
+ }
+ break;
+
+ case 0x1F:
+ INST_NAME("NOP (multibyte)");
+ nextop = F8;
+ FAKEED;
+ break;
+
+ case 0x28:
+ INST_NAME("MOVAPS Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_MV_Q(x3);
+ break;
+ case 0x29:
+ INST_NAME("MOVAPS Ex,Gx");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_MV_Q2(x3);
+ if(!MODREG)
+ SMWRITE2();
+ break;
+
+ case 0x2B:
+ INST_NAME("MOVNTPS Ex,Gx");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LD(x3, gback, gdoffset+0);
+ LD(x4, gback, gdoffset+8);
+ SD(x3, wback, fixedaddress+0);
+ SD(x4, wback, fixedaddress+8);
+ break;
+ case 0x2E:
+ // no special check...
+ case 0x2F:
+ if(opcode==0x2F) {INST_NAME("COMISS Gx, Ex");} else {INST_NAME("UCOMISS Gx, Ex");}
+ SETFLAGS(X_ALL, SF_SET);
+ SET_DFNONE();
+ nextop = F8;
+ GETGXSS(d0);
+ GETEXSS(v0, 0);
+ CLEAR_FLAGS();
+ // if isnan(d0) || isnan(v0)
+ IFX(X_ZF | X_PF | X_CF) {
+ FEQS(x3, d0, d0);
+ FEQS(x2, v0, v0);
+ AND(x2, x2, x3);
+ BNE_MARK(x2, xZR);
+ ORI(xFlags, xFlags, (1<<F_ZF) | (1<<F_PF) | (1<<F_CF));
+ B_NEXT_nocond;
+ }
+ MARK;
+ // else if isless(d0, v0)
+ IFX(X_CF) {
+ FLTS(x2, d0, v0);
+ BEQ_MARK2(x2, xZR);
+ ORI(xFlags, xFlags, 1<<F_CF);
+ B_NEXT_nocond;
+ }
+ MARK2;
+ // else if d0 == v0
+ IFX(X_ZF) {
+ FEQS(x2, d0, v0);
+ CBZ_NEXT(x2);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ }
+ break;
+ case 0x31:
+ INST_NAME("RDTSC");
+ NOTEST(x1);
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ CALL(ReadTSC, x3); // will return the u64 in x3
+ SRLI(xRDX, x3, 32);
+ AND(xRAX, x3, 32); // wipe upper part
+ break;
+ case 0x38:
+ //SSE3
+ nextop=F8;
+ switch(nextop) {
+ case 0xF0:
+ INST_NAME("MOVBE Gd, Ed");
+ nextop=F8;
+ GETGD;
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ LDxw(gd, ed, fixedaddress);
+ if (rv64_zbb) {
+ REV8(gd, gd);
+ if (!rex.w) {
+ SRLI(gd, gd, 32);
+ }
+ } else {
+ if (rex.w) {
+ MOV_U12(x2, 0xff);
+ SLLI(x1, gd, 56);
+ SRLI(x3, gd, 56);
+ SRLI(x4, gd, 40);
+ SLLI(x2, x2, 8);
+ AND(x4, x4, x2);
+ OR(x1, x1, x3);
+ OR(x1, x1, x4);
+ SLLI(x3, gd, 40);
+ SLLI(x4, x2, 40);
+ AND(x3, x3, x4);
+ OR(x1, x1, x3);
+
+ SRLI(x3, gd, 24);
+ SLLI(x4, x2, 8);
+ AND(x3, x3, x4);
+ OR(x1, x1, x3);
+ SLLI(x3, gd, 24);
+ SLLI(x4, x2, 32);
+ AND(x3, x3, x4);
+ OR(x1, x1, x3);
+
+ SRLI(x3, gd, 8);
+ SLLI(x4, x2, 16);
+ AND(x3, x3, x4);
+ OR(x1, x1, x3);
+ SLLI(x3, gd, 8);
+ SLLI(x4, x2, 24);
+ AND(x3, x3, x4);
+ OR(gd, x1, x3);
+ } else {
+ MOV_U12(x2, 0xff);
+ SLLIW(x2, x2, 8);
+ SLLIW(x1, gd, 24);
+ SRLIW(x3, gd, 24);
+ SRLIW(x4, gd, 8);
+ AND(x4, x4, x2);
+ OR(x1, x1, x3);
+ OR(x1, x1, x4);
+ SLLIW(gd, gd, 8);
+ LUI(x2, 0xff0);
+ AND(gd, gd, x2);
+ OR(gd, gd, x1);
+ }
+ }
+ break;
+ case 0xF1:
+ INST_NAME("MOVBE Ed, Gd");
+ nextop=F8;
+ GETGD;
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ if (rv64_zbb) {
+ REV8(x1, gd);
+ if (!rex.w) {
+ SRLI(x1, x1, 32);
+ }
+ } else {
+ if (rex.w) {
+ MOV_U12(x2, 0xff);
+ SLLI(x1, gd, 56);
+ SRLI(x3, gd, 56);
+ SRLI(x4, gd, 40);
+ SLLI(x2, x2, 8);
+ AND(x4, x4, x2);
+ OR(x1, x1, x3);
+ OR(x1, x1, x4);
+ SLLI(x3, gd, 40);
+ SLLI(x4, x2, 40);
+ AND(x3, x3, x4);
+ OR(x1, x1, x3);
+
+ SRLI(x3, gd, 24);
+ SLLI(x4, x2, 8);
+ AND(x3, x3, x4);
+ OR(x1, x1, x3);
+ SLLI(x3, gd, 24);
+ SLLI(x4, x2, 32);
+ AND(x3, x3, x4);
+ OR(x1, x1, x3);
+
+ SRLI(x3, gd, 8);
+ SLLI(x4, x2, 16);
+ AND(x3, x3, x4);
+ OR(x1, x1, x3);
+ SLLI(x3, gd, 8);
+ SLLI(x4, x2, 24);
+ AND(x3, x3, x4);
+ OR(x1, x1, x3);
+ } else {
+ MOV_U12(x2, 0xff);
+ SLLIW(x2, x2, 8);
+ SLLIW(x1, gd, 24);
+ SRLIW(x3, gd, 24);
+ SRLIW(x4, gd, 8);
+ AND(x4, x4, x2);
+ OR(x1, x1, x3);
+ OR(x1, x1, x4);
+ SLLIW(x3, gd, 8);
+ LUI(x2, 0xff0);
+ AND(x3, x3, x2);
+ OR(x1, x1, x3);
+ }
+ }
+ SDxw(x1, wback, fixedaddress);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
+ #define GO(GETFLAGS, NO, YES, F) \
+ READFLAGS(F); \
+ GETFLAGS; \
+ nextop=F8; \
+ GETGD; \
+ if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ B##NO(x1, 8); \
+ MV(gd, ed); \
+ } else { \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x4, &fixedaddress, rex, NULL, 1, 0); \
+ B##NO(x1, 8); \
+ LDxw(gd, ed, fixedaddress); \
+ } \
+ if(!rex.w) ZEROUP(gd);
+
+ GOCOND(0x40, "CMOV", "Gd, Ed");
+ #undef GO
+ case 0x50:
+ INST_NAME("MOVMSKPS Gd, Ex");
+ nextop = F8;
+ GETGD;
+ GETEX(x1, 0);
+ XOR(gd, gd, gd);
+ for(int i=0; i<4; ++i) {
+ LWU(x2, wback, fixedaddress+i*4);
+ SRLI(x2, x2, 31-i);
+ if (i>0) ANDI(x2, x2, 1<<i);
+ OR(gd, gd, x2);
+ }
+ break;
+ case 0x51:
+ INST_NAME("SQRTPS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ d0 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ FLW(d0, wback, fixedaddress+4*i);
+ FSQRTS(d0, d0);
+ FSW(d0, gback, gdoffset+4*i);
+ }
+ break;
+ case 0x52:
+ INST_NAME("RSQRTPS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ s0 = fpu_get_scratch(dyn);
+ s1 = fpu_get_scratch(dyn); // 1.0f
+ v0 = fpu_get_scratch(dyn); // 0.0f
+ // do accurate computation, because riscv doesn't have rsqrt
+ MOV32w(x3, 1);
+ FCVTSW(s1, x3, RD_DYN);
+ if (!box64_dynarec_fastnan) {
+ FCVTSW(v0, xZR, RD_DYN);
+ }
+ for(int i=0; i<4; ++i) {
+ FLW(s0, wback, fixedaddress+i*4);
+ if (!box64_dynarec_fastnan) {
+ FLES(x3, v0, s0); // s0 >= 0.0f?
+ BNEZ(x3, 6*4);
+ FEQS(x3, s0, s0); // isnan(s0)?
+ BEQZ(x3, 2*4);
+ // s0 is negative, so generate a NaN
+ FDIVS(s0, s1, v0);
+ // s0 is a NaN, just copy it
+ FSW(s0, gback, gdoffset+i*4);
+ J(4*4);
+ // do regular computation
+ }
+ FSQRTS(s0, s0);
+ FDIVS(s0, s1, s0);
+ FSW(s0, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x53:
+ INST_NAME("RCPPS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ d0 = fpu_get_scratch(dyn);
+ d1 = fpu_get_scratch(dyn);
+ LUI(x3, 0x3f800);
+ FMVWX(d0, x3); // 1.0f
+ for(int i=0; i<4; ++i) {
+ FLW(d1, wback, fixedaddress+4*i);
+ FDIVS(d1, d0, d1);
+ FSW(d1, gback, gdoffset+4*i);
+ }
+ break;
+ case 0x54:
+ INST_NAME("ANDPS Gx, Ex");
+ nextop = F8;
+ gd = ((nextop&0x38)>>3)+(rex.r<<3);
+ if(!(MODREG && gd==(nextop&7)+(rex.b<<3))) {
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, AND(x3, x3, x4));
+ }
+ break;
+ case 0x55:
+ INST_NAME("ANDNPS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, NOT(x3, x3); AND(x3, x3, x4));
+ break;
+ case 0x56:
+ INST_NAME("ORPS Gx, Ex");
+ nextop = F8;
+ gd = ((nextop&0x38)>>3)+(rex.r<<3);
+ if(!(MODREG && gd==(nextop&7)+(rex.b<<3))) {
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, OR(x3, x3, x4));
+ }
+ break;
+ case 0x57:
+ INST_NAME("XORPS Gx, Ex");
+ nextop = F8;
+ //TODO: it might be possible to check if SS or SD are used and not purge them to optimize a bit
+ GETGX();
+ if(MODREG && gd==(nextop&7)+(rex.b<<3))
+ {
+ // just zero dest
+ SD(xZR, gback, gdoffset+0);
+ SD(xZR, gback, gdoffset+8);
+ } else {
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4));
+ }
+ break;
+ case 0x58:
+ INST_NAME("ADDPS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ s0 = fpu_get_scratch(dyn);
+ s1 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ // GX->f[i] += EX->f[i];
+ FLW(s0, wback, fixedaddress+i*4);
+ FLW(s1, gback, gdoffset+i*4);
+ FADDS(s1, s1, s0);
+ FSW(s1, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x59:
+ INST_NAME("MULPS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ s0 = fpu_get_scratch(dyn);
+ s1 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ // GX->f[i] *= EX->f[i];
+ FLW(s0, wback, fixedaddress+i*4);
+ FLW(s1, gback, gdoffset+i*4);
+ FMULS(s1, s1, s0);
+ FSW(s1, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x5A:
+ INST_NAME("CVTPS2PD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ s0 = fpu_get_scratch(dyn);
+ s1 = fpu_get_scratch(dyn);
+ FLW(s0, wback, fixedaddress);
+ FLW(s1, wback, fixedaddress+4);
+ FCVTDS(s0, s0);
+ FCVTDS(s1, s1);
+ FSD(s0, gback, gdoffset+0);
+ FSD(s1, gback, gdoffset+8);
+ break;
+ case 0x5B:
+ INST_NAME("CVTDQ2PS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ s0 = fpu_get_scratch(dyn);
+ for (int i=0; i<4; ++i) {
+ LW(x3, wback, fixedaddress+i*4);
+ FCVTSW(s0, x3, RD_RNE);
+ FSW(s0, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x5C:
+ INST_NAME("SUBPS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ s0 = fpu_get_scratch(dyn);
+ s1 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ // GX->f[i] -= EX->f[i];
+ FLW(s0, wback, fixedaddress+i*4);
+ FLW(s1, gback, gdoffset+i*4);
+ FSUBS(s1, s1, s0);
+ FSW(s1, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x5D:
+ INST_NAME("MINPS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ s0 = fpu_get_scratch(dyn);
+ s1 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ FLW(s0, wback, fixedaddress+i*4);
+ FLW(s1, gback, gdoffset+i*4);
+ if(!box64_dynarec_fastnan) {
+ FEQS(x3, s0, s0);
+ FEQS(x4, s1, s1);
+ AND(x3, x3, x4);
+ BEQZ(x3, 12);
+ FLTS(x3, s0, s1);
+ BEQZ(x3, 8);
+ FSW(s0, gback, gdoffset+i*4);
+ } else {
+ FMINS(s1, s1, s0);
+ FSW(s1, gback, gdoffset+i*4);
+ }
+ }
+ break;
+ case 0x5E:
+ INST_NAME("DIVPS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ s0 = fpu_get_scratch(dyn);
+ s1 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ // GX->f[i] /= EX->f[i];
+ FLW(s0, wback, fixedaddress+i*4);
+ FLW(s1, gback, gdoffset+i*4);
+ FDIVS(s1, s1, s0);
+ FSW(s1, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x5F:
+ INST_NAME("MAXPS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ s0 = fpu_get_scratch(dyn);
+ s1 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ FLW(s0, wback, fixedaddress+i*4);
+ FLW(s1, gback, gdoffset+i*4);
+ if(!box64_dynarec_fastnan) {
+ FEQS(x3, s0, s0);
+ FEQS(x4, s1, s1);
+ AND(x3, x3, x4);
+ BEQZ(x3, 12);
+ FLTS(x3, s1, s0);
+ BEQZ(x3, 8);
+ FSW(s0, gback, gdoffset+i*4);
+ } else {
+ FMAXS(s1, s1, s0);
+ FSW(s1, gback, gdoffset+i*4);
+ }
+ }
+ break;
+ case 0x60:
+ INST_NAME("PUNPCKLBW Gm,Em");
+ nextop = F8;
+ GETGM();
+ for(int i=3; i>0; --i) { // 0 is untouched
+ // GX->ub[2 * i] = GX->ub[i];
+ LBU(x3, gback, gdoffset+i);
+ SB(x3, gback, gdoffset+2*i);
+ }
+ if (MODREG && gd==(nextop&7)) {
+ for(int i=0; i<4; ++i) {
+ // GX->ub[2 * i + 1] = GX->ub[2 * i];
+ LBU(x3, gback, gdoffset+2*i);
+ SB(x3, gback, gdoffset+2*i+1);
+ }
+ } else {
+ GETEM(x2, 0);
+ for(int i=0; i<4; ++i) {
+ // GX->ub[2 * i + 1] = EX->ub[i];
+ LBU(x3, wback, fixedaddress+i);
+ SB(x3, gback, gdoffset+2*i+1);
+ }
+ }
+ break;
+ case 0x61:
+ INST_NAME("PUNPCKLWD Gm, Em");
+ nextop = F8;
+ GETGM();
+ GETEM(x2, 0);
+ // GM->uw[3] = EM->uw[1];
+ LHU(x3, wback, fixedaddress+2*1);
+ SH(x3, gback, gdoffset+2*3);
+ // GM->uw[2] = GM->uw[1];
+ LHU(x3, gback, gdoffset+2*1);
+ SH(x3, gback, gdoffset+2*2);
+ // GM->uw[1] = EM->uw[0];
+ LHU(x3, wback, fixedaddress+2*0);
+ SH(x3, gback, gdoffset+2*1);
+ break;
+ case 0x62:
+ INST_NAME("PUNPCKLDQ Gm, Em");
+ nextop = F8;
+ GETGM();
+ GETEM(x2, 0);
+ // GM->ud[1] = EM->ud[0];
+ LWU(x3, wback, fixedaddress);
+ SW(x3, gback, gdoffset+4*1);
+ break;
+ case 0x67:
+ INST_NAME("PACKUSWB Gm, Em");
+ nextop = F8;
+ GETGM();
+ ADDI(x5, xZR, 0xFF);
+ for(int i=0; i<4; ++i) {
+ // GX->ub[i] = (GX->sw[i]<0)?0:((GX->sw[i]>0xff)?0xff:GX->sw[i]);
+ LH(x3, gback, gdoffset+i*2);
+ BGE(x5, x3, 8);
+ ADDI(x3, xZR, 0xFF);
+ NOT(x4, x3);
+ SRAI(x4, x4, 63);
+ AND(x3, x3, x4);
+ SB(x3, gback, gdoffset+i);
+ }
+ if (MODREG && gd==(nextop&7)) {
+ // GM->ud[1] = GM->ud[0];
+ LW(x3, gback, gdoffset+0*4);
+ SW(x3, gback, gdoffset+1*4);
+ } else {
+ GETEM(x1, 0);
+ for(int i=0; i<4; ++i) {
+ // GX->ub[4+i] = (EX->sw[i]<0)?0:((EX->sw[i]>0xff)?0xff:EX->sw[i]);
+ LH(x3, wback, fixedaddress+i*2);
+ BGE(x5, x3, 8);
+ ADDI(x3, xZR, 0xFF);
+ NOT(x4, x3);
+ SRAI(x4, x4, 63);
+ AND(x3, x3, x4);
+ SB(x3, gback, gdoffset+4+i);
+ }
+ }
+ break;
+ case 0x68:
+ INST_NAME("PUNPCKHBW Gm,Em");
+ nextop = F8;
+ GETGM();
+ for(int i=0; i<4; ++i) {
+ // GX->ub[2 * i] = GX->ub[i + 4];
+ LBU(x3, gback, gdoffset+i+4);
+ SB(x3, gback, gdoffset+2*i);
+ }
+ if (MODREG && gd==(nextop&7)) {
+ for(int i=0; i<4; ++i) {
+ // GX->ub[2 * i + 1] = GX->ub[2 * i];
+ LBU(x3, gback, gdoffset+2*i);
+ SB(x3, gback, gdoffset+2*i+1);
+ }
+ } else {
+ GETEM(x2, 0);
+ for(int i=0; i<4; ++i) {
+ // GX->ub[2 * i + 1] = EX->ub[i + 4];
+ LBU(x3, wback, fixedaddress+i+4);
+ SB(x3, gback, gdoffset+2*i+1);
+ }
+ }
+ break;
+ case 0x69:
+ INST_NAME("PUNPCKHWD Gm,Em");
+ nextop = F8;
+ GETGM();
+ for(int i=0; i<2; ++i) {
+ // GX->uw[2 * i] = GX->uw[i + 2];
+ LHU(x3, gback, gdoffset+(i+2)*2);
+ SH(x3, gback, gdoffset+2*i*2);
+ }
+ if (MODREG && gd==(nextop&7)) {
+ for(int i=0; i<2; ++i) {
+ // GX->uw[2 * i + 1] = GX->uw[2 * i];
+ LHU(x3, gback, gdoffset+2*i*2);
+ SH(x3, gback, gdoffset+(2*i+1)*2);
+ }
+ } else {
+ GETEM(x1, 0);
+ for(int i=0; i<2; ++i) {
+ // GX->uw[2 * i + 1] = EX->uw[i + 2];
+ LHU(x3, wback, fixedaddress+(i+2)*2);
+ SH(x3, gback, gdoffset+(2*i+1)*2);
+ }
+ }
+ break;
+ case 0x6A:
+ INST_NAME("PUNPCKHDQ Gm,Em");
+ nextop = F8;
+ GETEM(x1, 0);
+ GETGM();
+ // GM->ud[0] = GM->ud[1];
+ LWU(x3, gback, gdoffset+1*4);
+ SW(x3, gback, gdoffset+0*4);
+ if (!(MODREG && (gd==ed))) {
+ // GM->ud[1] = EM->ud[1];
+ LWU(x3, wback, fixedaddress+1*4);
+ SW(x3, gback, gdoffset+1*4);
+ }
+ break;
+ case 0x6E:
+ INST_NAME("MOVD Gm, Ed");
+ nextop = F8;
+ GETGM();
+ if(MODREG) {
+ ed = xRAX + (nextop&7) + (rex.b<<3);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 1, 0);
+ if(rex.w) {
+ LD(x4, ed, fixedaddress);
+ } else {
+ LW(x4, ed, fixedaddress);
+ }
+ ed = x4;
+ }
+ if(rex.w) SD(ed, gback, gdoffset+0); else SW(ed, gback, gdoffset+0);
+ break;
+ case 0x6F:
+ INST_NAME("MOVQ Gm, Em");
+ nextop = F8;
+ GETGM();
+ GETEM(x2, 0);
+ LD(x3, wback, fixedaddress);
+ SD(x3, gback, gdoffset+0);
+ break;
+ case 0x71:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 2:
+ INST_NAME("PSRLW Em, Ib");
+ GETEM(x1, 1);
+ u8 = F8;
+ if (u8>15) {
+ // just zero dest
+ SD(xZR, wback, fixedaddress);
+ } else if(u8) {
+ for (int i=0; i<4; ++i) {
+ // EX->uw[i] >>= u8;
+ LHU(x3, wback, fixedaddress+i*2);
+ SRLI(x3, x3, u8);
+ SH(x3, wback, fixedaddress+i*2);
+ }
+ }
+ break;
+ case 4:
+ INST_NAME("PSRAW Em, Ib");
+ GETEM(x1, 1);
+ u8 = F8;
+ if(u8>15) u8=15;
+ if(u8) {
+ for (int i=0; i<4; ++i) {
+ // EX->sw[i] >>= u8;
+ LH(x3, wback, fixedaddress+i*2);
+ SRAI(x3, x3, u8);
+ SH(x3, wback, fixedaddress+i*2);
+ }
+ }
+ break;
+ case 6:
+ INST_NAME("PSLLW Em, Ib");
+ GETEM(x1, 1);
+ u8 = F8;
+ if (u8>15) {
+ // just zero dest
+ SD(xZR, wback, fixedaddress+0);
+ } else if(u8) {
+ for (int i=0; i<4; ++i) {
+ // EX->uw[i] <<= u8;
+ LHU(x3, wback, fixedaddress+i*2);
+ SLLI(x3, x3, u8);
+ SH(x3, wback, fixedaddress+i*2);
+ }
+ }
+ break;
+ default:
+ *ok = 0;
+ DEFAULT;
+ }
+ break;
+ case 0x75:
+ INST_NAME("PCMPEQW Gm,Em");
+ nextop = F8;
+ GETGM();
+ GETEM(x2, 0);
+ MMX_LOOP_W(x3, x4, SUB(x3, x3, x4); SEQZ(x3, x3); NEG(x3, x3));
+ break;
+ case 0x77:
+ INST_NAME("EMMS");
+ // empty MMX, FPU now usable
+ mmx_purgecache(dyn, ninst, 0, x1);
+ /*emu->top = 0;
+ emu->fpu_stack = 0;*/ //TODO: Check if something is needed here?
+ break;
+ case 0x7F:
+ INST_NAME("MOVQ Em, Gm");
+ nextop = F8;
+ GETGM();
+ GETEM(x2, 0);
+ LD(x3, gback, gdoffset+0);
+ SD(x3, wback, fixedaddress);
+ break;
+ #define GO(GETFLAGS, NO, YES, F) \
+ READFLAGS(F); \
+ i32_ = F32S; \
+ BARRIER(BARRIER_MAYBE); \
+ JUMP(addr+i32_, 1); \
+ GETFLAGS; \
+ if(dyn->insts[ninst].x64.jmp_insts==-1 || \
+ CHECK_CACHE()) { \
+ /* out of the block */ \
+ i32 = dyn->insts[ninst].epilog-(dyn->native_size); \
+ B##NO##_safe(x1, i32); \
+ if(dyn->insts[ninst].x64.jmp_insts==-1) { \
+ if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \
+ fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \
+ jump_to_next(dyn, addr+i32_, 0, ninst); \
+ } else { \
+ CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \
+ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \
+ B(i32); \
+ } \
+ } else { \
+ /* inside the block */ \
+ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \
+ B##YES##_safe(x1, i32); \
+ }
+
+ GOCOND(0x80, "J", "Id");
+ #undef GO
+
+ #define GO(GETFLAGS, NO, YES, F) \
+ READFLAGS(F); \
+ GETFLAGS; \
+ nextop=F8; \
+ S##YES(x3, x1); \
+ if(MODREG) { \
+ if(rex.rex) { \
+ eb1= xRAX+(nextop&7)+(rex.b<<3); \
+ eb2 = 0; \
+ } else { \
+ ed = (nextop&7); \
+ eb2 = (ed>>2)*8; \
+ eb1 = xRAX+(ed&3); \
+ } \
+ if (eb2) { \
+ LUI(x1, 0xffff0); \
+ ORI(x1, x1, 0xff); \
+ AND(eb1, eb1, x1); \
+ SLLI(x3, x3, 8); \
+ } else { \
+ ANDI(eb1, eb1, 0xf00); \
+ } \
+ OR(eb1, eb1, x3); \
+ } else { \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress,rex, NULL, 1, 0); \
+ SB(x3, ed, fixedaddress); \
+ SMWRITE(); \
+ }
+
+ GOCOND(0x90, "SET", "Eb");
+ #undef GO
+
+ case 0xA2:
+ INST_NAME("CPUID");
+ NOTEST(x1);
+ MV(A1, xRAX);
+ CALL_(my_cpuid, -1, 0);
+ // BX and DX are not synchronized durring the call, so need to force the update
+ LD(xRDX, xEmu, offsetof(x64emu_t, regs[_DX]));
+ LD(xRBX, xEmu, offsetof(x64emu_t, regs[_BX]));
+ break;
+ case 0xA3:
+ INST_NAME("BT Ed, Gd");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE();
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0);
+ SRAIxw(x1, gd, 5+rex.w); // r1 = (gd>>5)
+ SLLI(x1, x1, 2+rex.w);
+ ADD(x3, wback, x1); //(&ed)+=r1*4;
+ LDxw(x1, x3, fixedaddress);
+ ed = x1;
+ }
+ ANDI(x2, gd, rex.w?0x3f:0x1f);
+ SRL(x4, ed, x2);
+ ANDI(x4, x4, 1);
+ ANDI(xFlags, xFlags, ~1); //F_CF is 1
+ OR(xFlags, xFlags, x4);
+ break;
+ case 0xA4:
+ nextop = F8;
+ INST_NAME("SHLD Ed, Gd, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED(1);
+ GETGD;
+ u8 = F8;
+ emit_shld32c(dyn, ninst, rex, ed, gd, u8, x3, x4, x5);
+ WBACK;
+ break;
+ case 0xAB:
+ INST_NAME("BTS Ed, Gd");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE();
+ nextop = F8;
+ GETGD;
+ if (MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ wback = 0;
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0);
+ SRAI(x1, gd, 5+rex.w);
+ SLLI(x1, x1, 2+rex.w);
+ ADD(x3, wback, x1);
+ LDxw(x1, x3, fixedaddress);
+ ed = x1;
+ wback = x3;
+ }
+ if (rex.w) {
+ ANDI(x2, gd, 0x3f);
+ } else {
+ ANDI(x2, gd, 0x1f);
+ }
+ SRL(x4, ed, x2);
+ ANDI(x4, x4, 1); // F_CF is 1
+ ANDI(xFlags, xFlags, ~1);
+ OR(xFlags, xFlags, x4);
+ ADDI(x3, xZR, 1);
+ SLL(x3, x3, x2);
+ OR(ed, ed, x3);
+ if(wback) {
+ SDxw(ed, wback, fixedaddress);
+ SMWRITE();
+ }
+ break;
+ case 0xAC:
+ nextop = F8;
+ INST_NAME("SHRD Ed, Gd, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED(1);
+ GETGD;
+ u8 = F8;
+ u8&=(rex.w?0x3f:0x1f);
+ emit_shrd32c(dyn, ninst, rex, ed, gd, u8, x3, x4);
+ WBACK;
+ break;
+ case 0xAE:
+ nextop = F8;
+ if((nextop&0xF8)==0xE8) {
+ INST_NAME("LFENCE");
+ SMDMB();
+ } else
+ if((nextop&0xF8)==0xF0) {
+ INST_NAME("MFENCE");
+ SMDMB();
+ } else
+ if((nextop&0xF8)==0xF8) {
+ INST_NAME("SFENCE");
+ SMDMB();
+ } else {
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("FXSAVE Ed");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ SKIPTEST(x1);
+ fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
+ if(MODREG) {
+ DEFAULT;
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x3, &fixedaddress, rex, NULL, 0, 0);
+ if(ed!=x1) {MV(x1, ed);}
+ CALL(rex.w?((void*)fpu_fxsave64):((void*)fpu_fxsave32), -1);
+ }
+ break;
+ case 1:
+ INST_NAME("FXRSTOR Ed");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ SKIPTEST(x1);
+ fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
+ if(MODREG) {
+ DEFAULT;
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x3, &fixedaddress, rex, NULL, 0, 0);
+ if(ed!=x1) {MV(x1, ed);}
+ CALL(rex.w?((void*)fpu_fxrstor64):((void*)fpu_fxrstor32), -1);
+ }
+ break;
+ case 2:
+ INST_NAME("LDMXCSR Md");
+ GETED(0);
+ SW(ed, xEmu, offsetof(x64emu_t, mxcsr));
+ if(box64_sse_flushto0) {
+ // TODO: applyFlushTo0 also needs to add RISC-V support.
+ }
+ break;
+ case 3:
+ INST_NAME("STMXCSR Md");
+ addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0);
+ LWU(x4, xEmu, offsetof(x64emu_t, mxcsr));
+ SW(x4, wback, fixedaddress);
+ break;
+ case 7:
+ INST_NAME("CLFLUSH Ed");
+ MESSAGE(LOG_DUMP, "Need Optimization?\n");
+ addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0);
+ if(wback!=A1) {
+ MV(A1, wback);
+ }
+ CALL_(native_clflush, -1, 0);
+ break;
+ default:
+ DEFAULT;
+ }
+ }
+ break;
+ case 0xAF:
+ INST_NAME("IMUL Gd, Ed");
+ SETFLAGS(X_ALL, SF_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED(0);
+ if(rex.w) {
+ // 64bits imul
+ UFLAG_IF {
+ MULH(x3, gd, ed);
+ MUL(gd, gd, ed);
+ UFLAG_OP1(x3);
+ UFLAG_RES(gd);
+ UFLAG_DF(x3, d_imul64);
+ } else {
+ MULxw(gd, gd, ed);
+ }
+ } else {
+ // 32bits imul
+ UFLAG_IF {
+ MUL(gd, gd, ed);
+ UFLAG_RES(gd);
+ SRLI(x3, gd, 32);
+ UFLAG_OP1(x3);
+ UFLAG_DF(x3, d_imul32);
+ } else {
+ MULxw(gd, gd, ed);
+ }
+ SLLI(gd, gd, 32);
+ SRLI(gd, gd, 32);
+ }
+ break;
+ case 0xB3:
+ INST_NAME("BTR Ed, Gd");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE();
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ wback = 0;
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ SRAI(x1, gd, 5+rex.w);
+ SLLI(x1, x1, 2+rex.w);
+ ADD(x3, wback, x1);
+ LDxw(x1, x3, fixedaddress);
+ ed = x1;
+ wback = x3;
+ }
+ if (rex.w) {
+ ANDI(x2, gd, 0x3f);
+ } else {
+ ANDI(x2, gd, 0x1f);
+ }
+ SRL(x4, ed, x2);
+ ANDI(x4, x4, 1); // F_CF is 1
+ ANDI(xFlags, xFlags, ~1);
+ OR(xFlags, xFlags, x4);
+ ADDI(x5, xZR, 1);
+ SLL(x5, x5, x2);
+ NOT(x5, x5);
+ AND(ed, ed, x5);
+ if(wback) {
+ SDxw(ed, wback, fixedaddress);
+ SMWRITE();
+ }
+ break;
+ case 0xB6:
+ INST_NAME("MOVZX Gd, Eb");
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ if(rex.rex) {
+ eb1 = xRAX+(nextop&7)+(rex.b<<3);
+ eb2 = 0; \
+ } else {
+ ed = (nextop&7);
+ eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
+ eb2 = (ed&4)>>2; // L or H
+ }
+ if (eb2) {
+ SRLI(gd, eb1, 8);
+ ANDI(gd, gd, 0xff);
+ } else {
+ ANDI(gd, eb1, 0xff);
+ }
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ LBU(gd, ed, fixedaddress);
+ }
+ break;
+ case 0xB7:
+ INST_NAME("MOVZX Gd, Ew");
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ ZEXTH(gd, ed);
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ LHU(gd, ed, fixedaddress);
+ }
+ break;
+ case 0xBA:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 4:
+ INST_NAME("BT Ed, Ib");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE();
+ GETED(1);
+ u8 = F8;
+ u8&=rex.w?0x3f:0x1f;
+ SRLIxw(x3, ed, u8);
+ ANDI(x3, x3, 1); // F_CF is 1
+ ANDI(xFlags, xFlags, ~1);
+ OR(xFlags, xFlags, x3);
+ break;
+ case 5:
+ INST_NAME("BTS Ed, Ib");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE();
+ GETED(1);
+ u8 = F8;
+ u8&=(rex.w?0x3f:0x1f);
+ ORI(xFlags, xFlags, 1<<F_CF);
+ if (u8 <= 10) {
+ ANDI(x6, ed, 1<<u8);
+ BNE_MARK(x6, xZR);
+ ANDI(xFlags, xFlags, ~(1<<F_CF));
+ XORI(ed, ed, 1<<u8);
+ } else {
+ ORI(x6, xZR, 1);
+ SLLI(x6, x6, u8);
+ AND(x4, ed, x6);
+ BNE_MARK(x4, xZR);
+ ANDI(xFlags, xFlags, ~(1<<F_CF));
+ XOR(ed, ed, x6);
+ }
+ if (wback) {
+ SDxw(ed, wback, fixedaddress);
+ SMWRITE();
+ }
+ MARK;
+ break;
+ case 6:
+ INST_NAME("BTR Ed, Ib");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE();
+ GETED(1);
+ u8 = F8;
+ u8&=(rex.w?0x3f:0x1f);
+ ANDI(xFlags, xFlags, ~(1<<F_CF));
+ if (u8 <= 10) {
+ ANDI(x6, ed, 1<<u8);
+ BEQ_MARK(x6, xZR);
+ ORI(xFlags, xFlags, 1<<F_CF);
+ XORI(ed, ed, 1<<u8);
+ } else {
+ ORI(x6, xZR, 1);
+ SLLI(x6, x6, u8);
+ AND(x6, ed, x6);
+ BEQ_MARK(x6, xZR);
+ ORI(xFlags, xFlags, 1<<F_CF);
+ XOR(ed, ed, x6);
+ }
+ if (wback) {
+ SDxw(ed, wback, fixedaddress);
+ SMWRITE();
+ }
+ MARK;
+ break;
+ case 7:
+ INST_NAME("BTC Ed, Ib");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE();
+ GETED(1);
+ u8 = F8;
+ u8&=rex.w?0x3f:0x1f;
+ SRLIxw(x3, ed, u8);
+ ANDI(x3, x3, 1); // F_CF is 1
+ ANDI(xFlags, xFlags, ~1);
+ OR(xFlags, xFlags, x3);
+ if (u8 <= 10) {
+ XORI(ed, ed, (1LL << u8));
+ } else {
+ MOV64xw(x3, (1LL << u8));
+ XOR(ed, ed, x3);
+ }
+ if(wback) {
+ SDxw(ed, wback, fixedaddress);
+ SMWRITE();
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0xBB:
+ INST_NAME("BTC Ed, Gd");
+ SETFLAGS(X_CF, SF_SUBSET);
+ SET_DFNONE();
+ nextop = F8;
+ GETGD;
+ if (MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ wback = 0;
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0);
+ SRAI(x1, gd, 5+rex.w);
+ SLLI(x1, x1, 2+rex.w);
+ ADD(x3, wback, x1);
+ LDxw(x1, x3, fixedaddress);
+ ed = x1;
+ wback = x3;
+ }
+ if (rex.w) {
+ ANDI(x2, gd, 0x3f);
+ } else {
+ ANDI(x2, gd, 0x1f);
+ }
+ SRL(x4, ed, x2);
+ ANDI(x4, x4, 1); // F_CF is 1
+ ANDI(xFlags, xFlags, ~1);
+ OR(xFlags, xFlags, x4);
+ ADDI(x3, xZR, 1);
+ SLL(x3, x3, x2);
+ XOR(ed, ed, x3);
+ if(wback) {
+ SDxw(ed, wback, fixedaddress);
+ SMWRITE();
+ }
+ break;
+ case 0xBC:
+ INST_NAME("BSF Gd, Ed");
+ SETFLAGS(X_ZF, SF_SUBSET);
+ SET_DFNONE();
+ nextop = F8;
+ GETED(0);
+ GETGD;
+ if(!rex.w && MODREG) {
+ AND(x4, ed, xMASK);
+ ed = x4;
+ }
+ BNE_MARK(ed, xZR);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ B_NEXT_nocond;
+ MARK;
+ if(rv64_zbb) {
+ CTZxw(gd, ed);
+ } else {
+ NEG(x2, ed);
+ AND(x2, x2, ed);
+ TABLE64(x3, 0x03f79d71b4ca8b09ULL);
+ MUL(x2, x2, x3);
+ SRLI(x2, x2, 64-6);
+ TABLE64(x1, (uintptr_t)&deBruijn64tab);
+ ADD(x1, x1, x2);
+ LBU(gd, x1, 0);
+ }
+ ANDI(xFlags, xFlags, ~(1<<F_ZF));
+ break;
+ case 0xBD:
+ INST_NAME("BSR Gd, Ed");
+ SETFLAGS(X_ZF, SF_SUBSET);
+ SET_DFNONE();
+ nextop = F8;
+ GETED(0);
+ GETGD;
+ if(!rex.w && MODREG) {
+ AND(x4, ed, xMASK);
+ ed = x4;
+ }
+ BNE_MARK(ed, xZR);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ B_NEXT_nocond;
+ MARK;
+ ANDI(xFlags, xFlags, ~(1<<F_ZF));
+ if(rv64_zbb) {
+ MOV32w(x1, rex.w?63:31);
+ CLZxw(gd, ed);
+ SUB(gd, x1, gd);
+ } else {
+ if(ed!=gd)
+ u8 = gd;
+ else
+ u8 = x1;
+ ADDI(u8, xZR, 0);
+ if(rex.w) {
+ MV(x2, ed);
+ SRLI(x3, x2, 32);
+ BEQZ(x3, 4+2*4);
+ ADDI(u8, u8, 32);
+ MV(x2, x3);
+ } else {
+ AND(x2, ed, xMASK);
+ }
+ SRLI(x3, x2, 16);
+ BEQZ(x3, 4+2*4);
+ ADDI(u8, u8, 16);
+ MV(x2, x3);
+ SRLI(x3, x2, 8);
+ BEQZ(x3, 4+2*4);
+ ADDI(u8, u8, 8);
+ MV(x2, x3);
+ SRLI(x3, x2, 4);
+ BEQZ(x3, 4+2*4);
+ ADDI(u8, u8, 4);
+ MV(x2, x3);
+ ANDI(x2, x2, 0b1111);
+ TABLE64(x3, (uintptr_t)&lead0tab);
+ ADD(x3, x3, x2);
+ LBU(x2, x3, 0);
+ ADD(gd, u8, x2);
+ }
+ break;
+ case 0xBE:
+ INST_NAME("MOVSX Gd, Eb");
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ if(rex.rex) {
+ wback = xRAX+(nextop&7)+(rex.b<<3);
+ wb2 = 0;
+ } else {
+ wback = (nextop&7);
+ wb2 = (wback>>2)*8;
+ wback = xRAX+(wback&3);
+ }
+ SLLI(gd, wback, 56-wb2);
+ SRAI(gd, gd, 56);
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, x1, &fixedaddress, rex, NULL, 1, 0);
+ LB(gd, ed, fixedaddress);
+ }
+ if(!rex.w)
+ ZEROUP(gd);
+ break;
+ case 0xBF:
+ INST_NAME("MOVSX Gd, Ew");
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ SLLI(gd, ed, 48);
+ SRAI(gd, gd, 48);
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, x1, &fixedaddress, rex, NULL, 1, 0);
+ LH(gd, ed, fixedaddress);
+ }
+ if(!rex.w)
+ ZEROUP(gd);
+ break;
+ case 0xC2:
+ INST_NAME("CMPPS Gx, Ex, Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ d0 = fpu_get_scratch(dyn);
+ d1 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ FLW(d0, gback, gdoffset+i*4);
+ FLW(d1, wback, fixedaddress+i*4);
+ if ((u8&7) == 0) { // Equal
+ FEQS(x3, d0, d1);
+ } else if ((u8&7) == 4) { // Not Equal or unordered
+ FEQS(x3, d0, d1);
+ XORI(x3, x3, 1);
+ } else {
+ // x4 = !(isnan(d0) || isnan(d1))
+ FEQS(x4, d0, d0);
+ FEQS(x3, d1, d1);
+ AND(x3, x3, x4);
+
+ switch(u8&7) {
+ case 1: BEQ_MARK(x3, xZR); FLTS(x3, d0, d1); break; // Less than
+ case 2: BEQ_MARK(x3, xZR); FLES(x3, d0, d1); break; // Less or equal
+ case 3: XORI(x3, x3, 1); break; // NaN
+ case 5: { // Greater or equal or unordered
+ BEQ(x3, xZR, 12); // MARK2
+ FLES(x3, d1, d0);
+ J(8); // MARK;
+ break;
+ }
+ case 6: { // Greater or unordered, test inverted, N!=V so unordered or less than (inverted)
+ BEQ(x3, xZR, 12); // MARK2
+ FLTS(x3, d1, d0);
+ J(8); // MARK;
+ break;
+ }
+ case 7: break; // Not NaN
+ }
+
+ // MARK2;
+ if ((u8&7) == 5 || (u8&7) == 6) {
+ MOV32w(x3, 1);
+ }
+ // MARK;
+ }
+ NEG(x3, x3);
+ SW(x3, gback, gdoffset+i*4);
+ }
+ break;
+ case 0xC3:
+ INST_NAME("MOVNTI Ed, Gd");
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ MVxw(xRAX+(nextop&7)+(rex.b<<3), gd);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ SDxw(gd, ed, fixedaddress);
+ }
+ break;
+ case 0xC6: // TODO: Optimize this!
+ INST_NAME("SHUFPS Gx, Ex, Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ int32_t idx;
+
+ idx = (u8>>(0*2))&3;
+ LWU(x3, gback, gdoffset+idx*4);
+ idx = (u8>>(1*2))&3;
+ LWU(x4, gback, gdoffset+idx*4);
+ idx = (u8>>(2*2))&3;
+ LWU(x5, wback, fixedaddress+idx*4);
+ idx = (u8>>(3*2))&3;
+ LWU(x6, wback, fixedaddress+idx*4);
+
+ SW(x3, gback, gdoffset+0*4);
+ SW(x4, gback, gdoffset+1*4);
+ SW(x5, gback, gdoffset+2*4);
+ SW(x6, gback, gdoffset+3*4);
+ break;
+
+ case 0xC8:
+ case 0xC9:
+ case 0xCA:
+ case 0xCB:
+ case 0xCC:
+ case 0xCD:
+ case 0xCE:
+ case 0xCF: /* BSWAP reg */
+ INST_NAME("BSWAP Reg");
+ gd = xRAX+(opcode&7)+(rex.b<<3);
+ if(rv64_zbb) {
+ REV8(gd, gd);
+ if(!rex.w)
+ SRLI(gd, gd, 32);
+ } else {
+ gback = gd;
+ if (!rex.w) {
+ AND(x4, gd, xMASK);
+ gd = x4;
+ }
+ ANDI(x1, gd, 0xff);
+ SLLI(x1, x1, (rex.w?64:32)-8);
+ SRLI(x2, gd, 8);
+ ANDI(x3, x2, 0xff);
+ SLLI(x3, x3, (rex.w?64:32)-16);
+ OR(x1, x1, x3);
+ SRLI(x2, gd, 16);
+ ANDI(x3, x2, 0xff);
+ SLLI(x3, x3, (rex.w?64:32)-24);
+ OR(x1, x1, x3);
+ SRLI(x2, gd, 24);
+ if(rex.w) {
+ ANDI(x3, x2, 0xff);
+ SLLI(x3, x3, 64-32);
+ OR(x1, x1, x3);
+ SRLI(x2, gd, 32);
+ ANDI(x3, x2, 0xff);
+ SLLI(x3, x3, 64-40);
+ OR(x1, x1, x3);
+ SRLI(x2, gd, 40);
+ ANDI(x3, x2, 0xff);
+ SLLI(x3, x3, 64-48);
+ OR(x1, x1, x3);
+ SRLI(x2, gd, 48);
+ ANDI(x3, x2, 0xff);
+ SLLI(x3, x3, 64-56);
+ OR(x1, x1, x3);
+ SRLI(x2, gd, 56);
+ }
+ OR(gback, x1, x2);
+ }
+ break;
+ case 0xE5:
+ INST_NAME("PMULHW Gm,Em");
+ nextop = F8;
+ GETGM();
+ GETEM(x2, 0);
+ for(int i=0; i<4; ++i) {
+ LH(x3, gback, gdoffset+2*i);
+ LH(x4, wback, fixedaddress+2*i);
+ MULW(x3, x3, x4);
+ SRAIW(x3, x3, 16);
+ SH(x3, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xED:
+ INST_NAME("PADDSW Gm,Em");
+ nextop = F8;
+ GETGM();
+ GETEM(x2, 0);
+ for(int i=0; i<4; ++i) {
+ // tmp32s = (int32_t)GX->sw[i] + EX->sw[i];
+ // GX->sw[i] = (tmp32s>32767)?32767:((tmp32s<-32768)?-32768:tmp32s);
+ LH(x3, gback, gdoffset+2*i);
+ LH(x4, wback, fixedaddress+2*i);
+ ADDW(x3, x3, x4);
+ LUI(x4, 0xFFFF8); // -32768
+ BGE(x3, x4, 12);
+ SH(x4, gback, gdoffset+2*i);
+ J(20); // continue
+ LUI(x4, 8); // 32768
+ BLT(x3, x4, 8);
+ ADDIW(x3, x4, -1);
+ SH(x3, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xEF:
+ INST_NAME("PXOR Gm,Em");
+ nextop = F8;
+ GETGM();
+ if(MODREG && gd==(nextop&7)) {
+ // just zero dest
+ SD(xZR, gback, gdoffset+0);
+ } else {
+ GETEM(x2, 0);
+ LD(x3, gback, gdoffset+0);
+ LD(x4, wback, fixedaddress);
+ XOR(x3, x3, x4);
+ SD(x3, gback, gdoffset+0);
+ }
+ break;
+ case 0xF9:
+ INST_NAME("PSUBW Gm, Em");
+ nextop = F8;
+ GETGM();
+ GETEM(x2, 0);
+ MMX_LOOP_W(x3, x4, SUBW(x3, x3, x4));
+ break;
+ case 0xFD:
+ INST_NAME("PADDW Gm, Em");
+ nextop = F8;
+ GETGM();
+ GETEM(x2, 0);
+ MMX_LOOP_W(x3, x4, ADDW(x3, x3, x4));
+ break;
+ default:
+ DEFAULT;
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_64.c b/src/dynarec/rv64/dynarec_rv64_64.c
new file mode 100644
index 0000000..bc3b2c9
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_64.c
@@ -0,0 +1,496 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+#include "custommem.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+uintptr_t dynarec64_64(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog)
+{
+ (void)ip; (void)rep; (void)need_epilog;
+
+ uint8_t opcode = F8;
+ uint8_t nextop;
+ uint8_t u8;
+ uint8_t gd, ed, eb1, eb2, gb1, gb2;
+ uint8_t gback, wback, wb1, wb2, wb;
+ int64_t i64, j64;
+ uint64_t u64;
+ int v0, v1;
+ int q0;
+ int d0;
+ int64_t fixedaddress, gdoffset;
+ int unscaled;
+ MAYUSE(eb1);
+ MAYUSE(eb2);
+ MAYUSE(wb1);
+ MAYUSE(wb2);
+ MAYUSE(gb1);
+ MAYUSE(gb2);
+ MAYUSE(j64);
+ MAYUSE(d0);
+ MAYUSE(q0);
+ MAYUSE(v0);
+ MAYUSE(v1);
+
+ while((opcode==0xF2) || (opcode==0xF3)) {
+ rep = opcode-0xF1;
+ opcode = F8;
+ }
+
+ GETREX();
+
+ switch(opcode) {
+ case 0x03:
+ INST_NAME("ADD Gd, Seg:Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ nextop = F8;
+ GETGD;
+ GETEDO(x4, 0, x5);
+ emit_add32(dyn, ninst, rex, gd, ed, x3, x4, x5);
+ break;
+ case 0x0F:
+ opcode = F8;
+ switch(opcode) {
+ case 0x11:
+ switch(rep) {
+ case 0:
+ INST_NAME("MOVUPS Ex,Gx");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ if(!MODREG) {
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ ADD(x4, x4, wback);
+ wback = x4;
+ }
+ LD(x3, gback, gdoffset+0);
+ LD(x5, gback, gdoffset+8);
+ SD(x3, wback, fixedaddress+0);
+ SD(x5, wback, fixedaddress+8);
+ if(!MODREG)
+ SMWRITE2();
+ break;
+ case 1:
+ INST_NAME("MOVSD Ex, Gx");
+ nextop = F8;
+ GETG;
+ v0 = sse_get_reg(dyn, ninst, x1, gd, 0);
+ if(MODREG) {
+ ed = (nextop&7)+ (rex.b<<3);
+ d0 = sse_get_reg(dyn, ninst, x1, ed, 0);
+ FMVD(d0, v0);
+ } else {
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0);
+ ADD(x4, x4, ed);
+ ed = x4;
+ FSD(v0, ed, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+ case 2:
+ INST_NAME("MOVSS Ex, Gx");
+ nextop = F8;
+ GETG;
+ v0 = sse_get_reg(dyn, ninst, x1, gd, 1);
+ if(MODREG) {
+ q0 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 1);
+ FMVS(q0, v0);
+ } else {
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0);
+ ADD(x4, x4, ed);
+ ed = x4;
+ FSW(v0, ed, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0x2B:
+ INST_NAME("SUB Gd, Seg:Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ nextop = F8;
+ GETGD;
+ GETEDO(x4, 0, x5);
+ emit_sub32(dyn, ninst, rex, gd, ed, x3, x4, x5);
+ break;
+
+ case 0x33:
+ INST_NAME("XOR Gd, Seg:Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ nextop = F8;
+ GETGD;
+ GETEDO(x4, 0, x5);
+ emit_xor32(dyn, ninst, rex, gd, ed, x3, x4);
+ break;
+
+ case 0x66:
+ addr = dynarec64_6664(dyn, addr, ip, ninst, rex, seg, ok, need_epilog);
+ break;
+ case 0x80:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0: // ADD
+ INST_NAME("ADD Eb, Ib");
+ grab_segdata(dyn, addr, ninst, x1, seg);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEBO(x1, 1);
+ u8 = F8;
+ emit_add8c(dyn, ninst, x1, u8, x2, x4, x5);
+ EBBACK(x5, 0);
+ break;
+ case 1: // OR
+ INST_NAME("OR Eb, Ib");
+ grab_segdata(dyn, addr, ninst, x1, seg);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEBO(x1, 1);
+ u8 = F8;
+ emit_or8c(dyn, ninst, x1, u8, x2, x4, x5);
+ EBBACK(x5, 0);
+ break;
+ case 2: // ADC
+ INST_NAME("ADC Eb, Ib");
+ grab_segdata(dyn, addr, ninst, x1, seg);
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEBO(x1, 1);
+ u8 = F8;
+ emit_adc8c(dyn, ninst, x1, u8, x2, x4, x5, x6);
+ EBBACK(x5, 0);
+ break;
+ case 3: // SBB
+ INST_NAME("SBB Eb, Ib");
+ grab_segdata(dyn, addr, ninst, x1, seg);
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEBO(x1, 1);
+ u8 = F8;
+ emit_sbb8c(dyn, ninst, x1, u8, x2, x4, x5, x6);
+ EBBACK(x5, 0);
+ break;
+ case 4: // AND
+ INST_NAME("AND Eb, Ib");
+ grab_segdata(dyn, addr, ninst, x1, seg);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEBO(x1, 1);
+ u8 = F8;
+ emit_and8c(dyn, ninst, x1, u8, x2, x4);
+ EBBACK(x5, 0);
+ break;
+ case 5: // SUB
+ INST_NAME("SUB Eb, Ib");
+ grab_segdata(dyn, addr, ninst, x1, seg);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEBO(x1, 1);
+ u8 = F8;
+ emit_sub8c(dyn, ninst, x1, u8, x2, x4, x5, x6);
+ EBBACK(x5, 0);
+ break;
+ case 6: // XOR
+ INST_NAME("XOR Eb, Ib");
+ grab_segdata(dyn, addr, ninst, x1, seg);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEBO(x1, 1);
+ u8 = F8;
+ emit_xor8c(dyn, ninst, x1, u8, x2, x4);
+ EBBACK(x5, 0);
+ break;
+ case 7: // CMP
+ INST_NAME("CMP Eb, Ib");
+ grab_segdata(dyn, addr, ninst, x1, seg);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEBO(x1, 1);
+ u8 = F8;
+ if(u8) {
+ MOV32w(x2, u8);
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ } else {
+ emit_cmp8_0(dyn, ninst, x1, x3, x4);
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0x81:
+ case 0x83:
+ nextop = F8;
+ grab_segdata(dyn, addr, ninst, x6, seg);
+ switch((nextop>>3)&7) {
+ case 0: // ADD
+ if(opcode==0x81) {INST_NAME("ADD Ed, Id");} else {INST_NAME("ADD Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEDO(x6, (opcode==0x81)?4:1, x5);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x9);
+ WBACKO(x6);
+ break;
+ case 1: // OR
+ if(opcode==0x81) {INST_NAME("OR Ed, Id");} else {INST_NAME("OR Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEDO(x6, (opcode==0x81)?4:1, x5);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_or32c(dyn, ninst, rex, ed, i64, x3, x4);
+ WBACKO(x6);
+ break;
+ case 2: // ADC
+ if(opcode==0x81) {INST_NAME("ADC Ed, Id");} else {INST_NAME("ADC Ed, Ib");}
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEDO(x6, (opcode==0x81)?4:1, x5);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ MOV64xw(x5, i64);
+ SD(x6, xEmu, offsetof(x64emu_t, scratch));
+ emit_adc32(dyn, ninst, rex, ed, x5, x3, x4, x6, x9);
+ LD(x6, xEmu, offsetof(x64emu_t, scratch));
+ WBACKO(x6);
+ break;
+ case 3: // SBB
+ if(opcode==0x81) {INST_NAME("SBB Ed, Id");} else {INST_NAME("SBB Ed, Ib");}
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEDO(x6, (opcode==0x81)?4:1, x5);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ MOV64xw(x5, i64);
+ emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4, x9);
+ WBACKO(x6);
+ break;
+ case 4: // AND
+ if(opcode==0x81) {INST_NAME("AND Ed, Id");} else {INST_NAME("AND Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEDO(x6, (opcode==0x81)?4:1, x5);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_and32c(dyn, ninst, rex, ed, i64, x3, x4);
+ WBACKO(x6);
+ break;
+ case 5: // SUB
+ if(opcode==0x81) {INST_NAME("SUB Ed, Id");} else {INST_NAME("SUB Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEDO(x6, (opcode==0x81)?4:1, x5);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x9);
+ WBACKO(x6);
+ break;
+ case 6: // XOR
+ if(opcode==0x81) {INST_NAME("XOR Ed, Id");} else {INST_NAME("XOR Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEDO(x6, (opcode==0x81)?4:1, x5);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4);
+ WBACKO(x6);
+ break;
+ case 7: // CMP
+ if(opcode==0x81) {INST_NAME("CMP Ed, Id");} else {INST_NAME("CMP Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEDO(x6, (opcode==0x81)?4:1, x5);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ if(i64) {
+ MOV64xw(x2, i64);
+ emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5, x6);
+ } else
+ emit_cmp32_0(dyn, ninst, rex, ed, x3, x4);
+ break;
+ }
+ break;
+ case 0x88:
+ INST_NAME("MOV Seg:Eb, Gb");
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ nextop=F8;
+ gd = ((nextop&0x38)>>3)+(rex.r<<3);
+ if(rex.rex) {
+ gb2 = 0;
+ gb1 = xRAX + gd;
+ } else {
+ gb2 = ((gd&4)>>2);
+ gb1 = xRAX+(gd&3);
+ }
+ gd = x5;
+ if(gb2) {
+ SRLI(x5, gb1, 8);
+ gb1 = x5;
+ }
+ if(MODREG) {
+ ed = (nextop&7) + (rex.b<<3);
+ if(rex.rex) {
+ eb1 = xRAX+ed;
+ eb2 = 0;
+ } else {
+ eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
+ eb2 = ((ed&4)>>2); // L or H
+ }
+ ANDI(gd, gb1, 0xff);
+ if(eb2) {
+ MOV64x(x1, 0xffffffffffff00ffLL);
+ ANDI(x1, eb1, x1);
+ SLLI(gd, gd, 8);
+ OR(eb1, x1, gd);
+ } else {
+ ANDI(x1, eb1, ~0xff);
+ OR(eb1, x1, gd);
+ }
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ ADD(x4, ed, x4);
+ SB(gb1, x4, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+ case 0x89:
+ INST_NAME("MOV Seg:Ed, Gd");
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ nextop=F8;
+ GETGD;
+ if(MODREG) { // reg <= reg
+ MVxw(xRAX+(nextop&7)+(rex.b<<3), gd);
+ } else { // mem <= reg
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ ADD(x4, ed, x4);
+ SDxw(gd, x4, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+
+ case 0x8B:
+ INST_NAME("MOV Gd, Seg:Ed");
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ nextop=F8;
+ GETGD;
+ if(MODREG) { // reg <= reg
+ MVxw(gd, xRAX+(nextop&7)+(rex.b<<3));
+ } else { // mem <= reg
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ ADD(x4, ed, x4);
+ LDxw(gd, x4, fixedaddress);
+ }
+ break;
+
+ case 0xA1:
+ INST_NAME("MOV EAX,FS:Od");
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ if(rex.is32bits)
+ u64 = F32;
+ else
+ u64 = F64;
+ // TODO: could be optimized.
+ MOV64z(x1, u64);
+ ADD(x1, x1, x4);
+ LDxw(xRAX, x1, 0);
+ break;
+
+ case 0xA3:
+ INST_NAME("MOV FS:Od,EAX");
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ if(rex.is32bits)
+ u64 = F32;
+ else
+ u64 = F64;
+ // TODO: could be optimized.
+ MOV64z(x1, u64);
+ ADD(x1, x1, x4);
+ SDxw(xRAX, x1, 0);
+ SMWRITE2();
+ break;
+
+ case 0xC6:
+ INST_NAME("MOV Seg:Eb, Ib");
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ nextop=F8;
+ if(MODREG) { // reg <= u8
+ u8 = F8;
+ if(!rex.rex) {
+ ed = (nextop&7);
+ eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
+ eb2 = (ed&4)>>2; // L or H
+ } else {
+ eb1 = xRAX+(nextop&7)+(rex.b<<3);
+ eb2 = 0;
+ }
+
+ if (eb2) {
+ // load a mask to x3 (ffffffffffff00ff)
+ LUI(x3, 0xffff0);
+ ORI(x3, x3, 0xff);
+ // apply mask
+ AND(eb1, eb1, x3);
+ if(u8) {
+ if((u8<<8)<2048) {
+ ADDI(x4, xZR, u8<<8);
+ } else {
+ ADDI(x4, xZR, u8);
+ SLLI(x4, x4, 8);
+ }
+ OR(eb1, eb1, x4);
+ }
+ } else {
+ ANDI(eb1, eb1, 0xf00); // mask ffffffffffffff00
+ ORI(eb1, eb1, u8);
+ }
+ } else { // mem <= u8
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 1);
+ u8 = F8;
+ if(u8) {
+ ADDI(x3, xZR, u8);
+ ed = x3;
+ } else
+ ed = xZR;
+ ADD(x4, wback, x4);
+ SB(ed, x4, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+ case 0xC7:
+ INST_NAME("MOV Seg:Ed, Id");
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ nextop=F8;
+ if(MODREG) { // reg <= i32
+ i64 = F32S;
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ MOV64xw(ed, i64);
+ } else { // mem <= i32
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 4);
+ i64 = F32S;
+ if(i64) {
+ MOV64xw(x3, i64);
+ ed = x3;
+ } else
+ ed = xZR;
+ ADD(x4, wback, x4);
+ SDxw(ed, x4, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_66.c b/src/dynarec/rv64/dynarec_rv64_66.c
new file mode 100644
index 0000000..3e11d45
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_66.c
@@ -0,0 +1,1020 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+
+uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ uint8_t opcode = F8;
+ uint8_t nextop, u8;
+ int16_t i16;
+ uint16_t u16;
+ uint64_t u64;
+ int32_t i32;
+ int64_t j64;
+ uint8_t gd, ed;
+ uint8_t wback, wb1;
+ int64_t fixedaddress;
+ int unscaled;
+ int lock;
+ MAYUSE(u8);
+ MAYUSE(u16);
+ MAYUSE(u64);
+ MAYUSE(j64);
+ MAYUSE(lock);
+
+ while((opcode==0x2E) || (opcode==0x36) || (opcode==0x66)) // ignoring CS:, SS: or multiple 0x66
+ opcode = F8;
+
+ while((opcode==0xF2) || (opcode==0xF3)) {
+ rep = opcode-0xF1;
+ opcode = F8;
+ }
+
+ GETREX();
+
+ if(rex.w && !(opcode==0x0f || opcode==0xf0 || opcode==0x64 || opcode==0x65)) // rex.w cancels "66", but not for 66 0f type of prefix
+ return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog); // addr-1, to "put back" opcode
+
+ switch(opcode) {
+ case 0x01:
+ INST_NAME("ADD Ew, Gw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x2);
+ GETEW(x1, 0);
+ emit_add16(dyn, ninst, x1, x2, x4, x5, x6);
+ EWBACK;
+ break;
+ case 0x03:
+ INST_NAME("ADD Gw, Ew");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x1);
+ GETEW(x2, 0);
+ emit_add16(dyn, ninst, x1, x2, x3, x4, x6);
+ GWBACK;
+ break;
+ case 0x05:
+ INST_NAME("ADD AX, Iw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i32 = F16;
+ ZEXTH(x1 , xRAX);
+ MOV32w(x2, i32);
+ emit_add16(dyn, ninst, x1, x2, x3, x4, x6);
+ LUI(x3, 0xffff0);
+ AND(xRAX, xRAX, x3);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x09:
+ INST_NAME("OR Ew, Gw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x2);
+ GETEW(x1, 0);
+ emit_or16(dyn, ninst, x1, x2, x4, x2);
+ EWBACK;
+ break;
+ case 0x0B:
+ INST_NAME("OR Gw, Ew");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x1);
+ GETEW(x2, 0);
+ emit_or16(dyn, ninst, x1, x2, x4, x5);
+ GWBACK;
+ break;
+ case 0x0D:
+ INST_NAME("OR AX, Iw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i32 = F16;
+ ZEXTH(x1, xRAX);
+ MOV32w(x2, i32);
+ emit_or16(dyn, ninst, x1, x2, x3, x4);
+ LUI(x3, 0xffff0);
+ AND(xRAX, xRAX, x3);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x0F:
+ addr = dynarec64_660F(dyn, addr, ip, ninst, rex, ok, need_epilog);
+ break;
+ case 0x11:
+ INST_NAME("ADC Ew, Gw");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x2);
+ GETEW(x1, 0);
+ emit_adc16(dyn, ninst, x1, x2, x4, x3, x5);
+ EWBACK;
+ break;
+ case 0x13:
+ INST_NAME("ADC Gw, Ew");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x1);
+ GETEW(x2, 0);
+ emit_adc16(dyn, ninst, x1, x2, x4, x3, x5);
+ GWBACK;
+ break;
+ case 0x15:
+ INST_NAME("ADC AX, Iw");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i16 = F16;
+ SRLI(x6, xMASK, 16);
+ AND(x1, xRAX, x6);
+ MOV32w(x2, i16);
+ emit_adc16(dyn, ninst, x1, x2, x3, x4, x5);
+ if (rv64_zbb) {
+ ANDN(xRAX, xRAX, x6);
+ } else {
+ NOT(x6, x6);
+ AND(xRAX, xRAX, x6);
+ }
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x19:
+ INST_NAME("SBB Ew, Gw");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x2);
+ GETEW(x1, 0);
+ emit_sbb16(dyn, ninst, x1, x2, x4, x5, x6);
+ EWBACK;
+ break;
+ case 0x1B:
+ INST_NAME("SBB Gw, Ew");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x1);
+ GETEW(x2, 0);
+ emit_sbb16(dyn, ninst, x1, x2, x3, x4, x5);
+ GWBACK;
+ break;
+ case 0x21:
+ INST_NAME("AND Ew, Gw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x2);
+ GETEW(x1, 0);
+ emit_and16(dyn, ninst, x1, x2, x4, x5);
+ EWBACK;
+ break;
+ case 0x23:
+ INST_NAME("AND Gw, Ew");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x1);
+ GETEW(x2, 0);
+ emit_and16(dyn, ninst, x1, x2, x4, x5);
+ GWBACK;
+ break;
+ case 0x25:
+ INST_NAME("AND AX, Iw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i32 = F16;
+ ZEXTH(x1, xRAX);
+ MOV32w(x2, i32);
+ emit_and16(dyn, ninst, x1, x2, x3, x4);
+ LUI(x3, 0xffff0);
+ AND(xRAX, xRAX, x3);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x29:
+ INST_NAME("SUB Ew, Gw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x1);
+ GETEW(x2, 0);
+ emit_sub16(dyn, ninst, x2, x1, x4, x5, x6);
+ EWBACK;
+ break;
+ case 0x2B:
+ INST_NAME("SUB Gw, Ew");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x1);
+ GETEW(x2, 0);
+ emit_sub16(dyn, ninst, x1, x2, x3, x4, x5);
+ GWBACK;
+ break;
+ case 0x2D:
+ INST_NAME("SUB AX, Iw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i32 = F16;
+ ZEXTH(x1, xRAX);
+ MOV32w(x2, i32);
+ emit_sub16(dyn, ninst, x1, x2, x3, x4, x5);
+ LUI(x2, 0xffff0);
+ AND(xRAX, xRAX, x2);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x31:
+ INST_NAME("XOR Ew, Gw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x2);
+ GETEW(x1, 0);
+ emit_xor16(dyn, ninst, x1, x2, x4, x5, x6);
+ EWBACK;
+ break;
+ case 0x33:
+ INST_NAME("XOR Gw, Ew");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x1);
+ GETEW(x2, 0);
+ emit_xor16(dyn, ninst, x1, x2, x4, x5, x6);
+ GWBACK;
+ break;
+ case 0x35:
+ INST_NAME("XOR AX, Iw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i32 = F16;
+ ZEXTH(x1, xRAX);
+ MOV32w(x2, i32);
+ emit_xor16(dyn, ninst, x1, x2, x3, x4, x5);
+ LUI(x5, 0xffff0);
+ AND(xRAX, xRAX, x5);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0x39:
+ INST_NAME("CMP Ew, Gw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x2);
+ GETEW(x1, 0);
+ emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ break;
+ case 0x3B:
+ INST_NAME("CMP Gw, Ew");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x1);
+ GETEW(x2, 0);
+ emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ break;
+ case 0x3D:
+ INST_NAME("CMP AX, Iw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i32 = F16;
+ ZEXTH(x1, xRAX);
+ if(i32) {
+ MOV32w(x2, i32);
+ emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ } else {
+ emit_cmp16_0(dyn, ninst, x1, x3, x4);
+ }
+ break;
+ case 0x40:
+ case 0x41:
+ case 0x42:
+ case 0x43:
+ case 0x44:
+ case 0x45:
+ case 0x46:
+ case 0x47:
+ INST_NAME("INC Reg16 (32bits)");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ gd = xRAX + (opcode&7);
+ ZEXTH(x1, gd);
+ emit_inc16(dyn, ninst, x1, x2, x3, x4);
+ LUI(x3, 0xffff0);
+ AND(gd, gd, x3);
+ OR(gd, gd, x1);
+ ZEROUP(gd);
+ break;
+ case 0x48:
+ case 0x49:
+ case 0x4A:
+ case 0x4B:
+ case 0x4C:
+ case 0x4D:
+ case 0x4E:
+ case 0x4F:
+ INST_NAME("DEC Reg16 (32bits)");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ gd = xRAX + (opcode&7);
+ ZEXTH(x1, gd);
+ emit_dec16(dyn, ninst, x1, x2, x3, x4, x5);
+ LUI(x3, 0xffff0);
+ AND(gd, gd, x3);
+ OR(gd, gd, x1);
+ ZEROUP(gd);
+ break;
+ case 0x64:
+ addr = dynarec64_6664(dyn, addr, ip, ninst, rex, _FS, ok, need_epilog);
+ break;
+ case 0x65:
+ addr = dynarec64_6664(dyn, addr, ip, ninst, rex, _GS, ok, need_epilog);
+ break;
+ case 0x66:
+ addr = dynarec64_66(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+ break;
+ case 0x69:
+ case 0x6B:
+ if(opcode==0x69) {
+ INST_NAME("IMUL Gw,Ew,Iw");
+ } else {
+ INST_NAME("IMUL Gw,Ew,Ib");
+ }
+ SETFLAGS(X_ALL, SF_PENDING);
+ nextop = F8;
+ UFLAG_DF(x1, d_imul16);
+ GETSEW(x1, (opcode==0x69)?2:1);
+ if(opcode==0x69) i32 = F16S; else i32 = F8S;
+ MOV32w(x2, i32);
+ MULW(x2, x2, x1);
+ ZEXTH(x2, x2);
+ UFLAG_RES(x2);
+ gd=x2;
+ GWBACK;
+ break;
+ case 0x70:
+ case 0x71:
+ case 0x72:
+ case 0x73:
+ case 0x74:
+ case 0x75:
+ case 0x76:
+ case 0x77:
+ case 0x78:
+ case 0x79:
+ case 0x7a:
+ case 0x7b:
+ case 0x7c:
+ case 0x7d:
+ case 0x7e:
+ case 0x7f:
+ // just use regular conditional jump
+ return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog);
+
+ case 0x81:
+ case 0x83:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0: // ADD
+ if(opcode==0x81) {INST_NAME("ADD Ew, Iw");} else {INST_NAME("ADD Ew, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEW(x1, (opcode==0x81)?2:1);
+ if(opcode==0x81) i16 = F16S; else i16 = F8S;
+ MOV64x(x5, i16);
+ emit_add16(dyn, ninst, ed, x5, x2, x4, x6);
+ EWBACK;
+ break;
+ case 1: // OR
+ if(opcode==0x81) {INST_NAME("OR Ew, Iw");} else {INST_NAME("OR Ew, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEW(x1, (opcode==0x81)?2:1);
+ if(opcode==0x81) i16 = F16S; else i16 = F8S;
+ MOV64x(x5, i16);
+ emit_or16(dyn, ninst, x1, x5, x2, x4);
+ EWBACK;
+ break;
+ case 2: // ADC
+ if(opcode==0x81) {INST_NAME("ADC Ew, Iw");} else {INST_NAME("ADC Ew, Ib");}
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEW(x1, (opcode==0x81)?2:1);
+ if(opcode==0x81) i16 = F16S; else i16 = F8S;
+ MOV64x(x5, i16);
+ emit_adc16(dyn, ninst, x1, x5, x2, x4, x6);
+ EWBACK;
+ break;
+ case 3: // SBB
+ if(opcode==0x81) {INST_NAME("SBB Ew, Iw");} else {INST_NAME("SBB Ew, Ib");}
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEW(x1, (opcode==0x81)?2:1);
+ if(opcode==0x81) i16 = F16S; else i16 = F8S;
+ MOV64x(x5, i16);
+ emit_sbb16(dyn, ninst, x1, x5, x2, x4, x6);
+ EWBACK;
+ break;
+ case 4: // AND
+ if(opcode==0x81) {INST_NAME("AND Ew, Iw");} else {INST_NAME("AND Ew, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEW(x1, (opcode==0x81)?2:1);
+ if(opcode==0x81) i16 = F16S; else i16 = F8S;
+ MOV64x(x5, i16);
+ emit_and16(dyn, ninst, x1, x5, x2, x4);
+ EWBACK;
+ break;
+ case 5: // SUB
+ if(opcode==0x81) {INST_NAME("SUB Ew, Iw");} else {INST_NAME("SUB Ew, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEW(x1, (opcode==0x81)?2:1);
+ if(opcode==0x81) i16 = F16S; else i16 = F8S;
+ MOV32w(x5, i16);
+ emit_sub16(dyn, ninst, x1, x5, x2, x4, x6);
+ EWBACK;
+ break;
+ case 6: // XOR
+ if(opcode==0x81) {INST_NAME("XOR Ew, Iw");} else {INST_NAME("XOR Ew, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEW(x1, (opcode==0x81)?2:1);
+ if(opcode==0x81) i16 = F16S; else i16 = F8S;
+ MOV32w(x5, i16);
+ emit_xor16(dyn, ninst, x1, x5, x2, x4, x6);
+ EWBACK;
+ break;
+ case 7: // CMP
+ if(opcode==0x81) {INST_NAME("CMP Ew, Iw");} else {INST_NAME("CMP Ew, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEW(x1, (opcode==0x81)?2:1);
+ if(opcode==0x81) i16 = F16S; else i16 = F8S;
+ if(i16) {
+ MOV64x(x2, i16);
+ emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ } else
+ emit_cmp16_0(dyn, ninst, x1, x3, x4);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0x85:
+ INST_NAME("TEST Ew, Gw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEW(x1, 0);
+ GETGW(x2);
+ emit_test16(dyn, ninst, x1, x2, x3, x4, x5);
+ break;
+ case 0x87:
+ INST_NAME("(LOCK)XCHG Ew, Gw");
+ nextop = F8;
+ if(MODREG) {
+ GETGD;
+ GETED(0);
+ ADDI(x1, gd, 0);
+ LUI(x3, 0xffff0);
+ AND(gd, gd, x3);
+ ZEXTH(x4, ed);
+ OR(gd, gd, x4);
+ AND(ed, ed, x3);
+ ZEXTH(x4, x1);
+ OR(ed, ed, x4);
+ } else {
+ GETGD;
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ SMDMB();
+
+ ANDI(x3, ed, 1);
+ BNEZ_MARK(x3);
+
+ ANDI(x3, ed, 0b10);
+ LUI(x5, 0xffff0);
+ ZEXTH(x6, gd);
+ BNEZ_MARK3(x3);
+
+ MARKLOCK;
+ LR_W(x1, ed, 1, 0);
+ AND(x3, x1, x5);
+ OR(x3, x3, x6);
+ SC_W(x3, x3, ed, 0, 1);
+ BNEZ_MARKLOCK(x3);
+ ZEXTH(x1, x1);
+ B_MARK2_nocond;
+
+ MARK3;
+ NOT(x5, x5);
+ SLLI(x5, x5, 16);
+ SLLI(x6, x6, 16);
+ NOT(x5, x5);
+ LR_W(x1, ed, 1, 0);
+ AND(x3, x1, x5);
+ OR(x3, x3, x6);
+ SC_W(x3, x3, ed, 0, 1);
+ BNEZ(x3, -4 * 4);
+ SRLI(x1, x1, 16);
+ ZEXTH(x1, x1);
+ B_MARK2_nocond;
+
+ MARK;
+ LHU(x1, ed, 0);
+ SH(gd, ed, 0);
+
+ MARK2;
+ SMDMB();
+ LUI(x5, 0xffff0);
+ AND(gd, gd, x5);
+ OR(gd, gd, x1);
+ }
+ break;
+ case 0x89:
+ INST_NAME("MOV Ew, Gw");
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ if(ed!=gd) {
+ // we don't use GETGW above, so we need let gd & 0xffff.
+ LUI(x1, 0xffff0);
+ AND(ed, ed, x1);
+ ZEXTH(x2, gd);
+ OR(ed, ed, x2);
+ }
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 0, 0);
+ SH(gd, ed, fixedaddress);
+ SMWRITELOCK(lock);
+ }
+ break;
+ case 0x8B:
+ INST_NAME("MOV Gw, Ew");
+ nextop = F8;
+ GETGD; // don't need GETGW neither
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ if(ed!=gd) {
+ LUI(x1, 0xffff0);
+ AND(gd, gd, x1);
+ ZEXTH(x2, ed);
+ OR(gd, gd, x2);
+ }
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0);
+ SMREADLOCK(lock);
+ LHU(x1, ed, fixedaddress);
+ LUI(x4, 0xffff0);
+ AND(gd, gd, x4);
+ OR(gd, gd, x1);
+ }
+ break;
+ case 0x90:
+ case 0x91:
+ case 0x92:
+ case 0x93:
+ case 0x94:
+ case 0x95:
+ case 0x96:
+ case 0x97:
+ gd = xRAX+(opcode&0x07)+(rex.b<<3);
+ if(gd==xRAX) {
+ INST_NAME("NOP");
+ } else {
+ INST_NAME("XCHG AX, Reg");
+ LUI(x4, 0xffff0);
+ // x2 <- rax
+ MV(x2, xRAX);
+ // rax[15:0] <- gd[15:0]
+ ZEXTH(x3, gd);
+ AND(xRAX, xRAX, x4);
+ OR(xRAX, xRAX, x3);
+ // gd[15:0] <- x2[15:0]
+ ZEXTH(x2, x2);
+ AND(gd, gd, x4);
+ OR(gd, gd, x2);
+ }
+ break;
+
+ case 0x98:
+ INST_NAME("CBW");
+ SLLI(x1, xRAX, 56);
+ SRAI(x1, x1, 56);
+ LUI(x2, 0xffff0);
+ AND(xRAX, xRAX, x2);
+ NOT(x2, x2);
+ AND(x1, x1, x2);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0xA5:
+ if(rep) {
+ INST_NAME("REP MOVSW");
+ CBZ_NEXT(xRCX);
+ ANDI(x1, xFlags, 1<<F_DF);
+ BNEZ_MARK2(x1);
+ MARK; // Part with DF==0
+ LH(x1, xRSI, 0);
+ ADDI(xRSI, xRSI, 2);
+ SH(x1, xRDI, 0);
+ ADDI(xRDI, xRDI, 2);
+ SUBI(xRCX, xRCX, 1);
+ BNEZ_MARK(xRCX);
+ B_NEXT_nocond;
+ MARK2; // Part with DF==1
+ LH(x1, xRSI, 0);
+ SUBI(xRSI, xRSI, 2);
+ SH(x1, xRDI, 0);
+ SUBI(xRDI, xRDI, 2);
+ SUBI(xRCX, xRCX, 1);
+ BNEZ_MARK2(xRCX);
+ // done
+ } else {
+ INST_NAME("MOVSD");
+ GETDIR(x3, x1, 2);
+ LH(x1, xRSI, 0);
+ SH(x1, xRDI, 0);
+ ADD(xRSI, xRSI, x3);
+ ADD(xRDI, xRDI, x3);
+ }
+ break;
+ case 0xA9:
+ INST_NAME("TEST AX,Iw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ u16 = F16;
+ MOV32w(x2, u16);
+ SLLIW(x1, xRAX, 16);
+ SRLIW(x1, x1, 16);
+ emit_test16(dyn, ninst, x1, x2, x3, x4, x5);
+ break;
+ case 0xAB:
+ if(rep) {
+ INST_NAME("REP STOSW");
+ CBZ_NEXT(xRCX);
+ ANDI(x1, xFlags, 1<<F_DF);
+ BNEZ_MARK2(x1);
+ MARK; // Part with DF==0
+ SH(xRAX, xRDI, 0);
+ ADDI(xRDI, xRDI, 2);
+ SUBI(xRCX, xRCX, 1);
+ BNEZ_MARK(xRCX);
+ B_NEXT_nocond;
+ MARK2; // Part with DF==1
+ SH(xRAX, xRDI, 0);
+ SUBI(xRDI, xRDI, 2);
+ SUBI(xRCX, xRCX, 1);
+ BNEZ_MARK2(xRCX);
+ // done
+ } else {
+ INST_NAME("STOSW");
+ GETDIR(x3, x1, 2);
+ SH(xRAX, xRDI, 0);
+ ADD(xRDI, xRDI, x3);
+ }
+ break;
+
+ case 0xAF:
+ switch (rep) {
+ case 1:
+ case 2:
+ if(rep==1) {INST_NAME("REPNZ SCASW");} else {INST_NAME("REPZ SCASW");}
+ MAYSETFLAGS();
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ CBZ_NEXT(xRCX);
+ GETDIR(x3, x1, rex.w?8:2);
+ if (rex.w) {
+ MARK;
+ LD(x2, xRDI, 0);
+ ADD(xRDI, xRDI, x3);
+ ADDI(xRCX, xRCX, -1);
+ if (rep==1) {BEQ_MARK3(xRAX, x2);} else {BNE_MARK3(xRAX, x2);}
+ BNE_MARK(xRCX, xZR);
+ MARK3;
+ emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5, x6);
+ } else {
+ ZEXTH(x1, xRAX);
+ MARK;
+ LHU(x2, xRDI, 0);
+ ADD(xRDI, xRDI, x3);
+ ADDI(xRCX, xRCX, -1);
+ if (rep==1) {BEQ_MARK3(x1, x2);} else {BNE_MARK3(x1, x2);}
+ BNE_MARK(xRCX, xZR);
+ MARK3;
+ emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ }
+ break;
+ default:
+ INST_NAME("SCASW");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETDIR(x3, x1, rex.w?8:2);
+ if (rex.w) {
+ LD(x2, xRDI, 0);
+ emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5, x6);
+ } else {
+ ZEXTH(x1, xRAX);
+ LHU(x2, xRDI, 0);
+ emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ }
+ ADD(xRDI, xRDI, x3);
+ break;
+ }
+ break;
+
+ case 0xB8:
+ case 0xB9:
+ case 0xBA:
+ case 0xBB:
+ case 0xBC:
+ case 0xBD:
+ case 0xBE:
+ case 0xBF:
+ INST_NAME("MOV Reg, Iw");
+ gd = xRAX+(opcode&7)+(rex.b<<3);
+ if(rex.w) {
+ u64 = F64;
+ MOV64x(gd, u64);
+ } else {
+ u16 = F16;
+ MOV64x(x1, ~0xffff);
+ AND(gd, gd, x1);
+ if(u16<2048) {
+ ORI(gd, gd, u16);
+ } else {
+ MOV32w(x1, u16);
+ OR(gd, gd, x1);
+ }
+ }
+ break;
+
+ case 0xC1:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("ROL Ew, Ib");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ SETFLAGS(X_OF|X_CF, SF_SET);
+ GETEW(x1, 1);
+ u8 = F8;
+ MOV32w(x2, u8);
+ CALL_(rol16, x1, x3);
+ EWBACK;
+ break;
+ case 1:
+ INST_NAME("ROR Ew, Ib");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ SETFLAGS(X_OF|X_CF, SF_SET);
+ GETEW(x1, 1);
+ u8 = F8;
+ MOV32w(x2, u8);
+ CALL_(ror16, x1, x3);
+ EWBACK;
+ break;
+ case 2:
+ INST_NAME("RCL Ew, Ib");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ READFLAGS(X_CF);
+ SETFLAGS(X_OF|X_CF, SF_SET);
+ GETEW(x1, 1);
+ u8 = F8;
+ MOV32w(x2, u8);
+ CALL_(rcl16, x1, x3);
+ EWBACK;
+ break;
+ case 3:
+ INST_NAME("RCR Ew, Ib");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ READFLAGS(X_CF);
+ SETFLAGS(X_OF|X_CF, SF_SET);
+ GETEW(x1, 1);
+ u8 = F8;
+ MOV32w(x2, u8);
+ CALL_(rcr16, x1, x3);
+ EWBACK;
+ break;
+ case 4:
+ case 6:
+ INST_NAME("SHL Ew, Ib");
+ UFLAG_IF {MESSAGE(LOG_DUMP, "Need Optimization for flags\n");}
+ SETFLAGS(X_ALL, SF_PENDING);
+ GETEW(x1, 1);
+ u8 = F8;
+ UFLAG_IF {MOV32w(x2, (u8&0x1f));}
+ UFLAG_OP12(ed, x2)
+ if(MODREG) {
+ SLLI(ed, ed, 48+(u8&0x1f));
+ SRLI(ed, ed, 48);
+ } else {
+ SLLI(ed, ed, u8&0x1f);
+ }
+ EWBACK;
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_shl16);
+ break;
+ case 5:
+ INST_NAME("SHR Ed, Ib");
+ UFLAG_IF {MESSAGE(LOG_DUMP, "Need Optimization for flags\n");}
+ SETFLAGS(X_ALL, SF_PENDING);
+ GETEW(x1, 1);
+ u8 = F8;
+ UFLAG_IF {MOV32w(x2, (u8&0x1f));}
+ UFLAG_OP12(ed, x2)
+ SRLI(ed, ed, u8&0x1f);
+ EWBACK;
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_shr16);
+ break;
+ case 7:
+ INST_NAME("SAR Ed, Ib");
+ SETFLAGS(X_ALL, SF_PENDING);
+ UFLAG_IF {MESSAGE(LOG_DUMP, "Need Optimization for flags\n");}
+ GETSEW(x1, 1);
+ u8 = F8;
+ UFLAG_IF {MOV32w(x2, (u8&0x1f));}
+ UFLAG_OP12(ed, x2)
+ SRAI(ed, ed, u8&0x1f);
+ if(MODREG) {
+ ZEXTH(ed, ed);
+ }
+ EWBACK;
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_sar16);
+ break;
+ }
+ break;
+
+ case 0xC7:
+ INST_NAME("MOV Ew, Iw");
+ nextop = F8;
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ ADDI(x1, xZR, -1);
+ SRLI(x1, x1, 48);
+ AND(ed, ed, x1);
+ u16 = F16;
+ MOV32w(x1, u16);
+ ORI(ed, ed, x1);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 2);
+ u16 = F16;
+ MOV32w(x1, u16);
+ SH(x1, ed, fixedaddress);
+ SMWRITELOCK(lock);
+ }
+ break;
+ case 0xD1:
+ case 0xD3:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 5:
+ if(opcode==0xD1) {
+ INST_NAME("SHR Ew, 1");
+ MOV32w(x4, 1);
+ } else {
+ INST_NAME("SHR Ew, CL");
+ ANDI(x4, xRCX, 0x1f);
+ }
+ UFLAG_IF {MESSAGE(LOG_DUMP, "Need Optimization for flags\n");}
+ SETFLAGS(X_ALL, SF_PENDING);
+ GETEW(x1, 0);
+ UFLAG_OP12(ed, x4)
+ SRL(ed, ed, x4);
+ EWBACK;
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_shr16);
+ break;
+ case 4:
+ case 6:
+ if(opcode==0xD1) {
+ INST_NAME("SHL Ew, 1");
+ MOV32w(x4, 1);
+ } else {
+ INST_NAME("SHL Ew, CL");
+ ANDI(x4, xRCX, 0x1f);
+ }
+ UFLAG_IF {MESSAGE(LOG_DUMP, "Need Optimization for flags\n");}
+ SETFLAGS(X_ALL, SF_PENDING);
+ GETEW(x1, 0);
+ UFLAG_OP12(ed, x4)
+ SLL(ed, ed, x4);
+ ZEXTH(ed, ed);
+ EWBACK;
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_shl16);
+ break;
+ case 7:
+ if(opcode==0xD1) {
+ INST_NAME("SAR Ew, 1");
+ MOV32w(x4, 1);
+ } else {
+ INST_NAME("SAR Ew, CL");
+ ANDI(x4, xRCX, 0x1f);
+ }
+ UFLAG_IF {MESSAGE(LOG_DUMP, "Need Optimization for flags\n");}
+ SETFLAGS(X_ALL, SF_PENDING);
+ GETSEW(x1, 0);
+ UFLAG_OP12(ed, x4);
+ SRA(ed, ed, x4);
+ ZEXTH(ed, ed);
+ EWBACK;
+ UFLAG_RES(ed);
+ UFLAG_DF(x3, d_sar16);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
+ case 0xF0:
+ return dynarec64_66F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+
+ case 0xF7:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ case 1:
+ INST_NAME("TEST Ew, Iw");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEW(x1, 2);
+ u16 = F16;
+ MOV32w(x2, u16);
+ emit_test16(dyn, ninst, x1, x2, x3, x4, x5);
+ break;
+ case 2:
+ INST_NAME("NOT Ew");
+ GETEW(x1, 0);
+ NOT(ed, ed); // No flags affected
+ EWBACK;
+ break;
+ case 3:
+ INST_NAME("NEG Ew");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETEW(x1, 0);
+ emit_neg16(dyn, ninst, ed, x2, x4);
+ EWBACK;
+ break;
+ case 6:
+ INST_NAME("DIV Ew");
+ SETFLAGS(X_ALL, SF_SET);
+ GETEW(x1, 0);
+ ZEXTH(x2, xRAX);
+ SLLI(x3, xRDX, 48);
+ SRLI(x3, x3, 32);
+ OR(x2, x2, x3);
+ DIVUW(x3, x2, ed);
+ REMUW(x4, x2, ed);
+ MOV64x(x5, ~0xffff);
+ AND(xRAX, xRAX, x5);
+ AND(xRDX, xRDX, x5);
+ NOT(x5, x5);
+ AND(x3, x3, x5);
+ AND(x4, x4, x5);
+ OR(xRAX, xRAX, x3);
+ OR(xRDX, xRDX, x4);
+ break;
+ case 7:
+ INST_NAME("IDIV Ew");
+ NOTEST(x1);
+ SETFLAGS(X_ALL, SF_SET);
+ GETSEW(x1, 0);
+ ZEXTH(x2, xRAX);
+ SLLI(x3, xRDX, 48);
+ SRLI(x3, x3, 32);
+ OR(x2, x2, x3);
+ DIVW(x3, x2, ed);
+ REMW(x4, x2, ed);
+ MOV64x(x5, ~0xffff);
+ AND(xRAX, xRAX, x5);
+ AND(xRDX, xRDX, x5);
+ NOT(x5, x5);
+ AND(x3, x3, x5);
+ AND(x4, x4, x5);
+ OR(xRAX, xRAX, x3);
+ OR(xRDX, xRDX, x4);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
+ case 0xFF:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("INC Ew");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ GETEW(x1, 0);
+ emit_inc16(dyn, ninst, x1, x2, x4, x5);
+ EWBACK;
+ break;
+ case 1:
+ INST_NAME("DEC Ew");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ GETEW(x1, 0);
+ emit_dec16(dyn, ninst, x1, x2, x4, x5, x6);
+ EWBACK;
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
+ default:
+ DEFAULT;
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_660f.c b/src/dynarec/rv64/dynarec_rv64_660f.c
new file mode 100644
index 0000000..c60d214
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_660f.c
@@ -0,0 +1,2644 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog)
+{
+ (void)ip; (void)need_epilog;
+
+ uint8_t opcode = F8;
+ uint8_t nextop, u8, s8;
+ int32_t i32;
+ uint8_t gd, ed;
+ uint8_t wback, wb1, wb2, gback;
+ uint8_t eb1, eb2;
+ int64_t j64;
+ uint64_t tmp64u, tmp64u2;
+ int v0, v1;
+ int q0, q1;
+ int d0, d1;
+ int64_t fixedaddress, gdoffset;
+ int unscaled;
+
+ MAYUSE(d0);
+ MAYUSE(d1);
+ MAYUSE(q0);
+ MAYUSE(q1);
+ MAYUSE(eb1);
+ MAYUSE(eb2);
+ MAYUSE(j64);
+
+ static const int8_t round_round[] = { RD_RNE, RD_RDN, RD_RUP, RD_RTZ };
+
+ switch(opcode) {
+ case 0x10:
+ INST_NAME("MOVUPD Gx,Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_MV_Q(x3);
+ break;
+ case 0x11:
+ INST_NAME("MOVUPD Ex,Gx");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_MV_Q2(x3);
+ if(!MODREG) SMWRITE2();
+ break;
+ case 0x12:
+ INST_NAME("MOVLPD Gx, Eq");
+ nextop = F8;
+ GETGX();
+ if(MODREG) {
+ // access register instead of memory is bad opcode!
+ DEFAULT;
+ return addr;
+ }
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0);
+ LD(x3, wback, fixedaddress);
+ SD(x3, gback, gdoffset+0);
+ break;
+ case 0x13:
+ INST_NAME("MOVLPD Eq, Gx");
+ nextop = F8;
+ GETGX();
+ if(MODREG) {
+ // access register instead of memory is bad opcode!
+ DEFAULT;
+ return addr;
+ }
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0);
+ LD(x3, gback, gdoffset+0);
+ SD(x3, wback, fixedaddress);
+ SMWRITE2();
+ break;
+ case 0x14:
+ INST_NAME("UNPCKLPD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ // GX->q[1] = EX->q[0];
+ LD(x3, wback, fixedaddress+0);
+ SD(x3, gback, gdoffset+8);
+ break;
+ case 0x15:
+ INST_NAME("UNPCKHPD Gx, Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ // GX->q[0] = GX->q[1];
+ LD(x3, gback, gdoffset+8);
+ SD(x3, gback, gdoffset+0);
+ // GX->q[1] = EX->q[1];
+ LD(x3, wback, fixedaddress+8);
+ SD(x3, gback, gdoffset+8);
+ break;
+ case 0x16:
+ INST_NAME("MOVHPD Gx, Eq");
+ nextop = F8;
+ GETGX();
+ if(MODREG) {
+ // access register instead of memory is bad opcode!
+ DEFAULT;
+ return addr;
+ }
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0);
+ LD(x3, wback, fixedaddress);
+ SD(x3, gback, gdoffset+8);
+ break;
+ case 0x1F:
+ INST_NAME("NOP (multibyte)");
+ nextop = F8;
+ FAKEED;
+ break;
+ case 0x28:
+ INST_NAME("MOVAPD Gx,Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_MV_Q(x3);
+ break;
+ case 0x29:
+ INST_NAME("MOVAPD Ex,Gx");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_MV_Q2(x3);
+ if(!MODREG) SMWRITE2();
+ break;
+ case 0x2B:
+ INST_NAME("MOVNTPD Ex, Gx");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_MV_Q2(x3);
+ break;
+ case 0x2E:
+ // no special check...
+ case 0x2F:
+ if(opcode==0x2F) {INST_NAME("COMISD Gx, Ex");} else {INST_NAME("UCOMISD Gx, Ex");}
+ SETFLAGS(X_ALL, SF_SET);
+ SET_DFNONE();
+ nextop = F8;
+ GETGXSD(d0);
+ GETEXSD(v0, 0);
+ CLEAR_FLAGS();
+ // if isnan(d0) || isnan(v0)
+ IFX(X_ZF | X_PF | X_CF) {
+ FEQD(x3, d0, d0);
+ FEQD(x2, v0, v0);
+ AND(x2, x2, x3);
+ BNE_MARK(x2, xZR);
+ ORI(xFlags, xFlags, (1<<F_ZF) | (1<<F_PF) | (1<<F_CF));
+ B_NEXT_nocond;
+ }
+ MARK;
+ // else if isless(d0, v0)
+ IFX(X_CF) {
+ FLTD(x2, d0, v0);
+ BEQ_MARK2(x2, xZR);
+ ORI(xFlags, xFlags, 1<<F_CF);
+ B_NEXT_nocond;
+ }
+ MARK2;
+ // else if d0 == v0
+ IFX(X_ZF) {
+ FEQD(x2, d0, v0);
+ CBZ_NEXT(x2);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ }
+ break;
+ case 0x38: // SSSE3 opcodes
+ nextop = F8;
+ switch(nextop) {
+ case 0x00:
+ INST_NAME("PSHUFB Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ sse_forget_reg(dyn, ninst, x5);
+
+ ADDI(x5, xEmu, offsetof(x64emu_t, scratch));
+
+ // perserve gd
+ LD(x3, gback, gdoffset+0);
+ LD(x4, gback, gdoffset+8);
+ SD(x3, x5, 0);
+ SD(x4, x5, 8);
+
+ for (int i=0; i<16; ++i) {
+ LBU(x3, wback, fixedaddress+i);
+ ANDI(x4, x3, 128);
+ BEQZ(x4, 12);
+ SB(xZR, gback, gdoffset+i);
+ BEQZ(xZR, 20); // continue
+ ANDI(x4, x3, 15);
+ ADD(x4, x4, x5);
+ LBU(x4, x4, 0);
+ SB(x4, gback, gdoffset+i);
+ }
+ break;
+ case 0x01:
+ INST_NAME("PHADDW Gx, Ex");
+ nextop = F8;
+ GETGX();
+ for (int i=0; i<4; ++i) {
+ // GX->sw[i] = GX->sw[i*2+0]+GX->sw[i*2+1];
+ LH(x3, gback, gdoffset+2*(i*2+0));
+ LH(x4, gback, gdoffset+2*(i*2+1));
+ ADDW(x3, x3, x4);
+ SH(x3, gback, gdoffset+2*i);
+ }
+ if (MODREG && gd==(nextop&7)+(rex.b<<3)) {
+ // GX->q[1] = GX->q[0];
+ LD(x3, gback, gdoffset+0);
+ SD(x3, gback, gdoffset+8);
+ } else {
+ GETEX(x2, 0);
+ for (int i=0; i<4; ++i) {
+ // GX->sw[4+i] = EX->sw[i*2+0] + EX->sw[i*2+1];
+ LH(x3, wback, fixedaddress+2*(i*2+0));
+ LH(x4, wback, fixedaddress+2*(i*2+1));
+ ADDW(x3, x3, x4);
+ SH(x3, gback, gdoffset+2*(4+i));
+ }
+ }
+ break;
+ case 0x02:
+ INST_NAME("PHADDD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ // GX->sd[0] += GX->sd[1];
+ LW(x3, gback, gdoffset+0*4);
+ LW(x4, gback, gdoffset+1*4);
+ ADDW(x3, x3, x4);
+ SW(x3, gback, gdoffset+0*4);
+ // GX->sd[1] = GX->sd[2] + GX->sd[3];
+ LW(x3, gback, gdoffset+2*4);
+ LW(x4, gback, gdoffset+3*4);
+ ADDW(x3, x3, x4);
+ SW(x3, gback, gdoffset+1*4);
+ if (MODREG && gd==(nextop&7)+(rex.b<<3)) {
+ // GX->q[1] = GX->q[0];
+ LD(x3, gback, gdoffset+0);
+ SD(x3, gback, gdoffset+8);
+ } else {
+ GETEX(x2, 0);
+ // GX->sd[2] = EX->sd[0] + EX->sd[1];
+ LW(x3, wback, fixedaddress+0*4);
+ LW(x4, wback, fixedaddress+1*4);
+ ADDW(x3, x3, x4);
+ SW(x3, gback, gdoffset+2*4);
+ // GX->sd[3] = EX->sd[2] + EX->sd[3];
+ LW(x3, wback, fixedaddress+2*4);
+ LW(x4, wback, fixedaddress+3*4);
+ ADDW(x3, x3, x4);
+ SW(x3, gback, gdoffset+3*4);
+ }
+ break;
+
+ case 0x04:
+ INST_NAME("PADDUBSW Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ MOV64x(x5, 32767);
+ MOV64x(x6, -32768);
+ for(int i=0; i<8; ++i) {
+ LBU(x3, gback, gdoffset+i*2);
+ LB(x4, wback, fixedaddress+i*2);
+ MUL(x9, x3, x4);
+ LBU(x3, gback, gdoffset+i*2+1);
+ LB(x4, wback, fixedaddress+i*2+1);
+ MUL(x3, x3, x4);
+ ADD(x3, x3, x9);
+ if(rv64_zbb) {
+ MIN(x3, x3, x5);
+ MAX(x3, x3, x6);
+ } else {
+ BLT(x3, x5, 4+4);
+ MV(x3, x5);
+ BLT(x6, x3, 4+4);
+ MV(x3, x6);
+ }
+ SH(x3, gback, gdoffset+i*2);
+ }
+ break;
+
+ case 0x08:
+ INST_NAME("PSIGNB Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<16; ++i) {
+ LB(x3, gback, gdoffset+i);
+ LB(x4, wback, fixedaddress+i);
+ BGE(x4, xZR, 4+4);
+ NEG(x3, x3);
+ BNE(x4, xZR, 4+4);
+ MOV_U12(x3, 0);
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0x09:
+ INST_NAME("PSIGNW Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ LH(x3, gback, gdoffset+i*2);
+ LH(x4, wback, fixedaddress+i*2);
+ BGE(x4, xZR, 4+4);
+ NEG(x3, x3);
+ BNE(x4, xZR, 4+4);
+ MOV_U12(x3, 0);
+ SH(x3, gback, gdoffset+i*2);
+ }
+ break;
+ case 0x0A:
+ INST_NAME("PSIGND Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<4; ++i) {
+ LW(x3, gback, gdoffset+i*4);
+ LW(x4, wback, fixedaddress+i*4);
+ BGE(x4, xZR, 4+4);
+ NEG(x3, x3);
+ BNE(x4, xZR, 4+4);
+ ADDI(x3, xZR, 0);
+ SW(x3, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x0B:
+ INST_NAME("PMULHRSW Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ LH(x3, gback, gdoffset+i*2);
+ LH(x4, wback, fixedaddress+i*2);
+ MUL(x3, x3, x4);
+ SRAI(x3, x3, 14);
+ ADDI(x3, x3, 1);
+ SRAI(x3, x3, 1);
+ SH(x3, gback, gdoffset+i*2);
+ }
+ break;
+ case 0x10:
+ INST_NAME("PBLENDVB Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ sse_forget_reg(dyn, ninst, 0); // forget xmm[0]
+ for (int i=0; i<16; ++i) {
+ LB(x3, xEmu, offsetof(x64emu_t, xmm[0])+i);
+ BGE(x3, xZR, 12); // continue
+ LBU(x3, wback, fixedaddress+i);
+ SB(x3, gback, gdoffset+i);
+ // continue
+ }
+ break;
+ case 0x17:
+ INST_NAME("PTEST Gx, Ex");
+ nextop = F8;
+ SETFLAGS(X_ALL, SF_SET);
+ GETGX();
+ GETEX(x2, 0);
+ CLEAR_FLAGS();
+ SET_DFNONE();
+ IFX(X_ZF|X_CF) {
+ LD(x5, wback, fixedaddress+0);
+ LD(x6, wback, fixedaddress+8);
+
+ IFX(X_ZF) {
+ LD(x3, gback, gdoffset+0);
+ LD(x4, gback, gdoffset+8);
+ AND(x3, x3, x5);
+ AND(x4, x4, x6);
+ OR(x3, x3, x4);
+ BNEZ(x3, 8);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ }
+ IFX(X_CF) {
+ LD(x3, gback, gdoffset+0);
+ NOT(x3, x3);
+ LD(x4, gback, gdoffset+8);
+ NOT(x4, x4);
+ AND(x3, x3, x5);
+ AND(x4, x4, x6);
+ OR(x3, x3, x4);
+ BNEZ(x3, 8);
+ ORI(xFlags, xFlags, 1<<F_CF);
+ }
+ }
+ break;
+
+ case 0x1C:
+ INST_NAME("PABSB Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<16; ++i) {
+ LB(x4, wback, fixedaddress+i);
+ BGE(x4, xZR, 4+4);
+ NEG(x4, x4);
+ SB(x4, gback, gdoffset+i);
+ }
+ break;
+ case 0x1D:
+ INST_NAME("PABSW Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ LH(x4, wback, fixedaddress+i*2);
+ BGE(x4, xZR, 4+4);
+ NEG(x4, x4);
+ SH(x4, gback, gdoffset+i*2);
+ }
+ break;
+ case 0x1E:
+ INST_NAME("PABSD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ MOV64x(x5, ~(1<<31));
+ for(int i=0; i<4; ++i) {
+ LW(x4, wback, fixedaddress+i*4);
+ BGE(x4, xZR, 4+4);
+ NEG(x4, x4);
+ SW(x4, gback, gdoffset+i*4);
+ }
+ break;
+
+ case 0x2B:
+ INST_NAME("PACKUSDW Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ MOV64x(x5, 65535);
+ for(int i=0; i<4; ++i) {
+ LW(x3, gback, gdoffset+i*4);
+ if(rv64_zbb) {
+ MIN(x3, x3, x5);
+ MAX(x3, x3, xZR);
+ } else {
+ BGE(x3, xZR, 4+4);
+ MV(x3, xZR);
+ BLT(x3, x5, 4+4);
+ MV(x3, x5);
+ }
+ SH(x3, gback, gdoffset+i*2);
+ }
+ if(MODREG && gd==ed) {
+ LD(x3, gback, gdoffset+0);
+ SD(x3, gback, gdoffset+8);
+ } else for(int i=0; i<4; ++i) {
+ LW(x3, wback, fixedaddress+i*4);
+ if(rv64_zbb) {
+ MIN(x3, x3, x5);
+ MAX(x3, x3, xZR);
+ } else {
+ BGE(x3, xZR, 4+4);
+ MV(x3, xZR);
+ BLT(x3, x5, 4+4);
+ MV(x3, x5);
+ }
+ SH(x3, gback, gdoffset+8+i*2);
+ }
+ break;
+
+ case 0x30:
+ INST_NAME("PMOVZXBW Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=7; i>=0; --i) {
+ LBU(x3, wback, fixedaddress+i);
+ SH(x3, gback, gdoffset+i*2);
+ }
+ break;
+ case 0x31:
+ INST_NAME("PMOVZXBD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=3; i>=0; --i) {
+ LBU(x3, wback, fixedaddress+i);
+ SW(x3, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x32:
+ INST_NAME("PMOVZXBQ Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=1; i>=0; --i) {
+ LBU(x3, wback, fixedaddress+i);
+ SD(x3, gback, gdoffset+i*8);
+ }
+ break;
+ case 0x33:
+ INST_NAME("PMOVZXWD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=3; i>=0; --i) {
+ LHU(x3, wback, fixedaddress+i*2);
+ SW(x3, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x34:
+ INST_NAME("PMOVZXWQ Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=1; i>=0; --i) {
+ LHU(x3, wback, fixedaddress+i*2);
+ SD(x3, gback, gdoffset+i*8);
+ }
+ break;
+ case 0x35:
+ INST_NAME("PMOVZXDQ Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=1; i>=0; --i) {
+ LWU(x3, wback, fixedaddress+i*4);
+ SD(x3, gback, gdoffset+i*8);
+ }
+ break;
+
+ case 0x38:
+ INST_NAME("PMINSB Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<16; ++i) {
+ LB(x3, gback, gdoffset+i);
+ LB(x4, wback, fixedaddress+i);
+ if(rv64_zbb) MIN(x4, x3, x4); else BLT(x3, x4, 4+4);
+ SB(x4, gback, gdoffset+i);
+ }
+ break;
+ case 0x39:
+ INST_NAME("PMINSD Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<4; ++i) {
+ LW(x3, gback, gdoffset+i*4);
+ LW(x4, wback, fixedaddress+i*4);
+ if(rv64_zbb) MIN(x4, x3, x4); else BLT(x3, x4, 4+4);
+ SW(x4, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x3A:
+ INST_NAME("PMINUW Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ LHU(x3, gback, gdoffset+i*2);
+ LHU(x4, wback, fixedaddress+i*2);
+ if(rv64_zbb) MINU(x4, x3, x4); else BLTU(x3, x4, 4+4);
+ SH(x4, gback, gdoffset+i*2);
+ }
+ break;
+ case 0x3B:
+ INST_NAME("PMINUD Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<4; ++i) {
+ LWU(x3, gback, gdoffset+i*4);
+ LWU(x4, wback, fixedaddress+i*4);
+ if(rv64_zbb) MINU(x4, x3, x4); else BLTU(x3, x4, 4+4);
+ SW(x4, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x3C:
+ INST_NAME("PMAXSB Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<16; ++i) {
+ LB(x3, gback, gdoffset+i);
+ LB(x4, wback, fixedaddress+i);
+ if(rv64_zbb) MAX(x4, x3, x4); else BLT(x4, x3, 4+4);
+ SB(x4, gback, gdoffset+i);
+ }
+ break;
+ case 0x3D:
+ INST_NAME("PMAXSD Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<4; ++i) {
+ LW(x3, gback, gdoffset+i*4);
+ LW(x4, wback, fixedaddress+i*4);
+ if(rv64_zbb) MAX(x4, x3, x4); else BLT(x4, x3, 4+4);
+ SW(x4, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x3E:
+ INST_NAME("PMAXUW Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ LHU(x3, gback, gdoffset+i*2);
+ LHU(x4, wback, fixedaddress+i*2);
+ if(rv64_zbb) MAXU(x4, x3, x4); else BLTU(x4, x3, 4+4);
+ SH(x4, gback, gdoffset+i*2);
+ }
+ break;
+ case 0x3F:
+ INST_NAME("PMAXUD Gx, Ex"); // SSE4 opcode!
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<4; ++i) {
+ LWU(x3, gback, gdoffset+i*4);
+ LWU(x4, wback, fixedaddress+i*4);
+ if(rv64_zbb) MAXU(x4, x3, x4); else BLTU(x4, x3, 4+4);
+ SW(x4, gback, gdoffset+i*4);
+ }
+ break;
+ case 0x40:
+ INST_NAME("PMULLD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<4; ++i) {
+ LW(x3, gback, gdoffset+i*4);
+ LW(x4, wback, fixedaddress+i*4);
+ MUL(x3, x3, x4);
+ SW(x3, gback, gdoffset+i*4);
+ }
+ break;
+ case 0xDB:
+ INST_NAME("AESIMC Gx, Ex"); // AES-NI
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_MV_Q(x3);
+ sse_forget_reg(dyn, ninst, gd);
+ MOV32w(x1, gd);
+ CALL(native_aesimc, -1);
+ break;
+ case 0xDC:
+ INST_NAME("AESENC Gx, Ex"); // AES-NI
+ nextop = F8;
+ GETG;
+ sse_forget_reg(dyn, ninst, gd);
+ MOV32w(x1, gd);
+ CALL(native_aese, -1);
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4));
+ break;
+ case 0xDD:
+ INST_NAME("AESENCLAST Gx, Ex"); // AES-NI
+ nextop = F8;
+ GETG;
+ sse_forget_reg(dyn, ninst, gd);
+ MOV32w(x1, gd);
+ CALL(native_aeselast, -1);
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4));
+ break;
+ case 0xDE:
+ INST_NAME("AESDEC Gx, Ex"); // AES-NI
+ nextop = F8;
+ GETG;
+ sse_forget_reg(dyn, ninst, gd);
+ MOV32w(x1, gd);
+ CALL(native_aesd, -1);
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4));
+ break;
+
+ case 0xDF:
+ INST_NAME("AESDECLAST Gx, Ex"); // AES-NI
+ nextop = F8;
+ GETG;
+ sse_forget_reg(dyn, ninst, gd);
+ MOV32w(x1, gd);
+ CALL(native_aesdlast, -1);
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4));
+ break;
+ case 0xF0:
+ INST_NAME("MOVBE Gw, Ew");
+ nextop=F8;
+ GETGD;
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 1);
+ LHU(x1, ed, fixedaddress);
+ if (rv64_zbb) {
+ REV8(x1, x1);
+ SRLI(x1, x1, 48);
+ } else {
+ ANDI(x2, x1, 0xff);
+ SLLI(x2, x2, 8);
+ SRLI(x1, x1, 8);
+ OR(x1, x1, x2);
+ }
+ LUI(x2, 0xffff0);
+ AND(gd, gd, x2);
+ OR(gd, gd, x1);
+ break;
+ case 0xF1:
+ INST_NAME("MOVBE Ew, Gw");
+ nextop=F8;
+ GETGD;
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 0, 1);
+ if (rv64_zbb) {
+ REV8(x1, gd);
+ SRLI(x1, x1, 48);
+ } else {
+ ANDI(x1, gd, 0xff);
+ SLLI(x1, x1, 8);
+ SRLI(x2, gd, 8);
+ ANDI(x2, x2, 0xff);
+ OR(x1, x1, x2);
+ }
+ SH(x1, wback, fixedaddress);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0x3A: // these are some more SSSE3+ opcodes
+ opcode = F8;
+ switch(opcode) {
+ case 0x0B:
+ INST_NAME("ROUNDSD Gx, Ex, Ib");
+ nextop = F8;
+ GETEXSD(d0, 1);
+ GETGXSD_empty(v0);
+ d1 = fpu_get_scratch(dyn);
+ v1 = fpu_get_scratch(dyn);
+ u8 = F8;
+ FEQD(x2, d0, d0);
+ BNEZ_MARK(x2);
+ if (v0!=d0) FMVD(v0, d0);
+ B_NEXT_nocond;
+ MARK; // d0 is not nan
+ FABSD(v1, d0);
+ MOV64x(x3, 1ULL << __DBL_MANT_DIG__);
+ FCVTDL(d1, x3, RD_RTZ);
+ FLTD(x3, v1, d1);
+ BNEZ_MARK2(x3);
+ if (v0!=d0) FMVD(v0, d0);
+ B_NEXT_nocond;
+ MARK2;
+ if(u8&4) {
+ u8 = sse_setround(dyn, ninst, x4, x2);
+ FCVTLD(x5, d0, RD_DYN);
+ FCVTDL(v0, x5, RD_RTZ);
+ x87_restoreround(dyn, ninst, u8);
+ } else {
+ FCVTLD(x5, d0, round_round[u8&3]);
+ FCVTDL(v0, x5, RD_RTZ);
+ }
+ break;
+ case 0x09:
+ INST_NAME("ROUNDPD Gx, Ex, Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ d0 = fpu_get_scratch(dyn);
+ d1 = fpu_get_scratch(dyn);
+ v1 = fpu_get_scratch(dyn);
+ MOV64x(x3, 1ULL << __DBL_MANT_DIG__);
+ FCVTDL(d1, x3, RD_RTZ);
+
+ // i = 0
+ FLD(d0, wback, fixedaddress);
+ FEQD(x4, d0, d0);
+ BNEZ(x4, 8);
+ B_MARK_nocond;
+ // d0 is not nan
+ FABSD(v1, d0);
+ FLTD(x4, v1, d1);
+ BNEZ(x4, 8);
+ B_MARK_nocond;
+ if(u8&4) {
+ u8 = sse_setround(dyn, ninst, x4, x5);
+ FCVTLD(x5, d0, RD_DYN);
+ FCVTDL(d0, x5, RD_RTZ);
+ x87_restoreround(dyn, ninst, u8);
+ } else {
+ FCVTLD(x5, d0, round_round[u8&3]);
+ FCVTDL(d0, x5, RD_RTZ);
+ }
+ MARK;
+ FSD(d0, gback, gdoffset+0);
+
+ // i = 1
+ FLD(d0, wback, fixedaddress+8);
+ FEQD(x4, d0, d0);
+ BNEZ(x4, 8);
+ B_MARK2_nocond;
+ // d0 is not nan
+ FABSD(v1, d0);
+ FLTD(x4, v1, d1);
+ BNEZ(x4, 8);
+ B_MARK2_nocond;
+ if(u8&4) {
+ u8 = sse_setround(dyn, ninst, x4, x5);
+ FCVTLD(x5, d0, RD_DYN);
+ FCVTDL(d0, x5, RD_RTZ);
+ x87_restoreround(dyn, ninst, u8);
+ } else {
+ FCVTLD(x5, d0, round_round[u8&3]);
+ FCVTDL(d0, x5, RD_RTZ);
+ }
+ MARK2;
+ FSD(d0, gback, gdoffset+8);
+ break;
+ case 0x0E:
+ INST_NAME("PBLENDW Gx, Ex, Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ i32 = 0;
+ if (MODREG && gd==ed) break;
+ while (u8)
+ if(u8&1) {
+ if(!(i32&1) && u8&2) {
+ if(!(i32&3) && (u8&0xf)==0xf) {
+ // whole 64bits
+ LD(x3, wback, fixedaddress+8*(i32>>2));
+ SD(x3, gback, gdoffset+8*(i32>>2));
+ i32+=4;
+ u8>>=4;
+ } else {
+ // 32bits
+ LWU(x3, wback, fixedaddress+4*(i32>>1));
+ SW(x3, gback, gdoffset+4*(i32>>1));
+ i32+=2;
+ u8>>=2;
+ }
+ } else {
+ // 16 bits
+ LHU(x3, wback, fixedaddress+2*i32);
+ SH(x3, gback, gdoffset+2*i32);
+ i32++;
+ u8>>=1;
+ }
+ } else {
+ // nope
+ i32++;
+ u8>>=1;
+ }
+ break;
+ case 0x0F:
+ INST_NAME("PALIGNR Gx, Ex, Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ sse_forget_reg(dyn, ninst, x5);
+ ADDI(x5, xEmu, offsetof(x64emu_t, scratch));
+ // perserve gd
+ LD(x3, gback, gdoffset+0);
+ LD(x4, gback, gdoffset+8);
+ SD(x3, x5, 0);
+ SD(x4, x5, 8);
+ if(u8>31) {
+ SD(xZR, gback, gdoffset+0);
+ SD(xZR, gback, gdoffset+8);
+ } else {
+ for (int i=0; i<16; ++i, ++u8) {
+ if (u8>15) {
+ if(u8>31) {
+ SB(xZR, gback, gdoffset+i);
+ continue;
+ }
+ else LBU(x3, x5, u8-16);
+ } else {
+ LBU(x3, wback, fixedaddress+u8);
+ }
+ SB(x3, gback, gdoffset+i);
+ }
+ }
+ break;
+ case 0x16:
+ if(rex.w) {INST_NAME("PEXTRQ Ed, Gx, Ib");} else {INST_NAME("PEXTRD Ed, Gx, Ib");}
+ nextop = F8;
+ GETGX();
+ GETED(1);
+ u8 = F8;
+ if(rex.w)
+ LD(ed, gback, gdoffset+8*(u8&1));
+ else
+ LWU(ed, gback, gdoffset+4*(u8&3));
+ if (wback) {
+ SDxw(ed, wback, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+ case 0x20:
+ INST_NAME("PINSRB Gx, ED, Ib");
+ nextop = F8;
+ GETGX();
+ GETED(1);
+ u8 = F8;
+ SB(ed, gback, gdoffset+u8&0xF);
+ break;
+ case 0x21:
+ INST_NAME("INSERTPS GX, EX, Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ if(MODREG) s8 = (u8>>6)&3; else s8 = 0;
+ // GX->ud[(tmp8u>>4)&3] = EX->ud[tmp8s];
+ LWU(x3, wback, fixedaddress+4*s8);
+ SW(x3, gback, gdoffset+4*(u8>>4));
+ for(int i=0; i<4; ++i) {
+ if(u8&(1<<i))
+ // GX->ud[i] = 0;
+ SW(xZR, gback, gdoffset+4*i);
+ }
+ break;
+ case 0x22:
+ INST_NAME("PINSRD Gx, ED, Ib");
+ nextop = F8;
+ GETGX();
+ GETED(1);
+ u8 = F8;
+ if(rex.w) {
+ SD(ed, gback, gdoffset+8*(u8&0x1));
+ } else {
+ SW(ed, gback, gdoffset+4*(u8&0x3));
+ }
+ break;
+ case 0x44:
+ INST_NAME("PCLMULQDQ Gx, Ex, Ib");
+ nextop = F8;
+ GETG;
+ sse_forget_reg(dyn, ninst, gd);
+ MOV32w(x1, gd); // gx
+ if(MODREG) {
+ ed = (nextop&7)+(rex.b<<3);
+ sse_forget_reg(dyn, ninst, ed);
+ MOV32w(x2, ed);
+ MOV32w(x3, 0); // p = NULL
+ } else {
+ MOV32w(x2, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, x5, &fixedaddress, rex, NULL, 0, 1);
+ if(ed!=x3) {
+ MV(x3, ed);
+ }
+ }
+ u8 = F8;
+ MOV32w(x4, u8);
+ CALL(native_pclmul, -1);
+ break;
+ case 0xDF:
+ INST_NAME("AESKEYGENASSIST Gx, Ex, Ib"); // AES-NI
+ nextop = F8;
+ GETG;
+ sse_forget_reg(dyn, ninst, gd);
+ MOV32w(x1, gd); // gx
+ if(MODREG) {
+ ed = (nextop&7)+(rex.b<<3);
+ sse_forget_reg(dyn, ninst, ed);
+ MOV32w(x2, ed);
+ MOV32w(x3, 0); //p = NULL
+ } else {
+ MOV32w(x2, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 1);
+ if(ed!=x3) {
+ MV(x3, ed);
+ }
+ }
+ u8 = F8;
+ MOV32w(x4, u8);
+ CALL(native_aeskeygenassist, -1);
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ #define GO(GETFLAGS, NO, YES, F) \
+ READFLAGS(F); \
+ GETFLAGS; \
+ nextop=F8; \
+ GETGD; \
+ if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ ZEXTH(x4, ed); \
+ ed = x4; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x4, &fixedaddress, rex, NULL, 1, 0); \
+ LHU(x4, ed, fixedaddress); \
+ ed = x4; \
+ } \
+ B##NO(x1, 4+3*4); \
+ LUI(x3, 0xffff0); \
+ AND(gd, gd, x3); \
+ OR(gd, gd, ed);
+
+ GOCOND(0x40, "CMOV", "Gw, Ew");
+ #undef GO
+ case 0x50:
+ INST_NAME("PMOVMSKD Gd, Ex");
+ nextop = F8;
+ GETGD;
+ GETEX(x1, 0);
+ MV(gd, xZR);
+ for(int i=0; i<2; ++i) {
+ // GD->dword[0] |= ((EX->q[i]>>63)&1)<<i;
+ LD(x2, wback, fixedaddress+8*i);
+ SRLI(x2, x2, 63);
+ if (i) SLLI(x2, x2, 1);
+ OR(gd, gd, x2);
+ }
+ break;
+ case 0x51:
+ INST_NAME("SQRTPD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ d0 = fpu_get_scratch(dyn);
+ if(!box64_dynarec_fastnan) {
+ d1 = fpu_get_scratch(dyn);
+ FMVDX(d1, xZR);
+ }
+ for (int i=0; i<2; ++i) {
+ FLD(d0, wback, fixedaddress+i*8);
+ if(!box64_dynarec_fastnan) {
+ FLTD(x3, d0, d1);
+ }
+ FSQRTD(d0, d0);
+ if(!box64_dynarec_fastnan) {
+ BEQ(x3, xZR, 8);
+ FNEGD(d0, d0);
+ }
+ FSD(d0, gback, gdoffset+i*8);
+ }
+ break;
+ case 0x54:
+ INST_NAME("ANDPD Gx, Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_Q(x3, x4, AND(x3, x3, x4));
+ break;
+ case 0x55:
+ INST_NAME("ANDNPD Gx, Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_Q(x3, x4, NOT(x3, x3); AND(x3, x3, x4));
+ break;
+ case 0x56:
+ INST_NAME("ORPD Gx, Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_Q(x3, x4, OR(x3, x3, x4));
+ break;
+ case 0x57:
+ INST_NAME("XORPD Gx, Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4));
+ break;
+ case 0x58:
+ INST_NAME("ADDPD Gx, Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_FQ(x3, x4, {
+ if(!box64_dynarec_fastnan) {
+ FEQD(x3, v0, v0);
+ FEQD(x4, v1, v1);
+ }
+ FADDD(v0, v0, v1);
+ if(!box64_dynarec_fastnan) {
+ AND(x3, x3, x4);
+ BEQZ(x3, 16);
+ FEQD(x3, v0, v0);
+ BNEZ(x3, 8);
+ FNEGD(v0, v0);
+ }
+ });
+ break;
+ case 0x59:
+ INST_NAME("MULPD Gx, Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_FQ(x3, x4, {
+ if(!box64_dynarec_fastnan) {
+ FEQD(x3, v0, v0);
+ FEQD(x4, v1, v1);
+ }
+ FMULD(v0, v0, v1);
+ if(!box64_dynarec_fastnan) {
+ AND(x3, x3, x4);
+ BEQZ(x3, 16);
+ FEQD(x3, v0, v0);
+ BNEZ(x3, 8);
+ FNEGD(v0, v0);
+ }
+ });
+ break;
+ case 0x5A:
+ INST_NAME("CVTPD2PS Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ d0 = fpu_get_scratch(dyn);
+ // GX->f[0] = EX->d[0];
+ FLD(d0, wback, fixedaddress+0);
+ FCVTSD(d0, d0);
+ FSD(d0, gback, gdoffset+0);
+ // GX->f[1] = EX->d[1];
+ FLD(d0, wback, fixedaddress+8);
+ FCVTSD(d0, d0);
+ FSD(d0, gback, gdoffset+4);
+ // GX->q[1] = 0;
+ SD(xZR, gback, gdoffset+8);
+ break;
+ case 0x5B:
+ INST_NAME("CVTPS2DQ Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ d0 = fpu_get_scratch(dyn);
+ u8 = sse_setround(dyn, ninst, x6, x4);
+ for (int i=0; i<4; ++i) {
+ FLW(d0, wback, fixedaddress+4*i);
+ FCVTLS(x3, d0, RD_DYN);
+ SEXT_W(x5, x3);
+ SUB(x5, x5, x3);
+ BEQZ(x5, 8);
+ LUI(x3, 0x80000); // INT32_MIN
+ SW(x3, gback, gdoffset+4*i);
+ }
+ x87_restoreround(dyn, ninst, u8);
+ break;
+ case 0x5C:
+ INST_NAME("SUBPD Gx, Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_FQ(x3, x4, {
+ if(!box64_dynarec_fastnan) {
+ FEQD(x3, v0, v0);
+ FEQD(x4, v1, v1);
+ }
+ FSUBD(v0, v0, v1);
+ if(!box64_dynarec_fastnan) {
+ AND(x3, x3, x4);
+ BEQZ(x3, 16);
+ FEQD(x3, v0, v0);
+ BNEZ(x3, 8);
+ FNEGD(v0, v0);
+ }
+ });
+ break;
+ case 0x5D:
+ INST_NAME("MINPD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ d0 = fpu_get_scratch(dyn);
+ d1 = fpu_get_scratch(dyn);
+ for (int i=0; i<2; ++i) {
+ FLD(d0, gback, gdoffset+8*i);
+ FLD(d1, wback, fixedaddress+8*i);
+ FEQD(x3, d0, d0);
+ FEQD(x4, d1, d1);
+ AND(x3, x3, x4);
+ BEQ(x3, xZR, 12);
+ FLTD(x3, d1, d0);
+ BEQ(x3, xZR, 8); // continue
+ FSD(d1, gback, gdoffset+8*i);
+ }
+ break;
+ case 0x5E:
+ INST_NAME("DIVPD Gx, Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_FQ(x3, x4, {
+ if(!box64_dynarec_fastnan) {
+ FEQD(x3, v0, v0);
+ FEQD(x4, v1, v1);
+ }
+ FDIVD(v0, v0, v1);
+ if(!box64_dynarec_fastnan) {
+ AND(x3, x3, x4);
+ BEQZ(x3, 16);
+ FEQD(x3, v0, v0);
+ BNEZ(x3, 8);
+ FNEGD(v0, v0);
+ }
+ });
+ break;
+ case 0x5F:
+ INST_NAME("MAXPD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ d0 = fpu_get_scratch(dyn);
+ d1 = fpu_get_scratch(dyn);
+ for (int i=0; i<2; ++i) {
+ FLD(d0, gback, gdoffset+8*i);
+ FLD(d1, wback, fixedaddress+8*i);
+ FEQD(x3, d0, d0);
+ FEQD(x4, d1, d1);
+ AND(x3, x3, x4);
+ BEQ(x3, xZR, 12);
+ FLTD(x3, d0, d1);
+ BEQ(x3, xZR, 8); // continue
+ FSD(d1, gback, gdoffset+8*i);
+ }
+ break;
+ case 0x60:
+ INST_NAME("PUNPCKLBW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ for(int i=7; i>0; --i) { // 0 is untouched
+ // GX->ub[2 * i] = GX->ub[i];
+ LBU(x3, gback, gdoffset+i);
+ SB(x3, gback, gdoffset+2*i);
+ }
+ if (MODREG && gd==(nextop&7)+(rex.b<<3)) {
+ for(int i=0; i<8; ++i) {
+ // GX->ub[2 * i + 1] = GX->ub[2 * i];
+ LBU(x3, gback, gdoffset+2*i);
+ SB(x3, gback, gdoffset+2*i+1);
+ }
+ } else {
+ GETEX(x1, 0);
+ for(int i=0; i<8; ++i) {
+ // GX->ub[2 * i + 1] = EX->ub[i];
+ LBU(x3, wback, fixedaddress+i);
+ SB(x3, gback, gdoffset+2*i+1);
+ }
+ }
+ break;
+ case 0x61:
+ INST_NAME("PUNPCKLWD Gx,Ex");
+ nextop = F8;
+ GETGX();
+ for(int i=3; i>0; --i) {
+ // GX->uw[2 * i] = GX->uw[i];
+ LHU(x3, gback, gdoffset+i*2);
+ SH(x3, gback, gdoffset+2*i*2);
+ }
+ if (MODREG && gd==(nextop&7)+(rex.b<<3)) {
+ for(int i=0; i<4; ++i) {
+ // GX->uw[2 * i + 1] = GX->uw[2 * i];
+ LHU(x3, gback, gdoffset+2*i*2);
+ SH(x3, gback, gdoffset+(2*i+1)*2);
+ }
+ } else {
+ GETEX(x1, 0);
+ for(int i=0; i<4; ++i) {
+ // GX->uw[2 * i + 1] = EX->uw[i];
+ LHU(x3, wback, fixedaddress+i*2);
+ SH(x3, gback, gdoffset+(2*i+1)*2);
+ }
+ }
+ break;
+ case 0x62:
+ INST_NAME("PUNPCKLDQ Gx,Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ // GX->ud[3] = EX->ud[1];
+ LWU(x3, wback, fixedaddress+1*4);
+ SW(x3, gback, gdoffset+3*4);
+ // GX->ud[2] = GX->ud[1];
+ LWU(x3, gback, gdoffset+1*4);
+ SW(x3, gback, gdoffset+2*4);
+ // GX->ud[1] = EX->ud[0];
+ LWU(x3, wback, fixedaddress+0*4);
+ SW(x3, gback, gdoffset+1*4);
+ break;
+ case 0x63:
+ INST_NAME("PACKSSWB Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ MOV64x(x5, 127);
+ MOV64x(x6, -128);
+ for(int i=0; i<8; ++i) {
+ LH(x3, gback, gdoffset+i*2);
+ if(rv64_zbb) {
+ MIN(x3, x3, x5);
+ MAX(x3, x3, x6);
+ } else {
+ BLT(x3, x5, 4+4);
+ MV(x3, x5);
+ BGE(x3, x6, 4+4);
+ MV(x3, x6);
+ }
+ SB(x3, gback, gdoffset+i);
+ }
+ if(MODREG && gd==ed) {
+ LD(x3, gback, gdoffset+0);
+ SD(x3, gback, gdoffset+8);
+ } else for(int i=0; i<8; ++i) {
+ LH(x3, wback, fixedaddress+i*2);
+ if(rv64_zbb) {
+ MIN(x3, x3, x5);
+ MAX(x3, x3, x6);
+ } else {
+ BLT(x3, x5, 4+4);
+ MV(x3, x5);
+ BGE(x3, x6, 4+4);
+ MV(x3, x6);
+ }
+ SB(x3, gback, gdoffset+8+i);
+ }
+ break;
+ case 0x64:
+ INST_NAME("PCMPGTB Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<16; ++i) {
+ // GX->ub[i] = (GX->sb[i]>EX->sb[i])?0xFF:0x00;
+ LB(x3, wback, fixedaddress+i);
+ LB(x4, gback, gdoffset+i);
+ SLT(x3, x3, x4);
+ NEG(x3, x3);
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0x65:
+ INST_NAME("PCMPGTW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ // GX->uw[i] = (GX->sw[i]>EX->sw[i])?0xFFFF:0x0000;
+ LH(x3, wback, fixedaddress+i*2);
+ LH(x4, gback, gdoffset+i*2);
+ SLT(x3, x3, x4);
+ NEG(x3, x3);
+ SH(x3, gback, gdoffset+i*2);
+ }
+ break;
+ case 0x66:
+ INST_NAME("PCMPGTD Gx,Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ SSE_LOOP_DS(x3, x4, SLT(x4, x4, x3); SLLI(x3, x4, 63); SRAI(x3, x3, 63));
+ break;
+ case 0x67:
+ INST_NAME("PACKUSWB Gx, Ex");
+ nextop = F8;
+ GETGX();
+ ADDI(x5, xZR, 0xFF);
+ for(int i=0; i<8; ++i) {
+ // GX->ub[i] = (GX->sw[i]<0)?0:((GX->sw[i]>0xff)?0xff:GX->sw[i]);
+ LH(x3, gback, gdoffset+i*2);
+ BGE(x5, x3, 8);
+ ADDI(x3, xZR, 0xFF);
+ NOT(x4, x3);
+ SRAI(x4, x4, 63);
+ AND(x3, x3, x4);
+ SB(x3, gback, gdoffset+i);
+ }
+ if (MODREG && gd==(nextop&7)+(rex.b<<3)) {
+ // GX->q[1] = GX->q[0];
+ LD(x3, gback, gdoffset+0*8);
+ SD(x3, gback, gdoffset+1*8);
+ } else {
+ GETEX(x1, 0);
+ for(int i=0; i<8; ++i) {
+ // GX->ub[8+i] = (EX->sw[i]<0)?0:((EX->sw[i]>0xff)?0xff:EX->sw[i]);
+ LH(x3, wback, fixedaddress+i*2);
+ BGE(x5, x3, 8);
+ ADDI(x3, xZR, 0xFF);
+ NOT(x4, x3);
+ SRAI(x4, x4, 63);
+ AND(x3, x3, x4);
+ SB(x3, gback, gdoffset+8+i);
+ }
+ }
+ break;
+ case 0x68:
+ INST_NAME("PUNPCKHBW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ for(int i=0; i<8; ++i) {
+ // GX->ub[2 * i] = GX->ub[i + 8];
+ LBU(x3, gback, gdoffset+i+8);
+ SB(x3, gback, gdoffset+2*i);
+ }
+ if (MODREG && gd==(nextop&7)+(rex.b<<3)) {
+ for(int i=0; i<8; ++i) {
+ // GX->ub[2 * i + 1] = GX->ub[2 * i];
+ LBU(x3, gback, gdoffset+2*i);
+ SB(x3, gback, gdoffset+2*i+1);
+ }
+ } else {
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ // GX->ub[2 * i + 1] = EX->ub[i + 8];
+ LBU(x3, wback, fixedaddress+i+8);
+ SB(x3, gback, gdoffset+2*i+1);
+ }
+ }
+ break;
+ case 0x69:
+ INST_NAME("PUNPCKHWD Gx,Ex");
+ nextop = F8;
+ GETGX();
+ for(int i=0; i<4; ++i) {
+ // GX->uw[2 * i] = GX->uw[i + 4];
+ LHU(x3, gback, gdoffset+(i+4)*2);
+ SH(x3, gback, gdoffset+2*i*2);
+ }
+ if (MODREG && gd==(nextop&7)+(rex.b<<3)) {
+ for(int i=0; i<4; ++i) {
+ // GX->uw[2 * i + 1] = GX->uw[2 * i];
+ LHU(x3, gback, gdoffset+2*i*2);
+ SH(x3, gback, gdoffset+(2*i+1)*2);
+ }
+ } else {
+ GETEX(x1, 0);
+ for(int i=0; i<4; ++i) {
+ // GX->uw[2 * i + 1] = EX->uw[i + 4];
+ LHU(x3, wback, fixedaddress+(i+4)*2);
+ SH(x3, gback, gdoffset+(2*i+1)*2);
+ }
+ }
+ break;
+ case 0x6A:
+ INST_NAME("PUNPCKHDQ Gx,Ex");
+ nextop = F8;
+ GETEX(x1, 0);
+ GETGX();
+ // GX->ud[0] = GX->ud[2];
+ LWU(x3, gback, gdoffset+2*4);
+ SW(x3, gback, gdoffset+0*4);
+ // GX->ud[1] = EX->ud[2];
+ LWU(x3, wback, fixedaddress+2*4);
+ SW(x3, gback, gdoffset+1*4);
+ // GX->ud[2] = GX->ud[3];
+ LWU(x3, gback, gdoffset+3*4);
+ SW(x3, gback, gdoffset+2*4);
+ // GX->ud[3] = EX->ud[3];
+ if (!(MODREG && (gd==ed))) {
+ LWU(x3, wback, fixedaddress+3*4);
+ SW(x3, gback, gdoffset+3*4);
+ }
+ break;
+ case 0x6B:
+ INST_NAME("PACKSSDW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ MOV64x(x5, 32768);
+ NEG(x6, x5);
+ for(int i=0; i<4; ++i) {
+ // GX->sw[i] = (GX->sd[i]<-32768)?-32768:((GX->sd[i]>32767)?32767:GX->sd[i]);
+ LW(x3, gback, gdoffset+i*4);
+ BGE(x5, x3, 8);
+ ADDI(x3, x5, -1);
+ BGE(x3, x6, 8);
+ MV(x3, x6);
+ SH(x3, gback, gdoffset+i*2);
+ }
+ if (MODREG && gd==(nextop&7)+(rex.b<<3)) {
+ // GX->q[1] = GX->q[0];
+ LD(x3, gback, gdoffset+0*8);
+ SD(x3, gback, gdoffset+1*8);
+ } else {
+ GETEX(x1, 0);
+ for(int i=0; i<4; ++i) {
+ // GX->sw[4+i] = (EX->sd[i]<-32768)?-32768:((EX->sd[i]>32767)?32767:EX->sd[i]);
+ LW(x3, wback, fixedaddress+i*4);
+ BGE(x5, x3, 8);
+ ADDI(x3, x5, -1);
+ BGE(x3, x6, 8);
+ MV(x3, x6);
+ SH(x3, gback, gdoffset+(4+i)*2);
+ }
+ }
+ break;
+ case 0x6C:
+ INST_NAME("PUNPCKLQDQ Gx,Ex");
+ nextop = F8;
+ GETGX();
+ if(MODREG) {
+ v1 = sse_get_reg(dyn, ninst, x2, (nextop&7)+(rex.b<<3), 0);
+ FSD(v1, gback, gdoffset+8);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0);
+ LD(x3, ed, fixedaddress+0);
+ SD(x3, gback, gdoffset+8);
+ }
+ break;
+ case 0x6D:
+ INST_NAME("PUNPCKHQDQ Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LD(x3, gback, gdoffset+8);
+ SD(x3, gback, gdoffset+0);
+ LD(x3, wback, fixedaddress+8);
+ SD(x3, gback, gdoffset+8);
+ break;
+ case 0x6E:
+ INST_NAME("MOVD Gx, Ed");
+ nextop = F8;
+ if(rex.w) {
+ GETGXSD_empty(v0);
+ } else {
+ GETGXSS_empty(v0);
+ }
+ GETED(0);
+ if(rex.w) {
+ FMVDX(v0, ed);
+ } else {
+ FMVWX(v0, ed);
+ SW(xZR, xEmu, offsetof(x64emu_t, xmm[gd])+4);
+ }
+ SD(xZR, xEmu, offsetof(x64emu_t, xmm[gd])+8);
+ break;
+ case 0x6F:
+ INST_NAME("MOVDQA Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_MV_Q(x3);
+ break;
+ case 0x70: // TODO: Optimize this!
+ INST_NAME("PSHUFD Gx,Ex,Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ int32_t idx;
+
+ idx = (u8>>(0*2))&3;
+ LWU(x3, wback, fixedaddress+idx*4);
+ idx = (u8>>(1*2))&3;
+ LWU(x4, wback, fixedaddress+idx*4);
+ idx = (u8>>(2*2))&3;
+ LWU(x5, wback, fixedaddress+idx*4);
+ idx = (u8>>(3*2))&3;
+ LWU(x6, wback, fixedaddress+idx*4);
+
+ SW(x3, gback, gdoffset+0*4);
+ SW(x4, gback, gdoffset+1*4);
+ SW(x5, gback, gdoffset+2*4);
+ SW(x6, gback, gdoffset+3*4);
+ break;
+ case 0x71:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 2:
+ INST_NAME("PSRLW Ex, Ib");
+ GETEX(x1, 1);
+ u8 = F8;
+ if (u8>15) {
+ // just zero dest
+ SD(xZR, wback, fixedaddress+0);
+ SD(xZR, wback, fixedaddress+8);
+ } else if(u8) {
+ for (int i=0; i<8; ++i) {
+ // EX->uw[i] >>= u8;
+ LHU(x3, wback, fixedaddress+i*2);
+ SRLI(x3, x3, u8);
+ SH(x3, wback, fixedaddress+i*2);
+ }
+ }
+ break;
+ case 4:
+ INST_NAME("PSRAW Ex, Ib");
+ GETEX(x1, 1);
+ u8 = F8;
+ if(u8>15) u8=15;
+ if(u8) {
+ for (int i=0; i<8; ++i) {
+ // EX->sw[i] >>= u8;
+ LH(x3, wback, fixedaddress+i*2);
+ SRAI(x3, x3, u8);
+ SH(x3, wback, fixedaddress+i*2);
+ }
+ }
+ break;
+ case 6:
+ INST_NAME("PSLLW Ex, Ib");
+ GETEX(x1, 1);
+ u8 = F8;
+ if (u8>15) {
+ // just zero dest
+ SD(xZR, wback, fixedaddress+0);
+ SD(xZR, wback, fixedaddress+8);
+ } else if(u8) {
+ for (int i=0; i<8; ++i) {
+ // EX->uw[i] <<= u8;
+ LHU(x3, wback, fixedaddress+i*2);
+ SLLI(x3, x3, u8);
+ SH(x3, wback, fixedaddress+i*2);
+ }
+ }
+ break;
+ default:
+ *ok = 0;
+ DEFAULT;
+ }
+ break;
+ case 0x72:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 2:
+ INST_NAME("PSRLD Ex, Ib");
+ GETEX(x1, 1);
+ u8 = F8;
+ if(u8) {
+ if (u8>31) {
+ // just zero dest
+ SD(xZR, wback, fixedaddress+0);
+ SD(xZR, wback, fixedaddress+8);
+ } else if(u8) {
+ SSE_LOOP_D_S(x3, SRLI(x3, x3, u8));
+ }
+ }
+ break;
+ case 4:
+ INST_NAME("PSRAD Ex, Ib");
+ GETEX(x1, 1);
+ u8 = F8;
+ if(u8>31) u8=31;
+ if (u8) {
+ SSE_LOOP_D_S(x3, SRAIW(x3, x3, u8));
+ }
+ break;
+ case 6:
+ INST_NAME("PSLLD Ex, Ib");
+ GETEX(x1, 1);
+ u8 = F8;
+ if(u8) {
+ if (u8>31) {
+ // just zero dest
+ SD(xZR, wback, fixedaddress+0);
+ SD(xZR, wback, fixedaddress+8);
+ } else if(u8) {
+ SSE_LOOP_D_S(x3, SLLI(x3, x3, u8));
+ }
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0x73:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 2:
+ INST_NAME("PSRLQ Ex, Ib");
+ GETEX(x1, 1);
+ u8 = F8;
+ if(!u8) break;
+ if(u8>63) {
+ // just zero dest
+ SD(xZR, wback, fixedaddress+0);
+ SD(xZR, wback, fixedaddress+8);
+ } else {
+ LD(x3, wback, fixedaddress+0);
+ LD(x4, wback, fixedaddress+8);
+ SRLI(x3, x3, u8);
+ SRLI(x4, x4, u8);
+ SD(x3, wback, fixedaddress+0);
+ SD(x4, wback, fixedaddress+8);
+ }
+ break;
+ case 3:
+ INST_NAME("PSRLDQ Ex, Ib");
+ GETEX(x1, 1);
+ u8 = F8;
+ if(!u8) break;
+ if(u8>15) {
+ // just zero dest
+ SD(xZR, wback, fixedaddress+0);
+ SD(xZR, wback, fixedaddress+8);
+ } else {
+ u8*=8;
+ if (u8 < 64) {
+ LD(x3, wback, fixedaddress+0);
+ LD(x4, wback, fixedaddress+8);
+ SRLI(x3, x3, u8);
+ SLLI(x5, x4, 64-u8);
+ OR(x3, x3, x5);
+ SD(x3, wback, fixedaddress+0);
+ SRLI(x4, x4, u8);
+ SD(x4, wback, fixedaddress+8);
+ } else {
+ LD(x3, wback, fixedaddress+8);
+ if (u8-64 > 0) { SRLI(x3, x3, u8-64); }
+ SD(x3, wback, fixedaddress+0);
+ SD(xZR, wback, fixedaddress+8);
+ }
+ }
+ break;
+ case 6:
+ INST_NAME("PSLLQ Ex, Ib");
+ GETEX(x1, 1);
+ u8 = F8;
+ if(!u8) break;
+ if(u8>63) {
+ // just zero dest
+ SD(xZR, wback, fixedaddress+0);
+ SD(xZR, wback, fixedaddress+8);
+ } else {
+ LD(x3, wback, fixedaddress+0);
+ LD(x4, wback, fixedaddress+8);
+ SLLI(x3, x3, u8);
+ SLLI(x4, x4, u8);
+ SD(x3, wback, fixedaddress+0);
+ SD(x4, wback, fixedaddress+8);
+ }
+ break;
+ case 7:
+ INST_NAME("PSLLDQ Ex, Ib");
+ GETEX(x1, 1);
+ u8 = F8;
+ if(!u8) break;
+ if(u8>15) {
+ // just zero dest
+ SD(xZR, wback, fixedaddress+0);
+ SD(xZR, wback, fixedaddress+8);
+ } else {
+ u8*=8;
+ if (u8 < 64) {
+ LD(x3, wback, fixedaddress+0);
+ LD(x4, wback, fixedaddress+8);
+ SLLI(x4, x4, u8);
+ SRLI(x5, x3, 64-u8);
+ OR(x4, x4, x5);
+ SD(x4, wback, fixedaddress+8);
+ SLLI(x3, x3, u8);
+ SD(x3, wback, fixedaddress+0);
+ } else {
+ LD(x3, wback, fixedaddress+0);
+ if (u8-64 > 0) { SLLI(x3, x3, u8-64); }
+ SD(x3, wback, fixedaddress+8);
+ SD(xZR, wback, fixedaddress+0);
+ }
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0x74:
+ INST_NAME("PCMPEQB Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for (int i=0; i<16; ++i) {
+ LBU(x3, gback, gdoffset+i);
+ LBU(x4, wback, fixedaddress+i);
+ SUB(x3, x3, x4);
+ SEQZ(x3, x3);
+ NEG(x3, x3);
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0x75:
+ INST_NAME("PCMPEQW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_W(x3, x4, SUB(x3, x3, x4); SEQZ(x3, x3); NEG(x3, x3));
+ break;
+ case 0x76:
+ INST_NAME("PCMPEQD Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_D(x3, x4, XOR(x3, x3, x4); SNEZ(x3, x3); ADDI(x3, x3, -1));
+ break;
+ case 0x7C:
+ INST_NAME("HADDPD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ d0 = fpu_get_scratch(dyn);
+ d1 = fpu_get_scratch(dyn);
+ FLD(d0, gback, gdoffset+0);
+ FLD(d1, gback, gdoffset+8);
+ if(!box64_dynarec_fastnan) {
+ FEQD(x3, d0, d0);
+ FEQD(x4, d1, d1);
+ AND(x3, x3, x4);
+ }
+ FADDD(d0, d0, d1);
+ if(!box64_dynarec_fastnan) {
+ FEQD(x4, d0, d0);
+ BEQZ(x3, 12);
+ BNEZ(x4, 8);
+ FNEGD(d0, d0);
+ }
+ FSD(d0, gback, gdoffset+0);
+ if(MODREG && gd==(nextop&7)+(rex.b<<3)) {
+ FSD(d0, gback, gdoffset+8);
+ } else {
+ GETEX(x2, 0);
+ FLD(d0, wback, fixedaddress+0);
+ FLD(d1, wback, fixedaddress+8);
+ if(!box64_dynarec_fastnan) {
+ FEQD(x3, d0, d0);
+ FEQD(x4, d1, d1);
+ AND(x3, x3, x4);
+ }
+ FADDD(d0, d0, d1);
+ if(!box64_dynarec_fastnan) {
+ FEQD(x4, d0, d0);
+ BEQZ(x3, 12);
+ BNEZ(x4, 8);
+ FNEGD(d0, d0);
+ }
+ FSD(d0, gback, gdoffset+8);
+ }
+ break;
+ case 0x7E:
+ INST_NAME("MOVD Ed,Gx");
+ nextop = F8;
+ GETGX();
+ if(rex.w) {
+ if(MODREG) {
+ ed = xRAX + (nextop&7) + (rex.b<<3);
+ LD(ed, gback, gdoffset+0);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0);
+ LD(x3, gback, gdoffset+0);
+ SD(x3, ed, fixedaddress);
+ SMWRITE2();
+ }
+ } else {
+ if(MODREG) {
+ ed = xRAX + (nextop&7) + (rex.b<<3);
+ LWU(ed, gback, gdoffset+0);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0);
+ LWU(x3, gback, gdoffset+0);
+ SW(x3, ed, fixedaddress);
+ SMWRITE2();
+ }
+ }
+ break;
+ case 0x7F:
+ INST_NAME("MOVDQA Ex,Gx");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_MV_Q2(x3);
+ if(!MODREG) SMWRITE2();
+ break;
+ case 0xAF:
+ INST_NAME("IMUL Gw,Ew");
+ SETFLAGS(X_ALL, SF_PENDING);
+ nextop = F8;
+ UFLAG_DF(x1, d_imul16);
+ GETSEW(x1, 0);
+ GETSGW(x2);
+ MULW(x2, x2, x1);
+ UFLAG_RES(x2);
+ ZEXTH(x2, x2);
+ GWBACK;
+ break;
+
+ case 0xBE:
+ INST_NAME("MOVSX Gw, Eb");
+ nextop = F8;
+ GETGD;
+ if(MODREG) {
+ if(rex.rex) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ eb1=ed;
+ eb2=0;
+ } else {
+ ed = (nextop&7);
+ eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
+ eb2 = (ed&4)>>2; // L or H
+ }
+ SLLI(x1, eb1, 56-eb2*8);
+ SRAI(x1, x1, 56);
+ } else {
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x4, &fixedaddress, rex, NULL, 1, 0);
+ LB(x1, ed, fixedaddress);
+ }
+ LUI(x5, 0xffff0);
+ AND(gd, gd, x5);
+ NOT(x5, x5);
+ AND(x1, x1, x5);
+ OR(gd, gd, x1);
+ break;
+ case 0xC2:
+ INST_NAME("CMPPD Gx, Ex, Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ d0 = fpu_get_scratch(dyn);
+ d1 = fpu_get_scratch(dyn);
+ for(int i=0; i<2; ++i) {
+ FLD(d0, gback, gdoffset+8*i);
+ FLD(d1, wback, fixedaddress+8*i);
+ if ((u8&7) == 0) { // Equal
+ FEQD(x3, d0, d1);
+ } else if ((u8&7) == 4) { // Not Equal or unordered
+ FEQD(x3, d0, d1);
+ XORI(x3, x3, 1);
+ } else {
+ // x4 = !(isnan(d0) || isnan(d1))
+ FEQD(x4, d0, d0);
+ FEQD(x3, d1, d1);
+ AND(x3, x3, x4);
+
+ switch(u8&7) {
+ case 1: BEQ_MARK(x3, xZR); FLTD(x3, d0, d1); break; // Less than
+ case 2: BEQ_MARK(x3, xZR); FLED(x3, d0, d1); break; // Less or equal
+ case 3: XORI(x3, x3, 1); break; // NaN
+ case 5: { // Greater or equal or unordered
+ BEQ(x3, xZR, 12); // MARK2
+ FLED(x3, d1, d0);
+ J(8); // MARK;
+ break;
+ }
+ case 6: { // Greater or unordered
+ BEQ(x3, xZR, 12); // MARK2
+ FLTD(x3, d1, d0);
+ J(8); // MARK;
+ break;
+ }
+ case 7: break; // Not NaN
+ }
+
+ // MARK2;
+ if ((u8&7) == 5 || (u8&7) == 6) {
+ MOV32w(x3, 1);
+ }
+ // MARK;
+ }
+ NEG(x3, x3);
+ SD(x3, gback, gdoffset+8*i);
+ }
+ break;
+ case 0xC4:
+ INST_NAME("PINSRW Gx,Ed,Ib");
+ nextop = F8;
+ GETED(1);
+ GETGX();
+ u8 = (F8)&7;
+ SH(ed, gback, gdoffset+u8*2);
+ break;
+ case 0xC5:
+ INST_NAME("PEXTRW Gd,Ex,Ib");
+ nextop = F8;
+ GETGD;
+ GETEX(x1, 0);
+ u8 = (F8)&7;
+ LHU(gd, wback, fixedaddress+u8*2);
+ break;
+ case 0xC6:
+ INST_NAME("SHUFPD Gx, Ex, Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ if (MODREG && gd==(nextop&7)+(rex.b<<3) && u8==0) {
+ LD(x3, gback, gdoffset+0);
+ SD(x3, gback, gdoffset+8);
+ break;
+ }
+ LD(x3, gback, gdoffset+8*(u8&1));
+ LD(x4, wback, fixedaddress+8*((u8>>1)&1));
+ SD(x3, gback, gdoffset+0);
+ SD(x4, gback, gdoffset+8);
+ break;
+ case 0xD1:
+ INST_NAME("PSRLW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LD(x3, wback, fixedaddress);
+ ADDI(x4, xZR, 16);
+ BLTU_MARK(x3, x4);
+ SD(xZR, gback, gdoffset+0);
+ SD(xZR, gback, gdoffset+8);
+ B_NEXT_nocond;
+ MARK;
+ for (int i=0; i<8; ++i) {
+ LHU(x5, gback, gdoffset+2*i);
+ SRLW(x5, x5, x3);
+ SH(x5, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xD2:
+ INST_NAME("PSRLD Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LD(x3, wback, fixedaddress);
+ ADDI(x4, xZR, 32);
+ BLTU_MARK(x3, x4);
+ SD(xZR, gback, gdoffset+0);
+ SD(xZR, gback, gdoffset+8);
+ B_NEXT_nocond;
+ MARK;
+ for (int i=0; i<4; ++i) {
+ LWU(x5, gback, gdoffset+4*i);
+ SRLW(x5, x5, x3);
+ SW(x5, gback, gdoffset+4*i);
+ }
+ break;
+ case 0xD3:
+ INST_NAME("PSRLQ Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LD(x3, wback, fixedaddress);
+ ADDI(x4, xZR, 64);
+ BLTU_MARK(x3, x4);
+ SD(xZR, gback, gdoffset+0);
+ SD(xZR, gback, gdoffset+8);
+ B_NEXT_nocond;
+ MARK;
+ for (int i=0; i<2; ++i) {
+ LD(x5, gback, gdoffset+8*i);
+ SRL(x5, x5, x3);
+ SD(x5, gback, gdoffset+8*i);
+ }
+ break;
+ case 0xD4:
+ INST_NAME("PADDQ Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, ADD(x3, x3, x4));
+ break;
+ case 0xD5:
+ INST_NAME("PMULLW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ LH(x3, gback, gdoffset+2*i);
+ LH(x4, wback, fixedaddress+2*i);
+ MULW(x3, x3, x4);
+ SH(x3, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xD6:
+ INST_NAME("MOVQ Ex, Gx");
+ nextop = F8;
+ GETGXSD(d0);
+ GETEX(x2, 0);
+ FSD(d0, wback, fixedaddress+0);
+ if (MODREG) {
+ SD(xZR, wback, fixedaddress+8);
+ } else {
+ SMWRITE2();
+ }
+ break;
+ case 0xD7:
+ INST_NAME("PMOVMSKB Gd, Ex");
+ nextop = F8;
+ GETEX(x2, 0);
+ GETGD;
+ MV(gd, xZR);
+ for (int i=0; i<16; ++i) {
+ LB(x1, wback, fixedaddress+i);
+ SLT(x3, x1, xZR);
+ if (i > 0) SLLI(x3, x3, i);
+ OR(gd, gd, x3);
+ }
+ break;
+ case 0xD8:
+ INST_NAME("PSUBUSB Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<16; ++i) {
+ LBU(x3, gback, gdoffset+i);
+ LBU(x4, wback, fixedaddress+i);
+ SUB(x3, x3, x4);
+ NOT(x4, x3);
+ SRAI(x4, x4, 63);
+ AND(x3, x3, x4);
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0xD9:
+ INST_NAME("PSUBUSW Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_W(x3, x4, SUB(x3, x3, x4); NOT(x4, x3); SRAI(x4, x4, 63); AND(x3, x3, x4));
+ break;
+ case 0xDA:
+ INST_NAME("PMINUB Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for (int i=0; i<16; ++i) {
+ LBU(x3, gback, gdoffset+i);
+ LBU(x4, wback, fixedaddress+i);
+ BLTU(x3, x4, 8);
+ MV(x3, x4);
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0xDB:
+ INST_NAME("PAND Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, AND(x3, x3, x4));
+ break;
+ case 0xDC:
+ INST_NAME("PADDUSB Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ ADDI(x5, xZR, 0xFF);
+ for(int i=0; i<16; ++i) {
+ LBU(x3, gback, gdoffset+i);
+ LBU(x4, wback, fixedaddress+i);
+ ADD(x3, x3, x4);
+ BLT(x3, x5, 8);
+ ADDI(x3, xZR, 0xFF);
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0xDD:
+ INST_NAME("PADDUSW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ // tmp32s = (int32_t)GX->uw[i] + EX->uw[i];
+ // GX->uw[i] = (tmp32s>65535)?65535:tmp32s;
+ LHU(x3, gback, gdoffset+i*2);
+ LHU(x4, wback, fixedaddress+i*2);
+ ADDW(x3, x3, x4);
+ MOV32w(x4, 65536);
+ BLT(x3, x4, 8);
+ ADDIW(x3, x4, -1);
+ SH(x3, gback, gdoffset+i*2);
+ }
+ break;
+ case 0xDE:
+ INST_NAME("PMAXUB Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for (int i=0; i<16; ++i) {
+ LBU(x3, gback, gdoffset+i);
+ LBU(x4, wback, fixedaddress+i);
+ BLTU(x4, x3, 8);
+ MV(x3, x4);
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0xDF:
+ INST_NAME("PANDN Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, NOT(x3, x3); AND(x3, x3, x4));
+ break;
+ case 0xE0:
+ INST_NAME("PAVGB Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for (int i=0; i<16; ++i) {
+ LBU(x3, gback, gdoffset+i);
+ LBU(x4, wback, fixedaddress+i);
+ ADDW(x3, x3, x4);
+ ADDIW(x3, x3, 1);
+ SRAIW(x3, x3, 1);
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0xE1:
+ INST_NAME("PSRAW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ ADDI(x4, xZR, 16);
+ LD(x3, wback, fixedaddress);
+ BLTU(x3, x4, 8);
+ SUBI(x3, x4, 1);
+ for (int i=0; i<8; ++i) {
+ LH(x4, gback, gdoffset+2*i);
+ SRAW(x4, x4, x3);
+ SH(x4, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xE2:
+ INST_NAME("PSRAD Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ ADDI(x4, xZR, 32);
+ LD(x3, wback, fixedaddress);
+ BLTU(x3, x4, 8);
+ SUBI(x3, x4, 1);
+ for (int i=0; i<4; ++i) {
+ LW(x4, gback, gdoffset+4*i);
+ SRAW(x4, x4, x3);
+ SW(x4, gback, gdoffset+4*i);
+ }
+ break;
+ case 0xE3:
+ INST_NAME("PAVGW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for (int i=0; i<8; ++i) {
+ LHU(x3, gback, gdoffset+2*i);
+ LHU(x4, wback, fixedaddress+2*i);
+ ADDW(x3, x3, x4);
+ ADDIW(x3, x3, 1);
+ SRAIW(x3, x3, 1);
+ SH(x3, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xE4:
+ INST_NAME("PMULHUW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ LHU(x3, gback, gdoffset+2*i);
+ LHU(x4, wback, fixedaddress+2*i);
+ MULW(x3, x3, x4);
+ SRLIW(x3, x3, 16);
+ SH(x3, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xE5:
+ INST_NAME("PMULHW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ LH(x3, gback, gdoffset+2*i);
+ LH(x4, wback, fixedaddress+2*i);
+ MULW(x3, x3, x4);
+ SRAIW(x3, x3, 16);
+ SH(x3, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xE6:
+ INST_NAME("CVTTPD2DQ Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ v0 = fpu_get_scratch(dyn);
+ v1 = fpu_get_scratch(dyn);
+ FLD(v0, wback, fixedaddress+0);
+ FLD(v1, wback, fixedaddress+8);
+ if(!box64_dynarec_fastround) {
+ FSFLAGSI(0); // // reset all bits
+ }
+ FCVTWD(x3, v0, RD_RTZ);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, (1<<FR_NV)|(1<<FR_OF));
+ BEQ_MARK(x5, xZR);
+ MOV32w(x3, 0x80000000);
+ MARK;
+ FSFLAGSI(0); // // reset all bits
+ }
+ FCVTWD(x4, v1, RD_RTZ);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, (1<<FR_NV)|(1<<FR_OF));
+ BEQ_MARK2(x5, xZR);
+ MOV32w(x4, 0x80000000);
+ MARK2;
+ }
+ SW(x3, gback, gdoffset+0);
+ SW(x4, gback, gdoffset+4);
+ SD(xZR, gback, gdoffset+8);
+ break;
+ case 0xE7:
+ INST_NAME("MOVNTDQ Ex, Gx");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_MV_Q2(x3);
+ break;
+ case 0xE8:
+ INST_NAME("PSUBSB Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<16; ++i) {
+ // tmp16s = (int16_t)GX->sb[i] - EX->sb[i];
+ // GX->sb[i] = (tmp16s<-128)?-128:((tmp16s>127)?127:tmp16s);
+ LB(x3, gback, gdoffset+i);
+ LB(x4, wback, fixedaddress+i);
+ SUBW(x3, x3, x4);
+ SLLIW(x3, x3, 16);
+ SRAIW(x3, x3, 16);
+ ADDI(x4, xZR, 0x7f);
+ BLT(x3, x4, 12); // tmp16s>127?
+ SB(x4, gback, gdoffset+i);
+ J(24); // continue
+ ADDI(x4, xZR, 0xf80);
+ BLT(x4, x3, 12); // tmp16s<-128?
+ SB(x4, gback, gdoffset+i);
+ J(8); // continue
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0xE9:
+ INST_NAME("PSUBSW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ // tmp32s = (int32_t)GX->sw[i] - EX->sw[i];
+ // GX->sw[i] = (tmp32s>32767)?32767:((tmp32s<-32768)?-32768:tmp32s);
+ LH(x3, gback, gdoffset+2*i);
+ LH(x4, wback, fixedaddress+2*i);
+ SUBW(x3, x3, x4);
+ LUI(x4, 0xFFFF8); // -32768
+ BGE(x3, x4, 12);
+ SH(x4, gback, gdoffset+2*i);
+ J(20); // continue
+ LUI(x4, 8); // 32768
+ BLT(x3, x4, 8);
+ ADDIW(x3, x4, -1);
+ SH(x3, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xEA:
+ INST_NAME("PMINSW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for (int i=0; i<8; ++i) {
+ LH(x3, gback, gdoffset+2*i);
+ LH(x4, wback, fixedaddress+2*i);
+ BLT(x3, x4, 8);
+ MV(x3, x4);
+ SH(x3, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xEB:
+ INST_NAME("POR Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, OR(x3, x3, x4));
+ break;
+ case 0xEC:
+ INST_NAME("PADDSB Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<16; ++i) {
+ // tmp16s = (int16_t)GX->sb[i] + EX->sb[i];
+ // GX->sb[i] = (tmp16s>127)?127:((tmp16s<-128)?-128:tmp16s);
+ LB(x3, gback, gdoffset+i);
+ LB(x4, wback, fixedaddress+i);
+ ADDW(x3, x3, x4);
+ SLLIW(x3, x3, 16);
+ SRAIW(x3, x3, 16);
+ ADDI(x4, xZR, 0x7f);
+ BLT(x3, x4, 12); // tmp16s>127?
+ SB(x4, gback, gdoffset+i);
+ J(24); // continue
+ ADDI(x4, xZR, 0xf80);
+ BLT(x4, x3, 12); // tmp16s<-128?
+ SB(x4, gback, gdoffset+i);
+ J(8); // continue
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0xED:
+ INST_NAME("PADDSW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<8; ++i) {
+ // tmp32s = (int32_t)GX->sw[i] + EX->sw[i];
+ // GX->sw[i] = (tmp32s>32767)?32767:((tmp32s<-32768)?-32768:tmp32s);
+ LH(x3, gback, gdoffset+2*i);
+ LH(x4, wback, fixedaddress+2*i);
+ ADDW(x3, x3, x4);
+ LUI(x4, 0xFFFF8); // -32768
+ BGE(x3, x4, 12);
+ SH(x4, gback, gdoffset+2*i);
+ J(20); // continue
+ LUI(x4, 8); // 32768
+ BLT(x3, x4, 8);
+ ADDIW(x3, x4, -1);
+ SH(x3, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xEE:
+ INST_NAME("PMAXSW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_WS(x3, x4, BGE(x3, x4, 8); MV(x3, x4));
+ break;
+ case 0xEF:
+ INST_NAME("PXOR Gx, Ex");
+ nextop = F8;
+ GETGX();
+ if(MODREG && gd==(nextop&7)+(rex.b<<3))
+ {
+ // just zero dest
+ SD(xZR, gback, gdoffset+0);
+ SD(xZR, gback, gdoffset+8);
+ } else {
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4));
+ }
+ break;
+ case 0xF1:
+ INST_NAME("PSLLQ Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ ADDI(x4, xZR, 16);
+ LD(x3, wback, fixedaddress+0);
+ BLTU_MARK(x3, x4);
+ // just zero dest
+ SD(xZR, gback, gdoffset+0);
+ SD(xZR, gback, gdoffset+8);
+ B_NEXT_nocond;
+ MARK;
+ for (int i=0; i<8; ++i) {
+ LHU(x4, gback, gdoffset+2*i);
+ SLLW(x4, x4, x3);
+ SH(x4, gback, gdoffset+2*i);
+ }
+ break;
+ case 0xF2:
+ INST_NAME("PSLLQ Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ ADDI(x4, xZR, 32);
+ LD(x3, wback, fixedaddress+0);
+ BLTU_MARK(x3, x4);
+ // just zero dest
+ SD(xZR, gback, gdoffset+0);
+ SD(xZR, gback, gdoffset+8);
+ B_NEXT_nocond;
+ MARK;
+ for (int i=0; i<4; ++i) {
+ LWU(x4, gback, gdoffset+4*i);
+ SLLW(x4, x4, x3);
+ SW(x4, gback, gdoffset+4*i);
+ }
+ break;
+ case 0xF3:
+ INST_NAME("PSLLQ Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ ADDI(x4, xZR, 64);
+ LD(x3, wback, fixedaddress+0);
+ BLTU_MARK(x3, x4);
+ // just zero dest
+ SD(xZR, gback, gdoffset+0);
+ SD(xZR, gback, gdoffset+8);
+ B_NEXT_nocond;
+ MARK;
+ for (int i=0; i<2; ++i) {
+ LD(x4, gback, gdoffset+8*i);
+ SLL(x4, x4, x3);
+ SD(x4, gback, gdoffset+8*i);
+ }
+ break;
+ case 0xF4:
+ INST_NAME("PMULUDQ Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ // GX->q[1] = (uint64_t)EX->ud[2]*GX->ud[2];
+ LWU(x3, gback, gdoffset+2*4);
+ LWU(x4, wback, fixedaddress+2*4);
+ MUL(x3, x3, x4);
+ SD(x3, gback, gdoffset+8);
+ // GX->q[0] = (uint64_t)EX->ud[0]*GX->ud[0];
+ LWU(x3, gback, gdoffset+0*4);
+ LWU(x4, wback, fixedaddress+0*4);
+ MUL(x3, x3, x4);
+ SD(x3, gback, gdoffset+0);
+ break;
+ case 0xF5:
+ INST_NAME("PMADDWD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for (int i=0; i<4; ++i) {
+ // GX->sd[i] = (int32_t)(GX->sw[i*2+0])*EX->sw[i*2+0] +
+ // (int32_t)(GX->sw[i*2+1])*EX->sw[i*2+1];
+ LH(x3, gback, gdoffset+2*(i*2+0));
+ LH(x4, wback, fixedaddress+2*(i*2+0));
+ MULW(x5, x3, x4);
+ LH(x3, gback, gdoffset+2*(i*2+1));
+ LH(x4, wback, fixedaddress+2*(i*2+1));
+ MULW(x6, x3, x4);
+ ADDW(x5, x5, x6);
+ SW(x5, gback, gdoffset+4*i);
+ }
+ break;
+ case 0xF6:
+ INST_NAME("PSADBW Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ MV(x6, xZR);
+ for (int i=0; i<16; ++i) {
+ LBU(x3, gback, gdoffset+i);
+ LBU(x4, wback, fixedaddress+i);
+ SUBW(x3, x3, x4);
+ SRAIW(x5, x3, 31);
+ XOR(x3, x5, x3);
+ SUBW(x3, x3, x5);
+ ANDI(x3, x3, 0xff);
+ ADDW(x6, x6, x3);
+ if (i==7 || i == 15) {
+ SD(x6, gback, gdoffset+i+1-8);
+ if (i==7) MV(x6, xZR);
+ }
+ }
+ break;
+ case 0xF8:
+ INST_NAME("PSUBB Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<16; ++i) {
+ // GX->sb[i] -= EX->sb[i];
+ LB(x3, wback, fixedaddress+i);
+ LB(x4, gback, gdoffset+i);
+ SUB(x3, x4, x3);
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0xF9:
+ INST_NAME("PSUBW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_W(x3, x4, SUBW(x3, x3, x4));
+ break;
+ case 0xFA:
+ INST_NAME("PSUBD Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_D(x3, x4, SUBW(x3, x3, x4));
+ break;
+ case 0xFB:
+ INST_NAME("PSUBQ Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_Q(x3, x4, SUB(x3, x3, x4));
+ break;
+ case 0xFC:
+ INST_NAME("PADDB Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ for(int i=0; i<16; ++i) {
+ // GX->sb[i] += EX->sb[i];
+ LB(x3, gback, gdoffset+i);
+ LB(x4, wback, fixedaddress+i);
+ ADDW(x3, x3, x4);
+ SB(x3, gback, gdoffset+i);
+ }
+ break;
+ case 0xFD:
+ INST_NAME("PADDW Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_W(x3, x4, ADDW(x3, x3, x4));
+ break;
+ case 0xFE:
+ INST_NAME("PADDD Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_D(x3, x4, ADDW(x3, x3, x4));
+ break;
+ default:
+ DEFAULT;
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_6664.c b/src/dynarec/rv64/dynarec_rv64_6664.c
new file mode 100644
index 0000000..3acac90
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_6664.c
@@ -0,0 +1,105 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+uintptr_t dynarec64_6664(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog)
+{
+ (void)ip; (void)need_epilog;
+
+ uint8_t opcode = F8;
+ uint8_t nextop;
+ uint8_t gd, ed;
+ int64_t j64;
+ int v0, v1;
+ int64_t fixedaddress;
+ int unscaled;
+ MAYUSE(j64);
+
+ GETREX();
+
+ switch(opcode) {
+ case 0x89:
+ INST_NAME("MOV FS:Ew, Gw");
+ nextop = F8;
+ GETGD; // don't need GETGW here
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ if(rex.w) {
+ ADDI(ed, gd, 0);
+ } else {
+ if(ed!=gd) {
+ LUI(x1, 0xffff0);
+ AND(gd, gd, x1);
+ ZEXTH(x1, ed);
+ OR(gd, gd, x1);
+ }
+ }
+ } else {
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ ADD(x4, ed, x4);
+ if(rex.w) {
+ SD(gd, x4, fixedaddress);
+ } else {
+ SH(gd, x4, fixedaddress);
+ }
+ SMWRITE();
+ }
+ break;
+
+ case 0x8B:
+ INST_NAME("MOV Gd, FS:Ed");
+ nextop=F8;
+ GETGD;
+ if(MODREG) { // reg <= reg
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ if(rex.w) {
+ MV(gd, ed);
+ } else {
+ if(ed!=gd) {
+ LUI(x1, 0xffff0);
+ AND(gd, gd, x1);
+ ZEXTH(x1, ed);
+ OR(gd, gd, x1);
+ }
+ }
+ } else { // mem <= reg
+ grab_segdata(dyn, addr, ninst, x4, seg);
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ ADD(x4, ed, x4);
+ if(rex.w) {
+ LD(gd, x4, fixedaddress);
+ } else {
+ LHU(x1, x4, fixedaddress);
+ SRLI(gd, gd, 16);
+ SLLI(gd, gd, 16);
+ OR(gd, gd, x1);
+ }
+ }
+ break;
+
+ default:
+ DEFAULT;
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_66f0.c b/src/dynarec/rv64/dynarec_rv64_66f0.c
new file mode 100644
index 0000000..8416422
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_66f0.c
@@ -0,0 +1,195 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "rv64_emitter.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+
+uintptr_t dynarec64_66F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ (void)ip; (void)rep; (void)need_epilog;
+
+ uint8_t opcode = F8;
+ uint8_t nextop;
+ uint8_t gd, ed, u8;
+ uint8_t wback, wb1, wb2, gb1, gb2;
+ int32_t i32;
+ int64_t i64, j64;
+ int64_t fixedaddress;
+ int unscaled;
+ MAYUSE(gb1);
+ MAYUSE(gb2);
+ MAYUSE(wb1);
+ MAYUSE(wb2);
+ MAYUSE(j64);
+
+ while((opcode==0xF2) || (opcode==0xF3)) {
+ rep = opcode-0xF1;
+ opcode = F8;
+ }
+
+ GETREX();
+
+ switch(opcode) {
+ case 0x11:
+ INST_NAME("LOCK ADC Ew, Gw");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGW(x1);
+ SMDMB();
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ MOV32w(x6, 0xFFFF);
+ AND(x2, ed, x6);
+ emit_adc16(dyn, ninst, x1, x2, x3, x4, x5);
+ if (rv64_zbb) {
+ ANDN(ed, ed, x6);
+ } else {
+ NOT(x6, x6);
+ AND(ed, ed, x6);
+ }
+ OR(ed, ed, x2);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ ANDI(x3, wback, 0b10);
+ MOV32w(x4, 0xffff); // x4 = mask
+ BNEZ_MARK(x3);
+ // lower 16bits
+ MARKLOCK;
+ LR_W(x5, wback, 1, 1);
+ AND(x6, x5, x4); // x6 = Ed.h[0]
+ SRLIW(x5, x5, 16);
+ SLLIW(x5, x5, 16); // x5 = clear Ed.h[0]
+ ADDW(x2, x1, x6); // x2 = Gw + Ew
+ ANDI(x9, xFlags, 1 << F_CF);
+ ADDW(x2, x2, x9); // x2 = adc
+ AND(x2, x2, x4);
+ OR(x5, x5, x2);
+ SC_W(x2, x5, wback, 1, 1);
+ BNEZ_MARKLOCK(x2);
+ B_MARK3_nocond;
+ MARK;
+ // upper 16bits
+ SLLIW(x3, x4, 16); // x3 = mask
+ SUBI(wback, wback, 2); // aligning address
+ SLLI(x1, x1, 16); // x1 = extended Gw
+ MARK2;
+ LR_W(x6, wback, 1, 1); // x6 = Ed
+ AND(x5, x6, x3); // x5 = Ed.h[1] << 16
+ ADDW(x5,x5, x1);
+ ANDI(x9, xFlags, 1 << F_CF);
+ SLLIW(x9, x9, 16);
+ ADDW(x5, x5, x9); // x5 = adc << 16
+ AND(x9, x6, x4); // x9 = Ed.h[0]
+ OR(x5, x5, x9);
+ SC_W(x9, x5, wback, 1, 1);
+ BNEZ_MARK2(x9);
+ IFX(X_ALL|X_PEND) {
+ SRLIW(x6, x6, 16);
+ SRLIW(x1, x1, 16);
+ }
+ MARK3;
+ IFX(X_ALL|X_PEND) {
+ emit_adc16(dyn, ninst, x1, x6, x3, x4, x5);
+ }
+ }
+ SMDMB();
+ break;
+ case 0x81:
+ case 0x83:
+ nextop = F8;
+ SMDMB();
+ switch((nextop>>3)&7) {
+ case 0: //ADD
+ if(opcode==0x81) {
+ INST_NAME("LOCK ADD Ew, Iw");
+ } else {
+ INST_NAME("LOCK ADD Ew, Ib");
+ }
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ if(MODREG) {
+ if(opcode==0x81) i32 = F16S; else i32 = F8S;
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ MOV32w(x5, i32);
+ ZEXTH(x6, ed);
+ emit_add16(dyn, ninst, x6, x5, x3, x4, x2);
+ SRLI(ed, ed, 16);
+ SLLI(ed, ed, 16);
+ OR(ed, ed, x6);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1);
+ if(opcode==0x81) i32 = F16S; else i32 = F8S;
+ MOV32w(x5, i32);
+
+ ANDI(x3, wback, 0b10);
+ BNEZ_MARK(x3);
+
+ // lower 16 bits
+ MARKLOCK;
+ LR_W(x1, wback, 1, 1);
+ SRLIW(x3, x1, 16);
+ SLLIW(x3, x3, 16);
+ ADD(x4, x1, x5);
+ SLLIW(x4, x4, 16);
+ SRLIW(x4, x4, 16);
+ OR(x4, x4, x3);
+ SC_W(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND) {
+ SLLIW(x1, x1, 16);
+ SRLIW(x1, x1, 16);
+ }
+ B_MARK3_nocond;
+
+ MARK;
+ // upper 16 bits
+ XORI(wback, wback, 0b10);
+ MARK2;
+ LR_W(x1, wback, 1, 1);
+ SLLIW(x3, x1, 16);
+ SRLIW(x3, x3, 16);
+ SRLIW(x1, x1, 16);
+ ADD(x4, x1, x5);
+ SLLIW(x4, x4, 16);
+ OR(x4, x4, x3);
+ SC_W(x3, x4, wback, 1, 1);
+ BNEZ_MARK2(x3);
+
+ MARK3;
+ // final
+ IFX(X_ALL|X_PEND) {
+ emit_add16(dyn, ninst, x1, x5, x3, x4, x6);
+ }
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ SMDMB();
+ break;
+
+ default:
+ DEFAULT;
+ }
+
+ return addr;
+} \ No newline at end of file
diff --git a/src/dynarec/rv64/dynarec_rv64_67.c b/src/dynarec/rv64/dynarec_rv64_67.c
new file mode 100644
index 0000000..5f10274
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_67.c
@@ -0,0 +1,631 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+#include <assert.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+uintptr_t dynarec64_67(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ (void)ip; (void)need_epilog;
+
+ uint8_t opcode = F8;
+ uint8_t nextop;
+ uint8_t gd, ed, wback, wb, wb1, wb2, gb1, gb2, eb1, eb2;
+ int64_t fixedaddress;
+ int unscaled;
+ int8_t i8;
+ uint8_t u8;
+ int32_t i32;
+ int64_t j64, i64;
+ int cacheupd = 0;
+ int lock;
+ int v0, v1, s0;
+ MAYUSE(i32);
+ MAYUSE(j64);
+ MAYUSE(v0);
+ MAYUSE(v1);
+ MAYUSE(s0);
+ MAYUSE(lock);
+ MAYUSE(cacheupd);
+
+ if(rex.is32bits) {
+ // should do a different file
+ DEFAULT;
+ return addr;
+ }
+
+ GETREX();
+
+ rep = 0;
+ while((opcode==0xF2) || (opcode==0xF3)) {
+ rep = opcode-0xF1;
+ opcode = F8;
+ }
+
+ switch(opcode) {
+
+ case 0x01:
+ INST_NAME("ADD Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_add32(dyn, ninst, rex, ed, gd, x3, x4, x5);
+ WBACK;
+ break;
+ case 0x02:
+ INST_NAME("ADD Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB32(x2, 0);
+ GETGB(x1);
+ emit_add8(dyn, ninst, x1, x2, x3, x4);
+ GBBACK(x4);
+ break;
+ case 0x03:
+ INST_NAME("ADD Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_add32(dyn, ninst, rex, gd, ed, x3, x4, x5);
+ break;
+
+ case 0x05:
+ INST_NAME("ADD EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ emit_add32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5, x6);
+ break;
+
+ case 0x09:
+ INST_NAME("OR Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_or32(dyn, ninst, rex, ed, gd, x3, x4);
+ WBACK;
+ break;
+ case 0x0A:
+ INST_NAME("OR Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB32(x2, 0);
+ GETGB(x1);
+ emit_or8(dyn, ninst, x1, x2, x3, x4);
+ GBBACK(x4);
+ break;
+ case 0x0B:
+ INST_NAME("OR Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_or32(dyn, ninst, rex, gd, ed, x3, x4);
+ break;
+
+ case 0x0D:
+ INST_NAME("OR EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ emit_or32c(dyn, ninst, rex, xRAX, i64, x3, x4);
+ break;
+
+ case 0x0F:
+ opcode=F8;
+ switch(opcode) {
+ case 0x2E:
+ // no special check...
+ case 0x2F:
+ switch (rep) {
+ case 0:
+ if(opcode==0x2F) {INST_NAME("COMISS Gx, Ex");} else {INST_NAME("UCOMISS Gx, Ex");}
+ SETFLAGS(X_ALL, SF_SET);
+ nextop = F8;
+ GETGXSS(s0);
+ if(MODREG) {
+ v0 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 1);
+ } else {
+ v0 = fpu_get_scratch(dyn);
+ SMREAD();
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0);
+ FLW(v0, ed, fixedaddress);
+ }
+ CLEAR_FLAGS();
+ // if isnan(s0) || isnan(v0)
+ IFX(X_ZF | X_PF | X_CF) {
+ FEQS(x3, s0, s0);
+ FEQS(x2, v0, v0);
+ AND(x2, x2, x3);
+ BNE_MARK(x2, xZR);
+ ORI(xFlags, xFlags, (1<<F_ZF) | (1<<F_PF) | (1<<F_CF));
+ B_NEXT_nocond;
+ }
+ MARK;
+ // else if isless(d0, v0)
+ IFX(X_CF) {
+ FLTS(x2, s0, v0);
+ BEQ_MARK2(x2, xZR);
+ ORI(xFlags, xFlags, 1<<F_CF);
+ B_NEXT_nocond;
+ }
+ MARK2;
+ // else if d0 == v0
+ IFX(X_ZF) {
+ FEQS(x2, s0, v0);
+ CBZ_NEXT(x2);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
+ case 0x11:
+ INST_NAME("ADC Ed, Gd");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_adc32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6);
+ WBACK;
+ break;
+
+ case 0x13:
+ INST_NAME("ADC Gd, Ed");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_adc32(dyn, ninst, rex, gd, ed, x3, x4, x5, x6);
+ break;
+
+ case 0x15:
+ INST_NAME("ADC EAX, Id");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ MOV64xw(x1, i64);
+ emit_adc32(dyn, ninst, rex, xRAX, x1, x3, x4, x5, x6);
+ break;
+
+ case 0x19:
+ INST_NAME("SBB Ed, Gd");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_sbb32(dyn, ninst, rex, ed, gd, x3, x4, x5);
+ WBACK;
+ break;
+ case 0x1A:
+ INST_NAME("SBB Gb, Eb");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB32(x2, 0);
+ GETGB(x1);
+ emit_sbb8(dyn, ninst, x1, x2, x3, x4, x5);
+ GBBACK(x4);
+ break;
+ case 0x1B:
+ INST_NAME("SBB Gd, Ed");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_sbb32(dyn, ninst, rex, gd, ed, x3, x4, x5);
+ break;
+
+ case 0x1D:
+ INST_NAME("SBB EAX, Id");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ MOV64xw(x2, i64);
+ emit_sbb32(dyn, ninst, rex, xRAX, x2, x3, x4, x5);
+ break;
+
+ case 0x21:
+ INST_NAME("AND Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_and32(dyn, ninst, rex, ed, gd, x3, x4);
+ WBACK;
+ break;
+ case 0x22:
+ INST_NAME("AND Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB32(x2, 0);
+ GETGB(x1);
+ emit_and8(dyn, ninst, x1, x2, x3, x4);
+ GBBACK(x4);
+ break;
+ case 0x23:
+ INST_NAME("AND Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_and32(dyn, ninst, rex, gd, ed, x3, x4);
+ break;
+
+ case 0x25:
+ INST_NAME("AND EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ emit_and32c(dyn, ninst, rex, xRAX, i64, x3, x4);
+ break;
+
+ case 0x29:
+ INST_NAME("SUB Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_sub32(dyn, ninst, rex, ed, gd, x3, x4, x5);
+ WBACK;
+ break;
+ case 0x2A:
+ INST_NAME("SUB Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB32(x2, 0);
+ GETGB(x1);
+ emit_sub8(dyn, ninst, x1, x2, x3, x4, x5);
+ GBBACK(x5);
+ break;
+ case 0x2B:
+ INST_NAME("SUB Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_sub32(dyn, ninst, rex, gd, ed, x3, x4, x5);
+ break;
+
+ case 0x2D:
+ INST_NAME("SUB EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ emit_sub32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5, x6);
+ break;
+
+ case 0x31:
+ INST_NAME("XOR Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_xor32(dyn, ninst, rex, ed, gd, x3, x4);
+ WBACK;
+ break;
+ case 0x32:
+ INST_NAME("XOR Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB32(x2, 0);
+ GETGB(x1);
+ emit_xor8(dyn, ninst, x1, x2, x3, x4);
+ GBBACK(x4);
+ break;
+ case 0x33:
+ INST_NAME("XOR Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_xor32(dyn, ninst, rex, gd, ed, x3, x4);
+ break;
+
+ case 0x35:
+ INST_NAME("XOR EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ emit_xor32c(dyn, ninst, rex, xRAX, i64, x3, x4);
+ break;
+
+ case 0x38:
+ INST_NAME("CMP Eb, Gb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB32(x1, 0);
+ GETGB(x2);
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ break;
+ case 0x39:
+ INST_NAME("CMP Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_cmp32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6);
+ break;
+ case 0x3A:
+ INST_NAME("CMP Gb, Eb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETEB32(x2, 0);
+ GETGB(x1);
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ break;
+ case 0x3B:
+ INST_NAME("CMP Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ GETED32(0);
+ emit_cmp32(dyn, ninst, rex, gd, ed, x3, x4, x5, x6);
+ break;
+ case 0x3C:
+ INST_NAME("CMP AL, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ u8 = F8;
+ ANDI(x1, xRAX, 0xff);
+ if(u8) {
+ MOV32w(x2, u8);
+ emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6);
+ } else {
+ emit_cmp8_0(dyn, ninst, x1, x3, x4);
+ }
+ break;
+ case 0x3D:
+ INST_NAME("CMP EAX, Id");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ i64 = F32S;
+ if(i64) {
+ MOV64xw(x2, i64);
+ emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5, x6);
+ } else
+ emit_cmp32_0(dyn, ninst, rex, xRAX, x3, x4);
+ break;
+
+ case 0x81:
+ case 0x83:
+ nextop = F8;
+ switch((nextop>>3)&7) {
+ case 0: //ADD
+ if(opcode==0x81) {INST_NAME("ADD Ed, Id");} else {INST_NAME("ADD Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED32((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6);
+ WBACK;
+ break;
+ case 1: //OR
+ if(opcode==0x81) {INST_NAME("OR Ed, Id");} else {INST_NAME("OR Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED32((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_or32c(dyn, ninst, rex, ed, i64, x3, x4);
+ WBACK;
+ break;
+ case 2: //ADC
+ if(opcode==0x81) {INST_NAME("ADC Ed, Id");} else {INST_NAME("ADC Ed, Ib");}
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED32((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ MOV64xw(x5, i64);
+ emit_adc32(dyn, ninst, rex, ed, x5, x3, x4, x5, x6);
+ WBACK;
+ break;
+ case 3: //SBB
+ if(opcode==0x81) {INST_NAME("SBB Ed, Id");} else {INST_NAME("SBB Ed, Ib");}
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED32((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ MOV64xw(x5, i64);
+ emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4, x5);
+ WBACK;
+ break;
+ case 4: //AND
+ if(opcode==0x81) {INST_NAME("AND Ed, Id");} else {INST_NAME("AND Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED32((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_and32c(dyn, ninst, rex, ed, i64, x3, x4);
+ WBACK;
+ break;
+ case 5: //SUB
+ if(opcode==0x81) {INST_NAME("SUB Ed, Id");} else {INST_NAME("SUB Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED32((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6);
+ WBACK;
+ break;
+ case 6: //XOR
+ if(opcode==0x81) {INST_NAME("XOR Ed, Id");} else {INST_NAME("XOR Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED32((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4);
+ WBACK;
+ break;
+ case 7: //CMP
+ if(opcode==0x81) {INST_NAME("CMP Ed, Id");} else {INST_NAME("CMP Ed, Ib");}
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ GETED32((opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ if(i64) {
+ MOV64xw(x2, i64);
+ emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5, x6);
+ } else
+ emit_cmp32_0(dyn, ninst, rex, ed, x3, x4);
+ break;
+ }
+ break;
+
+ case 0x88:
+ INST_NAME("MOV Eb, Gb");
+ nextop = F8;
+ gd = ((nextop&0x38)>>3)+(rex.r<<3);
+ if(rex.rex) {
+ gb2 = 0;
+ gb1 = xRAX + gd;
+ } else {
+ gb2 = ((gd&4)>>2);
+ gb1 = xRAX+(gd&3);
+ }
+ gd = x4;
+ if(gb2) {
+ SRLI(x4, gb1, 8);
+ gb1 = x4;
+ }
+ if(MODREG) {
+ ed = (nextop&7) + (rex.b<<3);
+ if(rex.rex) {
+ eb1 = xRAX+ed;
+ eb2 = 0;
+ } else {
+ eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
+ eb2 = ((ed&4)>>2); // L or H
+ }
+ ANDI(gd, gb1, 0xff);
+ if(eb2) {
+ MOV64x(x1, 0xffffffffffff00ffLL);
+ AND(x1, eb1, x1);
+ SLLI(gd, gd, 8);
+ OR(eb1, x1, gd);
+ } else {
+ ANDI(x1, eb1, ~0xff);
+ OR(eb1, x1, gd);
+ }
+ } else {
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0);
+ SB(gb1, ed, fixedaddress);
+ SMWRITELOCK(lock);
+ }
+ break;
+ case 0x89:
+ INST_NAME("MOV Ed, Gd");
+ nextop=F8;
+ GETGD;
+ if(MODREG) { // reg <= reg
+ MVxw(xRAX+(nextop&7)+(rex.b<<3), gd);
+ } else { // mem <= reg
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0);
+ SDxw(gd, ed, fixedaddress);
+ SMWRITELOCK(lock);
+ }
+ break;
+ case 0x8B:
+ INST_NAME("MOV Gd, Ed");
+ nextop=F8;
+ GETGD;
+ if(MODREG) {
+ MVxw(gd, xRAX+(nextop&7)+(rex.b<<3));
+ } else {
+ addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0);
+ SMREADLOCK(lock);
+ LDxw(gd, ed, fixedaddress);
+ }
+ break;
+ case 0x8D:
+ INST_NAME("LEA Gd, Ed");
+ nextop=F8;
+ GETGD;
+ if(MODREG) { // reg <= reg? that's an invalid operation
+ DEFAULT;
+ } else { // mem <= reg
+ addr = geted32(dyn, addr, ninst, nextop, &ed, gd, x1, &fixedaddress, rex, NULL, 0, 0);
+ if(ed!=gd) {
+ AND(gd, ed, xMASK);
+ }
+ }
+ break;
+ #define GO(Z) \
+ BARRIER(BARRIER_MAYBE); \
+ JUMP(addr+i8, 1); \
+ if(dyn->insts[ninst].x64.jmp_insts==-1 || \
+ CHECK_CACHE()) { \
+ /* out of the block */ \
+ i32 = dyn->insts[ninst].epilog-(dyn->native_size); \
+ if(Z) {BNE(x1, xZR, i32);} else {BEQ(x1, xZR, i32);}; \
+ if(dyn->insts[ninst].x64.jmp_insts==-1) { \
+ if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \
+ fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \
+ jump_to_next(dyn, addr+i8, 0, ninst); \
+ } else { \
+ CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \
+ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \
+ B(i32); \
+ } \
+ } else { \
+ /* inside the block */ \
+ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \
+ if(Z) {BEQ(x1, xZR, i32);} else {BNE(x1, xZR, i32);}; \
+ }
+ case 0xE0:
+ INST_NAME("LOOPNZ (32bits)");
+ READFLAGS(X_ZF);
+ i8 = F8S;
+ SUBI(xRCX, xRCX, 1);
+ ANDI(x1, xFlags, 1 << F_ZF);
+ CBNZ_NEXT(x1);
+ AND(x1, xRCX, xMASK);
+ GO(0);
+ break;
+ case 0xE1:
+ INST_NAME("LOOPZ (32bits)");
+ READFLAGS(X_ZF);
+ i8 = F8S;
+ SUBI(xRCX, xRCX, 1);
+ ANDI(x1, xFlags, 1 << F_ZF);
+ CBZ_NEXT(x1);
+ AND(x1, xRCX, xMASK);
+ GO(0);
+ break;
+ case 0xE2:
+ INST_NAME("LOOP (32bits)");
+ i8 = F8S;
+ SUBI(xRCX, xRCX, 1);
+ AND(x1, xRCX, xMASK);
+ GO(0);
+ break;
+ case 0xE3:
+ INST_NAME("JECXZ (32bits)");
+ i8 = F8S;
+ AND(x1, xRCX, xMASK);
+ GO(1);
+ break;
+ #undef GO
+
+ default:
+ DEFAULT;
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_d8.c b/src/dynarec/rv64/dynarec_rv64_d8.c
new file mode 100644
index 0000000..7f14468
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_d8.c
@@ -0,0 +1,182 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "emu/x87emu_private.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+
+uintptr_t dynarec64_D8(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ (void)ip; (void)rep; (void)need_epilog;
+
+ uint8_t nextop = F8;
+ uint8_t ed;
+ uint8_t wback, wb1;
+ uint8_t u8;
+ int64_t fixedaddress;
+ int unscaled;
+ int v1, v2;
+ int s0;
+ int i1, i2, i3;
+
+ MAYUSE(s0);
+ MAYUSE(v2);
+ MAYUSE(v1);
+
+ switch(nextop) {
+ case 0xC0 ... 0xC7:
+
+ case 0xC8 ... 0xCF:
+
+ case 0xD0 ... 0xD7:
+
+ case 0xD8 ... 0xDF:
+ INST_NAME("FCOMP ST0, STx");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ LHU(x3, xEmu, offsetof(x64emu_t, sw));
+ MOV32w(x1, 0b1110100011111111); // mask off c0,c1,c2,c3
+ AND(x3, x3, x1);
+ if(ST_IS_F(0)) {
+ FEQS(x5, v1, v1);
+ FEQS(x4, v2, v2);
+ AND(x5, x5, x4);
+ BEQZ(x5, 24); // undefined/NaN
+ FEQS(x5, v1, v2);
+ BNEZ(x5, 28); // equal
+ FLTS(x3, v1, v2); // x3 = (v1<v2)?1:0
+ SLLI(x1, x3, 8);
+ J(20); // end
+ // undefined/NaN
+ LUI(x1, 1);
+ ADDI(x1, x1, 0b010100000000);
+ J(8); // end
+ // equal
+ LUI(x1, 1);
+ // end
+ } else {
+ FEQD(x5, v1, v1);
+ FEQD(x4, v2, v2);
+ AND(x5, x5, x4);
+ BEQZ(x5, 24); // undefined/NaN
+ FEQD(x5, v1, v2);
+ BNEZ(x5, 28); // equal
+ FLTD(x3, v1, v2); // x3 = (v1<v2)?1:0
+ SLLI(x1, x3, 8);
+ J(20); // end
+ // undefined/NaN
+ LUI(x1, 1);
+ ADDI(x1, x1, 0b010100000000);
+ J(8); // end
+ // equal
+ LUI(x1, 1);
+ // end
+ }
+ OR(x3, x3, x1);
+ SH(x3, xEmu, offsetof(x64emu_t, sw));
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xE0 ... 0xE7:
+ INST_NAME("FSUB ST0, STx");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ if(ST_IS_F(0)) {
+ FSUBS(v1, v1, v2);
+ } else {
+ FSUBD(v1, v1, v2);
+ }
+ break;
+ case 0xE8 ... 0xEF:
+
+ case 0xF0 ... 0xF7:
+ INST_NAME("FDIV ST0, STx");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ if(ST_IS_F(0)) {
+ FDIVS(v1, v1, v2);
+ } else {
+ FDIVD(v1, v1, v2);
+ }
+ break;
+ case 0xF8 ... 0xFF:
+ DEFAULT;
+ break;
+
+ default:
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("FADD ST0, float[ED]");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ s0 = fpu_get_scratch(dyn);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FLW(s0, ed, fixedaddress);
+ if(ST_IS_F(0)) {
+ FADDS(v1, v1, s0);
+ } else {
+ FCVTDS(s0, s0);
+ FADDD(v1, v1, s0);
+ }
+ break;
+ case 1:
+ INST_NAME("FMUL ST0, float[ED]");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ s0 = fpu_get_scratch(dyn);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FLW(s0, ed, fixedaddress);
+ if(ST_IS_F(0)) {
+ FMULS(v1, v1, s0);
+ } else {
+ FCVTDS(s0, s0);
+ FMULD(v1, v1, s0);
+ }
+ break;
+ case 4:
+ INST_NAME("FSUB ST0, float[ED]");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ s0 = fpu_get_scratch(dyn);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FLW(s0, ed, fixedaddress);
+ if(ST_IS_F(0)) {
+ FSUBS(v1, v1, s0);
+ } else {
+ FCVTDS(s0, s0);
+ FSUBD(v1, v1, s0);
+ }
+ break;
+ case 6:
+ INST_NAME("FDIV ST0, float[ED]");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ s0 = fpu_get_scratch(dyn);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FLW(s0, ed, fixedaddress);
+ if(ST_IS_F(0)) {
+ FDIVS(v1, v1, s0);
+ } else {
+ FCVTDS(s0, s0);
+ FDIVD(v1, v1, s0);
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_d9.c b/src/dynarec/rv64/dynarec_rv64_d9.c
new file mode 100644
index 0000000..4940d6b
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_d9.c
@@ -0,0 +1,426 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "emu/x87emu_private.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+
+uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ (void)ip; (void)rep; (void)need_epilog;
+
+ uint8_t nextop = F8;
+ uint8_t ed;
+ uint8_t wback, wb1;
+ uint8_t u8;
+ int64_t fixedaddress;
+ int unscaled;
+ int v0, v1, v2;
+ int s0;
+ int i1, i2, i3;
+ int64_t j64;
+
+ MAYUSE(s0);
+ MAYUSE(v0);
+ MAYUSE(v1);
+ MAYUSE(v2);
+ MAYUSE(j64);
+
+ switch(nextop) {
+ case 0xC0:
+ case 0xC1:
+ case 0xC2:
+ case 0xC3:
+ case 0xC4:
+ case 0xC5:
+ case 0xC6:
+ case 0xC7:
+ INST_NAME("FLD STx");
+ v2 = x87_do_push(dyn, ninst, x1, X87_ST(nextop&7));
+ v1 = x87_get_st(dyn, ninst, x1, x2, (nextop&7)+1, X87_COMBINE(0, (nextop&7)+1));
+ if(ST_IS_F(0)) {
+ FMVS(v2, v1);
+ } else {
+ FMVD(v2, v1);
+ }
+ break;
+
+ case 0xC8:
+ INST_NAME("FXCH ST0");
+ break;
+ case 0xC9:
+ case 0xCA:
+ case 0xCB:
+ case 0xCC:
+ case 0xCD:
+ case 0xCE:
+ case 0xCF:
+ INST_NAME("FXCH STx");
+ // swap the cache value, not the double value itself :p
+ x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_ST(nextop&7));
+ x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ x87_swapreg(dyn, ninst, x1, x2, 0, nextop&7);
+ // should set C1 to 0
+ break;
+
+ case 0xD0:
+ INST_NAME("FNOP");
+ break;
+
+ case 0xD8:
+ INST_NAME("FSTPNCE ST0, ST0");
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xD9:
+ case 0xDA:
+ case 0xDB:
+ case 0xDC:
+ case 0xDD:
+ case 0xDE:
+ case 0xDF:
+ INST_NAME("FSTPNCE ST0, STx");
+ // copy the cache value for st0 to stx
+ x87_get_st_empty(dyn, ninst, x1, x2, nextop&7, X87_ST(nextop&7));
+ x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ x87_swapreg(dyn, ninst, x1, x2, 0, nextop&7);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xE0:
+ INST_NAME("FCHS");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ if(ST_IS_F(0)) {
+ FNEGS(v1, v1);
+ } else {
+ FNEGD(v1, v1);
+ }
+ break;
+ case 0xE1:
+ INST_NAME("FABS");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ if(ST_IS_F(0)) {
+ FABSS(v1, v1);
+ } else {
+ FABSD(v1, v1);
+ }
+ break;
+
+ case 0xE4:
+ INST_NAME("FTST");
+ DEFAULT
+ break;
+ case 0xE5:
+ INST_NAME("FXAM");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_refresh(dyn, ninst, x1, x2, 0);
+ CALL(fpu_fxam, -1); // should be possible inline, but is it worth it?
+ break;
+
+ case 0xE8:
+ INST_NAME("FLD1");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_F);
+ if(ST_IS_F(0)) {
+ MOV32w(x1, 0x3f800000);
+ FMVWX(v1, x1);
+ } else {
+ MOV64x(x1, 0x3FF0000000000000);
+ FMVDX(v1, x1);
+ }
+ break;
+ case 0xE9:
+ INST_NAME("FLDL2T");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_D);
+ FTABLE64(v1, L2T);
+ break;
+ case 0xEA:
+ INST_NAME("FLDL2E");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_D);
+ FTABLE64(v1, L2E);
+ break;
+ case 0xEB:
+ INST_NAME("FLDPI");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_D);
+ FTABLE64(v1, PI);
+ break;
+ case 0xEC:
+ INST_NAME("FLDLG2");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_D);
+ FTABLE64(v1, LG2);
+ break;
+ case 0xED:
+ INST_NAME("FLDLN2");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_D);
+ FTABLE64(v1, LN2);
+ break;
+ case 0xEE:
+ INST_NAME("FLDZ");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_F);
+ if(ST_IS_F(0)) {
+ FMVWX(v1, xZR);
+ } else {
+ FMVDX(v1, xZR);
+ }
+ break;
+
+ case 0xF0:
+ INST_NAME("F2XM1");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_forget(dyn, ninst, x1, x2, 0);
+ CALL(native_f2xm1, -1);
+ break;
+ case 0xF1:
+ INST_NAME("FYL2X");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_forget(dyn, ninst, x1, x2, 0);
+ x87_forget(dyn, ninst, x1, x2, 1);
+ CALL(native_fyl2x, -1);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xF2:
+ INST_NAME("FPTAN");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_forget(dyn, ninst, x1, x2, 0);
+ CALL(native_ftan, -1);
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_F);
+ if(ST_IS_F(0)) {
+ MOV32w(x1, 0x3f800000);
+ FMVWX(v1, x1);
+ } else {
+ MOV64x(x1, 0x3FF0000000000000);
+ FMVDX(v1, x1);
+ }
+ break;
+ case 0xF3:
+ INST_NAME("FPATAN");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_forget(dyn, ninst, x1, x2, 0);
+ x87_forget(dyn, ninst, x1, x2, 1);
+ CALL(native_fpatan, -1);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xF4:
+ INST_NAME("FXTRACT");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_do_push_empty(dyn, ninst, 0);
+ x87_forget(dyn, ninst, x1, x2, 1);
+ CALL(native_fxtract, -1);
+ break;
+ case 0xF5:
+ INST_NAME("FPREM1");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_forget(dyn, ninst, x1, x2, 0);
+ x87_forget(dyn, ninst, x1, x2, 1);
+ CALL(native_fprem1, -1);
+ break;
+ case 0xF6:
+ INST_NAME("FDECSTP");
+ fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
+ LW(x2, xEmu, offsetof(x64emu_t, top));
+ SUBI(x2, x2, 1);
+ ANDI(x2, x2, 7);
+ SW(x2, xEmu, offsetof(x64emu_t, top));
+ break;
+ case 0xF7:
+ INST_NAME("FINCSTP");
+ fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
+ LW(x2, xEmu, offsetof(x64emu_t, top));
+ ADDI(x2, x2, 1);
+ ANDI(x2, x2, 7);
+ SW(x2, xEmu, offsetof(x64emu_t, top));
+ break;
+ case 0xF8:
+ INST_NAME("FPREM");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_forget(dyn, ninst, x1, x2, 0);
+ x87_forget(dyn, ninst, x1, x2, 1);
+ CALL(native_fprem, -1);
+ break;
+ case 0xF9:
+ INST_NAME("FYL2XP1");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_forget(dyn, ninst, x1, x2, 0);
+ x87_forget(dyn, ninst, x1, x2, 1);
+ CALL(native_fyl2xp1, -1);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xFA:
+ INST_NAME("FSQRT");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ if(ST_IS_F(0)) {
+ FSQRTS(v1, v1);
+ } else {
+ FSQRTD(v1, v1);
+ }
+ break;
+ case 0xFB:
+ INST_NAME("FSINCOS");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_do_push_empty(dyn, ninst, 0);
+ x87_forget(dyn, ninst, x1, x2, 1);
+ CALL(native_fsincos, -1);
+ break;
+ case 0xFC:
+ INST_NAME("FRNDINT");
+ v0 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ v1 = fpu_get_scratch(dyn);
+ v2 = fpu_get_scratch(dyn);
+ u8 = x87_setround(dyn, ninst, x1, x2);
+
+ if(ST_IS_F(0)) {
+ FEQS(x2, v0, v0);
+ BNEZ_MARK(x2);
+ B_NEXT_nocond;
+ MARK; // v0 is not nan
+ FABSS(v1, v0);
+ MOV64x(x3, 1ULL << __FLT_MANT_DIG__);
+ FCVTSL(v2, x3, RD_RTZ);
+ FLTS(x3, v1, v2);
+ BNEZ_MARK2(x3);
+ B_NEXT_nocond;
+ MARK2;
+ FCVTLS(x3, v0, RD_DYN);
+ FCVTSL(v1, x3, RD_DYN);
+ FSGNJS(v0, v1, v0);
+ } else {
+ FEQD(x2, v0, v0);
+ BNEZ_MARK(x2);
+ B_NEXT_nocond;
+ MARK; // v0 is not nan
+ FABSD(v1, v0);
+ MOV64x(x3, 1ULL << __DBL_MANT_DIG__);
+ FCVTDL(v2, x3, RD_RTZ);
+ FLTD(x3, v1, v2);
+ BNEZ_MARK2(x3);
+ B_NEXT_nocond;
+ MARK2;
+ FCVTLD(x3, v0, RD_DYN);
+ FCVTDL(v1, x3, RD_DYN);
+ FSGNJD(v0, v1, v0);
+ }
+ x87_restoreround(dyn, ninst, u8);
+ break;
+ case 0xFD:
+ INST_NAME("FSCALE");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_forget(dyn, ninst, x1, x2, 0);
+ x87_forget(dyn, ninst, x1, x2, 1);
+ CALL(native_fscale, -1);
+ break;
+ case 0xFE:
+ INST_NAME("FSIN");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_forget(dyn, ninst, x1, x2, 0);
+ CALL(native_fsin, -1);
+ break;
+ case 0xFF:
+ INST_NAME("FCOS");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_forget(dyn, ninst, x1, x2, 0);
+ CALL(native_fcos, -1);
+ break;
+
+
+ case 0xD1:
+ case 0xD4:
+ case 0xD5:
+ case 0xD6:
+ case 0xD7:
+ case 0xE2:
+ case 0xE3:
+ case 0xE6:
+ case 0xE7:
+ case 0xEF:
+ DEFAULT;
+ break;
+
+ default:
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("FLD ST0, float[ED]");
+ v1 = x87_do_push(dyn, ninst, x1, box64_dynarec_x87double?EXT_CACHE_ST_D:EXT_CACHE_ST_F);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FLW(v1, ed, fixedaddress);
+ if(!ST_IS_F(0)) {
+ FCVTDS(v1, v1);
+ }
+ break;
+ case 2:
+ INST_NAME("FST float[ED], ST0");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F);
+ if(ST_IS_F(0))
+ s0 = v1;
+ else {
+ s0 = fpu_get_scratch(dyn);
+ FCVTSD(s0, v1);
+ }
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FSW(s0, ed, fixedaddress);
+ break;
+ case 3:
+ INST_NAME("FSTP float[ED], ST0");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ if(!ST_IS_F(0)) {
+ FCVTSD(v1, v1);
+ }
+ FSW(v1, ed, fixedaddress);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 4:
+ INST_NAME("FLDENV Ed");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE?
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0);
+ if(ed!=x1) {
+ MV(x1, ed);
+ }
+ MOV32w(x2, 0);
+ CALL(fpu_loadenv, -1);
+ break;
+ case 5:
+ INST_NAME("FLDCW Ew");
+ GETEW(x1, 0);
+ SH(x1, xEmu, offsetof(x64emu_t, cw)); // hopefully cw is not too far for an imm8
+ break;
+ case 6:
+ INST_NAME("FNSTENV Ed");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE?
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0);
+ if(ed!=x1) {
+ MV(x1, ed);
+ }
+ MOV32w(x2, 0);
+ CALL(fpu_savenv, -1);
+ break;
+ case 7:
+ INST_NAME("FNSTCW Ew");
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 0, 0);
+ ed = x1;
+ wb1 = 1;
+ LH(x1, xEmu, offsetof(x64emu_t, cw));
+ EWBACK;
+ break;
+ default:
+ DEFAULT;
+ }
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_db.c b/src/dynarec/rv64/dynarec_rv64_db.c
new file mode 100644
index 0000000..7a5dddb
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_db.c
@@ -0,0 +1,303 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "emu/x87emu_private.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+
+uintptr_t dynarec64_DB(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ (void)ip; (void)rep; (void)need_epilog;
+
+ uint8_t nextop = F8;
+ uint8_t ed;
+ uint8_t wback;
+ uint8_t u8;
+ int64_t fixedaddress;
+ int unscaled;
+ int v1, v2;
+ int s0;
+ int64_t j64;
+
+ MAYUSE(s0);
+ MAYUSE(v2);
+ MAYUSE(v1);
+ MAYUSE(j64);
+
+ switch(nextop) {
+ case 0xC0:
+ case 0xC1:
+ case 0xC2:
+ case 0xC3:
+ case 0xC4:
+ case 0xC5:
+ case 0xC6:
+ case 0xC7:
+ INST_NAME("FCMOVNB ST0, STx");
+ READFLAGS(X_CF);
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ ANDI(x1, xFlags, 1<<F_CF);
+ CBNZ_NEXT(x1);
+ if(ST_IS_F(0)) {
+ FMVS(v1, v2);
+ } else {
+ FMVD(v1, v2); // F_CF==0
+ }
+ break;
+ case 0xC8:
+ case 0xC9:
+ case 0xCA:
+ case 0xCB:
+ case 0xCC:
+ case 0xCD:
+ case 0xCE:
+ case 0xCF:
+ INST_NAME("FCMOVNE ST0, STx");
+ READFLAGS(X_ZF);
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ ANDI(x1, xFlags, 1<<F_ZF);
+ CBNZ_NEXT(x1);
+ if(ST_IS_F(0)) {
+ FMVS(v1, v2);
+ } else {
+ FMVD(v1, v2); // F_ZF==0
+ }
+ break;
+ case 0xD0:
+ case 0xD1:
+ case 0xD2:
+ case 0xD3:
+ case 0xD4:
+ case 0xD5:
+ case 0xD6:
+ case 0xD7:
+ INST_NAME("FCMOVNBE ST0, STx");
+ READFLAGS(X_CF|X_ZF);
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ ANDI(x1, xFlags, (1<<F_CF)|(1<<F_ZF));
+ CBNZ_NEXT(x1);
+ if(ST_IS_F(0)) {
+ FMVS(v1, v2);
+ } else {
+ FMVD(v1, v2); // F_CF==0 & F_ZF==0
+ }
+ break;
+ case 0xD8:
+ case 0xD9:
+ case 0xDA:
+ case 0xDB:
+ case 0xDC:
+ case 0xDD:
+ case 0xDE:
+ case 0xDF:
+ INST_NAME("FCMOVNU ST0, STx");
+ READFLAGS(X_PF);
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ ANDI(x1, xFlags, 1<<F_PF);
+ CBNZ_NEXT(x1);
+ if(ST_IS_F(0)) {
+ FMVS(v1, v2);
+ } else {
+ FMVD(v1, v2); // F_PF==0
+ }
+ break;
+ case 0xE1:
+ INST_NAME("FDISI8087_NOP"); // so.. NOP?
+ break;
+ case 0xE2:
+ INST_NAME("FNCLEX");
+ LH(x2, xEmu, offsetof(x64emu_t, sw));
+ ANDI(x2, x2, ~(0xff)); // IE .. PE, SF, ES
+ MOV32w(x1, ~(1<<15)); // B
+ AND(x2, x2, x1);
+ SH(x2, xEmu, offsetof(x64emu_t, sw));
+ break;
+ case 0xE3:
+ INST_NAME("FNINIT");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_purgecache(dyn, ninst, 0, x1, x2, x3);
+ CALL(reset_fpu, -1);
+ break;
+ case 0xE8:
+ case 0xE9:
+ case 0xEA:
+ case 0xEB:
+ case 0xEC:
+ case 0xED:
+ case 0xEE:
+ case 0xEF:
+ INST_NAME("FUCOMI ST0, STx");
+ SETFLAGS(X_ALL, SF_SET);
+ SET_DFNONE();
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ IFX(F_ZF | F_PF | F_CF) {
+ if(ST_IS_F(0)) {
+ FEQS(x5, v1, v1);
+ FEQS(x4, v2, v2);
+ AND(x5, x5, x4);
+ BEQZ(x5, 24); // undefined/NaN
+ FEQS(x5, v1, v2);
+ BNEZ(x5, 24); // equal
+ FLTS(x3, v1, v2); // x3 = (v1<v2)?1:0
+ OR(xFlags, xFlags, x3); // CF is the least significant bit
+ J(16); // end
+ // NaN
+ ORI(xFlags, xFlags, (1<<F_ZF) | (1<<F_PF) | (1<<F_CF));
+ J(8); // end
+ // equal
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ // end
+ } else {
+ FEQD(x5, v1, v1);
+ FEQD(x4, v2, v2);
+ AND(x5, x5, x4);
+ BEQZ(x5, 24); // undefined/NaN
+ FEQD(x5, v1, v2);
+ BNEZ(x5, 24); // equal
+ FLTD(x3, v1, v2); // x3 = (v1<v2)?1:0
+ OR(xFlags, xFlags, x3); // CF is the least significant bit
+ J(16); // end
+ // NaN
+ ORI(xFlags, xFlags, (1<<F_ZF) | (1<<F_PF) | (1<<F_CF));
+ J(8); // end
+ // equal
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ // end
+ }
+ }
+ break;
+ case 0xF0:
+ case 0xF1:
+ case 0xF2:
+ case 0xF3:
+ case 0xF4:
+ case 0xF5:
+ case 0xF6:
+ case 0xF7:
+ INST_NAME("FCOMI ST0, STx");
+ DEFAULT;
+ break;
+
+ case 0xE0:
+ case 0xE4:
+ case 0xE5:
+ case 0xE6:
+ case 0xE7:
+ DEFAULT;
+ break;
+
+ default:
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("FILD ST0, Ed");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_D);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ LW(x1, ed, fixedaddress);
+ FCVTDW(v1, x1, RD_RNE); // i32 -> double
+ break;
+ case 1:
+ INST_NAME("FISTTP Ed, ST0");
+ DEFAULT;
+ break;
+ case 2:
+ INST_NAME("FIST Ed, ST0");
+ DEFAULT;
+ break;
+ case 3:
+ INST_NAME("FISTP Ed, ST0");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D);
+ u8 = x87_setround(dyn, ninst, x1, x2);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0);
+ v2 = fpu_get_scratch(dyn);
+ if(!box64_dynarec_fastround) {
+ FSFLAGSI(0); // reset all bits
+ }
+ FCVTWD(x4, v1, RD_DYN);
+ x87_restoreround(dyn, ninst, u8);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, 1<<FR_NV);
+ BEQ_MARK2(x5, xZR);
+ MOV32w(x4, 0x80000000);
+ }
+ MARK2;
+ SW(x4, wback, fixedaddress);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 5:
+ INST_NAME("FLD tbyte");
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0);
+ if((PK(0)==0xDB && ((PK(1)>>3)&7)==7) || (PK(0)>=0x40 && PK(0)<=0x4f && PK(1)==0xDB && ((PK(2)>>3)&7)==7)) {
+ // the FLD is immediatly followed by an FSTP
+ LD(x5, ed, fixedaddress+0);
+ LH(x6, ed, fixedaddress+8);
+ // no persistant scratch register, so unrool both instruction here...
+ MESSAGE(LOG_DUMP, "\tHack: FSTP tbyte\n");
+ nextop = F8; // 0xDB or rex
+ if(nextop>=0x40 && nextop<=0x4f) {
+ rex.rex = nextop;
+ nextop = F8; //0xDB
+ } else
+ rex.rex = 0;
+ nextop = F8; //modrm
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0);
+ SD(x5, ed, fixedaddress+0);
+ SH(x6, ed, fixedaddress+8);
+ } else {
+ if(box64_x87_no80bits) {
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_D);
+ FLD(v1, ed, fixedaddress);
+ } else {
+ if(ed!=x1) {
+ MV(x1, ed);
+ }
+ x87_do_push_empty(dyn, ninst, x3);
+ CALL(native_fld, -1);
+ }
+ }
+ break;
+ case 7:
+ INST_NAME("FSTP tbyte");
+ if(box64_x87_no80bits) {
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FSD(v1, wback, fixedaddress);
+ } else {
+ x87_forget(dyn, ninst, x1, x3, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0);
+ if(ed!=x1) {
+ MV(x1, ed);
+ }
+ CALL(native_fstp, -1);
+ }
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ default:
+ DEFAULT;
+ }
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_dc.c b/src/dynarec/rv64/dynarec_rv64_dc.c
new file mode 100644
index 0000000..d802e2f
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_dc.c
@@ -0,0 +1,119 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "emu/x87emu_private.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+
+uintptr_t dynarec64_DC(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ (void)ip; (void)rep; (void)need_epilog;
+
+ uint8_t nextop = F8;
+ uint8_t wback;
+ int64_t fixedaddress;
+ int unscaled;
+ int v1, v2;
+
+ MAYUSE(v2);
+ MAYUSE(v1);
+
+ switch(nextop) {
+ case 0xC0 ... 0xC7:
+ INST_NAME("FADD STx, ST0");
+ DEFAULT;
+ break;
+ case 0xC8 ... 0xCF:
+ INST_NAME("FMUL STx, ST0");
+ DEFAULT;
+ break;
+ case 0xD0 ... 0xD7:
+ INST_NAME("FCOM ST0, STx"); //yep
+ DEFAULT;
+ break;
+ case 0xD8 ... 0xDF:
+ INST_NAME("FCOMP ST0, STx");
+ DEFAULT;
+ break;
+ case 0xE0 ... 0xE7:
+ INST_NAME("FSUBR STx, ST0");
+ DEFAULT;
+ break;
+ break;
+ case 0xE8 ... 0xEF:
+ INST_NAME("FSUB STx, ST0");
+ DEFAULT;
+ break;
+ case 0xF0 ... 0xF7:
+ INST_NAME("FDIVR STx, ST0");
+ DEFAULT;
+ break;
+ case 0xF8 ... 0xFF:
+ INST_NAME("FDIV STx, ST0");
+ DEFAULT;
+ break;
+ default:
+ switch((nextop>>3)&7) {
+ case 3:
+ INST_NAME("FCOMP ST0, double[ED]");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D);
+ v2 = fpu_get_scratch(dyn);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FLD(v2, wback, fixedaddress);
+
+ LHU(x3, xEmu, offsetof(x64emu_t, sw));
+ MOV32w(x1, 0b1110100011111111); // mask off c0,c1,c2,c3
+ AND(x3, x3, x1);
+ FEQD(x5, v1, v1);
+ FEQD(x4, v2, v2);
+ AND(x5, x5, x4);
+ BEQZ(x5, 24); // undefined/NaN
+ FEQD(x5, v1, v2);
+ BNEZ(x5, 28); // equal
+ FLTD(x3, v1, v2); // x3 = (v1<v2)?1:0
+ SLLI(x1, x3, 8);
+ J(20); // end
+ // undefined/NaN
+ LUI(x1, 1);
+ ADDI(x1, x1, 0b010100000000);
+ J(8); // end
+ // equal
+ LUI(x1, 1);
+ // end
+ OR(x3, x3, x1);
+ SH(x3, xEmu, offsetof(x64emu_t, sw));
+
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 6:
+ INST_NAME("FDIV ST0, double[ED]");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D);
+ v2 = fpu_get_scratch(dyn);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FLD(v2, wback, fixedaddress);
+ FDIVD(v1, v1, v2);
+ break;
+ default:
+ DEFAULT;
+ }
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_dd.c b/src/dynarec/rv64/dynarec_rv64_dd.c
new file mode 100644
index 0000000..044f9aa
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_dd.c
@@ -0,0 +1,179 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "emu/x87emu_private.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+
+uintptr_t dynarec64_DD(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ (void)ip; (void)rep; (void)need_epilog;
+
+ uint8_t nextop = F8;
+ uint8_t ed, wback;
+ int64_t fixedaddress;
+ int unscaled;
+ int v1, v2;
+ int s0;
+ int64_t j64;
+
+ MAYUSE(s0);
+ MAYUSE(v2);
+ MAYUSE(v1);
+ MAYUSE(j64);
+
+ switch(nextop) {
+ case 0xC0:
+ case 0xC1:
+ case 0xC2:
+ case 0xC3:
+ case 0xC4:
+ case 0xC5:
+ case 0xC6:
+ case 0xC7:
+ INST_NAME("FFREE STx");
+ MESSAGE(LOG_DUMP, "Need Optimization\n");
+ x87_purgecache(dyn, ninst, 0, x1, x2, x3);
+ MOV32w(x1, nextop&7);
+ CALL(fpu_do_free, -1);
+ break;
+ case 0xD0:
+ case 0xD1:
+ case 0xD2:
+ case 0xD3:
+ case 0xD4:
+ case 0xD5:
+ case 0xD6:
+ case 0xD7:
+ INST_NAME("FST ST0, STx");
+ DEFAULT;
+ break;
+ case 0xD8:
+ INST_NAME("FSTP ST0, ST0");
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xD9:
+ case 0xDA:
+ case 0xDB:
+ case 0xDC:
+ case 0xDD:
+ case 0xDE:
+ case 0xDF:
+ INST_NAME("FSTP ST0, STx");
+ // copy the cache value for st0 to stx
+ x87_get_st_empty(dyn, ninst, x1, x2, nextop&7, X87_ST(nextop&7));
+ x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
+ x87_swapreg(dyn, ninst, x1, x2, 0, nextop&7);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xE0:
+ case 0xE1:
+ case 0xE2:
+ case 0xE3:
+ case 0xE4:
+ case 0xE5:
+ case 0xE6:
+ case 0xE7:
+ INST_NAME("FUCOM ST0, STx");
+ DEFAULT;
+ break;
+ case 0xE8:
+ case 0xE9:
+ case 0xEA:
+ case 0xEB:
+ case 0xEC:
+ case 0xED:
+ case 0xEE:
+ case 0xEF:
+ INST_NAME("FUCOMP ST0, STx");
+ DEFAULT;
+ break;
+ case 0xC8:
+ case 0xC9:
+ case 0xCA:
+ case 0xCB:
+ case 0xCC:
+ case 0xCD:
+ case 0xCE:
+ case 0xCF:
+ case 0xF0:
+ case 0xF1:
+ case 0xF2:
+ case 0xF3:
+ case 0xF4:
+ case 0xF5:
+ case 0xF6:
+ case 0xF7:
+ case 0xF8:
+ case 0xF9:
+ case 0xFA:
+ case 0xFB:
+ case 0xFC:
+ case 0xFD:
+ case 0xFE:
+ case 0xFF:
+ DEFAULT;
+ break;
+
+ default:
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("FLD double");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_D);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FLD(v1, wback, fixedaddress);
+ break;
+ case 2:
+ INST_NAME("FST double");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FSD(v1, wback, fixedaddress);
+ break;
+ case 3:
+ INST_NAME("FSTP double");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0);
+ FSD(v1, wback, fixedaddress);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 7:
+ INST_NAME("FNSTSW m2byte");
+ fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0);
+ LWU(x2, xEmu, offsetof(x64emu_t, top));
+ LHU(x3, xEmu, offsetof(x64emu_t, sw));
+ if(dyn->e.x87stack) {
+ // update top
+ ADDI(x2, x2, -dyn->e.x87stack);
+ ANDI(x2, x2, 7);
+ }
+ MOV32w(x5, ~0x3800);
+ AND(x3, x3, x5); // mask out TOP
+ SLLI(x2, x2, 11); // shift TOP to bit 11
+ OR(x3, x3, x2); // inject TOP
+ SH(x3, ed, fixedaddress); // store whole sw flags
+ break;
+ default:
+ DEFAULT;
+ }
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_de.c b/src/dynarec/rv64/dynarec_rv64_de.c
new file mode 100644
index 0000000..a2341b4
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_de.c
@@ -0,0 +1,177 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "emu/x87emu_private.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+
+uintptr_t dynarec64_DE(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ (void)ip; (void)rep; (void)need_epilog;
+
+ uint8_t nextop = F8;
+ uint8_t wback;
+ int64_t fixedaddress;
+ int v1, v2;
+
+ MAYUSE(v2);
+ MAYUSE(v1);
+
+ switch(nextop) {
+ case 0xC0:
+ case 0xC1:
+ case 0xC2:
+ case 0xC3:
+ case 0xC4:
+ case 0xC5:
+ case 0xC6:
+ case 0xC7:
+ INST_NAME("FADDP STx, ST0");
+ v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ if(ST_IS_F(0)) {
+ FADDS(v1, v1, v2);
+ } else {
+ FADDD(v1, v1, v2);
+ }
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xC8:
+ case 0xC9:
+ case 0xCA:
+ case 0xCB:
+ case 0xCC:
+ case 0xCD:
+ case 0xCE:
+ case 0xCF:
+ INST_NAME("FMULP STx, ST0");
+ v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ if(ST_IS_F(0)) {
+ FMULS(v1, v1, v2);
+ } else {
+ FMULD(v1, v1, v2);
+ }
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xD0:
+ case 0xD1:
+ case 0xD2:
+ case 0xD3:
+ case 0xD4:
+ case 0xD5:
+ case 0xD6:
+ case 0xD7:
+ // INST_NAME("FCOMP ST0, STx"); //yep
+ DEFAULT;
+ break;
+ case 0xD9:
+ // INST_NAME("FCOMPP ST0, STx");
+ DEFAULT;
+ break;
+ case 0xE0:
+ case 0xE1:
+ case 0xE2:
+ case 0xE3:
+ case 0xE4:
+ case 0xE5:
+ case 0xE6:
+ case 0xE7:
+ INST_NAME("FSUBRP STx, ST0");
+ v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ if(ST_IS_F(0)) {
+ FSUBS(v1, v2, v1);
+ } else {
+ FSUBD(v1, v2, v1);
+ }
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xE8:
+ case 0xE9:
+ case 0xEA:
+ case 0xEB:
+ case 0xEC:
+ case 0xED:
+ case 0xEE:
+ case 0xEF:
+ INST_NAME("FSUBP STx, ST0");
+ v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ if(ST_IS_F(0)) {
+ FSUBS(v1, v1, v2);
+ } else {
+ FSUBD(v1, v1, v2);
+ }
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xF0:
+ case 0xF1:
+ case 0xF2:
+ case 0xF3:
+ case 0xF4:
+ case 0xF5:
+ case 0xF6:
+ case 0xF7:
+ INST_NAME("FDIVRP STx, ST0");
+ v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ if(ST_IS_F(0)) {
+ FDIVS(v1, v2, v1);
+ } else {
+ FDIVD(v1, v2, v1);
+ }
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xF8:
+ case 0xF9:
+ case 0xFA:
+ case 0xFB:
+ case 0xFC:
+ case 0xFD:
+ case 0xFE:
+ case 0xFF:
+ INST_NAME("FDIVP STx, ST0");
+ v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ if(ST_IS_F(0)) {
+ FDIVS(v1, v1, v2);
+ } else {
+ FDIVD(v1, v1, v2);
+ }
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xD8:
+ case 0xDA:
+ case 0xDB:
+ case 0xDC:
+ case 0xDD:
+ case 0xDE:
+ case 0xDF:
+ return 0;
+ default:
+ switch((nextop>>3)&7) {
+ default:
+ DEFAULT;
+ }
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_df.c b/src/dynarec/rv64/dynarec_rv64_df.c
new file mode 100644
index 0000000..de99b02
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_df.c
@@ -0,0 +1,244 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "emu/x87emu_private.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+uintptr_t dynarec64_DF(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ (void)ip; (void)rep; (void)need_epilog;
+
+ uint8_t nextop = F8;
+ uint8_t ed, wback, u8;
+ int v1, v2;
+ int s0;
+ int64_t j64;
+ int64_t fixedaddress;
+
+ MAYUSE(s0);
+ MAYUSE(v2);
+ MAYUSE(v1);
+ MAYUSE(j64);
+
+ switch(nextop) {
+ case 0xC0 ... 0xC7:
+ INST_NAME("FFREEP STx");
+ DEFAULT;
+ break;
+
+ case 0xE0:
+ INST_NAME("FNSTSW AX");
+ LHU(x2, xEmu, offsetof(x64emu_t, top));
+ LHU(x1, xEmu, offsetof(x64emu_t, sw));
+ MOV32w(x3, 0b1100011111111111); // mask
+ AND(x1, x1, x3);
+ SLLI(x2, x2, 11);
+ OR(x1, x1, x2); // inject top
+ SH(x1, xEmu, offsetof(x64emu_t, sw));
+ SRLI(xRAX, xRAX, 16);
+ SLLI(xRAX, xRAX, 16);
+ OR(xRAX, xRAX, x1);
+ break;
+ case 0xE8 ... 0xF7:
+ if (nextop < 0xF0) {
+ INST_NAME("FUCOMIP ST0, STx");
+ } else {
+ INST_NAME("FCOMIP ST0, STx");
+ }
+ SETFLAGS(X_ALL, SF_SET);
+ SET_DFNONE();
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7));
+ v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7));
+ CLEAR_FLAGS();
+ IFX(F_ZF | F_PF | F_CF) {
+ if(ST_IS_F(0)) {
+ FEQS(x5, v1, v1);
+ FEQS(x4, v2, v2);
+ AND(x5, x5, x4);
+ BEQZ(x5, 24); // undefined/NaN
+ FEQS(x5, v1, v2);
+ BNEZ(x5, 24); // equal
+ FLTS(x3, v1, v2); // x3 = (v1<v2)?1:0
+ OR(xFlags, xFlags, x3); // CF is the least significant bit
+ J(16); // end
+ // NaN
+ ORI(xFlags, xFlags, (1<<F_ZF) | (1<<F_PF) | (1<<F_CF));
+ J(8); // end
+ // equal
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ // end
+ } else {
+ FEQD(x5, v1, v1);
+ FEQD(x4, v2, v2);
+ AND(x5, x5, x4);
+ BEQZ(x5, 24); // undefined/NaN
+ FEQD(x5, v1, v2);
+ BNEZ(x5, 24); // equal
+ FLTD(x3, v1, v2); // x3 = (v1<v2)?1:0
+ OR(xFlags, xFlags, x3); // CF is the least significant bit
+ J(16); // end
+ // NaN
+ ORI(xFlags, xFlags, (1<<F_ZF) | (1<<F_PF) | (1<<F_CF));
+ J(8); // end
+ // equal
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ // end
+ }
+ }
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 0xC8 ... 0xDF:
+ case 0xE1 ... 0xE7:
+ case 0xF8 ... 0xFF:
+ DEFAULT;
+ break;
+
+ default:
+ switch((nextop>>3)&7) {
+ case 0:
+ INST_NAME("FILD ST0, Ew");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_F);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0);
+ LH(x1, wback, fixedaddress);
+ if(ST_IS_F(0)) {
+ FCVTSL(v1, x1, RD_RNE);
+ } else {
+ FCVTDL(v1, x1, RD_RNE);
+ }
+ break;
+ case 1:
+ INST_NAME("FISTTP Ew, ST0");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0);
+ if(!box64_dynarec_fastround) {
+ FSFLAGSI(0); // reset all bits
+ }
+ FCVTWD(x4, v1, RD_RTZ);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, 1<<FR_NV);
+ BNEZ_MARK(x5);
+ SLLIW(x5, x4, 16);
+ SRAIW(x5, x5, 16);
+ BEQ_MARK2(x5, x4);
+ MARK;
+ MOV32w(x4, 0x8000);
+ }
+ MARK2;
+ SH(x4, wback, fixedaddress);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 3:
+ INST_NAME("FISTP Ew, ST0");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F);
+ u8 = x87_setround(dyn, ninst, x1, x2);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0);
+ if(!box64_dynarec_fastround) {
+ FSFLAGSI(0); // reset all bits
+ }
+ FCVTWD(x4, v1, RD_DYN);
+ x87_restoreround(dyn, ninst, u8);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, 1<<FR_NV);
+ BNEZ_MARK(x5);
+ SLLIW(x5, x4, 16);
+ SRAIW(x5, x5, 16);
+ BEQ_MARK2(x5, x4);
+ MARK;
+ MOV32w(x4, 0x8000);
+ }
+ MARK2;
+ SH(x4, wback, fixedaddress);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ case 5:
+ INST_NAME("FILD ST0, i64");
+ v1 = x87_do_push(dyn, ninst, x1, EXT_CACHE_ST_D);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0);
+ LD(x1, wback, fixedaddress);
+ if (rex.is32bits) {
+ // need to also feed the STll stuff...
+ ADDI(x4, xEmu, offsetof(x64emu_t, fpu_ll));
+ LWU(x5, xEmu, offsetof(x64emu_t, top));
+ int a = 0 - dyn->e.x87stack;
+ if(a) {
+ ADDIW(x5, x5, a);
+ ANDI(x5, x5, 0x7);
+ }
+ SLLI(x5, x5, 4); // fpu_ll is 2 i64
+ ADD(x5, x5, x4);
+ SD(x1, x5, 8); // ll
+ }
+ FCVTDL(v1, x1, RD_RTZ);
+ if(rex.is32bits) {
+ FSD(v1, x5, 0); // ref
+ }
+ break;
+ case 7:
+ INST_NAME("FISTP i64, ST0");
+ v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D);
+ u8 = x87_setround(dyn, ninst, x1, x2);
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0);
+
+ if(rex.is32bits) {
+ // need to check STll first...
+ ADDI(x4, xEmu, offsetof(x64emu_t, fpu_ll));
+ LWU(x5, xEmu, offsetof(x64emu_t, top));
+ int a = 0 - dyn->e.x87stack;
+ if(a) {
+ ADDIW(x5, x5, a);
+ ANDI(x5, x5, 0x7);
+ }
+ SLLI(x5, x5, 4); // fpu_ll is 2 i64
+ ADD(x5, x5, x4);
+ FMVXD(x3, v1);
+ LD(x6, x5, 0); // ref
+ BNE_MARK(x6, x3);
+ LD(x6, x5, 8); // ll
+ SD(x6, wback, fixedaddress);
+ B_MARK3_nocond;
+ MARK;
+ }
+
+ if(!box64_dynarec_fastround) {
+ FSFLAGSI(0); // reset all bits
+ }
+ FCVTLD(x4, v1, RD_DYN);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, 1<<FR_NV);
+ BEQ_MARK2(x5, xZR);
+ MOV64x(x4, 0x8000000000000000LL);
+ }
+ MARK2;
+ SD(x4, wback, fixedaddress);
+ MARK3;
+ x87_restoreround(dyn, ninst, u8);
+ x87_do_pop(dyn, ninst, x3);
+ break;
+ default:
+ DEFAULT;
+ break;
+ }
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_emit_logic.c b/src/dynarec/rv64/dynarec_rv64_emit_logic.c
new file mode 100644
index 0000000..1352868
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_emit_logic.c
@@ -0,0 +1,478 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+// emit XOR8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed)
+void emit_xor8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s4, d_xor8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ XOR(s1, s1, s2);
+ ANDI(s1, s1, 0xff);
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit XOR8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch
+void emit_xor8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s4, d_xor8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ XORI(s1, s1, c&0xff);
+ ANDI(s1, s1, 0xff);
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit XOR32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_xor32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s4, rex.w?d_xor64:d_xor32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ XOR(s1, s1, s2);
+
+ // test sign bit before zeroup.
+ IFX(X_SF) {
+ if (!rex.w) SEXT_W(s1, s1);
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w && s1!=s2) {
+ ZEROUP(s1);
+ }
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit XOR32 instruction, from s1, c, store result in s1 using s3 and s4 as scratch
+void emit_xor32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s4, rex.w?d_xor64:d_xor32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ if(c>=-2048 && c<=2047) {
+ XORI(s1, s1, c);
+ } else {
+ MOV64xw(s3, c);
+ XOR(s1, s1, s3);
+ }
+
+ // test sign bit before zeroup.
+ IFX(X_SF) {
+ if (!rex.w) SEXT_W(s1, s1);
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit XOR16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed)
+void emit_xor16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s4, d_xor16);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ XOR(s1, s1, s2);
+ ZEXTH(s1, s1);
+
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_ZF | X_SF) {
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 15);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit OR16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed)
+void emit_or16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) {
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s3, d_or16);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ OR(s1, s1, s2);
+ ZEXTH(s1, s1);
+ IFX(X_PEND) {
+ SD(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ IFX(X_SF) {
+ SRLI(s3, s1, 15);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit OR32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_or32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s4, rex.w?d_or64:d_or32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ OR(s1, s1, s2);
+
+ // test sign bit before zeroup.
+ IFX(X_SF) {
+ if (!rex.w) SEXT_W(s1, s1);
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+// emit OR32 instruction, from s1, c, store result in s1 using s3 and s4 as scratch
+void emit_or32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s4, rex.w?d_or64:d_or32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ if(c>=-2048 && c<=2047) {
+ ORI(s1, s1, c);
+ } else {
+ MOV64xw(s3, c);
+ OR(s1, s1, s3);
+ }
+
+ // test sign bit before zeroup.
+ IFX(X_SF) {
+ if (!rex.w) SEXT_W(s1, s1);
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+
+// emit AND8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed)
+void emit_and8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4)
+{
+
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s3, d_and8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ AND(s1, s1, s2);
+
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+
+// emit AND8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch
+void emit_and8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s3, d_and8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ ANDI(s1, s1, c&0xff);
+
+ IFX(X_PEND) {
+ SD(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+void emit_and16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) {
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s3, d_tst16);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ AND(s1, s1, s2); // res = s1 & s2
+
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 15);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit AND32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_and32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s3, rex.w?d_tst64:d_tst32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ AND(s1, s1, s2); // res = s1 & s2
+ if (!rex.w) ZEROUP(s1);
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, rex.w?63:31);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit AND32 instruction, from s1, c, store result in s1 using s3 and s4 as scratch
+void emit_and32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s3, rex.w?d_tst64:d_tst32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ if(c>=-2048 && c<=2047) {
+ ANDI(s1, s1, c);
+ } else {
+ MOV64xw(s3, c);
+ AND(s1, s1, s3); // res = s1 & s2
+ }
+ if (!rex.w && c<0 && c>=-2048) ZEROUP(s1);
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, rex.w?63:31);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit OR8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed)
+void emit_or8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SET_DF(s3, d_or8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ OR(s1, s1, s2);
+
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit OR8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch
+void emit_or8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4)
+{
+ MOV32w(s2, c&0xff);
+ emit_or8(dyn, ninst, s1, s2, s3, s4);
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_emit_math.c b/src/dynarec/rv64/dynarec_rv64_emit_math.c
new file mode 100644
index 0000000..5d6f7e0
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_emit_math.c
@@ -0,0 +1,1441 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+// emit ADD32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_add32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, rex.w?d_add64:d_add32b);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_CF) {
+ if (rex.w) {
+ AND(s5, xMASK, s1);
+ if(rv64_zba) ADDUW(s5, s2, s5); else {AND(s4, xMASK, s2); ADD(s5, s5, s4);} // lo
+ SRLI(s3, s1, 0x20);
+ SRLI(s4, s2, 0x20);
+ ADD(s4, s4, s3);
+ SRLI(s5, s5, 0x20);
+ ADD(s5, s5, s4); // hi
+ SRAI(s5, s5, 0x20);
+ BEQZ(s5, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ } else {
+ ADD(s5, s1, s2);
+ SRLI(s5, s5, 0x20);
+ BEQZ(s5, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+ }
+ IFX(X_AF | X_OF) {
+ OR(s3, s1, s2); // s3 = op1 | op2
+ AND(s4, s1, s2); // s4 = op1 & op2
+ }
+
+ ADDxw(s1, s1, s2);
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s3); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s5, s1); // s5 = ~res
+ AND(s3, s5, s3); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s4, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, rex.w?62:30);
+ SRLI(s4, s3, 1);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
+
+// emit ADD32 instruction, from s1, constant c, store result in s1 using s3 and s4 as scratch
+void emit_add32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ if(s1==xRSP && (!dyn->insts || dyn->insts[ninst].x64.gen_flags==X_PEND))
+ {
+ // special case when doing math on ESP and only PEND is needed: ignoring it!
+ if(c >= -2048 && c < 2048) {
+ ADDIxw(s1, s1, c);
+ } else {
+ MOV64xw(s2, c);
+ ADDxw(s1, s1, s2);
+ }
+ return;
+ }
+ IFX(X_PEND | X_AF | X_CF | X_OF) {
+ MOV64xw(s2, c);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, rex.w?d_add64:d_add32b);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_CF) {
+ if (rex.w) {
+ AND(s5, xMASK, s1);
+ if(rv64_zba) ADDUW(s5, s2, s5); else {AND(s4, xMASK, s2); ADD(s5, s5, s4);} // lo
+ SRLI(s3, s1, 0x20);
+ SRLI(s4, s2, 0x20);
+ ADD(s4, s4, s3);
+ SRLI(s5, s5, 0x20);
+ ADD(s5, s5, s4); // hi
+ SRAI(s5, s5, 0x20);
+ BEQZ(s5, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ } else {
+ ADD(s5, s1, s2);
+ SRLI(s5, s5, 0x20);
+ BEQZ(s5, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+ }
+ IFX(X_AF | X_OF) {
+ OR(s3, s1, s2); // s3 = op1 | op2
+ AND(s4, s1, s2); // s4 = op1 & op2
+ }
+
+ if(c >= -2048 && c < 2048) {
+ ADDIxw(s1, s1, c);
+ } else {
+ IFX(X_PEND | X_AF | X_CF | X_OF) {} else {MOV64xw(s2, c);}
+ ADDxw(s1, s1, s2);
+ }
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s3); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s2, s1); // s2 = ~res
+ AND(s3, s2, s3); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s4, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, rex.w?62:30);
+ SRLI(s4, s3, 1);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
+
+// emit ADD16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_add16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, op1));
+ SH(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, d_add16);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ OR(s3, s1, s2); // s3 = op1 | op2
+ AND(s4, s1, s2); // s4 = op1 & op2
+ }
+ ADD(s1, s1, s2);
+
+ IFX(X_PEND) {
+ SW(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s3); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s5, s1); // s5 = ~res
+ AND(s3, s5, s3); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s4, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, 14);
+ SRLI(s4, s3, 1);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+
+ IFX(X_CF) {
+ SRLI(s3, s1, 16);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+
+ ZEXTH(s1, s1);
+
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 15);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit ADD8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_add8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, op1));
+ SB(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, d_add8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ OR(s3, s1, s2); // s3 = op1 | op2
+ AND(s4, s1, s2); // s4 = op1 & op2
+ }
+ ADD(s1, s1, s2);
+
+ IFX(X_AF|X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s3); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s4, s1); // s4 = ~res
+ AND(s3, s4, s3); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s2); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s4, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, 6);
+ SRLI(s4, s3, 1);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_CF) {
+ SRLI(s3, s1, 8);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ ANDI(s1, s1, 0xff);
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit ADD8 instruction, from s1, const c, store result in s1 using s3 and s4 as scratch
+void emit_add8c(dynarec_rv64_t* dyn, int ninst, int s1, int c, int s2, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ MOV32w(s4, c&0xff);
+ SB(s1, xEmu, offsetof(x64emu_t, op1));
+ SB(s4, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, d_add8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ if(X_PEND) {} else {MOV32w(s4, c&0xff);}
+ OR(s3, s1, s4); // s3 = op1 | op2
+ AND(s4, s1, s4); // s4 = op1 & op2
+ }
+ ADDI(s1, s1, c);
+
+ IFX(X_AF|X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s3); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s2, s1); // s2 = ~res
+ AND(s3, s2, s3); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s4, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, 6);
+ SRLI(s4, s3, 1);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_CF) {
+ SRLI(s3, s1, 8);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ ANDI(s1, s1, 0xff);
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit SUB8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_sub8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, op1));
+ SB(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, d_sub8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ // for later flag calculation
+ NOT(s5, s1);
+ }
+
+ SUB(s1, s1, s2);
+ ANDI(s1, s1, 0xff);
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ CALC_SUB_FLAGS(s5, s2, s1, s3, s4, 8);
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit SUB8 instruction, from s1, constant c, store result in s1 using s3 and s4 as scratch
+void emit_sub8c(dynarec_rv64_t* dyn, int ninst, int s1, int c, int s2, int s3, int s4, int s5)
+{
+ MOV32w(s2, c&0xff);
+ emit_sub8(dyn, ninst, s1, s2, s3, s4, s5);
+}
+
+// emit SUB16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_sub16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, op1));
+ SH(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, d_sub16);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ // for later flag calculation
+ NOT(s5, s1);
+ }
+
+ SUBW(s1, s1, s2);
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ SLLI(s1, s1, 48);
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ SRLI(s1, s1, 48);
+
+ CALC_SUB_FLAGS(s5, s2, s1, s3, s4, 16);
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+
+// emit SUB32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_sub32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, rex.w?d_sub64:d_sub32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ // for later flag calculation
+ NOT(s5, s1);
+ }
+
+ SUBxw(s1, s1, s2);
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w?64:32);
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+
+// emit SUB32 instruction, from s1, constant c, store result in s1 using s2, s3, s4 and s5 as scratch
+void emit_sub32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ if(s1==xRSP && (!dyn->insts || dyn->insts[ninst].x64.gen_flags==X_PEND))
+ {
+ // special case when doing math on RSP and only PEND is needed: ignoring it!
+ if (c > -2048 && c <= 2048) {
+ SUBI(s1, s1, c);
+ } else {
+ MOV64xw(s2, c);
+ SUBxw(s1, s1, s2);
+ }
+ return;
+ }
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ MOV64xw(s2, c);
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, rex.w?d_sub64:d_sub32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ // for later flag calculation
+ NOT(s5, s1);
+ }
+
+ if (c > -2048 && c <= 2048) {
+ ADDIxw(s1, s1, -c);
+ } else {
+ IFX(X_PEND) {} else {MOV64xw(s2, c);}
+ SUBxw(s1, s1, s2);
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ IFX(X_PEND) {}
+ else if (c > -2048 && c <= 2048) {
+ MOV64xw(s2, c);
+ }
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w?64:32);
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit INC8 instruction, from s1, store result in s1 using s2, s3 and s4 as scratch
+void emit_inc8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4)
+{
+ IFX(X_ALL) {
+ ANDI(xFlags, xFlags, ~((1UL<<F_AF) | (1UL<<F_OF2) | (1UL<<F_ZF) | (1UL<<F_SF) | (1UL<<F_PF)));
+ }
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s3, d_inc8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ ORI(s3, s1, 1); // s3 = op1 | op2
+ ANDI(s4, s1, 1); // s5 = op1 & op2
+ }
+
+ ADDIW(s1, s1, 1);
+
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s3); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s2, s1); // s2 = ~res
+ AND(s3, s2, s3); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s2, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, 6);
+ SRLI(s2, s3, 1);
+ XOR(s3, s3, s2);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ ANDI(s1, s1, 0xff);
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s2);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
+
+
+// emit DEC8 instruction, from s1, store result in s1 using s2, s3 and s4 as scratch
+void emit_dec8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4)
+{
+ IFX(X_ALL) {
+ ANDI(xFlags, xFlags, ~((1UL<<F_AF) | (1UL<<F_OF2) | (1UL<<F_ZF) | (1UL<<F_SF) | (1UL<<F_PF)));
+ }
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s3, d_dec8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ NOT(s4, s1); // s4 = ~op1
+ ORI(s3, s4, 1); // s3 = ~op1 | op2
+ ANDI(s4, s4, 1); // s4 = ~op1 & op2
+ }
+
+ ADDIW(s1, s1, -1);
+
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ AND(s3, s1, s3); // s3 = res & (~op1 | op2)
+ OR(s3, s3, s4); // cc = (res & (~op1 | op2)) | (~op1 & op2)
+ IFX(X_AF) {
+ ANDI(s2, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, 6);
+ SRLI(s2, s3, 1);
+ XOR(s3, s3, s2);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ ANDI(s1, s1, 0xff);
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s2);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
+
+// emit INC32 instruction, from s1, store result in s1 using s3 and s4 as scratch
+void emit_inc32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5)
+{
+ IFX(X_ALL) {
+ ANDI(xFlags, xFlags, ~((1UL<<F_AF) | (1UL<<F_OF2) | (1UL<<F_ZF) | (1UL<<F_SF) | (1UL<<F_PF)));
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s3, rex.w?d_inc64:d_inc32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ ORI(s3, s1, 1); // s3 = op1 | op2
+ ANDI(s5, s1, 1); // s5 = op1 & op2
+ }
+
+ ADDIxw(s1, s1, 1);
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s3); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s2, s1); // s2 = ~res
+ AND(s3, s2, s3); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s2, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, rex.w?62:30);
+ SRLI(s2, s3, 1);
+ XOR(s3, s3, s2);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s2);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
+
+// emit DEC32 instruction, from s1, store result in s1 using s3 and s4 as scratch
+void emit_dec32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5)
+{
+ IFX(X_ALL) {
+ ANDI(xFlags, xFlags, ~((1UL<<F_AF) | (1UL<<F_OF2) | (1UL<<F_ZF) | (1UL<<F_SF) | (1UL<<F_PF)));
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s3, rex.w?d_dec64:d_dec32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ NOT(s5, s1);
+ ORI(s3, s5, 1); // s3 = ~op1 | op2
+ ANDI(s5, s5, 1); // s5 = ~op1 & op2
+ }
+
+ ADDIxw(s1, s1, -1);
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ AND(s3, s1, s3); // s3 = res & (~op1 | op2)
+ OR(s3, s3, s5); // cc = (res & (~op1 | op2)) | (~op1 & op2)
+ IFX(X_AF) {
+ ANDI(s2, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, rex.w?62:30);
+ SRLI(s2, s3, 1);
+ XOR(s3, s3, s2);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s2);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
+
+// emit INC16 instruction, from s1, store result in s1 using s3 and s4 as scratch
+void emit_inc16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4)
+{
+ IFX(X_ALL) {
+ ANDI(xFlags, xFlags, ~((1UL<<F_AF) | (1UL<<F_OF2) | (1UL<<F_ZF) | (1UL<<F_SF) | (1UL<<F_PF)));
+ }
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s3, d_inc16);
+ } else IFX(X_ZF|X_OF|X_AF|X_SF|X_PF) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ ORI(s3, s1, 1); // s3 = op1 | op2
+ ANDI(s4, s1, 1); // s4 = op1 & op2
+ }
+
+ ADDI(s1, s1, 1);
+
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s3); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s2, s1); // s2 = ~res
+ AND(s3, s2, s3); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s4, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, 14);
+ SRLI(s4, s3, 1);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+
+ ZEXTH(s1, s1);
+
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 15);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit DEC16 instruction, from s1, store result in s1 using s3 and s4 as scratch
+void emit_dec16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
+{
+ IFX(X_ALL) {
+ ANDI(xFlags, xFlags, ~((1UL<<F_AF) | (1UL<<F_OF2) | (1UL<<F_ZF) | (1UL<<F_SF) | (1UL<<F_PF)));
+ }
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s3, d_dec16);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ NOT(s5, s1);
+ ORI(s3, s5, 1); // s3 = ~op1 | op2
+ ANDI(s5, s5, 1); // s5 = ~op1 & op2
+ }
+
+ ADDIW(s1, s1, -1);
+
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ AND(s3, s1, s3); // s3 = res & (~op1 | op2)
+ OR(s3, s3, s5); // cc = (res & (~op1 | op2)) | (~op1 & op2)
+ IFX(X_AF) {
+ ANDI(s2, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, 14);
+ SRLI(s2, s3, 1);
+ XOR(s3, s3, s2);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ SLLIW(s1, s1, 16);
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ SRLIW(s1, s1, 16);
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s2);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
+
+// emit SBB8 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch
+void emit_sbb8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
+{
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, op1));
+ SB(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, d_sbb8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ // for later flag calculation
+ NOT(s5, s1);
+ }
+
+ SUBW(s1, s1, s2);
+ ANDI(s3, xFlags, 1 << F_CF);
+ SUBW(s1, s1, s3);
+ ANDI(s1, s1, 0xff);
+
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ CALC_SUB_FLAGS(s5, s2, s1, s3, s4, 8);
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit ADC8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_adc8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) {
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, op1));
+ SH(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, d_adc8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ OR(s4, s1, s2); // s3 = op1 | op2
+ AND(s5, s1, s2); // s4 = op1 & op2
+ }
+
+ ADD(s1, s1, s2);
+ ANDI(s3, xFlags, 1 << F_CF);
+ ADD(s1, s1, s3);
+
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SW(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s4); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s2, s1); // s2 = ~res
+ AND(s3, s2, s4); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s4, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, 6);
+ SRLI(s4, s3, 1);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_CF) {
+ SRLI(s3, s1, 8);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+
+ ANDI(s1, s1, 0xff);
+
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit ADC8 instruction, from s1, const c, store result in s1 using s3, s4, s5 and s6 as scratch
+void emit_adc8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5, int s6) {
+ MOV32w(s5, c&0xff);
+ emit_adc8(dyn, ninst, s1, s5, s3, s4, s6);
+}
+
+// emit SBB8 instruction, from s1, constant c, store result in s1 using s3, s4, s5 and s6 as scratch
+void emit_sbb8c(dynarec_rv64_t* dyn, int ninst, int s1, int c, int s3, int s4, int s5, int s6)
+{
+ MOV32w(s6, c&0xff);
+ emit_sbb8(dyn, ninst, s1, s6, s3, s4, s5);
+}
+
+// emit SBB16 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch
+void emit_sbb16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
+{
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, op1));
+ SH(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, d_sbb16);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ // for later flag calculation
+ NOT(s5, s1);
+ }
+
+ SUBW(s1, s1, s2);
+ ANDI(s3, xFlags, 1 << F_CF);
+ SUBW(s1, s1, s3);
+
+ CLEAR_FLAGS();
+ SLLIW(s1, s1, 16);
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ SRLIW(s1, s1, 16);
+
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ CALC_SUB_FLAGS(s5, s2, s1, s3, s4, 16);
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit SBB32 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch
+void emit_sbb32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5)
+{
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, rex.w?d_sbb64:d_sbb32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ // for later flag calculation
+ NOT(s5, s1);
+ }
+
+ SUBxw(s1, s1, s2);
+ ANDI(s3, xFlags, 1 << F_CF);
+ SUBxw(s1, s1, s3);
+
+ CLEAR_FLAGS();
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w?64:32);
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit NEG32 instruction, from s1, store result in s1 using s2 and s3 as scratch
+void emit_neg32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s3, rex.w?d_neg64:d_neg32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ MV(s3, s1); // s3 = op1
+ }
+
+ NEGxw(s1, s1);
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ IFX(X_CF) {
+ BEQZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+
+ IFX(X_AF | X_OF) {
+ OR(s3, s1, s3); // s3 = res | op1
+ IFX(X_AF) {
+ /* af = bc & 0x8 */
+ ANDI(s2, s3, 8);
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ /* of = ((bc >> (width-2)) ^ (bc >> (width-1))) & 0x1; */
+ SRLI(s2, s3, (rex.w?64:32)-2);
+ SRLI(s3, s2, 1);
+ XOR(s2, s2, s3);
+ ANDI(s2, s2, 1);
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s2);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
+
+// emit NEG16 instruction, from s1, store result in s1 using s2 and s3 as scratch
+void emit_neg16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s3, d_neg16);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ MV(s3, s1); // s3 = op1
+ }
+
+ NEG(s1, s1);
+ ZEXTH(s1, s1);
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ IFX(X_CF) {
+ BEQZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+
+ IFX(X_AF | X_OF) {
+ OR(s3, s1, s3); // s3 = res | op1
+ IFX(X_AF) {
+ /* af = bc & 0x8 */
+ ANDI(s2, s3, 8);
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ /* of = ((bc >> (width-2)) ^ (bc >> (width-1))) & 0x1; */
+ SRLI(s2, s3, 14);
+ SRLI(s3, s2, 1);
+ XOR(s2, s2, s3);
+ ANDI(s2, s2, 1);
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 15-F_SF); // put sign bit in place
+ ANDI(s3, s3, 1 << F_SF); // 1<<F_SF is sign bit, so just mask
+ OR(xFlags, xFlags, s3);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s2);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
+
+// emit NEG8 instruction, from s1, store result in s1 using s2 and s3 as scratch
+void emit_neg8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s3, d_neg8);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ MV(s3, s1); // s3 = op1
+ }
+
+ NEG(s1, s1);
+ ANDI(s1, s1, 0xff);
+ IFX(X_PEND) {
+ SB(s1, xEmu, offsetof(x64emu_t, res));
+ }
+
+ IFX(X_CF) {
+ BEQZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+
+ IFX(X_AF | X_OF) {
+ OR(s3, s1, s3); // s3 = res | op1
+ IFX(X_AF) {
+ /* af = bc & 0x8 */
+ ANDI(s2, s3, 8);
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ /* of = ((bc >> (width-2)) ^ (bc >> (width-1))) & 0x1; */
+ SRLI(s2, s3, 6);
+ SRLI(s3, s2, 1);
+ XOR(s2, s2, s3);
+ ANDI(s2, s2, 1);
+ BEQZ(s2, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_SF) {
+ ANDI(s3, s1, 1 << F_SF); // 1<<F_SF is sign bit, so just mask
+ OR(xFlags, xFlags, s3);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s2);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
+
+// emit ADC16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_adc16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
+{
+ IFX(X_PEND) {
+ SH(s1, xEmu, offsetof(x64emu_t, op1));
+ SH(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, d_adc16);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_AF | X_OF) {
+ OR(s4, s1, s2); // s3 = op1 | op2
+ AND(s5, s1, s2); // s4 = op1 & op2
+ }
+
+ ADD(s1, s1, s2);
+ ANDI(s3, xFlags, 1 << F_CF);
+ ADD(s1, s1, s3);
+
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SW(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_AF | X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s4); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s2, s1); // s2 = ~res
+ AND(s3, s2, s4); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s4, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, 14);
+ SRLI(s4, s3, 1);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_CF) {
+ SRLI(s3, s1, 16);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+
+ ZEXTH(s1, s1);
+
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_SF) {
+ SRLI(s3, s1, 15);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit ADC32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_adc32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5, int s6)
+{
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s3, rex.w?d_adc64:d_adc32b);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ IFX(X_CF) {
+ if (rex.w) {
+ AND(s5, xMASK, s1);
+ if(rv64_zba) ADDUW(s5, s2, s5); else {AND(s4, xMASK, s2); ADD(s5, s5, s4);} // lo
+ SRLI(s3, s1, 0x20);
+ SRLI(s4, s2, 0x20);
+ ADD(s4, s4, s3);
+ SRLI(s5, s5, 0x20);
+ ADD(s5, s5, s4); // hi
+ SRAI(s6, s5, 0x20);
+ } else {
+ ADD(s5, s1, s2);
+ SRLI(s6, s5, 0x20);
+ }
+ }
+ IFX(X_AF | X_OF) {
+ OR(s4, s1, s2); // s3 = op1 | op2
+ AND(s5, s1, s2); // s4 = op1 & op2
+ }
+
+ ADDxw(s1, s1, s2);
+ ANDI(s3, xFlags, 1 << F_CF);
+ ADDxw(s1, s1, s3);
+
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_CF) {
+ BEQZ(s6, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+ IFX(X_AF | X_OF) {
+ if(rv64_zbb) {
+ ANDN(s3, s1, s4); // s3 = ~res & (op1 | op2)
+ } else {
+ NOT(s2, s1); // s2 = ~res
+ AND(s3, s2, s4); // s3 = ~res & (op1 | op2)
+ }
+ OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2)
+ IFX(X_AF) {
+ ANDI(s4, s3, 0x08); // AF: cc & 0x08
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_AF);
+ }
+ IFX(X_OF) {
+ SRLI(s3, s3, rex.w?62:30);
+ SRLI(s4, s3, 1);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1); // OF: xor of two MSB's of cc
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_emit_shift.c b/src/dynarec/rv64/dynarec_rv64_emit_shift.c
new file mode 100644
index 0000000..7030c67
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_emit_shift.c
@@ -0,0 +1,618 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+// emit SHL32 instruction, from s1 , shift s2, store result in s1 using s3, s4 and s5 as scratch
+void emit_shl32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5)
+{
+ // s2 is not 0 here and is 1..1f/3f
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s4, rex.w?d_shl64:d_shl32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ IFX(X_CF|X_OF) {
+ SUBI(s5, s2, rex.w?64:32);
+ NEG(s5, s5);
+ SRL(s3, s1, s5);
+ ANDI(s5, s3, 1); // F_CF
+ IFX(X_CF) {
+ OR(xFlags, xFlags, s5);
+ }
+ }
+
+ SLL(s1, s1, s2);
+
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_OF) {
+ SRLIxw(s3, s1, rex.w?63:31);
+ XOR(s3, s3, s5);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+// emit SHL32 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch
+void emit_shl32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ if (c) {
+ MOV64x(s3, c);
+ SDxw(s3, xEmu, offsetof(x64emu_t, op2));
+ } else SDxw(xZR, xEmu, offsetof(x64emu_t, op2));
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s4, rex.w?d_shl64:d_shl32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ if(!c) {
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ return;
+ }
+ IFX(X_CF|X_OF) {
+ if (c > 0) {
+ SRLI(s3, s1, (rex.w?64:32)-c);
+ ANDI(s5, s3, 1); // F_CF
+ IFX(X_CF) {
+ OR(xFlags, xFlags, s5);
+ }
+ } else {
+ IFX(X_OF) MOV64x(s5, 0);
+ }
+ }
+
+ SLLIxw(s1, s1, c);
+
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_OF) {
+ SRLIxw(s3, s1, rex.w?63:31);
+ XOR(s3, s3, s5);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit SHR32 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3 and s4 as scratch
+void emit_shr32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4)
+{
+ int64_t j64;
+
+ CLEAR_FLAGS();
+
+ IFX(X_PEND) {
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s4, rex.w?d_shr64:d_shr32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ IFX(X_CF) {
+ SUBI(s3, s2, 1);
+ SRA(s3, s1, s3);
+ ANDI(s3, s3, 1); // LSB
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+
+ SRL(s1, s1, s2);
+
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_OF) {
+ ADDI(s3, xZR, 1);
+ BEQ(s2, s3, 4+6*4);
+ SRLI(s3, s1, rex.w?62:30);
+ SRLI(s4, s1, rex.w?63:31);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit SHR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch
+void emit_shr32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4)
+{
+ CLEAR_FLAGS();
+
+ IFX(X_PEND) {
+ if (c) {
+ MOV64x(s3, c);
+ SDxw(s3, xEmu, offsetof(x64emu_t, op2));
+ } else SDxw(xZR, xEmu, offsetof(x64emu_t, op2));
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s4, rex.w?d_shr64:d_shr32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ if(!c) {
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ return;
+ }
+ IFX(X_CF) {
+ if (c > 1) {
+ SRAI(s3, s1, c-1);
+ ANDI(s3, s3, 1); // LSB
+ BEQZ(s3, 8);
+ } else {
+ // no need to shift
+ ANDI(s3, s1, 1);
+ BEQZ(s3, 8);
+ }
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+
+ SRLIxw(s1, s1, c);
+
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_OF) {
+ if(c==1) {
+ SRLI(s3, s1, rex.w?62:30);
+ SRLI(s4, s1, rex.w?63:31);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit SAR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch
+void emit_sar32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4)
+{
+ CLEAR_FLAGS();
+
+ IFX(X_PEND) {
+ if (c) {
+ MOV64x(s3, c);
+ SDxw(s3, xEmu, offsetof(x64emu_t, op2));
+ } else SDxw(xZR, xEmu, offsetof(x64emu_t, op2));
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s4, rex.w?d_sar64:d_sar32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ if(!c) {
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ return;
+ }
+ IFX(X_CF) {
+ if (c > 1) {
+ SRAI(s3, s1, c-1);
+ ANDI(s3, s3, 1); // LSB
+ BEQZ(s3, 8);
+ } else {
+ // no need to shift
+ ANDI(s3, s1, 1);
+ BEQZ(s3, 8);
+ }
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+
+ SRAIxw(s1, s1, c);
+
+ // SRAIW sign-extends, so test sign bit before clearing upper bits
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit ROL32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_rol32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4)
+{
+ int64_t j64;
+ IFX(X_CF | X_OF) {
+ ANDI(xFlags, xFlags, ~(1UL<<F_CF | 1UL<<F_OF2));
+ }
+
+ IFX(X_PEND) {
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s4, rex.w?d_rol64:d_rol32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ if(rex.w) {
+ ANDI(s4, s2, 0x3f);
+ } else {
+ ANDI(s4, s2, 0x1f);
+ }
+ if(rv64_zbb) {
+ ROLxw(s1, s1, s4);
+ } else {
+ SLLxw(s3, s1, s4);
+ NEG(s4, s4);
+ ADDI(s4, s4, rex.w?64:32);
+ SRLxw(s1, s1, s4);
+ OR(s1, s3, s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_CF) {
+ ANDI(s4, s1, 1<<F_CF);
+ OR(xFlags, xFlags, s4);
+ }
+ IFX(X_OF) {
+ ADDI(s3, xZR, 1);
+ BEQ_NEXT(s2, s3);
+ SRLIxw(s3, s1, rex.w?63:31);
+ XOR(s3, s3, s1);
+ ANDI(s3, s3, 1);
+ SLLI(s3, s3, F_OF2);
+ OR(xFlags, xFlags, s3);
+ }
+}
+
+// emit ROR32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch
+void emit_ror32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4)
+{
+ int64_t j64;
+ IFX(X_CF | X_OF) {
+ ANDI(xFlags, xFlags, ~(1UL<<F_CF | 1UL<<F_OF2));
+ }
+
+ IFX(X_PEND) {
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s4, rex.w?d_ror64:d_ror32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ if(rex.w) {
+ ANDI(s4, s2, 0x3f);
+ } else {
+ ANDI(s4, s2, 0x1f);
+ }
+ if(rv64_zbb) {
+ RORxw(s1, s1, s4);
+ } else {
+ SRLxw(s3, s1, s4);
+ NEG(s4, s4);
+ ADDI(s4, s4, rex.w?64:32);
+ SLLxw(s1, s1, s4);
+ OR(s1, s3, s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_CF) {
+ SRLI(s3, s1, rex.w?63:31);
+ AND(xFlags, xFlags, s3);
+ }
+ IFX(X_OF) {
+ ADDI(s3, xZR, 1);
+ BEQ_NEXT(s2, s3);
+ SRLIxw(s3, s1, rex.w?63:31);
+ XOR(s3, s3, s1);
+ ANDI(s3, s3, 1);
+ SLLI(s3, s3, F_OF2);
+ OR(xFlags, xFlags, s3);
+ }
+}
+
+// emit ROL32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch
+void emit_rol32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4)
+{
+ IFX(X_CF | X_OF) {
+ ANDI(xFlags, xFlags, ~(1UL<<F_CF | 1UL<<F_OF2));
+ }
+
+ IFX(X_PEND) {
+ MOV32w(s3, c);
+ SDxw(s3, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s4, rex.w?d_rol64:d_rol32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ if(!c) {
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ return;
+ }
+ if(rv64_zbb) {
+ RORIxw(s1, s1, (rex.w?64:32)-c);
+ } else {
+ SLLIxw(s3, s1, c);
+ SRLIxw(s1, s1, (rex.w?64:32)-c);
+ OR(s1, s3, s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_CF) {
+ ANDI(s4, s1, 1<<F_CF);
+ OR(xFlags, xFlags, s4);
+ }
+ IFX(X_OF) {
+ if(c==1) {
+ SRLIxw(s3, s1, rex.w?63:31);
+ XOR(s3, s3, s1);
+ ANDI(s3, s3, 1);
+ SLLI(s3, s3, F_OF2);
+ OR(xFlags, xFlags, s3);
+ }
+ }
+}
+
+// emit ROR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch
+void emit_ror32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4)
+{
+ IFX(X_CF | X_OF) {
+ ANDI(xFlags, xFlags, ~(1UL<<F_CF | 1UL<<F_OF2));
+ }
+
+ IFX(X_PEND) {
+ MOV32w(s3, c);
+ SDxw(s3, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s4, rex.w?d_ror64:d_ror32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ if(!c) {
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ return;
+ }
+ if(rv64_zbb) {
+ RORIxw(s1, s1, c);
+ } else {
+ SRLIxw(s3, s1, c);
+ SLLIxw(s1, s1, (rex.w?64:32)-c);
+ OR(s1, s3, s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_CF) {
+ SRLI(s3, s1, rex.w?63:31);
+ AND(xFlags, xFlags, s3);
+ }
+ IFX(X_OF) {
+ if(c==1) {
+ SRLI(s3, s1, rex.w?62:30);
+ SRLI(s4, s3, 1);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1);
+ SLLI(s3, s3, F_OF2);
+ OR(xFlags, xFlags, s3);
+ }
+ }
+}
+
+// emit SHRD32 instruction, from s1, fill s2 , constant c, store result in s1 using s3 and s4 as scratch
+void emit_shrd32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4)
+{
+ CLEAR_FLAGS();
+
+ IFX(X_PEND) {
+ if (c) {
+ MOV64x(s3, c);
+ SDxw(s3, xEmu, offsetof(x64emu_t, op2));
+ } else SDxw(xZR, xEmu, offsetof(x64emu_t, op2));
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s4, rex.w?d_shr64:d_shr32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+ if(!c) {
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ return;
+ }
+ IFX(X_CF) {
+ if (c > 1) {
+ SRAI(s3, s1, c-1);
+ ANDI(s3, s3, 1); // LSB
+ BEQZ(s3, 8);
+ } else {
+ // no need to shift
+ ANDI(s3, s1, 1);
+ BEQZ(s3, 8);
+ }
+ ORI(xFlags, xFlags, 1 << F_CF);
+ }
+
+ SRLIxw(s3, s1, c);
+ SLLIxw(s1, s2, (rex.w?64:32)-c);
+ OR(s1, s1, s3);
+
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_OF) {
+ if(c==1) {
+ SRLI(s3, s1, rex.w?62:30);
+ SRLI(s4, s1, rex.w?63:31);
+ XOR(s3, s3, s4);
+ ANDI(s3, s3, 1);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+void emit_shld32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5) {
+ CLEAR_FLAGS();
+ IFX(X_PEND) {
+ if (c) {
+ MOV64x(s3, c);
+ SDxw(s3, xEmu, offsetof(x64emu_t, op2));
+ } else SDxw(xZR, xEmu, offsetof(x64emu_t, op2));
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SET_DF(s4, rex.w?d_shl64:d_shl32);
+ } else IFX(X_ALL) {
+ SET_DFNONE();
+ }
+
+ if(!c) {
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ return;
+ }
+ IFX(X_CF|X_OF) {
+ if (c > 0) {
+ SRLI(s3, s1, (rex.w?64:32)-c);
+ ANDI(s5, s3, 1); // F_CF
+ IFX(X_CF) {
+ OR(xFlags, xFlags, s5);
+ }
+ } else {
+ IFX(X_OF) MOV64x(s5, 0);
+ }
+ }
+
+ SLLIxw(s3, s1, c);
+ SRLIxw(s1, s2, (rex.w?64:32)-c);
+ OR(s1, s1, s3);
+
+ IFX(X_SF) {
+ BGE(s1, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s1);
+ }
+ IFX(X_PEND) {
+ SDxw(s1, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_OF) {
+ SRLIxw(s3, s1, rex.w?63:31);
+ XOR(s3, s3, s5);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_OF2);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_emit_tests.c b/src/dynarec/rv64/dynarec_rv64_emit_tests.c
new file mode 100644
index 0000000..00c1fb7
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_emit_tests.c
@@ -0,0 +1,349 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+// emit CMP8 instruction, from cmp s1, s2, using s3, s4, s5 and s6 as scratch
+void emit_cmp8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6)
+{
+ CLEAR_FLAGS();
+ IFX_PENDOR0 {
+ SB(s1, xEmu, offsetof(x64emu_t, op1));
+ SB(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s4, d_cmp8);
+ } else {
+ SET_DFNONE();
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ // for later flag calculation
+ NOT(s5, s1);
+ }
+
+ // It's a cmp, we can't store the result back to s1.
+ SUB(s6, s1, s2);
+ ANDI(s6, s6, 0xff);
+ IFX_PENDOR0 {
+ SB(s6, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s3, s6, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ CALC_SUB_FLAGS(s5, s2, s6, s3, s4, 8);
+ IFX(X_ZF) {
+ BNEZ(s6, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s6, s3, s4);
+ }
+}
+
+// emit CMP8 instruction, from cmp s1 , 0, using s3 and s4 as scratch
+void emit_cmp8_0(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX_PENDOR0 {
+ SB(s1, xEmu, offsetof(x64emu_t, op1));
+ SB(xZR, xEmu, offsetof(x64emu_t, op2));
+ SB(s1, xEmu, offsetof(x64emu_t, res));
+ SET_DF(s3, d_cmp8);
+ } else {
+ SET_DFNONE();
+ }
+
+ IFX(X_SF) {
+ SRLI(s3, s1, 7);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit CMP16 instruction, from cmp s1, s2, using s3 and s4 as scratch
+void emit_cmp16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6)
+{
+ CLEAR_FLAGS();
+ IFX_PENDOR0 {
+ SH(s1, xEmu, offsetof(x64emu_t, op1));
+ SH(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s4, d_cmp16);
+ } else {
+ SET_DFNONE();
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ // for later flag calculation
+ NOT(s5, s1);
+ }
+
+ // It's a cmp, we can't store the result back to s1.
+ SUB(s6, s1, s2);
+ IFX(X_ALL) {
+ ZEXTH(s6, s6);
+ }
+ IFX_PENDOR0 {
+ SH(s6, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s3, s6, 15);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ CALC_SUB_FLAGS(s5, s2, s6, s3, s4, 16);
+ IFX(X_ZF) {
+ BNEZ(s6, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s6, s3, s4);
+ }
+}
+
+// emit CMP16 instruction, from cmp s1 , #0, using s3 and s4 as scratch
+void emit_cmp16_0(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX_PENDOR0 {
+ SH(s1, xEmu, offsetof(x64emu_t, op1));
+ SH(xZR, xEmu, offsetof(x64emu_t, op2));
+ SH(s1, xEmu, offsetof(x64emu_t, res));
+ SET_DF(s3, d_cmp16);
+ } else {
+ SET_DFNONE();
+ }
+
+ IFX(X_SF) {
+ SRLI(s3, s1, 15);
+ BEQZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit CMP32 instruction, from cmp s1, s2, using s3 and s4 as scratch
+void emit_cmp32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5, int s6)
+{
+ CLEAR_FLAGS();
+ IFX_PENDOR0 {
+ SDxw(s1, xEmu, offsetof(x64emu_t, op1));
+ SDxw(s2, xEmu, offsetof(x64emu_t, op2));
+ SET_DF(s4, rex.w?d_cmp64:d_cmp32);
+ } else {
+ SET_DFNONE();
+ }
+
+ IFX(X_AF | X_CF | X_OF) {
+ // for later flag calculation
+ NOT(s5, s1);
+ }
+
+ // It's a cmp, we can't store the result back to s1.
+ SUBxw(s6, s1, s2);
+ IFX_PENDOR0 {
+ SDxw(s6, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ BGE(s6, xZR, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ if (!rex.w) {
+ ZEROUP(s6);
+ }
+ CALC_SUB_FLAGS(s5, s2, s6, s3, s4, rex.w?64:32);
+ IFX(X_ZF) {
+ BNEZ(s6, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s6, s3, s4);
+ }
+}
+
+// emit CMP32 instruction, from cmp s1, 0, using s3 and s4 as scratch
+void emit_cmp32_0(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4)
+{
+ CLEAR_FLAGS();
+ IFX_PENDOR0 {
+ SD(s1, xEmu, offsetof(x64emu_t, op1));
+ SD(xZR, xEmu, offsetof(x64emu_t, op2));
+ SD(s1, xEmu, offsetof(x64emu_t, res));
+ SET_DF(s4, rex.w?d_cmp64:d_cmp32);
+ } else {
+ SET_DFNONE();
+ }
+ IFX(X_SF) {
+ if (rex.w) {
+ BGE(s1, xZR, 8);
+ } else {
+ SRLI(s3, s1, 31);
+ BEQZ(s3, 8);
+ }
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s1, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s1, s3, s4);
+ }
+}
+
+// emit TEST8 instruction, from test s1, s2, using s3, s4 and s5 as scratch
+void emit_test8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) {
+ CLEAR_FLAGS();
+ IFX_PENDOR0 {
+ SET_DF(s3, d_tst8);
+ } else {
+ SET_DFNONE();
+ }
+
+ AND(s3, s1, s2); // res = s1 & s2
+
+ IFX_PENDOR0 {
+ SD(s3, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s4, s3, 7);
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s3, s4, s5);
+ }
+}
+
+// emit TEST16 instruction, from test s1, s2, using s3, s4 and s5 as scratch
+void emit_test16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ IFX_PENDOR0 {
+ SET_DF(s3, d_tst16);
+ } else {
+ SET_DFNONE();
+ }
+
+ AND(s3, s1, s2); // res = s1 & s2
+
+ IFX_PENDOR0 {
+ SH(s3, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s4, s3, 15);
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s3, s4, s5);
+ }
+}
+
+// emit TEST32 instruction, from test s1, s2, using s3 and s4 as scratch
+void emit_test32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ IFX_PENDOR0 {
+ SET_DF(s3, rex.w?d_tst64:d_tst32);
+ } else {
+ SET_DFNONE();
+ }
+
+ AND(s3, s1, s2); // res = s1 & s2
+
+ IFX_PENDOR0 {
+ SDxw(s3, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF|X_ZF) {
+ if (!rex.w) ZEROUP(s3);
+ }
+ IFX(X_SF) {
+ SRLI(s4, s3, rex.w?63:31);
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s3, s4, s5);
+ }
+}
+
+// emit TEST32 instruction, from test s1, s2, using s3 and s4 as scratch
+void emit_test32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4, int s5)
+{
+ CLEAR_FLAGS();
+ IFX_PENDOR0 {
+ SET_DF(s3, rex.w?d_tst64:d_tst32);
+ } else {
+ SET_DFNONE();
+ }
+
+ if(c>=-2048 && c<=2047) {
+ ANDI(s3, s1, c);
+ IFX(X_SF|X_ZF) {
+ if (!rex.w && c<0) ZEROUP(s3);
+ }
+ } else {
+ MOV64xw(s3, c);
+ AND(s3, s1, s3); // res = s1 & s2
+ }
+
+ IFX_PENDOR0 {
+ SDxw(s3, xEmu, offsetof(x64emu_t, res));
+ }
+ IFX(X_SF) {
+ SRLI(s4, s3, rex.w?63:31);
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_SF);
+ }
+ IFX(X_ZF) {
+ BNEZ(s3, 8);
+ ORI(xFlags, xFlags, 1 << F_ZF);
+ }
+ IFX(X_PF) {
+ emit_pf(dyn, ninst, s3, s4, s5);
+ }
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_f0.c b/src/dynarec/rv64/dynarec_rv64_f0.c
new file mode 100644
index 0000000..bb5c78c
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_f0.c
@@ -0,0 +1,691 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_helper.h"
+#include "dynarec_rv64_functions.h"
+
+
+uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
+{
+ (void)ip; (void)rep; (void)need_epilog;
+
+ uint8_t opcode = F8;
+ uint8_t nextop;
+ uint8_t gd, ed, u8;
+ uint8_t wback, wb1, wb2, eb1, eb2, gb1, gb2;
+ int32_t i32;
+ int64_t i64, j64;
+ int64_t fixedaddress;
+ int unscaled;
+ MAYUSE(eb1);
+ MAYUSE(eb2);
+ MAYUSE(gb1);
+ MAYUSE(gb2);
+ MAYUSE(wb1);
+ MAYUSE(wb2);
+ MAYUSE(j64);
+
+ while((opcode==0xF2) || (opcode==0xF3)) {
+ rep = opcode-0xF1;
+ opcode = F8;
+ }
+
+ GETREX();
+
+ // TODO: Take care of unligned memory access for all the LOCK ones.
+ // https://github.com/ptitSeb/box64/pull/604
+ switch(opcode) {
+ case 0x01:
+ INST_NAME("LOCK ADD Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ SMDMB();
+ if((nextop&0xC0)==0xC0) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_add32(dyn, ninst, rex, ed, gd, x3, x4, x5);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ ADDxw(x4, x1, gd);
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND) {
+ emit_add32(dyn, ninst, rex, x1, gd, x3, x4, x5);
+ }
+ }
+ SMDMB();
+ break;
+ case 0x09:
+ INST_NAME("LOCK OR Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ SMDMB();
+ if (MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_or32(dyn, ninst, rex, ed, gd, x3, x4);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ OR(x4, x1, gd);
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND)
+ emit_or32(dyn, ninst, rex, x1, gd, x3, x4);
+ }
+ SMDMB();
+ break;
+
+ case 0x0F:
+ nextop = F8;
+ switch(nextop) {
+ case 0xB0:
+ switch(rep) {
+ case 0:
+ INST_NAME("LOCK CMPXCHG Eb, Gb");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ ANDI(x6, xRAX, 0xff); // AL
+ SMDMB();
+ if(MODREG) {
+ if(rex.rex) {
+ wback = xRAX+(nextop&7)+(rex.b<<3);
+ wb2 = 0;
+ } else {
+ wback = (nextop&7);
+ wb2 = (wback>>2)*8;
+ wback = xRAX+(wback&3);
+ }
+ if (wb2) {
+ MV(x2, wback);
+ SRLI(x2, x2, wb2);
+ ANDI(x2, x2, 0xff);
+ } else {
+ ANDI(x2, wback, 0xff);
+ }
+ wb1 = 0;
+ ed = x2;
+ UFLAG_IF {
+ emit_cmp8(dyn, ninst, x6, ed, x3, x4, x5, x1);
+ }
+ BNE_MARK2(x6, x2);
+ if (wb2) {
+ MV(wback, x2);
+ SRLI(wback, wback, wb2);
+ ANDI(wback, wback, 0xff);
+ } else {
+ ANDI(wback, x2, 0xff);
+ }
+ GETGB(x1);
+ MV(ed, gd);
+ MARK2;
+ ANDI(xRAX, xRAX, ~0xff);
+ OR(xRAX, xRAX, x2);
+ B_NEXT_nocond;
+ } else {
+ // this one is tricky, and did some repetitive work.
+ // mostly because we only got 6 scratch registers,
+ // and has so much to do.
+ if(rex.rex) {
+ gb1 = xRAX+((nextop&0x38)>>3)+(rex.r<<3);
+ gb2 = 0;
+ } else {
+ gd = (nextop&0x38)>>3;
+ gb2 = ((gd&4)>>2);
+ gb1 = xRAX+(gd&3);
+ }
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ ANDI(x5, wback, 0b11);
+ SLLI(x5, x5, 3); // shamt
+ MARKLOCK;
+ ANDI(x2, wback, ~0b11); // align to 32bit
+ LWU(x1, x2, 0);
+ LR_W(x4, x2, 1, 1);
+ SRL(x4, x4, x5);
+ ANDI(x4, x4, 0xff);
+ BNE_MARK(x6, x4); // compare AL with m8
+ // AL == m8, r8 is loaded into m8
+ ADDI(x2, xZR, 0xff);
+ SLL(x2, x2, x5);
+ NOT(x2, x2);
+ AND(x2, x1, x2);
+ if (gb2) {
+ MV(x1, gb1);
+ SRLI(x1, x1, 8);
+ ANDI(x1, x1, 0xff);
+ } else {
+ ANDI(x1, gb1, 0xff);
+ }
+ SLL(x1, x1, x5);
+ OR(x1, x1, x2);
+ ANDI(x2, wback, ~0b11); // align to 32bit again
+ SC_W(x9, x1, x2, 1, 1);
+ BNEZ_MARKLOCK(x9);
+ // done
+ MARK;
+ UFLAG_IF {emit_cmp8(dyn, ninst, x6, x4, x1, x2, x3, x5);}
+ // load m8 into AL
+ ANDI(xRAX, xRAX, ~0xff);
+ OR(xRAX, xRAX, x4);
+ }
+ SMDMB();
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0xB1:
+ switch (rep) {
+ case 0:
+ INST_NAME("LOCK CMPXCHG Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ if (MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ wback = 0;
+ UFLAG_IF {emit_cmp32(dyn, ninst, rex, xRAX, ed, x3, x4, x5, x6);}
+ MV(x1, ed); // save value
+ SUB(x2, x1, xRAX);
+ BNE_MARK2(x2, xZR);
+ MV(ed, gd);
+ MARK2;
+ MVxw(xRAX, x1);
+ } else {
+ SMDMB();
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ SUBxw(x3, x1, xRAX);
+ BNE_MARK(x3, xZR);
+ // EAX == Ed
+ SCxw(x4, gd, wback, 1, 1);
+ BNEZ_MARKLOCK(x4);
+ MARK;
+ UFLAG_IF {emit_cmp32(dyn, ninst, rex, xRAX, x1, x3, x4, x5, x6);}
+ MVxw(xRAX, x1);
+ SMDMB();
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0xC1:
+ switch(rep) {
+ case 0:
+ INST_NAME("LOCK XADD Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ SMDMB();
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ MVxw(x1, ed);
+ MVxw(ed, gd);
+ MVxw(gd, x1);
+ emit_add32(dyn, ninst, rex, ed, gd, x3, x4, x5);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ ADDxw(x4, x1, gd);
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND) {
+ MVxw(x2, x1);
+ emit_add32(dyn, ninst, rex, x2, gd, x3, x4, x5);
+ }
+ MVxw(gd, x1);
+ }
+ SMDMB();
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
+ case 0xC7:
+ switch(rep) {
+ case 0:
+ if (rex.w) {
+ INST_NAME("LOCK CMPXCHG16B Gq, Eq");
+ } else {
+ INST_NAME("LOCK CMPXCHG8B Gq, Eq");
+ }
+ SETFLAGS(X_ZF, SF_SUBSET);
+ nextop = F8;
+ addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ ANDI(xFlags, xFlags, ~(1<<F_ZF));
+ if (rex.w) {
+ // there is no atomic move on 16bytes, so implement it with mutex
+ LD(x9, xEmu, offsetof(x64emu_t, context));
+ ADDI(x9, x9, offsetof(box64context_t, mutex_16b));
+ ADDI(x4, xZR, 1);
+ MARKLOCK;
+ AMOSWAP_W(x4, x4, x9, 1, 1);
+ // x4 == 1 if locked
+ BNEZ_MARKLOCK(x4);
+
+ SMDMB();
+ LD(x2, wback, 0);
+ LD(x3, wback, 8);
+ BNE_MARK(x2, xRAX);
+ BNE_MARK(x3, xRDX);
+ SD(xRBX, wback, 0);
+ SD(xRCX, wback, 8);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ B_MARK3_nocond;
+ MARK;
+ MV(xRAX, x2);
+ MV(xRDX, x3);
+ MARK3;
+ SMDMB();
+
+ // unlock
+ AMOSWAP_W(xZR, xZR, x9, 1, 1);
+ } else {
+ SMDMB();
+ MARKLOCK;
+ LR_D(x2, wback, 1, 1);
+ AND(x3, x2, xMASK);
+ AND(x4, xRAX, xMASK);
+ SRLI(x5, x2, 32);
+ AND(x6, xRDX, xMASK);
+ BNE_MARK(x3, x4); // EAX != Ed[0]
+ BNE_MARK(x5, x6); // EDX != Ed[1]
+ SLLI(x2, xRCX, 32);
+ AND(x3, xRBX, xMASK);
+ OR(x2, x2, x3);
+ SC_D(x3, x2, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ B_MARK3_nocond;
+ MARK;
+ ADDI(xRAX, x3, 0);
+ ADDI(xRDX, x5, 0);
+ AND(xRAX, xRAX, xMASK);
+ AND(xRDX, xRDX, xMASK);
+ MARK3;
+ SMDMB();
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0x10:
+ INST_NAME("LOCK ADC Eb, Gb");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGB(x2);
+ SMDMB();
+ if((nextop&0xC0)==0xC0) {
+ if(rex.rex) {
+ wback = xRAX + (nextop&7) + (rex.b<<3);
+ wb2 = 0;
+ } else {
+ wback = (nextop&7);
+ wb2 = (wback>>2);
+ wback = xRAX+(wback&3);
+ }
+ SRLIW(x1, wback, wb2*8);
+ ANDI(x1, x1, 0xFF);
+ emit_adc8(dyn, ninst, x1, x2, x3, x4, x5);
+ SLLI(x1, x1, wb2*8);
+ MOV_U12(x3, 0xFF);
+ SLLI(x3, x3, wb2*8);
+ NOT(x3, x3);
+ AND(wback, wback, x3);
+ OR(wback, wback, x1);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x1, x3, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ ANDI(x3, wback, 0b11);
+ BNEZ_MARK(x3);
+ MARKLOCK;
+ LR_W(x5, wback, 1, 1);
+ ANDI(x4, x5, 0xff); // x4 = Ed.b[0]
+ ANDI(x5, x5, -256); // x5 = clear Ed.b[0]
+ ADDW(x6, x4, x2);
+ ANDI(x9, xFlags, 1 << F_CF);
+ ADDW(x6, x6, x9); // x6 = adc
+ ANDI(x6, x6, 0xff);
+ OR(x5, x5, x6);
+ SC_W(x9, x5, wback, 1, 1);
+ BNEZ_MARKLOCK(x9);
+ B_MARK3_nocond;
+ MARK;
+ SLLI(x3, x3, 3);
+ MOV_U12(x4, 0xff);
+ ANDI(wback, wback, ~3); // aligning address
+ SLLI(x4, x4, x3); // x4 = byte mask
+ NOT(x5, x4); // x5 = ~mask
+ SLL(x2, x2, x3); // x2 = extented Gb
+ MARK2;
+ LR_W(x6, wback, 1, 1); // x6 = Ed
+ AND(x9, x6, x4); // x9 = extended Ed.b[dest]
+ AND(x6, x6, x5); // x6 = clear Ed.b[dest]
+ ADDW(x5, x9, x2);
+ ANDI(x4, xFlags, 1 << F_CF);
+ SLL(x4, x4, x3); // extented
+ ADDW(x5, x5, x4); // x5 = adc
+ OR(x5, x5, x6);
+ SC_W(x4, x5, wback, 1, 1);
+ BNEZ_MARK2(x4);
+ IFX(X_ALL|X_PEND) {
+ SRLI(x2, x2, x3); // Gb
+ SRLI(x4, x9, x3); // Eb
+ }
+ MARK3;
+ IFX(X_ALL|X_PEND) {
+ emit_adc8(dyn, ninst, x4, x2, x3, x5, x6);
+ }
+ }
+ SMDMB();
+ break;
+ case 0x11:
+ INST_NAME("LOCK ADC Ed, Gd");
+ READFLAGS(X_CF);
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ SMDMB();
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_adc32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ ADDxw(x3, x1, gd);
+ ANDI(x4, xFlags, 1 << F_CF);
+ ADDxw(x3, x3, x4);
+ SCxw(x4, x3, wback, 1, 1);
+ BNEZ_MARKLOCK(x4);
+ IFX(X_ALL|X_PEND) {
+ emit_adc32(dyn, ninst, rex, x1, gd, x3, x4, x5, x6);
+ }
+ }
+ SMDMB();
+ break;
+ case 0x21:
+ INST_NAME("LOCK AND Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ SMDMB();
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_and32(dyn, ninst, rex, ed, gd, x3, x4);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ AND(x4, x1, gd);
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND)
+ emit_and32(dyn, ninst, rex, x1, gd, x3, x4);
+ }
+ SMDMB();
+ break;
+ case 0x29:
+ INST_NAME("LOCK SUB Ed, Gd");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ nextop = F8;
+ GETGD;
+ SMDMB();
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_sub32(dyn, ninst, rex, ed, gd, x3, x4, x5);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ SUB(x4, x1, gd);
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND)
+ emit_sub32(dyn, ninst, rex, x1, gd, x3, x4, x5);
+ }
+ SMDMB();
+ break;
+ case 0x66:
+ return dynarec64_66F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog);
+
+ case 0x80:
+ nextop = F8;
+ SMDMB();
+ switch((nextop>>3)&7) {
+ case 1: // OR
+ INST_NAME("LOCK OR Eb, Ib");
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ if(MODREG) {
+ GETEB(x1, 1);
+ u8 = F8;
+ emit_or8c(dyn, ninst, x1, u8, x2, x4, x5);
+ EBBACK(x5, 0);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x5, x1, &fixedaddress, rex, LOCK_LOCK, 0, 1);
+ u8 = F8;
+ ANDI(x2, wback, 3);
+ SLLI(x2, x2, 3); // offset in bits
+ ANDI(x3, wback, ~3); // aligned addr
+ ADDI(x1, xZR, u8);
+ SLL(x1, x1, x2); // Ib << offset
+ MARKLOCK;
+ LR_W(x4, x3, 1, 1);
+ OR(x6, x4, x1);
+ SC_W(x6, x6, x3, 1, 1);
+ BNEZ_MARKLOCK(x6);
+ IFX(X_ALL|X_PEND) {
+ SRL(x1, x4, x2);
+ ANDI(x1, x1, 0xFF);
+ emit_or8c(dyn, ninst, x1, u8, x2, x4, x5);
+ }
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ SMDMB();
+ break;
+ case 0x81:
+ case 0x83:
+ nextop = F8;
+ SMDMB();
+ switch((nextop>>3)&7) {
+ case 0: // ADD
+ if(opcode==0x81) {
+ INST_NAME("LOCK ADD Ed, Id");
+ } else {
+ INST_NAME("LOCK ADD Ed, Ib");
+ }
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ if(MODREG) {
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ if(i64>=-2048 && i64<2048)
+ ADDIxw(x4, x1, i64);
+ else {
+ MOV64xw(x4, i64);
+ ADDxw(x4, x1, x4);
+ }
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND)
+ emit_add32c(dyn, ninst, rex, x1, i64, x3, x4, x5, x6);
+ }
+ break;
+ case 1: // OR
+ if(opcode==0x81) {
+ INST_NAME("LOCK OR Ed, Id");
+ } else {
+ INST_NAME("LOCK OR Ed, Ib");
+ }
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ if(MODREG) {
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_or32c(dyn, ninst, rex, ed, i64, x3, x4);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ if (i64>=-2048 && i64<2048) {
+ ORI(x4, x1, i64);
+ } else {
+ MOV64xw(x4, i64);
+ OR(x4, x1, x4);
+ }
+ if (!rex.w) ZEROUP(x4);
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND)
+ emit_or32c(dyn, ninst, rex, x1, i64, x3, x4);
+ }
+ break;
+ case 4: // AND
+ if(opcode==0x81) {
+ INST_NAME("LOCK AND Ed, Id");
+ } else {
+ INST_NAME("LOCK AND Ed, Ib");
+ }
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ if(MODREG) {
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_and32c(dyn, ninst, rex, ed, i64, x3, x4);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ if (i64>=-2048 && i64<2048) {
+ ANDI(x4, x1, i64);
+ } else {
+ MOV64xw(x4, i64);
+ AND(x4, x1, x4);
+ }
+ if (!rex.w) ZEROUP(x4);
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND)
+ emit_and32c(dyn, ninst, rex, x1, i64, x3, x4);
+ }
+ break;
+ case 5: // SUB
+ if(opcode==0x81) {
+ INST_NAME("LOCK SUB Ed, Id");
+ } else {
+ INST_NAME("LOCK SUB Ed, Ib");
+ }
+ SETFLAGS(X_ALL, SF_SET_PENDING);
+ if(MODREG) {
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_sub32(dyn, ninst, rex, ed, i64, x3, x4, x5);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1);
+ if(opcode==0x81) i64 = F32S; else i64 = F8S;
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ if (i64>-2048 && i64<=2048) {
+ ADDIxw(x4, x1, -i64);
+ } else {
+ MOV64xw(x4, i64);
+ SUBxw(x4, x1, x4);
+ }
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND)
+ emit_sub32c(dyn, ninst, rex, x1, i64, x3, x4, x5, x6);
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ SMDMB();
+ break;
+ case 0xFF:
+ nextop = F8;
+ switch((nextop>>3)&7)
+ {
+ case 0: // INC Ed
+ INST_NAME("LOCK INC Ed");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ SMDMB();
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_inc32(dyn, ninst, rex, ed, x3, x4, x5, x6);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ ADDIxw(x4, x1, 1);
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND)
+ emit_inc32(dyn, ninst, rex, x1, x3, x4, x5, x6);
+ }
+ break;
+ case 1: // DEC Ed
+ INST_NAME("LOCK DEC Ed");
+ SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING);
+ SMDMB();
+ if(MODREG) {
+ ed = xRAX+(nextop&7)+(rex.b<<3);
+ emit_dec32(dyn, ninst, rex, ed, x3, x4, x5, x6);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0);
+ MARKLOCK;
+ LRxw(x1, wback, 1, 1);
+ ADDIxw(x4, x1, -1);
+ SCxw(x3, x4, wback, 1, 1);
+ BNEZ_MARKLOCK(x3);
+ IFX(X_ALL|X_PEND)
+ emit_inc32(dyn, ninst, rex, x1, x3, x4, x5, x6);
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ break;
+ default:
+ DEFAULT;
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_f20f.c b/src/dynarec/rv64/dynarec_rv64_f20f.c
new file mode 100644
index 0000000..ac3da81
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_f20f.c
@@ -0,0 +1,377 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog)
+{
+ (void)ip; (void)need_epilog;
+
+ uint8_t opcode = F8;
+ uint8_t nextop;
+ uint8_t gd, ed;
+ uint8_t wback, gback;
+ uint8_t u8;
+ uint64_t u64, j64;
+ int v0, v1;
+ int q0;
+ int d0, d1;
+ int64_t fixedaddress, gdoffset;
+ int unscaled;
+
+ MAYUSE(d0);
+ MAYUSE(d1);
+ MAYUSE(q0);
+ MAYUSE(v0);
+ MAYUSE(v1);
+
+ switch(opcode) {
+
+ case 0x10:
+ INST_NAME("MOVSD Gx, Ex");
+ nextop = F8;
+ GETG;
+ if(MODREG) {
+ ed = (nextop&7)+ (rex.b<<3);
+ v0 = sse_get_reg(dyn, ninst, x1, gd, 0);
+ d0 = sse_get_reg(dyn, ninst, x1, ed, 0);
+ FMVD(v0, d0);
+ } else {
+ SMREAD();
+ v0 = sse_get_reg_empty(dyn, ninst, x1, gd, 0);
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0);
+ FLD(v0, ed, fixedaddress);
+ // reset upper part
+ SD(xZR, xEmu, offsetof(x64emu_t, xmm[gd])+8);
+ }
+ break;
+ case 0x11:
+ INST_NAME("MOVSD Ex, Gx");
+ nextop = F8;
+ GETG;
+ v0 = sse_get_reg(dyn, ninst, x1, gd, 0);
+ if(MODREG) {
+ ed = (nextop&7)+ (rex.b<<3);
+ d0 = sse_get_reg(dyn, ninst, x1, ed, 0);
+ FMVD(d0, v0);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0);
+ FSD(v0, ed, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+ case 0x12:
+ INST_NAME("MOVDDUP Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ LD(x3, wback, fixedaddress+0);
+ SD(x3, gback, gdoffset+0);
+ SD(x3, gback, gdoffset+8);
+ break;
+ case 0x2A:
+ INST_NAME("CVTSI2SD Gx, Ed");
+ nextop = F8;
+ GETGXSD(v0);
+ GETED(0);
+ if(rex.w) {
+ FCVTDL(v0, ed, RD_RNE);
+ } else {
+ FCVTDW(v0, ed, RD_RNE);
+ }
+ break;
+ case 0x2C:
+ INST_NAME("CVTTSD2SI Gd, Ex");
+ nextop = F8;
+ GETGD;
+ GETEXSD(v0, 0);
+ if(!box64_dynarec_fastround) {
+ FSFLAGSI(0); // // reset all bits
+ }
+ FCVTLDxw(gd, v0, RD_RTZ);
+ if(!rex.w)
+ ZEROUP(gd);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, (1<<FR_NV)|(1<<FR_OF));
+ CBZ_NEXT(x5);
+ if(rex.w) {
+ MOV64x(gd, 0x8000000000000000LL);
+ } else {
+ MOV32w(gd, 0x80000000);
+ }
+ }
+ break;
+ case 0x2D:
+ INST_NAME("CVTSD2SI Gd, Ex");
+ nextop = F8;
+ GETGD;
+ GETEXSD(v0, 0);
+ if(!box64_dynarec_fastround) {
+ FSFLAGSI(0); // // reset all bits
+ }
+ u8 = sse_setround(dyn, ninst, x2, x3);
+ FCVTLDxw(gd, v0, RD_DYN);
+ x87_restoreround(dyn, ninst, u8);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, (1<<FR_NV)|(1<<FR_OF));
+ CBZ_NEXT(x5);
+ if(rex.w) {
+ MOV64x(gd, 0x8000000000000000LL);
+ } else {
+ MOV32w(gd, 0x80000000);
+ }
+ }
+ break;
+ case 0x38: // these are some more SSSE4.2+ opcodes
+ opcode = F8;
+ switch(opcode) {
+
+ case 0xF0:
+ INST_NAME("(unsupported) CRC32 Gd, Eb)");
+ nextop = F8;
+ addr = fakeed(dyn, addr, ninst, nextop);
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL();
+ CALL(native_ud, -1);
+ LOAD_XEMU_CALL();
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+ case 0xF1:
+ INST_NAME("(unsupported) CRC32 Gd, Ed)");
+ nextop = F8;
+ addr = fakeed(dyn, addr, ninst, nextop);
+ SETFLAGS(X_ALL, SF_SET); // Hack to set flags in "don't care" state
+ GETIP(ip);
+ STORE_XEMU_CALL();
+ CALL(native_ud, -1);
+ LOAD_XEMU_CALL();
+ jump_to_epilog(dyn, 0, xRIP, ninst);
+ *need_epilog = 0;
+ *ok = 0;
+ break;
+
+ default:
+ DEFAULT;
+ }
+ break;
+ case 0x51:
+ INST_NAME("SQRTSD Gx, Ex");
+ nextop = F8;
+ GETEXSD(d0, 0);
+ GETGXSD_empty(d1);
+ if(!box64_dynarec_fastnan) {
+ v0 = fpu_get_scratch(dyn); // need a scratch in case d0 == d1
+ FMVDX(v0, xZR);
+ FLTD(x3, d0, v0);
+ }
+ FSQRTD(d1, d0);
+ if(!box64_dynarec_fastnan) {
+ BEQ(x3, xZR, 8);
+ FNEGD(d1, d1);
+ }
+ break;
+ case 0x58:
+ INST_NAME("ADDSD Gx, Ex");
+ nextop = F8;
+ // TODO: fastnan handling
+ GETGXSD(v0);
+ GETEXSD(v1, 0);
+ FADDD(v0, v0, v1);
+ break;
+ case 0x59:
+ INST_NAME("MULSD Gx, Ex");
+ nextop = F8;
+ //TODO: fastnan handling
+ GETGXSD(v0);
+ GETEXSD(v1, 0);
+ FMULD(v0, v0, v1);
+ break;
+ case 0x5A:
+ INST_NAME("CVTSD2SS Gx, Ex");
+ nextop = F8;
+ GETEXSD(v1, 0);
+ GETGXSS_empty(v0);
+ FCVTSD(v0, v1);
+ break;
+ case 0x5C:
+ INST_NAME("SUBSD Gx, Ex");
+ nextop = F8;
+ //TODO: fastnan handling
+ GETGXSD(v0);
+ GETEXSD(v1, 0);
+ FSUBD(v0, v0, v1);
+ break;
+ case 0x5D:
+ INST_NAME("MINSD Gx, Ex");
+ nextop = F8;
+ GETGXSD(v0);
+ GETEXSD(v1, 0);
+ FEQD(x2, v0, v0);
+ FEQD(x3, v1, v1);
+ AND(x2, x2, x3);
+ BEQ_MARK(x2, xZR);
+ FLED(x2, v1, v0);
+ BEQ_MARK2(x2, xZR);
+ MARK;
+ FMVD(v0, v1);
+ MARK2;
+ break;
+ case 0x5E:
+ INST_NAME("DIVSD Gx, Ex");
+ nextop = F8;
+ GETGXSD(v0);
+ GETEXSD(v1, 0);
+ if(!box64_dynarec_fastnan) {
+ FEQD(x3, v0, v0);
+ FEQD(x4, v1, v1);
+ }
+ FDIVD(v0, v0, v1);
+ if(!box64_dynarec_fastnan) {
+ AND(x3, x3, x4);
+ CBZ_NEXT(x3);
+ FEQD(x3, v0, v0);
+ CBNZ_NEXT(x3);
+ FNEGD(v0, v0);
+ }
+ break;
+ case 0x5F:
+ INST_NAME("MAXSD Gx, Ex");
+ nextop = F8;
+ GETGXSD(v0);
+ GETEXSD(v1, 0);
+ FEQD(x2, v0, v0);
+ FEQD(x3, v1, v1);
+ AND(x2, x2, x3);
+ BEQ_MARK(x2, xZR);
+ FLED(x2, v0, v1);
+ BEQ_MARK2(x2, xZR);
+ MARK;
+ FMVD(v0, v1);
+ MARK2;
+ break;
+ case 0x70: // TODO: Optimize this!
+ INST_NAME("PSHUFLW Gx, Ex, Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ int32_t idx;
+
+ idx = (u8>>(0*2))&3;
+ LHU(x3, wback, fixedaddress+idx*2);
+ idx = (u8>>(1*2))&3;
+ LHU(x4, wback, fixedaddress+idx*2);
+ idx = (u8>>(2*2))&3;
+ LHU(x5, wback, fixedaddress+idx*2);
+ idx = (u8>>(3*2))&3;
+ LHU(x6, wback, fixedaddress+idx*2);
+
+ SH(x3, gback, gdoffset+0*2);
+ SH(x4, gback, gdoffset+1*2);
+ SH(x5, gback, gdoffset+2*2);
+ SH(x6, gback, gdoffset+3*2);
+
+ if (!(MODREG && (gd==ed))) {
+ LD(x3, wback, fixedaddress+8);
+ SD(x3, gback, gdoffset+8);
+ }
+ break;
+ case 0xC2:
+ INST_NAME("CMPSD Gx, Ex, Ib");
+ nextop = F8;
+ GETGXSD(d0);
+ GETEXSD(d1, 1);
+ u8 = F8;
+ if ((u8&7) == 0) { // Equal
+ FEQD(x2, d0, d1);
+ } else if ((u8&7) == 4) { // Not Equal or unordered
+ FEQD(x2, d0, d1);
+ XORI(x2, x2, 1);
+ } else {
+ // x2 = !(isnan(d0) || isnan(d1))
+ FEQD(x3, d0, d0);
+ FEQD(x2, d1, d1);
+ AND(x2, x2, x3);
+
+ switch(u8&7) {
+ case 1: BEQ_MARK(x2, xZR); FLTD(x2, d0, d1); break; // Less than
+ case 2: BEQ_MARK(x2, xZR); FLED(x2, d0, d1); break; // Less or equal
+ case 3: XORI(x2, x2, 1); break; // NaN
+ case 5: { // Greater or equal or unordered
+ BEQ_MARK2(x2, xZR);
+ FLED(x2, d1, d0);
+ B_MARK_nocond;
+ break;
+ }
+ case 6: { // Greater or unordered, test inverted, N!=V so unordered or less than (inverted)
+ BEQ_MARK2(x2, xZR);
+ FLTD(x2, d1, d0);
+ B_MARK_nocond;
+ break;
+ }
+ case 7: break; // Not NaN
+ }
+
+ MARK2;
+ if ((u8&7) == 5 || (u8&7) == 6) {
+ MOV32w(x2, 1);
+ }
+ MARK;
+ }
+ NEG(x2, x2);
+ FMVDX(d0, x2);
+ break;
+ case 0xE6:
+ INST_NAME("CVTPD2DQ Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ d0 = fpu_get_scratch(dyn);
+ u8 = sse_setround(dyn, ninst, x6, x4);
+ for (int i=0; i<2 ; ++i) {
+ FLD(d0, wback, fixedaddress+8*i);
+ FCVTLD(x3, d0, RD_DYN);
+ SEXT_W(x5, x3);
+ SUB(x5, x5, x3);
+ BEQZ(x5, 8);
+ LUI(x3, 0x80000); // INT32_MIN
+ SW(x3, gback, gdoffset+4*i);
+ }
+ x87_restoreround(dyn, ninst, u8);
+ SD(xZR, gback, gdoffset+8);
+ break;
+ case 0xF0:
+ INST_NAME("LDDQU Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_MV_Q(x3);
+ break;
+ default:
+ DEFAULT;
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_f30f.c b/src/dynarec/rv64/dynarec_rv64_f30f.c
new file mode 100644
index 0000000..0c0676e
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_f30f.c
@@ -0,0 +1,522 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+#include "bitutils.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog)
+{
+ (void)ip; (void)need_epilog;
+
+ uint8_t opcode = F8;
+ uint8_t nextop, u8;
+ uint8_t gd, ed;
+ uint8_t wback, gback;
+ uint64_t u64;
+ int v0, v1;
+ int q0, q1;
+ int d0, d1;
+ int64_t fixedaddress, gdoffset;
+ int unscaled;
+ int64_t j64;
+
+ MAYUSE(d0);
+ MAYUSE(d1);
+ MAYUSE(q0);
+ MAYUSE(q1);
+ MAYUSE(v0);
+ MAYUSE(v1);
+ MAYUSE(j64);
+
+ switch(opcode) {
+ case 0x10:
+ INST_NAME("MOVSS Gx, Ex");
+ nextop = F8;
+ GETG;
+ if(MODREG) {
+ v0 = sse_get_reg(dyn, ninst, x1, gd, 1);
+ q0 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 1);
+ FMVS(v0, q0);
+ } else {
+ v0 = sse_get_reg_empty(dyn, ninst, x1, gd, 1);
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0);
+ FLW(v0, ed, fixedaddress);
+ // reset upper part
+ SW(xZR, xEmu, offsetof(x64emu_t, xmm[gd])+4);
+ SD(xZR, xEmu, offsetof(x64emu_t, xmm[gd])+8);
+ }
+ break;
+ case 0x11:
+ INST_NAME("MOVSS Ex, Gx");
+ nextop = F8;
+ GETG;
+ v0 = sse_get_reg(dyn, ninst, x1, gd, 1);
+ if(MODREG) {
+ q0 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 1);
+ FMVS(q0, v0);
+ } else {
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0);
+ FSW(v0, ed, fixedaddress);
+ SMWRITE2();
+ }
+ break;
+
+ case 0x12:
+ INST_NAME("MOVSLDUP Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+
+ // GX->ud[1] = GX->ud[0] = EX->ud[0];
+ // GX->ud[3] = GX->ud[2] = EX->ud[2];
+ LD(x3, wback, fixedaddress+0);
+ SD(x3, gback, gdoffset+0);
+ SD(x3, gback, gdoffset+4);
+ LD(x3, wback, fixedaddress+8);
+ SD(x3, gback, gdoffset+8);
+ SD(x3, gback, gdoffset+12);
+ break;
+ case 0x1E:
+ INST_NAME("NOP / ENDBR32 / ENDBR64");
+ nextop = F8;
+ FAKEED;
+ break;
+
+ case 0x2A:
+ INST_NAME("CVTSI2SS Gx, Ed");
+ nextop = F8;
+ GETGXSS(v0);
+ GETED(0);
+ if(rex.w) {
+ FCVTSL(v0, ed, RD_RNE);
+ } else {
+ FCVTSW(v0, ed, RD_RNE);
+ }
+ break;
+
+ case 0x2C:
+ INST_NAME("CVTTSS2SI Gd, Ex");
+ nextop = F8;
+ GETGD;
+ GETEXSS(d0, 0);
+ if(!box64_dynarec_fastround) {
+ FSFLAGSI(0); // // reset all bits
+ }
+ FCVTSxw(gd, d0, RD_RTZ);
+ if(!rex.w)
+ ZEROUP(gd);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, (1<<FR_NV)|(1<<FR_OF));
+ CBZ_NEXT(x5);
+ if(rex.w) {
+ MOV64x(gd, 0x8000000000000000LL);
+ } else {
+ MOV32w(gd, 0x80000000);
+ }
+ }
+ break;
+ case 0x2D:
+ INST_NAME("CVTSS2SI Gd, Ex");
+ nextop = F8;
+ GETGD;
+ GETEXSS(d0, 0);
+ if(!box64_dynarec_fastround) {
+ FSFLAGSI(0); // // reset all bits
+ }
+ u8 = sse_setround(dyn, ninst, x5, x6);
+ FCVTSxw(gd, d0, RD_DYN);
+ x87_restoreround(dyn, ninst, u8);
+ if(!rex.w)
+ ZEROUP(gd);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, (1<<FR_NV)|(1<<FR_OF));
+ CBZ_NEXT(x5);
+ if(rex.w) {
+ MOV64x(gd, 0x8000000000000000LL);
+ } else {
+ MOV32w(gd, 0x80000000);
+ }
+ }
+ break;
+
+ case 0x51:
+ INST_NAME("SQRTSS Gx, Ex");
+ nextop = F8;
+ GETEXSS(v0, 0);
+ GETGXSS_empty(v1);
+ FSQRTS(v1, v0);
+ break;
+ case 0x53:
+ INST_NAME("RCPSS Gx, Ex");
+ nextop = F8;
+ GETEXSS(v0, 0);
+ GETGXSS_empty(v1);
+ q0 = fpu_get_scratch(dyn);
+ LUI(x3, 0x3F800); // 1.0f
+ FMVWX(q0, x3);
+ FDIVS(v1, q0, v0);
+ break;
+ case 0x58:
+ INST_NAME("ADDSS Gx, Ex");
+ nextop = F8;
+ GETGXSS(v0);
+ GETEXSS(d0, 0);
+ FADDS(v0, v0, d0);
+ break;
+ case 0x59:
+ INST_NAME("MULSS Gx, Ex");
+ nextop = F8;
+ GETGXSS(v0);
+ GETEXSS(d0, 0);
+ FMULS(v0, v0, d0);
+ break;
+ case 0x5A:
+ INST_NAME("CVTSS2SD Gx, Ex");
+ nextop = F8;
+ GETEXSS(v1, 0);
+ GETGXSD_empty(v0);
+ FCVTDS(v0, v1);
+ break;
+ case 0x5C:
+ INST_NAME("SUBSS Gx, Ex");
+ nextop = F8;
+ GETGXSS(v0);
+ GETEXSS(d0, 0);
+ FSUBS(v0, v0, d0);
+ break;
+ case 0x5D:
+ INST_NAME("MINSS Gx, Ex");
+ nextop = F8;
+ GETGXSS(d0);
+ GETEXSS(d1, 0);
+ FEQS(x2, d0, d0);
+ FEQS(x3, d1, d1);
+ AND(x2, x2, x3);
+ BEQ_MARK(x2, xZR);
+ FLTS(x2, d1, d0);
+ BEQ_MARK2(x2, xZR);
+ MARK;
+ FMVS(d0, d1);
+ MARK2;
+ break;
+ case 0x5E:
+ INST_NAME("DIVSS Gx, Ex");
+ nextop = F8;
+ GETGXSS(v0);
+ GETEXSS(d0, 0);
+ FDIVS(v0, v0, d0);
+ break;
+ case 0x5F:
+ INST_NAME("MAXSS Gx, Ex");
+ nextop = F8;
+ GETGXSS(d0);
+ GETEXSS(d1, 0);
+ FEQS(x2, d0, d0);
+ FEQS(x3, d1, d1);
+ AND(x2, x2, x3);
+ BEQ_MARK(x2, xZR);
+ FLTS(x2, d0, d1);
+ BEQ_MARK2(x2, xZR);
+ MARK;
+ FMVS(d0, d1);
+ MARK2;
+ break;
+ case 0x6F:
+ INST_NAME("MOVDQU Gx,Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_MV_Q(x3);
+ break;
+ case 0x70: // TODO: Optimize this!
+ INST_NAME("PSHUFHW Gx, Ex, Ib");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 1);
+ u8 = F8;
+ int32_t idx;
+
+ idx = 4+((u8>>(0*2))&3);
+ LHU(x3, wback, fixedaddress+idx*2);
+ idx = 4+((u8>>(1*2))&3);
+ LHU(x4, wback, fixedaddress+idx*2);
+ idx = 4+((u8>>(2*2))&3);
+ LHU(x5, wback, fixedaddress+idx*2);
+ idx = 4+((u8>>(3*2))&3);
+ LHU(x6, wback, fixedaddress+idx*2);
+
+ SH(x3, gback, gdoffset+(4+0)*2);
+ SH(x4, gback, gdoffset+(4+1)*2);
+ SH(x5, gback, gdoffset+(4+2)*2);
+ SH(x6, gback, gdoffset+(4+3)*2);
+
+ if (!(MODREG && (gd==ed))) {
+ LD(x3, wback, fixedaddress+0);
+ SD(x3, gback, gdoffset+0);
+ }
+ break;
+ case 0x7E:
+ INST_NAME("MOVQ Gx, Ex");
+ nextop = F8;
+ // Will load Gx as SD. Is that a good choice?
+ if(MODREG) {
+ v1 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 0);
+ GETGXSD_empty(v0);
+ FMVD(v0, v1);
+ } else {
+ GETGXSD_empty(v0);
+ SMREAD();
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0);
+ FLD(v0, ed, fixedaddress);
+ }
+ SD(xZR, xEmu, offsetof(x64emu_t, xmm[gd])+8);
+ break;
+ case 0x7F:
+ INST_NAME("MOVDQU Ex,Gx");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ SSE_LOOP_MV_Q2(x3);
+ if(!MODREG) SMWRITE2();
+ break;
+
+ case 0x5B:
+ INST_NAME("CVTTPS2DQ Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ v0 = fpu_get_scratch(dyn);
+ for(int i=0; i<4; ++i) {
+ if(!box64_dynarec_fastround) {
+ FSFLAGSI(0); // reset all bits
+ }
+ FLW(v0, wback, fixedaddress+i*4);
+ FCVTWS(x3, v0, RD_RTZ);
+ if(!box64_dynarec_fastround) {
+ FRFLAGS(x5); // get back FPSR to check the IOC bit
+ ANDI(x5, x5, (1<<FR_NV)|(1<<FR_OF));
+ BEQZ(x5, 8);
+ MOV32w(x3, 0x80000000);
+ }
+ SW(x3, gback, gdoffset+i*4);
+ }
+ break;
+ case 0xB8:
+ INST_NAME("POPCNT Gd, Ed");
+ SETFLAGS(X_ALL, SF_SET);
+ SET_DFNONE();
+ nextop = F8;
+ GETED(0);
+ GETGD;
+ if(!rex.w && MODREG) {
+ AND(x4, ed, xMASK);
+ ed = x4;
+ }
+ CLEAR_FLAGS();
+ BNE_MARK(ed, xZR);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ MOV32w(gd, 0);
+ B_NEXT_nocond;
+ MARK;
+ if(rv64_zbb) {
+ CPOPxw(gd, ed);
+ } else {
+ TABLE64(x1, 0x5555555555555555uLL);
+ SRLI(x5, ed, 1);
+ AND(x5, x5, x1);
+ SUB(x5, ed, x5);
+ TABLE64(x3, 0x3333333333333333uLL);
+ SRLI(x1, x5, 2);
+ AND(x1, x1, x3);
+ AND(x5, x5, x3);
+ ADD(x5, x5, x1);
+ TABLE64(x3, 0x0F0F0F0F0F0F0F0FuLL);
+ SRLI(x1, x5, 4);
+ ADD(x5, x5, x1);
+ AND(x5, x5, x3);
+ SRLI(x1, x5, 32);
+ ADDW(x5, x5, x1);
+ SRLIW(x1, x5, 16);
+ ADDW(x5, x5, x1);
+ SRLIW(x1, x5, 8);
+ ADDW(x5, x5, x1);
+ ANDI(gd, x5, 0x7F);
+ }
+ break;
+ case 0xBC:
+ INST_NAME("TZCNT Gd, Ed");
+ SETFLAGS(X_ZF, SF_SUBSET);
+ SET_DFNONE();
+ nextop = F8;
+ GETED(0);
+ GETGD;
+ if(!rex.w && MODREG) {
+ AND(x4, ed, xMASK);
+ ed = x4;
+ }
+ ANDI(xFlags, xFlags, ~((1<<F_ZF) | (1<<F_CF)));
+ BNE_MARK(ed, xZR);
+ ORI(xFlags, xFlags, 1<<F_CF);
+ MOV32w(gd, rex.w?64:32);
+ B_NEXT_nocond;
+ MARK;
+ if(rv64_zbb) {
+ CTZxw(gd, ed);
+ } else {
+ NEG(x2, ed);
+ AND(x2, x2, ed);
+ TABLE64(x3, 0x03f79d71b4ca8b09ULL);
+ MUL(x2, x2, x3);
+ SRLI(x2, x2, 64-6);
+ TABLE64(x1, (uintptr_t)&deBruijn64tab);
+ ADD(x1, x1, x2);
+ LBU(gd, x1, 0);
+ }
+ BNE(gd, xZR, 4+4);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ break;
+ case 0xBD:
+ INST_NAME("LZCNT Gd, Ed");
+ SETFLAGS(X_ZF|X_CF, SF_SUBSET);
+ SET_DFNONE();
+ nextop = F8;
+ GETED(0);
+ GETGD;
+ if(!rex.w && MODREG) {
+ AND(x4, ed, xMASK);
+ ed = x4;
+ }
+ BNE_MARK(ed, xZR);
+ MOV32w(gd, rex.w?64:32);
+ ANDI(xFlags, xFlags, ~(1<<F_ZF));
+ ORI(xFlags, xFlags, 1<<F_CF);
+ B_NEXT_nocond;
+ MARK;
+ if(rv64_zbb) {
+ CLZxw(gd, ed);
+ } else {
+ if(ed!=gd)
+ u8 = gd;
+ else
+ u8 = x1;
+ ADDI(u8, xZR, rex.w?63:31);
+ if(rex.w) {
+ MV(x2, ed);
+ SRLI(x3, x2, 32);
+ BEQZ(x3, 4+2*4);
+ SUBI(u8, u8, 32);
+ MV(x2, x3);
+ } else {
+ AND(x2, ed, xMASK);
+ }
+ SRLI(x3, x2, 16);
+ BEQZ(x3, 4+2*4);
+ SUBI(u8, u8, 16);
+ MV(x2, x3);
+ SRLI(x3, x2, 8);
+ BEQZ(x3, 4+2*4);
+ SUBI(u8, u8, 8);
+ MV(x2, x3);
+ SRLI(x3, x2, 4);
+ BEQZ(x3, 4+2*4);
+ SUBI(u8, u8, 4);
+ MV(x2, x3);
+ ANDI(x2, x2, 0b1111);
+ TABLE64(x3, (uintptr_t)&lead0tab);
+ ADD(x3, x3, x2);
+ LBU(x2, x3, 0);
+ SUB(gd, u8, x2);
+ MARK2;
+ }
+ ANDI(xFlags, xFlags, ~((1<<F_ZF) | (1<<F_CF)));
+ BNE(gd, xZR, 4+4);
+ ORI(xFlags, xFlags, 1<<F_ZF);
+ break;
+
+ case 0xC2:
+ INST_NAME("CMPSS Gx, Ex, Ib");
+ nextop = F8;
+ GETGXSS(d0);
+ GETEXSS(d1, 1);
+ u8 = F8;
+ if ((u8&7) == 0) { // Equal
+ FEQS(x2, d0, d1);
+ } else if ((u8&7) == 4) { // Not Equal or unordered
+ FEQS(x2, d0, d1);
+ XORI(x2, x2, 1);
+ } else {
+ // x2 = !(isnan(d0) || isnan(d1))
+ FEQS(x3, d0, d0);
+ FEQS(x2, d1, d1);
+ AND(x2, x2, x3);
+
+ switch(u8&7) {
+ case 1: BEQ_MARK(x2, xZR); FLTS(x2, d0, d1); break; // Less than
+ case 2: BEQ_MARK(x2, xZR); FLES(x2, d0, d1); break; // Less or equal
+ case 3: XORI(x2, x2, 1); break; // NaN
+ case 5: { // Greater or equal or unordered
+ BEQ_MARK2(x2, xZR);
+ FLES(x2, d1, d0);
+ B_MARK_nocond;
+ break;
+ }
+ case 6: { // Greater or unordered, test inverted, N!=V so unordered or less than (inverted)
+ BEQ_MARK2(x2, xZR);
+ FLTS(x2, d1, d0);
+ B_MARK_nocond;
+ break;
+ }
+ case 7: break; // Not NaN
+ }
+
+ MARK2;
+ if ((u8&7) == 5 || (u8&7) == 6) {
+ MOV32w(x2, 1);
+ }
+ MARK;
+ }
+ NEG(x2, x2);
+ FMVWX(d0, x2);
+ break;
+
+ case 0xE6:
+ INST_NAME("CVTDQ2PD Gx, Ex");
+ nextop = F8;
+ GETGX();
+ GETEX(x2, 0);
+ q0 = fpu_get_scratch(dyn);
+ q1 = fpu_get_scratch(dyn);
+ LW(x3, wback, fixedaddress+0);
+ LW(x4, wback, fixedaddress+4);
+ FCVTDW(q0, x3, RD_RTZ);
+ FCVTDW(q1, x4, RD_RTZ);
+ FSD(q0, gback, gdoffset+0);
+ FSD(q1, gback, gdoffset+8);
+ break;
+
+ default:
+ DEFAULT;
+ }
+ return addr;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_functions.c b/src/dynarec/rv64/dynarec_rv64_functions.c
new file mode 100644
index 0000000..541ac45
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_functions.c
@@ -0,0 +1,564 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <math.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "emu/x87emu_private.h"
+#include "x64trace.h"
+#include "signals.h"
+#include "dynarec_rv64.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "custommem.h"
+#include "bridge.h"
+#include "rv64_lock.h"
+
+#define XMM0 0
+#define X870 XMM0+16
+#define EMM0 XMM0+16
+
+// Get a FPU scratch reg
+int fpu_get_scratch(dynarec_rv64_t* dyn)
+{
+ return SCRATCH0 + dyn->e.fpu_scratch++; // return an Sx
+}
+// Reset scratch regs counter
+void fpu_reset_scratch(dynarec_rv64_t* dyn)
+{
+ dyn->e.fpu_scratch = 0;
+}
+// Get a x87 double reg
+int fpu_get_reg_x87(dynarec_rv64_t* dyn, int t, int n)
+{
+ int i=X870;
+ while (dyn->e.fpuused[i]) ++i;
+ dyn->e.fpuused[i] = 1;
+ dyn->e.extcache[i].n = n;
+ dyn->e.extcache[i].t = t;
+ dyn->e.news |= (1<<i);
+ return EXTREG(i); // return a Dx
+}
+// Free a FPU reg
+void fpu_free_reg(dynarec_rv64_t* dyn, int reg)
+{
+ int idx = EXTIDX(reg);
+ // TODO: check upper limit?
+ dyn->e.fpuused[idx] = 0;
+ if(dyn->e.extcache[reg].t!=EXT_CACHE_ST_F && dyn->e.extcache[reg].t!=EXT_CACHE_ST_D)
+ dyn->e.extcache[idx].v = 0;
+}
+// Get an MMX double reg
+int fpu_get_reg_emm(dynarec_rv64_t* dyn, int emm)
+{
+ dyn->e.fpuused[EMM0 + emm] = 1;
+ dyn->e.extcache[EMM0 + emm].t = EXT_CACHE_MM;
+ dyn->e.extcache[EMM0 + emm].n = emm;
+ dyn->e.news |= (1<<(EMM0 + emm));
+ return EXTREG(EMM0 + emm);
+}
+// Get an XMM reg
+int fpu_get_reg_xmm(dynarec_rv64_t* dyn, int t, int xmm)
+{
+ int i = XMM0+xmm;
+ dyn->e.fpuused[i] = 1;
+ dyn->e.extcache[i].t = t;
+ dyn->e.extcache[i].n = xmm;
+ dyn->e.news |= (1<<i);
+ return EXTREG(i);
+}
+// Reset fpu regs counter
+void fpu_reset_reg(dynarec_rv64_t* dyn)
+{
+ dyn->e.fpu_reg = 0;
+ for (int i=0; i<24; ++i) {
+ dyn->e.fpuused[i]=0;
+ dyn->e.extcache[i].v = 0;
+ }
+}
+
+int extcache_get_st(dynarec_rv64_t* dyn, int ninst, int a)
+{
+ if (dyn->insts[ninst].e.swapped) {
+ if(dyn->insts[ninst].e.combined1 == a)
+ a = dyn->insts[ninst].e.combined2;
+ else if(dyn->insts[ninst].e.combined2 == a)
+ a = dyn->insts[ninst].e.combined1;
+ }
+ for(int i=0; i<24; ++i)
+ if((dyn->insts[ninst].e.extcache[i].t==EXT_CACHE_ST_F
+ || dyn->insts[ninst].e.extcache[i].t==EXT_CACHE_ST_D)
+ && dyn->insts[ninst].e.extcache[i].n==a)
+ return dyn->insts[ninst].e.extcache[i].t;
+ // not in the cache yet, so will be fetched...
+ return EXT_CACHE_ST_D;
+}
+
+int extcache_get_current_st(dynarec_rv64_t* dyn, int ninst, int a)
+{
+ (void)ninst;
+ if(!dyn->insts)
+ return EXT_CACHE_ST_D;
+ for(int i=0; i<24; ++i)
+ if((dyn->e.extcache[i].t==EXT_CACHE_ST_F
+ || dyn->e.extcache[i].t==EXT_CACHE_ST_D)
+ && dyn->e.extcache[i].n==a)
+ return dyn->e.extcache[i].t;
+ // not in the cache yet, so will be fetched...
+ return EXT_CACHE_ST_D;
+}
+
+int extcache_get_st_f(dynarec_rv64_t* dyn, int ninst, int a)
+{
+ for(int i=0; i<24; ++i)
+ if(dyn->insts[ninst].e.extcache[i].t==EXT_CACHE_ST_F
+ && dyn->insts[ninst].e.extcache[i].n==a)
+ return i;
+ return -1;
+}
+int extcache_get_st_f_noback(dynarec_rv64_t* dyn, int ninst, int a)
+{
+ for(int i=0; i<24; ++i)
+ if(dyn->insts[ninst].e.extcache[i].t==EXT_CACHE_ST_F
+ && dyn->insts[ninst].e.extcache[i].n==a)
+ return i;
+ return -1;
+}
+int extcache_get_current_st_f(dynarec_rv64_t* dyn, int a)
+{
+ for(int i=0; i<24; ++i)
+ if(dyn->e.extcache[i].t==EXT_CACHE_ST_F
+ && dyn->e.extcache[i].n==a)
+ return i;
+ return -1;
+}
+
+static void extcache_promote_double_forward(dynarec_rv64_t* dyn, int ninst, int maxinst, int a);
+static void extcache_promote_double_internal(dynarec_rv64_t* dyn, int ninst, int maxinst, int a);
+static void extcache_promote_double_combined(dynarec_rv64_t* dyn, int ninst, int maxinst, int a)
+{
+ if(a == dyn->insts[ninst].e.combined1 || a == dyn->insts[ninst].e.combined2) {
+ if(a == dyn->insts[ninst].e.combined1) {
+ a = dyn->insts[ninst].e.combined2;
+ } else
+ a = dyn->insts[ninst].e.combined1;
+ int i = extcache_get_st_f_noback(dyn, ninst, a);
+ //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_combined, ninst=%d combined%c %d i=%d (stack:%d/%d)\n", ninst, (a == dyn->insts[ninst].e.combined2)?'2':'1', a ,i, dyn->insts[ninst].e.stack_push, -dyn->insts[ninst].e.stack_pop);
+ if(i>=0) {
+ dyn->insts[ninst].e.extcache[i].t = EXT_CACHE_ST_D;
+ if(!dyn->insts[ninst].e.barrier)
+ extcache_promote_double_internal(dyn, ninst-1, maxinst, a-dyn->insts[ninst].e.stack_push);
+ // go forward is combined is not pop'd
+ if(a-dyn->insts[ninst].e.stack_pop>=0)
+ if(!dyn->insts[ninst+1].e.barrier)
+ extcache_promote_double_forward(dyn, ninst+1, maxinst, a-dyn->insts[ninst].e.stack_pop);
+ }
+ }
+}
+static void extcache_promote_double_internal(dynarec_rv64_t* dyn, int ninst, int maxinst, int a)
+{
+ if(dyn->insts[ninst+1].e.barrier)
+ return;
+ while(ninst>=0) {
+ a+=dyn->insts[ninst].e.stack_pop; // adjust Stack depth: add pop'd ST (going backward)
+ int i = extcache_get_st_f(dyn, ninst, a);
+ //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_internal, ninst=%d, a=%d st=%d:%d, i=%d\n", ninst, a, dyn->insts[ninst].e.stack, dyn->insts[ninst].e.stack_next, i);
+ if(i<0) return;
+ dyn->insts[ninst].e.extcache[i].t = EXT_CACHE_ST_D;
+ // check combined propagation too
+ if(dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) {
+ if(dyn->insts[ninst].e.swapped) {
+ //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_internal, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack);
+ if (a==dyn->insts[ninst].e.combined1)
+ a = dyn->insts[ninst].e.combined2;
+ else if (a==dyn->insts[ninst].e.combined2)
+ a = dyn->insts[ninst].e.combined1;
+ } else {
+ //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_internal, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack);
+ extcache_promote_double_combined(dyn, ninst, maxinst, a);
+ }
+ }
+ a-=dyn->insts[ninst].e.stack_push; // // adjust Stack depth: remove push'd ST (going backward)
+ --ninst;
+ if(ninst<0 || a<0 || dyn->insts[ninst].e.barrier)
+ return;
+ }
+}
+
+static void extcache_promote_double_forward(dynarec_rv64_t* dyn, int ninst, int maxinst, int a)
+{
+ while((ninst!=-1) && (ninst<maxinst) && (a>=0)) {
+ a+=dyn->insts[ninst].e.stack_push; // // adjust Stack depth: add push'd ST (going forward)
+ if((dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) && dyn->insts[ninst].e.swapped) {
+ //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_forward, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack);
+ if (a==dyn->insts[ninst].e.combined1)
+ a = dyn->insts[ninst].e.combined2;
+ else if (a==dyn->insts[ninst].e.combined2)
+ a = dyn->insts[ninst].e.combined1;
+ }
+ int i = extcache_get_st_f_noback(dyn, ninst, a);
+ //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_forward, ninst=%d, a=%d st=%d:%d(%d/%d), i=%d\n", ninst, a, dyn->insts[ninst].e.stack, dyn->insts[ninst].e.stack_next, dyn->insts[ninst].e.stack_push, -dyn->insts[ninst].e.stack_pop, i);
+ if(i<0) return;
+ dyn->insts[ninst].e.extcache[i].t = EXT_CACHE_ST_D;
+ // check combined propagation too
+ if((dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) && !dyn->insts[ninst].e.swapped) {
+ //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_forward, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack);
+ extcache_promote_double_combined(dyn, ninst, maxinst, a);
+ }
+ a-=dyn->insts[ninst].e.stack_pop; // adjust Stack depth: remove pop'd ST (going forward)
+ if(dyn->insts[ninst].x64.has_next && !dyn->insts[ninst].e.barrier)
+ ++ninst;
+ else
+ ninst=-1;
+ }
+ if(ninst==maxinst)
+ extcache_promote_double(dyn, ninst, a);
+}
+
+void extcache_promote_double(dynarec_rv64_t* dyn, int ninst, int a)
+{
+ int i = extcache_get_current_st_f(dyn, a);
+ //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double, ninst=%d a=%d st=%d i=%d\n", ninst, a, dyn->e.stack, i);
+ if(i<0) return;
+ dyn->e.extcache[i].t = EXT_CACHE_ST_D;
+ dyn->insts[ninst].e.extcache[i].t = EXT_CACHE_ST_D;
+ // check combined propagation too
+ if(dyn->e.combined1 || dyn->e.combined2) {
+ if(dyn->e.swapped) {
+ //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double, ninst=%d swapped! %d/%d vs %d\n", ninst, dyn->e.combined1 ,dyn->e.combined2, a);
+ if(dyn->e.combined1 == a)
+ a = dyn->e.combined2;
+ else if(dyn->e.combined2 == a)
+ a = dyn->e.combined1;
+ } else {
+ //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double, ninst=%d combined! %d/%d vs %d\n", ninst, dyn->e.combined1 ,dyn->e.combined2, a);
+ if(dyn->e.combined1 == a)
+ extcache_promote_double(dyn, ninst, dyn->e.combined2);
+ else if(dyn->e.combined2 == a)
+ extcache_promote_double(dyn, ninst, dyn->e.combined1);
+ }
+ }
+ a-=dyn->insts[ninst].e.stack_push; // // adjust Stack depth: remove push'd ST (going backward)
+ if(!ninst || a<0) return;
+ extcache_promote_double_internal(dyn, ninst-1, ninst, a);
+}
+
+int extcache_combine_st(dynarec_rv64_t* dyn, int ninst, int a, int b)
+{
+ dyn->e.combined1=a;
+ dyn->e.combined2=b;
+ if( extcache_get_current_st(dyn, ninst, a)==EXT_CACHE_ST_F
+ && extcache_get_current_st(dyn, ninst, b)==EXT_CACHE_ST_F )
+ return EXT_CACHE_ST_F;
+ return EXT_CACHE_ST_D;
+}
+
+static int isCacheEmpty(dynarec_native_t* dyn, int ninst) {
+ if(dyn->insts[ninst].e.stack_next) {
+ return 0;
+ }
+ for(int i=0; i<24; ++i)
+ if(dyn->insts[ninst].e.extcache[i].v) { // there is something at ninst for i
+ if(!(
+ (dyn->insts[ninst].e.extcache[i].t==EXT_CACHE_ST_F || dyn->insts[ninst].e.extcache[i].t==EXT_CACHE_ST_D)
+ && dyn->insts[ninst].e.extcache[i].n<dyn->insts[ninst].e.stack_pop))
+ return 0;
+ }
+ return 1;
+
+}
+
+int fpuCacheNeedsTransform(dynarec_rv64_t* dyn, int ninst) {
+ int i2 = dyn->insts[ninst].x64.jmp_insts;
+ if(i2<0)
+ return 1;
+ if((dyn->insts[i2].x64.barrier&BARRIER_FLOAT))
+ // if the barrier as already been apply, no transform needed
+ return ((dyn->insts[ninst].x64.barrier&BARRIER_FLOAT))?0:(isCacheEmpty(dyn, ninst)?0:1);
+ int ret = 0;
+ if(!i2) { // just purge
+ if(dyn->insts[ninst].e.stack_next) {
+ return 1;
+ }
+ for(int i=0; i<24 && !ret; ++i)
+ if(dyn->insts[ninst].e.extcache[i].v) { // there is something at ninst for i
+ if(!(
+ (dyn->insts[ninst].e.extcache[i].t==EXT_CACHE_ST_F || dyn->insts[ninst].e.extcache[i].t==EXT_CACHE_ST_D)
+ && dyn->insts[ninst].e.extcache[i].n<dyn->insts[ninst].e.stack_pop))
+ ret = 1;
+ }
+ return ret;
+ }
+ // Check if ninst can be compatible to i2
+ if(dyn->insts[ninst].e.stack_next != dyn->insts[i2].e.stack-dyn->insts[i2].e.stack_push) {
+ return 1;
+ }
+ extcache_t cache_i2 = dyn->insts[i2].e;
+ extcacheUnwind(&cache_i2);
+
+ for(int i=0; i<24; ++i) {
+ if(dyn->insts[ninst].e.extcache[i].v) { // there is something at ninst for i
+ if(!cache_i2.extcache[i].v) { // but there is nothing at i2 for i
+ ret = 1;
+ } else if(dyn->insts[ninst].e.extcache[i].v!=cache_i2.extcache[i].v) { // there is something different
+ ret = 1;
+ }
+ } else if(cache_i2.extcache[i].v)
+ ret = 1;
+ }
+ return ret;
+}
+
+void extcacheUnwind(extcache_t* cache)
+{
+ if(cache->swapped) {
+ // unswap
+ int a = -1;
+ int b = -1;
+ for(int j=0; j<24 && ((a==-1) || (b==-1)); ++j)
+ if((cache->extcache[j].t == EXT_CACHE_ST_D || cache->extcache[j].t == EXT_CACHE_ST_F)) {
+ if(cache->extcache[j].n == cache->combined1)
+ a = j;
+ else if(cache->extcache[j].n == cache->combined2)
+ b = j;
+ }
+ if(a!=-1 && b!=-1) {
+ int tmp = cache->extcache[a].n;
+ cache->extcache[a].n = cache->extcache[b].n;
+ cache->extcache[b].n = tmp;
+ }
+ cache->swapped = 0;
+ cache->combined1 = cache->combined2 = 0;
+ }
+ if(cache->news) {
+ // remove the newly created extcache
+ for(int i=0; i<24; ++i)
+ if(cache->news&(1<<i))
+ cache->extcache[i].v = 0;
+ cache->news = 0;
+ }
+ // add/change bad regs
+ for(int i=0; i<16; ++i) {
+ if(cache->olds[i].changed) {
+ cache->extcache[i].t = cache->olds[i].single?EXT_CACHE_SS:EXT_CACHE_SD;
+ } else if(cache->olds[i].purged) {
+ cache->extcache[i].n = i;
+ cache->extcache[i].t = cache->olds[i].single?EXT_CACHE_SS:EXT_CACHE_SD;
+ }
+ }
+ if(cache->stack_push) {
+ // unpush
+ for(int j=0; j<24; ++j) {
+ if((cache->extcache[j].t == EXT_CACHE_ST_D || cache->extcache[j].t == EXT_CACHE_ST_F)) {
+ if(cache->extcache[j].n<cache->stack_push)
+ cache->extcache[j].v = 0;
+ else
+ cache->extcache[j].n-=cache->stack_push;
+ }
+ }
+ cache->x87stack-=cache->stack_push;
+ cache->stack-=cache->stack_push;
+ cache->stack_push = 0;
+ }
+ cache->x87stack+=cache->stack_pop;
+ cache->stack_next = cache->stack;
+ cache->stack_pop = 0;
+ cache->barrier = 0;
+ // And now, rebuild the x87cache info with extcache
+ cache->mmxcount = 0;
+ cache->fpu_scratch = 0;
+ cache->fpu_extra_qscratch = 0;
+ cache->fpu_reg = 0;
+ for(int i=0; i<8; ++i) {
+ cache->x87cache[i] = -1;
+ cache->mmxcache[i] = -1;
+ cache->x87reg[i] = 0;
+ cache->ssecache[i*2].v = -1;
+ cache->ssecache[i*2+1].v = -1;
+ }
+ int x87reg = 0;
+ for(int i=0; i<24; ++i) {
+ if(cache->extcache[i].v) {
+ cache->fpuused[i] = 1;
+ switch (cache->extcache[i].t) {
+ case EXT_CACHE_MM:
+ cache->mmxcache[cache->extcache[i].n] = EXTREG(i);
+ ++cache->mmxcount;
+ ++cache->fpu_reg;
+ break;
+ case EXT_CACHE_SS:
+ cache->ssecache[cache->extcache[i].n].reg = EXTREG(i);
+ cache->ssecache[cache->extcache[i].n].single = 1;
+ ++cache->fpu_reg;
+ break;
+ case EXT_CACHE_SD:
+ cache->ssecache[cache->extcache[i].n].reg = EXTREG(i);
+ cache->ssecache[cache->extcache[i].n].single = 0;
+ ++cache->fpu_reg;
+ break;
+ case EXT_CACHE_ST_F:
+ case EXT_CACHE_ST_D:
+ cache->x87cache[x87reg] = cache->extcache[i].n;
+ cache->x87reg[x87reg] = EXTREG(i);
+ ++x87reg;
+ ++cache->fpu_reg;
+ break;
+ case EXT_CACHE_SCR:
+ cache->fpuused[i] = 0;
+ cache->extcache[i].v = 0;
+ break;
+ }
+ } else {
+ cache->fpuused[i] = 0;
+ }
+ }
+}
+
+
+uint8_t extract_byte(uint32_t val, void* address){
+ int idx = (((uintptr_t)address)&3)*8;
+ return (val>>idx)&0xff;
+}
+uint32_t insert_byte(uint32_t val, uint8_t b, void* address){
+ int idx = (((uintptr_t)address)&3)*8;
+ val&=~(0xff<<idx);
+ val|=(((uint32_t)b)<<idx);
+ return val;
+}
+
+// will go badly if address is unaligned
+uint16_t extract_half(uint32_t val, void* address){
+ int idx = (((uintptr_t)address)&3)*8;
+ return (val>>idx)&0xffff;
+}
+uint32_t insert_half(uint32_t val, uint16_t h, void* address){
+ int idx = (((uintptr_t)address)&3)*8;
+ val&=~(0xffff<<idx);
+ val|=(((uint32_t)h)<<idx);
+ return val;
+}
+
+uint8_t rv64_lock_xchg_b(void* addr, uint8_t val)
+{
+ uint32_t ret;
+ uint32_t* aligned = (uint32_t*)(((uintptr_t)addr)&~3);
+ do {
+ ret = *aligned;
+ } while(rv64_lock_cas_d(aligned, ret, insert_byte(ret, val, addr)));
+ return extract_byte(ret, addr);
+}
+
+int rv64_lock_cas_b(void* addr, uint8_t ref, uint8_t val)
+{
+ uint32_t* aligned = (uint32_t*)(((uintptr_t)addr)&~3);
+ uint32_t tmp = *aligned;
+ return rv64_lock_cas_d(aligned, tmp, insert_byte(tmp, val, addr));
+}
+
+int rv64_lock_cas_h(void* addr, uint16_t ref, uint16_t val)
+{
+ uint32_t* aligned = (uint32_t*)(((uintptr_t)addr)&~3);
+ uint32_t tmp = *aligned;
+ return rv64_lock_cas_d(aligned, tmp, insert_half(tmp, val, addr));
+}
+
+
+const char* getCacheName(int t, int n)
+{
+ static char buff[20];
+ switch(t) {
+ case EXT_CACHE_ST_D: sprintf(buff, "ST%d", n); break;
+ case EXT_CACHE_ST_F: sprintf(buff, "st%d", n); break;
+ case EXT_CACHE_MM: sprintf(buff, "MM%d", n); break;
+ case EXT_CACHE_SS: sprintf(buff, "SS%d", n); break;
+ case EXT_CACHE_SD: sprintf(buff, "SD%d", n); break;
+ case EXT_CACHE_SCR: sprintf(buff, "Scratch"); break;
+ case EXT_CACHE_NONE: buff[0]='\0'; break;
+ }
+ return buff;
+}
+
+void inst_name_pass3(dynarec_native_t* dyn, int ninst, const char* name, rex_t rex)
+{
+ static const char* fnames[] = {
+ "ft0"," ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7",
+ "fs0", "fs1",
+ "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", "fa6", "fa7",
+ "fs2", "fs3", "fs4", "fs5", "fs6", "fs7", "fs8", "fs9", "fs10", "fs11",
+ "ft8", "ft9", "ft10", "ft11"
+ };
+ if(box64_dynarec_dump) {
+ printf_x64_instruction(rex.is32bits?my_context->dec32:my_context->dec, &dyn->insts[ninst].x64, name);
+ dynarec_log(LOG_NONE, "%s%p: %d emitted opcodes, inst=%d, barrier=%d state=%d/%d(%d), %s=%X/%X, use=%X, need=%X/%X, sm=%d/%d",
+ (box64_dynarec_dump>1)?"\e[32m":"",
+ (void*)(dyn->native_start+dyn->insts[ninst].address),
+ dyn->insts[ninst].size/4,
+ ninst,
+ dyn->insts[ninst].x64.barrier,
+ dyn->insts[ninst].x64.state_flags,
+ dyn->f.pending,
+ dyn->f.dfnone,
+ dyn->insts[ninst].x64.may_set?"may":"set",
+ dyn->insts[ninst].x64.set_flags,
+ dyn->insts[ninst].x64.gen_flags,
+ dyn->insts[ninst].x64.use_flags,
+ dyn->insts[ninst].x64.need_before,
+ dyn->insts[ninst].x64.need_after,
+ dyn->smread, dyn->smwrite);
+ if(dyn->insts[ninst].pred_sz) {
+ dynarec_log(LOG_NONE, ", pred=");
+ for(int ii=0; ii<dyn->insts[ninst].pred_sz; ++ii)
+ dynarec_log(LOG_NONE, "%s%d", ii?"/":"", dyn->insts[ninst].pred[ii]);
+ }
+ if(dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts>=0)
+ dynarec_log(LOG_NONE, ", jmp=%d", dyn->insts[ninst].x64.jmp_insts);
+ if(dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts==-1)
+ dynarec_log(LOG_NONE, ", jmp=out");
+ if(dyn->last_ip)
+ dynarec_log(LOG_NONE, ", last_ip=%p", (void*)dyn->last_ip);
+ for(int ii=0; ii<24; ++ii) {
+ switch(dyn->insts[ninst].e.extcache[ii].t) {
+ case EXT_CACHE_ST_D: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break;
+ case EXT_CACHE_ST_F: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break;
+ case EXT_CACHE_MM: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break;
+ case EXT_CACHE_SS: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break;
+ case EXT_CACHE_SD: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break;
+ case EXT_CACHE_SCR: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break;
+ case EXT_CACHE_NONE:
+ default: break;
+ }
+ }
+ if(dyn->e.stack || dyn->insts[ninst].e.stack_next || dyn->insts[ninst].e.x87stack)
+ dynarec_log(LOG_NONE, " X87:%d/%d(+%d/-%d)%d", dyn->e.stack, dyn->insts[ninst].e.stack_next, dyn->insts[ninst].e.stack_push, dyn->insts[ninst].e.stack_pop, dyn->insts[ninst].e.x87stack);
+ if(dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2)
+ dynarec_log(LOG_NONE, " %s:%d/%d", dyn->insts[ninst].e.swapped?"SWP":"CMB", dyn->insts[ninst].e.combined1, dyn->insts[ninst].e.combined2);
+ dynarec_log(LOG_NONE, "%s\n", (box64_dynarec_dump>1)?"\e[m":"");
+ }
+}
+
+void print_opcode(dynarec_native_t* dyn, int ninst, uint32_t opcode)
+{
+ dynarec_log(LOG_NONE, "\t%08x\t%s\n", opcode, rv64_print(opcode, (uintptr_t)dyn->block));
+}
+
+void print_newinst(dynarec_native_t* dyn, int ninst)
+{
+ dynarec_log(LOG_NONE, "%sNew instruction %d, native=%p (0x%x)%s\n",
+ (box64_dynarec_dump>1)?"\e[4;32m":"",
+ ninst, dyn->block, dyn->native_size,
+ (box64_dynarec_dump>1)?"\e[m":""
+ );
+} \ No newline at end of file
diff --git a/src/dynarec/rv64/dynarec_rv64_functions.h b/src/dynarec/rv64/dynarec_rv64_functions.h
new file mode 100644
index 0000000..451336b
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_functions.h
@@ -0,0 +1,52 @@
+#ifndef __DYNAREC_RV64_FUNCTIONS_H__
+#define __DYNAREC_RV64_FUNCTIONS_H__
+
+#include "../dynarec_native_functions.h"
+
+typedef struct x64emu_s x64emu_t;
+typedef struct dynarec_rv64_s dynarec_rv64_t;
+
+#define SCRATCH0 2
+
+// Get an FPU scratch reg
+int fpu_get_scratch(dynarec_rv64_t* dyn);
+// Reset scratch regs counter
+void fpu_reset_scratch(dynarec_rv64_t* dyn);
+// Get an x87 double reg
+int fpu_get_reg_x87(dynarec_rv64_t* dyn, int t, int n);
+// Get an MMX double reg
+int fpu_get_reg_emm(dynarec_rv64_t* dyn, int emm);
+// Get an XMM quad reg
+int fpu_get_reg_xmm(dynarec_rv64_t* dyn, int t, int xmm);
+// Free a FPU/MMX/XMM reg
+void fpu_free_reg(dynarec_rv64_t* dyn, int reg);
+// Reset fpu regs counter
+void fpu_reset_reg(dynarec_rv64_t* dyn);
+
+// ---- Neon cache functions
+// Get type for STx
+int extcache_get_st(dynarec_rv64_t* dyn, int ninst, int a);
+// Get if STx is FLOAT or DOUBLE
+int extcache_get_st_f(dynarec_rv64_t* dyn, int ninst, int a);
+// Get actual type for STx
+int extcache_get_current_st(dynarec_rv64_t* dyn, int ninst, int a);
+// Get actual STx is FLOAT or DOUBLE
+int extcache_get_current_st_f(dynarec_rv64_t* dyn, int a);
+// Back-propagate a change float->double
+void extcache_promote_double(dynarec_rv64_t* dyn, int ninst, int a);
+// Combine and propagate if needed (pass 1 only)
+int extcache_combine_st(dynarec_rv64_t* dyn, int ninst, int a, int b); // with stack current dyn->n_stack*
+
+// FPU Cache transformation (for loops) // Specific, need to be written par backend
+int fpuCacheNeedsTransform(dynarec_rv64_t* dyn, int ninst);
+
+// Undo the changes of a extcache to get the status before the instruction
+void extcacheUnwind(extcache_t* cache);
+
+const char* getCacheName(int t, int n);
+
+void inst_name_pass3(dynarec_native_t* dyn, int ninst, const char* name, rex_t rex);
+void print_opcode(dynarec_native_t* dyn, int ninst, uint32_t opcode);
+void print_newinst(dynarec_native_t* dyn, int ninst);
+
+#endif //__DYNAREC_RV64_FUNCTIONS_H__
diff --git a/src/dynarec/rv64/dynarec_rv64_helper.c b/src/dynarec/rv64/dynarec_rv64_helper.c
new file mode 100644
index 0000000..a005c3b
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_helper.c
@@ -0,0 +1,2174 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+#include <assert.h>
+#include <string.h>
+
+#include "bitutils.h"
+#include "debug.h"
+#include "box64context.h"
+#include "dynarec.h"
+#include "emu/x64emu_private.h"
+#include "emu/x64run_private.h"
+#include "x64run.h"
+#include "x64emu.h"
+#include "box64stack.h"
+#include "callback.h"
+#include "emu/x64run_private.h"
+#include "x64trace.h"
+#include "dynarec_native.h"
+#include "../dynablock_private.h"
+#include "custommem.h"
+
+#include "rv64_printer.h"
+#include "dynarec_rv64_private.h"
+#include "dynarec_rv64_functions.h"
+#include "dynarec_rv64_helper.h"
+
+static uintptr_t geted_32(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, int *l, int i12);
+
+/* setup r2 to address pointed by ED, also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */
+uintptr_t geted(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int *l, int i12, int delta)
+{
+ MAYUSE(dyn); MAYUSE(ninst); MAYUSE(delta);
+
+ if(rex.is32bits)
+ return geted_32(dyn, addr, ninst, nextop, ed, hint, scratch, fixaddress, l, i12);
+
+ int lock = l?((l==LOCK_LOCK)?1:2):0;
+ if(lock==2)
+ *l = 0;
+ uint8_t ret = x2;
+ *fixaddress = 0;
+ if(hint>0) ret = hint;
+ int maxval = 2047;
+ if(i12>1)
+ maxval -= i12;
+ MAYUSE(scratch);
+ if(!(nextop&0xC0)) {
+ if((nextop&7)==4) {
+ uint8_t sib = F8;
+ int sib_reg = ((sib>>3)&7)+(rex.x<<3);
+ int sib_reg2 = (sib&0x7)+(rex.b<<3);
+ if((sib&0x7)==5) {
+ int64_t tmp = F32S;
+ if (sib_reg!=4) {
+ if(tmp && ((tmp<-2048) || (tmp>maxval) || !i12)) {
+ MOV64x(scratch, tmp);
+ if((sib>>6)) {
+ if(rv64_zba) {
+ SHxADD(ret, xRAX+sib_reg, sib>>6, scratch);
+ } else {
+ SLLI(ret, xRAX+sib_reg, (sib>>6));
+ ADD(ret, ret, scratch);
+ }
+ } else {
+ ADD(ret, xRAX+sib_reg, scratch);
+ }
+ } else {
+ if(sib>>6) {
+ SLLI(ret, xRAX+sib_reg, (sib>>6));
+ } else
+ ret = xRAX+sib_reg;
+ *fixaddress = tmp;
+ }
+ } else {
+ switch(lock) {
+ case 1: addLockAddress(tmp); break;
+ case 2: if(isLockAddress(tmp)) *l=1; break;
+ }
+ MOV64x(ret, tmp);
+ }
+ } else {
+ if (sib_reg!=4) {
+ if(sib>>6) {
+ if(rv64_zba) {
+ SHxADD(ret, xRAX+sib_reg, sib>>6, xRAX+sib_reg2);
+ } else {
+ SLLI(scratch, xRAX+sib_reg, (sib>>6));
+ ADD(ret, xRAX+sib_reg2, scratch);
+ }
+ } else {
+ ADD(ret, xRAX+sib_reg2, xRAX+sib_reg);
+ }
+ } else {
+ ret = xRAX+sib_reg2;
+ }
+ }
+ } else if((nextop&7)==5) {
+ int64_t tmp = F32S64;
+ int64_t adj = dyn->last_ip?((addr+delta)-dyn->last_ip):0;
+ if(i12 && adj && (tmp+adj>=-2048) && (tmp+adj<=maxval)) {
+ ret = xRIP;
+ *fixaddress = tmp+adj;
+ } else if(i12 && (tmp>=-2048) && (tmp<=maxval)) {
+ GETIP(addr+delta);
+ ret = xRIP;
+ *fixaddress = tmp;
+ } else if(adj && (tmp+adj>=-2048) && (tmp+adj<=maxval)) {
+ ADDI(ret, xRIP, tmp+adj);
+ } else if((tmp>=-2048) && (tmp<=maxval)) {
+ GETIP(addr+delta);
+ ADDI(ret, xRIP, tmp);
+ } else if(tmp+addr+delta<0x100000000LL) {
+ MOV64x(ret, tmp+addr+delta);
+ } else {
+ if(adj) {
+ MOV64x(ret, tmp+adj);
+ } else {
+ MOV64x(ret, tmp);
+ GETIP(addr+delta);
+ }
+ ADD(ret, ret, xRIP);
+ }
+ switch(lock) {
+ case 1: addLockAddress(addr+delta+tmp); break;
+ case 2: if(isLockAddress(addr+delta+tmp)) *l=1; break;
+ }
+ } else {
+ ret = xRAX+(nextop&7)+(rex.b<<3);
+ }
+ } else {
+ int64_t i64;
+ uint8_t sib = 0;
+ int sib_reg = 0;
+ if((nextop&7)==4) {
+ sib = F8;
+ sib_reg = ((sib>>3)&7)+(rex.x<<3);
+ }
+ int sib_reg2 = (sib&0x07)+(rex.b<<3);
+ if(nextop&0x80)
+ i64 = F32S;
+ else
+ i64 = F8S;
+ if(i64==0 || ((i64>=-2048) && (i64<=2047) && i12)) {
+ *fixaddress = i64;
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ if(sib>>6) {
+ if(rv64_zba) {
+ SHxADD(ret, xRAX+sib_reg, sib>>6, xRAX+sib_reg2);
+ } else {
+ SLLI(scratch, xRAX+sib_reg, (sib>>6));
+ ADD(ret, xRAX+sib_reg2, scratch);
+ }
+ } else {
+ ADD(ret, xRAX+sib_reg2, xRAX+sib_reg);
+ }
+ } else {
+ ret = xRAX+sib_reg2;
+ }
+ } else
+ ret = xRAX+(nextop&0x07)+(rex.b<<3);
+ } else {
+ if(i64>=-2048 && i64<=2047) {
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ if(sib>>6) {
+ if(rv64_zba) {
+ SHxADD(scratch, xRAX+sib_reg, sib>>6, xRAX+sib_reg2);
+ } else {
+ SLLI(scratch, xRAX+sib_reg, (sib>>6));
+ ADD(scratch, xRAX+sib_reg2, scratch);
+ }
+ } else {
+ ADD(scratch, xRAX+sib_reg2, xRAX+sib_reg);
+ }
+ } else {
+ scratch = xRAX+sib_reg2;
+ }
+ } else
+ scratch = xRAX+(nextop&0x07)+(rex.b<<3);
+ ADDI(ret, scratch, i64);
+ } else {
+ MOV64x(scratch, i64);
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ ADD(scratch, scratch, xRAX+sib_reg2);
+ if(sib>>6) {
+ if(rv64_zba) {
+ SHxADD(ret, xRAX+sib_reg, sib>>6, scratch);
+ } else {
+ SLLI(ret, xRAX+sib_reg, (sib>>6));
+ ADD(ret, scratch, ret);
+ }
+ } else {
+ ADD(ret, scratch, xRAX+sib_reg);
+ }
+ } else {
+ PASS3(int tmp = xRAX+sib_reg2);
+ ADD(ret, tmp, scratch);
+ }
+ } else {
+ PASS3(int tmp = xRAX+(nextop&0x07)+(rex.b<<3));
+ ADD(ret, tmp, scratch);
+ }
+ }
+ }
+ }
+ *ed = ret;
+ return addr;
+}
+
+static uintptr_t geted_32(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, int *l, int i12)
+{
+ MAYUSE(dyn); MAYUSE(ninst);
+
+ int lock = l?((l==LOCK_LOCK)?1:2):0;
+ if(lock==2)
+ *l = 0;
+ uint8_t ret = x2;
+ *fixaddress = 0;
+ if(hint>0) ret = hint;
+ int maxval = 2047;
+ if(i12>1)
+ maxval -= i12;
+ MAYUSE(scratch);
+ if(!(nextop&0xC0)) {
+ if((nextop&7)==4) {
+ uint8_t sib = F8;
+ int sib_reg = (sib>>3)&0x7;
+ int sib_reg2 = sib&0x7;
+ if(sib_reg2==5) {
+ int64_t tmp = F32S;
+ if (sib_reg!=4) {
+ if(tmp && ((tmp<-2048) || (tmp>maxval) || !i12)) {
+ MOV32w(scratch, tmp);
+ if((sib>>6)) {
+ if(rv64_zba) SHxADDUW(ret, xRAX+sib_reg, (sib>>6), scratch); else {SLLI(ret, xRAX+sib_reg, sib>>6); ADDW(ret, ret, scratch);}
+ } else
+ ADDW(ret, xRAX+sib_reg, scratch);
+ } else {
+ if(sib>>6)
+ SLLI(ret, xRAX+sib_reg, (sib>>6));
+ else
+ ret = xRAX+sib_reg;
+ *fixaddress = tmp;
+ }
+ } else {
+ switch(lock) {
+ case 1: addLockAddress((int32_t)tmp); break;
+ case 2: if(isLockAddress((int32_t)tmp)) *l=1; break;
+ }
+ MOV32w(ret, tmp);
+ }
+ } else {
+ if (sib_reg!=4) {
+ if((sib>>6)) {
+ if(rv64_zba) SHxADDUW(ret, xRAX+sib_reg, (sib>>6), xRAX+sib_reg2); else { SLLI(ret, xRAX+sib_reg, (sib>>6)); ADDW(ret, ret, xRAX+sib_reg2);}
+ } else
+ ADDW(ret, xRAX+sib_reg2, xRAX+sib_reg);
+ } else {
+ ret = xRAX+sib_reg2;
+ }
+ }
+ } else if((nextop&7)==5) {
+ uint32_t tmp = F32;
+ MOV32w(ret, tmp);
+ switch(lock) {
+ case 1: addLockAddress(tmp); break;
+ case 2: if(isLockAddress(tmp)) *l=1; break;
+ }
+ } else {
+ ret = xRAX+(nextop&7);
+ if(ret==hint) {
+ AND(hint, ret, xMASK); //to clear upper part
+ }
+ }
+ } else {
+ int64_t i32;
+ uint8_t sib = 0;
+ int sib_reg = 0;
+ if((nextop&7)==4) {
+ sib = F8;
+ sib_reg = (sib>>3)&7;
+ }
+ int sib_reg2 = sib&0x07;
+ if(nextop&0x80)
+ i32 = F32S;
+ else
+ i32 = F8S;
+ if(i32==0 || ((i32>=-2048) && (i32<=2047) && i12)) {
+ *fixaddress = i32;
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ if(sib>>6) {
+ if(rv64_zba) SHxADDUW(ret, xRAX+sib_reg, (sib>>6), xRAX+sib_reg2); else {SLLI(ret, xRAX+sib_reg, (sib>>6)); ADDW(ret, ret, xRAX+sib_reg2);}
+ } else
+ ADDW(ret, xRAX+sib_reg2, xRAX+sib_reg);
+ } else {
+ ret = xRAX+sib_reg2;
+ }
+ } else {
+ ret = xRAX+(nextop&0x07);
+ }
+ } else {
+ if(i32>=-2048 && i32<=2047) {
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ if(sib>>6) {
+ if(rv64_zba) SHxADDUW(scratch, xRAX+sib_reg, (sib>>6), xRAX+sib_reg2); else {SLLI(scratch, xRAX+sib_reg, sib>>6); ADDW(scratch, scratch, xRAX+sib_reg2);}
+ } else
+ ADDW(scratch, xRAX+sib_reg2, xRAX+sib_reg);
+ } else {
+ scratch = xRAX+sib_reg2;
+ }
+ } else
+ scratch = xRAX+(nextop&0x07);
+ ADDIW(ret, scratch, i32);
+ } else {
+ MOV32w(scratch, i32);
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ ADDW(scratch, scratch, xRAX+sib_reg2);
+ if(sib>>6) {
+ if(rv64_zba) SHxADDUW(ret, xRAX+sib_reg, (sib>>6), scratch); else {SLLI(ret, xRAX+sib_reg, (sib>>6)); ADDW(ret, ret, scratch);}
+ } else
+ ADDW(ret, scratch, xRAX+sib_reg);
+ } else {
+ PASS3(int tmp = xRAX+sib_reg2);
+ ADDW(ret, tmp, scratch);
+ }
+ } else {
+ PASS3(int tmp = xRAX+(nextop&0x07));
+ ADDW(ret, tmp, scratch);
+ }
+ }
+ }
+ }
+ *ed = ret;
+ return addr;
+}
+
+/* setup r2 to address pointed by ED, also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */
+uintptr_t geted32(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int *l, int i12, int delta)
+{
+ MAYUSE(dyn); MAYUSE(ninst); MAYUSE(delta);
+
+ int lock = l?((l==LOCK_LOCK)?1:2):0;
+ if(lock==2)
+ *l = 0;
+ uint8_t ret = x2;
+ *fixaddress = 0;
+ if(hint>0) ret = hint;
+ int maxval = 2047;
+ if(i12>1)
+ maxval -= i12;
+ MAYUSE(scratch);
+ if(!(nextop&0xC0)) {
+ if((nextop&7)==4) {
+ uint8_t sib = F8;
+ int sib_reg = ((sib>>3)&0x7)+(rex.x<<3);
+ int sib_reg2 = (sib&0x7)+(rex.b<<3);
+ if((sib&0x7)==5) {
+ int64_t tmp = F32S;
+ if (sib_reg!=4) {
+ if(tmp && ((tmp<-2048) || (tmp>maxval) || !i12)) {
+ MOV64x(scratch, tmp);
+ if((sib>>6)) {
+ if(rv64_zba) SHxADDUW(ret, xRAX+sib_reg, (sib>>6), scratch); else {SLLI(ret, xRAX+sib_reg, sib>>6); ADDW(ret, ret, scratch);}
+ } else
+ ADDW(ret, xRAX+sib_reg, scratch);
+ } else {
+ if(sib>>6)
+ SLLI(ret, xRAX+sib_reg, (sib>>6));
+ else
+ ret = xRAX+sib_reg;
+ *fixaddress = tmp;
+ }
+ } else {
+ switch(lock) {
+ case 1: addLockAddress(tmp); break;
+ case 2: if(isLockAddress(tmp)) *l=1; break;
+ }
+ MOV64x(ret, tmp);
+ }
+ } else {
+ if (sib_reg!=4) {
+ if((sib>>6)) {
+ if(rv64_zba) SHxADDUW(ret, xRAX+sib_reg, (sib>>6), xRAX+sib_reg2); else { SLLI(ret, xRAX+sib_reg, (sib>>6)); ADDW(ret, ret, xRAX+sib_reg2);}
+ } else
+ ADDW(ret, xRAX+sib_reg2, xRAX+sib_reg);
+ } else {
+ ret = xRAX+sib_reg2;
+ }
+ }
+ } else if((nextop&7)==5) {
+ uint32_t tmp = F32;
+ MOV32w(ret, tmp);
+ GETIP(addr+delta);
+ ADDW(ret, ret, xRIP);
+ switch(lock) {
+ case 1: addLockAddress(addr+delta+tmp); break;
+ case 2: if(isLockAddress(addr+delta+tmp)) *l=1; break;
+ }
+ } else {
+ ret = xRAX+(nextop&7)+(rex.b<<3);
+ if(ret==hint) {
+ AND(hint, ret, xMASK); //to clear upper part
+ }
+ }
+ } else {
+ int64_t i64;
+ uint8_t sib = 0;
+ int sib_reg = 0;
+ if((nextop&7)==4) {
+ sib = F8;
+ sib_reg = ((sib>>3)&7)+(rex.x<<3);
+ }
+ int sib_reg2 = (sib&0x07)+(rex.b<<3);
+ if(nextop&0x80)
+ i64 = F32S;
+ else
+ i64 = F8S;
+ if(i64==0 || ((i64>=-2048) && (i64<=2047) && i12)) {
+ *fixaddress = i64;
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ if(sib>>6) {
+ if(rv64_zba) SHxADDUW(ret, xRAX+sib_reg, (sib>>6), xRAX+sib_reg2); else {SLLI(ret, xRAX+sib_reg, (sib>>6)); ADDW(ret, ret, xRAX+sib_reg2);}
+ } else
+ ADDW(ret, xRAX+sib_reg2, xRAX+sib_reg);
+ } else {
+ ret = xRAX+sib_reg2;
+ }
+ } else {
+ ret = xRAX+(nextop&0x07)+(rex.b<<3);
+ }
+ } else {
+ if(i64>=-2048 && i64<=2047) {
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ if(sib>>6) {
+ if(rv64_zba) SHxADDUW(scratch, xRAX+sib_reg, (sib>>6), xRAX+sib_reg2); else {SLLI(scratch, xRAX+sib_reg, sib>>6); ADDW(scratch, scratch, xRAX+sib_reg2);}
+ } else
+ ADDW(scratch, xRAX+sib_reg2, xRAX+sib_reg);
+ } else {
+ scratch = xRAX+sib_reg2;
+ }
+ } else
+ scratch = xRAX+(nextop&0x07)+(rex.b<<3);
+ ADDIW(ret, scratch, i64);
+ } else {
+ MOV32w(scratch, i64);
+ if((nextop&7)==4) {
+ if (sib_reg!=4) {
+ ADDW(scratch, scratch, xRAX+sib_reg2);
+ if(sib>>6) {
+ if(rv64_zba) SHxADDUW(ret, xRAX+sib_reg, (sib>>6), scratch); else {SLLI(ret, xRAX+sib_reg, (sib>>6)); ADDW(ret, ret, scratch);}
+ } else
+ ADDW(ret, scratch, xRAX+sib_reg);
+ } else {
+ PASS3(int tmp = xRAX+sib_reg2);
+ ADDW(ret, tmp, scratch);
+ }
+ } else {
+ PASS3(int tmp = xRAX+(nextop&0x07)+(rex.b<<3));
+ ADDW(ret, tmp, scratch);
+ }
+ }
+ }
+ }
+ *ed = ret;
+ return addr;
+}
+
+void jump_to_epilog(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst)
+{
+ MAYUSE(dyn); MAYUSE(ip); MAYUSE(ninst);
+ MESSAGE(LOG_DUMP, "Jump to epilog\n");
+
+ if(reg) {
+ if(reg!=xRIP) {
+ MV(xRIP, reg);
+ }
+ } else {
+ GETIP_(ip);
+ }
+ TABLE64(x2, (uintptr_t)rv64_epilog);
+ SMEND();
+ BR(x2);
+}
+
+void jump_to_epilog_fast(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst)
+{
+ MAYUSE(dyn); MAYUSE(ip); MAYUSE(ninst);
+ MESSAGE(LOG_DUMP, "Jump to epilog_fast\n");
+
+ if(reg) {
+ if(reg!=xRIP) {
+ MV(xRIP, reg);
+ }
+ } else {
+ GETIP_(ip);
+ }
+ TABLE64(x2, (uintptr_t)rv64_epilog_fast);
+ SMEND();
+ BR(x2);
+}
+
+void jump_to_next(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst)
+{
+ MAYUSE(dyn); MAYUSE(ninst);
+ MESSAGE(LOG_DUMP, "Jump to next\n");
+
+ if(reg) {
+ if(reg!=xRIP) {
+ MV(xRIP, reg);
+ }
+ uintptr_t tbl = getJumpTable64();
+ MAYUSE(tbl);
+ TABLE64(x3, tbl);
+ SRLI(x2, xRIP, JMPTABL_START3);
+ if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);}
+ LD(x3, x3, 0); // could be LR_D(x3, x3, 1, 1); for better safety
+ MOV64x(x4, JMPTABLE_MASK2<<3); // x4 = mask
+ SRLI(x2, xRIP, JMPTABL_START2-3);
+ AND(x2, x2, x4);
+ ADD(x3, x3, x2);
+ LD(x3, x3, 0); //LR_D(x3, x3, 1, 1);
+ if(JMPTABLE_MASK2!=JMPTABLE_MASK1) {
+ MOV64x(x4, JMPTABLE_MASK1<<3); // x4 = mask
+ }
+ SRLI(x2, xRIP, JMPTABL_START1-3);
+ AND(x2, x2, x4);
+ ADD(x3, x3, x2);
+ LD(x3, x3, 0); //LR_D(x3, x3, 1, 1);
+ if(JMPTABLE_MASK0<2048) {
+ ANDI(x2, xRIP, JMPTABLE_MASK0);
+ } else {
+ if(JMPTABLE_MASK1!=JMPTABLE_MASK0) {
+ MOV64x(x4, JMPTABLE_MASK0); // x4 = mask
+ }
+ AND(x2, xRIP, x4);
+ }
+ if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);}
+ LD(x2, x3, 0); //LR_D(x2, x3, 1, 1);
+ } else {
+ uintptr_t p = getJumpTableAddress64(ip);
+ MAYUSE(p);
+ TABLE64(x3, p);
+ GETIP_(ip);
+ LD(x2, x3, 0); //LR_D(x2, x3, 1, 1);
+ }
+ if(reg!=A1) {
+ MV(A1, xRIP);
+ }
+ CLEARIP();
+ #ifdef HAVE_TRACE
+ //MOVx(x3, 15); no access to PC reg
+ #endif
+ SMEND();
+ JALR(x2); // save LR...
+}
+
+void ret_to_epilog(dynarec_rv64_t* dyn, int ninst, rex_t rex)
+{
+ MAYUSE(dyn); MAYUSE(ninst);
+ MESSAGE(LOG_DUMP, "Ret to epilog\n");
+ POP1z(xRIP);
+ MVz(x1, xRIP);
+ SMEND();
+ /*if(box64_dynarec_callret) {
+ // pop the actual return address from RV64 stack
+ LDPx_S7_offset(x2, x6, xSP, 0);
+ CBZx(x6, 5*4);
+ ADDx_U12(xSP, xSP, 16);
+ SUBx_REG(x6, x6, xRIP); // is it the right address?
+ CBNZx(x6, 2*4);
+ BLR(x2);
+ // not the correct return address, regular jump
+ }*/
+ uintptr_t tbl = getJumpTable64();
+ MOV64x(x3, tbl);
+ SRLI(x2, xRIP, JMPTABL_START3);
+ if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);}
+ LD(x3, x3, 0);
+ MOV64x(x4, JMPTABLE_MASK2<<3); // x4 = mask
+ SRLI(x2, xRIP, JMPTABL_START2-3);
+ AND(x2, x2, x4);
+ ADD(x3, x3, x2);
+ LD(x3, x3, 0);
+ if(JMPTABLE_MASK2!=JMPTABLE_MASK1) {
+ MOV64x(x4, JMPTABLE_MASK1<<3); // x4 = mask
+ }
+ SRLI(x2, xRIP, JMPTABL_START1-3);
+ AND(x2, x2, x4);
+ ADD(x3, x3, x2);
+ LD(x3, x3, 0);
+ if(JMPTABLE_MASK0<2048) {
+ ANDI(x2, xRIP, JMPTABLE_MASK0);
+ } else {
+ if(JMPTABLE_MASK1!=JMPTABLE_MASK0) {
+ MOV64x(x4, JMPTABLE_MASK0); // x4 = mask
+ }
+ AND(x2, xRIP, x4);
+ }
+ if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);}
+ LD(x2, x3, 0);
+ JALR(x2); // save LR
+ CLEARIP();
+}
+
+void retn_to_epilog(dynarec_rv64_t* dyn, int ninst, rex_t rex, int n)
+{
+ MAYUSE(dyn); MAYUSE(ninst);
+ MESSAGE(LOG_DUMP, "Retn to epilog\n");
+ POP1z(xRIP);
+ if(n>0x7ff) {
+ MOV64x(w1, n);
+ ADDz(xRSP, xRSP, x1);
+ } else {
+ ADDIz(xRSP, xRSP, n);
+ }
+ MVz(x1, xRIP);
+ SMEND();
+ /*if(box64_dynarec_callret) {
+ // pop the actual return address from RV64 stack
+ LDPx_S7_offset(x2, x6, xSP, 0);
+ CBZx(x6, 5*4);
+ ADDx_U12(xSP, xSP, 16);
+ SUBx_REG(x6, x6, xRIP); // is it the right address?
+ CBNZx(x6, 2*4);
+ BLR(x2);
+ // not the correct return address, regular jump
+ }*/
+ uintptr_t tbl = getJumpTable64();
+ MOV64x(x3, tbl);
+ SRLI(x2, xRIP, JMPTABL_START3);
+ if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);}
+ LD(x3, x3, 0);
+ MOV64x(x4, JMPTABLE_MASK2<<3); // x4 = mask
+ SRLI(x2, xRIP, JMPTABL_START2-3);
+ AND(x2, x2, x4);
+ ADD(x3, x3, x2);
+ LD(x3, x3, 0);
+ if(JMPTABLE_MASK2!=JMPTABLE_MASK1) {
+ MOV64x(x4, JMPTABLE_MASK1<<3); // x4 = mask
+ }
+ SRLI(x2, xRIP, JMPTABL_START1-3);
+ AND(x2, x2, x4);
+ ADD(x3, x3, x2);
+ LD(x3, x3, 0);
+ if(JMPTABLE_MASK0<2048) {
+ ANDI(x2, xRIP, JMPTABLE_MASK0);
+ } else {
+ if(JMPTABLE_MASK1!=JMPTABLE_MASK0) {
+ MOV64x(x4, JMPTABLE_MASK0); // x4 = mask
+ }
+ AND(x2, xRIP, x4);
+ }
+ if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);}
+ LD(x2, x3, 0);
+ JALR(x2); // save LR
+ CLEARIP();
+}
+
+void iret_to_epilog(dynarec_rv64_t* dyn, int ninst, int is64bits)
+{
+ //#warning TODO: is64bits
+ MAYUSE(ninst);
+ MESSAGE(LOG_DUMP, "IRet to epilog\n");
+ NOTEST(x2);
+ if(is64bits) {
+ POP1(xRIP);
+ POP1(x2);
+ POP1(xFlags);
+ } else {
+ POP1_32(xRIP);
+ POP1_32(x2);
+ POP1_32(xFlags);
+ }
+
+ SH(x2, xEmu, offsetof(x64emu_t, segs[_CS]));
+ SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_CS]));
+ // clean EFLAGS
+ MOV32w(x1, 0x3F7FD7);
+ AND(xFlags, xFlags, x1);
+ ORI(xFlags, xFlags, 0x2);
+ SET_DFNONE();
+ // POP RSP
+ if (is64bits) {
+ POP1(x3); //rsp
+ POP1(x2); //ss
+ } else {
+ POP1_32(x3); //rsp
+ POP1_32(x2); //ss
+ }
+ // POP SS
+ SH(x2, xEmu, offsetof(x64emu_t, segs[_SS]));
+ SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_SS]));
+ // set new RSP
+ MV(xRSP, x3);
+ // Ret....
+ MOV64x(x2, (uintptr_t)rv64_epilog); // epilog on purpose, CS might have changed!
+ SMEND();
+ BR(x2);
+ CLEARIP();
+}
+
+void call_c(dynarec_rv64_t* dyn, int ninst, void* fnc, int reg, int ret, int saveflags, int savereg)
+{
+ MAYUSE(fnc);
+ if(savereg==0)
+ savereg = x6;
+ if(saveflags) {
+ FLAGS_ADJUST_TO11(xFlags, xFlags, reg);
+ SD(xFlags, xEmu, offsetof(x64emu_t, eflags));
+ }
+ fpu_pushcache(dyn, ninst, reg, 0);
+ if(ret!=-2) {
+ SUBI(xSP, xSP, 16); // RV64 stack needs to be 16byte aligned
+ SD(xEmu, xSP, 0);
+ SD(savereg, xSP, 8);
+ // x5..x8, x10..x17, x28..x31 those needs to be saved by caller
+ STORE_REG(RAX);
+ STORE_REG(RCX);
+ STORE_REG(RDX);
+ STORE_REG(R12);
+ STORE_REG(R13);
+ STORE_REG(R14);
+ STORE_REG(R15);
+ SD(xRIP, xEmu, offsetof(x64emu_t, ip));
+ }
+ TABLE64(reg, (uintptr_t)fnc);
+ JALR(reg);
+ if(ret>=0) {
+ MV(ret, xEmu);
+ }
+ if(ret!=-2) {
+ LD(xEmu, xSP, 0);
+ LD(savereg, xSP, 8);
+ ADDI(xSP, xSP, 16);
+ #define GO(A) if(ret!=x##A) {LOAD_REG(A);}
+ GO(RAX);
+ GO(RCX);
+ GO(RDX);
+ GO(R12);
+ GO(R13);
+ GO(R14);
+ GO(R15);
+ if(ret!=xRIP)
+ LD(xRIP, xEmu, offsetof(x64emu_t, ip));
+ #undef GO
+ }
+ // regenerate mask
+ XORI(xMASK, xZR, -1);
+ SRLI(xMASK, xMASK, 32);
+
+ fpu_popcache(dyn, ninst, reg, 0);
+ if(saveflags) {
+ LD(xFlags, xEmu, offsetof(x64emu_t, eflags));
+ FLAGS_ADJUST_FROM11(xFlags, reg);
+ }
+ SET_NODF();
+ dyn->last_ip = 0;
+}
+
+void call_n(dynarec_rv64_t* dyn, int ninst, void* fnc, int w)
+{
+ MAYUSE(fnc);
+ FLAGS_ADJUST_TO11(xFlags, xFlags, x3);
+ SD(xFlags, xEmu, offsetof(x64emu_t, eflags));
+ fpu_pushcache(dyn, ninst, x3, 1);
+ // x5..x8, x10..x17, x28..x31 those needs to be saved by caller
+ // RDI, RSI, RDX, RCX, R8, R9 are used for function call
+ SUBI(xSP, xSP, 16);
+ SD(xEmu, xSP, 0);
+ SD(xRIP, xSP, 8); // ARM64 stack needs to be 16byte aligned
+ STORE_REG(R12);
+ STORE_REG(R13);
+ STORE_REG(R14);
+ STORE_REG(R15);
+ // float and double args
+ if(abs(w)>1) {
+ /*MESSAGE(LOG_DUMP, "Getting %d XMM args\n", abs(w)-1);
+ for(int i=0; i<abs(w)-1; ++i) {
+ sse_get_reg(dyn, ninst, x6, i, w);
+ }*/
+ MESSAGE(LOG_DUMP, "Warning XMM args not ready\n");
+ }
+ if(w<0) {
+ /*
+ MESSAGE(LOG_DUMP, "Return in XMM0\n");
+ sse_get_reg_empty(dyn, ninst, x6, 0);
+ */
+ MESSAGE(LOG_DUMP, "Warning return in XMM args not ready\n");
+ }
+ // prepare regs for native call
+ MV(A0, xRDI);
+ MV(A1, xRSI);
+ MV(A2, xRDX);
+ MV(A3, xRCX);
+ MV(A4, xR8);
+ MV(A5, xR9);
+ // native call
+ TABLE64(16, (uintptr_t)fnc); // using x16 as scratch regs for call address
+ JALR(16);
+ // put return value in x64 regs
+ if(w>0) {
+ MV(xRAX, A0);
+ MV(xRDX, A1);
+ }
+ // all done, restore all regs
+ LD(xEmu, xSP, 0);
+ LD(xRIP, xSP, 8);
+ ADDI(xSP, xSP, 16);
+ LOAD_REG(R12);
+ LOAD_REG(R13);
+ LOAD_REG(R14);
+ LOAD_REG(R15);
+ // regenerate mask
+ XORI(xMASK, xZR, -1);
+ SRLI(xMASK, xMASK, 32);
+
+ fpu_popcache(dyn, ninst, x3, 1);
+ LD(xFlags, xEmu, offsetof(x64emu_t, eflags));
+ FLAGS_ADJUST_FROM11(xFlags, x3);
+ SET_NODF();
+}
+
+void grab_segdata(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, int reg, int segment)
+{
+ (void)addr;
+ int64_t j64;
+ MAYUSE(j64);
+ MESSAGE(LOG_DUMP, "Get %s Offset\n", (segment==_FS)?"FS":"GS");
+ int t1 = x1, t2 = x4;
+ if(reg==t1) ++t1;
+ if(reg==t2) ++t2;
+ LWU(t2, xEmu, offsetof(x64emu_t, segs_serial[segment]));
+ LD(reg, xEmu, offsetof(x64emu_t, segs_offs[segment]));
+ if(segment==_GS) {
+ CBNZ_MARKSEG(t2); // fast check
+ } else {
+ LD(t1, xEmu, offsetof(x64emu_t, context));
+ LWU(t1, t1, offsetof(box64context_t, sel_serial));
+ SUBW(t1, t1, t2);
+ CBZ_MARKSEG(t1);
+ }
+ MOV64x(x1, segment);
+ call_c(dyn, ninst, GetSegmentBaseEmu, t2, reg, 0, xFlags);
+ MARKSEG;
+ MESSAGE(LOG_DUMP, "----%s Offset\n", (segment==_FS)?"FS":"GS");
+}
+
+// x87 stuffs
+static void x87_reset(dynarec_rv64_t* dyn)
+{
+ for (int i=0; i<8; ++i)
+ dyn->e.x87cache[i] = -1;
+ dyn->e.x87stack = 0;
+ dyn->e.stack = 0;
+ dyn->e.stack_next = 0;
+ dyn->e.stack_pop = 0;
+ dyn->e.stack_push = 0;
+ dyn->e.combined1 = dyn->e.combined2 = 0;
+ dyn->e.swapped = 0;
+ dyn->e.barrier = 0;
+ for(int i=0; i<24; ++i)
+ if(dyn->e.extcache[i].t == EXT_CACHE_ST_F || dyn->e.extcache[i].t == EXT_CACHE_ST_D)
+ dyn->e.extcache[i].v = 0;
+}
+
+void x87_stackcount(dynarec_rv64_t* dyn, int ninst, int scratch)
+{
+ MAYUSE(scratch);
+ if(!dyn->e.x87stack)
+ return;
+ if(dyn->e.mmxcount)
+ mmx_purgecache(dyn, ninst, 0, scratch);
+ MESSAGE(LOG_DUMP, "\tSynch x87 Stackcount (%d)\n", dyn->e.x87stack);
+ int a = dyn->e.x87stack;
+ // Add x87stack to emu fpu_stack
+ LW(scratch, xEmu, offsetof(x64emu_t, fpu_stack));
+ ADDI(scratch, scratch, a);
+ SW(scratch, xEmu, offsetof(x64emu_t, fpu_stack));
+ // Sub x87stack to top, with and 7
+ LW(scratch, xEmu, offsetof(x64emu_t, top));
+ SUBI(scratch, scratch, a);
+ ANDI(scratch, scratch, 7);
+ SW(scratch, xEmu, offsetof(x64emu_t, top));
+ // reset x87stack, but not the stack count of extcache
+ dyn->e.x87stack = 0;
+ dyn->e.stack_next -= dyn->e.stack;
+ dyn->e.stack = 0;
+ MESSAGE(LOG_DUMP, "\t------x87 Stackcount\n");
+}
+
+int extcache_st_coherency(dynarec_rv64_t* dyn, int ninst, int a, int b)
+{
+ int i1 = extcache_get_st(dyn, ninst, a);
+ int i2 = extcache_get_st(dyn, ninst, b);
+ if(i1!=i2) {
+ MESSAGE(LOG_DUMP, "Warning, ST cache incoherent between ST%d(%d) and ST%d(%d)\n", a, i1, b, i2);
+ }
+
+ return i1;
+}
+
+// On step 1, Float/Double for ST is actualy computed and back-propagated
+// On step 2-3, the value is just read for inst[...].n.neocache[..]
+// the reg returned is *2 for FLOAT
+int x87_do_push(dynarec_rv64_t* dyn, int ninst, int s1, int t)
+{
+ if(dyn->e.mmxcount)
+ mmx_purgecache(dyn, ninst, 0, s1);
+ dyn->e.x87stack+=1;
+ dyn->e.stack+=1;
+ dyn->e.stack_next+=1;
+ dyn->e.stack_push+=1;
+ // move all regs in cache, and find a free one
+ for(int j=0; j<24; ++j)
+ if((dyn->e.extcache[j].t == EXT_CACHE_ST_D) || (dyn->e.extcache[j].t == EXT_CACHE_ST_F))
+ ++dyn->e.extcache[j].n;
+ int ret = -1;
+ for(int i=0; i<8; ++i)
+ if(dyn->e.x87cache[i]!=-1)
+ ++dyn->e.x87cache[i];
+ else if(ret==-1) {
+ dyn->e.x87cache[i] = 0;
+ ret=dyn->e.x87reg[i]=fpu_get_reg_x87(dyn, t, 0);
+ }
+ return ret;
+}
+void x87_do_push_empty(dynarec_rv64_t* dyn, int ninst, int s1)
+{
+ if(dyn->e.mmxcount)
+ mmx_purgecache(dyn, ninst, 0, s1);
+ dyn->e.x87stack+=1;
+ dyn->e.stack+=1;
+ dyn->e.stack_next+=1;
+ dyn->e.stack_push+=1;
+ // move all regs in cache
+ for(int j=0; j<24; ++j)
+ if((dyn->e.extcache[j].t == EXT_CACHE_ST_D) || (dyn->e.extcache[j].t == EXT_CACHE_ST_F))
+ ++dyn->e.extcache[j].n;
+ for(int i=0; i<8; ++i)
+ if(dyn->e.x87cache[i]!=-1)
+ ++dyn->e.x87cache[i];
+ if(s1)
+ x87_stackcount(dyn, ninst, s1);
+}
+void x87_do_pop(dynarec_rv64_t* dyn, int ninst, int s1)
+{
+ if(dyn->e.mmxcount)
+ mmx_purgecache(dyn, ninst, 0, s1);
+ dyn->e.x87stack-=1;
+ dyn->e.stack_next-=1;
+ dyn->e.stack_pop+=1;
+ // move all regs in cache, poping ST0
+ for(int i=0; i<8; ++i)
+ if(dyn->e.x87cache[i]!=-1) {
+ --dyn->e.x87cache[i];
+ if(dyn->e.x87cache[i]==-1) {
+ fpu_free_reg(dyn, dyn->e.x87reg[i]);
+ dyn->e.x87reg[i] = -1;
+ }
+ }
+}
+
+void x87_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1, int s2, int s3)
+{
+ int ret = 0;
+ for (int i=0; i<8 && !ret; ++i)
+ if(dyn->e.x87cache[i] != -1)
+ ret = 1;
+ if(!ret && !dyn->e.x87stack) // nothing to do
+ return;
+ MESSAGE(LOG_DUMP, "\tPurge %sx87 Cache and Synch Stackcount (%+d)---\n", next?"locally ":"", dyn->e.x87stack);
+ int a = dyn->e.x87stack;
+ if(a!=0) {
+ // reset x87stack
+ if(!next)
+ dyn->e.x87stack = 0;
+ // Add x87stack to emu fpu_stack
+ LW(s2, xEmu, offsetof(x64emu_t, fpu_stack));
+ ADDI(s2, s2, a);
+ SW(s2, xEmu, offsetof(x64emu_t, fpu_stack));
+ // Sub x87stack to top, with and 7
+ LW(s2, xEmu, offsetof(x64emu_t, top));
+ // update tags (and top at the same time)
+ if(a>0) {
+ // new tag to fulls
+ ADDI(s3, xZR, 0);
+ for (int i=0; i<a; ++i) {
+ SUBI(s2, s2, 1);
+ ANDI(s2, s2, 7); // (emu->top + st)&7
+ if(rv64_zba) SH2ADD(s1, s2, xEmu); else {SLLI(s1, s2, 2); ADD(s1, xEmu, s1);}
+ SW(s3, s1, offsetof(x64emu_t, p_regs));
+ }
+ } else {
+ // empty tags
+ ADDI(s3, xZR, 0b11);
+ for (int i=0; i<-a; ++i) {
+ if(rv64_zba) SH2ADD(s1, s2, xEmu); else {SLLI(s1, s2, 2); ADD(s1, xEmu, s1);}
+ SW(s3, s1, offsetof(x64emu_t, p_regs));
+ ADDI(s2, s2, 1);
+ ANDI(s2, s2, 7); // (emu->top + st)&7
+ }
+ }
+ SW(s2, xEmu, offsetof(x64emu_t, top));
+ } else {
+ LW(s2, xEmu, offsetof(x64emu_t, top));
+ }
+ if(ret!=0) {
+ // --- set values
+ // Get top
+ // loop all cache entries
+ for (int i=0; i<8; ++i)
+ if(dyn->e.x87cache[i]!=-1) {
+ #if STEP == 1
+ if(!next) { // don't force promotion here
+ // pre-apply pop, because purge happens in-between
+ extcache_promote_double(dyn, ninst, dyn->e.x87cache[i]+dyn->e.stack_pop);
+ }
+ #endif
+ #if STEP == 3
+ if(!next && extcache_get_st_f(dyn, ninst, dyn->e.x87cache[i])>=0) {
+ MESSAGE(LOG_DUMP, "Warning, incoherency with purged ST%d cache\n", dyn->e.x87cache[i]);
+ }
+ #endif
+ ADDI(s3, s2, dyn->e.x87cache[i]);
+ ANDI(s3, s3, 7); // (emu->top + st)&7
+ if(rv64_zba) SH3ADD(s1, s3, xEmu); else {SLLI(s1, s3, 3); ADD(s1, xEmu, s1);}
+ if(next) {
+ // need to check if a ST_F need local promotion
+ if(extcache_get_st_f(dyn, ninst, dyn->e.x87cache[i])>=0) {
+ FCVTDS(SCRATCH0, dyn->e.x87reg[i]);
+ FSD(SCRATCH0, s1, offsetof(x64emu_t, x87)); // save the value
+ } else {
+ FSD(dyn->e.x87reg[i], s1, offsetof(x64emu_t, x87)); // save the value
+ }
+ } else {
+ FSD(dyn->e.x87reg[i], s1, offsetof(x64emu_t, x87));
+ fpu_free_reg(dyn, dyn->e.x87reg[i]);
+ dyn->e.x87reg[i] = -1;
+ dyn->e.x87cache[i] = -1;
+ //dyn->e.stack_pop+=1; //no pop, but the purge because of barrier will have the n.barrier flags set
+ }
+ }
+ }
+ if(!next) {
+ dyn->e.stack_next = 0;
+ #if STEP < 2
+ // refresh the cached valued, in case it's a purge outside a instruction
+ dyn->insts[ninst].e.barrier = 1;
+ #endif
+ }
+ MESSAGE(LOG_DUMP, "\t---Purge x87 Cache and Synch Stackcount\n");
+}
+
+static void x87_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3)
+{
+ //Sync top and stack count
+ int a = dyn->e.x87stack;
+ if(a) {
+ // Add x87stack to emu fpu_stack
+ LW(s2, xEmu, offsetof(x64emu_t, fpu_stack));
+ ADDI(s2, s2, a);
+ SW(s2, xEmu, offsetof(x64emu_t, fpu_stack));
+ // Sub x87stack to top, with and 7
+ LW(s2, xEmu, offsetof(x64emu_t, top));
+ SUBI(s2, s2, a);
+ ANDI(s2, s2, 7);
+ SW(s2, xEmu, offsetof(x64emu_t, top));
+ }
+ int ret = 0;
+ for (int i=0; (i<8) && (!ret); ++i)
+ if(dyn->e.x87cache[i] != -1)
+ ret = 1;
+ if(!ret) // nothing to do
+ return;
+ // prepare offset to fpu => s1
+ // Get top
+ if(!a) {
+ LW(s2, xEmu, offsetof(x64emu_t, top));
+ }
+ // loop all cache entries
+ for (int i=0; i<8; ++i)
+ if(dyn->e.x87cache[i]!=-1) {
+ ADDI(s3, s2, dyn->e.x87cache[i]);
+ ANDI(s3, s3, 7); // (emu->top + i)&7
+ if(rv64_zba) SH3ADD(s1, s3, xEmu); else {SLLI(s1, s3, 3); ADD(s1, xEmu, s1);}
+ if(extcache_get_st_f(dyn, ninst, dyn->e.x87cache[i])>=0) {
+ FCVTDS(SCRATCH0, dyn->e.x87reg[i]);
+ FSD(SCRATCH0, s1, offsetof(x64emu_t, x87));
+ } else
+ FSD(dyn->e.x87reg[i], s1, offsetof(x64emu_t, x87));
+ }
+}
+
+static void x87_unreflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3)
+{
+ // revert top and stack count
+ int a = dyn->e.x87stack;
+ if(a) {
+ // Sub x87stack to emu fpu_stack
+ LW(s2, xEmu, offsetof(x64emu_t, fpu_stack));
+ SUBI(s2, s2, a);
+ SW(s2, xEmu, offsetof(x64emu_t, fpu_stack));
+ // Add x87stack to top, with and 7
+ LW(s2, xEmu, offsetof(x64emu_t, top));
+ ADDI(s2, s2, a);
+ ANDI(s2, s2, 7);
+ SW(s2, xEmu, offsetof(x64emu_t, top));
+ }
+}
+
+int x87_get_current_cache(dynarec_rv64_t* dyn, int ninst, int st, int t)
+{
+ // search in cache first
+ for (int i=0; i<8; ++i) {
+ if(dyn->e.x87cache[i]==st) {
+ #if STEP == 1
+ if(t==EXT_CACHE_ST_D && (dyn->e.extcache[EXTIDX(dyn->e.x87reg[i])].t==EXT_CACHE_ST_F))
+ extcache_promote_double(dyn, ninst, st);
+ #endif
+ return i;
+ }
+ assert(dyn->e.x87cache[i]<8);
+ }
+ return -1;
+}
+
+int x87_get_cache(dynarec_rv64_t* dyn, int ninst, int populate, int s1, int s2, int st, int t)
+{
+ if(dyn->e.mmxcount)
+ mmx_purgecache(dyn, ninst, 0, s1);
+ int ret = x87_get_current_cache(dyn, ninst, st, t);
+ if(ret!=-1)
+ return ret;
+ MESSAGE(LOG_DUMP, "\tCreate %sx87 Cache for ST%d\n", populate?"and populate ":"", st);
+ // get a free spot
+ for (int i=0; (i<8) && (ret==-1); ++i)
+ if(dyn->e.x87cache[i]==-1)
+ ret = i;
+ // found, setup and grab the value
+ dyn->e.x87cache[ret] = st;
+ dyn->e.x87reg[ret] = fpu_get_reg_x87(dyn, EXT_CACHE_ST_D, st);
+ if(populate) {
+ LW(s2, xEmu, offsetof(x64emu_t, top));
+ int a = st - dyn->e.x87stack;
+ if(a) {
+ ADDI(s2, s2, a);
+ ANDI(s2, s2, 7);
+ }
+ if(rv64_zba) SH3ADD(s1, s2, xEmu); else {SLLI(s2, s2, 3); ADD(s1, xEmu, s2);}
+ FLD(dyn->e.x87reg[ret], s1, offsetof(x64emu_t, x87));
+ }
+ MESSAGE(LOG_DUMP, "\t-------x87 Cache for ST%d\n", st);
+
+ return ret;
+}
+int x87_get_extcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st)
+{
+ for(int ii=0; ii<24; ++ii)
+ if((dyn->e.extcache[ii].t == EXT_CACHE_ST_F || dyn->e.extcache[ii].t == EXT_CACHE_ST_D)
+ && dyn->e.extcache[ii].n==st)
+ return ii;
+ assert(0);
+ return -1;
+}
+int x87_get_st(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int a, int t)
+{
+ return dyn->e.x87reg[x87_get_cache(dyn, ninst, 1, s1, s2, a, t)];
+}
+int x87_get_st_empty(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int a, int t)
+{
+ return dyn->e.x87reg[x87_get_cache(dyn, ninst, 0, s1, s2, a, t)];
+}
+
+
+void x87_refresh(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st)
+{
+ x87_stackcount(dyn, ninst, s1);
+ int ret = -1;
+ for (int i=0; (i<8) && (ret==-1); ++i)
+ if(dyn->e.x87cache[i] == st)
+ ret = i;
+ if(ret==-1) // nothing to do
+ return;
+ MESSAGE(LOG_DUMP, "\tRefresh x87 Cache for ST%d\n", st);
+ // prepare offset to fpu => s1
+ // Get top
+ LW(s2, xEmu, offsetof(x64emu_t, top));
+ // Update
+ if(st) {
+ ADDI(s2, s2, st);
+ ANDI(s2, s2, 7); // (emu->top + i)&7
+ }
+ ADD(s1, xEmu, s2);
+ if(dyn->e.extcache[EXTIDX(dyn->e.x87reg[ret])].t==EXT_CACHE_ST_F) {
+ FCVTDS(SCRATCH0, dyn->e.x87reg[ret]);
+ FSD(SCRATCH0, s1, offsetof(x64emu_t, x87));
+ } else {
+ FSD(dyn->e.x87reg[ret], s1, offsetof(x64emu_t, x87));
+ }
+ MESSAGE(LOG_DUMP, "\t--------x87 Cache for ST%d\n", st);
+}
+
+void x87_forget(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st)
+{
+ x87_stackcount(dyn, ninst, s1);
+ int ret = -1;
+ for (int i=0; (i<8) && (ret==-1); ++i)
+ if(dyn->e.x87cache[i] == st)
+ ret = i;
+ if(ret==-1) // nothing to do
+ return;
+ MESSAGE(LOG_DUMP, "\tForget x87 Cache for ST%d\n", st);
+ #if STEP == 1
+ if(dyn->e.extcache[EXTIDX(dyn->e.x87reg[ret])].t==EXT_CACHE_ST_F)
+ extcache_promote_double(dyn, ninst, st);
+ #endif
+ // prepare offset to fpu => s1
+ // Get top
+ LW(s2, xEmu, offsetof(x64emu_t, top));
+ // Update
+ int a = st - dyn->e.x87stack;
+ if(a) {
+ ADDI(s2, s2, a);
+ ANDI(s2, s2, 7); // (emu->top + i)&7
+ }
+ if(rv64_zba) SH3ADD(s1, s2, xEmu); else {SLLI(s2, s2, 3); ADD(s1, xEmu, s2);}
+ FSD(dyn->e.x87reg[ret], s1, offsetof(x64emu_t, x87));
+ MESSAGE(LOG_DUMP, "\t--------x87 Cache for ST%d\n", st);
+ // and forget that cache
+ fpu_free_reg(dyn, dyn->e.x87reg[ret]);
+ dyn->e.extcache[EXTIDX(dyn->e.x87reg[ret])].v = 0;
+ dyn->e.x87cache[ret] = -1;
+ dyn->e.x87reg[ret] = -1;
+}
+
+void x87_reget_st(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st)
+{
+ if(dyn->e.mmxcount)
+ mmx_purgecache(dyn, ninst, 0, s1);
+ // search in cache first
+ for (int i=0; i<8; ++i)
+ if(dyn->e.x87cache[i]==st) {
+ // refresh the value
+ MESSAGE(LOG_DUMP, "\tRefresh x87 Cache for ST%d\n", st);
+ #if STEP == 1
+ if(dyn->e.extcache[EXTIDX(dyn->e.x87reg[i])].t==EXT_CACHE_ST_F)
+ extcache_promote_double(dyn, ninst, st);
+ #endif
+ LW(s2, xEmu, offsetof(x64emu_t, top));
+ int a = st - dyn->e.x87stack;
+ if(a) {
+ ADDI(s2, s2, a);
+ AND(s2, s2, 7);
+ }
+ if(rv64_zba) SH3ADD(s1, s2, xEmu); else {SLLI(s2, s2, 3); ADD(s1, xEmu, s2);}
+ FLD(dyn->e.x87reg[i], s1, offsetof(x64emu_t, x87));
+ MESSAGE(LOG_DUMP, "\t-------x87 Cache for ST%d\n", st);
+ // ok
+ return;
+ }
+ // Was not in the cache? creating it....
+ MESSAGE(LOG_DUMP, "\tCreate x87 Cache for ST%d\n", st);
+ // get a free spot
+ int ret = -1;
+ for (int i=0; (i<8) && (ret==-1); ++i)
+ if(dyn->e.x87cache[i]==-1)
+ ret = i;
+ // found, setup and grab the value
+ dyn->e.x87cache[ret] = st;
+ dyn->e.x87reg[ret] = fpu_get_reg_x87(dyn, EXT_CACHE_ST_D, st);
+ LW(s2, xEmu, offsetof(x64emu_t, top));
+ int a = st - dyn->e.x87stack;
+ ADDI(s2, s2, a);
+ ANDI(s2, s2, 7); // (emu->top + i)&7
+ if(rv64_zba) SH3ADD(s1, s2, xEmu); else {SLLI(s2, s2, 3); ADD(s1, xEmu, s2);}
+ FLD(dyn->e.x87reg[ret], s1, offsetof(x64emu_t, x87));
+ MESSAGE(LOG_DUMP, "\t-------x87 Cache for ST%d\n", st);
+}
+
+void x87_swapreg(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int a, int b)
+{
+ int i1, i2, i3;
+ i1 = x87_get_cache(dyn, ninst, 1, s1, s2, b, X87_ST(b));
+ i2 = x87_get_cache(dyn, ninst, 1, s1, s2, a, X87_ST(a));
+ i3 = dyn->e.x87cache[i1];
+ dyn->e.x87cache[i1] = dyn->e.x87cache[i2];
+ dyn->e.x87cache[i2] = i3;
+ // swap those too
+ int j1, j2, j3;
+ j1 = x87_get_extcache(dyn, ninst, s1, s2, b);
+ j2 = x87_get_extcache(dyn, ninst, s1, s2, a);
+ j3 = dyn->e.extcache[j1].n;
+ dyn->e.extcache[j1].n = dyn->e.extcache[j2].n;
+ dyn->e.extcache[j2].n = j3;
+ // mark as swapped
+ dyn->e.swapped = 1;
+ dyn->e.combined1= a; dyn->e.combined2=b;
+}
+
+// Set rounding according to cw flags, return reg to restore flags
+int x87_setround(dynarec_rv64_t* dyn, int ninst, int s1, int s2)
+{
+ MAYUSE(dyn); MAYUSE(ninst);
+ MAYUSE(s1); MAYUSE(s2);
+ LW(s1, xEmu, offsetof(x64emu_t, cw));
+ SRLI(s1, s1, 10);
+ ANDI(s1, s1, 0b11);
+ // MMX/x87 Round mode: 0..3: Nearest, Down, Up, Chop
+ // RV64: 0..7: Nearest, Toward Zero (Chop), Down, Up, Nearest tie to Max, invalid, invalid, dynamic (invalid here)
+ // 0->0, 1->2, 2->3, 3->1
+ BEQ(s1, xZR, 24);
+ ADDI(s2, xZR, 3);
+ BEQ(s1, s2, 12);
+ ADDI(s1, s1, 1);
+ J(8);
+ ADDI(s1, xZR, 1);
+ // transform done (is there a faster way?)
+ FSRM(s1, s1); // exange RM with current
+ return s1;
+}
+
+// Set rounding according to mxcsr flags, return reg to restore flags
+int sse_setround(dynarec_rv64_t* dyn, int ninst, int s1, int s2)
+{
+ MAYUSE(dyn); MAYUSE(ninst);
+ MAYUSE(s1); MAYUSE(s2);
+ LW(s1, xEmu, offsetof(x64emu_t, mxcsr));
+ SRLI(s1, s1, 13);
+ ANDI(s1, s1, 0b11);
+ // MMX/x87 Round mode: 0..3: Nearest, Down, Up, Chop
+ // RV64: 0..7: Nearest, Toward Zero (Chop), Down, Up, Nearest tie to Max, invalid, invalid, dynamic (invalid here)
+ // 0->0, 1->2, 2->3, 3->1
+ BEQ(s1, xZR, 24);
+ ADDI(s2, xZR, 3);
+ BEQ(s1, s2, 12);
+ ADDI(s1, s1, 1);
+ J(8);
+ ADDI(s1, xZR, 1);
+ // transform done (is there a faster way?)
+ FSRM(s1, s1); // exange RM with current
+ return s1;
+}
+
+// Restore round flag, destroy s1 doing so
+void x87_restoreround(dynarec_rv64_t* dyn, int ninst, int s1)
+{
+ MAYUSE(dyn); MAYUSE(ninst);
+ MAYUSE(s1);
+ FSRM(s1, s1); // put back fpscr
+}
+
+// MMX helpers
+static void mmx_reset(dynarec_rv64_t* dyn)
+{
+ dyn->e.mmxcount = 0;
+ for (int i=0; i<8; ++i)
+ dyn->e.mmxcache[i] = -1;
+}
+static int isx87Empty(dynarec_rv64_t* dyn)
+{
+ for (int i=0; i<8; ++i)
+ if(dyn->e.x87cache[i] != -1)
+ return 0;
+ return 1;
+}
+
+// forget ext register for a MMX reg, does nothing if the regs is not loaded
+void mmx_forget_reg(dynarec_rv64_t* dyn, int ninst, int a)
+{
+ if (dyn->e.mmxcache[a] == -1)
+ return;
+ FSD(dyn->e.mmxcache[a], xEmu, offsetof(x64emu_t, mmx[a]));
+ fpu_free_reg(dyn, dyn->e.mmxcache[a]);
+ return;
+}
+
+// get neon register for a MMX reg, create the entry if needed
+int mmx_get_reg(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a)
+{
+ if(!dyn->e.x87stack && isx87Empty(dyn))
+ x87_purgecache(dyn, ninst, 0, s1, s2, s3);
+ if(dyn->e.mmxcache[a]!=-1)
+ return dyn->e.mmxcache[a];
+ ++dyn->e.mmxcount;
+ int ret = dyn->e.mmxcache[a] = fpu_get_reg_emm(dyn, a);
+ FLD(ret, xEmu, offsetof(x64emu_t, mmx[a]));
+ return ret;
+}
+// get neon register for a MMX reg, but don't try to synch it if it needed to be created
+int mmx_get_reg_empty(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a)
+{
+ if(!dyn->e.x87stack && isx87Empty(dyn))
+ x87_purgecache(dyn, ninst, 0, s1, s2, s3);
+ if(dyn->e.mmxcache[a]!=-1)
+ return dyn->e.mmxcache[a];
+ ++dyn->e.mmxcount;
+ int ret = dyn->e.mmxcache[a] = fpu_get_reg_emm(dyn, a);
+ return ret;
+}
+// purge the MMX cache only(needs 3 scratch registers)
+void mmx_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1)
+{
+ if(!dyn->e.mmxcount)
+ return;
+ if(!next)
+ dyn->e.mmxcount = 0;
+ int old = -1;
+ for (int i=0; i<8; ++i)
+ if(dyn->e.mmxcache[i]!=-1) {
+ if (old==-1) {
+ MESSAGE(LOG_DUMP, "\tPurge %sMMX Cache ------\n", next?"locally ":"");
+ ++old;
+ }
+ FSD(dyn->e.mmxcache[i], xEmu, offsetof(x64emu_t, mmx[i]));
+ if(!next) {
+ fpu_free_reg(dyn, dyn->e.mmxcache[i]);
+ dyn->e.mmxcache[i] = -1;
+ }
+ }
+ if(old!=-1) {
+ MESSAGE(LOG_DUMP, "\t------ Purge MMX Cache\n");
+ }
+}
+
+static void mmx_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1)
+{
+ for (int i=0; i<8; ++i)
+ if(dyn->e.mmxcache[i]!=-1) {
+ FLD(dyn->e.mmxcache[i], xEmu, offsetof(x64emu_t, mmx[i]));
+ }
+}
+
+// SSE / SSE2 helpers
+static void sse_reset(dynarec_rv64_t* dyn)
+{
+ for (int i=0; i<16; ++i)
+ dyn->e.ssecache[i].v = -1;
+}
+// get ext register for a SSE reg, create the entry if needed
+int sse_get_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a, int single)
+{
+ if(dyn->e.ssecache[a].v!=-1) {
+ // forget / reload if change of size
+ if(dyn->e.ssecache[a].single!=single) {
+ sse_forget_reg(dyn, ninst, a);
+ // update olds after the forget...
+ dyn->e.olds[a].changed = 1;
+ dyn->e.olds[a].purged = 0;
+ dyn->e.olds[a].single = 1-single;
+ return sse_get_reg(dyn, ninst, s1, a, single);
+ }
+ return dyn->e.ssecache[a].reg;
+ }
+ dyn->e.ssecache[a].reg = fpu_get_reg_xmm(dyn, single?EXT_CACHE_SS:EXT_CACHE_SD, a);
+ int ret = dyn->e.ssecache[a].reg;
+ dyn->e.ssecache[a].single = single;
+ if(dyn->e.ssecache[a].single)
+ FLW(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a]));
+ else
+ FLD(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a]));
+ return ret;
+}
+// get ext register for a SSE reg, but don't try to synch it if it needed to be created
+int sse_get_reg_empty(dynarec_rv64_t* dyn, int ninst, int s1, int a, int single)
+{
+ if(dyn->e.ssecache[a].v!=-1) {
+ if(dyn->e.ssecache[a].single!=single && single) {
+ // writting back the double
+ FSD(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a]));
+ // need to wipe the half high 32bits of old Double because we now have a single
+ //SW(xZR, xEmu, offsetof(x64emu_t, xmm[a])+4);
+ }
+ dyn->e.olds[a].changed = 1;
+ dyn->e.olds[a].purged = 0;
+ dyn->e.olds[a].reg = EXTIDX(dyn->e.ssecache[a].reg);
+ dyn->e.olds[a].single = 1-single;
+ dyn->e.ssecache[a].single = single;
+ dyn->e.extcache[EXTIDX(dyn->e.ssecache[a].reg)].t = single?EXT_CACHE_SS:EXT_CACHE_SD;
+ return dyn->e.ssecache[a].reg;
+ }
+ dyn->e.ssecache[a].reg = fpu_get_reg_xmm(dyn, single?EXT_CACHE_SS:EXT_CACHE_SD, a);
+ dyn->e.ssecache[a].single = single;
+ return dyn->e.ssecache[a].reg;
+}
+// forget ext register for a SSE reg, does nothing if the regs is not loaded
+void sse_forget_reg(dynarec_rv64_t* dyn, int ninst, int a)
+{
+ if(dyn->e.ssecache[a].v==-1)
+ return;
+ if(dyn->e.ssecache[a].single)
+ FSW(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a]));
+ else
+ FSD(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a]));
+ fpu_free_reg(dyn, dyn->e.ssecache[a].reg);
+ dyn->e.olds[a].changed = 0;
+ dyn->e.olds[a].purged = 1;
+ dyn->e.olds[a].reg = dyn->e.ssecache[a].reg;
+ dyn->e.olds[a].single = dyn->e.ssecache[a].single;
+ dyn->e.ssecache[a].v = -1;
+ return;
+}
+// purge the SSE cache for XMM0..XMM7 (to use before function native call)
+void sse_purge07cache(dynarec_rv64_t* dyn, int ninst, int s1)
+{
+ int old = -1;
+ for (int i=0; i<8; ++i)
+ if(dyn->e.ssecache[i].v!=-1) {
+ if (old==-1) {
+ MESSAGE(LOG_DUMP, "\tPurge XMM0..7 Cache ------\n");
+ ++old;
+ }
+ if(dyn->e.ssecache[i].single)
+ FSW(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
+ else
+ FSD(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
+ fpu_free_reg(dyn, dyn->e.ssecache[i].reg);
+ dyn->e.ssecache[i].v = -1;
+ }
+ if(old!=-1) {
+ MESSAGE(LOG_DUMP, "\t------ Purge XMM0..7 Cache\n");
+ }
+}
+
+// purge the SSE cache only
+static void sse_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1)
+{
+ int old = -1;
+ for (int i=0; i<16; ++i)
+ if(dyn->e.ssecache[i].v!=-1) {
+ if (old==-1) {
+ MESSAGE(LOG_DUMP, "\tPurge %sSSE Cache ------\n", next?"locally ":"");
+ ++old;
+ }
+ if(dyn->e.ssecache[i].single)
+ FSW(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
+ else
+ FSD(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
+ if(!next) {
+ fpu_free_reg(dyn, dyn->e.ssecache[i].reg);
+ dyn->e.olds[i].changed = 0;
+ dyn->e.olds[i].purged = 1;
+ dyn->e.olds[i].reg = dyn->e.ssecache[i].reg;
+ dyn->e.olds[i].single = dyn->e.ssecache[i].single;
+ dyn->e.ssecache[i].v = -1;
+ }
+ }
+ if(old!=-1) {
+ MESSAGE(LOG_DUMP, "\t------ Purge SSE Cache\n");
+ }
+}
+
+static void sse_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1)
+{
+ for (int i=0; i<16; ++i)
+ if(dyn->e.ssecache[i].v!=-1) {
+ if(dyn->e.ssecache[i].single)
+ FSW(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
+ else
+ FSD(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
+ }
+}
+
+void fpu_pushcache(dynarec_rv64_t* dyn, int ninst, int s1, int not07)
+{
+ // need to save 0..1 && 10..17 (maybe) && 28..31
+ // so 0..7 (SSE) && 17..23 (x87+MMX)
+ int start = not07?8:0;
+ // only SSE regs needs to be push back to xEmu (needs to be "write")
+ int n=0;
+ for (int i=start; i<8; i++)
+ if(dyn->e.ssecache[i].v!=-1)
+ ++n;
+ if(n) {
+ MESSAGE(LOG_DUMP, "\tPush XMM Cache (%d)------\n", n);
+ for (int i=start; i<8; ++i)
+ if(dyn->e.ssecache[i].v!=-1) {
+ if(dyn->e.ssecache[i].single)
+ FSW(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
+ else
+ FSD(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
+ }
+ MESSAGE(LOG_DUMP, "\t------- Push XMM Cache (%d)\n", n);
+ }
+ n = 0;
+ for(int i=17; i<24; ++i)
+ if(dyn->e.extcache[i].v!=0)
+ ++n;
+ if(n) {
+ MESSAGE(LOG_DUMP, "\tPush x87/MMX Cache (%d)------\n", n);
+ SUBI(xSP, xSP, 8*((n+1)&~1));
+ int p = 0;
+ for(int i=17; i<24; ++i)
+ if(dyn->e.extcache[i].v!=0) {
+ switch(dyn->e.extcache[i].t) {
+ case EXT_CACHE_ST_F:
+ case EXT_CACHE_SS:
+ FSW(EXTREG(i), xSP, p*8);
+ break;
+ default:
+ FSD(EXTREG(i), xSP, p*8);
+ break;
+ };
+ ++p;
+ }
+ MESSAGE(LOG_DUMP, "\t------- Push x87/MMX Cache (%d)\n", n);
+ }
+}
+void fpu_popcache(dynarec_rv64_t* dyn, int ninst, int s1, int not07)
+{
+ int start = not07?8:0;
+ // only SSE regs needs to be pop back from xEmu (don't need to be "write" this time)
+ int n=0;
+ for (int i=start; i<8; i++)
+ if(dyn->e.ssecache[i].v!=-1)
+ ++n;
+ if(n) {
+ MESSAGE(LOG_DUMP, "\tPop XMM Cache (%d)------\n", n);
+ for (int i=start; i<8; ++i)
+ if(dyn->e.ssecache[i].v!=-1) {
+ if(dyn->e.ssecache[i].single)
+ FLW(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
+ else
+ FLD(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i]));
+ }
+ MESSAGE(LOG_DUMP, "\t------- Pop XMM Cache (%d)\n", n);
+ }
+ n = 0;
+ for(int i=17; i<24; ++i)
+ if(dyn->e.extcache[i].v!=0)
+ ++n;
+ if(n) {
+ MESSAGE(LOG_DUMP, "\tPush x87/MMX Cache (%d)------\n", n);
+ int p = 0;
+ for(int i=17; i<24; ++i)
+ if(dyn->e.extcache[i].v!=0) {
+ switch(dyn->e.extcache[i].t) {
+ case EXT_CACHE_ST_F:
+ case EXT_CACHE_SS:
+ FLW(EXTREG(i), xSP, p*8);
+ break;
+ default:
+ FLD(EXTREG(i), xSP, p*8);
+ break;
+ };
+ ++p;
+ }
+ ADDI(xSP, xSP, 8*((n+1)&~1));
+ MESSAGE(LOG_DUMP, "\t------- Push x87/MMX Cache (%d)\n", n);
+ }
+}
+
+void fpu_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1, int s2, int s3)
+{
+ x87_purgecache(dyn, ninst, next, s1, s2, s3);
+ mmx_purgecache(dyn, ninst, next, s1);
+ sse_purgecache(dyn, ninst, next, s1);
+ if(!next)
+ fpu_reset_reg(dyn);
+}
+
+static int findCacheSlot(dynarec_rv64_t* dyn, int ninst, int t, int n, extcache_t* cache)
+{
+ ext_cache_t f;
+ f.n = n; f.t = t;
+ for(int i=0; i<24; ++i) {
+ if(cache->extcache[i].v == f.v)
+ return i;
+ if(cache->extcache[i].n == n) {
+ switch(cache->extcache[i].t) {
+ case EXT_CACHE_ST_F:
+ if (t==EXT_CACHE_ST_D)
+ return i;
+ break;
+ case EXT_CACHE_ST_D:
+ if (t==EXT_CACHE_ST_F)
+ return i;
+ break;
+ }
+ }
+ }
+ return -1;
+}
+
+static void swapCache(dynarec_rv64_t* dyn, int ninst, int i, int j, extcache_t *cache)
+{
+ if (i==j)
+ return;
+ int reg_i = EXTREG(i);
+ int reg_j = EXTREG(j);
+ int i_single = 0;
+ if(cache->extcache[i].t==EXT_CACHE_SS || cache->extcache[i].t==EXT_CACHE_ST_F)
+ i_single =1;
+ int j_single = 0;
+ if(cache->extcache[j].t==EXT_CACHE_SS || cache->extcache[j].t==EXT_CACHE_ST_F)
+ j_single =1;
+
+ if(!cache->extcache[i].v) {
+ // a mov is enough, no need to swap
+ MESSAGE(LOG_DUMP, "\t - Moving %d <- %d\n", i, j);
+ if(j_single) {
+ FMVS(reg_i, reg_j);
+ } else {
+ FMVD(reg_i, reg_j);
+ }
+ cache->extcache[i].v = cache->extcache[j].v;
+ cache->extcache[j].v = 0;
+ return;
+ }
+ // SWAP
+ ext_cache_t tmp;
+ MESSAGE(LOG_DUMP, "\t - Swapping %d <-> %d\n", i, j);
+ // There is no VSWP in Arm64 NEON to swap 2 register contents!
+ // so use a scratch...
+ #define SCRATCH 0
+ if(i_single)
+ FMVS(SCRATCH, reg_i);
+ else
+ FMVD(SCRATCH, reg_i);
+ if(j_single)
+ FMVS(reg_i, reg_j);
+ else
+ FMVD(reg_i, reg_j);
+ if(i_single)
+ FMVS(reg_j, SCRATCH);
+ else
+ FMVD(reg_j, SCRATCH);
+ #undef SCRATCH
+ tmp.v = cache->extcache[i].v;
+ cache->extcache[i].v = cache->extcache[j].v;
+ cache->extcache[j].v = tmp.v;
+}
+
+static void loadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, int s2, int s3, int* s1_val, int* s2_val, int* s3_top, extcache_t *cache, int i, int t, int n)
+{
+ int reg = EXTREG(i);
+ if(cache->extcache[i].v) {
+ int single = 0;
+ if(t==EXT_CACHE_SS || t==EXT_CACHE_ST_F)
+ single = 1;
+ if(cache->extcache[i].t==EXT_CACHE_SS || cache->extcache[i].t==EXT_CACHE_ST_F)
+ single = 1;
+ int j = i+1;
+ while(cache->extcache[j].v)
+ ++j;
+ MESSAGE(LOG_DUMP, "\t - Moving away %d\n", i);
+ if(single) {
+ FMVS(EXTREG(j), reg);
+ } else {
+ FMVD(EXTREG(j), reg);
+ }
+ cache->extcache[j].v = cache->extcache[i].v;
+ }
+ switch(t) {
+ case EXT_CACHE_SS:
+ MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n));
+ FLW(reg, xEmu, offsetof(x64emu_t, xmm[n]));
+ break;
+ case EXT_CACHE_SD:
+ MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n));
+ FLD(reg, xEmu, offsetof(x64emu_t, xmm[n]));
+ break;
+ case EXT_CACHE_MM:
+ MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n));
+ FLD(reg, xEmu, offsetof(x64emu_t, mmx[i]));
+ break;
+ case EXT_CACHE_ST_D:
+ case EXT_CACHE_ST_F:
+ MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n));
+ if((*s3_top) == 0xffff) {
+ LW(s3, xEmu, offsetof(x64emu_t, top));
+ *s3_top = 0;
+ }
+ int a = n - (*s3_top) - stack_cnt;
+ if(a) {
+ ADDI(s3, s3, a);
+ ANDI(s3, s3, 7); // (emu->top + i)&7
+ }
+ *s3_top += a;
+ *s2_val = 0;
+ if(rv64_zba) SH3ADD(s2, s3, xEmu); else {SLLI(s2, s3, 3); ADD(s2, xEmu, s2);}
+ FLD(reg, s2, offsetof(x64emu_t, x87));
+ if(t==EXT_CACHE_ST_F) {
+ FCVTSD(reg, reg);
+ }
+ break;
+ case EXT_CACHE_NONE:
+ case EXT_CACHE_SCR:
+ default: /* nothing done */
+ MESSAGE(LOG_DUMP, "\t - ignoring %s\n", getCacheName(t, n));
+ break;
+ }
+ cache->extcache[i].n = n;
+ cache->extcache[i].t = t;
+}
+
+static void unloadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, int s2, int s3, int* s1_val, int* s2_val, int* s3_top, extcache_t *cache, int i, int t, int n)
+{
+ int reg = EXTREG(i);
+ switch(t) {
+ case EXT_CACHE_SS:
+ MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n));
+ FSW(reg, xEmu, offsetof(x64emu_t, xmm[n]));
+ break;
+ case EXT_CACHE_SD:
+ MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n));
+ FSD(reg, xEmu, offsetof(x64emu_t, xmm[n]));
+ break;
+ case EXT_CACHE_MM:
+ MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n));
+ FSD(reg, xEmu, offsetof(x64emu_t, mmx[n]));
+ break;
+ case EXT_CACHE_ST_D:
+ case EXT_CACHE_ST_F:
+ MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n));
+ if((*s3_top)==0xffff) {
+ LW(s3, xEmu, offsetof(x64emu_t, top));
+ *s3_top = 0;
+ }
+ int a = n - (*s3_top) - stack_cnt;
+ if(a) {
+ ADDI(s3, s3, a);
+ ANDI(s3, s3, 7);
+ }
+ *s3_top += a;
+ if(rv64_zba) SH3ADD(s2, s3, xEmu); else {SLLI(s2, s3, 3); ADD(s2, xEmu, s2);}
+ *s2_val = 0;
+ if(t==EXT_CACHE_ST_F) {
+ FCVTDS(reg, reg);
+ }
+ FSD(reg, s2, offsetof(x64emu_t, x87));
+ break;
+ case EXT_CACHE_NONE:
+ case EXT_CACHE_SCR:
+ default: /* nothing done */
+ MESSAGE(LOG_DUMP, "\t - ignoring %s\n", getCacheName(t, n));
+ break;
+ }
+ cache->extcache[i].v = 0;
+}
+
+static void fpuCacheTransform(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3)
+{
+#if STEP > 1
+ int i2 = dyn->insts[ninst].x64.jmp_insts;
+ if(i2<0)
+ return;
+ MESSAGE(LOG_DUMP, "\tCache Transform ---- ninst=%d -> %d\n", ninst, i2);
+ if((!i2) || (dyn->insts[i2].x64.barrier&BARRIER_FLOAT)) {
+ if(dyn->e.stack_next) {
+ fpu_purgecache(dyn, ninst, 1, s1, s2, s3);
+ MESSAGE(LOG_DUMP, "\t---- Cache Transform\n");
+ return;
+ }
+ for(int i=0; i<24; ++i)
+ if(dyn->e.extcache[i].v) { // there is something at ninst for i
+ fpu_purgecache(dyn, ninst, 1, s1, s2, s3);
+ MESSAGE(LOG_DUMP, "\t---- Cache Transform\n");
+ return;
+ }
+ MESSAGE(LOG_DUMP, "\t---- Cache Transform\n");
+ return;
+ }
+ extcache_t cache_i2 = dyn->insts[i2].e;
+ extcacheUnwind(&cache_i2);
+
+ if(!cache_i2.stack) {
+ int purge = 1;
+ for (int i=0; i<24 && purge; ++i)
+ if(cache_i2.extcache[i].v)
+ purge = 0;
+ if(purge) {
+ fpu_purgecache(dyn, ninst, 1, s1, s2, s3);
+ MESSAGE(LOG_DUMP, "\t---- Cache Transform\n");
+ return;
+ }
+ }
+ int stack_cnt = dyn->e.stack_next;
+ int s3_top = 0xffff;
+ if(stack_cnt != cache_i2.stack) {
+ MESSAGE(LOG_DUMP, "\t - adjust stack count %d -> %d -\n", stack_cnt, cache_i2.stack);
+ int a = stack_cnt - cache_i2.stack;
+ // Add x87stack to emu fpu_stack
+ LWU(s3, xEmu, offsetof(x64emu_t, fpu_stack));
+ ADDI(s3, s3, a);
+ SW(s3, xEmu, offsetof(x64emu_t, fpu_stack));
+ // Sub x87stack to top, with and 7
+ LWU(s3, xEmu, offsetof(x64emu_t, top));
+ // update tags (and top at the same time)
+ if(a>0) {
+ // new tag to fulls
+ ADDI(s2, xZR, 0);
+ ADDI(s1, xEmu, offsetof(x64emu_t, p_regs));
+ SLLI(s3, s3, 2);
+ for (int i=0; i<a; ++i) {
+ SUBI(s3, s3, 1<<2);
+ ANDI(s3, s3, 7<<2);
+ ADD(s3, s1, s3);
+ SW(s2, s3, 0); // that slot is full
+ SUB(s3, s3, s1);
+ }
+ SRLI(s3, s3, 2);
+ } else {
+ // empty tags
+ ADDI(s2, xZR, 0b11);
+ ADDI(s1, xEmu, offsetof(x64emu_t, p_regs));
+ SLLI(s3, s3, 2);
+ for (int i=0; i<-a; ++i) {
+ ADD(s3, s1, s3);
+ SW(s2, s3, 0); // empty slot before leaving it
+ SUB(s3, s3, s1);
+ ADDI(s3, s3, 1<<2);
+ ANDI(s3, s3, 7<<2); // (emu->top + st)&7
+ }
+ SRLI(s3, s3, 2);
+ }
+ SW(s3, xEmu, offsetof(x64emu_t, top));
+ s3_top = 0;
+ stack_cnt = cache_i2.stack;
+ }
+ extcache_t cache = dyn->e;
+ int s1_val = 0;
+ int s2_val = 0;
+ // unload every uneeded cache
+ // check SSE first, than MMX, in order, for optimisation issue
+ for(int i=0; i<16; ++i) {
+ int j=findCacheSlot(dyn, ninst, EXT_CACHE_SS, i, &cache);
+ if(j>=0 && findCacheSlot(dyn, ninst, EXT_CACHE_SS, i, &cache_i2)==-1)
+ unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.extcache[j].t, cache.extcache[j].n);
+ j=findCacheSlot(dyn, ninst, EXT_CACHE_SD, i, &cache);
+ if(j>=0 && findCacheSlot(dyn, ninst, EXT_CACHE_SD, i, &cache_i2)==-1)
+ unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.extcache[j].t, cache.extcache[j].n);
+ }
+ for(int i=0; i<8; ++i) {
+ int j=findCacheSlot(dyn, ninst, EXT_CACHE_MM, i, &cache);
+ if(j>=0 && findCacheSlot(dyn, ninst, EXT_CACHE_MM, i, &cache_i2)==-1)
+ unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.extcache[j].t, cache.extcache[j].n);
+ }
+ for(int i=0; i<24; ++i) {
+ if(cache.extcache[i].v)
+ if(findCacheSlot(dyn, ninst, cache.extcache[i].t, cache.extcache[i].n, &cache_i2)==-1)
+ unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, i, cache.extcache[i].t, cache.extcache[i].n);
+ }
+ // and now load/swap the missing one
+ for(int i=0; i<24; ++i) {
+ if(cache_i2.extcache[i].v) {
+ if(cache_i2.extcache[i].v != cache.extcache[i].v) {
+ int j;
+ if((j=findCacheSlot(dyn, ninst, cache_i2.extcache[i].t, cache_i2.extcache[i].n, &cache))==-1)
+ loadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, i, cache_i2.extcache[i].t, cache_i2.extcache[i].n);
+ else {
+ // it's here, lets swap if needed
+ if(j!=i)
+ swapCache(dyn, ninst, i, j, &cache);
+ }
+ }
+ if(cache.extcache[i].t != cache_i2.extcache[i].t) {
+ if(cache.extcache[i].t == EXT_CACHE_ST_D && cache_i2.extcache[i].t == EXT_CACHE_ST_F) {
+ MESSAGE(LOG_DUMP, "\t - Convert %s\n", getCacheName(cache.extcache[i].t, cache.extcache[i].n));
+ FCVTSD(EXTREG(i), EXTREG(i));
+ cache.extcache[i].t = EXT_CACHE_ST_F;
+ } else if(cache.extcache[i].t == EXT_CACHE_ST_F && cache_i2.extcache[i].t == EXT_CACHE_ST_D) {
+ MESSAGE(LOG_DUMP, "\t - Convert %s\n", getCacheName(cache.extcache[i].t, cache.extcache[i].n));
+ FCVTDS(EXTREG(i), EXTREG(i));
+ cache.extcache[i].t = EXT_CACHE_ST_D;
+ }
+ }
+ }
+ }
+ MESSAGE(LOG_DUMP, "\t---- Cache Transform\n");
+#endif
+}
+static void flagsCacheTransform(dynarec_rv64_t* dyn, int ninst, int s1)
+{
+#if STEP > 1
+ int j64;
+ int jmp = dyn->insts[ninst].x64.jmp_insts;
+ if(jmp<0)
+ return;
+ if(dyn->f.dfnone) // flags are fully known, nothing we can do more
+ return;
+ MESSAGE(LOG_DUMP, "\tFlags fetch ---- ninst=%d -> %d\n", ninst, jmp);
+ int go = 0;
+ switch (dyn->insts[jmp].f_entry.pending) {
+ case SF_UNKNOWN: break;
+ case SF_SET:
+ if(dyn->f.pending!=SF_SET && dyn->f.pending!=SF_SET_PENDING)
+ go = 1;
+ break;
+ case SF_SET_PENDING:
+ if(dyn->f.pending!=SF_SET
+ && dyn->f.pending!=SF_SET_PENDING
+ && dyn->f.pending!=SF_PENDING)
+ go = 1;
+ break;
+ case SF_PENDING:
+ if(dyn->f.pending!=SF_SET
+ && dyn->f.pending!=SF_SET_PENDING
+ && dyn->f.pending!=SF_PENDING)
+ go = 1;
+ else
+ go = (dyn->insts[jmp].f_entry.dfnone == dyn->f.dfnone)?0:1;
+ break;
+ }
+ if(dyn->insts[jmp].f_entry.dfnone && !dyn->f.dfnone)
+ go = 1;
+ if(go) {
+ if(dyn->f.pending!=SF_PENDING) {
+ LW(s1, xEmu, offsetof(x64emu_t, df));
+ j64 = (GETMARKF2)-(dyn->native_size);
+ BEQZ(s1, j64);
+ }
+ CALL_(UpdateFlags, -1, 0);
+ MARKF2;
+ }
+#endif
+}
+
+void CacheTransform(dynarec_rv64_t* dyn, int ninst, int cacheupd, int s1, int s2, int s3) {
+ if(cacheupd&2)
+ fpuCacheTransform(dyn, ninst, s1, s2, s3);
+ if(cacheupd&1)
+ flagsCacheTransform(dyn, ninst, s1);
+}
+
+
+void rv64_move32(dynarec_rv64_t* dyn, int ninst, int reg, int32_t val, int zeroup)
+{
+ // Depending on val, the following insns are emitted.
+ // val == 0 -> ADDI
+ // lo12 != 0 && hi20 == 0 -> ADDI
+ // lo12 == 0 && hi20 != 0 -> LUI
+ // else -> LUI+ADDI
+ int32_t hi20 = (val+0x800)>>12 & 0xfffff;
+ int32_t lo12 = val&0xfff;
+
+ int src = xZR;
+ if (hi20) {
+ LUI(reg, hi20);
+ src = reg;
+ }
+ if (lo12 || !hi20) ADDIW(reg, src, lo12);
+ if((zeroup && ((hi20&0x80000) || (!hi20 && (lo12&0x800)))
+ || (!zeroup && !(val&0x80000000) && ((hi20&0x80000) || (!hi20 && (lo12&0x800)))))) {
+ ZEROUP(reg);
+ }
+}
+
+void rv64_move64(dynarec_rv64_t* dyn, int ninst, int reg, int64_t val)
+{
+ if(((val<<32)>>32)==val) {
+ // 32bits value
+ rv64_move32(dyn, ninst, reg, val, 0);
+ return;
+ }
+
+ int64_t lo12 = (val<<52)>>52;
+ int64_t hi52 = (val+0x800)>>12;
+ int shift = 12+TrailingZeros64((uint64_t)hi52);
+ hi52 = ((hi52>>(shift-12))<<shift)>>shift;
+ rv64_move64(dyn, ninst, reg, hi52);
+ SLLI(reg, reg, shift);
+
+ if (lo12) {
+ ADDI(reg, reg, lo12);
+ }
+}
+
+void fpu_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3)
+{
+ x87_reflectcache(dyn, ninst, s1, s2, s3);
+ mmx_reflectcache(dyn, ninst, s1);
+ sse_reflectcache(dyn, ninst, s1);
+}
+
+void fpu_unreflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3)
+{
+ // need to undo the top and stack tracking that must not be reflected permenatly yet
+ x87_unreflectcache(dyn, ninst, s1, s2, s3);
+}
+
+void fpu_reset(dynarec_rv64_t* dyn)
+{
+ x87_reset(dyn);
+ mmx_reset(dyn);
+ sse_reset(dyn);
+ fpu_reset_reg(dyn);
+}
+
+void emit_pf(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4)
+{
+ MAYUSE(dyn); MAYUSE(ninst);
+ // PF: (((emu->x64emu_parity_tab[(res&0xff) / 32] >> ((res&0xff) % 32)) & 1) == 0)
+ MOV64x(s4, (uintptr_t)GetParityTab());
+ SRLI(s3, s1, 3);
+ ANDI(s3, s3, 28);
+ ADD(s4, s4, s3);
+ LW(s4, s4, 0);
+ NOT(s4, s4);
+ SRLW(s4, s4, s1);
+ ANDI(s4, s4, 1);
+
+ BEQZ(s4, 8);
+ ORI(xFlags, xFlags, 1 << F_PF);
+}
+
+void fpu_reset_cache(dynarec_rv64_t* dyn, int ninst, int reset_n)
+{
+ MESSAGE(LOG_DEBUG, "Reset Caches with %d\n",reset_n);
+ #if STEP > 1
+ // for STEP 2 & 3, just need to refrest with current, and undo the changes (push & swap)
+ dyn->e = dyn->insts[ninst].e;
+ extcacheUnwind(&dyn->e);
+ #ifdef HAVE_TRACE
+ if(box64_dynarec_dump)
+ if(memcmp(&dyn->e, &dyn->insts[reset_n].e, sizeof(ext_cache_t))) {
+ MESSAGE(LOG_DEBUG, "Warning, difference in extcache: reset=");
+ for(int i=0; i<24; ++i)
+ if(dyn->insts[reset_n].e.extcache[i].v)
+ MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->insts[reset_n].e.extcache[i].t, dyn->insts[reset_n].e.extcache[i].n));
+ if(dyn->insts[reset_n].e.combined1 || dyn->insts[reset_n].e.combined2)
+ MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[reset_n].e.swapped?"SWP":"CMB", dyn->insts[reset_n].e.combined1, dyn->insts[reset_n].e.combined2);
+ if(dyn->insts[reset_n].e.stack_push || dyn->insts[reset_n].e.stack_pop)
+ MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->insts[reset_n].e.stack_push, -dyn->insts[reset_n].e.stack_pop);
+ MESSAGE(LOG_DEBUG, " ==> ");
+ for(int i=0; i<24; ++i)
+ if(dyn->insts[ninst].e.extcache[i].v)
+ MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->insts[ninst].e.extcache[i].t, dyn->insts[ninst].e.extcache[i].n));
+ if(dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2)
+ MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[ninst].e.swapped?"SWP":"CMB", dyn->insts[ninst].e.combined1, dyn->insts[ninst].e.combined2);
+ if(dyn->insts[ninst].e.stack_push || dyn->insts[ninst].e.stack_pop)
+ MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->insts[ninst].e.stack_push, -dyn->insts[ninst].e.stack_pop);
+ MESSAGE(LOG_DEBUG, " -> ");
+ for(int i=0; i<24; ++i)
+ if(dyn->e.extcache[i].v)
+ MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->e.extcache[i].t, dyn->e.extcache[i].n));
+ if(dyn->e.combined1 || dyn->e.combined2)
+ MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->e.swapped?"SWP":"CMB", dyn->e.combined1, dyn->e.combined2);
+ if(dyn->e.stack_push || dyn->e.stack_pop)
+ MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->e.stack_push, -dyn->e.stack_pop);
+ MESSAGE(LOG_DEBUG, "\n");
+ }
+ #endif //HAVE_TRACE
+ #else
+ dyn->e = dyn->insts[reset_n].e;
+ #endif
+}
+
+// propagate ST stack state, especial stack pop that are deferred
+void fpu_propagate_stack(dynarec_rv64_t* dyn, int ninst)
+{
+ if(dyn->e.stack_pop) {
+ for(int j=0; j<24; ++j)
+ if((dyn->e.extcache[j].t == EXT_CACHE_ST_D || dyn->e.extcache[j].t == EXT_CACHE_ST_F)) {
+ if(dyn->e.extcache[j].n<dyn->e.stack_pop)
+ dyn->e.extcache[j].v = 0;
+ else
+ dyn->e.extcache[j].n-=dyn->e.stack_pop;
+ }
+ dyn->e.stack_pop = 0;
+ }
+ dyn->e.stack = dyn->e.stack_next;
+ dyn->e.news = 0;
+ dyn->e.stack_push = 0;
+ dyn->e.swapped = 0;
+}
diff --git a/src/dynarec/rv64/dynarec_rv64_helper.h b/src/dynarec/rv64/dynarec_rv64_helper.h
new file mode 100644
index 0000000..0b1023b
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_helper.h
@@ -0,0 +1,1348 @@
+#ifndef __DYNAREC_RV64_HELPER_H__
+#define __DYNAREC_RV64_HELPER_H__
+
+// undef to get Close to SSE Float->int conversions
+//#define PRECISE_CVT
+
+#if STEP == 0
+#include "dynarec_rv64_pass0.h"
+#elif STEP == 1
+#include "dynarec_rv64_pass1.h"
+#elif STEP == 2
+#include "dynarec_rv64_pass2.h"
+#elif STEP == 3
+#include "dynarec_rv64_pass3.h"
+#endif
+
+#include "debug.h"
+#include "rv64_emitter.h"
+#include "../emu/x64primop.h"
+
+#define F8 *(uint8_t*)(addr++)
+#define F8S *(int8_t*)(addr++)
+#define F16 *(uint16_t*)(addr+=2, addr-2)
+#define F16S *(int16_t*)(addr+=2, addr-2)
+#define F32 *(uint32_t*)(addr+=4, addr-4)
+#define F32S *(int32_t*)(addr+=4, addr-4)
+#define F32S64 (uint64_t)(int64_t)F32S
+#define F64 *(uint64_t*)(addr+=8, addr-8)
+#define PK(a) *(uint8_t*)(addr+a)
+#define PK16(a) *(uint16_t*)(addr+a)
+#define PK32(a) *(uint32_t*)(addr+a)
+#define PK64(a) *(uint64_t*)(addr+a)
+#define PKip(a) *(uint8_t*)(ip+a)
+
+
+// Strong mem emulation helpers
+// Sequence of Read will trigger a DMB on "first" read if strongmem is 2
+// Squence of Write will trigger a DMB on "last" write if strongmem is 1
+// Opcode will read
+#define SMREAD() if(!dyn->smread && box64_dynarec_strongmem>1) {SMDMB();}
+// Opcode will read with option forced lock
+#define SMREADLOCK(lock) if(lock || (!dyn->smread && box64_dynarec_strongmem>1)) {SMDMB();}
+// Opcode migh read (depend on nextop)
+#define SMMIGHTREAD() if(!MODREG) {SMREAD();}
+// Opcode has wrote
+#define SMWRITE() dyn->smwrite=1
+// Opcode has wrote (strongmem>1 only)
+#define SMWRITE2() if(box64_dynarec_strongmem>1) dyn->smwrite=1
+// Opcode has wrote with option forced lock
+#define SMWRITELOCK(lock) if(lock) {SMDMB();} else dyn->smwrite=1
+// Opcode migh have wrote (depend on nextop)
+#define SMMIGHTWRITE() if(!MODREG) {SMWRITE();}
+// Start of sequence
+#define SMSTART() SMEND()
+// End of sequence
+#define SMEND() if(dyn->smwrite && box64_dynarec_strongmem) {FENCE();} dyn->smwrite=0; dyn->smread=0;
+// Force a Data memory barrier (for LOCK: prefix)
+#define SMDMB() FENCE(); dyn->smwrite=0; dyn->smread=1
+
+//LOCK_* define
+#define LOCK_LOCK (int*)1
+
+// GETGD get x64 register in gd
+#define GETGD gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3)
+// GETED can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI
+#define GETED(D) if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ wback = 0; \
+ } else { \
+ SMREAD() \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, D); \
+ LDxw(x1, wback, fixedaddress); \
+ ed = x1; \
+ }
+// GETSED can use r1 for ed, and r2 for wback. ed will be sign extended!
+#define GETSED(D) if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ wback = 0; \
+ if(!rex.w) { \
+ ADDW(x1, ed, xZR); \
+ ed = x1; \
+ } \
+ } else { \
+ SMREAD() \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, D); \
+ if(rex.w) \
+ LD(x1, wback, fixedaddress); \
+ else \
+ LW(x1, wback, fixedaddress); \
+ ed = x1; \
+ }
+// GETEDx can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI
+#define GETEDx(D) if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ wback = 0; \
+ } else { \
+ SMREAD() \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, D); \
+ LD(x1, wback, fixedaddress); \
+ ed = x1; \
+ }
+#define GETEDz(D) if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ wback = 0; \
+ } else { \
+ SMREAD() \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, D); \
+ LDz(x1, wback, fixedaddress); \
+ ed = x1; \
+ }
+// GETED32 can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI
+#define GETED32(D) if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ wback = 0; \
+ } else { \
+ SMREAD() \
+ addr = geted32(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, D); \
+ LDxw(x1, wback, fixedaddress); \
+ ed = x1; \
+ }
+//GETEDH can use hint for ed, and x1 or x2 for wback (depending on hint), might also use x3. wback is 0 if ed is xEAX..xEDI
+#define GETEDH(hint, D) if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ wback = 0; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, (hint==x2)?x1:x2, (hint==x1)?x1:x3, &fixedaddress, rex, NULL, 1, D); \
+ LDxw(hint, wback, fixedaddress); \
+ ed = hint; \
+ }
+//GETEDW can use hint for wback and ret for ed. wback is 0 if ed is xEAX..xEDI
+#define GETEDW(hint, ret, D) if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ MV(ret, ed); \
+ wback = 0; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, (hint==x2)?x1:x2, (hint==x1)?x1:x3, &fixedaddress, rex, NULL, 0, D); \
+ ed = ret; \
+ LDxw(ed, wback, fixedaddress); \
+ }
+// GETGW extract x64 register in gd, that is i
+#define GETGW(i) gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); ZEXTH(i, gd); gd = i;
+//GETEWW will use i for ed, and can use w for wback.
+#define GETEWW(w, i, D) if(MODREG) { \
+ wback = xRAX+(nextop&7)+(rex.b<<3);\
+ ZEXTH(i, wback); \
+ ed = i; \
+ wb1 = 0; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, w, i, &fixedaddress, rex, NULL, 1, D); \
+ LHU(i, wback, fixedaddress);\
+ ed = i; \
+ wb1 = 1; \
+ }
+//GETEW will use i for ed, and can use r3 for wback.
+#define GETEW(i, D) GETEWW(x3, i, D)
+//GETSEW will use i for ed, and can use r3 for wback. This is the Signed version
+#define GETSEW(i, D) if(MODREG) { \
+ wback = xRAX+(nextop&7)+(rex.b<<3);\
+ if(rv64_zbb) SEXTH(i, wback); else {SLLI(i, wback, 48); SRAI(i, i, 48);}\
+ ed = i; \
+ wb1 = 0; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, i, &fixedaddress, rex, NULL, 1, D); \
+ LH(i, wback, fixedaddress); \
+ ed = i; \
+ wb1 = 1; \
+ }
+// Write ed back to original register / memory
+#define EWBACK EWBACKW(ed)
+// Write w back to original register / memory (w needs to be 16bits only!)
+#define EWBACKW(w) if(wb1) {SH(w, wback, fixedaddress); SMWRITE();} else {SRLI(wback, wback, 16); SLLI(wback, wback, 16); OR(wback, wback, w);}
+// Write back gd in correct register (gd needs to be 16bits only!)
+#define GWBACK do{int g=xRAX+((nextop&0x38)>>3)+(rex.r<<3); SRLI(g, g, 16); SLLI(g, g, 16); OR(g, g, gd);}while(0)
+
+//GETEDO can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI
+#define GETEDO(O, D, S) if(MODREG) { \
+ ed = xRAX+(nextop&7)+(rex.b<<3); \
+ wback = 0; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, S, &fixedaddress, rex, NULL, 1, D); \
+ ADD(S, wback, O); \
+ LDxw(x1, S, fixedaddress); \
+ ed = x1; \
+ }
+#define WBACKO(O) if(wback) {ADD(O, wback, O); SDxw(ed, O, 0); SMWRITE2();}
+
+// FAKEED like GETED, but doesn't get anything
+#define FAKEED if(!MODREG) { \
+ addr = fakeed(dyn, addr, ninst, nextop); \
+ }
+
+// GETGW extract x64 register in gd, that is i, Signed extented
+#define GETSGW(i) gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); SLLIW(i, gd, 16); SRAIW(i, i, 16); gd = i;
+
+// Write back ed in wback (if wback not 0)
+#define WBACK if(wback) {SDxw(ed, wback, fixedaddress); SMWRITE();}
+
+// GETEB will use i for ed, and can use r3 for wback.
+#define GETEB(i, D) if(MODREG) { \
+ if(rex.rex) { \
+ wback = xRAX+(nextop&7)+(rex.b<<3); \
+ wb2 = 0; \
+ } else { \
+ wback = (nextop&7); \
+ wb2 = (wback>>2)*8; \
+ wback = xRAX+(wback&3); \
+ } \
+ if (wb2) {MV(i, wback); SRLI(i, i, wb2); ANDI(i, i, 0xff);} else {ANDI(i, wback, 0xff);} \
+ wb1 = 0; \
+ ed = i; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, D); \
+ LBU(i, wback, fixedaddress);\
+ wb1 = 1; \
+ ed = i; \
+ }
+//GETEBO will use i for ed, i is also Offset, and can use r3 for wback.
+#define GETEBO(i, D) if(MODREG) { \
+ if(rex.rex) { \
+ wback = xRAX+(nextop&7)+(rex.b<<3); \
+ wb2 = 0; \
+ } else { \
+ wback = (nextop&7); \
+ wb2 = (wback>>2)*8; \
+ wback = xRAX+(wback&3); \
+ } \
+ if (wb2) {MV(i, wback); SRLI(i, i, wb2); ANDI(i, i, 0xff);} else {ANDI(i, wback, 0xff);} \
+ wb1 = 0; \
+ ed = i; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, D); \
+ ADD(x3, wback, i); \
+ if(wback!=x3) wback = x3; \
+ LBU(i, wback, fixedaddress);\
+ wb1 = 1; \
+ ed = i; \
+ }
+//GETSEB sign extend EB, will use i for ed, and can use r3 for wback.
+#define GETSEB(i, D) if(MODREG) { \
+ if(rex.rex) { \
+ wback = xRAX+(nextop&7)+(rex.b<<3); \
+ wb2 = 0; \
+ } else { \
+ wback = (nextop&7); \
+ wb2 = (wback>>2)*8; \
+ wback = xRAX+(wback&3); \
+ } \
+ MV(i, wback); \
+ SLLIW(i, i, 24-wb2); \
+ SRAIW(i, i, 24); \
+ wb1 = 0; \
+ ed = i; \
+ } else { \
+ SMREAD(); \
+ addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, D); \
+ LB(i, wback, fixedaddress); \
+ wb1 = 1; \
+ ed = i; \
+ }
+// GETEB32 will use i for ed, and can use r3 for wback.
+#define GETEB32(i, D) if(MODREG) { \
+ if(rex.rex) { \
+ wback = xRAX+(nextop&7)+(rex.b<<3); \
+ wb2 = 0; \
+ } else { \
+ wback = (nextop&7); \
+ wb2 = (wback>>2)*8; \
+ wback = xRAX+(wback&3); \
+ } \
+ if (wb2) {MV(i, wback); SRLI(i, i, wb2); ANDI(i, i, 0xff);} else {ANDI(i, wback, 0xff);} \
+ wb1 = 0; \
+ ed = i; \
+ } else { \
+ SMREAD(); \
+ addr = geted32(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, D); \
+ LBU(i, wback, fixedaddress);\
+ wb1 = 1; \
+ ed = i; \
+ }
+
+//GETGB will use i for gd
+#define GETGB(i) if(rex.rex) { \
+ gb1 = xRAX+((nextop&0x38)>>3)+(rex.r<<3); \
+ gb2 = 0; \
+ } else { \
+ gd = (nextop&0x38)>>3; \
+ gb2 = ((gd&4)>>2); \
+ gb1 = xRAX+(gd&3); \
+ } \
+ gd = i; \
+ if (gb2) {MV(gd, gb1); SRLI(gd, gd, 8); ANDI(gd, gd, 0xff);} else {ANDI(gd, gb1, 0xff);}
+
+// Write gb (gd) back to original register / memory, using s1 as scratch
+#define GBBACK(s1) if(gb2) { \
+ MOV64x(s1, 0xffffffffffff00ffLL); \
+ AND(gb1, gb1, s1); \
+ SLLI(s1, gd, 8); \
+ OR(gb1, gb1, s1); \
+ } else { \
+ ANDI(gb1, gb1, ~0xff); \
+ OR(gb1, gb1, gd); \
+ }
+
+// Write eb (ed) back to original register / memory, using s1 as scratch
+#define EBBACK(s1, c) if(wb1) { \
+ SB(ed, wback, fixedaddress); \
+ SMWRITE(); \
+ } else if(wb2) { \
+ MOV64x(s1, 0xffffffffffff00ffLL); \
+ AND(wback, wback, s1); \
+ if (c) {ANDI(ed, ed, 0xff);} \
+ SLLI(s1, ed, 8); \
+ OR(wback, wback, s1); \
+ } else { \
+ ANDI(wback, wback, ~0xff); \
+ if (c) {ANDI(ed, ed, 0xff);} \
+ OR(wback, wback, ed); \
+ }
+
+// Get direction with size Z and based of F_DF flag, on register r ready for load/store fetching
+// using s as scratch.
+#define GETDIR(r, s, Z) \
+ MOV32w(r, Z); /* mask=1<<10 */ \
+ ANDI(s, xFlags, 1<<F_DF); \
+ BEQZ(s, 8); \
+ SUB(r, xZR, r); \
+
+// Generic get GD, but reg value in gd (R_RAX is not added)
+#define GETG gd = ((nextop&0x38)>>3)+(rex.r<<3)
+
+// Get GX as a Single (might use x2)
+#define GETGXSS(a) \
+ gd = ((nextop&0x38)>>3)+(rex.r<<3); \
+ a = sse_get_reg(dyn, ninst, x2, gd, 1)
+
+// Get GX as a Single (might use x2), no fetching old value
+#define GETGXSS_empty(a) \
+ gd = ((nextop&0x38)>>3)+(rex.r<<3); \
+ a = sse_get_reg_empty(dyn, ninst, x2, gd, 1)
+
+// Get GX as a Double (might use x2)
+#define GETGXSD(a) \
+ gd = ((nextop&0x38)>>3)+(rex.r<<3); \
+ a = sse_get_reg(dyn, ninst, x2, gd, 0)
+
+// Get GX as a Double (might use x2), no fetching old value
+#define GETGXSD_empty(a) \
+ gd = ((nextop&0x38)>>3)+(rex.r<<3); \
+ a = sse_get_reg_empty(dyn, ninst, x2, gd, 0)
+
+// Get Ex as a single, not a quad (warning, x1 get used, x2 might too)
+#define GETEXSS(a, D) \
+ if(MODREG) { \
+ a = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1); \
+ } else { \
+ SMREAD(); \
+ a = fpu_get_scratch(dyn); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, D); \
+ FLW(a, ed, fixedaddress); \
+ }
+
+// Get Ex as a double, not a quad (warning, x1 get used, x2 might too)
+#define GETEXSD(a, D) \
+ if(MODREG) { \
+ a = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); \
+ } else { \
+ SMREAD(); \
+ a = fpu_get_scratch(dyn); \
+ addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, D); \
+ FLD(a, ed, fixedaddress); \
+ }
+
+// Will get pointer to GX in general register a, will purge SS or SD if loaded. can use gback as load address
+#define GETGX() \
+ gd = ((nextop&0x38)>>3)+(rex.r<<3); \
+ sse_forget_reg(dyn, ninst, gd); \
+ gback = xEmu; \
+ gdoffset = offsetof(x64emu_t, xmm[gd])
+
+// Get Ex address in general register a, will purge SS or SD if it's reg and is loaded. May use x3. Use wback as load address!
+#define GETEX(a, D) \
+ if(MODREG) { \
+ ed = (nextop&7)+(rex.b<<3); \
+ sse_forget_reg(dyn, ninst, ed); \
+ fixedaddress = offsetof(x64emu_t, xmm[ed]); \
+ wback = xEmu; \
+ } else { \
+ SMREAD(); \
+ ed=16; \
+ addr = geted(dyn, addr, ninst, nextop, &wback, a, x3, &fixedaddress, rex, NULL, 1, D); \
+ }
+
+#define GETGM() \
+ gd = ((nextop&0x38)>>3); \
+ mmx_forget_reg(dyn, ninst, gd); \
+ gback = xEmu; \
+ gdoffset = offsetof(x64emu_t, mmx[gd])
+
+// Get EM, might use x3
+#define GETEM(a, D) \
+ if(MODREG) { \
+ ed = (nextop&7); \
+ mmx_forget_reg(dyn, ninst, ed); \
+ fixedaddress = offsetof(x64emu_t, mmx[ed]); \
+ wback = xEmu; \
+ } else { \
+ SMREAD(); \
+ ed=8; \
+ addr = geted(dyn, addr, ninst, nextop, &wback, a, x3, &fixedaddress, rex, NULL, 1, D); \
+ }
+
+#define SSE_LOOP_D_ITEM(GX1, EX1, F, i) \
+ LWU(GX1, gback, gdoffset+i*4); \
+ LWU(EX1, wback, fixedaddress+i*4); \
+ F; \
+ SW(GX1, gback, gdoffset+i*4);
+
+// Loop for SSE opcode that use 32bits value and write to GX.
+#define SSE_LOOP_D(GX1, EX1, F) \
+ SSE_LOOP_D_ITEM(GX1, EX1, F, 0) \
+ SSE_LOOP_D_ITEM(GX1, EX1, F, 1) \
+ SSE_LOOP_D_ITEM(GX1, EX1, F, 2) \
+ SSE_LOOP_D_ITEM(GX1, EX1, F, 3)
+
+#define SSE_LOOP_DS_ITEM(GX1, EX1, F, i) \
+ LW(GX1, gback, gdoffset+i*4); \
+ LW(EX1, wback, fixedaddress+i*4); \
+ F; \
+ SW(GX1, gback, gdoffset+i*4);
+
+// Loop for SSE opcode that use 32bits value and write to GX.
+#define SSE_LOOP_DS(GX1, EX1, F) \
+ SSE_LOOP_DS_ITEM(GX1, EX1, F, 0) \
+ SSE_LOOP_DS_ITEM(GX1, EX1, F, 1) \
+ SSE_LOOP_DS_ITEM(GX1, EX1, F, 2) \
+ SSE_LOOP_DS_ITEM(GX1, EX1, F, 3)
+
+#define MMX_LOOP_W(GX1, EX1, F) \
+ for (int i=0; i<4; ++i) { \
+ LHU(GX1, gback, gdoffset+i*2); \
+ LHU(EX1, wback, fixedaddress+i*2); \
+ F; \
+ SH(GX1, gback, gdoffset+i*2); \
+ }
+
+#define SSE_LOOP_W(GX1, EX1, F) \
+ for (int i=0; i<8; ++i) { \
+ LHU(GX1, gback, gdoffset+i*2); \
+ LHU(EX1, wback, fixedaddress+i*2); \
+ F; \
+ SH(GX1, gback, gdoffset+i*2); \
+ }
+
+#define SSE_LOOP_WS(GX1, EX1, F) \
+ for (int i=0; i<8; ++i) { \
+ LH(GX1, gback, gdoffset+i*2); \
+ LH(EX1, wback, fixedaddress+i*2); \
+ F; \
+ SH(GX1, gback, gdoffset+i*2); \
+ }
+
+#define SSE_LOOP_D_S_ITEM(EX1, F, i) \
+ LWU(EX1, wback, fixedaddress+i*4); \
+ F; \
+ SW(EX1, wback, fixedaddress+i*4);
+
+// Loop for SSE opcode that use 32bits value and write to EX.
+#define SSE_LOOP_D_S(EX1, F) \
+ SSE_LOOP_D_S_ITEM(EX1, F, 0) \
+ SSE_LOOP_D_S_ITEM(EX1, F, 1) \
+ SSE_LOOP_D_S_ITEM(EX1, F, 2) \
+ SSE_LOOP_D_S_ITEM(EX1, F, 3)
+
+#define SSE_LOOP_Q_ITEM(GX1, EX1, F, i) \
+ LD(GX1, gback, gdoffset+i*8); \
+ LD(EX1, wback, fixedaddress+i*8); \
+ F; \
+ SD(GX1, gback, gdoffset+i*8);
+
+// Loop for SSE opcode that use 64bits value and write to GX.
+#define SSE_LOOP_Q(GX1, EX1, F) \
+ SSE_LOOP_Q_ITEM(GX1, EX1, F, 0) \
+ SSE_LOOP_Q_ITEM(GX1, EX1, F, 1)
+
+
+#define SSE_LOOP_FQ_ITEM(GX1, EX1, F, i) \
+ FLD(v0, gback, gdoffset+i*8); \
+ FLD(v1, wback, fixedaddress+i*8); \
+ F; \
+ FSD(v0, gback, gdoffset+i*8);
+
+#define SSE_LOOP_FQ(GX1, EX1, F) \
+ v0 = fpu_get_scratch(dyn); \
+ v1 = fpu_get_scratch(dyn); \
+ SSE_LOOP_FQ_ITEM(GX1, EX1, F, 0) \
+ SSE_LOOP_FQ_ITEM(GX1, EX1, F, 1)
+
+
+#define SSE_LOOP_MV_Q_ITEM(s, i) \
+ LD(s, wback, fixedaddress+i*8); \
+ SD(s, gback, gdoffset+i*8);
+
+// Loop for SSE opcode that moves 64bits value from wback to gback, use s as scratch.
+#define SSE_LOOP_MV_Q(s) \
+ SSE_LOOP_MV_Q_ITEM(s, 0) \
+ SSE_LOOP_MV_Q_ITEM(s, 1)
+
+#define SSE_LOOP_MV_Q_ITEM2(s, i) \
+ LD(s, gback, gdoffset+i*8); \
+ SD(s, wback, fixedaddress+i*8);
+
+// Loop for SSE opcode that moves 64bits value from gback to wback, use s as scratch.
+#define SSE_LOOP_MV_Q2(s) \
+ SSE_LOOP_MV_Q_ITEM2(s, 0) \
+ SSE_LOOP_MV_Q_ITEM2(s, 1)
+
+// CALL will use x6 for the call address. Return value can be put in ret (unless ret is -1)
+// R0 will not be pushed/popd if ret is -2
+#define CALL(F, ret) call_c(dyn, ninst, F, x6, ret, 1, 0)
+// CALL_ will use x6 for the call address. Return value can be put in ret (unless ret is -1)
+// R0 will not be pushed/popd if ret is -2
+#define CALL_(F, ret, reg) call_c(dyn, ninst, F, x6, ret, 1, reg)
+// CALL_S will use x6 for the call address. Return value can be put in ret (unless ret is -1)
+// R0 will not be pushed/popd if ret is -2. Flags are not save/restored
+#define CALL_S(F, ret) call_c(dyn, ninst, F, x6, ret, 0, 0)
+
+#define MARK dyn->insts[ninst].mark = dyn->native_size
+#define GETMARK dyn->insts[ninst].mark
+#define MARK2 dyn->insts[ninst].mark2 = dyn->native_size
+#define GETMARK2 dyn->insts[ninst].mark2
+#define MARK3 dyn->insts[ninst].mark3 = dyn->native_size
+#define GETMARK3 dyn->insts[ninst].mark3
+#define MARKF dyn->insts[ninst].markf = dyn->native_size
+#define GETMARKF dyn->insts[ninst].markf
+#define MARKF2 dyn->insts[ninst].markf2 = dyn->native_size
+#define GETMARKF2 dyn->insts[ninst].markf2
+#define MARKSEG dyn->insts[ninst].markseg = dyn->native_size
+#define GETMARKSEG dyn->insts[ninst].markseg
+#define MARKLOCK dyn->insts[ninst].marklock = dyn->native_size
+#define GETMARKLOCK dyn->insts[ninst].marklock
+
+#define Bxx_gen(OP, M, reg1, reg2) \
+ j64 = GET##M - dyn->native_size; \
+ B##OP (reg1, reg2, j64)
+
+// Branch to MARK if reg1==reg2 (use j64)
+#define BEQ_MARK(reg1, reg2) Bxx_gen(EQ, MARK, reg1, reg2)
+// Branch to MARK if reg1!=reg2 (use j64)
+#define BNE_MARK(reg1, reg2) Bxx_gen(NE, MARK, reg1, reg2)
+// Branch to MARK if reg1!=0 (use j64)
+#define BNEZ_MARK(reg) BNE_MARK(reg, xZR)
+// Branch to MARK instruction unconditionnal (use j64)
+#define B_MARK_nocond Bxx_gen(__, MARK, 0, 0)
+// Branch to MARK if reg1<reg2 (use j64)
+#define BLT_MARK(reg1, reg2) Bxx_gen(LT, MARK, reg1, reg2)
+// Branch to MARK if reg1<reg2 (use j64)
+#define BLTU_MARK(reg1, reg2) Bxx_gen(LTU, MARK, reg1, reg2)
+// Branch to MARK if reg1>=reg2 (use j64)
+#define BGE_MARK(reg1, reg2) Bxx_gen(GE, MARK, reg1, reg2)
+// Branch to MARK2 if reg1==reg2 (use j64)
+#define BEQ_MARK2(reg1, reg2) Bxx_gen(EQ, MARK2, reg1,reg2)
+// Branch to MARK2 if reg1!=reg2 (use j64)
+#define BNE_MARK2(reg1, reg2) Bxx_gen(NE, MARK2, reg1,reg2)
+// Branch to MARK2 if reg1!=0 (use j64)
+#define BNEZ_MARK2(reg) BNE_MARK2(reg, xZR)
+// Branch to MARK2 if reg1<reg2 (use j64)
+#define BLT_MARK2(reg1, reg2) Bxx_gen(LT, MARK2, reg1,reg2)
+// Branch to MARK2 instruction unconditionnal (use j64)
+#define B_MARK2_nocond Bxx_gen(__, MARK2, 0, 0)
+// Branch to MARK3 if reg1==reg2 (use j64)
+#define BEQ_MARK3(reg1, reg2) Bxx_gen(EQ, MARK3, reg1, reg2)
+// Branch to MARK3 if reg1!=reg2 (use j64)
+#define BNE_MARK3(reg1, reg2) Bxx_gen(NE, MARK3, reg1, reg2)
+// Branch to MARK3 if reg1!=0 (use j64)
+#define BNEZ_MARK3(reg) BNE_MARK3(reg, xZR)
+// Branch to MARK3 instruction unconditionnal (use j64)
+#define B_MARK3_nocond Bxx_gen(__, MARK3, 0, 0)
+// Branch to MARKLOCK if reg1!=reg2 (use j64)
+#define BNE_MARKLOCK(reg1, reg2) Bxx_gen(NE, MARKLOCK, reg1, reg2)
+// Branch to MARKLOCK if reg1!=0 (use j64)
+#define BNEZ_MARKLOCK(reg) BNE_MARKLOCK(reg, xZR)
+
+// Branch to NEXT if reg1==reg2 (use j64)
+#define BEQ_NEXT(reg1, reg2) \
+ j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; \
+ BEQ(reg1, reg2, j64)
+
+// Branch to NEXT if reg1==0 (use j64)
+#define CBZ_NEXT(reg1) \
+ j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; \
+ BEQ(reg1, xZR, j64)
+// Branch to NEXT if reg1!=0 (use j64)
+#define CBNZ_NEXT(reg1) \
+ j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; \
+ BNE(reg1, xZR, j64)
+// Branch to next instruction unconditionnal (use j64)
+#define B_NEXT_nocond \
+ j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0;\
+ B(j64)
+
+// Branch to MARKSEG if reg is 0 (use j64)
+#define CBZ_MARKSEG(reg) \
+ j64 = GETMARKSEG-(dyn->native_size); \
+ BEQZ(reg, j64);
+// Branch to MARKSEG if reg is not 0 (use j64)
+#define CBNZ_MARKSEG(reg) \
+ j64 = GETMARKSEG-(dyn->native_size); \
+ BNEZ(reg, j64);
+
+#define IFX(A) if((dyn->insts[ninst].x64.gen_flags&(A)))
+#define IFX_PENDOR0 if((dyn->insts[ninst].x64.gen_flags&(X_PEND) || !dyn->insts[ninst].x64.gen_flags))
+#define IFXX(A) if((dyn->insts[ninst].x64.gen_flags==(A)))
+#define IFX2X(A, B) if((dyn->insts[ninst].x64.gen_flags==(A) || dyn->insts[ninst].x64.gen_flags==(B) || dyn->insts[ninst].x64.gen_flags==((A)|(B))))
+#define IFXN(A, B) if((dyn->insts[ninst].x64.gen_flags&(A) && !(dyn->insts[ninst].x64.gen_flags&(B))))
+
+#define STORE_REG(A) SD(x##A, xEmu, offsetof(x64emu_t, regs[_##A]))
+#define LOAD_REG(A) LD(x##A, xEmu, offsetof(x64emu_t, regs[_##A]))
+
+// Need to also store current value of some register, as they may be used by functions like setjmp
+#define STORE_XEMU_CALL() \
+ STORE_REG(RBX); \
+ STORE_REG(RDX); \
+ STORE_REG(RSP); \
+ STORE_REG(RBP); \
+ STORE_REG(RDI); \
+ STORE_REG(RSI); \
+ STORE_REG(R8); \
+ STORE_REG(R9); \
+ STORE_REG(R10); \
+ STORE_REG(R11); \
+
+#define LOAD_XEMU_CALL() \
+
+#define LOAD_XEMU_REM() \
+ LOAD_REG(RBX); \
+ LOAD_REG(RDX); \
+ LOAD_REG(RSP); \
+ LOAD_REG(RBP); \
+ LOAD_REG(RDI); \
+ LOAD_REG(RSI); \
+ LOAD_REG(R8); \
+ LOAD_REG(R9); \
+ LOAD_REG(R10); \
+ LOAD_REG(R11); \
+
+
+#define SET_DFNONE() if(!dyn->f.dfnone) {SW(xZR, xEmu, offsetof(x64emu_t, df)); dyn->f.dfnone=1;}
+#define SET_DF(S, N) if((N)!=d_none) {MOV_U12(S, (N)); SW(S, xEmu, offsetof(x64emu_t, df)); dyn->f.dfnone=0;} else SET_DFNONE()
+#define SET_NODF() dyn->f.dfnone = 0
+#define SET_DFOK() dyn->f.dfnone = 1
+
+#define CLEAR_FLAGS() IFX(X_ALL) {ANDI(xFlags, xFlags, ~((1UL<<F_AF) | (1UL<<F_CF) | (1UL<<F_OF2) | (1UL<<F_ZF) | (1UL<<F_SF) | (1UL<<F_PF)));}
+
+#define CALC_SUB_FLAGS(op1_, op2, res, scratch1, scratch2, width) \
+ IFX(X_AF | X_CF | X_OF) { \
+ /* calc borrow chain */ \
+ /* bc = (res & (~op1 | op2)) | (~op1 & op2) */ \
+ OR(scratch1, op1_, op2); \
+ AND(scratch2, res, scratch1); \
+ AND(op1_, op1_, op2); \
+ OR(scratch2, scratch2, op1_); \
+ IFX(X_AF) { \
+ /* af = bc & 0x8 */ \
+ ANDI(scratch1, scratch2, 8); \
+ BEQZ(scratch1, 8); \
+ ORI(xFlags, xFlags, 1 << F_AF); \
+ } \
+ IFX(X_CF) { \
+ /* cf = bc & (1<<(width-1)) */ \
+ if ((width) == 8) { \
+ ANDI(scratch1, scratch2, 0x80); \
+ } else { \
+ SRLI(scratch1, scratch2, (width)-1); \
+ if(width!=64) ANDI(scratch1, scratch1, 1); \
+ } \
+ BEQZ(scratch1, 8); \
+ ORI(xFlags, xFlags, 1 << F_CF); \
+ } \
+ IFX(X_OF) { \
+ /* of = ((bc >> (width-2)) ^ (bc >> (width-1))) & 0x1; */ \
+ SRLI(scratch1, scratch2, (width)-2); \
+ SRLI(scratch2, scratch1, 1); \
+ XOR(scratch1, scratch1, scratch2); \
+ ANDI(scratch1, scratch1, 1); \
+ BEQZ(scratch1, 8); \
+ ORI(xFlags, xFlags, 1 << F_OF2); \
+ } \
+ }
+
+// Adjust the xFlags bit 11 -> bit 5, result in reg (can be xFlags, but not s1)
+#define FLAGS_ADJUST_FROM11(reg, s1)\
+ ANDI(reg, xFlags, ~(1<<5)); \
+ SRLI(s1, reg, 11-5); \
+ ANDI(s1, s1, 1<<5); \
+ OR(reg, reg, s1)
+
+// Adjust the xFlags bit 5 -> bit 11, src and dst can be the same (and can be xFlags, but not s1)
+#define FLAGS_ADJUST_TO11(dst, src, s1) \
+ LUI(s1, 0xFFFFF); \
+ ADDIW(s1, s1, 0x7DF); \
+ AND(s1, src, s1); \
+ ANDI(dst, src, 1<<5); \
+ SLLI(dst, dst, 11-5); \
+ OR(dst, dst, s1)
+
+#ifndef MAYSETFLAGS
+#define MAYSETFLAGS()
+#endif
+
+#ifndef READFLAGS
+#define READFLAGS(A) \
+ if(((A)!=X_PEND && dyn->f.pending!=SF_SET) \
+ && (dyn->f.pending!=SF_SET_PENDING)) { \
+ if(dyn->f.pending!=SF_PENDING) { \
+ LD(x3, xEmu, offsetof(x64emu_t, df)); \
+ j64 = (GETMARKF)-(dyn->native_size); \
+ BEQ(x3, xZR, j64); \
+ } \
+ CALL_(UpdateFlags, -1, 0); \
+ FLAGS_ADJUST_FROM11(xFlags, x3); \
+ MARKF; \
+ dyn->f.pending = SF_SET; \
+ SET_DFOK(); \
+ }
+#endif
+
+#ifndef SETFLAGS
+#define SETFLAGS(A, B) \
+ if(dyn->f.pending!=SF_SET \
+ && ((B)&SF_SUB) \
+ && (dyn->insts[ninst].x64.gen_flags&(~(A)))) \
+ READFLAGS(((dyn->insts[ninst].x64.gen_flags&X_PEND)?X_ALL:dyn->insts[ninst].x64.gen_flags)&(~(A)));\
+ if(dyn->insts[ninst].x64.gen_flags) switch(B) { \
+ case SF_SUBSET: \
+ case SF_SET: dyn->f.pending = SF_SET; break; \
+ case SF_PENDING: dyn->f.pending = SF_PENDING; break; \
+ case SF_SUBSET_PENDING: \
+ case SF_SET_PENDING: \
+ dyn->f.pending = (dyn->insts[ninst].x64.gen_flags&X_PEND)?SF_SET_PENDING:SF_SET; \
+ break; \
+ } else dyn->f.pending = SF_SET
+#endif
+#ifndef JUMP
+#define JUMP(A, C)
+#endif
+#ifndef BARRIER
+#define BARRIER(A)
+#endif
+#ifndef BARRIER_NEXT
+#define BARRIER_NEXT(A)
+#endif
+#define UFLAG_OP1(A) if(dyn->insts[ninst].x64.gen_flags) {SDxw(A, xEmu, offsetof(x64emu_t, op1));}
+#define UFLAG_OP2(A) if(dyn->insts[ninst].x64.gen_flags) {SDxw(A, xEmu, offsetof(x64emu_t, op2));}
+#define UFLAG_OP12(A1, A2) if(dyn->insts[ninst].x64.gen_flags) {SDxw(A1, xEmu, offsetof(x64emu_t, op1));SDxw(A2, xEmu, offsetof(x64emu_t, op2));}
+#define UFLAG_RES(A) if(dyn->insts[ninst].x64.gen_flags) {SDxw(A, xEmu, offsetof(x64emu_t, res));}
+#define UFLAG_DF(r, A) if(dyn->insts[ninst].x64.gen_flags) {SET_DF(r, A)}
+#define UFLAG_IF if(dyn->insts[ninst].x64.gen_flags)
+#ifndef DEFAULT
+#define DEFAULT *ok = -1; BARRIER(2)
+#endif
+
+#ifndef TABLE64
+#define TABLE64(A, V)
+#endif
+#ifndef FTABLE64
+#define FTABLE64(A, V)
+#endif
+
+#define ARCH_INIT()
+
+
+#if STEP < 2
+#define GETIP(A)
+#define GETIP_(A)
+#else
+// put value in the Table64 even if not using it for now to avoid difference between Step2 and Step3. Needs to be optimized later...
+#define GETIP(A) \
+ if(dyn->last_ip && ((A)-dyn->last_ip)<2048) { \
+ uint64_t _delta_ip = (A)-dyn->last_ip; \
+ dyn->last_ip += _delta_ip; \
+ if(_delta_ip) { \
+ ADDI(xRIP, xRIP, _delta_ip); \
+ } \
+ } else { \
+ dyn->last_ip = (A); \
+ if(dyn->last_ip<0xffffffff) { \
+ MOV64x(xRIP, dyn->last_ip); \
+ } else \
+ TABLE64(xRIP, dyn->last_ip); \
+ }
+#define GETIP_(A) \
+ if(dyn->last_ip && ((A)-dyn->last_ip)<2048) { \
+ int64_t _delta_ip = (A)-dyn->last_ip; \
+ if(_delta_ip) {ADDI(xRIP, xRIP, _delta_ip);} \
+ } else { \
+ if((A)<0xffffffff) { \
+ MOV64x(xRIP, (A)); \
+ } else \
+ TABLE64(xRIP, (A)); \
+ }
+#endif
+#define CLEARIP() dyn->last_ip=0
+
+#if STEP < 2
+#define PASS2IF(A, B) if(A)
+#elif STEP == 2
+#define PASS2IF(A, B) if(A) dyn->insts[ninst].pass2choice = B; if(dyn->insts[ninst].pass2choice == B)
+#else
+#define PASS2IF(A, B) if(dyn->insts[ninst].pass2choice == B)
+#endif
+
+#define MODREG ((nextop&0xC0)==0xC0)
+
+void rv64_epilog(void);
+void rv64_epilog_fast(void);
+void* rv64_next(x64emu_t* emu, uintptr_t addr);
+
+#ifndef STEPNAME
+#define STEPNAME3(N,M) N##M
+#define STEPNAME2(N,M) STEPNAME3(N,M)
+#define STEPNAME(N) STEPNAME2(N, STEP)
+#endif
+
+#define native_pass STEPNAME(native_pass)
+
+#define dynarec64_00 STEPNAME(dynarec64_00)
+#define dynarec64_00_0 STEPNAME(dynarec64_00_0)
+#define dynarec64_00_1 STEPNAME(dynarec64_00_1)
+#define dynarec64_00_2 STEPNAME(dynarec64_00_2)
+#define dynarec64_00_3 STEPNAME(dynarec64_00_3)
+#define dynarec64_0F STEPNAME(dynarec64_0F)
+#define dynarec64_64 STEPNAME(dynarec64_64)
+#define dynarec64_65 STEPNAME(dynarec64_65)
+#define dynarec64_66 STEPNAME(dynarec64_66)
+#define dynarec64_67 STEPNAME(dynarec64_67)
+#define dynarec64_D8 STEPNAME(dynarec64_D8)
+#define dynarec64_D9 STEPNAME(dynarec64_D9)
+#define dynarec64_DA STEPNAME(dynarec64_DA)
+#define dynarec64_DB STEPNAME(dynarec64_DB)
+#define dynarec64_DC STEPNAME(dynarec64_DC)
+#define dynarec64_DD STEPNAME(dynarec64_DD)
+#define dynarec64_DE STEPNAME(dynarec64_DE)
+#define dynarec64_DF STEPNAME(dynarec64_DF)
+#define dynarec64_F0 STEPNAME(dynarec64_F0)
+#define dynarec64_660F STEPNAME(dynarec64_660F)
+#define dynarec64_6664 STEPNAME(dynarec64_6664)
+#define dynarec64_66F0 STEPNAME(dynarec64_66F0)
+#define dynarec64_F20F STEPNAME(dynarec64_F20F)
+#define dynarec64_F30F STEPNAME(dynarec64_F30F)
+
+#define geted STEPNAME(geted)
+#define geted32 STEPNAME(geted32)
+#define geted16 STEPNAME(geted16)
+#define jump_to_epilog STEPNAME(jump_to_epilog)
+#define jump_to_epilog_fast STEPNAME(jump_to_epilog_fast)
+#define jump_to_next STEPNAME(jump_to_next)
+#define ret_to_epilog STEPNAME(ret_to_epilog)
+#define retn_to_epilog STEPNAME(retn_to_epilog)
+#define iret_to_epilog STEPNAME(iret_to_epilog)
+#define call_c STEPNAME(call_c)
+#define call_n STEPNAME(call_n)
+#define grab_segdata STEPNAME(grab_segdata)
+#define emit_cmp8 STEPNAME(emit_cmp8)
+#define emit_cmp16 STEPNAME(emit_cmp16)
+#define emit_cmp32 STEPNAME(emit_cmp32)
+#define emit_cmp8_0 STEPNAME(emit_cmp8_0)
+#define emit_cmp16_0 STEPNAME(emit_cmp16_0)
+#define emit_cmp32_0 STEPNAME(emit_cmp32_0)
+#define emit_test8 STEPNAME(emit_test8)
+#define emit_test16 STEPNAME(emit_test16)
+#define emit_test32 STEPNAME(emit_test32)
+#define emit_test32c STEPNAME(emit_test32)
+#define emit_add32 STEPNAME(emit_add32)
+#define emit_add32c STEPNAME(emit_add32c)
+#define emit_add8 STEPNAME(emit_add8)
+#define emit_add8c STEPNAME(emit_add8c)
+#define emit_sub32 STEPNAME(emit_sub32)
+#define emit_sub32c STEPNAME(emit_sub32c)
+#define emit_sub8 STEPNAME(emit_sub8)
+#define emit_sub8c STEPNAME(emit_sub8c)
+#define emit_or32 STEPNAME(emit_or32)
+#define emit_or32c STEPNAME(emit_or32c)
+#define emit_xor32 STEPNAME(emit_xor32)
+#define emit_xor32c STEPNAME(emit_xor32c)
+#define emit_and32 STEPNAME(emit_and32)
+#define emit_and32c STEPNAME(emit_and32c)
+#define emit_or8 STEPNAME(emit_or8)
+#define emit_or8c STEPNAME(emit_or8c)
+#define emit_xor8 STEPNAME(emit_xor8)
+#define emit_xor8c STEPNAME(emit_xor8c)
+#define emit_and8 STEPNAME(emit_and8)
+#define emit_and8c STEPNAME(emit_and8c)
+#define emit_add16 STEPNAME(emit_add16)
+#define emit_add16c STEPNAME(emit_add16c)
+#define emit_sub16 STEPNAME(emit_sub16)
+#define emit_sub16c STEPNAME(emit_sub16c)
+#define emit_or16 STEPNAME(emit_or16)
+#define emit_or16c STEPNAME(emit_or16c)
+#define emit_xor16 STEPNAME(emit_xor16)
+#define emit_xor16c STEPNAME(emit_xor16c)
+#define emit_and16 STEPNAME(emit_and16)
+#define emit_and16c STEPNAME(emit_and16c)
+#define emit_inc32 STEPNAME(emit_inc32)
+#define emit_inc16 STEPNAME(emit_inc16)
+#define emit_inc8 STEPNAME(emit_inc8)
+#define emit_dec32 STEPNAME(emit_dec32)
+#define emit_dec16 STEPNAME(emit_dec16)
+#define emit_dec8 STEPNAME(emit_dec8)
+#define emit_adc32 STEPNAME(emit_adc32)
+#define emit_adc32c STEPNAME(emit_adc32c)
+#define emit_adc8 STEPNAME(emit_adc8)
+#define emit_adc8c STEPNAME(emit_adc8c)
+#define emit_adc16 STEPNAME(emit_adc16)
+#define emit_adc16c STEPNAME(emit_adc16c)
+#define emit_sbb32 STEPNAME(emit_sbb32)
+#define emit_sbb32c STEPNAME(emit_sbb32c)
+#define emit_sbb8 STEPNAME(emit_sbb8)
+#define emit_sbb8c STEPNAME(emit_sbb8c)
+#define emit_sbb16 STEPNAME(emit_sbb16)
+#define emit_sbb16c STEPNAME(emit_sbb16c)
+#define emit_neg32 STEPNAME(emit_neg32)
+#define emit_neg16 STEPNAME(emit_neg16)
+#define emit_neg8 STEPNAME(emit_neg8)
+#define emit_shl32 STEPNAME(emit_shl32)
+#define emit_shl32c STEPNAME(emit_shl32c)
+#define emit_shr32 STEPNAME(emit_shr32)
+#define emit_shr32c STEPNAME(emit_shr32c)
+#define emit_sar32c STEPNAME(emit_sar32c)
+#define emit_rol32 STEPNAME(emit_rol32)
+#define emit_ror32 STEPNAME(emit_ror32)
+#define emit_rol32c STEPNAME(emit_rol32c)
+#define emit_ror32c STEPNAME(emit_ror32c)
+#define emit_shrd32c STEPNAME(emit_shrd32c)
+#define emit_shld32c STEPNAME(emit_shld32c)
+
+#define emit_pf STEPNAME(emit_pf)
+
+#define x87_do_push STEPNAME(x87_do_push)
+#define x87_do_push_empty STEPNAME(x87_do_push_empty)
+#define x87_do_pop STEPNAME(x87_do_pop)
+#define x87_get_current_cache STEPNAME(x87_get_current_cache)
+#define x87_get_cache STEPNAME(x87_get_cache)
+#define x87_get_extcache STEPNAME(x87_get_extcache)
+#define x87_get_st STEPNAME(x87_get_st)
+#define x87_get_st_empty STEPNAME(x87_get_st)
+#define x87_refresh STEPNAME(x87_refresh)
+#define x87_forget STEPNAME(x87_forget)
+#define x87_reget_st STEPNAME(x87_reget_st)
+#define x87_stackcount STEPNAME(x87_stackcount)
+#define x87_swapreg STEPNAME(x87_swapreg)
+#define x87_setround STEPNAME(x87_setround)
+#define x87_restoreround STEPNAME(x87_restoreround)
+#define sse_setround STEPNAME(sse_setround)
+#define mmx_get_reg STEPNAME(mmx_get_reg)
+#define mmx_get_reg_empty STEPNAME(mmx_get_reg_empty)
+#define mmx_forget_reg STEPNAME(mmx_forget_reg)
+#define sse_get_reg STEPNAME(sse_get_reg)
+#define sse_get_reg_empty STEPNAME(sse_get_reg_empty)
+#define sse_forget_reg STEPNAME(sse_forget_reg)
+#define sse_purge07cache STEPNAME(sse_purge07cache)
+
+#define fpu_pushcache STEPNAME(fpu_pushcache)
+#define fpu_popcache STEPNAME(fpu_popcache)
+#define fpu_reset STEPNAME(fpu_reset)
+#define fpu_reset_cache STEPNAME(fpu_reset_cache)
+#define fpu_propagate_stack STEPNAME(fpu_propagate_stack)
+#define fpu_purgecache STEPNAME(fpu_purgecache)
+#define mmx_purgecache STEPNAME(mmx_purgecache)
+#define x87_purgecache STEPNAME(x87_purgecache)
+#define sse_purgecache STEPNAME(sse_purgecache)
+#define fpu_reflectcache STEPNAME(fpu_reflectcache)
+#define fpu_unreflectcache STEPNAME(fpu_unreflectcache)
+
+#define CacheTransform STEPNAME(CacheTransform)
+#define rv64_move64 STEPNAME(rv64_move64)
+#define rv64_move32 STEPNAME(rv64_move32)
+
+/* setup r2 to address pointed by */
+uintptr_t geted(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int* l, int i12, int delta);
+
+/* setup r2 to address pointed by */
+uintptr_t geted32(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int* l, int i12, int delta);
+
+/* setup r2 to address pointed by */
+//uintptr_t geted16(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int absmax, uint32_t mask, int s);
+
+
+// generic x64 helper
+void jump_to_epilog(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst);
+void jump_to_epilog_fast(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst);
+void jump_to_next(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst);
+void ret_to_epilog(dynarec_rv64_t* dyn, int ninst, rex_t rex);
+void retn_to_epilog(dynarec_rv64_t* dyn, int ninst, rex_t rex, int n);
+void iret_to_epilog(dynarec_rv64_t* dyn, int ninst, int is64bits);
+void call_c(dynarec_rv64_t* dyn, int ninst, void* fnc, int reg, int ret, int saveflags, int save_reg);
+void call_n(dynarec_rv64_t* dyn, int ninst, void* fnc, int w);
+void grab_segdata(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, int reg, int segment);
+void emit_cmp8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6);
+void emit_cmp16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6);
+void emit_cmp32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5, int s6);
+void emit_cmp8_0(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4);
+void emit_cmp16_0(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4);
+void emit_cmp32_0(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4);
+void emit_test8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+void emit_test16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+void emit_test32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5);
+void emit_test32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4, int s5);
+void emit_add32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5);
+void emit_add32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5);
+void emit_add8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4);
+void emit_add8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4);
+void emit_sub32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5);
+void emit_sub32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5);
+void emit_sub8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+void emit_sub8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4, int s5);
+void emit_or32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4);
+void emit_or32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4);
+void emit_xor32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4);
+void emit_xor32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4);
+void emit_and32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4);
+void emit_and32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4);
+void emit_or8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4);
+void emit_or8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4);
+void emit_xor8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4);
+void emit_xor8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_and8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4);
+void emit_and8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_add16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+//void emit_add16c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_sub16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+//void emit_sub16c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_or16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4);
+//void emit_or16c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_xor16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+//void emit_xor16c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_and16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4);
+//void emit_and16c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_inc32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5);
+void emit_inc16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4);
+void emit_inc8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4);
+void emit_dec32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5);
+void emit_dec16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+void emit_dec8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4);
+void emit_adc32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5, int s6);
+//void emit_adc32c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_adc8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+void emit_adc8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5, int s6);
+void emit_adc16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+//void emit_adc16c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_sbb32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5);
+//void emit_sbb32c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_sbb8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+void emit_sbb8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5, int s6);
+void emit_sbb16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5);
+//void emit_sbb16c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4);
+void emit_neg32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3);
+void emit_neg16(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4);
+void emit_neg8(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4);
+void emit_shl32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5);
+void emit_shl32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4, int s5);
+void emit_shr32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4);
+void emit_shr32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4);
+void emit_sar32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4);
+void emit_rol32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4);
+void emit_ror32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4);
+void emit_rol32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4);
+void emit_ror32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4);
+void emit_shrd32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4);
+void emit_shld32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5);
+
+void emit_pf(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4);
+
+// x87 helper
+// cache of the local stack counter, to avoid upadte at every call
+void x87_stackcount(dynarec_rv64_t* dyn, int ninst, int scratch);
+// fpu push. Return the Dd value to be used
+int x87_do_push(dynarec_rv64_t* dyn, int ninst, int s1, int t);
+// fpu push. Do not allocate a cache register. Needs a scratch register to do x87stack synch (or 0 to not do it)
+void x87_do_push_empty(dynarec_rv64_t* dyn, int ninst, int s1);
+// fpu pop. All previous returned Dd should be considered invalid
+void x87_do_pop(dynarec_rv64_t* dyn, int ninst, int s1);
+// get cache index for a x87 reg, return -1 if cache doesn't exist
+int x87_get_current_cache(dynarec_rv64_t* dyn, int ninst, int st, int t);
+// get cache index for a x87 reg, create the entry if needed
+int x87_get_cache(dynarec_rv64_t* dyn, int ninst, int populate, int s1, int s2, int a, int t);
+// get extcache index for a x87 reg
+int x87_get_extcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int a);
+// get vfpu register for a x87 reg, create the entry if needed
+int x87_get_st(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int a, int t);
+// get vfpu register for a x87 reg, create the entry if needed. Do not fetch the Stx if not already in cache
+int x87_get_st_empty(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int a, int t);
+// refresh a value from the cache ->emu (nothing done if value is not cached)
+void x87_refresh(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st);
+// refresh a value from the cache ->emu and then forget the cache (nothing done if value is not cached)
+void x87_forget(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st);
+// refresh the cache value from emu
+void x87_reget_st(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st);
+// swap 2 x87 regs
+void x87_swapreg(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int a, int b);
+// Set rounding according to cw flags, return reg to restore flags
+int x87_setround(dynarec_rv64_t* dyn, int ninst, int s1, int s2);
+// Restore round flag
+void x87_restoreround(dynarec_rv64_t* dyn, int ninst, int s1);
+// Set rounding according to mxcsr flags, return reg to restore flags
+int sse_setround(dynarec_rv64_t* dyn, int ninst, int s1, int s2);
+
+void CacheTransform(dynarec_rv64_t* dyn, int ninst, int cacheupd, int s1, int s2, int s3);
+
+void rv64_move64(dynarec_rv64_t* dyn, int ninst, int reg, int64_t val);
+void rv64_move32(dynarec_rv64_t* dyn, int ninst, int reg, int32_t val, int zeroup);
+
+#if STEP < 2
+#define CHECK_CACHE() 0
+#else
+#define CHECK_CACHE() (cacheupd = CacheNeedsTransform(dyn, ninst))
+#endif
+#define extcache_st_coherency STEPNAME(extcache_st_coherency)
+int extcache_st_coherency(dynarec_rv64_t* dyn, int ninst, int a, int b);
+
+#if STEP == 0
+#define ST_IS_F(A) 0
+#define X87_COMBINE(A, B) EXT_CACHE_ST_D
+#define X87_ST0 EXT_CACHE_ST_D
+#define X87_ST(A) EXT_CACHE_ST_D
+#elif STEP == 1
+#define ST_IS_F(A) (extcache_get_current_st(dyn, ninst, A)==EXT_CACHE_ST_F)
+#define X87_COMBINE(A, B) extcache_combine_st(dyn, ninst, A, B)
+#define X87_ST0 extcache_get_current_st(dyn, ninst, 0)
+#define X87_ST(A) extcache_get_current_st(dyn, ninst, A)
+#else
+#define ST_IS_F(A) (extcache_get_st(dyn, ninst, A)==EXT_CACHE_ST_F)
+#if STEP == 3
+#define X87_COMBINE(A, B) extcache_st_coherency(dyn, ninst, A, B)
+#else
+#define X87_COMBINE(A, B) extcache_get_st(dyn, ninst, A)
+#endif
+#define X87_ST0 extcache_get_st(dyn, ninst, 0)
+#define X87_ST(A) extcache_get_st(dyn, ninst, A)
+#endif
+
+//MMX helpers
+// get float register for a MMX reg, create the entry if needed
+int mmx_get_reg(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a);
+// get float register for a MMX reg, but don't try to synch it if it needed to be created
+int mmx_get_reg_empty(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a);
+// forget float register for a MMX reg, create the entry if needed
+void mmx_forget_reg(dynarec_rv64_t* dyn, int ninst, int a);
+
+//SSE/SSE2 helpers
+// get float register for a SSE reg, create the entry if needed
+int sse_get_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a, int single);
+// get float register for a SSE reg, but don't try to synch it if it needed to be created
+int sse_get_reg_empty(dynarec_rv64_t* dyn, int ninst, int s1, int a, int single);
+// forget float register for a SSE reg, create the entry if needed
+void sse_forget_reg(dynarec_rv64_t* dyn, int ninst, int a);
+// purge the XMM0..XMM7 cache (before function call)
+void sse_purge07cache(dynarec_rv64_t* dyn, int ninst, int s1);
+
+// common coproc helpers
+// reset the cache
+void fpu_reset(dynarec_rv64_t* dyn);
+// reset the cache with n
+void fpu_reset_cache(dynarec_rv64_t* dyn, int ninst, int reset_n);
+// propagate stack state
+void fpu_propagate_stack(dynarec_rv64_t* dyn, int ninst);
+// purge the FPU cache (needs 3 scratch registers)
+void fpu_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1, int s2, int s3);
+// purge MMX cache
+void mmx_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1);
+// purge x87 cache
+void x87_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1, int s2, int s3);
+void fpu_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3);
+void fpu_unreflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3);
+void fpu_pushcache(dynarec_rv64_t* dyn, int ninst, int s1, int not07);
+void fpu_popcache(dynarec_rv64_t* dyn, int ninst, int s1, int not07);
+
+
+uintptr_t dynarec64_00(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog);
+uintptr_t dynarec64_64(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog);
+//uintptr_t dynarec64_65(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep,int* ok, int* need_epilog);
+uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_67(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_D8(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+//uintptr_t dynarec64_DA(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_DB(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_DC(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_DD(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_DE(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_DF(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog);
+uintptr_t dynarec64_6664(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog);
+uintptr_t dynarec64_66F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog);
+uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog);
+uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog);
+
+#if STEP < 2
+#define PASS2(A)
+#else
+#define PASS2(A) A
+#endif
+
+#if STEP < 3
+#define PASS3(A)
+#else
+#define PASS3(A) A
+#endif
+
+#if STEP < 3
+#define MAYUSE(A) (void)A
+#else
+#define MAYUSE(A)
+#endif
+
+// GOCOND will use x1 and x3
+#define GOCOND(B, T1, T2) \
+ case B+0x0: \
+ INST_NAME(T1 "O " T2); \
+ GO( ANDI(x1, xFlags, 1<<F_OF2) \
+ , EQZ, NEZ, X_OF) \
+ break; \
+ case B+0x1: \
+ INST_NAME(T1 "NO " T2); \
+ GO( ANDI(x1, xFlags, 1<<F_OF2) \
+ , NEZ, EQZ, X_OF) \
+ break; \
+ case B+0x2: \
+ INST_NAME(T1 "C " T2); \
+ GO( ANDI(x1, xFlags, 1<<F_CF) \
+ , EQZ, NEZ, X_CF) \
+ break; \
+ case B+0x3: \
+ INST_NAME(T1 "NC " T2); \
+ GO( ANDI(x1, xFlags, 1<<F_CF) \
+ , NEZ, EQZ, X_CF) \
+ break; \
+ case B+0x4: \
+ INST_NAME(T1 "Z " T2); \
+ GO( ANDI(x1, xFlags, 1<<F_ZF) \
+ , EQZ, NEZ, X_ZF) \
+ break; \
+ case B+0x5: \
+ INST_NAME(T1 "NZ " T2); \
+ GO( ANDI(x1, xFlags, 1<<F_ZF) \
+ , NEZ, EQZ, X_ZF) \
+ break; \
+ case B+0x6: \
+ INST_NAME(T1 "BE " T2); \
+ GO( ANDI(x1, xFlags, (1<<F_CF)|(1<<F_ZF)) \
+ , EQZ, NEZ, X_CF|X_ZF) \
+ break; \
+ case B+0x7: \
+ INST_NAME(T1 "NBE " T2); \
+ GO( ANDI(x1, xFlags, (1<<F_CF)|(1<<F_ZF)) \
+ , NEZ, EQZ, X_CF|X_ZF) \
+ break; \
+ case B+0x8: \
+ INST_NAME(T1 "S " T2); \
+ GO( ANDI(x1, xFlags, 1<<F_SF) \
+ , EQZ, NEZ, X_SF) \
+ break; \
+ case B+0x9: \
+ INST_NAME(T1 "NS " T2); \
+ GO( ANDI(x1, xFlags, 1<<F_SF) \
+ , NEZ, EQZ, X_SF) \
+ break; \
+ case B+0xA: \
+ INST_NAME(T1 "P " T2); \
+ GO( ANDI(x1, xFlags, 1<<F_PF) \
+ , EQZ, NEZ, X_PF) \
+ break; \
+ case B+0xB: \
+ INST_NAME(T1 "NP " T2); \
+ GO( ANDI(x1, xFlags, 1<<F_PF) \
+ , NEZ, EQZ, X_PF) \
+ break; \
+ case B+0xC: \
+ INST_NAME(T1 "L " T2); \
+ GO( SRLI(x1, xFlags, F_SF-F_OF2); \
+ XOR(x1, x1, xFlags); \
+ ANDI(x1, x1, 1<<F_OF2) \
+ , EQZ, NEZ, X_SF|X_OF) \
+ break; \
+ case B+0xD: \
+ INST_NAME(T1 "GE " T2); \
+ GO( SRLI(x1, xFlags, F_SF-F_OF2); \
+ XOR(x1, x1, xFlags); \
+ ANDI(x1, x1, 1<<F_OF2) \
+ , NEZ, EQZ, X_SF|X_OF) \
+ break; \
+ case B+0xE: \
+ INST_NAME(T1 "LE " T2); \
+ GO( SRLI(x1, xFlags, F_SF-F_OF2); \
+ XOR(x1, x1, xFlags); \
+ ANDI(x1, x1, 1<<F_OF2); \
+ ANDI(x3, xFlags, 1<<F_ZF); \
+ OR(x1, x1, x3); \
+ ANDI(x1, x1, (1<<F_OF2) | (1<<F_ZF)) \
+ , EQZ, NEZ, X_SF|X_OF|X_ZF) \
+ break; \
+ case B+0xF: \
+ INST_NAME(T1 "G " T2); \
+ GO( SRLI(x1, xFlags, F_SF-F_OF2); \
+ XOR(x1, x1, xFlags); \
+ ANDI(x1, x1, 1<<F_OF2); \
+ ANDI(x3, xFlags, 1<<F_ZF); \
+ OR(x1, x1, x3); \
+ ANDI(x1, x1, (1<<F_OF2) | (1<<F_ZF)) \
+ , NEZ, EQZ, X_SF|X_OF|X_ZF) \
+ break
+
+#define NOTEST(s1) \
+ if(box64_dynarec_test) { \
+ SW(xZR, xEmu, offsetof(x64emu_t, test.test)); \
+ SW(xZR, xEmu, offsetof(x64emu_t, test.clean)); \
+ }
+#define SKIPTEST(s1) \
+ if(box64_dynarec_test) { \
+ SW(xZR, xEmu, offsetof(x64emu_t, test.clean)); \
+ }
+#define GOTEST(s1, s2) \
+ if(box64_dynarec_test) { \
+ MOV32w(s2, 1); \
+ SW(s2, xEmu, offsetof(x64emu_t, test.test)); \
+ }
+
+#define GETREX() \
+ rex.rex = 0; \
+ if(!rex.is32bits) \
+ while(opcode>=0x40 && opcode<=0x4f) { \
+ rex.rex = opcode; \
+ opcode = F8; \
+ }
+
+#endif //__DYNAREC_RV64_HELPER_H__
diff --git a/src/dynarec/rv64/dynarec_rv64_jmpnext.c b/src/dynarec/rv64/dynarec_rv64_jmpnext.c
new file mode 100644
index 0000000..9150dd4
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_jmpnext.c
@@ -0,0 +1,19 @@
+#include <stdint.h>
+
+#include "rv64_emitter.h"
+
+#define EMIT(A) *block = (A); ++block
+void CreateJmpNext(void* addr, void* next)
+{
+ uint32_t* block = (uint32_t*)addr;
+ uintptr_t diff = (intptr_t)next - (intptr_t)addr;
+ AUIPC(x2, SPLIT20(diff));
+ #if 1
+ LD(x2, x2, SPLIT12(diff));
+ #else
+ // Probably not usefull, but keeping the code, just in case
+ ADDI(x2, x2, SPLIT12(diff));
+ LR_D(x2, x2, 1, 1);
+ #endif
+ BR(x2);
+} \ No newline at end of file
diff --git a/src/dynarec/rv64/dynarec_rv64_pass0.h b/src/dynarec/rv64/dynarec_rv64_pass0.h
new file mode 100644
index 0000000..fbba8f2
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_pass0.h
@@ -0,0 +1,55 @@
+
+#define INIT uintptr_t sav_addr=addr
+#define FINI \
+ dyn->isize = addr-sav_addr; \
+ dyn->insts[ninst].x64.addr = addr; \
+ if(ninst) dyn->insts[ninst-1].x64.size = dyn->insts[ninst].x64.addr - dyn->insts[ninst-1].x64.addr
+
+#define MESSAGE(A, ...)
+#define MAYSETFLAGS() dyn->insts[ninst].x64.may_set = 1
+#define READFLAGS(A) \
+ dyn->insts[ninst].x64.use_flags = A; dyn->f.dfnone = 1;\
+ dyn->f.pending=SF_SET
+#define SETFLAGS(A,B) \
+ dyn->insts[ninst].x64.set_flags = A; \
+ dyn->insts[ninst].x64.state_flags = B; \
+ dyn->f.pending=(B)&SF_SET_PENDING; \
+ dyn->f.dfnone=((B)&SF_SET)?1:0;
+#define EMIT(A)
+#define JUMP(A, C) add_next(dyn, (uintptr_t)A); dyn->insts[ninst].x64.jmp = A; dyn->insts[ninst].x64.jmp_cond = C
+#define BARRIER(A) if(A!=BARRIER_MAYBE) {fpu_purgecache(dyn, ninst, 0, x1, x2, x3); dyn->insts[ninst].x64.barrier = A;} else dyn->insts[ninst].barrier_maybe = 1
+#define BARRIER_NEXT(A) dyn->insts[ninst+1].x64.barrier = A
+#define NEW_INST \
+ ++dyn->size; \
+ if(dyn->size+3>=dyn->cap) { \
+ dyn->insts = (instruction_native_t*)dynaRealloc(dyn->insts, sizeof(instruction_native_t)*dyn->cap*2);\
+ memset(&dyn->insts[dyn->cap], 0, sizeof(instruction_native_t)*dyn->cap); \
+ dyn->cap *= 2; \
+ } \
+ dyn->insts[ninst].x64.addr = ip; \
+ dyn->e.combined1 = dyn->e.combined2 = 0;\
+ dyn->e.swapped = 0; dyn->e.barrier = 0; \
+ for(int i=0; i<16; ++i) dyn->e.olds[i].v = 0;\
+ dyn->insts[ninst].f_entry = dyn->f; \
+ if(ninst) {dyn->insts[ninst-1].x64.size = dyn->insts[ninst].x64.addr - dyn->insts[ninst-1].x64.addr;}
+
+#define INST_EPILOG \
+ dyn->insts[ninst].f_exit = dyn->f; \
+ dyn->insts[ninst].e = dyn->e; \
+ dyn->insts[ninst].x64.has_next = (ok>0)?1:0;
+#define INST_NAME(name)
+#define DEFAULT \
+ --dyn->size; \
+ *ok = -1; \
+ if(box64_dynarec_log>=LOG_INFO || box64_dynarec_dump || box64_dynarec_missing) {\
+ dynarec_log(LOG_NONE, "%p: Dynarec stopped because of %sOpcode %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", \
+ (void*)ip, rex.is32bits?"32bits ":"",\
+ PKip(0), \
+ PKip(1), PKip(2), PKip(3), \
+ PKip(4), PKip(5), PKip(6), \
+ PKip(7), PKip(8), PKip(9), \
+ PKip(10),PKip(11),PKip(12), \
+ PKip(13),PKip(14)); \
+ printFunctionAddr(ip, " => "); \
+ dynarec_log(LOG_NONE, "\n"); \
+ }
diff --git a/src/dynarec/rv64/dynarec_rv64_pass1.h b/src/dynarec/rv64/dynarec_rv64_pass1.h
new file mode 100644
index 0000000..34d0a46
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_pass1.h
@@ -0,0 +1,15 @@
+#define INIT
+#define FINI
+#define MESSAGE(A, ...)
+#define EMIT(A)
+#define NEW_INST \
+ dyn->insts[ninst].f_entry = dyn->f; \
+ dyn->e.combined1 = dyn->e.combined2 = 0;\
+ for(int i=0; i<16; ++i) dyn->e.olds[i].v = 0;\
+ dyn->e.swapped = 0; dyn->e.barrier = 0
+
+#define INST_EPILOG \
+ dyn->insts[ninst].e = dyn->e; \
+ dyn->insts[ninst].f_exit = dyn->f
+
+#define INST_NAME(name)
diff --git a/src/dynarec/rv64/dynarec_rv64_pass2.h b/src/dynarec/rv64/dynarec_rv64_pass2.h
new file mode 100644
index 0000000..1c6e473
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_pass2.h
@@ -0,0 +1,18 @@
+#define INIT dyn->native_size = 0
+#define FINI \
+ if(ninst) { \
+ dyn->insts[ninst].address = (dyn->insts[ninst-1].address+dyn->insts[ninst-1].size); \
+ dyn->insts_size += 1+((dyn->insts[ninst].x64.size>(dyn->insts[ninst].size/4))?dyn->insts[ninst].x64.size:(dyn->insts[ninst].size/4))/15; \
+ }
+
+#define MESSAGE(A, ...)
+#define EMIT(A) do {dyn->insts[ninst].size+=4; dyn->native_size+=4;}while(0)
+#define NEW_INST \
+ if(ninst) { \
+ dyn->insts[ninst].address = (dyn->insts[ninst-1].address+dyn->insts[ninst-1].size); \
+ dyn->insts_size += 1+((dyn->insts[ninst-1].x64.size>(dyn->insts[ninst-1].size/4))?dyn->insts[ninst-1].x64.size:(dyn->insts[ninst-1].size/4))/15; \
+ }
+#define INST_EPILOG dyn->insts[ninst].epilog = dyn->native_size;
+#define INST_NAME(name)
+#define TABLE64(A, V) {Table64(dyn, (V), 2); EMIT(0); EMIT(0);}
+#define FTABLE64(A, V) {mmx87_regs_t v = {.d = V}; Table64(dyn, v.q, 2); EMIT(0); EMIT(0);} \ No newline at end of file
diff --git a/src/dynarec/rv64/dynarec_rv64_pass3.h b/src/dynarec/rv64/dynarec_rv64_pass3.h
new file mode 100644
index 0000000..459c4e1
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_pass3.h
@@ -0,0 +1,23 @@
+#define INIT
+#define FINI \
+ if(ninst) \
+ addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst].x64.size, dyn->insts[ninst].size/4); \
+ addInst(dyn->instsize, &dyn->insts_size, 0, 0);
+#define EMIT(A) \
+ do { \
+ if(box64_dynarec_dump) print_opcode(dyn, ninst, (uint32_t)A); \
+ *(uint32_t*)(dyn->block) = (uint32_t)(A); \
+ dyn->block += 4; dyn->native_size += 4; \
+ dyn->insts[ninst].size2 += 4; \
+ }while(0)
+
+#define MESSAGE(A, ...) if(box64_dynarec_dump) dynarec_log(LOG_NONE, __VA_ARGS__)
+#define NEW_INST \
+ if(box64_dynarec_dump) print_newinst(dyn, ninst); \
+ if(ninst) \
+ addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst-1].x64.size, dyn->insts[ninst-1].size/4);
+#define INST_EPILOG
+#define INST_NAME(name) inst_name_pass3(dyn, ninst, name, rex)
+
+#define TABLE64(A, V) {int val64offset = Table64(dyn, (V), 3); MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); AUIPC(A, SPLIT20(val64offset)); LD(A, A, SPLIT12(val64offset));}
+#define FTABLE64(A, V) {mmx87_regs_t v = {.d = V}; int val64offset = Table64(dyn, v.q, 3); MESSAGE(LOG_DUMP, " FTable64: %g\n", v.d); AUIPC(x1, SPLIT20(val64offset)); FLD(A, x1, SPLIT12(val64offset));}
diff --git a/src/dynarec/rv64/dynarec_rv64_private.h b/src/dynarec/rv64/dynarec_rv64_private.h
new file mode 100644
index 0000000..9913529
--- /dev/null
+++ b/src/dynarec/rv64/dynarec_rv64_private.h
@@ -0,0 +1,150 @@
+#ifndef __DYNAREC_RV64_PRIVATE_H_
+#define __DYNAREC_RV64_PRIVATE_H_
+#include <stdint.h>
+
+#include "../dynarec_private.h"
+
+typedef struct x64emu_s x64emu_t;
+typedef struct dynablock_s dynablock_t;
+typedef struct instsize_s instsize_t;
+
+#define BARRIER_MAYBE 8
+
+#define EXT_CACHE_NONE 0
+#define EXT_CACHE_ST_D 1
+#define EXT_CACHE_ST_F 2
+#define EXT_CACHE_MM 3
+#define EXT_CACHE_SS 4
+#define EXT_CACHE_SD 5
+#define EXT_CACHE_SCR 6
+typedef union ext_cache_s {
+ int8_t v;
+ struct {
+ uint8_t t:4; // reg type
+ uint8_t n:4; // reg number
+ };
+} ext_cache_t;
+typedef union sse_cache_s {
+ int8_t v;
+ struct {
+ uint8_t reg:7;
+ uint8_t single:1;
+ };
+} sse_cache_t;
+typedef union sse_old_s {
+ int8_t v;
+ struct {
+ uint8_t changed:1;
+ uint8_t purged:1;
+ uint8_t reg:4;
+ uint8_t single:1;
+ };
+} sse_old_t;
+typedef struct extcache_s {
+ // ext cache
+ ext_cache_t extcache[24];
+ int8_t stack;
+ int8_t stack_next;
+ int8_t stack_pop;
+ int8_t stack_push;
+ uint8_t combined1;
+ uint8_t combined2;
+ uint8_t swapped; // the combined reg were swapped
+ uint8_t barrier; // is there a barrier at instruction epilog?
+ uint32_t news; // bitmask, wich neoncache are new for this opcode
+ sse_old_t olds[16]; // SSE regs has changed or has been removed
+ // fpu cache
+ int8_t x87cache[8]; // cache status for the 8 x87 register behind the fpu stack
+ int8_t x87reg[8]; // reg used for x87cache entry
+ int8_t mmxcache[8]; // cache status for the 8 MMX registers
+ sse_cache_t ssecache[16]; // cache status for the 16 SSE(2) registers
+ int8_t fpuused[24]; // all 10..31 & 0..1 double reg from fpu, used by x87, sse and mmx
+ int8_t x87stack; // cache stack counter
+ int8_t mmxcount; // number of mmx register used (not both mmx and x87 at the same time)
+ int8_t fpu_scratch; // scratch counter
+ int8_t fpu_extra_qscratch; // some opcode need an extra quad scratch register
+ int8_t fpu_reg; // x87/sse/mmx reg counter
+} extcache_t;
+
+typedef struct flagcache_s {
+ int pending; // is there a pending flags here, or to check?
+ int dfnone; // if deferred flags is already set to df_none
+} flagcache_t;
+
+typedef struct instruction_rv64_s {
+ instruction_x64_t x64;
+ uintptr_t address; // (start) address of the arm emitted instruction
+ uintptr_t epilog; // epilog of current instruction (can be start of next, or barrier stuff)
+ int size; // size of the arm emitted instruction
+ int size2; // size of the arm emitted instrucion after pass2
+ int pred_sz; // size of predecessor list
+ int *pred; // predecessor array
+ uintptr_t mark, mark2, mark3;
+ uintptr_t markf, markf2;
+ uintptr_t markseg;
+ uintptr_t marklock;
+ int pass2choice;// value for choices that are fixed on pass2 for pass3
+ uintptr_t natcall;
+ int retn;
+ int barrier_maybe;
+ flagcache_t f_exit; // flags status at end of intruction
+ extcache_t e; // extcache at end of intruction (but before poping)
+ flagcache_t f_entry; // flags status before the instruction begin
+} instruction_rv64_t;
+
+typedef struct dynarec_rv64_s {
+ instruction_rv64_t* insts;
+ int32_t size;
+ int32_t cap;
+ uintptr_t start; // start of the block
+ uint32_t isize; // size in byte of x64 instructions included
+ void* block; // memory pointer where next instruction is emitted
+ uintptr_t native_start; // start of the arm code
+ size_t native_size; // size of emitted arm code
+ uintptr_t last_ip; // last set IP in RIP (or NULL if unclean state) TODO: move to a cache something
+ uint64_t* table64; // table of 64bits value
+ int table64size;// size of table (will be appended at end of executable code)
+ int table64cap;
+ uintptr_t tablestart;
+ uintptr_t jmp_next; // address of the jump_next address
+ flagcache_t f;
+ extcache_t e; // cache for the 10..31 0..1 double reg from fpu, plus x87 stack delta
+ uintptr_t* next; // variable array of "next" jump address
+ int next_sz;
+ int next_cap;
+ int* predecessor;// single array of all predecessor
+ dynablock_t* dynablock;
+ instsize_t* instsize;
+ size_t insts_size; // size of the instruction size array (calculated)
+ uint8_t smread; // for strongmem model emulation
+ uint8_t smwrite; // for strongmem model emulation
+ uintptr_t forward; // address of the last end of code while testing forward
+ uintptr_t forward_to; // address of the next jump to (to check if everything is ok)
+ int32_t forward_size; // size at the forward point
+ int forward_ninst; // ninst at the forward point
+ uint8_t always_test;
+} dynarec_rv64_t;
+
+// convert idx (0..24) to reg index (10..31 0..1)
+#define EXTREG(A) (((A)+10)&31)
+// convert reg index (10..31 0..1) or idx (0..24)
+#define EXTIDX(A) (((A)-10)&31)
+
+void add_next(dynarec_rv64_t *dyn, uintptr_t addr);
+uintptr_t get_closest_next(dynarec_rv64_t *dyn, uintptr_t addr);
+int is_nops(dynarec_rv64_t *dyn, uintptr_t addr, int n);
+int is_instructions(dynarec_rv64_t *dyn, uintptr_t addr, int n);
+
+int Table64(dynarec_rv64_t *dyn, uint64_t val, int pass); // add a value to table64 (if needed) and gives back the imm19 to use in LDR_literal
+
+void CreateJmpNext(void* addr, void* next);
+
+#define GO_TRACE(A, B) \
+ GETIP(addr); \
+ MV(A1, xRIP); \
+ STORE_XEMU_CALL(); \
+ MOV64x(A2, B); \
+ CALL(A, -1); \
+ LOAD_XEMU_CALL()
+
+#endif //__DYNAREC_RV64_PRIVATE_H_ \ No newline at end of file
diff --git a/src/dynarec/rv64/rv64_emitter.h b/src/dynarec/rv64/rv64_emitter.h
new file mode 100644
index 0000000..f23c671
--- /dev/null
+++ b/src/dynarec/rv64/rv64_emitter.h
@@ -0,0 +1,654 @@
+#ifndef __RV64_EMITTER_H__
+#define __RV64_EMITTER_H__
+/*
+ RV64 Emitter
+
+*/
+
+// RV64 ABI
+/*
+reg name description saver
+------------------------------------------------------
+x0 zero Hard-wired zero —
+x1 ra Return address Caller
+x2 sp Stack pointer Callee
+x3 gp Global pointer —
+x4 tp Thread pointer —
+x5–7 t0–2 Temporaries Caller
+x8 s0/fp Saved register/frame pointer Callee
+x9 s1 Saved register Callee
+x10–11 a0–1 Function arguments/return val. Caller
+x12–17 a2–7 Function arguments Caller
+x18–27 s2–11 Saved registers Callee
+x28–31 t3–6 Temporaries Caller
+-------------------------------------------------------
+f0–7 ft0–7 FP temporaries Caller
+f8–9 fs0–1 FP saved registers Callee
+f10–11 fa0–1 FP arguments/return values Caller
+f12–17 fa2–7 FP arguments Caller
+f18–27 fs2–11 FP saved registers Callee
+f28–31 ft8–11 FP temporaries Caller
+*/
+// x86 Register mapping
+#define xRAX 16
+#define xRCX 17
+#define xRDX 18
+#define xRBX 19
+#define xRSP 20
+#define xRBP 21
+#define xRSI 22
+#define xRDI 23
+#define xR8 24
+#define xR9 25
+#define xR10 26
+#define xR11 27
+#define xR12 28
+#define xR13 29
+#define xR14 30
+#define xR15 31
+#define xFlags 8
+#define xRIP 7
+
+// 32bits version
+#define wEAX xRAX
+#define wECX xRCX
+#define wEDX xRDX
+#define wEBX xRBX
+#define wESP xRSP
+#define wEBP xRBP
+#define wESI xRSI
+#define wEDI xRDI
+#define wR8 xR8
+#define wR9 xR9
+#define wR10 xR10
+#define wR11 xR11
+#define wR12 xR12
+#define wR13 xR13
+#define wR14 xR14
+#define wR15 xR15
+#define wFlags xFlags
+// scratch registers
+#define x1 11
+#define x2 12
+#define x3 13
+#define x4 14
+#define x5 15
+#define x6 6
+#define x9 9
+// used to clear the upper 32bits
+#define xMASK 5
+// 32bits version of scratch
+#define w1 x1
+#define w2 x2
+#define w3 x3
+#define w4 x4
+#define w5 x5
+#define w6 x6
+// emu is r10
+#define xEmu 10
+// RV64 RA
+#define xRA 1
+#define xSP 2
+// RV64 args
+#define A0 10
+#define A1 11
+#define A2 12
+#define A3 13
+#define A4 14
+#define A5 15
+#define A6 16
+#define A7 17
+// xZR reg is 0
+#define xZR 0
+#define wZR xZR
+
+// replacement for F_OF internaly, using a reserved bit. Need to use F_OF2 internaly, never F_OF directly!
+#define F_OF2 F_res3
+
+// split a 32bits value in 20bits + 12bits, adjust the upper part is 12bits is negative
+#define SPLIT20(A) (((A)+0x800)>>12)
+#define SPLIT12(A) ((A)&0xfff)
+
+// MOV64x/MOV32w is quite complex, so use a function for this
+#define MOV64x(A, B) rv64_move64(dyn, ninst, A, B)
+#define MOV32w(A, B) rv64_move32(dyn, ninst, A, B, 1)
+#define MOV64xw(A, B) if(rex.w) {MOV64x(A, B);} else {MOV32w(A, B);}
+#define MOV64z(A, B) if(rex.is32bits) {MOV32w(A, B);} else {MOV64x(A, B);}
+
+// ZERO the upper part
+#define ZEROUP(r) AND(r, r, xMASK)
+
+#define R_type(funct7, rs2, rs1, funct3, rd, opcode) ((funct7)<<25 | (rs2)<<20 | (rs1)<<15 | (funct3)<<12 | (rd)<<7 | (opcode))
+#define I_type(imm12, rs1, funct3, rd, opcode) ((imm12)<<20 | (rs1)<<15 | (funct3)<<12 | (rd)<<7 | (opcode))
+#define S_type(imm12, rs2, rs1, funct3, opcode) (((imm12)>>5)<<25 | (rs2)<<20 | (rs1)<<15 | (funct3)<<12 | ((imm12)&31)<<7 | (opcode))
+#define B_type(imm13, rs2, rs1, funct3, opcode) ((((imm13)>>12)&1)<<31 | (((imm13)>>5)&63)<<25 | (rs2)<<20 | (rs1)<<15 | (funct3)<<12 | (((imm13)>>1)&15)<<8 | (((imm13)>>11)&1)<<7 | (opcode))
+#define U_type(imm32, rd, opcode) (((imm32)>>12)<<12 | (rd)<<7 | (opcode))
+#define J_type(imm21, rd, opcode) ((((imm21)>>20)&1)<<31 | (((imm21)>>1)&0b1111111111)<<21 | (((imm21)>>11)&1)<<20 | (((imm21)>>12)&0b11111111)<<12 | (rd)<<7 | (opcode))
+
+// RV32I
+// put imm20 in the [31:12] bits of rd, zero [11:0] and sign extend bits31
+#define LUI(rd, imm20) EMIT(U_type((imm20)<<12, rd, 0b0110111))
+
+// put PC+imm20 in rd
+#define AUIPC(rd, imm20) EMIT(U_type((imm20)<<12, rd, 0b0010111))
+
+#define JAL_gen(rd, imm21) J_type(imm21, rd, 0b1101111)
+// Unconditional branch, no return address set
+#define B(imm21) EMIT(JAL_gen(xZR, imm21))
+#define B__(reg1, reg2, imm21) B(imm21)
+// Unconditional branch, return set to xRA
+#define JAL(imm21) EMIT(JAL_gen(xRA, imm21))
+// Unconditional branch, without link
+#define J(imm21) EMIT(JAL_gen(xZR, imm21))
+
+#define JALR_gen(rd, rs1, imm12) I_type(imm12, rs1, 0b000, rd, 0b1100111)
+// Unconditionnal branch to r, no return address set
+#define BR(r) EMIT(JALR_gen(xZR, r, 0))
+// Unconditionnal branch to r+i12, no return address set
+#define BR_I12(r, imm12) EMIT(JALR_gen(xZR, r, (imm12)&0b111111111111))
+// Unconditionnal branch to r, return address set to xRA
+#define JALR(r) EMIT(JALR_gen(xRA, r, 0))
+// Unconditionnal branch to r+i12, return address set to xRA
+#define JALR_I12(r, imm12) EMIT(JALR_gen(xRA, r, (imm12)&0b111111111111))
+
+// rd = rs1 + imm12
+#define ADDI(rd, rs1, imm12) EMIT(I_type((imm12)&0b111111111111, rs1, 0b000, rd, 0b0010011))
+// rd = rs1 - imm12 (pseudo instruction)
+#define SUBI(rd, rs1, imm12) EMIT(I_type((-(imm12))&0b111111111111, rs1, 0b000, rd, 0b0010011))
+// rd = (rs1<imm12)?1:0
+#define SLTI(rd, rs1, imm12) EMIT(I_type((imm12)&0b111111111111, rs1, 0b010, rd, 0b0010011))
+// rd = (rs1<imm12)?1:0 unsigned
+#define SLTIU(rd, rs1, imm12) EMIT(I_type((imm12)&0b111111111111, rs1, 0b011, rd, 0b0010011))
+// rd = rs1 ^ imm12
+#define XORI(rd, rs1, imm12) EMIT(I_type((imm12)&0b111111111111, rs1, 0b100, rd, 0b0010011))
+// rd = rs1 | imm12
+#define ORI(rd, rs1, imm12) EMIT(I_type((imm12)&0b111111111111, rs1, 0b110, rd, 0b0010011))
+// rd = rs1 & imm12
+#define ANDI(rd, rs1, imm12) EMIT(I_type((imm12)&0b111111111111, rs1, 0b111, rd, 0b0010011))
+
+// rd = imm12
+#define MOV_U12(rd, imm12) ADDI(rd, xZR, imm12)
+// nop
+#define NOP() ADDI(xZR, xZR, 0)
+
+// rd = rs1 + rs2
+#define ADD(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b000, rd, 0b0110011))
+// rd = rs1 + rs2
+#define ADDW(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b000, rd, 0b0111011))
+// rd = rs1 + rs2
+#define ADDxw(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b000, rd, rex.w?0b0110011:0b0111011))
+// rd = rs1 + rs2
+#define ADDz(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b000, rd, rex.is32bits?0b0111011:0b0110011))
+// rd = rs1 - rs2
+#define SUB(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b000, rd, 0b0110011))
+// rd = rs1 - rs2
+#define SUBW(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b000, rd, 0b0111011))
+// rd = rs1 - rs2
+#define SUBxw(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b000, rd, rex.w?0b0110011:0b0111011))
+// rd = rs1 - rs2
+#define SUBz(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b000, rd, rex.is32bits?0b0111011:0b0110011))
+// rd = rs1<<rs2
+#define SLL(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b001, rd, 0b0110011))
+// rd = (rs1<rs2)?1:0
+#define SLT(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b010, rd, 0b0110011))
+// rd = (rs1<rs2)?1:0 Unsigned
+#define SLTU(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b011, rd, 0b0110011))
+// rd = rs1 ^ rs2
+#define XOR(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b100, rd, 0b0110011))
+// rd = rs1 ^ rs2
+#define XORxw(rd, rs1, rs2) do{ XOR(rd, rs1, rs2); if (!rex.w) ZEROUP(rd); }while(0)
+// rd = rs1>>rs2 logical
+#define SRL(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b101, rd, 0b0110011))
+// rd = rs1>>rs2 arithmetic
+#define SRA(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b101, rd, 0b0110011))
+// rd = rs1 | rs2
+#define OR(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b110, rd, 0b0110011))
+// rd = rs1 & rs2
+#define AND(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b111, rd, 0b0110011))
+
+// rd = rs1 (pseudo instruction)
+#define MV(rd, rs1) ADDI(rd, rs1, 0)
+// rd = rs1 (pseudo instruction)
+#define MVxw(rd, rs1) if(rex.w) {MV(rd, rs1);} else {AND(rd, rs1, xMASK);}
+// rd = rs1 (pseudo instruction)
+#define MVz(rd, rs1) if(rex.is32bits) {AND(rd, rs1, xMASK);} else {MV(rd, rs1);}
+// rd = !rs1
+#define NOT(rd, rs1) XORI(rd, rs1, -1)
+// rd = -rs1
+#define NEG(rd, rs1) SUB(rd, xZR, rs1)
+// rd = -rs1
+#define NEGxw(rd, rs1) SUBxw(rd, xZR, rs1)
+// rd = rs1 == 0
+#define SEQZ(rd, rs1) SLTIU(rd, rs1, 1)
+// rd = rs1 != 0
+#define SNEZ(rd, rs1) SLTU(rd, xZR, rs1)
+
+
+#define BEQ(rs1, rs2, imm13) EMIT(B_type(imm13, rs2, rs1, 0b000, 0b1100011))
+#define BNE(rs1, rs2, imm13) EMIT(B_type(imm13, rs2, rs1, 0b001, 0b1100011))
+#define BLT(rs1, rs2, imm13) EMIT(B_type(imm13, rs2, rs1, 0b100, 0b1100011))
+#define BGE(rs1, rs2, imm13) EMIT(B_type(imm13, rs2, rs1, 0b101, 0b1100011))
+#define BLTU(rs1, rs2, imm13) EMIT(B_type(imm13, rs2, rs1, 0b110, 0b1100011))
+#define BGEU(rs1, rs2, imm13) EMIT(B_type(imm13, rs2, rs1, 0b111, 0b1100011))
+
+// TODO: Find a better way to have conditionnal jumps? Imm is a relative jump address, so the the 2nd jump needs to be addapted
+#define BEQ_safe(rs1, rs2, imm) if((imm)>-0x1000 && (imm)<0x1000) {BEQ(rs1, rs2, imm); NOP();} else {BNE(rs1, rs2, 8); B(imm-4);}
+#define BNE_safe(rs1, rs2, imm) if((imm)>-0x1000 && (imm)<0x1000) {BNE(rs1, rs2, imm); NOP();} else {BEQ(rs1, rs2, 8); B(imm-4);}
+#define BLT_safe(rs1, rs2, imm) if((imm)>-0x1000 && (imm)<0x1000) {BLT(rs1, rs2, imm); NOP();} else {BGE(rs2, rs1, 8); B(imm-4);}
+#define BGE_safe(rs1, rs2, imm) if((imm)>-0x1000 && (imm)<0x1000) {BGE(rs1, rs2, imm); NOP();} else {BLT(rs2, rs1, 8); B(imm-4);}
+#define BLTU_safe(rs1, rs2, imm) if((imm)>-0x1000 && (imm)<0x1000) {BLTU(rs1, rs2, imm); NOP();} else {BGEU(rs2, rs1, 8); B(imm-4);}
+#define BGEU_safe(rs1, rs2, imm) if((imm)>-0x1000 && (imm)<0x1000) {BGEU(rs1, rs2, imm); NOP();} else {BLTU(rs2, rs1, 8); B(imm-4);}
+
+#define BEQZ(rs1, imm13) BEQ(rs1, 0, imm13)
+#define BNEZ(rs1, imm13) BNE(rs1, 0, imm13)
+
+#define BEQZ_safe(rs1, imm) if((imm)>-0x1000 && (imm)<0x1000) {BEQZ(rs1, imm); NOP();} else {BNEZ(rs1, 8); B(imm-4);}
+#define BNEZ_safe(rs1, imm) if((imm)>-0x1000 && (imm)<0x1000) {BNEZ(rs1, imm); NOP();} else {BEQZ(rs1, 8); B(imm-4);}
+
+// rd = 4-bytes[rs1+imm12] signed extended
+#define LW(rd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b010, rd, 0b0000011))
+// rd = 2-bytes[rs1+imm12] signed extended
+#define LH(rd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b001, rd, 0b0000011))
+// rd = byte[rs1+imm12] signed extended
+#define LB(rd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b000, rd, 0b0000011))
+// rd = 2-bytes[rs1+imm12] zero extended
+#define LHU(rd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b101, rd, 0b0000011))
+// rd = byte[rs1+imm12] zero extended
+#define LBU(rd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b100, rd, 0b0000011))
+// byte[rs1+imm12] = rs2
+#define SB(rs2, rs1, imm12) EMIT(S_type(imm12, rs2, rs1, 0b000, 0b0100011))
+// 2-bytes[rs1+imm12] = rs2
+#define SH(rs2, rs1, imm12) EMIT(S_type(imm12, rs2, rs1, 0b001, 0b0100011))
+// 4-bytes[rs1+imm12] = rs2
+#define SW(rs2, rs1, imm12) EMIT(S_type(imm12, rs2, rs1, 0b010, 0b0100011))
+
+#define PUSH1(reg) do {SD(reg, xRSP, -8); SUBI(xRSP, xRSP, 8);} while(0)
+#define POP1(reg) do {LD(reg, xRSP, 0); if (reg!=xRSP) ADDI(xRSP, xRSP, 8);} while(0)
+#define PUSH1_32(reg) do {SW(reg, xRSP, -4); SUBIW(xRSP, xRSP, 4);} while(0)
+#define POP1_32(reg) do {LWU(reg, xRSP, 0); if (reg!=xRSP) ADDIW(xRSP, xRSP, 4);} while(0)
+
+#define POP1z(reg) if(rex.is32bits) {POP1_32(reg);} else {POP1(reg);}
+#define PUSH1z(reg) if(rex.is32bits) {PUSH1_32(reg);} else {PUSH1(reg);}
+
+#define FENCE_gen(pred, succ) (((pred)<<24) | ((succ)<<20) | 0b0001111)
+#define FENCE() EMIT(FENCE_gen(3, 3))
+
+#define FENCE_I_gen() ((0b001<<12) | 0b0001111)
+#define FENCE_I() EMIT(FENCE_I_gen())
+
+#define EBREAK() EMIT(I_type(1, 0, 0, 0, 0b1110011))
+
+// RV64I
+#define LWU(rd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b110, rd, 0b0000011))
+
+// rd = [rs1 + imm12]
+#define LD(rd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b011, rd, 0b0000011))
+// rd = [rs1 + imm12]
+#define LDxw(rd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b011<<(1-rex.w), rd, 0b0000011))
+// rd = [rs1 + imm12]
+#define LDz(rd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b011<<rex.is32bits, rd, 0b0000011))
+// [rs1 + imm12] = rs2
+#define SD(rs2, rs1, imm12) EMIT(S_type(imm12, rs2, rs1, 0b011, 0b0100011))
+// [rs1 + imm12] = rs2
+#define SDxw(rs2, rs1, imm12) EMIT(S_type(imm12, rs2, rs1, 0b010+rex.w, 0b0100011))
+// [rs1 + imm12] = rs2
+#define SDz(rs2, rs1, imm12) EMIT(S_type(imm12, rs2, rs1, 0b010+(1-rex.is32bits), 0b0100011))
+
+// Shift Left Immediate
+#define SLLI(rd, rs1, imm6) EMIT(I_type(imm6, rs1, 0b001, rd, 0b0010011))
+// Shift Right Logical Immediate
+#define SRLI(rd, rs1, imm6) EMIT(I_type(imm6, rs1, 0b101, rd, 0b0010011))
+// Shift Right Arithmetic Immediate
+#define SRAI(rd, rs1, imm6) EMIT(I_type((imm6)|(0b010000<<6), rs1, 0b101, rd, 0b0010011))
+
+// rd = rs1 + imm12
+#define ADDIW(rd, rs1, imm12) EMIT(I_type((imm12)&0b111111111111, rs1, 0b000, rd, 0b0011011))
+// rd = rs1 - imm12
+#define SUBIW(rd, rs1, imm12) EMIT(I_type((-imm12)&0b111111111111, rs1, 0b000, rd, 0b0011011))
+// rd = rs1 + imm12
+#define ADDIxw(rd, rs1, imm12) EMIT(I_type((imm12)&0b111111111111, rs1, 0b000, rd, rex.w?0b0010011:0b0011011))
+// rd = rs1 + imm12
+#define ADDIz(rd, rs1, imm12) EMIT(I_type((imm12)&0b111111111111, rs1, 0b000, rd, rex.is32bits?0b0011011:0b0010011))
+
+#define SEXT_W(rd, rs1) ADDIW(rd, rs1, 0)
+
+// rd = rs1<<rs2
+#define SLLW(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b001, rd, 0b0111011))
+// rd = rs1>>rs2 logical
+#define SRLW(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b101, rd, 0b0111011))
+// rd = rs1>>rs2 arithmetic
+#define SRAW(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b101, rd, 0b0111011))
+
+#define SLLxw(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b001, rd, rex.w?0b0110011:0b0111011))
+#define SRLxw(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b101, rd, rex.w?0b0110011:0b0111011))
+#define SRAxw(rd, rs1, rs2) if(rex.w) {SRA(rd, rs1, rs2);} else {SRAW(rd, rs1, rs2); ZEROUP(rd);}
+
+// Shift Left Immediate, 32-bit, sign-extended
+#define SLLIW(rd, rs1, imm5) EMIT(I_type(imm5, rs1, 0b001, rd, 0b0011011))
+// Shift Left Immediate
+#define SLLIxw(rd, rs1, imm) if (rex.w) { SLLI(rd, rs1, imm); } else { SLLIW(rd, rs1, imm); }
+// Shift Right Logical Immediate, 32-bit, sign-extended
+#define SRLIW(rd, rs1, imm5) EMIT(I_type(imm5, rs1, 0b101, rd, 0b0011011))
+// Shift Right Logical Immediate
+#define SRLIxw(rd, rs1, imm) if (rex.w) { SRLI(rd, rs1, imm); } else { SRLIW(rd, rs1, imm); }
+// Shift Right Arithmetic Immediate, 32-bit, sign-extended
+#define SRAIW(rd, rs1, imm5) EMIT(I_type((imm5)|(0b0100000<<5), rs1, 0b101, rd, 0b0011011))
+// Shift Right Arithmetic Immediate
+#define SRAIxw(rd, rs1, imm) if (rex.w) { SRAI(rd, rs1, imm); } else { SRAIW(rd, rs1, imm); }
+
+#define CSRRW(rd, rs1, csr) EMIT(I_type(csr, rs1, 0b001, rd, 0b1110011))
+#define CSRRS(rd, rs1, csr) EMIT(I_type(csr, rs1, 0b010, rd, 0b1110011))
+#define CSRRC(rd, rs1, csr) EMIT(I_type(csr, rs1, 0b011, rd, 0b1110011))
+#define CSRRWI(rd, imm, csr) EMIT(I_type(csr, imm, 0b101, rd, 0b1110011))
+#define CSRRSI(rd, imm, csr) EMIT(I_type(csr, imm, 0b110, rd, 0b1110011))
+#define CSRRCI(rd, imm, csr) EMIT(I_type(csr, imm, 0b111, rd, 0b1110011))
+
+// RV32M
+// rd =(lower) rs1 * rs2 (both signed)
+#define MUL(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b000, rd, 0b0110011))
+// rd =(upper) rs1 * rs2 (both signed)
+#define MULH(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b001, rd, 0b0110011))
+// rd =(upper) (signed)rs1 * (unsigned)rs2
+#define MULHSU(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b010, rd, 0b0110011))
+// rd =(upper) rs1 * rs2 (both unsigned)
+#define MULHU(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b011, rd, 0b0110011))
+// rd =(upper) rs1 / rs2
+#define DIV(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b100, rd, 0b0110011))
+#define DIVU(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b101, rd, 0b0110011))
+// rd = rs1 mod rs2
+#define REM(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b110, rd, 0b0110011))
+#define REMU(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b111, rd, 0b0110011))
+
+// RV64M
+// rd = rs1 * rs2
+#define MULW(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b000, rd, 0b0111011))
+// rd = rs1 * rs2
+#define MULxw(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b000, rd, rex.w?0b0110011:0b0111011))
+// rd = rs1 / rs2
+#define DIVW(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b100, rd, 0b0111011))
+#define DIVxw(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b100, rd, rex.w?0b0110011:0b0111011))
+#define DIVUW(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b101, rd, 0b0111011))
+#define DIVUxw(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b101, rd, rex.w?0b0110011:0b0111011))
+// rd = rs1 mod rs2
+#define REMW(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b110, rd, 0b0111011))
+#define REMxw(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b110, rd, rex.w?0b0110011:0b0111011))
+#define REMUW(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b111, rd, 0b0111011))
+#define REMUxw(rd, rs1, rs2) EMIT(R_type(0b0000001, rs2, rs1, 0b111, rd, rex.w?0b0110011:0b0111011))
+
+#define AQ_RL(f5, aq, rl) ((f5 << 2) | ((aq&1) << 1) | (rl&1))
+
+// RV32A
+#define LR_W(rd, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00010, aq, rl), 0, rs1, 0b010, rd, 0b0101111))
+#define SC_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00011, aq, rl), rs2, rs1, 0b010, rd, 0b0101111))
+
+#define AMOSWAP_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00001, aq, rl), rs2, rs1, 0b010, rd, 0b0101111))
+
+// RV64A
+#define LR_D(rd, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00010, aq, rl), 0, rs1, 0b011, rd, 0b0101111))
+#define SC_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00011, aq, rl), rs2, rs1, 0b011, rd, 0b0101111))
+
+#define LRxw(rd, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00010, aq, rl), 0, rs1, 0b010|rex.w, rd, 0b0101111))
+#define SCxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00011, aq, rl), rs2, rs1, 0b010|rex.w, rd, 0b0101111))
+
+#define AMOSWAP_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00001, aq, rl), rs2, rs1, 0b011, rd, 0b0101111))
+
+// RV32F
+// Read round mode
+#define FRRM(rd) CSRRS(rd, xZR, 0x002)
+// Swap round mode
+#define FSRM(rd, rs) CSRRW(rd, rs, 0x002)
+// Write FP exception flags, immediate
+#define FSFLAGSI(imm) CSRRWI(xZR, imm, 0x0001)
+// Read FP exception flags to rd
+#define FRFLAGS(rd) CSRRS(rd, xZR, 0x0001)
+// Inexact
+#define FR_NX 0
+// Underflow
+#define FR_UF 1
+// Overflow
+#define FR_OF 2
+// Divide by Zero
+#define FR_DZ 3
+// Invalid Operation
+#define FR_NV 4
+
+// Round to Nearest, ties to Even
+#define RD_RNE 0b000
+// Round towards Zero
+#define RD_RTZ 0b001
+// Round Down (towards −∞)
+#define RD_RDN 0b010
+// Round Up (towards +∞)
+#define RD_RUP 0b011
+// Round to Nearest, ties to Max Magnitude
+#define RD_RMM 0b100
+// In instruction’s rm field, selects dynamic rounding mode;
+#define RD_RM 0b111
+#define RD_DYN RD_RM
+
+// load single precision from rs1+imm12 to frd
+#define FLW(frd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b010, frd, 0b0000111))
+// store single precision frs2 to rs1+imm12
+#define FSW(frs2, rs1, imm12) EMIT(S_type(imm12, frs2, rs1, 0b010, 0b0100111))
+// store rs1 with rs2 sign bit to rd
+#define FSGNJS(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b000, rd, 0b1010011))
+// move rs1 to rd
+#define FMVS(rd, rs1) FSGNJS(rd, rs1, rs1)
+// store rs1 with oposite rs2 sign bit to rd
+#define FSGNJNS(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b001, rd, 0b1010011))
+// -rs1 => rd
+#define FNEGS(rd, rs1) FSGNJNS(rd, rs1, rs1)
+// store rs1 with rs1^rs2 sign bit to rd
+#define FSGNJXS(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b010, rd, 0b1010011))
+// |rs1| => rd
+#define FABSS(rd, rs1) FSGNJXS(rd, rs1, rs1)
+// Move from Single
+#define FMVXW(rd, frs1) EMIT(R_type(0b1110000, 0b00000, frs1, 0b000, rd, 0b1010011))
+// Move to Single
+#define FMVWX(frd, rs1) EMIT(R_type(0b1111000, 0b00000, rs1, 0b000, frd, 0b1010011))
+// Convert from signed 32bits to Single
+#define FCVTSW(frd, rs1, rm) EMIT(R_type(0b1101000, 0b00000, rs1, rm, frd, 0b1010011))
+// Convert from Single to signed 32bits (trucated)
+#define FCVTWS(rd, frs1, rm) EMIT(R_type(0b1100000, 0b00000, frs1, rm, rd, 0b1010011))
+
+#define FADDS(frd, frs1, frs2) EMIT(R_type(0b0000000, frs2, frs1, 0b000, frd, 0b1010011))
+#define FSUBS(frd, frs1, frs2) EMIT(R_type(0b0000100, frs2, frs1, 0b000, frd, 0b1010011))
+#define FMULS(frd, frs1, frs2) EMIT(R_type(0b0001000, frs2, frs1, 0b000, frd, 0b1010011))
+#define FDIVS(frd, frs1, frs2) EMIT(R_type(0b0001100, frs2, frs1, 0b000, frd, 0b1010011))
+#define FSQRTS(frd, frs1) EMIT(R_type(0b0101100, 0b00000, frs1, 0b000, frd, 0b1010011))
+#define FMINS(frd, frs1, frs2) EMIT(R_type(0b0010100, frs2, frs1, 0b000, frd, 0b1010011))
+#define FMAXS(frd, frs1, frs2) EMIT(R_type(0b0010100, frs2, frs1, 0b001, frd, 0b1010011))
+
+// compare
+#define FEQS(rd, frs1, frs2) EMIT(R_type(0b1010000, frs2, frs1, 0b010, rd, 0b1010011))
+#define FLTS(rd, frs1, frs2) EMIT(R_type(0b1010000, frs2, frs1, 0b001, rd, 0b1010011))
+#define FLES(rd, frs1, frs2) EMIT(R_type(0b1010000, frs2, frs1, 0b000, rd, 0b1010011))
+
+// RV64F
+// Convert from signed 64bits to Single
+#define FCVTSL(frd, rs1, rm) EMIT(R_type(0b1101000, 0b00010, rs1, rm, frd, 0b1010011))
+// Convert from unsigned 64bits to Single
+#define FCVTSLU(frd, rs1, rm) EMIT(R_type(0b1101000, 0b00011, rs1, rm, frd, 0b1010011))
+// Convert from Single to signed 64bits
+#define FCVTLS(rd, frs1, rm) EMIT(R_type(0b1100000, 0b00010, frs1, rm, rd, 0b1010011))
+// Convert from Single to unsigned 64bits
+#define FCVTLUS(rd, frs1, rm) EMIT(R_type(0b1100000, 0b00011, frs1, rm, rd, 0b1010011))
+// onvert from Single to signed 32/64bits (trucated)
+#define FCVTSxw(rd, frs1, rm) EMIT(R_type(0b1100000, rex.w?0b00010:0b00000, frs1, rm, rd, 0b1010011))
+
+// RV32D
+// load double precision from rs1+imm12 to frd
+#define FLD(frd, rs1, imm12) EMIT(I_type(imm12, rs1, 0b011, frd, 0b0000111))
+// store double precision frs2 to rs1+imm12
+#define FSD(frs2, rs1, imm12) EMIT(S_type(imm12, frs2, rs1, 0b011, 0b0100111))
+// Convert Double frs1 to Single frd
+#define FCVTSD(frd, frs1) EMIT(R_type(0b0100000, 0b00001, frs1, 0b000, frd, 0b1010011))
+// Convert Single frs1 to Double frd
+#define FCVTDS(frd, frs1) EMIT(R_type(0b0100001, 0b00000, frs1, 0b000, frd, 0b1010011))
+// Convert from Double to signed 32bits
+#define FCVTWD(rd, frs1, rm) EMIT(R_type(0b1100001, 0b00000, frs1, rm, rd, 0b1010011))
+// Convert from Double to unsigned 32bits
+#define FCVTWUD(rd, frs1, rm) EMIT(R_type(0b1100001, 0b00001, frs1, rm, rd, 0b1010011))
+// store rs1 with rs2 sign bit to rd
+#define FSGNJD(rd, rs1, rs2) EMIT(R_type(0b0010001, rs2, rs1, 0b000, rd, 0b1010011))
+// move rs1 to rd
+#define FMVD(rd, rs1) FSGNJD(rd, rs1, rs1)
+// store rs1 with oposite rs2 sign bit to rd
+#define FSGNJND(rd, rs1, rs2) EMIT(R_type(0b0010001, rs2, rs1, 0b001, rd, 0b1010011))
+// -rs1 => rd
+#define FNEGD(rd, rs1) FSGNJND(rd, rs1, rs1)
+// store rs1 with rs1^rs2 sign bit to rd
+#define FSGNJXD(rd, rs1, rs2) EMIT(R_type(0b0010001, rs2, rs1, 0b010, rd, 0b1010011))
+// |rs1| => rd
+#define FABSD(rd, rs1) FSGNJXD(rd, rs1, rs1)
+// Convert from signed 32bits to Double
+#define FCVTDW(frd, rs1, rm) EMIT(R_type(0b1101001, 0b00000, rs1, rm, frd, 0b1010011))
+
+#define FEQD(rd, frs1, frs2) EMIT(R_type(0b1010001, frs2, frs1, 0b010, rd, 0b1010011))
+#define FLTD(rd, frs1, frs2) EMIT(R_type(0b1010001, frs2, frs1, 0b001, rd, 0b1010011))
+#define FLED(rd, frs1, frs2) EMIT(R_type(0b1010001, frs2, frs1, 0b000, rd, 0b1010011))
+
+#define FADDD(frd, frs1, frs2) EMIT(R_type(0b0000001, frs2, frs1, 0b000, frd, 0b1010011))
+#define FSUBD(frd, frs1, frs2) EMIT(R_type(0b0000101, frs2, frs1, 0b000, frd, 0b1010011))
+#define FMULD(frd, frs1, frs2) EMIT(R_type(0b0001001, frs2, frs1, 0b000, frd, 0b1010011))
+#define FDIVD(frd, frs1, frs2) EMIT(R_type(0b0001101, frs2, frs1, 0b000, frd, 0b1010011))
+#define FSQRTD(frd, frs1) EMIT(R_type(0b0101101, 0b00000, frs1, 0b000, frd, 0b1010011))
+#define FMIND(frd, frs1, frs2) EMIT(R_type(0b0010101, frs2, frs1, 0b000, frd, 0b1010011))
+#define FMAXD(frd, frs1, frs2) EMIT(R_type(0b0010101, frs2, frs1, 0b001, frd, 0b1010011))
+
+//RV64D
+// Move from Double
+#define FMVXD(rd, frs1) EMIT(R_type(0b1110001, 0b00000, frs1, 0b000, rd, 0b1010011))
+// Move to Double
+#define FMVDX(frd, rs1) EMIT(R_type(0b1111001, 0b00000, rs1, 0b000, frd, 0b1010011))
+// Convert from signed 64bits to Double
+#define FCVTDL(frd, rs1, rm) EMIT(R_type(0b1101001, 0b00010, rs1, rm, frd, 0b1010011))
+// Convert from unsigned 64bits to Double
+#define FCVTDLU(frd, rs1, rm) EMIT(R_type(0b1101001, 0b00011, rs1, rm, frd, 0b1010011))
+// Convert from Double to signed 64bits
+#define FCVTLD(rd, frs1, rm) EMIT(R_type(0b1100001, 0b00010, frs1, rm, rd, 0b1010011))
+// Convert from Double to unsigned 64bits
+#define FCVTLUD(rd, frs1, rm) EMIT(R_type(0b1100001, 0b00011, frs1, rm, rd, 0b1010011))
+
+// Convert from Double to signed integer
+#define FCVTLDxw(rd, frs1, rm) EMIT(R_type(0b1100001, 0b00000+(rex.w?0b10:0b00), frs1, rm, rd, 0b1010011))
+// Convert from Double to unsigned integer
+#define FCVTLUDxw(rd, frs1, rm) EMIT(R_type(0b1100001, 0b00001+(rex.w?0b10:0b00), frs1, rm, rd, 0b1010011))
+
+//Zba
+// Add unsigned word (Wz(rs1) + X(rs2))
+#define ADDUW(rd, rs1, rs2) EMIT(R_type(0b0000100, rs2, rs1, 0b000, rd, 0b0111011))
+// Zero-extend Word
+#define ZEXTW(rd, rs1) ADDUW(rd, rs1, xZR)
+// Shift left by 1 and add (rd = X(rs2) + X(rs1)<<1)
+#define SH1ADD(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b010, rd, 0b0110011))
+// Shift unsigned word left by 1 and add (rd = X(rs2) + Wz(rs1)<<1)
+#define SH1ADDUW(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b010, rd, 0b0111011))
+// Shift left by 2 and add (rd = X(rs2) + X(rs1)<<2)
+#define SH2ADD(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b100, rd, 0b0110011))
+// Shift unsigned word left by 2 and add (rd = X(rs2) + Wz(rs1)<<2)
+#define SH2ADDUW(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b100, rd, 0b0111011))
+// Shift left by 3 and add (rd = X(rs2) + X(rs1)<<3)
+#define SH3ADD(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b110, rd, 0b0110011))
+// Shift unsigned word left by 3 and add (rd = X(rs2) + Wz(rs1)<<3)
+#define SH3ADDUW(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b110, rd, 0b0111011))
+// Shift left unsigned word (immediate)
+#define SLLIUW(rd, rs1, imm) EMIT(R_type(0b0000100, imm, rs1, 0b001, rd, 0b0011011))
+// Shift left by 1,2 or 3 and add (rd = X(rs2) + X(rs1)<<x)
+#define SHxADD(rd, rs1, x, rs2) EMIT(R_type(0b0010000, rs2, rs1, (x)<<1, rd, 0b0110011))
+// Shift unsigned word left by 1,2 or 3 and add (rd = X(rs2) + Wz(rs1)<<x)
+#define SHxADDUW(rd, rs1, x, rs2) EMIT(R_type(0b0010000, rs2, rs1, (x)<<1, rd, 0b0111011))
+
+//Zbb
+// AND with reverted operand (rs1 & ~rs2)
+#define ANDN(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b111, rd, 0b0110011))
+// OR with reverted operand (rs1 | ~rs2)
+#define ORN(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b110, rd, 0b0110011))
+// Exclusive NOR (~(rs1 ^ rs2))
+#define XNOR(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b100, rd, 0b0110011))
+// Count leading zero bits
+#define CLZ(rd, rs) EMIT(R_type(0b0110000, 0b00000, rs, 0b001, rd, 0b0010011))
+// Count leading zero bits in word
+#define CLZW(rd, rs) EMIT(R_type(0b0110000, 0b00000, rs, 0b001, rd, 0b0011011))
+// Count leading zero bits
+#define CLZxw(rd, rs) EMIT(R_type(0b0110000, 0b00000, rs, 0b001, rd, rex.w?0b0010011:0b0011011))
+// Count trailing zero bits
+#define CTZ(rd, rs) EMIT(R_type(0b0110000, 0b00001, rs, 0b001, rd, 0b0010011))
+// Count trailing zero bits in word
+#define CTZW(rd, rs) EMIT(R_type(0b0110000, 0b00001, rs, 0b001, rd, 0b0011011))
+// Count trailing zero bits
+#define CTZxw(rd, rs) EMIT(R_type(0b0110000, 0b00001, rs, 0b001, rd, rex.w?0b0010011:0b0011011))
+// Count set bits
+#define CPOP(rd, rs) EMIT(R_type(0b0110000, 0b00010, rs, 0b001, rd, 0b0010011))
+// Count set bits in word
+#define CPOPW(rd, rs) EMIT(R_type(0b0110000, 0b00010, rs, 0b001, rd, 0b0011011))
+// Count set bits
+#define CPOPxw(rd, rs) EMIT(R_type(0b0110000, 0b00010, rs, 0b001, rd, rex.w?0b0010011:0b0011011))
+// Maximum
+#define MAX(rd, rs1, rs2) EMIT(R_type(0b0000101, rs2, rs1, 0b110, rd, 0b0110011))
+// Unisgned maximum
+#define MAXU(rd, rs1, rs2) EMIT(R_type(0b0000101, rs2, rs1, 0b111, rd, 0b0110011))
+// Minimum
+#define MIN(rd, rs1, rs2) EMIT(R_type(0b0000101, rs2, rs1, 0b100, rd, 0b0110011))
+// Unsigned minimum
+#define MINU(rd, rs1, rs2) EMIT(R_type(0b0000101, rs2, rs1, 0b101, rd, 0b0110011))
+// Sign-extend byte
+#define SEXTB(rd, rs) EMIT(R_type(0b0110000, 0b00100, rs, 0b001, rd, 0b0010011))
+// Sign-extend half-word
+#define SEXTH(rd, rs) EMIT(R_type(0b0110000, 0b00101, rs, 0b001, rd, 0b0010011))
+// Zero-extend half-word
+#define ZEXTH_(rd, rs) EMIT(R_type(0b0000100, 0b00000, rs, 0b100, rd, 0b0111011))
+// Zero-extend half-word
+#define ZEXTH(rd, rs) if(rv64_zbb) ZEXTH_(rd, rs); else {SLLI(rd, rs, 48); SRLI(rd, rd, 48);}
+// Rotate left (register)
+#define ROL(rd, rs1, rs2) EMIT(R_type(0b0110000, rs2, rs1, 0b001, rd, 0b0110011))
+// Rotate left word (register)
+#define ROLW(rd, rs1, rs2) EMIT(R_type(0b0110000, rs2, rs1, 0b001, rd, 0b0111011))
+// Rotate left (register)
+#define ROLxw(rd, rs1, rs2) EMIT(R_type(0b0110000, rs2, rs1, 0b001, rd, rex.w?0b0110011:0b0111011))
+// Rotate right (register)
+#define ROR(rd, rs1, rs2) EMIT(R_type(0b0110000, rs2, rs1, 0b101, rd, 0b0110011))
+// Rotate right (immediate)
+#define RORI(rd, rs1, shamt) EMIT(R_type(0b0110000, shamt, rs1, 0b101, rd, 0b0010011))
+// Rotate right word (immediate)
+#define RORIW(rd, rs1, shamt) EMIT(R_type(0b0110000, shamt, rs1, 0b101, rd, 0b0011011))
+// Rotate right (immediate)
+#define RORIxw(rd, rs1, shamt) EMIT(R_type(0b0110000, shamt, rs1, 0b101, rd, rex.w?0b0010011:0b0011011))
+// Rotate right word (register)
+#define RORW(rd, rs1, rs2) EMIT(R_type(0b0110000, rs2, rs1, 0b101, rd, 0b0111011))
+// Rotate right (register)
+#define RORxw(rd, rs1, rs2) EMIT(R_type(0b0110000, rs2, rs1, 0b101, rd, rex.w?0b0110011:0b0111011))
+// Bitwise OR Combine, byte granule (for all byte, if byte==0, res.byte=0, else res.byte=0xff)
+#define ORCB(rd, rs) EMIT(I_type(0b001010000111, rs, 0b101, rd, 0b0010011))
+// Byte-reverse register
+#define REV8(rd, rs) EMIT(I_type(0b011010111000, rs, 0b101, rd, 0b0010011))
+
+//Zbc
+// Carry-less multily (low-part)
+#define CLMUL(rd, rs1, rs2) EMIT(R_type(0b0000101, rs2, rs1, 0b001, rd, 0b0110011))
+// Carry-less multiply (high-part)
+#define CLMULH(rd, rs1, rs2) EMIT(R_type(0b0000101, rs2, rs1, 0b011, rd, 0b0110011))
+// Carry-less multiply (reversed)
+#define CLMULR(rd, rs1, rs2) EMIT(R_type(0b0000101, rs2, rs1, 0b010, rd, 0b0110011))
+
+//Zbs
+// encoding of the "imm" on RV64 use a slight different mask, but it will work using R_type with high bit of imm ovewriting low bit op func
+// Single-bit Clear (Register)
+#define BCLR(rd, rs1, rs2) EMIT(R_type(0b0100100, rs2, rs1, 0b001, rd, 0b0110011))
+// Single-bit Clear (Immediate)
+#define BCLI(rd, rs1, imm) EMIT(R_type(0b0100100, imm, rs1, 0b001, rd, 0b0010011))
+// Single-bit Extreact (Register)
+#define BEXT(rd, rs1, rs2) EMIT(R_type(0b0100100, rs2, rs1, 0b101, rd, 0b0110011))
+// Single-bit Extract (Immediate)
+#define BEXTI(rd, rs1, imm) EMIT(R_type(0b0100100, imm, rs1, 0b101, rd, 0b0010011))
+// Single-bit Invert (Register)
+#define BINV(rd, rs1, rs2) EMIT(R_type(0b0110100, rs2, rs1, 0b001, rd, 0b0110011))
+// Single-bit Invert (Immediate)
+#define BINVI(rd, rs1, imm) EMIT(R_type(0b0110100, imm, rs1, 0b001, rd, 0b0010011))
+// Single-bit Set (Register)
+#define BSET(rd, rs1, rs2) EMIT(R_type(0b0010100, rs2, rs1, 0b001, rd, 0b0110011))
+// Single-bit Set (Immediate)
+#define BSETI(rd, rs1, imm) EMIT(R_type(0b0010100, imm, rs1, 0b001, rd, 0b0010011))
+
+
+#endif //__RV64_EMITTER_H__
diff --git a/src/dynarec/rv64/rv64_epilog.S b/src/dynarec/rv64/rv64_epilog.S
new file mode 100644
index 0000000..17dc117
--- /dev/null
+++ b/src/dynarec/rv64/rv64_epilog.S
@@ -0,0 +1,65 @@
+//riscv epilog for dynarec
+//Save stuff, prepare stack and register
+//called with pointer to emu as 1st parameter
+//and address to jump to as 2nd parameter
+
+.text
+.align 4
+
+.global rv64_epilog
+.global rv64_epilog_fast
+
+rv64_epilog:
+ //update register -> emu
+ sd x16, (a0)
+ sd x17, 8(a0)
+ sd x18, 16(a0)
+ sd x19, 24(a0)
+ sd x20, 32(a0)
+ sd x21, 40(a0)
+ sd x22, 48(a0)
+ sd x23, 56(a0)
+ sd x24, 64(a0)
+ sd x25, 72(a0)
+ sd x26, 80(a0)
+ sd x27, 88(a0)
+ sd x28, 96(a0)
+ sd x29, 104(a0)
+ sd x30, 112(a0)
+ sd x31, 120(a0)
+ // adjust flags bit 5 -> bit 11
+ li x5, ~(1<<11)
+ and x8, x8, x5
+ andi x5, x8, 1<<5
+ slli x5, x5, 11-5
+ or x8, x8, x5
+ sd x8, 128(a0) //xFlags
+ sd x7, 136(a0) // put back reg value in emu, including EIP (so x7 must be EIP now)
+ // fallback to epilog_fast now, just restoring saved regs
+rv64_epilog_fast:
+ ld ra, (sp) // save ra
+ ld x8, 8(sp) // save fp
+ ld x18, (2*8)(sp)
+ ld x19, (3*8)(sp)
+ ld x20, (4*8)(sp)
+ ld x21, (5*8)(sp)
+ ld x22, (6*8)(sp)
+ ld x23, (7*8)(sp)
+ ld x24, (8*8)(sp)
+ ld x25, (9*8)(sp)
+ ld x26, (10*8)(sp)
+ ld x27, (11*8)(sp)
+ ld x9, (12*8)(sp)
+ fld f18, (13*8)(sp)
+ fld f19, (14*8)(sp)
+ fld f20, (15*8)(sp)
+ fld f21, (16*8)(sp)
+ fld f22, (17*8)(sp)
+ fld f23, (19*8)(sp)
+ fld f24, (19*8)(sp)
+ fld f25, (20*8)(sp)
+ fld f26, (21*8)(sp)
+ fld f27, (22*8)(sp)
+ addi sp, sp, (8 * 24)
+ //end, return...
+ ret
diff --git a/src/dynarec/rv64/rv64_lock.S b/src/dynarec/rv64/rv64_lock.S
new file mode 100644
index 0000000..d6ea9c4
--- /dev/null
+++ b/src/dynarec/rv64/rv64_lock.S
@@ -0,0 +1,232 @@
+// RV64 lock helper
+// there is 2 part: read and write
+// write return 0 on success, 1 on fail (value has been changed)
+
+.text
+.align 4
+
+.global rv64_lock_xchg_dd
+.global rv64_lock_xchg_d
+.global rv64_lock_storeifnull
+.global rv64_lock_storeifnull_d
+.global rv64_lock_storeifref
+.global rv64_lock_storeifref_d
+.global rv64_lock_storeifref2_d
+.global rv64_lock_decifnot0b
+.global rv64_lock_storeb
+.global rv64_lock_incif0
+.global rv64_lock_decifnot0
+.global rv64_lock_store
+.global rv64_lock_cas_d
+.global rv64_lock_cas_dd
+.global rv64_lock_cas_dq
+
+rv64_lock_xchg_dd:
+ // address is a0, value is a1, return old value in a0
+ amoswap.d.aqrl a0, a1, (a0)
+ ret
+
+rv64_lock_xchg_d:
+ // address is a0, value is a1, return old value in a0
+ amoswap.w.aqrl a0, a1, (a0)
+ ret
+
+rv64_lock_storeifnull:
+ // address is a0, value is a1, a1 store to a0 only if [a0] is 0. return old [a0] value
+ fence rw, rw
+1:
+ lr.d a2, (a0)
+ bnez a2, 2f
+ sc.d a3, a1, (a0)
+ bnez a3, 1b
+2:
+ mv a0, a2
+ ret
+
+rv64_lock_storeifnull_d:
+ // address is a0, value is a1, a1 store to a0 only if [a0] is 0. return old [a0] value
+ fence rw, rw
+1:
+ lr.w a2, (a0)
+ bnez a2, 2f
+ sc.w a3, a1, (a0)
+ bnez a3, 1b
+2:
+ mv a0, a2
+ ret
+
+rv64_lock_storeifref:
+ // address is a0, value is a1, a1 store to a0 only if [a0] is a2. return new [a0] value (so a1 or old value)
+ fence rw, rw
+1:
+ lr.d a3, (a0)
+ bne a2, a3, 2f
+ sc.d a4, a1, (a0)
+ bnez a4, 1b
+ fence rw, rw
+ mv a0, a1
+ ret
+2:
+ fence rw, rw
+ mv a0, a3
+ ret
+
+rv64_lock_storeifref_d:
+ // address is a0, value is a1, a1 store to a0 only if [a0] is a2. return new [a0] value (so a1 or old value)
+ fence rw, rw
+1:
+ lr.w a3, (a0)
+ bne a2, a3, 2f
+ sc.w a4, a1, (a0)
+ bnez a4, 1b
+ mv a0, a1
+ ret
+2:
+ mv a0, a3
+ ret
+
+rv64_lock_storeifref2_d:
+ // address is a0, value is a1, a1 store to a0 only if [a0] is a2. return old [a0] value
+ fence rw, rw
+1:
+ lr.w a3, (a0)
+ bne a2, a3, 2f
+ sc.w a4, a1, (a0)
+ bnez a4, 1b
+2:
+ mv a0, a3
+ ret
+
+rv64_lock_decifnot0b:
+ fence rw, rw
+ andi a3, a0, 3
+ andi a0, a0, ~3
+ slli a3, a3, 1 //TODO: make a jump table less hacky!
+ la a4, table
+ add a4, a4, a3
+ jr a4, 10
+table:
+ j 1f
+ j rv64_lock_decifnot0b_1 // all those are compressed
+ j rv64_lock_decifnot0b_2
+ j rv64_lock_decifnot0b_3
+1:
+ lr.w a1, (a0)
+ andi a3, a1, 0xff
+ beqz a3, 2f
+ addi a3, a3, -1
+ andi a1, a1, ~0xff
+ or a1, a1, a3
+ sc.w a2, a1, (a0)
+ bnez a2, 1b
+2:
+ ret
+rv64_lock_decifnot0b_1:
+ li a4, 0xffff00ff
+1:
+ lr.w a1, (a0)
+ srli a3, a1, 8
+ andi a3, a3, 0xff
+ beqz a3, 2f
+ addi a3, a3, -1
+ and a1, a1, a4
+ slli a3, a3, 8
+ or a1, a1, a3
+ sc.w a2, a1, (a0)
+ bnez a2, 1b
+2:
+ ret
+rv64_lock_decifnot0b_2:
+ li a4, 0xff00ffff
+1:
+ lr.w a1, (a0)
+ srli a3, a1, 16
+ andi a3, a3, 0xff
+ beqz a3, 2f
+ addi a3, a3, -1
+ and a1, a1, a4
+ slli a3, a3, 16
+ or a1, a1, a3
+ sc.w a2, a1, (a0)
+ bnez a2, 1b
+2:
+ ret
+rv64_lock_decifnot0b_3:
+ li a4, 0x00ffffff
+1:
+ lr.w a1, (a0)
+ srli a3, a1, 24
+ andi a3, a3, 0xff
+ beqz a3, 2f
+ addi a3, a3, -1
+ and a1, a1, a4
+ slli a3, a3, 24
+ or a1, a1, a3
+ sc.w a2, a1, (a0)
+ bnez a2, 1b
+2:
+ ret
+
+
+rv64_lock_storeb:
+ sb a1, 0(a0)
+ fence rw, rw
+ ret
+
+rv64_lock_decifnot0:
+ fence rw, rw
+1:
+ lr.w a1, (a0)
+ beqz a1, 2f
+ addi a1, a1, -1
+ sc.w a2, a1, (a0)
+ bnez a2, 1b
+2:
+ mv a0, a1
+ ret
+
+rv64_lock_incif0:
+ fence rw, rw
+1:
+ lr.w a1, (a0)
+ bnez a1, 2f
+ addi a1, a1, 1
+ sc.w a2, a1, (a0)
+ bnez a2, 1b
+2:
+ mv a0, a1
+ ret
+
+rv64_lock_store:
+ sw a1, 0(a0)
+ fence rw, rw
+ ret
+
+rv64_lock_cas_d:
+ lr.w t0, (a0)
+ bne t0, a1, 1f
+ sc.w a0, a2, (a0)
+ ret
+1:
+ li a0, 1
+ ret
+
+rv64_lock_cas_dd:
+ lr.d t0, (a0)
+ bne t0, a1, 1f
+ sc.d a0, a2, (a0)
+ ret
+1:
+ li a0, 1
+ ret
+
+rv64_lock_cas_dq:
+ mv a4, a0
+ lr.d t0, (a0)
+ bne t0, a1, 1f
+ sc.d a0, a2, (a0)
+ sd a3,(a4)
+ ret
+1:
+ li a0, 1
+ ret \ No newline at end of file
diff --git a/src/dynarec/rv64/rv64_lock.h b/src/dynarec/rv64/rv64_lock.h
new file mode 100644
index 0000000..33ce09a
--- /dev/null
+++ b/src/dynarec/rv64/rv64_lock.h
@@ -0,0 +1,60 @@
+#ifndef __RV64_LOCK__H__
+#define __RV64_LOCK__H__
+#include <stdint.h>
+
+// Atomically store val at [p] if old [p] is ref. Return 0 if OK, 1 is not. p needs to be aligned
+extern int rv64_lock_cas_d(void* p, int32_t ref, int32_t val);
+
+// Atomically store val at [p] if old [p] is ref. Return 0 if OK, 1 is not. p needs to be aligned
+extern int rv64_lock_cas_dd(void* p, int64_t ref, int64_t val);
+
+// Atomically exchange value at [p] with val, return old p
+extern uintptr_t rv64_lock_xchg_dd(void* p, uintptr_t val);
+
+// Atomically exchange value at [p] with val, return old p
+extern uint32_t rv64_lock_xchg_d(void* p, uint32_t val);
+
+// Atomically store value to [p] only if [p] is NULL. Return old [p] value
+extern uint32_t rv64_lock_storeifnull_d(void*p, uint32_t val);
+
+// Atomically store value to [p] only if [p] is NULL. Return old [p] value
+extern void* rv64_lock_storeifnull(void*p, void* val);
+
+// Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old)
+extern void* rv64_lock_storeifref(void*p, void* val, void* ref);
+
+// Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old)
+extern uint32_t rv64_lock_storeifref_d(void*p, uint32_t val, uint32_t ref);
+
+// Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old)
+extern uint32_t rv64_lock_storeifref2_d(void*p, uint32_t val, uint32_t ref);
+
+// decrement atomically the byte at [p] (but only if p not 0)
+extern void rv64_lock_decifnot0b(void*p);
+
+// atomic store (with memory barrier)
+extern void rv64_lock_storeb(void*p, uint8_t b);
+
+// increment atomically the int at [p] only if it was 0. Return the old value of [p]
+extern int rv64_lock_incif0(void*p);
+
+// decrement atomically the int at [p] (but only if p not 0)
+extern int rv64_lock_decifnot0(void*p);
+
+// atomic store (with memory barrier)
+extern void rv64_lock_store(void*p, uint32_t v);
+
+// (mostly) Atomically store val1 and val2 at [p] if old [p] is ref. Return 0 if OK, 1 is not. p needs to be aligned
+extern int rv64_lock_cas_dq(void* p, uint64_t ref, uint64_t val1, uint64_t val2);
+
+// Not defined in assembler but in dynarec_rv64_functions
+uint8_t extract_byte(uint32_t val, void* address);
+uint32_t insert_byte(uint32_t val, uint8_t b, void* address);
+uint16_t extract_half(uint32_t val, void* address);
+uint32_t insert_half(uint32_t val, uint16_t h, void* address);
+
+uint8_t rv64_lock_xchg_b(void* addr, uint8_t v);
+extern int rv64_lock_cas_b(void* p, uint8_t ref, uint8_t val);
+extern int rv64_lock_cas_h(void* p, uint16_t ref, uint16_t val);
+
+#endif //__RV64_LOCK__H__
diff --git a/src/dynarec/rv64/rv64_next.S b/src/dynarec/rv64/rv64_next.S
new file mode 100644
index 0000000..ce34bb7
--- /dev/null
+++ b/src/dynarec/rv64/rv64_next.S
@@ -0,0 +1,51 @@
+//riscv update linker table for dynarec
+//called with pointer to emu as 1st parameter
+//and address of table to as 2nd parameter
+//ip is at r12
+
+.text
+.align 4
+
+.extern LinkNext
+
+.global rv64_next
+
+ .8byte 0 // NULL pointer before rv64_next, for getDB
+rv64_next:
+ // emu is a0
+ // IP address is a1
+ addi sp, sp, -(8 * 10)
+ sd a0, (sp)
+ sd a1, 8(sp)
+ sd x5, 16(sp)
+ sd x7, 24(sp)
+ sd x16, 32(sp)
+ sd x17, 40(sp)
+ sd x28, 48(sp)
+ sd x29, 56(sp)
+ sd x30, 64(sp)
+ sd x31, 72(sp)
+
+ mv a2, ra // "from" is in ra, so put in a2
+ addi a3, sp, 24 // a3 is address to change rip
+ // call the function
+1:
+ auipc a4, %pcrel_hi(LinkNext)
+ jalr a4, %pcrel_lo(1b)
+ // preserve return value
+ mv a3, a0
+ // pop regs
+ ld a0, (sp)
+ ld a1, 8(sp)
+ ld x5, 16(sp)
+ ld x7, 24(sp)
+ ld x16, 32(sp)
+ ld x17, 40(sp)
+ ld x28, 48(sp)
+ ld x29, 56(sp)
+ ld x30, 64(sp)
+ ld x31, 72(sp)
+ addi sp, sp, (8 * 10)
+ // return offset is jump address
+ jr a3
+
diff --git a/src/dynarec/rv64/rv64_printer.c b/src/dynarec/rv64/rv64_printer.c
new file mode 100644
index 0000000..db013c3
--- /dev/null
+++ b/src/dynarec/rv64/rv64_printer.c
@@ -0,0 +1,1450 @@
+#include <assert.h>
+#include <stddef.h>
+#include <string.h>
+#include <stdio.h>
+#include <inttypes.h>
+
+#include "rv64_printer.h"
+#include "debug.h"
+
+typedef struct {
+ int8_t rd;
+ int8_t rs1;
+ int8_t rs2;
+ int8_t rs3;
+ int32_t imm;
+ uint16_t csr;
+ char *name;
+ bool rvc;
+ bool f;
+} insn_t;
+
+static const char gpnames[32][9] = {
+ "zero", "ra", "sp", "gp", "tp", "t0_mask", "t1", "t2_rip",
+ "s0_flags", "s1", "a0", "a1", "a2", "a3", "a4", "a5",
+ "a6_rax", "a7_rcx", "s2_rdx", "s3_rbx", "s4_rsp", "s5_rbp", "s6_rsi", "s7_rdi",
+ "s8_r8", "s9_r9", "s10_r10", "s11_r11", "t3_r12", "t4_r13", "t5_r14", "t6_r15",
+};
+
+static const char fpnames[32][5] = {
+ "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7",
+ "fs0", "fs1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5",
+ "fa6", "fa7", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7",
+ "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11",
+};
+
+#define QUADRANT(data) (((data) >> 0) & 0x3 )
+
+/**
+ * normal types
+*/
+#define OPCODE(data) (((data) >> 2) & 0x1f)
+#define RD(data) (((data) >> 7) & 0x1f)
+#define RS1(data) (((data) >> 15) & 0x1f)
+#define RS2(data) (((data) >> 20) & 0x1f)
+#define RS3(data) (((data) >> 27) & 0x1f)
+#define FUNCT2(data) (((data) >> 25) & 0x3 )
+#define FUNCT3(data) (((data) >> 12) & 0x7 )
+#define FUNCT7(data) (((data) >> 25) & 0x7f)
+#define IMM116(data) (((data) >> 26) & 0x3f)
+#define AQ(data) (((data) >> 26) & 0x1)
+#define RL(data) (((data) >> 25) & 0x1)
+
+static inline insn_t insn_utype_read(uint32_t data)
+{
+ return (insn_t) {
+ .imm = (int32_t)data & 0xfffff000,
+ .rd = RD(data),
+ };
+}
+
+static inline insn_t insn_itype_read(uint32_t data)
+{
+ return (insn_t) {
+ .imm = (int32_t)data >> 20,
+ .rs1 = RS1(data),
+ .rd = RD(data),
+ };
+}
+
+static inline insn_t insn_jtype_read(uint32_t data)
+{
+ uint32_t imm20 = (data >> 31) & 0x1;
+ uint32_t imm101 = (data >> 21) & 0x3ff;
+ uint32_t imm11 = (data >> 20) & 0x1;
+ uint32_t imm1912 = (data >> 12) & 0xff;
+
+ int32_t imm = (imm20 << 20) | (imm1912 << 12) | (imm11 << 11) | (imm101 << 1);
+ imm = (imm << 11) >> 11;
+
+ return (insn_t) {
+ .imm = imm,
+ .rd = RD(data),
+ };
+}
+
+static inline insn_t insn_btype_read(uint32_t data)
+{
+ uint32_t imm12 = (data >> 31) & 0x1;
+ uint32_t imm105 = (data >> 25) & 0x3f;
+ uint32_t imm41 = (data >> 8) & 0xf;
+ uint32_t imm11 = (data >> 7) & 0x1;
+
+ int32_t imm = (imm12 << 12) | (imm11 << 11) |(imm105 << 5) | (imm41 << 1);
+ imm = (imm << 19) >> 19;
+
+ return (insn_t) {
+ .imm = imm,
+ .rs1 = RS1(data),
+ .rs2 = RS2(data),
+ };
+}
+
+static inline insn_t insn_rtype_read(uint32_t data)
+{
+ return (insn_t) {
+ .rs1 = RS1(data),
+ .rs2 = RS2(data),
+ .rd = RD(data),
+ };
+}
+
+static inline insn_t insn_stype_read(uint32_t data)
+{
+ uint32_t imm115 = (data >> 25) & 0x7f;
+ uint32_t imm40 = (data >> 7) & 0x1f;
+
+ int32_t imm = (imm115 << 5) | imm40;
+ imm = (imm << 20) >> 20;
+ return (insn_t) {
+ .imm = imm,
+ .rs1 = RS1(data),
+ .rs2 = RS2(data),
+ };
+}
+
+static inline insn_t insn_csrtype_read(uint32_t data)
+{
+ return (insn_t) {
+ .csr = data >> 20,
+ .rs1 = RS1(data),
+ .rd = RD(data),
+ };
+}
+
+static inline insn_t insn_fprtype_read(uint32_t data)
+{
+ return (insn_t) {
+ .rs1 = RS1(data),
+ .rs2 = RS2(data),
+ .rs3 = RS3(data),
+ .rd = RD(data),
+ };
+}
+
+/**
+ * compressed types
+*/
+#define COPCODE(data) (((data) >> 13) & 0x7 )
+#define CFUNCT1(data) (((data) >> 12) & 0x1 )
+#define CFUNCT2LOW(data) (((data) >> 5) & 0x3 )
+#define CFUNCT2HIGH(data) (((data) >> 10) & 0x3 )
+#define RP1(data) (((data) >> 7) & 0x7 )
+#define RP2(data) (((data) >> 2) & 0x7 )
+#define RC1(data) (((data) >> 7) & 0x1f)
+#define RC2(data) (((data) >> 2) & 0x1f)
+
+static inline insn_t insn_catype_read(uint16_t data)
+{
+ return (insn_t) {
+ .rd = RP1(data) + 8,
+ .rs2 = RP2(data) + 8,
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_crtype_read(uint16_t data)
+{
+ return (insn_t) {
+ .rs1 = RC1(data),
+ .rs2 = RC2(data),
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_citype_read(uint16_t data)
+{
+ uint32_t imm40 = (data >> 2) & 0x1f;
+ uint32_t imm5 = (data >> 12) & 0x1;
+ int32_t imm = (imm5 << 5) | imm40;
+ imm = (imm << 26) >> 26;
+
+ return (insn_t) {
+ .imm = imm,
+ .rd = RC1(data),
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_citype_read2(uint16_t data)
+{
+ uint32_t imm86 = (data >> 2) & 0x7;
+ uint32_t imm43 = (data >> 5) & 0x3;
+ uint32_t imm5 = (data >> 12) & 0x1;
+
+ int32_t imm = (imm86 << 6) | (imm43 << 3) | (imm5 << 5);
+
+ return (insn_t) {
+ .imm = imm,
+ .rd = RC1(data),
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_citype_read3(uint16_t data)
+{
+ uint32_t imm5 = (data >> 2) & 0x1;
+ uint32_t imm87 = (data >> 3) & 0x3;
+ uint32_t imm6 = (data >> 5) & 0x1;
+ uint32_t imm4 = (data >> 6) & 0x1;
+ uint32_t imm9 = (data >> 12) & 0x1;
+
+ int32_t imm = (imm5 << 5) | (imm87 << 7) | (imm6 << 6) | (imm4 << 4) | (imm9 << 9);
+ imm = (imm << 22) >> 22;
+
+ return (insn_t) {
+ .imm = imm,
+ .rd = RC1(data),
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_citype_read4(uint16_t data)
+{
+ uint32_t imm5 = (data >> 12) & 0x1;
+ uint32_t imm42 = (data >> 4) & 0x7;
+ uint32_t imm76 = (data >> 2) & 0x3;
+
+ int32_t imm = (imm5 << 5) | (imm42 << 2) | (imm76 << 6);
+
+ return (insn_t) {
+ .imm = imm,
+ .rd = RC1(data),
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_citype_read5(uint16_t data)
+{
+ uint32_t imm1612 = (data >> 2) & 0x1f;
+ uint32_t imm17 = (data >> 12) & 0x1;
+
+ int32_t imm = (imm1612 << 12) | (imm17 << 17);
+ imm = (imm << 14) >> 14;
+ return (insn_t) {
+ .imm = imm,
+ .rd = RC1(data),
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_cbtype_read(uint16_t data)
+{
+ uint32_t imm5 = (data >> 2) & 0x1;
+ uint32_t imm21 = (data >> 3) & 0x3;
+ uint32_t imm76 = (data >> 5) & 0x3;
+ uint32_t imm43 = (data >> 10) & 0x3;
+ uint32_t imm8 = (data >> 12) & 0x1;
+
+ int32_t imm = (imm8 << 8) | (imm76 << 6) | (imm5 << 5) | (imm43 << 3) | (imm21 << 1);
+ imm = (imm << 23) >> 23;
+
+ return (insn_t) {
+ .imm = imm,
+ .rs1 = RP1(data) + 8,
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_cbtype_read2(uint16_t data)
+{
+ uint32_t imm40 = (data >> 2) & 0x1f;
+ uint32_t imm5 = (data >> 12) & 0x1;
+ int32_t imm = (imm5 << 5) | imm40;
+ imm = (imm << 26) >> 26;
+
+ return (insn_t) {
+ .imm = imm,
+ .rd = RP1(data) + 8,
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_cstype_read(uint16_t data)
+{
+ uint32_t imm76 = (data >> 5) & 0x3;
+ uint32_t imm53 = (data >> 10) & 0x7;
+
+ int32_t imm = ((imm76 << 6) | (imm53 << 3));
+
+ return (insn_t) {
+ .imm = imm,
+ .rs1 = RP1(data) + 8,
+ .rs2 = RP2(data) + 8,
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_cstype_read2(uint16_t data)
+{
+ uint32_t imm6 = (data >> 5) & 0x1;
+ uint32_t imm2 = (data >> 6) & 0x1;
+ uint32_t imm53 = (data >> 10) & 0x7;
+
+ int32_t imm = ((imm6 << 6) | (imm2 << 2) | (imm53 << 3));
+
+ return (insn_t) {
+ .imm = imm,
+ .rs1 = RP1(data) + 8,
+ .rs2 = RP2(data) + 8,
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_cjtype_read(uint16_t data)
+{
+ uint32_t imm5 = (data >> 2) & 0x1;
+ uint32_t imm31 = (data >> 3) & 0x7;
+ uint32_t imm7 = (data >> 6) & 0x1;
+ uint32_t imm6 = (data >> 7) & 0x1;
+ uint32_t imm10 = (data >> 8) & 0x1;
+ uint32_t imm98 = (data >> 9) & 0x3;
+ uint32_t imm4 = (data >> 11) & 0x1;
+ uint32_t imm11 = (data >> 12) & 0x1;
+
+ int32_t imm = ((imm5 << 5) | (imm31 << 1) | (imm7 << 7) | (imm6 << 6) |
+ (imm10 << 10) | (imm98 << 8) | (imm4 << 4) | (imm11 << 11));
+ imm = (imm << 20) >> 20;
+ return (insn_t) {
+ .imm = imm,
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_cltype_read(uint16_t data)
+{
+ uint32_t imm6 = (data >> 5) & 0x1;
+ uint32_t imm2 = (data >> 6) & 0x1;
+ uint32_t imm53 = (data >> 10) & 0x7;
+
+ int32_t imm = (imm6 << 6) | (imm2 << 2) | (imm53 << 3);
+
+ return (insn_t) {
+ .imm = imm,
+ .rs1 = RP1(data) + 8,
+ .rd = RP2(data) + 8,
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_cltype_read2(uint16_t data)
+{
+ uint32_t imm76 = (data >> 5) & 0x3;
+ uint32_t imm53 = (data >> 10) & 0x7;
+
+ int32_t imm = (imm76 << 6) | (imm53 << 3);
+
+ return (insn_t) {
+ .imm = imm,
+ .rs1 = RP1(data) + 8,
+ .rd = RP2(data) + 8,
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_csstype_read(uint16_t data)
+{
+ uint32_t imm86 = (data >> 7) & 0x7;
+ uint32_t imm53 = (data >> 10) & 0x7;
+
+ int32_t imm = (imm86 << 6) | (imm53 << 3);
+
+ return (insn_t) {
+ .imm = imm,
+ .rs2 = RC2(data),
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_csstype_read2(uint16_t data)
+{
+ uint32_t imm76 = (data >> 7) & 0x3;
+ uint32_t imm52 = (data >> 9) & 0xf;
+
+ int32_t imm = (imm76 << 6) | (imm52 << 2);
+
+ return (insn_t) {
+ .imm = imm,
+ .rs2 = RC2(data),
+ .rvc = true,
+ };
+}
+
+static inline insn_t insn_ciwtype_read(uint16_t data)
+{
+ uint32_t imm3 = (data >> 5) & 0x1;
+ uint32_t imm2 = (data >> 6) & 0x1;
+ uint32_t imm96 = (data >> 7) & 0xf;
+ uint32_t imm54 = (data >> 11) & 0x3;
+
+ int32_t imm = (imm3 << 3) | (imm2 << 2) | (imm96 << 6) | (imm54 << 4);
+
+ return (insn_t) {
+ .imm = imm,
+ .rd = RP2(data) + 8,
+ .rvc = true,
+ };
+}
+
+#define RN(r) insn.f ? fpnames[insn.r] : gpnames[insn.r]
+
+#define PRINT_none() snprintf(buff, sizeof(buff), "%s", insn.name); return buff
+#define PRINT_rd_rs1() snprintf(buff, sizeof(buff), "%s\t%s, %s", insn.name, RN(rd), RN(rs1)); return buff
+#define PRINT_rd_rs1_rs2() snprintf(buff, sizeof(buff), "%s\t%s, %s, %s", insn.name, RN(rd), RN(rs1), RN(rs2)); return buff
+#define PRINT_rd_rs1_rs2_rs3() snprintf(buff, sizeof(buff), "%s\t%s, %s, %s, %s", insn.name, RN(rd), RN(rs1), RN(rs2), RN(rs3)); return buff
+#define PRINT_rd_rs1_imm() snprintf(buff, sizeof(buff), "%s\t%s, %s, %d", insn.name, RN(rd), RN(rs1), insn.imm); return buff
+#define PRINT_rd_rs1_immx() snprintf(buff, sizeof(buff), "%s\t%s, %s, 0x%x", insn.name, RN(rd), RN(rs1), insn.imm); return buff
+#define PRINT_rd_imm_rs1() snprintf(buff, sizeof(buff), "%s\t%s, %d(%s)", insn.name, RN(rd), insn.imm, gpnames[insn.rs1]); return buff
+#define PRINT_rs2_imm_rs1() snprintf(buff, sizeof(buff), "%s\t%s, %d(%s)", insn.name, RN(rs2), insn.imm, gpnames[insn.rs1]); return buff
+#define PRINT_rd_imm() snprintf(buff, sizeof(buff), "%s\t%s, %d", insn.name, RN(rd), insn.imm); return buff
+#define PRINT_rd_imm_rel() snprintf(buff, sizeof(buff), "%s\t%s, pc%+d # 0x%"PRIx64, insn.name, RN(rd), insn.imm, insn.imm+(uint64_t)addr); return buff
+#define PRINT_imm_rel() snprintf(buff, sizeof(buff), "%s\tpc%+d # 0x%"PRIx64, insn.name, insn.imm, insn.imm+(uint64_t)addr); return buff
+#define PRINT_rd_immx() snprintf(buff, sizeof(buff), "%s\t%s, 0x%x", insn.name, RN(rd), insn.imm); return buff
+#define PRINT_rs1_rs2_imm() snprintf(buff, sizeof(buff), "%s\t%s, %s, %d", insn.name, RN(rs1), RN(rs2), insn.imm); return buff
+#define PRINT_rs1_rs2_imm_rel() snprintf(buff, sizeof(buff), "%s\t%s, %s, pc%+d # 0x%"PRIx64, insn.name, RN(rs1), RN(rs2), insn.imm, insn.imm+(uint64_t)addr); return buff
+#define PRINT_fd_fs1() snprintf(buff, sizeof(buff), "%s\t%s, %s", insn.name, fpnames[insn.rd], fpnames[insn.rs1]); return buff
+#define PRINT_xd_fs1() snprintf(buff, sizeof(buff), "%s\t%s, %s", insn.name, gpnames[insn.rd], fpnames[insn.rs1]); return buff
+#define PRINT_fd_xs1() snprintf(buff, sizeof(buff), "%s\t%s, %s", insn.name, fpnames[insn.rd], gpnames[insn.rs1]); return buff
+#define PRINT_rd_fs1_fs2() snprintf(buff, sizeof(buff), "%s\t%s, %s, %s", insn.name, gpnames[insn.rd], RN(rs1), RN(rs2)); return buff
+#define PRINT_rd_rs1_aqrl() snprintf(buff, sizeof(buff), "%s%s%s\t%s, (%s)", insn.name, aq?".aq":"", rl?".rl":"", gpnames[insn.rd], gpnames[insn.rs1]); return buff
+#define PRINT_rd_rs1_rs2_aqrl() snprintf(buff, sizeof(buff), "%s%s%s\t%s, %s, (%s)", insn.name, aq?".aq":"", rl?".rl":"", gpnames[insn.rd], gpnames[insn.rs2], gpnames[insn.rs1]); return buff
+
+// TODO: display csr name
+#define PRINT_rd_csr_rs1() snprintf(buff, sizeof(buff), "%s\t%s, %d, %s", insn.name, RN(rd), insn.csr, RN(rs1)); return buff
+#define PRINT_rd_csr_uimm() snprintf(buff, sizeof(buff), "%s\t%s, %d, %d", insn.name, RN(rd), insn.csr, (uint32_t)insn.imm); return buff
+
+const char* rv64_print(uint32_t data, uintptr_t addr)
+{
+ static char buff[200] = {0};
+
+ insn_t insn = { 0 };
+ uint32_t quadrant = QUADRANT(data);
+ switch (quadrant) {
+ case 0x0: {
+ uint32_t copcode = COPCODE(data);
+
+ switch (copcode) {
+ case 0x0: /* C.ADDI4SPN */
+ insn = insn_ciwtype_read(data);
+ insn.rs1 = 2; /* sp */
+ insn.name = "addi";
+ assert(insn.imm != 0);
+ PRINT_rd_rs1_imm();
+ case 0x1: /* C.FLD */
+ insn = insn_cltype_read2(data);
+ insn.name = "fld";
+ insn.f = true;
+ PRINT_rd_imm_rs1();
+ case 0x2: /* C.LW */
+ insn = insn_cltype_read(data);
+ insn.name = "lw";
+ PRINT_rd_imm_rs1();
+ case 0x3: /* C.LD */
+ insn = insn_cltype_read2(data);
+ insn.name = "ld";
+ PRINT_rd_imm_rs1();
+ case 0x5: /* C.FSD */
+ insn = insn_cstype_read(data);
+ insn.name = "fsd";
+ insn.f = true;
+ PRINT_rs2_imm_rs1();
+ case 0x6: /* C.SW */
+ insn = insn_cstype_read2(data);
+ insn.name = "sw";
+ PRINT_rd_imm_rs1();
+ case 0x7: /* C.SD */
+ insn = insn_cstype_read(data);
+ insn.name = "sd";
+ PRINT_rs2_imm_rs1();
+ }
+ }
+ case 0x1: {
+ uint32_t copcode = COPCODE(data);
+
+ switch (copcode) {
+ case 0x0: /* C.ADDI */
+ insn = insn_citype_read(data);
+ insn.rs1 = insn.rd;
+ insn.name = "addi";
+ PRINT_rd_rs1_imm();
+ case 0x1: /* C.ADDIW */
+ insn = insn_citype_read(data);
+ assert(insn.rd != 0);
+ insn.rs1 = insn.rd;
+ insn.name = "addiw";
+ PRINT_rd_rs1_imm();
+ case 0x2: /* C.LI */
+ insn = insn_citype_read(data);
+ insn.rs1 = 0;
+ insn.name = "addi";
+ PRINT_rd_rs1_imm();
+ case 0x3: {
+ int32_t rd = RC1(data);
+ if (rd == 2) { /* C.ADDI16SP */
+ insn = insn_citype_read3(data);
+ assert(insn.imm != 0);
+ insn.rs1 = insn.rd;
+ insn.name = "addi";
+ PRINT_rd_rs1_imm();
+ } else { /* C.LUI */
+ insn = insn_citype_read5(data);
+ assert(insn.imm != 0);
+ insn.name = "lui";
+ PRINT_rd_immx();
+ }
+ }
+ case 0x4: {
+ uint32_t cfunct2high = CFUNCT2HIGH(data);
+
+ switch (cfunct2high) {
+ case 0x0: /* C.SRLI */
+ case 0x1: /* C.SRAI */
+ case 0x2: { /* C.ANDI */
+ insn = insn_cbtype_read2(data);
+ insn.rs1 = insn.rd;
+
+ if (cfunct2high == 0x0) {
+ insn.name = "srli";
+ } else if (cfunct2high == 0x1) {
+ insn.name = "srai";
+ } else {
+ insn.name = "andi";
+ }
+ PRINT_rd_rs1_imm();
+ }
+ case 0x3: {
+ uint32_t cfunct1 = CFUNCT1(data);
+
+ switch (cfunct1) {
+ case 0x0: {
+ uint32_t cfunct2low = CFUNCT2LOW(data);
+
+ insn = insn_catype_read(data);
+ insn.rs1 = insn.rd;
+
+ switch (cfunct2low) {
+ case 0x0: /* C.SUB */
+ insn.name = "sub";
+ break;
+ case 0x1: /* C.XOR */
+ insn.name = "xor";
+ break;
+ case 0x2: /* C.OR */
+ insn.name = "or";
+ break;
+ case 0x3: /* C.AND */
+ insn.name = "and";
+ break;
+ }
+ break;
+ }
+ case 0x1: {
+ uint32_t cfunct2low = CFUNCT2LOW(data);
+
+ insn = insn_catype_read(data);
+ insn.rs1 = insn.rd;
+
+ switch (cfunct2low) {
+ case 0x0: /* C.SUBW */
+ insn.name = "subw";
+ break;
+ case 0x1: /* C.ADDW */
+ insn.name = "addw";
+ break;
+ }
+ break;
+ }
+ }
+ PRINT_rd_rs1_rs2();
+ }
+ }
+ }
+ case 0x5: /* C.J */
+ insn = insn_cjtype_read(data);
+ insn.rd = 0;
+ insn.name = "jal";
+ PRINT_rd_imm();
+ case 0x6: /* C.BEQZ */
+ case 0x7: /* C.BNEZ */
+ insn = insn_cbtype_read(data);
+ insn.rs2 = 0;
+ insn.name = copcode == 0x6 ? "beq" : "bne";
+ PRINT_rs1_rs2_imm();
+ }
+ }
+ case 0x2: {
+ uint32_t copcode = COPCODE(data);
+ switch (copcode) {
+ case 0x0: /* C.SLLI */
+ insn = insn_citype_read(data);
+ insn.rs1 = insn.rd;
+ insn.name = "slli";
+ PRINT_rd_rs1_imm();
+ case 0x1: /* C.FLDSP */
+ insn = insn_citype_read2(data);
+ insn.rs1 = 2; /* sp */
+ insn.f = true;
+ insn.name = "fld";
+ PRINT_rd_imm_rs1();
+ case 0x2: /* C.LWSP */
+ insn = insn_citype_read4(data);
+ assert(insn.rd != 0);
+ insn.rs1 = 2; /* sp */
+ insn.name = "lw";
+ PRINT_rd_imm_rs1();
+ case 0x3: /* C.LDSP */
+ insn = insn_citype_read2(data);
+ assert(insn.rd != 0);
+ insn.rs1 = 2; /* sp */
+ insn.name = "ld";
+ PRINT_rd_imm_rs1();
+ case 0x4: {
+ uint32_t cfunct1 = CFUNCT1(data);
+
+ switch (cfunct1) {
+ case 0x0: {
+ insn = insn_crtype_read(data);
+
+ if (insn.rs2 == 0) { /* C.JR */
+ assert(insn.rs1 != 0);
+ insn.rd = 0;
+ insn.name = "jalr";
+ PRINT_rd_imm_rs1();
+ } else { /* C.MV */
+ insn.rd = insn.rs1;
+ insn.rs1 = 0;
+ insn.name = "add";
+ PRINT_rd_rs1_rs2();
+ }
+ }
+ case 0x1: {
+ insn = insn_crtype_read(data);
+ if (insn.rs1 == 0 && insn.rs2 == 0) { /* C.EBREAK */
+ insn.name = "ebreak";
+ PRINT_none();
+ } else if (insn.rs2 == 0) { /* C.JALR */
+ insn.rd = 1; /* ra */
+ insn.name = "jalr";
+ PRINT_rd_imm_rs1();
+ } else { /* C.ADD */
+ insn.rd = insn.rs1;
+ insn.name = "add";
+ PRINT_rd_rs1_rs2();
+ }
+ }
+ }
+ }
+ case 0x5: /* C.FSDSP */
+ insn = insn_csstype_read(data);
+ insn.rs1 = 2; /* sp */
+ insn.f = true;
+ insn.name = "fsd";
+ PRINT_rs2_imm_rs1();
+ case 0x6: /* C.SWSP */
+ insn = insn_csstype_read2(data);
+ insn.rs1 = 2; /* sp */
+ insn.name = "sw";
+ PRINT_rs2_imm_rs1();
+ case 0x7: /* C.SDSP */
+ insn = insn_csstype_read(data);
+ insn.rs1 = 2; /* sp */
+ insn.name = "sd";
+ PRINT_rs2_imm_rs1();
+ }
+ }
+ case 0x3: {
+ uint32_t opcode = OPCODE(data);
+ switch (opcode) {
+ case 0x0: {
+ uint32_t funct3 = FUNCT3(data);
+
+ insn = insn_itype_read(data);
+ switch (funct3) {
+ case 0x0: /* LB */
+ insn.name = "lb";
+ break;
+ case 0x1: /* LH */
+ insn.name = "lh";
+ break;
+ case 0x2: /* LW */
+ insn.name = "lw";
+ break;
+ case 0x3: /* LD */
+ insn.name = "ld";
+ break;
+ case 0x4: /* LBU */
+ insn.name = "lbu";
+ break;
+ case 0x5: /* LHU */
+ insn.name = "lhu";
+ break;
+ case 0x6: /* LWU */
+ insn.name = "lwu";
+ break;
+ }
+ PRINT_rd_imm_rs1();
+ }
+ case 0x1: {
+ uint32_t funct3 = FUNCT3(data);
+
+ insn = insn_itype_read(data);
+ switch (funct3) {
+ case 0x2: /* FLW */
+ insn.name = "flw";
+ insn.f = true;
+ break;
+ case 0x3: /* FLD */
+ insn.name = "fld";
+ insn.f = true;
+ break;
+ }
+ PRINT_rd_imm_rs1();
+ }
+ case 0x3: {
+ uint32_t funct3 = FUNCT3(data);
+
+ switch (funct3) {
+ case 0x0: { /* FENCE */
+ insn.name = "fence";
+ // TODO: handle pred succ
+ PRINT_none();
+ }
+ case 0x1: { /* FENCE.I */
+ insn.name = "fence.i";
+ PRINT_none();
+ }
+ }
+ }
+ case 0x4: {
+ int hex = 0;
+ int mv_alias = 0;
+ int nop_alias = 0;
+ int not_alias = 0;
+ uint32_t funct3 = FUNCT3(data);
+
+ insn = insn_itype_read(data);
+ switch (funct3) {
+ case 0x0: /* ADDI */
+ insn.name = "addi";
+ if (insn.imm == 0) {
+ if (insn.rd == 0 && insn.rs1 == 0) {
+ nop_alias = 1;
+ insn.name = "nop";
+ } else {
+ mv_alias = 1;
+ insn.name = "mv";
+ }
+ }
+ break;
+ case 0x1: {
+ uint32_t imm116 = IMM116(data);
+ if (imm116 == 0) { /* SLLI */
+ insn.name = "slli";
+ }
+ break;
+ }
+ case 0x2: /* SLTI */
+ insn.name = "slti";
+ break;
+ case 0x3: /* SLTIU */
+ insn.name = "sltiu";
+ break;
+ case 0x4: /* XORI */
+ insn.name = "xori";
+ hex = 1;
+ if (insn.imm == -1) {
+ not_alias = 1;
+ insn.name = "not";
+ }
+ break;
+ case 0x5: {
+ uint32_t imm116 = IMM116(data);
+
+ if (imm116 == 0x0) { /* SRLI */
+ insn.name = "srli";
+ } else if (imm116 == 0x10) { /* SRAI */
+ insn.name = "srai";
+ insn.imm&=0b111111;
+ } else if (insn.imm==0b011010111000) {
+ insn.name = "rev8";
+ PRINT_rd_rs1();
+ }
+ break;
+ }
+ case 0x6: /* ORI */
+ insn.name = "ori";
+ hex = 1;
+ break;
+ case 0x7: /* ANDI */
+ insn.name = "andi";
+ hex = 1;
+ break;
+ }
+ if (not_alias) {
+ PRINT_rd_rs1();
+ } else if (nop_alias) {
+ PRINT_none();
+ } else if (mv_alias) {
+ PRINT_rd_rs1();
+ } else if(hex) {
+ PRINT_rd_rs1_immx();
+ } else {
+ PRINT_rd_rs1_imm();
+ }
+ }
+ case 0x5: /* AUIPC */
+ insn = insn_utype_read(data);
+ insn.name = "auipc";
+ PRINT_rd_imm_rel();
+ case 0x6: {
+ uint32_t funct3 = FUNCT3(data);
+ uint32_t funct7 = FUNCT7(data);
+
+ insn = insn_itype_read(data);
+
+ switch (funct3) {
+ case 0x0: /* ADDIW */
+ insn.name = "addiw";
+ break;
+ case 0x1: /* SLLIW */
+ assert(funct7 == 0);
+ insn.name = "slliw";
+ break;
+ case 0x5: {
+ switch (funct7) {
+ case 0x0: /* SRLIW */
+ insn.name = "srliw";
+ break;
+ case 0x20: /* SRAIW */
+ insn.name = "sraiw";
+ insn.imm&=0b111111;
+ break;
+ }
+ }
+ }
+ PRINT_rd_rs1_imm();
+ }
+ case 0x8: {
+ uint32_t funct3 = FUNCT3(data);
+
+ insn = insn_stype_read(data);
+ switch (funct3) {
+ case 0x0: /* SB */
+ insn.name = "sb";
+ break;
+ case 0x1: /* SH */
+ insn.name = "sh";
+ break;
+ case 0x2: /* SW */
+ insn.name = "sw";
+ break;
+ case 0x3: /* SD */
+ insn.name = "sd";
+ break;
+ }
+ PRINT_rs2_imm_rs1();
+ }
+ case 0x9: {
+ uint32_t funct3 = FUNCT3(data);
+
+ insn = insn_stype_read(data);
+ switch (funct3) {
+ case 0x2: /* FSW */
+ insn.name = "fsw";
+ insn.f = true;
+ break;
+ case 0x3: /* FSD */
+ insn.name = "fsd";
+ insn.f = true;
+ break;
+ }
+ PRINT_rs2_imm_rs1();
+ }
+ case 0xb: {
+ uint32_t funct3 = FUNCT3(data);
+ uint32_t rs1 = RS3(data);
+ bool aq = AQ(data), rl = RL(data);
+ insn = insn_rtype_read(data);
+ switch(funct3) {
+ case 0x2:
+ switch (rs1) {
+ case 0x2: /* LR.W */
+ insn.name = "lr.w";
+ PRINT_rd_rs1_aqrl();
+ case 0x3: /* SC.W */
+ insn.name = "sc.w";
+ PRINT_rd_rs1_rs2_aqrl();
+ }
+ case 0x3:
+ switch (rs1) {
+ case 0x2: /* LR.D */
+ insn.name = "lr.d";
+ PRINT_rd_rs1_aqrl();
+ case 0x3: /* SC.D */
+ insn.name = "sc.d";
+ PRINT_rd_rs1_rs2_aqrl();
+ }
+ }
+ }
+ case 0xc: {
+ insn = insn_rtype_read(data);
+
+ uint32_t funct3 = FUNCT3(data);
+ uint32_t funct7 = FUNCT7(data);
+
+ switch (funct7) {
+ case 0x0: {
+ switch (funct3) {
+ case 0x0: /* ADD */
+ insn.name = "add";
+ break;
+ case 0x1: /* SLL */
+ insn.name = "sll";
+ break;
+ case 0x2: /* SLT */
+ insn.name = "slt";
+ break;
+ case 0x3: /* SLTU */
+ insn.name = "sltu";
+ break;
+ case 0x4: /* XOR */
+ insn.name = "xor";
+ break;
+ case 0x5: /* SRL */
+ insn.name = "srl";
+ break;
+ case 0x6: /* OR */
+ insn.name = "or";
+ break;
+ case 0x7: /* AND */
+ insn.name = "and";
+ break;
+ }
+ }
+ break;
+ case 0x1: {
+ switch (funct3) {
+ case 0x0: /* MUL */
+ insn.name = "mul";
+ break;
+ case 0x1: /* MULH */
+ insn.name = "mulh";
+ break;
+ case 0x2: /* MULHSU */
+ insn.name = "mulhsu";
+ break;
+ case 0x3: /* MULHU */
+ insn.name = "mulhu";
+ break;
+ case 0x4: /* DIV */
+ insn.name = "div";
+ break;
+ case 0x5: /* DIVU */
+ insn.name = "divu";
+ break;
+ case 0x6: /* REM */
+ insn.name = "rem";
+ break;
+ case 0x7: /* REMU */
+ insn.name = "remu";
+ break;
+ }
+ }
+ break;
+ case 0x10: {
+ switch (funct3) {
+ case 0b010:
+ insn.name = "sh1add";
+ break;
+ case 0b100:
+ insn.name = "sh2add";
+ break;
+ case 0b110:
+ insn.name = "sh3add";
+ break;
+ }
+ }
+ break;
+ case 0x20: {
+ switch (funct3) {
+ case 0x0: /* SUB */
+ insn.name = "sub";
+ break;
+ case 0x5: /* SRA */
+ insn.name = "sra";
+ break;
+ }
+ }
+ break;
+ }
+ PRINT_rd_rs1_rs2();
+ }
+ case 0xd: /* LUI */
+ insn = insn_utype_read(data);
+ insn.name = "lui";
+ PRINT_rd_immx();
+ case 0xe: {
+ insn = insn_rtype_read(data);
+
+ uint32_t funct3 = FUNCT3(data);
+ uint32_t funct7 = FUNCT7(data);
+
+ switch (funct7) {
+ case 0x0: {
+ switch (funct3) {
+ case 0x0: /* ADDW */
+ insn.name = "addw";
+ break;
+ case 0x1: /* SLLW */
+ insn.name = "sllw";
+ break;
+ case 0x5: /* SRLW */
+ insn.name = "srlw";
+ break;
+ }
+ }
+ break;
+ case 0x1: {
+ switch (funct3) {
+ case 0x0: /* MULW */
+ insn.name = "mulw";
+ break;
+ case 0x4: /* DIVW */
+ insn.name = "divw";
+ break;
+ case 0x5: /* DIVUW */
+ insn.name = "divuw";
+ break;
+ case 0x6: /* REMW */
+ insn.name = "remw";
+ break;
+ case 0x7: /* REMUW */
+ insn.name = "remuw";
+ break;
+ }
+ }
+ break;
+ case 0x20: {
+ switch (funct3) {
+ case 0x0: /* SUBW */
+ insn.name = "subw";
+ break;
+ case 0x5: /* SRAW */
+ insn.name = "sraw";
+ break;
+ }
+ }
+ break;
+ }
+ PRINT_rd_rs1_rs2();
+ }
+ case 0x10: {
+ uint32_t funct2 = FUNCT2(data);
+
+ insn = insn_fprtype_read(data);
+ switch (funct2) {
+ case 0x0: /* FMADD.S */
+ insn.name = "fmadd.s";
+ insn.f = true;
+ break;
+ case 0x1: /* FMADD.D */
+ insn.name = "fmadd.d";
+ insn.f = true;
+ break;
+ }
+ PRINT_rd_rs1_rs2();
+ }
+ case 0x11: {
+ uint32_t funct2 = FUNCT2(data);
+
+ insn = insn_fprtype_read(data);
+ switch (funct2) {
+ case 0x0: /* FMSUB.S */
+ insn.name = "fmsub.s";
+ insn.f = true;
+ break;
+ case 0x1: /* FMSUB.D */
+ insn.name = "fmsub.d";
+ insn.f = true;
+ break;
+ }
+ PRINT_rd_rs1_rs2();
+ }
+ case 0x12: {
+ uint32_t funct2 = FUNCT2(data);
+
+ insn = insn_fprtype_read(data);
+ switch (funct2) {
+ case 0x0: /* FNMSUB.S */
+ insn.name = "fnmsub.s";
+ insn.f = true;
+ break;
+ case 0x1: /* FNMSUB.D */
+ insn.name = "fnmsub.d";
+ insn.f = true;
+ break;
+ }
+ PRINT_rd_rs1_rs2_rs3();
+ }
+ case 0x13: {
+ uint32_t funct2 = FUNCT2(data);
+
+ insn = insn_fprtype_read(data);
+ switch (funct2) {
+ case 0x0: /* FNMADD.S */
+ insn.name = "fnmadd.s";
+ insn.f = true;
+ break;
+ case 0x1: /* FNMADD.D */
+ insn.name = "fnmadd.d";
+ insn.f = true;
+ break;
+ }
+ PRINT_rd_rs1_rs2_rs3();
+ }
+ case 0x14: {
+ uint32_t funct7 = FUNCT7(data);
+
+ insn = insn_rtype_read(data);
+ insn.f = true;
+ switch (funct7) {
+ case 0x0: /* FADD.S */
+ insn.name = "fadd.s";
+ PRINT_rd_rs1_rs2();
+ case 0x1: /* FADD.D */
+ insn.name = "fadd.d";
+ PRINT_rd_rs1_rs2();
+ case 0x4: /* FSUB.S */
+ insn.name = "fsub.s";
+ PRINT_rd_rs1_rs2();
+ case 0x5: /* FSUB.D */
+ insn.name = "fsub.d";
+ PRINT_rd_rs1_rs2();
+ case 0x8: /* FMUL.S */
+ insn.name = "fmul.s";
+ PRINT_rd_rs1_rs2();
+ case 0x9: /* FMUL.D */
+ insn.name = "fmul.d";
+ PRINT_rd_rs1_rs2();
+ case 0xc: /* FDIV.S */
+ insn.name = "fdiv.s";
+ PRINT_rd_rs1_rs2();
+ case 0xd: /* FDIV.D */
+ insn.name = "fdiv.d";
+ PRINT_rd_rs1_rs2();
+ case 0x10: {
+ uint32_t funct3 = FUNCT3(data);
+
+ switch (funct3) {
+ case 0x0: /* FSGNJ.S */
+ insn.name = "fsgnj.s";
+ break;
+ case 0x1: /* FSGNJN.S */
+ insn.name = "fsgnjn.s";
+ break;
+ case 0x2: /* FSGNJX.S */
+ insn.name = "fsgnjx.s";
+ break;
+ }
+ PRINT_rd_rs1_rs2();
+ }
+ case 0x11: {
+ uint32_t funct3 = FUNCT3(data);
+
+ switch (funct3) {
+ case 0x0: /* FSGNJ.D */
+ insn.name = "fsgnj.d";
+ break;
+ case 0x1: /* FSGNJN.D */
+ insn.name = "fsgnjn.d";
+ break;
+ case 0x2: /* FSGNJX.D */
+ insn.name = "fsgnjx.d";
+ break;
+ }
+ PRINT_rd_rs1_rs2();
+ }
+ case 0x14: {
+ uint32_t funct3 = FUNCT3(data);
+
+ switch (funct3) {
+ case 0x0: /* FMIN.S */
+ insn.name = "fmin.s";
+ break;
+ case 0x1: /* FMAX.S */
+ insn.name = "fmax.s";
+ break;
+ }
+ PRINT_rd_rs1_rs2();
+ }
+ case 0x15: {
+ uint32_t funct3 = FUNCT3(data);
+
+ switch (funct3) {
+ case 0x0: /* FMIN.D */
+ insn.name = "fmin.d";
+ break;
+ case 0x1: /* FMAX.D */
+ insn.name = "fmax.d";
+ break;
+ }
+ PRINT_rd_rs1_rs2();
+ }
+ case 0x20: /* FCVT.S.D */
+ assert(RS2(data) == 1);
+ insn.name = "fcvt.s.d";
+ PRINT_fd_fs1();
+ case 0x21: /* FCVT.D.S */
+ assert(RS2(data) == 0);
+ insn.name = "fcvt.d.s";
+ PRINT_fd_fs1();
+ case 0x2c: /* FSQRT.S */
+ assert(insn.rs2 == 0);
+ insn.name = "fsqrt.s";
+ PRINT_fd_fs1();
+ case 0x2d: /* FSQRT.D */
+ assert(insn.rs2 == 0);
+ insn.name = "fsqrt.d";
+ PRINT_fd_fs1();
+ case 0x50: {
+ uint32_t funct3 = FUNCT3(data);
+
+ switch (funct3) {
+ case 0x0: /* FLE.S */
+ insn.name = "fle.s";
+ break;
+ case 0x1: /* FLT.S */
+ insn.name = "flt.s";
+ break;
+ case 0x2: /* FEQ.S */
+ insn.name = "feq.s";
+ break;
+ }
+ PRINT_rd_fs1_fs2();
+ }
+ case 0x51: {
+ uint32_t funct3 = FUNCT3(data);
+
+ switch (funct3) {
+ case 0x0: /* FLE.D */
+ insn.name = "fle.d";
+ break;
+ case 0x1: /* FLT.D */
+ insn.name = "flt.d";
+ break;
+ case 0x2: /* FEQ.D */
+ insn.name = "feq.d";
+ break;
+ }
+ PRINT_rd_fs1_fs2();
+ }
+ case 0x60: {
+ uint32_t rs2 = RS2(data);
+
+ switch (rs2) {
+ case 0x0: /* FCVT.W.S */
+ insn.name = "fcvt.w.s";
+ break;
+ case 0x1: /* FCVT.WU.S */
+ insn.name = "fcvt.wu.s";
+ break;
+ case 0x2: /* FCVT.L.S */
+ insn.name = "fcvt.l.s";
+ break;
+ case 0x3: /* FCVT.LU.S */
+ insn.name = "fcvt.lu.s";
+ break;
+ }
+ PRINT_xd_fs1();
+ }
+ case 0x61: {
+ uint32_t rs2 = RS2(data);
+
+ switch (rs2) {
+ case 0x0: /* FCVT.W.D */
+ insn.name = "fcvt.w.d";
+ break;
+ case 0x1: /* FCVT.WU.D */
+ insn.name = "fcvt.wu.d";
+ break;
+ case 0x2: /* FCVT.L.D */
+ insn.name = "fcvt.l.d";
+ break;
+ case 0x3: /* FCVT.LU.D */
+ insn.name = "fcvt.lu.d";
+ break;
+ }
+ PRINT_xd_fs1();
+ }
+ case 0x68: {
+ uint32_t rs2 = RS2(data);
+
+ switch (rs2) {
+ case 0x0: /* FCVT.S.W */
+ insn.name = "fcvt.s.w";
+ break;
+ case 0x1: /* FCVT.S.WU */
+ insn.name = "fcvt.s.wu";
+ break;
+ case 0x2: /* FCVT.S.L */
+ insn.name = "fcvt.s.l";
+ break;
+ case 0x3: /* FCVT.S.LU */
+ insn.name = "fcvt.s.lu";
+ break;
+ }
+ PRINT_fd_xs1();
+ }
+ case 0x69: {
+ uint32_t rs2 = RS2(data);
+
+ switch (rs2) {
+ case 0x0: /* FCVT.D.W */
+ insn.name = "fcvt.d.w";
+ break;
+ case 0x1: /* FCVT.D.WU */
+ insn.name = "fcvt.d.wu";
+ break;
+ case 0x2: /* FCVT.D.L */
+ insn.name = "fcvt.d.l";
+ break;
+ case 0x3: /* FCVT.D.LU */
+ insn.name = "fcvt.d.lu";
+ break;
+ }
+ PRINT_fd_xs1();
+ }
+ case 0x70: {
+ assert(RS2(data) == 0);
+ uint32_t funct3 = FUNCT3(data);
+
+ switch (funct3) {
+ case 0x0: /* FMV.X.W */
+ insn.name = "fmv.x.w";
+ break;
+ case 0x1: /* FCLASS.S */
+ insn.name = "fclass.s";
+ break;
+ }
+ PRINT_xd_fs1();
+ }
+ case 0x71: {
+ assert(RS2(data) == 0);
+ uint32_t funct3 = FUNCT3(data);
+
+ switch (funct3) {
+ case 0x0: /* FMV.X.D */
+ insn.name = "fmv.x.d";
+ break;
+ case 0x1: /* FCLASS.D */
+ insn.name = "fclass.d";
+ break;
+ }
+ PRINT_xd_fs1();
+ }
+ case 0x78: /* FMV_W_X */
+ assert(RS2(data) == 0 && FUNCT3(data) == 0);
+ insn.name = "fmv.w.x";
+ PRINT_fd_xs1();
+ case 0x79: /* FMV_D_X */
+ assert(RS2(data) == 0 && FUNCT3(data) == 0);
+ insn.name = "fmv.d.x";
+ PRINT_fd_xs1();
+ }
+ }
+ case 0x18: {
+ insn = insn_btype_read(data);
+
+ uint32_t funct3 = FUNCT3(data);
+ switch (funct3) {
+ case 0x0: /* BEQ */
+ insn.name = "beq";
+ break;
+ case 0x1: /* BNE */
+ insn.name = "bne";
+ break;
+ case 0x4: /* BLT */
+ insn.name = "blt";
+ break;
+ case 0x5: /* BGE */
+ insn.name = "bge";
+ break;
+ case 0x6: /* BLTU */
+ insn.name = "bltu";
+ break;
+ case 0x7: /* BGEU */
+ insn.name = "bgeu";
+ break;
+ }
+
+ PRINT_rs1_rs2_imm_rel();
+ }
+ case 0x19: /* JALR */
+ insn = insn_itype_read(data);
+ insn.name = "jalr";
+ PRINT_rd_imm_rs1();
+ case 0x1b: /* JAL */
+ insn = insn_jtype_read(data);
+ if (insn.rd != 0) {
+ insn.name = "jal";
+ PRINT_rd_imm_rel();
+ } else {
+ insn.name = "j";
+ PRINT_imm_rel();
+ }
+ case 0x1c: {
+ if (data == 0x73) { /* ECALL */
+ insn.name = "ecall";
+ PRINT_none();
+ }
+
+ uint32_t funct3 = FUNCT3(data);
+ insn = insn_csrtype_read(data);
+ switch(funct3) {
+ case 0x1: /* CSRRW */
+ insn.name = "csrrw";
+ PRINT_rd_csr_rs1();
+ case 0x2: /* CSRRS */
+ insn.name = "csrrs";
+ PRINT_rd_csr_rs1();
+ case 0x3: /* CSRRC */
+ insn.name = "csrrc";
+ PRINT_rd_csr_rs1();
+ case 0x5: /* CSRRWI */
+ insn.name = "csrrwi";
+ PRINT_rd_csr_uimm();
+ case 0x6: /* CSRRSI */
+ insn.name = "csrrsi";
+ PRINT_rd_csr_uimm();
+ case 0x7: /* CSRRCI */
+ insn.name = "csrrci";
+ PRINT_rd_csr_uimm();
+ }
+ }
+ }
+ }
+ }
+
+ snprintf(buff, sizeof(buff), "%08X ???", __builtin_bswap32(data));
+ return buff;
+}
diff --git a/src/dynarec/rv64/rv64_printer.h b/src/dynarec/rv64/rv64_printer.h
new file mode 100644
index 0000000..e22a208
--- /dev/null
+++ b/src/dynarec/rv64/rv64_printer.h
@@ -0,0 +1,8 @@
+#ifndef _RV64_PRINTER_H_
+#define _RV64_PRINTER_H_
+#include <stdint.h>
+#include<stdbool.h>
+
+const char* rv64_print(uint32_t data, uint64_t addr);
+
+#endif //_RV64_PRINTER_H_
diff --git a/src/dynarec/rv64/rv64_prolog.S b/src/dynarec/rv64/rv64_prolog.S
new file mode 100644
index 0000000..96a85d3
--- /dev/null
+++ b/src/dynarec/rv64/rv64_prolog.S
@@ -0,0 +1,66 @@
+//arm prologue for dynarec
+//Save stuff, prepare stack and register
+//called with pointer to emu as 1st parameter
+//and address to jump to as 2nd parameter
+
+.text
+.align 4
+
+.extern rv64_next
+
+.global rv64_prolog
+rv64_prolog:
+ //save all 18 used register
+ addi sp, sp, -(8 * 24) // 16 bytes aligned
+ sd ra, (sp) // save ra
+ sd x8, 8(sp) // save fp
+ sd x18, (2*8)(sp)
+ sd x19, (3*8)(sp)
+ sd x20, (4*8)(sp)
+ sd x21, (5*8)(sp)
+ sd x22, (6*8)(sp)
+ sd x23, (7*8)(sp)
+ sd x24, (8*8)(sp)
+ sd x25, (9*8)(sp)
+ sd x26, (10*8)(sp)
+ sd x27, (11*8)(sp)
+ sd x9, (12*8)(sp)
+ fsd f18, (13*8)(sp)
+ fsd f19, (14*8)(sp)
+ fsd f20, (15*8)(sp)
+ fsd f21, (16*8)(sp)
+ fsd f22, (17*8)(sp)
+ fsd f23, (19*8)(sp)
+ fsd f24, (19*8)(sp)
+ fsd f25, (20*8)(sp)
+ fsd f26, (21*8)(sp)
+ fsd f27, (22*8)(sp)
+ //setup emu -> register
+ ld x16, (a0)
+ ld x17, 8(a0)
+ ld x18, 16(a0)
+ ld x19, 24(a0)
+ ld x20, 32(a0)
+ ld x21, 40(a0)
+ ld x22, 48(a0)
+ ld x23, 56(a0)
+ ld x24, 64(a0)
+ ld x25, 72(a0)
+ ld x26, 80(a0)
+ ld x27, 88(a0)
+ ld x28, 96(a0)
+ ld x29, 104(a0)
+ ld x30, 112(a0)
+ ld x31, 120(a0)
+ ld x8, 128(a0) //xFlags
+ ld x7, 136(a0) // xRIP
+ // // adjust flags bit 11 -> bit 5
+ andi x8, x8, ~(1<<5) // probably not usefull?
+ srli x5, x8, 11-5
+ andi x5, x5, 1<<5
+ or x8, x8, x5
+ // setup xMASK
+ xori x5, x0, -1
+ srli x5, x5, 32
+ // jump to block
+ jalr a1
diff --git a/src/elfs/elfdwarf_private.c b/src/elfs/elfdwarf_private.c
index aeba39b..90316a3 100644
--- a/src/elfs/elfdwarf_private.c
+++ b/src/elfs/elfdwarf_private.c
@@ -108,11 +108,11 @@ uintptr_t get_parent_registers(dwarf_unwind_t *unwind, const elfheader_t *ehdr,
*success = 0;
return 0;
}
- if(!IsAddressInElfSpace(ehdr, ehdr->ehframehdr)) {
+ if(!IsAddressInElfSpace(ehdr, ehdr->ehframehdr+ehdr->delta)) {
*success = 0;
return 0;
}
- unsigned char ehfh_version = *(unsigned char*)ehdr->ehframehdr;
+ unsigned char ehfh_version = *(unsigned char*)(ehdr->ehframehdr+ehdr->delta);
if (ehfh_version != 1) {
*success = 0;
return 0;
@@ -122,8 +122,8 @@ uintptr_t get_parent_registers(dwarf_unwind_t *unwind, const elfheader_t *ehdr,
// Not using the binary search table (for now)
- unsigned char *cur_addr = (unsigned char*)ehdr->ehframe;
- unsigned char *end_addr = (unsigned char*)ehdr->ehframe_end;
+ unsigned char *cur_addr = (unsigned char*)(ehdr->ehframe+ehdr->delta);
+ unsigned char *end_addr = (unsigned char*)(ehdr->ehframe_end+ehdr->delta);
#define AUG_EHDATA (1 << 0)
#define AUG_AUGDATA (1 << 1)
@@ -538,7 +538,7 @@ uintptr_t get_parent_registers(dwarf_unwind_t *unwind, const elfheader_t *ehdr,
break; \
}
#define RESTORE_REG(reg) \
- printf_log(LOG_DEBUG, "Trying to restore register 0x%02lX while in the intial CFIs\n", (uint64_t)reg); \
+ printf_log(LOG_DEBUG, "Trying to restore register 0x%02lX while in the initial CFIs\n", (uint64_t)reg); \
FAILED
#define FAILED \
box_free(unwind_constr.statuses); \
diff --git a/src/elfs/elfload_dump.c b/src/elfs/elfload_dump.c
index d7d11e4..d7d11e4 100755..100644
--- a/src/elfs/elfload_dump.c
+++ b/src/elfs/elfload_dump.c
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c
index 2082322..6a51660 100755..100644
--- a/src/elfs/elfloader.c
+++ b/src/elfs/elfloader.c
@@ -37,6 +37,7 @@
#include "dynablock.h"
#endif
#include "../emu/x64emu_private.h"
+#include "../emu/x64run_private.h"
#include "x64tls.h"
void* my__IO_2_1_stderr_ = NULL;
@@ -65,6 +66,8 @@ elfheader_t* LoadAndCheckElfHeader(FILE* f, const char* name, int exec)
h->mapsymbols = NewMapSymbols();
h->weaksymbols = NewMapSymbols();
h->localsymbols = NewMapSymbols();
+ h->globaldefver = NewDefaultVersion();
+ h->weakdefver = NewDefaultVersion();
h->refcnt = 1;
return h;
@@ -75,14 +78,9 @@ void FreeElfHeader(elfheader_t** head)
if(!head || !*head)
return;
elfheader_t *h = *head;
-#ifdef DYNAREC
- /*if(h->text) {
- dynarec_log(LOG_INFO, "Free Dynarec block for %s\n", h->path);
- cleanDBFromAddressRange(my_context, h->text, h->textsz, 1);
- }*/ // will be free at the end, no need to free it now
-#endif
- box_free(h->name);
- box_free(h->path);
+ if(my_context)
+ RemoveElfHeader(my_context, h);
+
box_free(h->PHEntries);
box_free(h->SHEntries);
box_free(h->SHStrTab);
@@ -95,8 +93,13 @@ void FreeElfHeader(elfheader_t** head)
FreeMapSymbols(&h->mapsymbols);
FreeMapSymbols(&h->weaksymbols);
FreeMapSymbols(&h->localsymbols);
+ FreeDefaultVersion(&h->globaldefver);
+ FreeDefaultVersion(&h->weakdefver);
FreeElfMemory(h);
+
+ box_free(h->name);
+ box_free(h->path);
box_free(h);
*head = NULL;
@@ -170,7 +173,7 @@ int AllocElfMemory(box64context_t* context, elfheader_t* head, int mainbin)
{
uintptr_t offs = 0;
if(!head->vaddr && box64_load_addr) {
- offs = box64_load_addr;
+ offs = (uintptr_t)find47bitBlockNearHint((void*)box64_load_addr, head->memsz);
box64_load_addr += head->memsz;
box64_load_addr = (box64_load_addr+0x10ffffffLL)&~0xffffffLL;
}
@@ -255,13 +258,25 @@ int AllocElfMemory(box64context_t* context, elfheader_t* head, int mainbin)
}
} else {
// vaddr is 0, load everything has a One block
- if(!offs && box64_wine)
+ uintptr_t old_offs = offs;
+ if(!offs /*&& box64_wine*/)
offs = (uintptr_t)find47bitBlock(head->memsz); // limit to 47bits...
printf_log(log_level, "Allocating 0x%zx memory @%p for Elf \"%s\"\n", head->memsz, (void*)offs, head->name);
void* p = mmap((void*)offs, head->memsz
, PROT_READ | PROT_WRITE | PROT_EXEC
, MAP_PRIVATE | MAP_ANONYMOUS /*| (((offs&&wine_preloaded)?MAP_FIXED:0))*/
, -1, 0);
+ if(offs &&!old_offs && p!=MAP_FAILED && offs!=(uintptr_t)p) {
+ // try again
+ munmap(p, head->memsz);
+ loadProtectionFromMap();
+ offs = (uintptr_t)find47bitBlock(head->memsz);
+ printf_log(log_level, "New, try. Allocating 0x%zx memory @%p for Elf \"%s\"\n", head->memsz, (void*)offs, head->name);
+ p = mmap((void*)offs, head->memsz
+ , PROT_READ | PROT_WRITE | PROT_EXEC
+ , MAP_PRIVATE | MAP_ANONYMOUS /*| (((offs&&wine_preloaded)?MAP_FIXED:0))*/
+ , -1, 0);
+ }
if(p==MAP_FAILED) {
printf_log(LOG_NONE, "Cannot create memory map (@%p 0x%zx/0x%zx) for elf \"%s\"\n", (void*)offs, head->memsz, head->align, head->name);
return 1;
@@ -293,8 +308,16 @@ int AllocElfMemory(box64context_t* context, elfheader_t* head, int mainbin)
void FreeElfMemory(elfheader_t* head)
{
if(head->multiblock_n) {
- for(int i=0; i<head->multiblock_n; ++i)
+ for(int i=0; i<head->multiblock_n; ++i) {
+#ifdef DYNAREC
+ dynarec_log(LOG_INFO, "Free DynaBlocks for %s\n", head->path);
+ if(box64_dynarec) {
+ cleanDBFromAddressRange((uintptr_t)head->multiblock[i], head->multiblock_size[i], 1);
+ freeProtection((uintptr_t)head->multiblock[i], head->multiblock_size[i]);
+ }
+#endif
munmap(head->multiblock[i], head->multiblock_size[i]);
+ }
box_free(head->multiblock);
box_free(head->multiblock_size);
box_free(head->multiblock_offs);
@@ -353,6 +376,23 @@ int LoadElfMemory(FILE* f, box64context_t* context, elfheader_t* head)
return 0;
}
+int isElfHasNeededVer(elfheader_t* head, const char* libname, elfheader_t* verneeded)
+{
+ if(!verneeded || !head)
+ return 1;
+ if(!head->VerDef || !verneeded->VerNeed)
+ return 1;
+ int cnt = GetNeededVersionCnt(verneeded, libname);
+ for (int i=0; i<cnt; ++i) {
+ const char* vername = GetNeededVersionString(verneeded, libname, i);
+ if(vername && !GetVersionIndice(head, vername)) {
+ printf_log(/*LOG_DEBUG*/LOG_INFO, "Discarding %s for missing version %s\n", head->path, vername);
+ return 0; // missing version
+ }
+ }
+ return 1;
+}
+
int ReloadElfMemory(FILE* f, box64context_t* context, elfheader_t* head)
{
(void)context;
@@ -401,9 +441,9 @@ int FindR64COPYRel(elfheader_t* h, const char* name, uintptr_t *offs, uint64_t**
if(t==R_X86_64_COPY && symname && !strcmp(symname, name) && sym->st_size==size) {
int version2 = h->VerSym?((Elf64_Half*)((uintptr_t)h->VerSym+h->delta))[ELF64_R_SYM(rela[i].r_info)]:-1;
if(version2!=-1) version2 &= 0x7fff;
- if(version && !version2) version2=-1; // match a versionned symbol against a global "local" symbol
+ if(version && !version2) version2=-1; // match a versioned symbol against a global "local" symbol
const char* vername2 = GetSymbolVersion(h, version2);
- if(SameVersionnedSymbol(name, version, vername, symname, version2, vername2)) {
+ if(SameVersionedSymbol(name, version, vername, symname, version2, vername2)) {
*offs = sym->st_value + h->delta;
*p = (uint64_t*)(rela[i].r_offset + h->delta + rela[i].r_addend);
return 1;
@@ -430,30 +470,40 @@ int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t*
int version = head->VerSym?((Elf64_Half*)((uintptr_t)head->VerSym+head->delta))[ELF64_R_SYM(rel[i].r_info)]:-1;
if(version!=-1) version &=0x7fff;
const char* vername = GetSymbolVersion(head, version);
- const char* defver = GetDefaultVersion((bind==STB_WEAK)?my_context->weakdefver:my_context->globaldefver, symname);
+ const char* globdefver = (bind==STB_WEAK)?NULL:GetMaplibDefaultVersion(maplib, local_maplib, 0, symname);
+ const char* weakdefver = (bind==STB_WEAK)?GetMaplibDefaultVersion(maplib, local_maplib, 1, symname):NULL;
if(bind==STB_LOCAL) {
if(!symname || !symname[0]) {
offs = sym->st_value + head->delta;
end = offs + sym->st_size;
} else {
if(!offs && !end && local_maplib)
- GetLocalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername);
+ GetLocalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
if(!offs && !end)
- GetLocalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername);
+ GetLocalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
}
} else {
- // this is probably very very wrong. A proprer way to get reloc need to be writen, but this hack seems ok for now
+ // this is probably very very wrong. A proprer way to get reloc need to be written, but this hack seems ok for now
// at least it work for half-life, unreal, ut99, zsnes, Undertale, ColinMcRae Remake, FTL, ShovelKnight...
/*if(bind==STB_GLOBAL && (ndx==10 || ndx==19) && t!=R_X86_64_GLOB_DAT) {
offs = sym->st_value + head->delta;
end = offs + sym->st_size;
}*/
// so weak symbol are the one left
- if(!offs && !end) {
- if(!offs && !end && local_maplib)
- GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername);
- if(!offs && !end && local_maplib)
- GetGlobalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername);
+ if(bind==STB_WEAK) {
+ if(!offs && !end) {
+ if(!offs && !end && local_maplib)
+ GetGlobalWeakSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
+ if(!offs && !end && local_maplib)
+ GetGlobalWeakSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
+ }
+ } else {
+ if(!offs && !end) {
+ if(!offs && !end && local_maplib)
+ GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
+ if(!offs && !end && local_maplib)
+ GetGlobalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
+ }
}
}
uintptr_t globoffs, globend;
@@ -474,21 +524,22 @@ int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t*
*p += offs;
break;
case R_X86_64_GLOB_DAT:
- if(head!=my_context->elfs[0] && !IsGlobalNoWeakSymbolInNative(maplib, symname, version, vername) && FindR64COPYRel(my_context->elfs[0], symname, &globoffs, &globp, size, version, vername)) {
+ if(head!=my_context->elfs[0] && !IsGlobalNoWeakSymbolInNative(maplib, symname, version, vername, globdefver) && FindR64COPYRel(my_context->elfs[0], symname, &globoffs, &globp, size, version, vername)) {
// set global offs / size for the symbol
offs = sym->st_value;
end = offs + sym->st_size;
if(sym->st_size && offs) {
printf_dump(LOG_NEVER, "Apply %s R_X86_64_GLOB_DAT with R_X86_64_COPY @%p/%p (%p/%p -> %p/%p) size=%ld on sym=%s \n", (bind==STB_LOCAL)?"Local":"Global", p, globp, (void*)(p?(*p):0), (void*)(globp?(*globp):0), (void*)(offs + head->delta), (void*)globoffs, sym->st_size, symname);
memmove((void*)globoffs, (void*)offs, sym->st_size); // preapply to copy part from lib to main elf
- AddUniqueSymbol(GetGlobalData(maplib), symname, offs + head->delta, sym->st_size, version, vername);
+ AddUniqueSymbol(GetGlobalData(maplib), symname, globoffs, sym->st_size, version, vername);
+ AddUniqueSymbol(my_context->globdata, symname, offs + head->delta, sym->st_size, version, vername);
} else {
printf_dump(LOG_NEVER, "Apply %s R_X86_64_GLOB_DAT with R_X86_64_COPY @%p/%p (%p/%p -> %p/%p) null sized on sym=%s \n", (bind==STB_LOCAL)?"Local":"Global", p, globp, (void*)(p?(*p):0), (void*)(globp?(*globp):0), (void*)offs, (void*)globoffs, symname);
}
*p = globoffs;
} else {
// Look for same symbol already loaded but not in self (so no need for local_maplib here)
- if (GetGlobalNoWeakSymbolStartEnd(local_maplib?local_maplib:maplib, symname, &globoffs, &globend, version, vername)) {
+ if (GetGlobalNoWeakSymbolStartEnd(local_maplib?local_maplib:maplib, symname, &globoffs, &globend, version, vername, globdefver)) {
offs = globoffs;
end = globend;
}
@@ -506,11 +557,11 @@ int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t*
uintptr_t old_offs = offs;
uintptr_t old_end = end;
offs = 0;
- GetSizedSymbolStartEnd(GetGlobalData(maplib), symname, &offs, &end, size, version, vername, 1, defver); // try globaldata symbols first
+ GetSizedSymbolStartEnd(my_context->globdata, symname, &offs, &end, size, version, vername, 1, globdefver); // try globaldata symbols first
if(offs==0) {
- GetNoSelfSymbolStartEnd(maplib, symname, &offs, &end, head, size, version, vername); // get original copy if any
+ GetNoSelfSymbolStartEnd(maplib, symname, &offs, &end, head, size, version, vername, globdefver, weakdefver); // get original copy if any
if(!offs && local_maplib)
- GetNoSelfSymbolStartEnd(local_maplib, symname, &offs, &end, head, size, version, vername);
+ GetNoSelfSymbolStartEnd(local_maplib, symname, &offs, &end, head, size, version, vername, globdefver, weakdefver);
}
if(!offs) {
offs = old_offs;
@@ -534,8 +585,9 @@ int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t*
break;
case R_X86_64_64:
if (!offs) {
- printf_log(LOG_NONE, "Error: Symbol %s not found, cannot apply R_X86_64_64 @%p (%p) in %s\n", symname, p, *(void**)p, head->name);
- ret_ok = 1;
+ printf_log(LOG_NONE, "%s: Symbol %s not found, cannot apply R_X86_64_64 @%p (%p) in %s\n", (bind==STB_GLOBAL)?"Error":"Warning", symname, p, *(void**)p, head->name);
+ if(bind==STB_GLOBAL)
+ ret_ok = 1;
// return -1;
} else {
printf_dump(LOG_NEVER, "Apply %s R_X86_64_64 @%p with sym=%s (%p -> %p)\n", (bind==STB_LOCAL)?"Local":"Global", p, symname, *(void**)p, (void*)(offs+*(uint64_t*)p));
@@ -596,6 +648,13 @@ EXPORT uintptr_t _dl_tlsdesc_undefweak(x64emu_t* emu)
int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t* head, int cnt, Elf64_Rela *rela, int* need_resolv)
{
int ret_ok = 0;
+ const char* old_globdefver = NULL;
+ const char* old_weakdefver = NULL;
+ int old_bind = -1;
+ const char* old_symname = NULL;
+ uintptr_t old_offs = 0;
+ uintptr_t old_end = 0;
+ int old_version = -1;
for (int i=0; i<cnt; ++i) {
int t = ELF64_R_TYPE(rela[i].r_info);
Elf64_Sym *sym = &head->DynSym[ELF64_R_SYM(rela[i].r_info)];
@@ -610,32 +669,62 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
int version = head->VerSym?((Elf64_Half*)((uintptr_t)head->VerSym+head->delta))[ELF64_R_SYM(rela[i].r_info)]:-1;
if(version!=-1) version &=0x7fff;
const char* vername = GetSymbolVersion(head, version);
- const char* defver = GetDefaultVersion((bind==STB_WEAK)?my_context->weakdefver:my_context->globaldefver, symname);
+ const char* globdefver = NULL;
+ const char* weakdefver = NULL;
+ if(old_bind==bind && old_symname==symname) {
+ globdefver = old_globdefver;
+ weakdefver = old_weakdefver;
+ } else {
+ old_globdefver = globdefver = (bind==STB_WEAK)?NULL:GetMaplibDefaultVersion(maplib, local_maplib, 0, symname);
+ old_weakdefver = weakdefver = (bind==STB_WEAK)?GetMaplibDefaultVersion(maplib, local_maplib, 1, symname):NULL;
+ }
if(bind==STB_LOCAL) {
if(!symname || !symname[0]) {
offs = sym->st_value + head->delta;
end = offs + sym->st_size;
} else {
- if(!offs && !end && local_maplib)
- GetLocalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername);
- if(!offs && !end)
- GetLocalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername);
+ if(old_version==version && old_bind==bind && old_symname==symname) {
+ offs = old_offs;
+ end = old_end;
+ } else {
+ if(local_maplib)
+ GetLocalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
+ if(!offs && !end)
+ GetLocalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
+ }
}
} else {
- // this is probably very very wrong. A proprer way to get reloc need to be writen, but this hack seems ok for now
+ // this is probably very very wrong. A proprer way to get reloc need to be written, but this hack seems ok for now
// at least it work for half-life, unreal, ut99, zsnes, Undertale, ColinMcRae Remake, FTL, ShovelKnight...
/*if(bind==STB_GLOBAL && (ndx==10 || ndx==19) && t!=R_X86_64_GLOB_DAT) {
offs = sym->st_value + head->delta;
end = offs + sym->st_size;
}*/
// so weak symbol are the one left
- if(!offs && !end) {
- GetGlobalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername);
- if(!offs && !end && local_maplib) {
- GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername);
+ if(bind==STB_WEAK) {
+ if(old_version==version && old_bind==bind && old_symname==symname) {
+ offs = old_offs;
+ end = old_end;
+ } else {
+ GetGlobalWeakSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
+ if(!offs && !end && local_maplib)
+ GetGlobalWeakSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
+ }
+ } else {
+ if(old_version==version && old_bind==bind && old_symname==symname) {
+ offs = old_offs;
+ end = old_end;
+ } else {
+ GetGlobalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
+ if(!offs && !end && local_maplib)
+ GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, globdefver, weakdefver);
}
}
}
+ old_bind = bind;
+ old_symname = symname;
+ old_offs = offs;
+ old_end = end;
uintptr_t globoffs, globend;
uint64_t* globp;
uintptr_t tmp = 0;
@@ -663,11 +752,11 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
globoffs = offs;
globend = end;
offs = end = 0;
- GetSizedSymbolStartEnd(GetGlobalData(maplib), symname, &offs, &end, size, version, vername, 1, defver); // try globaldata symbols first
+ GetSizedSymbolStartEnd(my_context->globdata, symname, &offs, &end, size, version, vername, 1, globdefver); // try globaldata symbols first
if(!offs && local_maplib)
- GetNoSelfSymbolStartEnd(local_maplib, symname, &offs, &end, head, size, version, vername);
+ GetNoSelfSymbolStartEnd(local_maplib, symname, &offs, &end, head, size, version, vername, globdefver, weakdefver);
if(!offs)
- GetNoSelfSymbolStartEnd(maplib, symname, &offs, &end, head, size, version, vername);
+ GetNoSelfSymbolStartEnd(maplib, symname, &offs, &end, head, size, version, vername, globdefver, weakdefver);
if(!offs) {offs = globoffs; end = globend;}
if(offs) {
// add r_addend to p?
@@ -679,7 +768,7 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
}
break;
case R_X86_64_GLOB_DAT:
- if(head!=my_context->elfs[0] && !IsGlobalNoWeakSymbolInNative(maplib, symname, version, vername) && FindR64COPYRel(my_context->elfs[0], symname, &globoffs, &globp, size, version, vername)) {
+ if(head!=my_context->elfs[0] && !IsGlobalNoWeakSymbolInNative(maplib, symname, version, vername, globdefver) && FindR64COPYRel(my_context->elfs[0], symname, &globoffs, &globp, size, version, vername)) {
// set global offs / size for the symbol
offs = sym->st_value + head->delta;
end = offs + sym->st_size;
@@ -688,7 +777,8 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
(bind==STB_LOCAL)?"Local":"Global", p, globp, (void*)(p?(*p):0),
(void*)(globp?(*globp):0), (void*)offs, (void*)globoffs, sym->st_size, symname, version, vername?vername:"(none)");
//memmove((void*)globoffs, (void*)offs, sym->st_size); // preapply to copy part from lib to main elf
- AddUniqueSymbol(GetGlobalData(maplib), symname, offs, sym->st_size, version, vername);
+ AddUniqueSymbol(GetGlobalData(maplib), symname, globoffs, sym->st_size, version, vername);
+ AddUniqueSymbol(my_context->globdata, symname, offs, sym->st_size, version, vername);
} else {
printf_dump(LOG_NEVER, "Apply %s R_X86_64_GLOB_DAT with R_X86_64_COPY @%p/%p (%p/%p -> %p/%p) null sized on sym=%s (ver=%d/%s)\n",
(bind==STB_LOCAL)?"Local":"Global", p, globp, (void*)(p?(*p):0),
@@ -697,7 +787,7 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
*p = globoffs;
} else {
// Look for same symbol already loaded but not in self (so no need for local_maplib here)
- if (GetGlobalNoWeakSymbolStartEnd(local_maplib?local_maplib:maplib, symname, &globoffs, &globend, version, vername)) {
+ if (GetGlobalNoWeakSymbolStartEnd(local_maplib?local_maplib:maplib, symname, &globoffs, &globend, version, vername, globdefver)) {
offs = globoffs;
end = globend;
}
@@ -750,8 +840,9 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
if(symname && !strcmp(symname, "__gxx_personality_v0")) {
printf_dump(LOG_NEVER, "Warning: Symbol %s not found, cannot apply R_X86_64_64 @%p (%p) in %s\n", symname, p, *(void**)p, head->name);
} else {
- printf_log(LOG_NONE, "Error: Symbol %s not found, cannot apply R_X86_64_64 @%p (%p) in %s\n", symname, p, *(void**)p, head->name);
- ret_ok = 1;
+ printf_log(LOG_INFO, "%s: Symbol %s not found, cannot apply R_X86_64_64 @%p (%p) in %s\n", (bind==STB_GLOBAL)?"Error":"Warning", symname, p, *(void**)p, head->name);
+ if(bind==STB_GLOBAL)
+ ret_ok = 1;
// return -1;
}
} else {
@@ -799,7 +890,7 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
printf_dump(LOG_NEVER, "Apply %s %s @%p with sym=%s (%p -> %p)\n", (bind==STB_LOCAL)?"Local":"Global", "R_X86_64_DTPMOD64", p, symname, *(void**)p, (void*)offs);
*p = offs;
} else {
- printf_log(LOG_NONE, "Warning, Symbol %s or Elf not found, but R_X86_64_DTPMOD64 Slot Offset is NULL \n", symname);
+ printf_log(LOG_INFO, "Warning, Symbol %s or Elf not found, but R_X86_64_DTPMOD64 Slot Offset is NULL \n", symname);
}
break;
case R_X86_64_DTPOFF64:
@@ -808,7 +899,7 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
if(bind==STB_WEAK) {
printf_log(LOG_INFO, "Warning: Weak Symbol %s not found, cannot apply R_X86_64_DTPOFF64 @%p (%p)\n", symname, p, *(void**)p);
} else {
- printf_log(LOG_NONE, "Error: Symbol %s not found, cannot apply R_X86_64_DTPOFF64 @%p (%p) in %s\n", symname, p, *(void**)p, head->name);
+ printf_log(LOG_INFO, "Error: Symbol %s not found, cannot apply R_X86_64_DTPOFF64 @%p (%p) in %s\n", symname, p, *(void**)p, head->name);
}
// return -1;
} else {
@@ -819,7 +910,7 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
printf_dump(LOG_NEVER, "Apply %s R_X86_64_DTPOFF64 @%p with sym=%s (%p -> %p)\n", (bind==STB_LOCAL)?"Local":"Global", p, symname, (void*)tlsoffset, (void*)offs);
*p = tlsoffset;
} else {
- printf_log(LOG_NONE, "Warning, Symbol %s found, but R_X86_64_DTPOFF64 Slot Offset is NULL \n", symname);
+ printf_log(LOG_INFO, "Warning, Symbol %s found, but R_X86_64_DTPOFF64 Slot Offset is NULL \n", symname);
}
}
break;
@@ -832,7 +923,7 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
td->entry = tlsdescUndefweak;
td->arg = (uintptr_t)(head->tlsbase + rela[i].r_addend);
} else {
- printf_log(LOG_NONE, "Warning, R_X86_64_TLSDESC used with Symbol %s(%p) not supported for now \n", symname, sym);
+ printf_log(LOG_INFO, "Warning, R_X86_64_TLSDESC used with Symbol %s(%p) not supported for now \n", symname, sym);
}
break;
default:
@@ -841,9 +932,12 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t
}
return bindnow?ret_ok:0;
}
-void checkHookedSymbols(lib_t *maplib, elfheader_t* h); // in mallochook.c
int RelocateElf(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t* head)
{
+ if((head->flags&DF_BIND_NOW) && !bindnow) {
+ bindnow = 1;
+ printf_log(LOG_DEBUG, "Forcing %s to Bind Now\n", head->name);
+ }
if(head->rel) {
int cnt = head->relsz / head->relent;
DumpRelTable(head, cnt, (Elf64_Rel *)(head->rel + head->delta), "Rel");
@@ -858,13 +952,16 @@ int RelocateElf(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t* he
if(RelocateElfRELA(maplib, local_maplib, bindnow, head, cnt, (Elf64_Rela *)(head->rela + head->delta), NULL))
return -1;
}
- checkHookedSymbols(maplib, head);
return 0;
}
int RelocateElfPlt(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t* head)
{
int need_resolver = 0;
+ if((head->flags&DF_BIND_NOW) && !bindnow) {
+ bindnow = 1;
+ printf_log(LOG_DEBUG, "Forcing %s to Bind Now\n", head->name);
+ }
if(head->pltrel) {
int cnt = head->pltsz / head->pltent;
if(head->pltrel==DT_REL) {
@@ -963,6 +1060,7 @@ uintptr_t GetLastByte(elfheader_t* h)
return (uintptr_t)h->memory/* + h->delta*/ + h->memsz;
}
+void checkHookedSymbols(elfheader_t* h); // in mallochook.c
void AddSymbols(lib_t *maplib, kh_mapsymbols_t* mapsymbols, kh_mapsymbols_t* weaksymbols, kh_mapsymbols_t* localsymbols, elfheader_t* h)
{
if(box64_dump && h->DynSym) DumpDynSym(h);
@@ -976,19 +1074,19 @@ void AddSymbols(lib_t *maplib, kh_mapsymbols_t* mapsymbols, kh_mapsymbols_t* wea
if((type==STT_OBJECT || type==STT_FUNC || type==STT_COMMON || type==STT_TLS || type==STT_NOTYPE)
&& (vis==STV_DEFAULT || vis==STV_PROTECTED || (vis==STV_HIDDEN && bind==STB_LOCAL)) && (h->SymTab[i].st_shndx!=0)) {
if(sz && strstr(symname, "@@")) {
- char symnameversionned[strlen(symname)+1];
- strcpy(symnameversionned, symname);
+ char symnameversioned[strlen(symname)+1];
+ strcpy(symnameversioned, symname);
// extact symname@@vername
- char* p = strchr(symnameversionned, '@');
+ char* p = strchr(symnameversioned, '@');
*p=0;
p+=2;
- symname = AddDictionnary(my_context->versym, symnameversionned);
+ symname = AddDictionnary(my_context->versym, symnameversioned);
const char* vername = AddDictionnary(my_context->versym, p);
- AddDefaultVersion((bind==STB_WEAK)?my_context->weakdefver:my_context->globaldefver, symname, vername);
+ AddDefaultVersion((bind==STB_WEAK)?h->weakdefver:h->globaldefver, symname, vername);
if((bind==STB_GNU_UNIQUE /*|| (bind==STB_GLOBAL && type==STT_FUNC)*/) && FindGlobalSymbol(maplib, symname, 2, p))
continue;
uintptr_t offs = (type==STT_TLS)?h->SymTab[i].st_value:(h->SymTab[i].st_value + h->delta);
- printf_dump(LOG_NEVER, "Adding Default Versionned Symbol(bind=%s) \"%s@%s\" with offset=%p sz=%zu\n", (bind==STB_LOCAL)?"LOCAL":((bind==STB_WEAK)?"WEAK":"GLOBAL"), symname, vername, (void*)offs, sz);
+ printf_dump(LOG_NEVER, "Adding Default Versioned Symbol(bind=%s) \"%s@%s\" with offset=%p sz=%zu\n", (bind==STB_LOCAL)?"LOCAL":((bind==STB_WEAK)?"WEAK":"GLOBAL"), symname, vername, (void*)offs, sz);
if(bind==STB_LOCAL)
AddSymbol(localsymbols, symname, offs, sz, 2, vername);
else // add in local and global map
@@ -1026,17 +1124,17 @@ void AddSymbols(lib_t *maplib, kh_mapsymbols_t* mapsymbols, kh_mapsymbols_t* wea
uintptr_t offs = (type==STT_TLS)?h->DynSym[i].st_value:(h->DynSym[i].st_value + h->delta);
size_t sz = h->DynSym[i].st_size;
int version = h->VerSym?((Elf64_Half*)((uintptr_t)h->VerSym+h->delta))[i]:-1;
- int add_default = (version!=-1 && (version&0x7fff)>1 && !(version&0x8000) && !GetDefaultVersion((bind==STB_WEAK)?my_context->weakdefver:my_context->globaldefver, symname))?1:0;
+ int add_default = (version!=-1 && (version&0x7fff)>1 && !(version&0x8000) && !GetMaplibDefaultVersion(my_context->maplib, (maplib==my_context->maplib)?NULL:maplib, (bind==STB_WEAK)?1:0, symname))?1:0;
if(version!=-1) version &= 0x7fff;
const char* vername = GetSymbolVersion(h, version);
if(add_default) {
- AddDefaultVersion((bind==STB_WEAK)?my_context->weakdefver:my_context->globaldefver, symname, vername);
+ AddDefaultVersion((bind==STB_WEAK)?h->weakdefver:h->globaldefver, symname, vername);
printf_dump(LOG_NEVER, "Adding Default Version \"%s\" for Symbol\"%s\"\n", vername, symname);
}
int to_add = 1;
if(!to_add || (bind==STB_GNU_UNIQUE && FindGlobalSymbol(maplib, symname, version, vername)))
continue;
- printf_dump(LOG_NEVER, "Adding Versionned Symbol(bind=%s) \"%s\" (ver=%d/%s) with offset=%p sz=%zu\n", (bind==STB_LOCAL)?"LOCAL":((bind==STB_WEAK)?"WEAK":"GLOBAL"), symname, version, vername?vername:"(none)", (void*)offs, sz);
+ printf_dump(LOG_NEVER, "Adding Versioned Symbol(bind=%s) \"%s\" (ver=%d/%s) with offset=%p sz=%zu\n", (bind==STB_LOCAL)?"LOCAL":((bind==STB_WEAK)?"WEAK":"GLOBAL"), symname, version, vername?vername:"(none)", (void*)offs, sz);
if(bind==STB_LOCAL)
AddSymbol(localsymbols, symname, offs, sz, version, vername);
else // add in local and global map
@@ -1047,6 +1145,7 @@ void AddSymbols(lib_t *maplib, kh_mapsymbols_t* mapsymbols, kh_mapsymbols_t* wea
}
}
}
+ checkHookedSymbols(h);
}
/*
@@ -1127,9 +1226,13 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, int local, int bindnow, box64c
DumpDynamicNeeded(h);
int cnt = 0;
- for (int i=0; i<h->numDynamic; ++i)
+ // count the number of needed libs, and also grab soname
+ for (int i=0; i<h->numDynamic; ++i) {
if(h->Dynamic[i].d_tag==DT_NEEDED)
++cnt;
+ if(h->Dynamic[i].d_tag==DT_SONAME)
+ h->soname = h->DynStrTab+h->delta+h->Dynamic[i].d_un.d_val;
+ }
h->needed = new_neededlib(cnt);
if(h == my_context->elfs[0])
my_context->neededlibs = h->needed;
@@ -1139,7 +1242,7 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, int local, int bindnow, box64c
h->needed->names[j++] = h->DynStrTab+h->delta+h->Dynamic[i].d_un.d_val;
// TODO: Add LD_LIBRARY_PATH and RPATH handling
- if(AddNeededLib(maplib, local, bindnow, h->needed, box64, emu)) {
+ if(AddNeededLib(maplib, local, bindnow, h->needed, h, box64, emu)) {
printf_log(LOG_INFO, "Error loading one of needed lib\n");
if(!allow_missing_libs)
return 1; //error...
@@ -1184,6 +1287,7 @@ void MarkElfInitDone(elfheader_t* h)
if(h)
h->init_done = 1;
}
+void startMallocHook();
void RunElfInitPltResolver(elfheader_t* h, x64emu_t *emu)
{
if(!h || h->init_done)
@@ -1198,17 +1302,20 @@ void RunElfInitPltResolver(elfheader_t* h, x64emu_t *emu)
}
printf_dump(LOG_DEBUG, "Calling Init for %s @%p\n", ElfName(h), (void*)p);
if(h->initentry)
- RunSafeFunction(my_context, p, 3, my_context->argc, my_context->argv, my_context->envv);
+ RunSafeFunction(p, 3, my_context->argc, my_context->argv, my_context->envv);
printf_dump(LOG_DEBUG, "Done Init for %s\n", ElfName(h));
// and check init array now
Elf64_Addr *addr = (Elf64_Addr*)(h->initarray + h->delta);
for (size_t i=0; i<h->initarray_sz; ++i) {
if(addr[i]) {
printf_dump(LOG_DEBUG, "Calling Init[%zu] for %s @%p\n", i, ElfName(h), (void*)addr[i]);
- RunSafeFunction(my_context, (uintptr_t)addr[i], 3, my_context->argc, my_context->argv, my_context->envv);
+ RunSafeFunction((uintptr_t)addr[i], 3, my_context->argc, my_context->argv, my_context->envv);
}
}
+ if(h->malloc_hook_2)
+ startMallocHook();
+
h->fini_done = 0; // can be fini'd now (in case it was re-inited)
printf_dump(LOG_DEBUG, "All Init Done for %s\n", ElfName(h));
return;
@@ -1224,13 +1331,13 @@ void RunElfInit(elfheader_t* h, x64emu_t *emu)
box64context_t* context = GetEmuContext(emu);
// Refresh no-file part of TLS in case default value changed
RefreshElfTLS(h);
- // check if in deferedInit
- if(context->deferedInit) {
- if(context->deferedInitSz==context->deferedInitCap) {
- context->deferedInitCap += 4;
- context->deferedInitList = (elfheader_t**)box_realloc(context->deferedInitList, context->deferedInitCap*sizeof(elfheader_t*));
+ // check if in deferredInit
+ if(context->deferredInit) {
+ if(context->deferredInitSz==context->deferredInitCap) {
+ context->deferredInitCap += 4;
+ context->deferredInitList = (elfheader_t**)box_realloc(context->deferredInitList, context->deferredInitCap*sizeof(elfheader_t*));
}
- context->deferedInitList[context->deferedInitSz++] = h;
+ context->deferredInitList[context->deferredInitSz++] = h;
return;
}
h->init_done = 1;
@@ -1253,24 +1360,27 @@ void RunElfInit(elfheader_t* h, x64emu_t *emu)
}
}
+ if(h->malloc_hook_2)
+ startMallocHook();
+
h->fini_done = 0; // can be fini'd now (in case it was re-inited)
printf_dump(LOG_DEBUG, "All Init Done for %s\n", ElfName(h));
return;
}
EXPORTDYN
-void RunDeferedElfInit(x64emu_t *emu)
+void RunDeferredElfInit(x64emu_t *emu)
{
box64context_t* context = GetEmuContext(emu);
- if(!context->deferedInit)
+ if(!context->deferredInit)
return;
- context->deferedInit = 0;
- if(!context->deferedInitList)
+ context->deferredInit = 0;
+ if(!context->deferredInitList)
return;
- int Sz = context->deferedInitSz;
- elfheader_t** List = context->deferedInitList;
- context->deferedInitList = NULL;
- context->deferedInitCap = context->deferedInitSz = 0;
+ int Sz = context->deferredInitSz;
+ elfheader_t** List = context->deferredInitList;
+ context->deferredInitList = NULL;
+ context->deferredInitCap = context->deferredInitSz = 0;
for (int i=0; i<Sz; ++i)
RunElfInit(List[i], emu);
box_free(List);
@@ -1278,7 +1388,7 @@ void RunDeferedElfInit(x64emu_t *emu)
void RunElfFini(elfheader_t* h, x64emu_t *emu)
{
- if(!h || h->fini_done)
+ if(!h || h->fini_done || !h->init_done)
return;
h->fini_done = 1;
// first check fini array
@@ -1294,8 +1404,6 @@ void RunElfFini(elfheader_t* h, x64emu_t *emu)
RunFunctionWithEmu(emu, 0, p, 0);
}
h->init_done = 0; // can be re-inited again...
- for(int i=0; i<h->needed->size; ++i)
- FiniLibrary(h->needed->libs[i], emu);
return;
}
@@ -1407,7 +1515,7 @@ const char* FindNearestSymbolName(elfheader_t* h, void* p, uintptr_t* start, uin
return ret;
}
-const char* VersionnedName(const char* name, int ver, const char* vername)
+const char* VersionedName(const char* name, int ver, const char* vername)
{
if(ver==-1)
return name;
@@ -1427,7 +1535,7 @@ const char* VersionnedName(const char* name, int ver, const char* vername)
return AddDictionnary(my_context->versym, buf);
}
-int SameVersionnedSymbol(const char* name1, int ver1, const char* vername1, const char* name2, int ver2, const char* vername2)
+int SameVersionedSymbol(const char* name1, int ver1, const char* vername1, const char* name2, int ver2, const char* vername2)
{
if(strcmp(name1, name2)) //name are different, no need to go further
return 0;
@@ -1451,24 +1559,19 @@ void* GetDTatOffset(box64context_t* context, unsigned long int index, unsigned l
int32_t GetTLSBase(elfheader_t* h)
{
- return h->tlsbase;
+ return h?h->tlsbase:0;
}
uint32_t GetTLSSize(elfheader_t* h)
{
- return h->tlssize;
+ return h?h->tlssize:0;
}
void* GetTLSPointer(box64context_t* context, elfheader_t* h)
{
- if(!h->tlssize)
+ if(!h || !h->tlssize)
return NULL;
- tlsdatasize_t* ptr;
- if ((ptr = (tlsdatasize_t*)pthread_getspecific(context->tlskey)) == NULL) {
- ptr = (tlsdatasize_t*)fillTLSData(context);
- }
- if(ptr->tlssize != context->tlssize)
- ptr = (tlsdatasize_t*)resizeTLSData(context, ptr);
+ tlsdatasize_t* ptr = getTLSData(context);
return ptr->data+h->tlsbase;
}
@@ -1532,7 +1635,7 @@ static int my_dl_iterate_phdr_##A(struct dl_phdr_info* a, size_t b, void* c)
return 0; \
if(!a->dlpi_name[0]) /*don't send informations about box64 itself*/ \
return 0; \
- return (int)RunFunction(my_context, my_dl_iterate_phdr_fct_##A, 3, a, b, c); \
+ return (int)RunFunction(my_dl_iterate_phdr_fct_##A, 3, a, b, c); \
}
SUPER()
#undef GO
@@ -1557,13 +1660,15 @@ EXPORT int my_dl_iterate_phdr(x64emu_t *emu, void* F, void *data) {
const char* empty = "";
int ret = 0;
for (int idx=0; idx<context->elfsize; ++idx) {
- my_dl_phdr_info_t info;
- info.dlpi_addr = GetElfDelta(context->elfs[idx]);
- info.dlpi_name = idx?context->elfs[idx]->name:empty; //1st elf is program, and this one doesn't get a name
- info.dlpi_phdr = context->elfs[idx]->PHEntries;
- info.dlpi_phnum = context->elfs[idx]->numPHEntries;
- if((ret = dl_iterate_phdr_callback(emu, F, &info, sizeof(info), data))) {
- return ret;
+ if(context->elfs[idx]) {
+ my_dl_phdr_info_t info;
+ info.dlpi_addr = GetElfDelta(context->elfs[idx]);
+ info.dlpi_name = idx?context->elfs[idx]->name:empty; //1st elf is program, and this one doesn't get a name
+ info.dlpi_phdr = context->elfs[idx]->PHEntries;
+ info.dlpi_phnum = context->elfs[idx]->numPHEntries;
+ if((ret = dl_iterate_phdr_callback(emu, F, &info, sizeof(info), data))) {
+ return ret;
+ }
}
}
// and now, go on native version
@@ -1737,7 +1842,7 @@ int dl_iterate_phdr_findsymbol(struct dl_phdr_info* info, size_t size, void* dat
return 0;
}
-void* GetNativeSymbolUnversionned(void* lib, const char* name)
+void* GetNativeSymbolUnversioned(void* lib, const char* name)
{
// try to find "name" in loaded elf, whithout checking for the symbol version (like dlsym, but no version check)
search_symbol_t s;
@@ -1752,6 +1857,16 @@ void* GetNativeSymbolUnversionned(void* lib, const char* name)
return s.addr;
}
+kh_defaultversion_t* GetGlobalDefaultVersion(elfheader_t* h)
+{
+ return h?h->globaldefver:NULL;
+}
+kh_defaultversion_t* GetWeakDefaultVersion(elfheader_t* h)
+{
+ return h?h->weakdefver:NULL;
+}
+
+
uintptr_t pltResolver = ~0LL;
EXPORT void PltResolver(x64emu_t* emu)
{
@@ -1774,12 +1889,14 @@ EXPORT void PltResolver(x64emu_t* emu)
library_t* lib = h->lib;
lib_t* local_maplib = GetMaplib(lib);
- GetGlobalSymbolStartEnd(my_context->maplib, symname, &offs, &end, h, version, vername);
+ const char* globdefver = (bind==STB_WEAK)?NULL:GetMaplibDefaultVersion(my_context->maplib, (my_context->maplib==local_maplib)?NULL:local_maplib, 0, symname);
+ const char* weakdefver = (bind==STB_WEAK)?GetMaplibDefaultVersion(my_context->maplib, (my_context->maplib==local_maplib)?NULL:local_maplib, 1, symname):NULL;
+ GetGlobalSymbolStartEnd(my_context->maplib, symname, &offs, &end, h, version, vername, globdefver, weakdefver);
if(!offs && !end && local_maplib) {
- GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, h, version, vername);
+ GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, h, version, vername, globdefver, weakdefver);
}
if(!offs && !end && !version)
- GetGlobalSymbolStartEnd(my_context->maplib, symname, &offs, &end, h, -1, NULL);
+ GetGlobalSymbolStartEnd(my_context->maplib, symname, &offs, &end, h, -1, NULL, globdefver, weakdefver);
if (!offs) {
printf_log(LOG_NONE, "Error: PltResolver: Symbol %s(ver %d: %s%s%s) not found, cannot apply R_X86_64_JUMP_SLOT %p (%p) in %s\n", symname, version, symname, vername?"@":"", vername?vername:"", p, *(void**)p, h->name);
@@ -1791,6 +1908,7 @@ EXPORT void PltResolver(x64emu_t* emu)
printf_dump(LOG_DEBUG, "symbol %s from %s but elf not initialized yet, run Init now (from %s)\n", symname, ElfName(sym_elf), ElfName(h));
RunElfInitPltResolver(sym_elf, emu);
}
+ offs = (uintptr_t)getAlternate((void*)offs);
if(p) {
printf_dump(LOG_DEBUG, " Apply %s R_X86_64_JUMP_SLOT %p with sym=%s(ver %d: %s%s%s) (%p -> %p / %s)\n", (bind==STB_LOCAL)?"Local":"Global", p, symname, version, symname, vername?"@":"", vername?vername:"",*(void**)p, (void*)offs, ElfName(sym_elf));
diff --git a/src/elfs/elfloader_private.h b/src/elfs/elfloader_private.h
index c463753..d2bc255 100755..100644
--- a/src/elfs/elfloader_private.h
+++ b/src/elfs/elfloader_private.h
@@ -4,6 +4,7 @@
typedef struct library_s library_t;
typedef struct needed_libs_s needed_libs_t;
typedef struct kh_mapsymbols_s kh_mapsymbols_t;
+typedef struct kh_defaultversion_s kh_defaultversion_t;
#include <elf.h>
#include "elfloader.h"
@@ -11,6 +12,7 @@ typedef struct kh_mapsymbols_s kh_mapsymbols_t;
struct elfheader_s {
char* name;
char* path; // Resolved path to file
+ char* soname; // soname of the elf
size_t numPHEntries;
Elf64_Phdr *PHEntries;
size_t numSHEntries;
@@ -34,6 +36,7 @@ struct elfheader_s {
Elf64_Verdef* VerDef;
int szVerDef;
int e_type;
+ uint32_t flags;
intptr_t delta; // should be 0
@@ -84,6 +87,7 @@ struct elfheader_s {
int init_done;
int fini_done;
int refcnt; // ref count for the elf
+ int malloc_hook_2; // this elf hook malloc, hacking it
char* memory; // char* and not void* to allow math on memory pointer
void** multiblock;
@@ -97,6 +101,8 @@ struct elfheader_s {
kh_mapsymbols_t *mapsymbols;
kh_mapsymbols_t *weaksymbols;
kh_mapsymbols_t *localsymbols;
+ kh_defaultversion_t *globaldefver; // the global default version for symbols (the XXX@@vvvv of symbols)
+ kh_defaultversion_t *weakdefver; // the weak default version for symbols (the XXX@@vvvv of symbols)
};
#define R_X86_64_NONE 0 /* No reloc */
diff --git a/src/elfs/elfparser.c b/src/elfs/elfparser.c
index 1fd3ca0..1701378 100755..100644
--- a/src/elfs/elfparser.c
+++ b/src/elfs/elfparser.c
@@ -278,6 +278,10 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec)
h->VerDef = (Elf64_Verdef*)ptr;
printf_dump(LOG_DEBUG, "The DT_VERDEF is at address %p\n", h->VerDef);
break;
+ case DT_FLAGS:
+ h->flags = val;
+ printf_dump(LOG_DEBUG, "The DT_FLAGS is 0x%x\n", h->flags);
+ break;
}
}
if(h->rel) {
@@ -412,18 +416,6 @@ int GetVersionIndice(elfheader_t* h, const char* vername)
{
if(!vername)
return 0;
- if(h->VerNeed) {
- Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed + h->delta);
- while(ver) {
- Elf64_Vernaux *aux = (Elf64_Vernaux*)((uintptr_t)ver + ver->vn_aux);
- for(int j=0; j<ver->vn_cnt; ++j) {
- if(!strcmp(h->DynStr+aux->vna_name, vername))
- return aux->vna_other;
- aux = (Elf64_Vernaux*)((uintptr_t)aux + aux->vna_next);
- }
- ver = ver->vn_next?((Elf64_Verneed*)((uintptr_t)ver + ver->vn_next)):NULL;
- }
- }
if(h->VerDef) {
Elf64_Verdef *def = (Elf64_Verdef*)((uintptr_t)h->VerDef + h->delta);
while(def) {
@@ -434,4 +426,44 @@ int GetVersionIndice(elfheader_t* h, const char* vername)
}
}
return 0;
+}
+
+int GetNeededVersionCnt(elfheader_t* h, const char* libname)
+{
+ if(!libname)
+ return 0;
+ if(h->VerNeed) {
+ Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed + h->delta);
+ while(ver) {
+ char *filename = h->DynStr + ver->vn_file;
+ Elf64_Vernaux *aux = (Elf64_Vernaux*)((uintptr_t)ver + ver->vn_aux);
+ if(!strcmp(filename, libname))
+ return ver->vn_cnt;
+ ver = ver->vn_next?((Elf64_Verneed*)((uintptr_t)ver + ver->vn_next)):NULL;
+ }
+ }
+ return 0;
+}
+
+const char* GetNeededVersionString(elfheader_t* h, const char* libname, int idx)
+{
+ if(!libname)
+ return 0;
+ if(h->VerNeed) {
+ Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed + h->delta);
+ while(ver) {
+ char *filename = h->DynStr + ver->vn_file;
+ Elf64_Vernaux *aux = (Elf64_Vernaux*)((uintptr_t)ver + ver->vn_aux);
+ if(!strcmp(filename, libname)) {
+ for(int j=0; j<ver->vn_cnt; ++j) {
+ if(j==idx)
+ return h->DynStr+aux->vna_name;
+ aux = (Elf64_Vernaux*)((uintptr_t)aux + aux->vna_next);
+ }
+ return NULL; // idx out of bound, return NULL...
+ }
+ ver = ver->vn_next?((Elf64_Verneed*)((uintptr_t)ver + ver->vn_next)):NULL;
+ }
+ }
+ return NULL;
} \ No newline at end of file
diff --git a/src/emu/modrm.h b/src/emu/modrm.h
index c01343b..cd967c0 100644
--- a/src/emu/modrm.h
+++ b/src/emu/modrm.h
@@ -18,7 +18,37 @@
#define STEP3
#endif
+#ifdef TEST_INTERPRETER
+#define GETED(D) oped=TestEd(test, &addr, rex, nextop, D)
+#define GETE4(D) oped=TestEd4(test, &addr, rex, nextop, D)
+#define GETE8(D) oped=TestEd8(test, &addr, rex, nextop, D)
+#define GETET(D) oped=TestEdt(test, &addr, rex, nextop, D)
+#define GETE8xw(D) oped=TestEd8xw(test, rex.w, &addr, rex, nextop, D)
+#define GETED32(D) oped=TestEd32O(test, &addr, rex, nextop, D, 0)
+#define GETED_OFFS(D, O) oped=TestEdO(test, &addr, rex, nextop, D, O)
+#define GETGD opgd=GetGd(test->emu, &addr, rex, nextop)
+#define GETEB(D) oped=TestEb(test, &addr, rex, nextop, D)
+#define GETEB32(D) oped=TestEb32O(test, &addr, rex, nextop, D, 0)
+#define GETEB_OFFS(D, O) oped=TestEbO(test, &addr, rex, nextop, D, O)
+#define GETGB opgd=GetGb(test->emu, &addr, rex, nextop)
+#define GETEW(D) oped=TestEw(test, &addr, rex, nextop, D)
+#define GETEW32(D) oped=TestEw32O(test, &addr, rex, nextop, D, 0)
+#define GETEW_OFFS(D, O) oped=TestEdO(test, &addr, rex, nextop, D, O)
+#define GETEW_OFFS_16(O) oped=TestEw16off(test, &addr, rex, nextop, O)
+#define GETGW opgd=GetGw(test->emu, &addr, rex, nextop)
+#define GETEX(D) opex=TestEx(test, &addr, rex, nextop, D)
+#define GETEX32(D) opex=TestEx32O(test, &addr, rex, nextop, D, 0)
+#define GETEX_OFFS(D, O) opex=TestExO(test, &addr, rex, nextop, D, O)
+#define GETGX opgx=GetGx(test->emu, &addr, rex, nextop)
+#define GETEM(D) opem=TestEm(test, &addr, rex, nextop, D)
+#define GETEM32(D) opem=TestEm32O(test, &addr, rex, nextop, D, 0)
+#define GETGM opgm=GetGm(test->emu, &addr, rex, nextop)
+#else
#define GETED(D) oped=GetEd(emu, &addr, rex, nextop, D)
+#define GETE4(D) GETED(D)
+#define GETE8(D) GETED(D)
+#define GETET(D) GETED(D)
+#define GETE8xw(D) GETED(D)
#define GETED32(D) oped=GetEd32O(emu, &addr, rex, nextop, D, 0)
#define GETED_OFFS(D, O) oped=GetEdO(emu, &addr, rex, nextop, D, O)
#define GETGD opgd=GetGd(emu, &addr, rex, nextop)
@@ -29,6 +59,7 @@
#define GETEW(D) oped=GetEw(emu, &addr, rex, nextop, D)
#define GETEW32(D) oped=GetEw32O(emu, &addr, rex, nextop, D, 0)
#define GETEW_OFFS(D, O) oped=GetEdO(emu, &addr, rex, nextop, D, O)
+#define GETEW_OFFS_16(O) oped=GetEw16off(emu, &addr, rex, nextop, O)
#define GETGW opgd=GetGw(emu, &addr, rex, nextop)
#define GETEX(D) opex=GetEx(emu, &addr, rex, nextop, D)
#define GETEX32(D) opex=GetEx32O(emu, &addr, rex, nextop, D, 0)
@@ -37,6 +68,7 @@
#define GETEM(D) opem=GetEm(emu, &addr, rex, nextop, D)
#define GETEM32(D) opem=GetEm32O(emu, &addr, rex, nextop, D, 0)
#define GETGM opgm=GetGm(emu, &addr, rex, nextop)
+#endif
#define ED oped
#define GD opgd
#define EB oped
@@ -47,6 +79,11 @@
#define GX opgx
#define EM opem
#define GM opgm
+#define FAKEED(D) GetEd(emu, &addr, rex, nextop, D)
+#define FAKEED32(D) GetEd32O(emu, &addr, rex, nextop, D, 0)
+#define GETEA(D) GetEA(emu, &addr, rex, nextop, D)
+#define _GETED(D) oped=GetEd(emu, &addr, rex, nextop, D)
+#define _GETED32(D) oped=GetEd32O(emu, &addr, rex, nextop, D, 0)
#define MODREG ((nextop&0xC0)==0xC0)
diff --git a/src/emu/x64emu.c b/src/emu/x64emu.c
index 9a328bb..95077d4 100755..100644
--- a/src/emu/x64emu.c
+++ b/src/emu/x64emu.c
@@ -38,6 +38,7 @@ typedef struct cleanup_s {
void* f;
int arg;
void* a;
+ void* dso;
} cleanup_t;
static uint32_t x86emu_parity_tab[8] =
@@ -57,17 +58,6 @@ uint32_t* GetParityTab()
return x86emu_parity_tab;
}
-void PushExit(x64emu_t* emu)
-{
- uintptr_t endMarker = AddCheckBridge(my_context->system, NULL, NULL, 0, "ExitEmulation");
- Push(emu, endMarker);
-}
-
-void* GetExit()
-{
- return (void*)AddCheckBridge(my_context->system, NULL, NULL, 0, "ExitEmulation");
-}
-
static void internalX64Setup(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack)
{
emu->context = context;
@@ -85,9 +75,9 @@ static void internalX64Setup(x64emu_t* emu, box64context_t *context, uintptr_t s
R_RIP = start;
R_RSP = (stack + stacksize) & ~7; // align stack start, always
// fake init of segments...
- emu->segs[_CS] = 0x73;
- emu->segs[_DS] = emu->segs[_ES] = emu->segs[_SS] = 0x7b;
- emu->segs[_FS] = 0x33;
+ emu->segs[_CS] = 0x33;
+ emu->segs[_DS] = emu->segs[_ES] = emu->segs[_SS] = 0x2b;
+ emu->segs[_FS] = 0x43;
emu->segs[_GS] = default_gs;
// setup fpu regs
reset_fpu(emu);
@@ -116,10 +106,18 @@ x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t s
}
EXPORTDYN
-void SetupX64Emu(x64emu_t *emu)
+void SetupX64Emu(x64emu_t *emu, x64emu_t *ref)
{
printf_log(LOG_DEBUG, "Setup X86_64 Emu\n");
- (void)emu; // Not doing much here...
+ if(ref) {
+ // save RIP and RSP
+ uintptr_t old_rip = R_RIP;
+ uintptr_t old_rsp = R_RSP;
+ CloneEmu(emu, ref);
+ // restore RIP and RSP
+ R_RIP = old_rip;
+ R_RSP = old_rsp;
+ }
}
#ifdef HAVE_TRACE
@@ -139,7 +137,7 @@ void SetTraceEmu(uintptr_t start, uintptr_t end)
}
#endif
-void AddCleanup(x64emu_t *emu, void *p)
+void AddCleanup(x64emu_t *emu, void *p, void* dso_handle)
{
(void)emu;
@@ -149,10 +147,11 @@ void AddCleanup(x64emu_t *emu, void *p)
}
my_context->cleanups[my_context->clean_sz].arg = 0;
my_context->cleanups[my_context->clean_sz].a = NULL;
+ my_context->cleanups[my_context->clean_sz].dso = dso_handle;
my_context->cleanups[my_context->clean_sz++].f = p;
}
-void AddCleanup1Arg(x64emu_t *emu, void *p, void* a)
+void AddCleanup1Arg(x64emu_t *emu, void *p, void* a, void* dso_handle)
{
(void)emu;
@@ -162,6 +161,7 @@ void AddCleanup1Arg(x64emu_t *emu, void *p, void* a)
}
my_context->cleanups[my_context->clean_sz].arg = 1;
my_context->cleanups[my_context->clean_sz].a = a;
+ my_context->cleanups[my_context->clean_sz].dso = dso_handle;
my_context->cleanups[my_context->clean_sz++].f = p;
}
@@ -169,7 +169,7 @@ void CallCleanup(x64emu_t *emu, void* p)
{
printf_log(LOG_DEBUG, "Calling atexit registered functions for %p mask\n", p);
for(int i=my_context->clean_sz-1; i>=0; --i) {
- if(p==my_context->cleanups[i].f) {
+ if(p==my_context->cleanups[i].dso) {
printf_log(LOG_DEBUG, "Call cleanup #%d\n", i);
RunFunctionWithEmu(emu, 0, (uintptr_t)(my_context->cleanups[i].f), my_context->cleanups[i].arg, my_context->cleanups[i].a );
// now remove the cleanup
@@ -205,6 +205,11 @@ void FreeX64Emu(x64emu_t **emu)
return;
printf_log(LOG_DEBUG, "%04d|Free a X86_64 Emu (%p)\n", GetTID(), *emu);
+ if((*emu)->test.emu) {
+ internalFreeX64((*emu)->test.emu);
+ box_free((*emu)->test.emu);
+ (*emu)->test.emu = NULL;
+ }
internalFreeX64(*emu);
box_free(*emu);
@@ -238,6 +243,13 @@ void CloneEmu(x64emu_t *newemu, const x64emu_t* emu)
newemu->top = emu->top;
newemu->fpu_stack = emu->fpu_stack;
memcpy(newemu->xmm, emu->xmm, sizeof(emu->xmm));
+ newemu->df = emu->df;
+ newemu->df_sav = emu->df_sav;
+ newemu->op1 = emu->op1;
+ newemu->op2 = emu->op2;
+ newemu->res = emu->res;
+ newemu->op1_sav = emu->op1_sav;
+ newemu->res_sav = emu->res_sav;
newemu->mxcsr = emu->mxcsr;
newemu->quit = emu->quit;
newemu->error = emu->error;
@@ -247,6 +259,37 @@ void CloneEmu(x64emu_t *newemu, const x64emu_t* emu)
newemu->regs[_SP].q[0] = emu->regs[_SP].q[0] + (intptr_t)(newst - oldst);
}
+void CopyEmu(x64emu_t *newemu, const x64emu_t* emu)
+{
+ memcpy(newemu->regs, emu->regs, sizeof(emu->regs));
+ memcpy(&newemu->ip, &emu->ip, sizeof(emu->ip));
+ memcpy(&newemu->eflags, &emu->eflags, sizeof(emu->eflags));
+ newemu->old_ip = emu->old_ip;
+ memcpy(newemu->segs, emu->segs, sizeof(emu->segs));
+ memcpy(newemu->segs_serial, emu->segs_serial, sizeof(emu->segs_serial));
+ memcpy(newemu->segs_offs, emu->segs_offs, sizeof(emu->segs_offs));
+ memcpy(newemu->x87, emu->x87, sizeof(emu->x87));
+ memcpy(newemu->mmx, emu->mmx, sizeof(emu->mmx));
+ memcpy(newemu->xmm, emu->xmm, sizeof(emu->xmm));
+ memcpy(newemu->fpu_ld, emu->fpu_ld, sizeof(emu->fpu_ld));
+ memcpy(newemu->fpu_ll, emu->fpu_ll, sizeof(emu->fpu_ll));
+ memcpy(newemu->p_regs, emu->p_regs, sizeof(emu->p_regs));
+ newemu->cw = emu->cw;
+ newemu->sw = emu->sw;
+ newemu->top = emu->top;
+ newemu->fpu_stack = emu->fpu_stack;
+ newemu->df = emu->df;
+ newemu->df_sav = emu->df_sav;
+ newemu->op1 = emu->op1;
+ newemu->op2 = emu->op2;
+ newemu->res = emu->res;
+ newemu->op1_sav = emu->op1_sav;
+ newemu->res_sav = emu->res_sav;
+ newemu->mxcsr = emu->mxcsr;
+ newemu->quit = emu->quit;
+ newemu->error = emu->error;
+}
+
box64context_t* GetEmuContext(x64emu_t* emu)
{
return emu->context;
@@ -352,11 +395,13 @@ void ResetFlags(x64emu_t *emu)
emu->df = d_none;
}
-const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip)
+const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits)
{
static char buff[1000];
- char* regname[] = {"RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI",
- " R8", " R9", "R10", "R11", "R12", "R13", "R14", "R15"};
+ static const char* regname[] = {"RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI",
+ " R8", " R9", "R10", "R11", "R12", "R13", "R14", "R15"};
+ static const char* regname32[]={"EAX", "ECX", "EDX", "EBX", "ESP", "EBP", "ESI", "EDI"};
+ static const char* segname[] = {"ES", "CS", "SS", "DS", "FS", "GS"};
char tmp[160];
buff[0] = '\0';
#ifdef HAVE_TRACE
@@ -370,8 +415,14 @@ const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip)
}
if(trace_xmm) {
// do xmm reg if needed
- for(int i=0; i<8; ++i) {
- sprintf(tmp, "%d:%016lx%016lx", i, emu->xmm[i].q[1], emu->xmm[i].q[0]);
+ for(int i=0; i<(is32bits?8:16); ++i) {
+ if (trace_regsdiff && (emu->old_xmm[i].q[0] != emu->xmm[i].q[0] || emu->old_xmm[i].q[1] != emu->xmm[i].q[1])) {
+ sprintf(tmp, "\e[1;35m%02d:%016lx-%016lx\e[m", i, emu->xmm[i].q[1], emu->xmm[i].q[0]);
+ emu->old_xmm[i].q[0] = emu->xmm[i].q[0];
+ emu->old_xmm[i].q[1] = emu->xmm[i].q[1];
+ } else {
+ sprintf(tmp, "%02d:%016lx-%016lx", i, emu->xmm[i].q[1], emu->xmm[i].q[0]);
+ }
strcat(buff, tmp);
if ((i&3)==3) strcat(buff, "\n"); else strcat(buff, " ");
}
@@ -389,21 +440,28 @@ const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip)
}
strcat(buff, "\n");
}
- for (int i=_AX; i<=_R15; ++i) {
+ for (int i=0; i<6; ++i) {
+ sprintf(tmp, "%s=0x%04x", segname[i], emu->segs[i]);
+ strcat(buff, tmp);
+ if(i!=_GS)
+ strcat(buff, " ");
+ }
+ strcat(buff, "\n");
+ if(is32bits)
+ for (int i=_AX; i<=_RDI; ++i) {
#ifdef HAVE_TRACE
- if (trace_regsdiff && (emu->regs[i].q[0] != emu->oldregs[i].q[0])) {
- sprintf(tmp, "\e[1;35m%s=%016lx\e[m ", regname[i], emu->regs[i].q[0]);
- emu->oldregs[i].q[0] = emu->regs[i].q[0];
- } else {
- sprintf(tmp, "%s=%016lx ", regname[i], emu->regs[i].q[0]);
- }
+ if (trace_regsdiff && (emu->regs[i].dword[0] != emu->oldregs[i].q[0])) {
+ sprintf(tmp, "\e[1;35m%s=%08x\e[m ", regname32[i], emu->regs[i].dword[0]);
+ emu->oldregs[i].q[0] = emu->regs[i].dword[0];
+ } else {
+ sprintf(tmp, "%s=%08x ", regname32[i], emu->regs[i].dword[0]);
+ }
#else
- sprintf(tmp, "%s=%016lx ", regname[i], emu->regs[i].q[0]);
+ sprintf(tmp, "%s=%08x ", regname[i], emu->regs[i].dword[0]);
#endif
- strcat(buff, tmp);
+ strcat(buff, tmp);
- if (i%5==4) {
- if(i==4) {
+ if(i==_RBX) {
if(emu->df) {
#define FLAG_CHAR(f) (ACCESS_FLAG(F_##f##F)) ? #f : "?"
sprintf(tmp, "flags=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C));
@@ -415,22 +473,54 @@ const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip)
strcat(buff, tmp);
#undef FLAG_CHAR
}
+ }
+ }
+ else
+ for (int i=_AX; i<=_R15; ++i) {
+#ifdef HAVE_TRACE
+ if (trace_regsdiff && (emu->regs[i].q[0] != emu->oldregs[i].q[0])) {
+ sprintf(tmp, "\e[1;35m%s=%016lx\e[m ", regname[i], emu->regs[i].q[0]);
+ emu->oldregs[i].q[0] = emu->regs[i].q[0];
} else {
- strcat(buff, "\n");
+ sprintf(tmp, "%s=%016lx ", regname[i], emu->regs[i].q[0]);
}
- }
+#else
+ sprintf(tmp, "%s=%016lx ", regname[i], emu->regs[i].q[0]);
+#endif
+ strcat(buff, tmp);
+
+ if (i%5==4) {
+ if(i==4) {
+ if(emu->df) {
+#define FLAG_CHAR(f) (ACCESS_FLAG(F_##f##F)) ? #f : "?"
+ sprintf(tmp, "flags=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C));
+ strcat(buff, tmp);
+#undef FLAG_CHAR
+ } else {
+#define FLAG_CHAR(f) (ACCESS_FLAG(F_##f##F)) ? #f : "-"
+ sprintf(tmp, "FLAGS=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C));
+ strcat(buff, tmp);
+#undef FLAG_CHAR
+ }
+ } else {
+ strcat(buff, "\n");
+ }
+ }
}
- sprintf(tmp, "RIP=%016lx ", ip);
+ if(is32bits)
+ sprintf(tmp, "EIP=%08lx ", ip);
+ else
+ sprintf(tmp, "RIP=%016lx ", ip);
strcat(buff, tmp);
return buff;
}
-void StopEmu(x64emu_t* emu, const char* reason)
+void StopEmu(x64emu_t* emu, const char* reason, int is32bits)
{
emu->quit = 1;
printf_log(LOG_NONE, "%s", reason);
// dump stuff...
- printf_log(LOG_NONE, "==== CPU Registers ====\n%s\n", DumpCPURegs(emu, R_RIP));
+ printf_log(LOG_NONE, "==== CPU Registers ====\n%s\n", DumpCPURegs(emu, R_RIP, is32bits));
printf_log(LOG_NONE, "======== Stack ========\nStack is from %lX to %lX\n", R_RBP, R_RSP);
if (R_RBP == R_RSP) {
printf_log(LOG_NONE, "RBP = RSP: leaf function detected; next 128 bytes should be either data or random.\n");
@@ -445,13 +535,13 @@ void StopEmu(x64emu_t* emu, const char* reason)
#endif
}
-void UnimpOpcode(x64emu_t* emu)
+void UnimpOpcode(x64emu_t* emu, int is32bits)
{
R_RIP = emu->old_ip;
int tid = syscall(SYS_gettid);
- printf_log(LOG_NONE, "%04d|%p: Unimplemented Opcode (%02X %02X %02X %02X) %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n",
- tid, (void*)emu->old_ip,
+ printf_log(LOG_NONE, "%04d|%p: Unimplemented %sOpcode (%02X %02X %02X %02X) %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n",
+ tid, (void*)emu->old_ip, is32bits?"32bits ":"",
Peek(emu, -4), Peek(emu, -3), Peek(emu, -2), Peek(emu, -1),
Peek(emu, 0), Peek(emu, 1), Peek(emu, 2), Peek(emu, 3),
Peek(emu, 4), Peek(emu, 5), Peek(emu, 6), Peek(emu, 7),
@@ -477,9 +567,9 @@ void EmuCall(x64emu_t* emu, uintptr_t addr)
Run(emu, 0);
emu->quit = 0; // reset Quit flags...
emu->df = d_none;
- if(emu->quitonlongjmp && emu->longjmp) {
- if(emu->quitonlongjmp==1)
- emu->longjmp = 0; // don't change anything because of the longjmp
+ if(emu->flags.quitonlongjmp && emu->flags.longjmp) {
+ if(emu->flags.quitonlongjmp==1)
+ emu->flags.longjmp = 0; // don't change anything because of the longjmp
} else {
R_RBX = old_rbx;
R_RDI = old_rdi;
diff --git a/src/emu/x64emu_private.h b/src/emu/x64emu_private.h
index 68fa5f8..8076049 100755..100644
--- a/src/emu/x64emu_private.h
+++ b/src/emu/x64emu_private.h
@@ -25,6 +25,25 @@ typedef union multiuint_s {
uint64_t u64;
} multiuint_t;
+typedef struct x64emu_s x64emu_t;
+
+typedef struct x64test_s {
+ x64emu_t* emu;
+ uintptr_t memaddr;
+ int memsize;
+ int test;
+ int clean;
+ uint8_t mem[16];
+} x64test_t;
+
+typedef struct emu_flags_s {
+ uint32_t need_jmpbuf:1; // need a new jmpbuff for signal handling
+ uint32_t quitonlongjmp:2; // quit if longjmp is called
+ uint32_t quitonexit:2; // quit if exit/_exit is called
+ uint32_t longjmp:1; // if quit because of longjmp
+ uint32_t jmpbuf_ready:1; // the jmpbuf in the emu is ok and don't need refresh
+} emu_flags_t;
+
typedef struct x64emu_s {
// cpu
reg64_t regs[16];
@@ -37,7 +56,7 @@ typedef struct x64emu_s {
mmx87_regs_t mmx[8];
x87control_t cw;
x87flags_t sw;
- uint32_t top; // top is part of sw, but it's faster to have it separatly
+ uint32_t top; // top is part of sw, but it's faster to have it separately
int fpu_stack;
mmxcontrol_t mxcsr;
fpu_ld_t fpu_ld[8]; // for long double emulation / 80bits fld fst
@@ -45,15 +64,15 @@ typedef struct x64emu_s {
fpu_p_reg_t p_regs[8];
// old ip
uintptr_t old_ip;
- // defered flags
+ // deferred flags
int dummy1; // to align on 64bits with df
- defered_flags_t df;
+ deferred_flags_t df;
multiuint_t op1;
multiuint_t op2;
multiuint_t res;
- multiuint_t op1_sav; // for dec/inc defered flags, to be able to compute CF
+ multiuint_t op1_sav; // for dec/inc deferred flags, to be able to compute CF
multiuint_t res_sav;
- defered_flags_t df_sav;
+ deferred_flags_t df_sav;
uint32_t *x64emu_parity_tab; // helper
#ifdef HAVE_TRACE
reg64_t oldregs[16];
@@ -72,22 +91,24 @@ typedef struct x64emu_s {
int quit;
int error;
int fork; // quit because need to fork
- forkpty_t* forkpty_info;
int exit;
- int quitonlongjmp; // quit if longjmp is called
- int quitonexit; // quit if exit/_exit is called
- int longjmp; // if quit because of longjmp
- // scratch stack, used for alignement of double and 64bits ints on arm. 200 elements should be enough
+ forkpty_t* forkpty_info;
+ emu_flags_t flags;
+ x64test_t test; // used for dynarec testing
+ #ifdef HAVE_TRACE
+ sse_regs_t old_xmm[16];
+ #endif
+ // scratch stack, used for alignment of double and 64bits ints on arm. 200 elements should be enough
uint64_t scratch[200];
// local stack, do be deleted when emu is freed
void* stack2free; // this is the stack to free (can be NULL)
void* init_stack; // initial stack (owned or not)
uint32_t size_stack; // stack size (owned or not)
+ struct __jmp_buf_tag *jmpbuf;
x64_ucontext_t *uc_link; // to handle setcontext
int type; // EMUTYPE_xxx define
-
} x64emu_t;
#define EMUTYPE_NONE 0
diff --git a/src/emu/x64int3.c b/src/emu/x64int3.c
index 49cc000..d58574c 100755..100644
--- a/src/emu/x64int3.c
+++ b/src/emu/x64int3.c
@@ -12,6 +12,7 @@
#include <signal.h>
#include <poll.h>
#include <sys/wait.h>
+#include <elf.h>
#include "debug.h"
#include "box64stack.h"
@@ -25,6 +26,7 @@
#include "wrapper.h"
#include "box64context.h"
#include "librarian.h"
+#include "elfload_dump.h"
#include <elf.h>
#include "elfloader.h"
@@ -120,7 +122,17 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr)
const char *s = NULL;
s = GetNativeName((void*)a);
if(a==(uintptr_t)PltResolver) {
- snprintf(buff, 256, "%s", cycle_log?"PltResolver ":" ... ");
+ if(cycle_log) {
+ uintptr_t addr = *((uint64_t*)(R_RSP));
+ int slot = *((uint64_t*)(R_RSP+8));
+ elfheader_t *h = (elfheader_t*)addr;
+ Elf64_Rela * rel = (Elf64_Rela *)(h->jmprel + h->delta) + slot;
+ Elf64_Sym *sym = &h->DynSym[ELF64_R_SYM(rel->r_info)];
+ const char* symname = SymName(h, sym);
+ snprintf(buff, 256, "%04d|PltResolver \"%s\"", tid, symname?symname:"???");
+ } else {
+ snprintf(buff, 256, "%s", " ... ");
+ }
} else if (!strcmp(s, "__open") || !strcmp(s, "open") || !strcmp(s, "open ") || !strcmp(s, "open64")) {
tmp = (char*)(R_RDI);
snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\", %d (,%d))", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)", (int)(R_ESI), (int)(R_EDX));
@@ -141,6 +153,10 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr)
tmp = (char*)(R_RDI);
snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\", %p, %zd)", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)", (void*)(R_RSI), (size_t)R_RDX);
perr = 1;
+ } else if (!strcmp(s, "execv")) {
+ tmp = (char*)(R_RDI);
+ snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\", %p)", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)", (void*)(R_RSI));
+ perr = 1;
} else if (strstr(s, "mkdir")==s) {
tmp = (char*)(R_RDI);
snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\", %d)", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)", (int)(R_ESI));
@@ -202,11 +218,18 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr)
pu64 = (uint64_t*)R_RDI;
post = 3;
snprintf(buff, 256, "%04d|%p: Calling %s(%p, %zu, %d, %zu, \"%s\" (,%p))", tid, *(void**)(R_RSP), s, (void*)R_RDI, R_RSI, R_EDX, R_RCX, (tmp)?tmp:"(nil)", (void*)(R_R9));
- } else if (!strcmp(s, "snprintf")) {
+ } else if (strstr(s, "__vfprintf_chk")) {
+ tmp = (char*)(R_RDX);
+ pu64 = (uint64_t*)R_RDI;
+ snprintf(buff, 256, "%04d|%p: Calling %s(%p, %d, \"%s\", ... )", tid, *(void**)(R_RSP), s, (void*)R_RDI, R_ESI, (tmp)?tmp:"(nil)");
+ } else if (strstr(s, "snprintf")==s) {
tmp = (char*)(R_RDX);
pu64 = (uint64_t*)R_RDI;
post = 3;
snprintf(buff, 256, "%04d|%p: Calling %s(%p, %zu, \"%s\" (,%p))", tid, *(void**)(R_RSP), s, (void*)R_RDI, R_RSI, (tmp)?tmp:"(nil)", (void*)(R_RCX));
+ } else if (!strcmp(s, "vfprintf")) {
+ tmp = (char*)((R_RSI>2)?R_RSI:R_RDX);
+ snprintf(buff, 256, "%04d|%p: Calling %s(%p, \"%s\", ...)", tid, *(void**)(R_RSP), s, (void*)R_RDI, (tmp)?tmp:"(nil)");
} else if (!strcmp(s, "getcwd")) {
post = 2;
snprintf(buff, 256, "%04d|%p: Calling %s(%p, %zu)", tid, *(void**)(R_RSP), s, (void*)R_RDI, R_RSI);
@@ -237,6 +260,8 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr)
snprintf(buff, 256, "%04d|%p: Calling %s(0x%x, %d, 0x%x, %p)", tid, *(void**)(R_RSP), s, R_EDI, R_ESI, R_EDX, (void*)R_RCX);
} else if (!strcmp(s, "glUniform4fv")) {
snprintf(buff, 256, "%04d|%p: Calling %s(%d, %d, %p[%g/%g/%g/%g...])", tid, *(void**)(R_RSP), s, R_EDI, R_ESI, (void*)R_RDX, ((float*)(R_RDX))[0], ((float*)(R_RDX))[1], ((float*)(R_RDX))[2], ((float*)(R_RDX))[3]);
+ } else if (!strcmp(s, "ov_read")) {
+ snprintf(buff, 256, "%04d|%p: Calling %s(%p, %p, %d, %d, %d, %d, %p)", tid, *(void**)(R_RSP), s, (void*)R_RDI, (void*)R_RSI, R_EDX, R_ECX, R_R8d, R_R9d, *(void**)(R_RSP+8));
} else if (!strcmp(s, "mmap64") || !strcmp(s, "mmap")) {
snprintf(buff, 256, "%04d|%p: Calling %s(%p, %lu, 0x%x, 0x%x, %d, %ld)", tid, *(void**)(R_RSP), s,
(void*)R_RDI, R_RSI, (int)(R_RDX), (int)R_RCX, (int)R_R8, R_R9);
diff --git a/src/emu/x64primop.c b/src/emu/x64primop.c
index b027049..b027049 100755..100644
--- a/src/emu/x64primop.c
+++ b/src/emu/x64primop.c
diff --git a/src/emu/x64primop.h b/src/emu/x64primop.h
index a0f465a..a0f465a 100755..100644
--- a/src/emu/x64primop.h
+++ b/src/emu/x64primop.h
diff --git a/src/emu/x64run.c b/src/emu/x64run.c
index 032614d..1f2f9dd 100755..100644
--- a/src/emu/x64run.c
+++ b/src/emu/x64run.c
@@ -28,7 +28,11 @@
int my_setcontext(x64emu_t* emu, void* ucp);
+#ifdef TEST_INTERPRETER
+int RunTest(x64test_t *test)
+#else
int Run(x64emu_t *emu, int step)
+#endif
{
uint8_t opcode;
uint8_t nextop;
@@ -40,10 +44,15 @@ int Run(x64emu_t *emu, int step)
uint32_t tmp32u, tmp32u2;
int64_t tmp64s;
uint64_t tmp64u, tmp64u2, tmp64u3;
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ int step = 0;
+ #endif
uintptr_t addr = R_RIP;
- rex_t rex;
+ rex_t rex = {0};
int rep; // 0 none, 1=F2 prefix, 2=F3 prefix
int unimp = 0;
+ int is32bits = (emu->segs[_CS]==0x23);
if(emu->quit)
return 0;
@@ -54,12 +63,14 @@ int Run(x64emu_t *emu, int step)
return 0;
}
//ref opcode: http://ref.x64asm.net/geek32.html#xA1
- printf_log(LOG_DEBUG, "Run X86 (%p), RIP=%p, Stack=%p\n", emu, (void*)addr, (void*)R_RSP);
+ printf_log(LOG_DEBUG, "Run X86 (%p), RIP=%p, Stack=%p is32bits=%d\n", emu, (void*)addr, (void*)R_RSP, is32bits);
x64emurun:
-
- while(1) {
-#ifdef HAVE_TRACE
+#ifndef TEST_INTERPRETER
+ while(1)
+#endif
+ {
+#if defined(HAVE_TRACE)
__builtin_prefetch((void*)addr, 0, 0);
emu->prev2_ip = emu->old_ip;
if(my_context->dec && (
@@ -76,13 +87,15 @@ x64emurun:
rep = opcode-0xF1;
opcode = F8;
}
- while((opcode==0x3E)) //Branch Taken Hint ignored
+ while((opcode==0x3E) || (opcode==0x26)) //Branch Taken Hint ignored
opcode = F8;
rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ rex.is32bits = is32bits;
+ if(!is32bits)
+ while(opcode>=0x40 && opcode<=0x4f) {
+ rex.rex = opcode;
+ opcode = F8;
+ }
switch(opcode) {
@@ -132,28 +145,58 @@ x64emurun:
break;
GO(0x00, add) /* ADD 0x00 -> 0x05 */
+ case 0x06: /* PUSH ES */
+ if(!rex.is32bits) {
+ unimp = 1;
+ goto fini;
+ }
+ Push32(emu, emu->segs[_ES]); // even if a segment is a 16bits, a 32bits push/pop is done
+ break;
+ case 0x07: /* POP ES */
+ if(!rex.is32bits) {
+ unimp = 1;
+ goto fini;
+ }
+ emu->segs[_ES] = Pop32(emu); // no check, no use....
+ emu->segs_serial[_ES] = 0;
+ break;
GO(0x08, or) /* OR 0x08 -> 0x0D */
case 0x0F: /* More instructions */
switch(rep) {
case 1:
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestF20F(test, rex, addr, &step)))
+ unimp = 1;
+ #else
if(!(addr = RunF20F(emu, rex, addr, &step))) {
unimp = 1;
goto fini;
}
if(step==2) STEP2;
+ #endif
break;
case 2:
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestF30F(test, rex, addr)))
+ unimp = 1;
+ #else
if(!(addr = RunF30F(emu, rex, addr))) {
unimp = 1;
goto fini;
}
+ #endif
break;
default:
+ #ifdef TEST_INTERPRETER
+ if(!(addr = Test0F(test, rex, addr, &step)))
+ unimp = 1;
+ #else
if(!(addr = Run0F(emu, rex, addr, &step))) {
unimp = 1;
goto fini;
}
if(step==2) STEP2;
+ #endif
break;
}
if(emu->quit) {
@@ -168,10 +211,50 @@ x64emurun:
GO(0x30, xor) /* XOR 0x30 -> 0x35 */
#undef GO
+ case 0x1E: /* PUSH DS */
+ if(!rex.is32bits) {
+ unimp = 1;
+ goto fini;
+ }
+ Push32(emu, emu->segs[_DS]); // even if a segment is a 16bits, a 32bits push/pop is done
+ break;
+ case 0x1F: /* POP DS */
+ if(!rex.is32bits) {
+ unimp = 1;
+ goto fini;
+ }
+ emu->segs[_DS] = Pop32(emu); // no check, no use....
+ emu->segs_serial[_DS] = 0;
+ break;
+
+ case 0x27: /* DAA */
+ if(rex.is32bits) {
+ R_AL = daa8(emu, R_AL);
+ } else {
+ unimp = 1;
+ goto fini;
+ }
+ break;
+ case 0x2F: /* DAS */
+ if(rex.is32bits) {
+ R_AL = das8(emu, R_AL);
+ } else {
+ unimp = 1;
+ goto fini;
+ }
+ break;
case 0x2E: /* segments are ignored */
+ case 0x26:
case 0x36: /* SS: (ignored) */
break;
-
+ case 0x37: /* AAA */
+ if(rex.is32bits) {
+ R_AX = aaa16(emu, R_AX);
+ } else {
+ unimp = 1;
+ goto fini;
+ }
+ break;
case 0x38:
nextop = F8;
GETEB(0);
@@ -212,12 +295,47 @@ x64emurun:
cmp32(emu, R_EAX, F32);
break;
+ case 0x3F: /* AAS */
+ if(rex.is32bits) {
+ R_AX = aas16(emu, R_AX);
+ } else {
+ unimp = 1;
+ goto fini;
+ }
+ break;
+ case 0x40:
+ case 0x41:
+ case 0x42:
+ case 0x43:
+ case 0x44:
+ case 0x45:
+ case 0x46:
+ case 0x47: /* INC Reg (32bits only)*/
+ tmp8u = opcode&7;
+ emu->regs[tmp8u].dword[0] = inc32(emu, emu->regs[tmp8u].dword[0]);
+ break;
+ case 0x48:
+ case 0x49:
+ case 0x4A:
+ case 0x4B:
+ case 0x4C:
+ case 0x4D:
+ case 0x4E:
+ case 0x4F: /* DEC Reg (32bits only)*/
+ tmp8u = opcode&7;
+ emu->regs[tmp8u].dword[0] = dec32(emu, emu->regs[tmp8u].dword[0]);
+ break;
case 0x54: /* PUSH ESP */
if(rex.b)
- Push(emu, R_R12);
+ Push64(emu, R_R12);
else {
- tmp64u = R_RSP;
- Push(emu, tmp64u);
+ if(rex.is32bits) {
+ tmp32u = R_ESP;
+ Push32(emu, tmp32u);
+ } else {
+ tmp64u = R_RSP;
+ Push64(emu, tmp64u);
+ }
}
break;
case 0x50:
@@ -228,7 +346,10 @@ x64emurun:
case 0x56:
case 0x57: /* PUSH Reg */
tmp8u = (opcode&7)+(rex.b<<3);
- Push(emu, emu->regs[tmp8u].q[0]);
+ if(rex.is32bits)
+ Push32(emu, emu->regs[tmp8u].dword[0]);
+ else
+ Push64(emu, emu->regs[tmp8u].q[0]);
break;
case 0x58:
case 0x59:
@@ -239,22 +360,70 @@ x64emurun:
case 0x5E:
case 0x5F: /* POP Reg */
tmp8u = (opcode&7)+(rex.b<<3);
- emu->regs[tmp8u].q[0] = Pop(emu);
+ emu->regs[tmp8u].q[0] = is32bits?Pop32(emu):Pop64(emu);
+ break;
+ case 0x60: /* PUSHAD */
+ if(rex.is32bits) {
+ tmp32u = R_ESP;
+ Push32(emu, R_EAX);
+ Push32(emu, R_ECX);
+ Push32(emu, R_EDX);
+ Push32(emu, R_EBX);
+ Push32(emu, tmp32u);
+ Push32(emu, R_EBP);
+ Push32(emu, R_ESI);
+ Push32(emu, R_EDI);
+ } else {
+ unimp = 1;
+ goto fini;
+ }
+ break;
+ case 0x61: /* POPAD */
+ if(rex.is32bits) {
+ R_EDI = Pop32(emu);
+ R_ESI = Pop32(emu);
+ R_EBP = Pop32(emu);
+ R_ESP+=4; // POP ESP
+ R_EBX = Pop32(emu);
+ R_EDX = Pop32(emu);
+ R_ECX = Pop32(emu);
+ R_EAX = Pop32(emu);
+ } else {
+ unimp = 1;
+ goto fini;
+ }
+ break;
+ case 0x62: /* BOUND Gd, Ed */
+ if(rex.is32bits) {
+ FAKEED(0);
+ } else {
+ unimp = 1;
+ goto fini;
+ }
break;
-
case 0x63: /* MOVSXD Gd,Ed */
nextop = F8;
GETED(0);
GETGD;
- if(rex.w)
- GD->sq[0] = ED->sdword[0];
- else
- if(MODREG)
- GD->q[0] = ED->dword[0]; // not really a sign extension
+ if(rex.is32bits) {
+ // ARPL here
+ // faking to always happy...
+ SET_FLAG(F_ZF);
+ } else {
+ if(rex.w)
+ GD->sq[0] = ED->sdword[0];
else
- GD->sdword[0] = ED->sdword[0]; // meh?
+ if(MODREG)
+ GD->q[0] = ED->dword[0]; // not really a sign extension
+ else
+ GD->sdword[0] = ED->sdword[0]; // meh?
+ }
break;
case 0x64: /* FS: prefix */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = Test64(test, rex, _FS, addr)))
+ unimp = 1;
+ #else
if(!(addr = Run64(emu, rex, _FS, addr))) {
unimp = 1;
goto fini;
@@ -263,8 +432,14 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ is32bits = (emu->segs[_CS]==0x23);
+ #endif
break;
case 0x65: /* GS: prefix */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = Test64(test, rex, _GS, addr)))
+ unimp = 1;
+ #else
if(!(addr = Run64(emu, rex, _GS, addr))) {
unimp = 1;
goto fini;
@@ -273,8 +448,14 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ is32bits = (emu->segs[_CS]==0x23);
+ #endif
break;
case 0x66: /* 16bits prefix */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = Test66(test, rex, rep, addr)))
+ unimp = 1;
+ #else
if(!(addr = Run66(emu, rex, rep, addr))) {
unimp = 1;
goto fini;
@@ -283,8 +464,13 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0x67: /* reduce EASize prefix */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = Test67(test, rex, rep, addr)))
+ unimp = 1;
+ #else
if(!(addr = Run67(emu, rex, rep, addr))) {
unimp = 1;
goto fini;
@@ -293,9 +479,13 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0x68: /* Push Id */
- Push(emu, F32S64);
+ if(rex.is32bits)
+ Push32(emu, F32);
+ else
+ Push64(emu, F32S64);
break;
case 0x69: /* IMUL Gd,Ed,Id */
nextop = F8;
@@ -308,8 +498,13 @@ x64emurun:
GD->q[0] = imul32(emu, ED->dword[0], tmp64u);
break;
case 0x6A: /* Push Ib */
- tmp64s = F8S;
- Push(emu, (uint64_t)tmp64s);
+ if(rex.is32bits) {
+ tmp32s = F8S;
+ Push32(emu, (uint32_t)tmp32s);
+ } else {
+ tmp64s = F8S;
+ Push64(emu, (uint64_t)tmp64s);
+ }
break;
case 0x6B: /* IMUL Gd,Ed,Ib */
nextop = F8;
@@ -322,12 +517,78 @@ x64emurun:
GD->q[0] = imul32(emu, ED->dword[0], (uint32_t)tmp64s);
break;
case 0x6C: /* INSB DX */
+ if(rex.is32bits) {
+ tmp32u = rep?R_ECX:1;
+ while(tmp32u--) {
+ *(int8_t*)(R_EDI+GetESBaseEmu(emu)) = 0; // faking port read, using explicit ES segment
+ if(ACCESS_FLAG(F_DF))
+ R_EDI-=1;
+ else
+ R_EDI+=1;
+ }
+ if(rep)
+ R_ECX = 0;
+ } else {
+ // this is a privilege opcode in 64bits, but not in 32bits...
+ #ifndef TEST_INTERPRETOR
+ emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
+ STEP;
+ #endif
+ }
+ break;
case 0x6D: /* INSL DX */
+ if(rex.is32bits) {
+ tmp32u = rep?R_ECX:1;
+ while(tmp32u--) {
+ *(int32_t*)(R_EDI+GetESBaseEmu(emu)) = 0; // faking port read, using explicit ES segment
+ if(ACCESS_FLAG(F_DF))
+ R_EDI-=4;
+ else
+ R_EDI+=4;
+ }
+ if(rep)
+ R_ECX = 0;
+ } else {
+ // this is a privilege opcode in 64bits, but not in 32bits...
+ #ifndef TEST_INTERPRETOR
+ emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
+ STEP;
+ #endif
+ }
+ break;
case 0x6E: /* OUTSB DX */
+ if(rex.is32bits) {
+ // faking port write, using explicit ES segment
+ if(ACCESS_FLAG(F_DF))
+ R_ESI-=rep?R_ECX:1;
+ else
+ R_ESI+=1?R_ECX:1;
+ if(rep)
+ R_ECX = 0;
+ } else {
+ // this is a privilege opcode in 64bits, but not in 32bits...
+ #ifndef TEST_INTERPRETOR
+ emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
+ STEP;
+ #endif
+ }
+ break;
case 0x6F: /* OUTSL DX */
- // this is a privilege opcode...
- emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
- STEP;
+ if(rex.is32bits) {
+ // faking port write, using explicit ES segment
+ if(ACCESS_FLAG(F_DF))
+ R_ESI-=(rep?R_ECX:1)*4;
+ else
+ R_ESI+=(rep?R_ECX:1)*4;
+ if(rep)
+ R_ECX = 0;
+ } else {
+ // this is a privilege opcode in 64bits, but not in 32bits...
+ #ifndef TEST_INTERPRETOR
+ emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
+ STEP;
+ #endif
+ }
break;
GOCOND(0x70
@@ -336,6 +597,12 @@ x64emurun:
,,STEP2
) /* Jxx Ib */
+ case 0x82:
+ if(!rex.is32bits) {
+ unimp = 1;
+ goto fini;
+ }
+ // fallthru
case 0x80: /* GRP Eb,Ib */
nextop = F8;
GETEB(1);
@@ -416,7 +683,7 @@ x64emurun:
break;
case 0x86: /* XCHG Eb,Gb */
nextop = F8;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
GETEB(0);
GETGB;
if(MODREG) { // reg / reg: no lock
@@ -424,27 +691,24 @@ x64emurun:
GB = EB->byte[0];
EB->byte[0] = tmp8u;
} else {
- do {
- tmp8u = native_lock_read_b(EB);
- } while(native_lock_write_b(EB, GB));
- GB = tmp8u;
+ GB = native_lock_xchg_b(EB, GB);
}
// dynarec use need it's own mecanism
#else
GETEB(0);
GETGB;
if(!MODREG)
- pthread_mutex_lock(&emu->context->mutex_lock); // XCHG always LOCK (but when accessing memory only)
+ pthread_mutex_lock(&my_context->mutex_lock); // XCHG always LOCK (but when accessing memory only)
tmp8u = GB;
GB = EB->byte[0];
EB->byte[0] = tmp8u;
if(!MODREG)
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 0x87: /* XCHG Ed,Gd */
nextop = F8;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
GETED(0);
GETGD;
if(MODREG) {
@@ -459,19 +723,16 @@ x64emurun:
}
} else {
if(rex.w) {
- GD->q[0] = native_lock_xchg(ED, GD->q[0]);
+ GD->q[0] = native_lock_xchg_dd(ED, GD->q[0]);
} else {
- do {
- tmp32u = native_lock_read_d(ED);
- } while(native_lock_write_d(ED, GD->dword[0]));
- GD->q[0] = tmp32u;
+ GD->q[0] = native_lock_xchg_d(ED, GD->dword[0]);
}
}
#else
GETED(0);
GETGD;
if(!MODREG)
- pthread_mutex_lock(&emu->context->mutex_lock); // XCHG always LOCK (but when accessing memory only)
+ pthread_mutex_lock(&my_context->mutex_lock); // XCHG always LOCK (but when accessing memory only)
if(rex.w) {
tmp64u = GD->q[0];
GD->q[0] = ED->q[0];
@@ -485,7 +746,7 @@ x64emurun:
ED->dword[0] = tmp32u;
}
if(!MODREG)
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 0x88: /* MOV Eb,Gb */
@@ -533,24 +794,37 @@ x64emurun:
break;
case 0x8D: /* LEA Gd,M */
nextop = F8;
- GETED(0);
GETGD;
+ tmp64u = GETEA(0);
if(rex.w)
- GD->q[0] = (uint64_t)ED;
+ GD->q[0] = tmp64u;
else
- GD->q[0] = ((uintptr_t)ED)&0xffffffff;
+ GD->q[0] = tmp64u&0xffffffff;
+ break;
+ case 0x8E: /* MOV Seg, Ew */
+ nextop = F8;
+ GETED(0);
+ emu->segs[((nextop&0x38)>>3)] = ED->word[0];
+ emu->segs_serial[((nextop&0x38)>>3)] = 0;
break;
-
case 0x8F: /* POP Ed */
nextop = F8;
if(MODREG) {
- emu->regs[(nextop&7)+(rex.b<<3)].q[0] = Pop(emu);
+ emu->regs[(nextop&7)+(rex.b<<3)].q[0] = rex.is32bits?Pop32(emu):Pop64(emu);
} else {
- tmp64u = Pop(emu); // this order allows handling POP [ESP] and variant
- GETED(0);
- R_ESP -= sizeof(void*); // to prevent issue with SEGFAULT
- ED->q[0] = tmp64u;
- R_ESP += sizeof(void*);
+ if(rex.is32bits) {
+ tmp32u = Pop32(emu); // this order allows handling POP [ESP] and variant
+ GETED(0);
+ R_ESP -= 4; // to prevent issue with SEGFAULT
+ ED->dword[0] = tmp32u;
+ R_ESP += 4;
+ } else {
+ tmp64u = Pop64(emu); // this order allows handling POP [ESP] and variant
+ GETED(0);
+ R_RSP -= sizeof(void*); // to prevent issue with SEGFAULT
+ ED->q[0] = tmp64u;
+ R_RSP += sizeof(void*);
+ }
}
break;
case 0x90: /* NOP or XCHG R8, RAX*/
@@ -594,11 +868,23 @@ x64emurun:
break;
case 0x9C: /* PUSHF */
CHECK_FLAGS(emu);
- Push(emu, emu->eflags.x64);
+ if(rex.is32bits)
+ Push32(emu, emu->eflags.x64);
+ else
+ Push64(emu, emu->eflags.x64);
break;
case 0x9D: /* POPF */
- emu->eflags.x64 = ((Pop(emu) & 0x3F7FD7)/* & (0xffff-40)*/ ) | 0x2; // mask off res2 and res3 and on res1
+ emu->eflags.x64 = (((rex.is32bits?Pop32(emu):Pop64(emu)) & 0x3F7FD7)/* & (0xffff-40)*/ ) | 0x2; // mask off res2 and res3 and on res1
RESET_FLAGS(emu);
+ #ifndef TEST_INTERPRETER
+ if(ACCESS_FLAG(F_TF)) {
+ R_RIP = addr;
+ emit_signal(emu, SIGTRAP, (void*)addr, 1);
+ if(emu->quit) goto fini;
+ CLEAR_FLAG(F_TF);
+ STEP;
+ }
+ #endif
break;
case 0x9E: /* SAHF */
CHECK_FLAGS(emu);
@@ -615,28 +901,44 @@ x64emurun:
R_AH = (uint8_t)emu->eflags.x64;
break;
case 0xA0: /* MOV AL,Ob */
- R_AL = *(uint8_t*)F64;
+ if(rex.is32bits)
+ R_AL = *(uint8_t*)(uintptr_t)F32;
+ else
+ R_AL = *(uint8_t*)F64;
break;
case 0xA1: /* MOV EAX,Od */
- if(rex.w)
- R_RAX = *(uint64_t*)F64;
- else
- R_RAX = *(uint32_t*)F64;
+ if(rex.is32bits)
+ R_EAX = *(int32_t*)(uintptr_t)F32;
+ else {
+ if(rex.w)
+ R_RAX = *(uint64_t*)F64;
+ else
+ R_RAX = *(uint32_t*)F64;
+ }
break;
case 0xA2: /* MOV Ob,AL */
- *(uint8_t*)F64 = R_AL;
+ if(rex.is32bits)
+ *(uint8_t*)(uintptr_t)F32 = R_AL;
+ else
+ *(uint8_t*)F64 = R_AL;
break;
case 0xA3: /* MOV Od,EAX */
- if(rex.w)
- *(uint64_t*)F64 = R_RAX;
- else
- *(uint32_t*)F64 = R_EAX;
+ if(rex.is32bits)
+ *(uint32_t*)(uintptr_t)F32 = R_EAX;
+ else {
+ if(rex.w)
+ *(uint64_t*)F64 = R_RAX;
+ else
+ *(uint32_t*)F64 = R_EAX;
+ }
break;
case 0xA4: /* MOVSB */
tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
tmp64u = (rep)?R_RCX:1L;
while(tmp64u) {
+ #ifndef TEST_INTERPRETER
*(uint8_t*)R_RDI = *(uint8_t*)R_RSI;
+ #endif
R_RDI += tmp8s;
R_RSI += tmp8s;
--tmp64u;
@@ -651,7 +953,9 @@ x64emurun:
tmp8s *= 8;
while(tmp64u) {
--tmp64u;
+ #ifndef TEST_INTERPRETER
*(uint64_t*)R_RDI = *(uint64_t*)R_RSI;
+ #endif
R_RDI += tmp8s;
R_RSI += tmp8s;
}
@@ -659,7 +963,9 @@ x64emurun:
tmp8s *= 4;
while(tmp64u) {
--tmp64u;
+ #ifndef TEST_INTERPRETER
*(uint32_t*)R_RDI = *(uint32_t*)R_RSI;
+ #endif
R_RDI += tmp8s;
R_RSI += tmp8s;
}
@@ -699,7 +1005,6 @@ x64emurun:
R_RCX = tmp64u;
break;
default:
- tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
tmp8u = *(uint8_t*)R_RDI;
tmp8u2 = *(uint8_t*)R_RSI;
R_RDI += tmp8s;
@@ -769,14 +1074,12 @@ x64emurun:
break;
default:
if(rex.w) {
- tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
tmp64u = *(uint64_t*)R_RDI;
tmp64u2 = *(uint64_t*)R_RSI;
R_RDI += tmp8s;
R_RSI += tmp8s;
cmp64(emu, tmp64u2, tmp64u);
} else {
- tmp8s = ACCESS_FLAG(F_DF)?-4:+4;
tmp32u = *(uint32_t*)R_RDI;
tmp32u2 = *(uint32_t*)R_RSI;
R_RDI += tmp8s;
@@ -799,7 +1102,9 @@ x64emurun:
tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
tmp64u = (rep)?R_RCX:1L;
while(tmp64u) {
+ #ifndef TEST_INTERPRETER
*(uint8_t*)R_RDI = R_AL;
+ #endif
R_RDI += tmp8s;
--tmp64u;
}
@@ -814,7 +1119,9 @@ x64emurun:
tmp64u = (rep)?R_RCX:1L;
if((rex.w))
while(tmp64u) {
+ #ifndef TEST_INTERPRETER
*(uint64_t*)R_RDI = R_RAX;
+ #endif
R_RDI += tmp8s;
--tmp64u;
}
@@ -1039,15 +1346,40 @@ x64emurun:
break;
case 0xC2: /* RETN Iw */
tmp16u = F16;
- addr = Pop(emu);
+ addr = rex.is32bits?Pop32(emu):Pop64(emu);
R_RSP += tmp16u;
STEP2
break;
case 0xC3: /* RET */
- addr = Pop(emu);
+ addr = rex.is32bits?Pop32(emu):Pop64(emu);
STEP2
break;
-
+ case 0xC4: /* LES Gd,Ed */
+ if(rex.is32bits) {
+ nextop = F8;
+ GETED(0);
+ GETGD;
+ emu->segs[_ES] = *(__uint16_t*)(((char*)ED)+4);
+ emu->segs_serial[_ES] = 0;
+ GD->dword[0] = *(uint32_t*)ED;
+ } else {
+ // AVX not supported yet
+ emit_signal(emu, SIGILL, (void*)R_RIP, 0);
+ }
+ break;
+ case 0xC5: /* LDS Gd,Ed */
+ if(rex.is32bits) {
+ nextop = F8;
+ GETED(0);
+ GETGD;
+ emu->segs[_DS] = *(__uint16_t*)(((char*)ED)+4);
+ emu->segs_serial[_DS] = 0;
+ GD->dword[0] = *(uint32_t*)ED;
+ } else {
+ // AVX not supported yet
+ emit_signal(emu, SIGILL, (void*)R_RIP, 0);
+ }
+ break;
case 0xC6: /* MOV Eb,Ib */
nextop = F8;
GETEB(1);
@@ -1067,47 +1399,84 @@ x64emurun:
case 0xC8: /* ENTER Iw,Ib */
tmp16u = F16;
tmp8u = (F8) & 0x1f;
- tmp64u = R_RBP;
- Push(emu, R_RBP);
- R_RBP = R_RSP;
- if (tmp8u) {
- for (tmp8u2 = 1; tmp8u2 < tmp8u; tmp8u2++) {
- tmp64u -= sizeof(void*);
- Push(emu, *((uintptr_t*)tmp64u));
+ if(rex.is32bits) {
+ tmp64u = R_EBP;
+ Push32(emu, R_EBP);
+ R_EBP = R_ESP;
+ if (tmp8u) {
+ for (tmp8u2 = 1; tmp8u2 < tmp8u; tmp8u2++) {
+ tmp64u -= 4;
+ Push32(emu, *((uint32_t*)tmp64u));
+ }
+ Push32(emu, R_EBP);
+ }
+ } else {
+ tmp64u = R_RBP;
+ Push64(emu, R_RBP);
+ R_RBP = R_RSP;
+ if (tmp8u) {
+ for (tmp8u2 = 1; tmp8u2 < tmp8u; tmp8u2++) {
+ tmp64u -= sizeof(void*);
+ Push64(emu, *((uintptr_t*)tmp64u));
+ }
+ Push64(emu, R_RBP);
}
- Push(emu, R_RBP);
}
R_RSP -= tmp16u;
break;
case 0xC9: /* LEAVE */
R_RSP = R_RBP;
- R_RBP = Pop(emu);
+ R_RBP = rex.is32bits?Pop32(emu):Pop64(emu);
break;
case 0xCC: /* INT 3 */
+ #ifndef TEST_INTERPRETER
x64Int3(emu, &addr);
if(emu->quit) goto fini; // R_RIP is up to date when returning from x64Int3
addr = R_RIP;
+ #endif
break;
case 0xCD: /* INT n */
+ tmp8u = F8;
// this is a privilege opcode...
- emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
- STEP;
+ if(box64_wine && tmp8u==0x2D) {
+ // lets ignore the INT 2D
+ printf_log(LOG_DEBUG, "INT 2D called\n");
+ emit_interruption(emu, 0x2d, (void*)R_RIP);
+ } else if(box64_wine && tmp8u==0x2c) {
+ printf_log(LOG_DEBUG, "INT 2c called\n");
+ emit_interruption(emu, 0x2c, (void*)R_RIP);
+ } else if(box64_wine && tmp8u==0x29) {
+ // INT 29 is __fastfail
+ printf_log(LOG_DEBUG, "INT 29 called => __fastfail(0x%x)\n", R_ECX);
+ emit_interruption(emu, 0x29, (void*)R_RIP);
+ } else if (tmp8u==0x80) {
+ // 32bits syscall
+ #ifndef TEST_INTERPRETER
+ x86Syscall(emu);
+ STEP;
+ #endif
+ } else {
+ #ifndef TEST_INTERPRETER
+ emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
+ STEP;
+ #endif
+ }
break;
-
case 0xCF: /* IRET */
- addr = Pop(emu);
- emu->segs[_CS] = Pop(emu)&0xffff;
+ addr = rex.is32bits?Pop32(emu):Pop64(emu);
+ emu->segs[_CS] = (rex.is32bits?Pop32(emu):Pop64(emu))&0xffff;
emu->segs_serial[_CS] = 0;
- emu->eflags.x64 = ((Pop(emu) & 0x3F7FD7)/* & (0xffff-40)*/ ) | 0x2; // mask off res2 and res3 and on res1
- tmp64u = Pop(emu); //RSP
- emu->segs[_SS] = Pop(emu)&0xffff;
+ emu->eflags.x64 = (((rex.is32bits?Pop32(emu):Pop64(emu)) & 0x3F7FD7)/* & (0xffff-40)*/ ) | 0x2; // mask off res2 and res3 and on res1
+ tmp64u = rex.is32bits?Pop32(emu):Pop64(emu); //RSP
+ emu->segs[_SS] = (rex.is32bits?Pop32(emu):Pop64(emu))&0xffff;
emu->segs_serial[_SS] = 0;
- R_RSP= tmp64u;
+ R_RSP = tmp64u;
RESET_FLAGS(emu);
R_RIP = addr;
- goto fini; // exit, to recompute CS if needed
+ STEP;
+ is32bits = (emu->segs[_CS]==0x23);
break;
case 0xD0: /* GRP2 Eb,1 */
case 0xD2: /* GRP2 Eb,CL */
@@ -1167,10 +1536,23 @@ x64emurun:
}
break;
+ case 0xD6: /* SALC */
+ if(rex.is32bits) {
+ CHECK_FLAGS(emu);
+ R_AL = ACCESS_FLAG(F_CF)?0xff:0x00;
+ } else {
+ unimp = 1;
+ goto fini;
+ };
+ break;
case 0xD7: /* XLAT */
R_AL = *(uint8_t*)(R_RBX + R_AL);
break;
case 0xD8: /* x87 opcodes */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestD8(test, rex, addr)))
+ unimp = 1;
+ #else
if(!(addr = RunD8(emu, rex, addr))) {
unimp = 1;
goto fini;
@@ -1179,8 +1561,13 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0xD9: /* x87 opcodes */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestD9(test, rex, addr)))
+ unimp = 1;
+ #else
if(!(addr = RunD9(emu, rex, addr))) {
unimp = 1;
goto fini;
@@ -1189,8 +1576,13 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0xDA: /* x87 opcodes */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestDA(test, rex, addr)))
+ unimp = 1;
+ #else
if(!(addr = RunDA(emu, rex, addr))) {
unimp = 1;
goto fini;
@@ -1199,8 +1591,13 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0xDB: /* x87 opcodes */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestDB(test, rex, addr)))
+ unimp = 1;
+ #else
if(!(addr = RunDB(emu, rex, addr))) {
unimp = 1;
goto fini;
@@ -1209,8 +1606,13 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0xDC: /* x87 opcodes */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestDC(test, rex, addr)))
+ unimp = 1;
+ #else
if(!(addr = RunDC(emu, rex, addr))) {
unimp = 1;
goto fini;
@@ -1219,8 +1621,13 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0xDD: /* x87 opcodes */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestDD(test, rex, addr)))
+ unimp = 1;
+ #else
if(!(addr = RunDD(emu, rex, addr))) {
unimp = 1;
goto fini;
@@ -1229,8 +1636,13 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0xDE: /* x87 opcodes */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestDE(test, rex, addr)))
+ unimp = 1;
+ #else
if(!(addr = RunDE(emu, rex, addr))) {
unimp = 1;
goto fini;
@@ -1239,8 +1651,13 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0xDF: /* x87 opcodes */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestDF(test, rex, addr)))
+ unimp = 1;
+ #else
if(!(addr = RunDF(emu, rex, addr))) {
unimp = 1;
goto fini;
@@ -1249,6 +1666,7 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0xE0: /* LOOPNZ */
CHECK_FLAGS(emu);
@@ -1284,18 +1702,24 @@ x64emurun:
case 0xE6: /* OUT XX, AL */
case 0xE7: /* OUT XX, EAX */
// this is a privilege opcode...
+ #ifndef TEST_INTERPRETER
emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
STEP;
+ #endif
break;
case 0xE8: /* CALL Id */
tmp32s = F32S; // call is relative
- Push(emu, addr);
+ if(rex.is32bits)
+ Push32(emu, addr);
+ else
+ Push64(emu, addr);
addr += tmp32s;
STEP2
break;
case 0xE9: /* JMP Id */
tmp32s = F32S; // jmp is relative
addr += tmp32s;
+ addr = (uintptr_t)getAlternate((void*)addr);
STEP2
break;
@@ -1309,10 +1733,16 @@ x64emurun:
case 0xEE: /* OUT DX, AL */
case 0xEF: /* OUT DX, EAX */
// this is a privilege opcode...
+ #ifndef TEST_INTERPRETER
emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
STEP;
+ #endif
break;
case 0xF0: /* LOCK prefix */
+ #ifdef TEST_INTERPRETER
+ if(!(addr = TestF0(test, rex, addr)))
+ unimp = 1;
+ #else
if(!(addr = RunF0(emu, rex, addr))) {
unimp = 1;
goto fini;
@@ -1321,12 +1751,15 @@ x64emurun:
R_RIP = addr;
goto fini;
}
+ #endif
break;
case 0xF4: /* HLT */
// this is a privilege opcode...
+ #ifndef TEST_INTERPRETER
emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
STEP;
+ #endif
break;
case 0xF5: /* CMC */
CHECK_FLAGS(emu);
@@ -1443,12 +1876,12 @@ x64emurun:
SET_FLAG(F_CF);
break;
case 0xFA: /* CLI */
- // this is a privilege opcode...
+ // this is a privilege opcode
emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
STEP;
break;
case 0xFB: /* STI */
- // this is a privilege opcode...
+ // this is a privilege opcode
emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
STEP;
break;
@@ -1475,9 +1908,9 @@ x64emurun:
break;
case 0xFF: /* GRP 5 Ed */
nextop = F8;
- GETED(0);
switch((nextop>>3)&7) {
case 0: /* INC Ed */
+ GETED(0);
if(rex.w)
ED->q[0] = inc64(emu, ED->q[0]);
else {
@@ -1488,6 +1921,7 @@ x64emurun:
}
break;
case 1: /* DEC Ed */
+ GETED(0);
if(rex.w)
ED->q[0] = dec64(emu, ED->q[0]);
else {
@@ -1498,49 +1932,78 @@ x64emurun:
}
break;
case 2: /* CALL NEAR Ed */
- tmp64u = (uintptr_t)getAlternate((void*)ED->q[0]);
- Push(emu, addr);
+ GETE8(0);
+ if(rex.is32bits) {
+ tmp64u = (uintptr_t)ED->dword[0];
+ Push32(emu, addr);
+ } else {
+ tmp64u = (uintptr_t)getAlternate((void*)ED->q[0]);
+ Push64(emu, addr);
+ }
addr = tmp64u;
STEP2
break;
case 3: /* CALL FAR Ed */
+ GETET(0);
if(MODREG) {
- printf_log(LOG_NONE, "Illegal Opcode %p: %02X %02X %02X %02X\n", (void*)R_RIP, opcode, nextop, PK(2), PK(3));
- emu->quit=1;
- emu->error |= ERR_ILLEGAL;
+ printf_log(LOG_NONE, "Illegal Opcode %p: (%02X %02X %02X %02X) %02X %02X %02X %02X\n", (void*)R_RIP, PK(-6), PK(-5), PK(-4), PK(-3), opcode, nextop, PK(0), PK(1));
+ emit_signal(emu, SIGILL, (void*)R_RIP, 0);
goto fini;
} else {
- Push(emu, R_CS);
- Push(emu, addr);
- R_RIP = addr = (uintptr_t)getAlternate((void*)ED->q[0]); // check CS?
- R_CS = (ED+1)->word[0];
- goto fini; // exit loop to recompute new CS...
+ if(rex.is32bits || !rex.w) {
+ Push32(emu, R_CS);
+ Push32(emu, addr);
+ addr = (uintptr_t)getAlternate((void*)(uintptr_t)ED->dword[0]);
+ R_CS = ED->word[2];
+ } else {
+ Push64(emu, R_CS);
+ Push64(emu, addr);
+ addr = (uintptr_t)getAlternate((void*)ED->q[0]);
+ R_CS = (ED+1)->word[0];
+ }
+ STEP2;
+ is32bits = (emu->segs[_CS]==0x23);
}
break;
case 4: /* JMP NEAR Ed */
- addr = (uintptr_t)getAlternate((void*)ED->q[0]);
+ GETE8(0);
+ if(rex.is32bits)
+ addr = (uintptr_t)ED->dword[0];
+ else
+ addr = (uintptr_t)getAlternate((void*)ED->q[0]);
STEP2
break;
case 5: /* JMP FAR Ed */
+ GETET(0);
if(MODREG) {
- printf_log(LOG_NONE, "Illegal Opcode %p: 0x%02X 0x%02X %02X %02X\n", (void*)R_RIP, opcode, nextop, PK(2), PK(3));
- emu->quit=1;
- emu->error |= ERR_ILLEGAL;
+ printf_log(LOG_NONE, "Illegal Opcode %p: (%02X %02X %02X %02X) %02X %02X %02X %02X\n", (void*)R_RIP, PK(-6), PK(-5), PK(-4), PK(-3), opcode, nextop, PK(0), PK(1));
+ emit_signal(emu, SIGILL, (void*)R_RIP, 0);
goto fini;
} else {
- R_RIP = (uintptr_t)getAlternate((void*)ED->q[0]); //check CS?
- R_CS = (ED+1)->word[0];
- goto fini; // exit loop to recompute CS...
+ if(rex.is32bits || !rex.w) {
+ addr = (uintptr_t)getAlternate((void*)(uintptr_t)ED->dword[0]);
+ R_CS = ED->word[2];
+ } else {
+ addr = (uintptr_t)getAlternate((void*)ED->q[0]);
+ R_CS = (ED+1)->word[0];
+ }
+ STEP2;
+ is32bits = (emu->segs[_CS]==0x23);
}
break;
case 6: /* Push Ed */
- tmp64u = ED->q[0]; // rex.w ignored
- Push(emu, tmp64u); // avoid potential issue with push [esp+...]
+ _GETED(0);
+ if(rex.is32bits) {
+ tmp32u = ED->dword[0];
+ Push32(emu, tmp32u); // avoid potential issue with push [esp+...]
+ } else {
+ tmp64u = ED->q[0]; // rex.w ignored
+ Push64(emu, tmp64u); // avoid potential issue with push [esp+...]
+ }
break;
default:
- printf_log(LOG_NONE, "Illegal Opcode %p: %02X %02X %02X %02X %02X %02X\n",(void*)R_RIP, opcode, nextop, PK(2), PK(3), PK(4), PK(5));
- emu->quit=1;
- emu->error |= ERR_ILLEGAL;
+ printf_log(LOG_NONE, "Illegal Opcode %p: (%02X %02X %02X %02X) %02X %02X %02X %02X %02X %02X\n", (void*)R_RIP, PK(-6), PK(-5), PK(-4), PK(-3), opcode, nextop, PK(0), PK(1), PK(2), PK(3));
+ emit_signal(emu, SIGILL, (void*)R_RIP, 0);
goto fini;
}
break;
@@ -1553,10 +2016,12 @@ x64emurun:
fini:
+if(emu->segs[_CS]!=0x33 && emu->segs[_CS]!=0x23) printf_log(LOG_NONE, "Warning, CS is not default value: 0x%x\n", emu->segs[_CS]);
+#ifndef TEST_INTERPRETER
printf_log(LOG_DEBUG, "End of X86 run (%p), RIP=%p, Stack=%p, unimp=%d, emu->fork=%d, emu->uc_link=%p, emu->quit=%d\n", emu, (void*)R_RIP, (void*)R_RSP, unimp, emu->fork, emu->uc_link, emu->quit);
if(unimp) {
emu->quit = 1;
- UnimpOpcode(emu);
+ UnimpOpcode(emu, is32bits);
}
// fork handling
if(emu->fork) {
@@ -1576,5 +2041,11 @@ fini:
addr = R_RIP;
goto x64emurun;
}
+#else
+ if(unimp) {
+ printf_log(LOG_INFO, "Warning, inimplemented opcode in Test Interpreter\n");
+ } else
+ addr = R_RIP;
+#endif
return 0;
}
diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c
index 05c9aab..466220b 100644
--- a/src/emu/x64run0f.c
+++ b/src/emu/x64run0f.c
@@ -28,7 +28,11 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test0F(x64test_t *test, rex_t rex, uintptr_t addr, int *step)
+#else
uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
+#endif
{
uint8_t opcode;
uint8_t nextop;
@@ -42,27 +46,38 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
sse_regs_t *opex, *opgx, eax1;
mmx87_regs_t *opem, *opgm, eam1;
+#ifdef TEST_INTERPRETER
+ x64emu_t *emu = test->emu;
+#endif
opcode = F8;
switch(opcode) {
case 0x05: /* SYSCALL */
+ #ifndef TEST_INTERPRETER
R_RIP = addr;
x64Syscall(emu);
+ #endif
break;
case 0x06: /* CLTS */
// this is a privilege opcode...
+ #ifndef TEST_INTERPRETER
emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
+ #endif
break;
case 0x08: /* INVD */
case 0x09: /* WBINVD */
// this is a privilege opcode...
+ #ifndef TEST_INTERPRETER
emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
+ #endif
break;
case 0x0B: /* UD2 */
+ #ifndef TEST_INTERPRETER
emit_signal(emu, SIGILL, (void*)R_RIP, 0);
+ #endif
break;
case 0x0D:
@@ -93,7 +108,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
nextop = F8;
GETEX(0);
GETGX;
- if((nextop&0xC0)==0xC0) /* MOVHLPS Gx,Ex */
+ if(MODREG) /* MOVHLPS Gx,Ex */
GX->q[0] = EX->q[1];
else
GX->q[0] = EX->q[0]; /* MOVLPS Gx,Ex */
@@ -135,7 +150,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
break;
case 0x18: /* PREFETCHh Ed */
nextop = F8;
- GETED(0);
+ _GETED(0);
if(MODREG) {
} else
switch((nextop>>3)&7) {
@@ -152,14 +167,16 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
case 0x1F: /* NOP (multi-byte) */
nextop = F8;
- GETED(0);
+ FAKEED(0);
break;
case 0x20: /* MOV REG, crX */
case 0x21: /* MOV REG, drX */
case 0x22: /* MOV cxR, REG */
case 0x23: /* MOV drX, REG */
// this is a privilege opcode...
+ #ifndef TEST_INTERPRETER
emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
+ #endif
break;
case 0x28: /* MOVAPS Gx,Ex */
@@ -194,38 +211,45 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
nextop = F8;
GETEX(0);
GETGM;
- if(isnanf(EX->f[1]) || isinff(EX->f[1]) || EX->f[1]>0x7fffffff)
- GM->sd[1] = 0x80000000;
+ tmp64s = EX->f[1];
+ if (tmp64s==(int32_t)tmp64s && !isnanf(EX->f[1]))
+ GM->sd[1] = (int32_t)tmp64s;
else
- GM->sd[1] = EX->f[1];
- if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>0x7fffffff)
- GM->sd[0] = 0x80000000;
+ GM->sd[1] = INT32_MIN;
+ tmp64s = EX->f[0];
+ if (tmp64s==(int32_t)tmp64s && !isnanf(EX->f[0]))
+ GM->sd[0] = (int32_t)tmp64s;
else
- GM->sd[0] = EX->f[0];
+ GM->sd[0] = INT32_MIN;
break;
case 0x2D: /* CVTPS2PI Gm, Ex */
// rounding should be done; and indefinite integer should also be assigned if overflow or NaN/Inf
nextop = F8;
GETEX(0);
GETGM;
- for(int i=1; i>=0; --i)
- if(isnanf(EX->f[i]) || isinff(EX->f[i]) || EX->f[i]>0x7fffffff)
- GM->sd[i] = 0x80000000;
+ for(int i=1; i>=0; --i) {
+ if(isnanf(EX->f[i]))
+ tmp64s = INT32_MIN;
else
switch(emu->mxcsr.f.MXCSR_RC) {
case ROUND_Nearest:
- GM->sd[i] = nearbyintf(EX->f[i]);
+ tmp64s = nearbyintf(EX->f[i]);
break;
case ROUND_Down:
- GM->sd[i] = floorf(EX->f[i]);
+ tmp64s = floorf(EX->f[i]);
break;
case ROUND_Up:
- GM->sd[i] = ceilf(EX->f[i]);
+ tmp64s = ceilf(EX->f[i]);
break;
case ROUND_Chop:
- GM->sd[i] = EX->f[i];
+ tmp64s = EX->f[i];
break;
}
+ if (tmp64s==(int32_t)tmp64s)
+ GM->sd[i] = (int32_t)tmp64s;
+ else
+ GM->sd[i] = INT32_MIN;
+ }
break;
case 0x2E: /* UCOMISS Gx, Ex */
// same for now
@@ -326,8 +350,12 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
GETED(0);
if(rex.w)
ED->q[0] = __builtin_bswap64(GD->q[0]);
- else
- ED->q[0] = __builtin_bswap32(GD->dword[0]);
+ else {
+ if(MODREG)
+ ED->q[0] = __builtin_bswap32(GD->dword[0]);
+ else
+ ED->dword[0] = __builtin_bswap32(GD->dword[0]);
+ }
break;
default:
@@ -785,7 +813,19 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
, EB->byte[0]=0;
,
) /* 0x90 -> 0x9F SETxx Eb */
-
+ case 0xA0: /* PUSH FS */
+ if(rex.is32bits)
+ Push32(emu, emu->segs[_FS]);
+ else
+ Push64(emu, emu->segs[_FS]);
+ break;
+ case 0xA1: /* POP FS */
+ if(rex.is32bits)
+ emu->segs[_FS] = Pop32(emu);
+ else
+ emu->segs[_FS] = Pop64(emu);
+ emu->segs_serial[_FS] = 0;
+ break;
case 0xA2: /* CPUID */
tmp32u = R_EAX;
my_cpuid(emu, tmp32u);
@@ -800,7 +840,15 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
tmp32s >>= (rex.w?6:5);
if(!MODREG)
{
+ #ifdef TEST_INTERPRETER
+ test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:2)));
+ if(rex.w)
+ *(uint64_t*)test->mem = *(uint64_t*)test->memaddr;
+ else
+ *(uint32_t*)test->mem = *(uint32_t*)test->memaddr;
+ #else
ED=(reg64_t*)(((uintptr_t)(ED))+(tmp32s<<(rex.w?3:2)));
+ #endif
}
if(rex.w) {
if(ED->q[0] & (1LL<<tmp8u))
@@ -833,6 +881,20 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
}
break;
+ case 0xA8: /* PUSH GS */
+ if(rex.is32bits)
+ Push32(emu, emu->segs[_GS]);
+ else
+ Push64(emu, emu->segs[_GS]);
+ break;
+ case 0xA9: /* POP GS */
+ if(rex.is32bits)
+ emu->segs[_GS] = Pop32(emu);
+ else
+ emu->segs[_GS] = Pop64(emu);
+ emu->segs_serial[_FS] = 0;
+ break;
+
case 0xAB: /* BTS Ed,Gd */
CHECK_FLAGS(emu);
nextop = F8;
@@ -843,7 +905,15 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
tmp64s >>= (rex.w?6:5);
if(!MODREG)
{
+ #ifdef TEST_INTERPRETER
+ test->memaddr=((test->memaddr)+(tmp64s<<(rex.w?3:2)));
+ if(rex.w)
+ *(uint64_t*)test->mem = *(uint64_t*)test->memaddr;
+ else
+ *(uint32_t*)test->mem = *(uint32_t*)test->memaddr;
+ #else
ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2)));
+ #endif
}
if(rex.w) {
if(ED->q[0] & (1LL<<tmp8u))
@@ -889,30 +959,38 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
if((nextop&0xF8)==0xF8) {
return addr; /* SFENCE */
}
- GETED(0);
switch((nextop>>3)&7) {
case 0: /* FXSAVE Ed */
+ _GETED(0);
+ #ifndef TEST_INTERPRETER
if(rex.w)
fpu_fxsave64(emu, ED);
else
fpu_fxsave32(emu, ED);
+ #endif
break;
case 1: /* FXRSTOR Ed */
+ _GETED(0);
if(rex.w)
fpu_fxrstor64(emu, ED);
else
fpu_fxrstor32(emu, ED);
break;
case 2: /* LDMXCSR Md */
+ GETED(0);
emu->mxcsr.x32 = ED->dword[0];
+ #ifndef TEST_INTERPRETER
if(box64_sse_flushto0)
applyFlushTo0(emu);
+ #endif
break;
case 3: /* STMXCSR Md */
+ GETED(0);
ED->dword[0] = emu->mxcsr.x32;
break;
case 7: /* CLFLUSH Ed */
- #ifdef DYNAREC
+ _GETED(0);
+ #if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(box64_dynarec)
cleanDBFromAddressRange((uintptr_t)ED, 8, 0);
#endif
@@ -975,7 +1053,15 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
tmp64s >>= (rex.w?6:5);
if(!MODREG)
{
+ #ifdef TEST_INTERPRETER
+ test->memaddr=((test->memaddr)+(tmp64s<<(rex.w?3:2)));
+ if(rex.w)
+ *(uint64_t*)test->mem = *(uint64_t*)test->memaddr;
+ else
+ *(uint32_t*)test->mem = *(uint32_t*)test->memaddr;
+ #else
ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2)));
+ #endif
}
if(rex.w) {
if(ED->q[0] & (1LL<<tmp8u)) {
@@ -1105,7 +1191,15 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
tmp64s >>= (rex.w?6:5);
if(!MODREG)
{
+ #ifdef TEST_INTERPRETER
+ test->memaddr=((test->memaddr)+(tmp64s<<(rex.w?3:2)));
+ if(rex.w)
+ *(uint64_t*)test->mem = *(uint64_t*)test->memaddr;
+ else
+ *(uint32_t*)test->mem = *(uint32_t*)test->memaddr;
+ #else
ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2)));
+ #endif
}
if(rex.w) {
if(ED->q[0] & (1LL<<tmp8u))
@@ -1289,6 +1383,10 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
CHECK_FLAGS(emu);
nextop = F8;
GETED(0);
+ #ifdef TEST_INTERPRETER
+ test->memsize = 16;
+ ((uint64_t*)test->mem)[1] = ((uint64_t*)test->memaddr)[1];
+ #endif
switch((nextop>>3)&7) {
case 1:
if(rex.w) {
@@ -1366,7 +1464,12 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
GETGM;
GM->q = (EM->q > 63) ? 0L : (GM->q >> EM->q);
break;
-
+ case 0xD4: /* PADDQ Gm,Em */
+ nextop = F8;
+ GETEM(0);
+ GETGM;
+ GM->sq += EM->sq;
+ break;
case 0xD5: /* PMULLW Gm,Em */
nextop = F8;
GETEM(0);
@@ -1506,7 +1609,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
break;
case 0xE7: /* MOVNTQ Em,Gm */
nextop = F8;
- if((nextop&0xC0)==0xC0)
+ if(MODREG)
return 0;
GETEM(0);
GETGM;
@@ -1530,7 +1633,13 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
GM->sw[i] = (tmp32s>32767)?32767:((tmp32s<-32768)?-32768:tmp32s);
}
break;
-
+ case 0xEA: /* PMINSW Gm,Em */
+ nextop = F8;
+ GETEM(0);
+ GETGM;
+ for (int i=0; i<4; ++i)
+ GM->sw[i] = (GM->sw[i]<EM->sw[i])?GM->sw[i]:EM->sw[i];
+ break;
case 0xEB: /* POR Gm, Em */
nextop = F8;
GETEM(0);
@@ -1555,7 +1664,13 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
GM->sw[i] = (tmp32s>32767)?32767:((tmp32s<-32768)?-32768:tmp32s);
}
break;
-
+ case 0xEE: /* PMAXSW Gm,Em */
+ nextop = F8;
+ GETEM(0);
+ GETGM;
+ for (int i=0; i<4; ++i)
+ GM->sw[i] = (GM->sw[i]>EM->sw[i])?GM->sw[i]:EM->sw[i];
+ break;
case 0xEF: /* PXOR Gm, Em */
nextop = F8;
GETEM(0);
@@ -1593,7 +1708,12 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
GETGM;
GM->q = (EM->q > 63) ? 0L : (GM->q << EM->ub[0]);
break;
-
+ case 0xF4: /* PMULUDQ Gm,Em */
+ nextop = F8;
+ GETEM(0);
+ GETGM;
+ GM->q = (uint64_t)GM->ud[0] * (uint64_t)EM->ud[0];
+ break;
case 0xF5: /* PMADDWD Gm, Em */
nextop = F8;
GETEM(0);
@@ -1636,7 +1756,12 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
for(int i=0; i<2; ++i)
GM->ud[i] -= EM->ud[i];
break;
-
+ case 0xFB: /* PSUBQ Gm, Em */
+ nextop = F8;
+ GETEM(0);
+ GETGM;
+ GM->sq -= EM->sq;
+ break;
case 0xFC: /* PADDB Gm, Em */
nextop = F8;
GETEM(0);
@@ -1663,4 +1788,4 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
return 0;
}
return addr;
-} \ No newline at end of file
+}
diff --git a/src/emu/x64run64.c b/src/emu/x64run64.c
index fa1ea28..587cc81 100644
--- a/src/emu/x64run64.c
+++ b/src/emu/x64run64.c
@@ -22,7 +22,11 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test64(x64test_t *test, rex_t rex, int seg, uintptr_t addr)
+#else
uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
+#endif
{
uint8_t opcode;
uint8_t nextop;
@@ -35,24 +39,29 @@ uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
reg64_t *oped, *opgd;
sse_regs_t *opex, *opgx;
int rep;
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
uintptr_t tlsdata = GetSegmentBaseEmu(emu, seg);
opcode = F8;
// REX prefix before the F0 are ignored
rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ if(!rex.is32bits)
+ while(opcode>=0x40 && opcode<=0x4f) {
+ rex.rex = opcode;
+ opcode = F8;
+ }
rep = 0;
while((opcode==0xF2) || (opcode==0xF3)) {
rep = opcode-0xF1;
opcode = F8;
}
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ if(!rex.is32bits)
+ while(opcode>=0x40 && opcode<=0x4f) {
+ rex.rex = opcode;
+ opcode = F8;
+ }
switch(opcode) {
#define GO(B, OP) \
@@ -114,6 +123,12 @@ uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
case 0x10:
switch(rep) {
+ case 0: /* MOVUPS Gx, FS:Ex */
+ nextop = F8;
+ GETEX_OFFS(0, tlsdata);
+ GETGX;
+ GX->u128 = EX->u128;
+ break;
case 1: /* MOVSD Gx, FS:Ex */
nextop = F8;
GETEX_OFFS(0, tlsdata);
@@ -162,7 +177,18 @@ uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
return 0;
}
break;
-
+ case 0x28:
+ switch(rep) {
+ case 0: /* MOVAPS Gx, FS:Ex */
+ nextop = F8;
+ GETEX_OFFS(0, tlsdata);
+ GETGX;
+ GX->u128 = EX->u128;
+ break;
+ default:
+ return 0;
+ }
+ break;
case 0x29: /* MOVAPS FS:Ex,Gx */
switch(rep) {
case 0:
@@ -283,17 +309,28 @@ uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
nextop = F8;
GETED_OFFS(0, tlsdata);
GETGD;
- if(rex.w)
- GD->sq[0] = ED->sdword[0];
- else
- if(MODREG)
- GD->q[0] = ED->dword[0]; // not really a sign extension
+ if(rex.is32bits) {
+ // ARPL here
+ // faking to always happy...
+ SET_FLAG(F_ZF);
+ } else {
+ if(rex.w)
+ GD->sq[0] = ED->sdword[0];
else
- GD->sdword[0] = ED->sdword[0]; // meh?
+ if(MODREG)
+ GD->q[0] = ED->dword[0]; // not really a sign extension
+ else
+ GD->sdword[0] = ED->sdword[0]; // meh?
+ }
break;
case 0x66:
return Run6664(emu, rex, seg, addr);
+ case 0x67:
+ if(rex.is32bits)
+ return Run6764_32(emu, rex, seg, seg, addr);
+ else
+ return 0;
case 0x80: /* GRP Eb,Ib */
nextop = F8;
@@ -371,7 +408,6 @@ uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
if(rex.w) {
ED->q[0] = GD->q[0];
} else {
- //if ED is a reg, than the opcode works like movzx
if(MODREG)
ED->q[0] = GD->dword[0];
else
@@ -394,6 +430,63 @@ uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
GD->q[0] = ED->dword[0];
break;
+ case 0x8D: /* LEA Gd,M */
+ nextop = F8;
+ GETGD;
+ tmp64u = GETEA(0);
+ if(rex.w)
+ GD->q[0] = tmp64u;
+ else
+ GD->q[0] = tmp64u&0xffffffff;
+ break;
+
+ case 0x8F: /* POP FS:Ed */
+ nextop = F8;
+ if(MODREG) {
+ emu->regs[(nextop&7)+(rex.b<<3)].q[0] = Pop64(emu);
+ } else {
+ if(rex.is32bits) {
+ tmp32u = Pop32(emu); // this order allows handling POP [ESP] and variant
+ GETED_OFFS(0, tlsdata);
+ R_ESP -= 4; // to prevent issue with SEGFAULT
+ ED->dword[0] = tmp32u;
+ R_ESP += 4;
+ } else {
+ tmp64u = Pop64(emu); // this order allows handling POP [ESP] and variant
+ GETED_OFFS(0, tlsdata);
+ R_RSP -= sizeof(void*); // to prevent issue with SEGFAULT
+ ED->q[0] = tmp64u;
+ R_RSP += sizeof(void*);
+ }
+ }
+ break;
+
+ case 0xA1: /* MOV EAX,FS:Od */
+ if(rex.is32bits) {
+ tmp32s = F32S;
+ R_EAX = *(uint32_t*)(tlsdata+tmp32s);
+ } else {
+ tmp64u = F64;
+ if(rex.w)
+ R_RAX = *(uint64_t*)(tlsdata+tmp64u);
+ else
+ R_RAX = *(uint32_t*)(tlsdata+tmp64u);
+ }
+ break;
+
+ case 0xA3: /* MOV FS:Od,EAX */
+ if(rex.is32bits) {
+ tmp32s = F32S;
+ *(uint32_t*)(uintptr_t)(tlsdata+tmp32s) = R_EAX;
+ } else {
+ tmp64u = F64;
+ if(rex.w)
+ *(uint64_t*)(tlsdata+tmp64u) = R_RAX;
+ else
+ *(uint32_t*)(tlsdata+tmp64u) = R_EAX;
+ }
+ break;
+
case 0xC6: /* MOV FS:Eb, Ib */
nextop = F8;
GETEB_OFFS(1, tlsdata);
@@ -549,42 +642,66 @@ uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
}
break;
case 2: /* CALL NEAR Ed */
- tmp64u = (uintptr_t)getAlternate((void*)ED->q[0]);
- Push(emu, addr);
+ if(rex.is32bits) {
+ tmp64u = (uintptr_t)getAlternate((void*)(uintptr_t)ED->dword[0]);
+ Push32(emu, addr);
+ } else {
+ tmp64u = (uintptr_t)getAlternate((void*)ED->q[0]);
+ Push64(emu, addr);
+ }
addr = tmp64u;
break;
case 3: /* CALL FAR Ed */
- if(nextop>0xC0) {
+ if(MODREG) {
printf_log(LOG_NONE, "Illegal Opcode %p: %02X %02X %02X %02X\n", (void*)R_RIP, opcode, nextop, PK(2), PK(3));
emu->quit=1;
emu->error |= ERR_ILLEGAL;
return 0;
} else {
- Push16(emu, R_CS);
- Push(emu, addr);
- R_RIP = addr = ED->dword[0];
- R_CS = (ED+1)->word[0];
+ if(rex.is32bits || !rex.w) {
+ Push32(emu, R_CS);
+ Push32(emu, addr);
+ R_RIP = addr = ED->dword[0];
+ R_CS = ED->word[2];
+ } else {
+ Push64(emu, R_CS);
+ Push64(emu, addr);
+ R_RIP = addr = ED->q[0];
+ R_CS = (ED+1)->word[0];
+ }
return 0; // exit loop to recompute new CS...
}
break;
case 4: /* JMP NEAR Ed */
- addr = (uintptr_t)getAlternate((void*)ED->q[0]);
+ if(rex.is32bits)
+ addr = (uintptr_t)getAlternate((void*)(uintptr_t)ED->dword[0]);
+ else
+ addr = (uintptr_t)getAlternate((void*)ED->q[0]);
break;
case 5: /* JMP FAR Ed */
- if(nextop>0xc0) {
+ if(MODREG) {
printf_log(LOG_NONE, "Illegal Opcode %p: 0x%02X 0x%02X %02X %02X\n", (void*)R_RIP, opcode, nextop, PK(2), PK(3));
emu->quit=1;
emu->error |= ERR_ILLEGAL;
return 0;
} else {
- R_RIP = addr = ED->q[0];
- R_CS = (ED+1)->word[0];
- return 0; // exit loop to recompute CS...
+ if(rex.is32bits || !rex.w) {
+ R_RIP = addr = ED->dword[0];
+ R_CS = ED->word[2];
+ } else {
+ R_RIP = addr = ED->q[0];
+ R_CS = (ED+1)->word[0];
+ }
}
break;
case 6: /* Push Ed */
- tmp64u = ED->q[0]; // rex.w ignored
- Push(emu, tmp64u); // avoid potential issue with push [esp+...]
+ if(rex.is32bits) {
+ tmp32u = ED->dword[0];
+ Push32(emu, tmp32u); // avoid potential issue with push [esp+...]
+ } else {
+ tmp64u = ED->q[0]; // rex.w ignored
+ Push64(emu, tmp64u); // avoid potential issue with push [esp+...]
+ }
break;
default:
printf_log(LOG_NONE, "Illegal Opcode %p: %02X %02X %02X %02X %02X %02X\n",(void*)R_RIP, opcode, nextop, PK(2), PK(3), PK(4), PK(5));
diff --git a/src/emu/x64run66.c b/src/emu/x64run66.c
index f7696ee..938fde4 100644
--- a/src/emu/x64run66.c
+++ b/src/emu/x64run66.c
@@ -25,7 +25,11 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test66(x64test_t *test, rex_t rex, int rep, uintptr_t addr)
+#else
uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
+#endif
{
uint8_t opcode;
uint8_t nextop;
@@ -37,6 +41,9 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
int64_t tmp64s;
uint64_t tmp64u, tmp64u2, tmp64u3;
reg64_t *oped, *opgd;
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
opcode = F8;
@@ -49,10 +56,11 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
}
rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ if(!rex.is32bits)
+ while(opcode>=0x40 && opcode<=0x4f) {
+ rex.rex = opcode;
+ opcode = F8;
+ }
switch(opcode) {
#define GO(B, OP) \
@@ -84,7 +92,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
if(rex.w) \
GW->q[0] = OP##64(emu, GW->q[0], EW->q[0]); \
else \
- GW->word[0] = OP##16(emu, GW->word[0], EW->word[0]); \
+ GW->word[0] = OP##16(emu, GW->word[0], EW->word[0]); \
break; \
case B+4: \
R_AL = OP##8(emu, R_AL, F8); \
@@ -105,7 +113,11 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
GO(0x30, xor) /* XOR 0x31 ~> 0x35 */
case 0x0F: /* more opcdes */
+ #ifdef TEST_INTERPRETER
+ return Test660F(test, rex, addr);
+ #else
return Run660F(emu, rex, addr);
+ #endif
case 0x39:
nextop = F8;
@@ -132,10 +144,97 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
cmp16(emu, R_AX, F16);
break;
+ case 0x40:
+ case 0x41:
+ case 0x42:
+ case 0x43:
+ case 0x44:
+ case 0x45:
+ case 0x46:
+ case 0x47: /* INC Reg (32bits only) */
+ tmp8u = opcode&7;
+ emu->regs[tmp8u].word[0] = inc16(emu, emu->regs[tmp8u].word[0]);
+ break;
+ case 0x48:
+ case 0x49:
+ case 0x4A:
+ case 0x4B:
+ case 0x4C:
+ case 0x4D:
+ case 0x4E:
+ case 0x4F: /* DEC Reg (32bits only) */
+ tmp8u = opcode&7;
+ emu->regs[tmp8u].word[0] = dec16(emu, emu->regs[tmp8u].word[0]);
+ break;
+ case 0x50:
+ case 0x51:
+ case 0x52:
+ case 0x53:
+ case 0x55:
+ case 0x56:
+ case 0x57: /* PUSH Reg */
+ if(rex.is32bits) {
+ tmp8u = opcode&7;
+ Push16(emu, emu->regs[tmp8u].word[0]);
+ } else
+ return 0;
+ break;
+ case 0x58:
+ case 0x59:
+ case 0x5A:
+ case 0x5B:
+ case 0x5C: /* POP ESP */
+ case 0x5D:
+ case 0x5E:
+ case 0x5F: /* POP Reg */
+ if(rex.is32bits) {
+ tmp8u = opcode&7;
+ emu->regs[tmp8u].word[0] = Pop16(emu);
+ } else
+ return 0;
+ break;
+ case 0x60: /* PUSHA */
+ if(rex.is32bits) {
+ tmp16u = R_SP;
+ Push16(emu, R_AX);
+ Push16(emu, R_CX);
+ Push16(emu, R_DX);
+ Push16(emu, R_BX);
+ Push16(emu, tmp16u);
+ Push16(emu, R_BP);
+ Push16(emu, R_SI);
+ Push16(emu, R_DI);
+ } else {
+ return 0;
+ }
+ break;
+ case 0x61: /* POPA */
+ if(rex.is32bits) {
+ R_DI = Pop16(emu);
+ R_SI = Pop16(emu);
+ R_BP = Pop16(emu);
+ R_ESP+=2; // POP ESP
+ R_BX = Pop16(emu);
+ R_DX = Pop16(emu);
+ R_CX = Pop16(emu);
+ R_AX = Pop16(emu);
+ } else {
+ return 0;
+ }
+ break;
+
case 0x64: /* FS: */
+ #ifdef TEST_INTERPRETER
+ return Test6664(test, rex, _FS, addr);
+ #else
return Run6664(emu, rex, _FS, addr);
+ #endif
case 0x65: /* GS: */
+ #ifdef TEST_INTERPRETER
+ return Test6664(test, rex, _GS, addr);
+ #else
return Run6664(emu, rex, _GS, addr);
+ #endif
case 0x69: /* IMUL Gw,Ew,Iw */
nextop = F8;
@@ -257,35 +356,34 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
break;
case 0x8D: /* LEA Gw,M */
nextop = F8;
- GETED(0);
GETGD;
+ tmp64u = GETEA(0);
if(rex.w)
- GD->q[0] = (uint64_t)ED;
+ GD->q[0] = tmp64u;
else
- GD->word[0] = (uint16_t)(uintptr_t)ED;
- break;
-
- case 0x90: /* NOP or XCHG R8d, AX*/
- case 0x91:
- case 0x92:
- case 0x93:
- case 0x94:
- case 0x95:
- case 0x96:
- case 0x97: /* XCHG reg,AX */
- tmp8u = _AX+(opcode&7)+(rex.b<<3);
- if(tmp8u!=_AX) {
- if(rex.w) {
- tmp64u = R_RAX;
- R_RAX = emu->regs[tmp8u].q[0];
- emu->regs[tmp8u].q[0] = tmp64u;
- } else {
- tmp16u = R_AX;
- R_AX = emu->regs[tmp8u].word[0];
- emu->regs[tmp8u].word[0] = tmp16u;
- }
+ GD->word[0] = (uint16_t)tmp64u;
+ break;
+
+ case 0x90: /* NOP or XCHG R8d, AX*/
+ case 0x91:
+ case 0x92:
+ case 0x93:
+ case 0x94:
+ case 0x95:
+ case 0x96:
+ case 0x97: /* XCHG reg,AX */
+ tmp8u = _AX+(opcode&7)+(rex.b<<3);
+ if(tmp8u!=_AX) {
+ if(rex.w) {
+ tmp64u = R_RAX;
+ R_RAX = emu->regs[tmp8u].q[0];
+ emu->regs[tmp8u].q[0] = tmp64u;
+ } else {
+ tmp16u = R_AX;
+ R_AX = emu->regs[tmp8u].word[0];
+ emu->regs[tmp8u].word[0] = tmp16u;
}
- break;
+ }
break;
case 0x98: /* CBW */
@@ -295,18 +393,36 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
R_DX=((R_AX & 0x8000)?0xFFFF:0x0000);
break;
+ case 0x9C: /* PUSHFW */
+ CHECK_FLAGS(emu);
+ Push16(emu, (uint16_t)emu->eflags.x64);
+ break;
+ case 0x9D: /* POPFW */
+ CHECK_FLAGS(emu);
+ emu->eflags.x64 &=0xffff0000;
+ emu->eflags.x64 |= (Pop16(emu) & 0x3F7FD7) | 0x2;
+ break;
+
case 0xA1: /* MOV EAX,Od */
- if(rex.w)
- R_RAX = *(uint64_t*)F64;
- else
- R_AX = *(uint16_t*)F64;
+ if(rex.is32bits) {
+ R_AX = *(uint16_t*)(uintptr_t)F32;
+ } else {
+ if(rex.w)
+ R_RAX = *(uint64_t*)F64;
+ else
+ R_AX = *(uint16_t*)F64;
+ }
break;
case 0xA3: /* MOV Od,EAX */
- if(rex.w)
- *(uint64_t*)F64 = R_RAX;
- else
- *(uint16_t*)F64 = R_AX;
+ if(rex.is32bits) {
+ *(uint16_t*)(uintptr_t)F32 = R_AX;
+ } else {
+ if(rex.w)
+ *(uint64_t*)F64 = R_RAX;
+ else
+ *(uint16_t*)F64 = R_AX;
+ }
break;
case 0xA5: /* (REP) MOVSW */
@@ -395,14 +511,12 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
break;
default:
if(rex.w) {
- tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
tmp64u = *(uint64_t*)R_RDI;
tmp64u2 = *(uint64_t*)R_RSI;
R_RDI += tmp8s;
R_RSI += tmp8s;
cmp64(emu, tmp64u2, tmp64u);
} else {
- tmp8s = ACCESS_FLAG(F_DF)?-2:+2;
tmp16u = *(uint16_t*)R_RDI;
tmp16u2 = *(uint16_t*)R_RSI;
R_RDI += tmp8s;
@@ -427,13 +541,17 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
tmp64u = (rep)?R_RCX:1L;
if((rex.w))
while(tmp64u) {
+ #ifndef TEST_INTERPRETER
*(uint64_t*)R_RDI = R_RAX;
+ #endif
R_RDI += tmp8s;
--tmp64u;
}
else
while(tmp64u) {
+ #ifndef TEST_INTERPRETER
*(uint16_t*)R_RDI = R_AX;
+ #endif
R_RDI += tmp8s;
--tmp64u;
}
@@ -462,7 +580,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
R_RCX = tmp64u;
break;
- case 0xAF: /* (REPZ/REPNE) SCASD */
+ case 0xAF: /* (REPZ/REPNE) SCASW */
if(rex.w)
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
else
@@ -609,19 +727,34 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
break;
case 0xD9: /* x87 opcdes */
+ #ifdef TEST_INTERPRETER
+ return Test66D9(test, rex, addr);
+ #else
return Run66D9(emu, rex, addr);
+ #endif
case 0xDD: /* x87 opcdes */
+ #ifdef TEST_INTERPRETER
+ return Test66DD(test, rex, addr);
+ #else
return Run66DD(emu, rex, addr);
+ #endif
case 0xE8: /* CALL Id */
tmp32s = F32S; // call is relative
- Push(emu, addr);
+ if(rex.is32bits)
+ Push32(emu, addr);
+ else
+ Push64(emu, addr);
addr += tmp32s;
break;
case 0xF0: /* LOCK: */
+ #ifdef TEST_INTERPRETER
+ return Test66F0(test, rex, addr);
+ #else
return Run66F0(emu, rex, addr);
+ #endif
case 0xF7: /* GRP3 Ew(,Iw) */
nextop = F8;
@@ -691,7 +824,6 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
case 0xFF: /* GRP 5 Ew */
nextop = F8;
GETEW(0);
- GETGW;
switch((nextop>>3)&7) {
case 0: /* INC Ed */
EW->word[0] = inc16(emu, EW->word[0]);
@@ -700,13 +832,21 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
EW->word[0] = dec16(emu, EW->word[0]);
break;
case 2: /* CALL NEAR Ed */
- tmp64u = (uintptr_t)getAlternate((void*)ED->q[0]);
- Push(emu, addr);
+ if(rex.is32bits) {
+ tmp64u = (uintptr_t)getAlternate((void*)(uintptr_t)ED->dword[0]);
+ Push32(emu, addr);
+ } else {
+ tmp64u = (uintptr_t)getAlternate((void*)ED->q[0]);
+ Push64(emu, addr);
+ }
addr = tmp64u;
break;
- /*case 6:
- Push16(emu, EW->word[0]);
- break;*/
+ case 6: /* Push Ew */
+ if(rex.is32bits) {
+ Push16(emu, EW->word[0]);
+ } else
+ return 0;
+ break;
default:
printf_log(LOG_NONE, "Illegal Opcode %p: 66 %02X %02X %02X %02X %02X %02X\n",(void*)R_RIP, opcode, nextop, PK(2), PK(3), PK(4), PK(5));
emu->quit=1;
diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c
index 5744099..902772e 100644
--- a/src/emu/x64run660f.c
+++ b/src/emu/x64run660f.c
@@ -43,7 +43,11 @@ static uint8_t ff_mult(uint8_t a, uint8_t b)
return retval;
}
+#ifdef TEST_INTERPRETER
+uintptr_t Test660F(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t opcode;
uint8_t nextop;
@@ -54,8 +58,9 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
int32_t tmp32s;
uint32_t tmp32u;
uint64_t tmp64u;
- int64_t tmp64s;
+ int64_t tmp64s, i64[4];
float tmpf;
+ double tmpd;
#ifndef NOALIGN
int is_nan;
#endif
@@ -106,6 +111,9 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d,
};
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
opcode = F8;
switch(opcode) {
@@ -124,13 +132,13 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
break;
case 0x12: /* MOVLPD Gx, Eq */
nextop = F8;
- GETED(0);
+ GETE8(0);
GETGX;
GX->q[0] = ED->q[0];
break;
case 0x13: /* MOVLPD Eq, Gx */
nextop = F8;
- GETED(0);
+ GETE8(0);
GETGX;
ED->q[0] = GX->q[0];
break;
@@ -149,20 +157,20 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
break;
case 0x16: /* MOVHPD Gx, Ed */
nextop = F8;
- GETED(0);
+ GETE8(0);
GETGX;
GX->q[1] = ED->q[0];
break;
case 0x17: /* MOVHPD Ed, Gx */
nextop = F8;
- GETED(0);
+ GETE8(0);
GETGX;
ED->q[0] = GX->q[1];
break;
case 0x1F: /* NOP (multi-byte) */
nextop = F8;
- GETED(0);
+ FAKEED(0);
break;
case 0x28: /* MOVAPD Gx, Ex */
@@ -186,13 +194,27 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
GX->d[0] = EM->sd[0];
GX->d[1] = EM->sd[1];
break;
-
+ case 0x2B: /* MOVNTPD Ex, Gx */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ EX->q[0] = GX->q[0];
+ EX->q[1] = GX->q[1];
+ break;
case 0x2C: /* CVTTPD2PI Gm, Ex */
nextop = F8;
GETEX(0);
GETGM;
- GM->sd[0] = EX->d[0];
- GM->sd[1] = EX->d[1];
+ tmp64s = EX->d[0];
+ if (tmp64s==(int32_t)tmp64s && !isnan(EX->d[0]))
+ GX->sd[0] = (int32_t)tmp64s;
+ else
+ GX->sd[0] = INT32_MIN;
+ tmp64s = EX->d[1];
+ if (tmp64s==(int32_t)tmp64s && !isnan(EX->d[1]))
+ GX->sd[1] = (int32_t)tmp64s;
+ else
+ GX->sd[1] = INT32_MIN;
break;
case 0x2D: /* CVTPD2PI Gm, Ex */
nextop = F8;
@@ -200,22 +222,28 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
GETGM;
switch(emu->mxcsr.f.MXCSR_RC) {
case ROUND_Nearest:
- GM->sd[0] = nearbyint(EX->d[0]);
- GM->sd[1] = nearbyint(EX->d[1]);
+ i64[0] = nearbyint(EX->d[0]);
+ i64[1] = nearbyint(EX->d[1]);
break;
case ROUND_Down:
- GM->sd[0] = floor(EX->d[0]);
- GM->sd[1] = floor(EX->d[1]);
+ i64[0] = floor(EX->d[0]);
+ i64[1] = floor(EX->d[1]);
break;
case ROUND_Up:
- GM->sd[0] = ceil(EX->d[0]);
- GM->sd[1] = ceil(EX->d[1]);
+ i64[0] = ceil(EX->d[0]);
+ i64[1] = ceil(EX->d[1]);
break;
case ROUND_Chop:
- GM->sd[0] = EX->d[0];
- GM->sd[1] = EX->d[1];
+ i64[0] = EX->d[0];
+ i64[1] = EX->d[1];
break;
}
+ for(int i=0; i<2; ++i)
+ if (i64[i]==(int32_t)i64[i] && !isnan(EX->d[i]))
+ GM->sd[i] = (int32_t)i64[i];
+ else
+ GM->sd[i] = INT32_MIN;
+
break;
case 0x2E: /* UCOMISD Gx, Ex */
// no special check...
@@ -316,7 +344,36 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
GX->sw[4+i] = EX->sw[i*2+0] - EX->sw[i*2+1];
}
break;
-
+ case 0x06: /* PHSUBD Gx, Ex */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ for (int i=0; i<2; ++i)
+ GX->sd[i] = GX->sd[i*2+0] - GX->sd[i*2+1];
+ if(GX == EX) {
+ GX->q[1] = GX->q[0];
+ } else {
+ for (int i=0; i<2; ++i)
+ GX->sd[2+i] = EX->sd[i*2+0] - EX->sd[i*2+1];
+ }
+ break;
+ case 0x07: /* PHSUBSW Gx, Ex */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ for (int i=0; i<4; ++i) {
+ tmp32s = GX->sw[i*2+0] - GX->sw[i*2+1];
+ GX->sw[i] = (tmp32s<-32768)?-32768:((tmp32s>32767)?32767:tmp32s);
+ }
+ if(GX == EX) {
+ GX->q[1] = GX->q[0];
+ } else {
+ for (int i=0; i<4; ++i) {
+ tmp32s = EX->sw[i*2+0] - EX->sw[i*2+1];
+ GX->sw[4+i] = (tmp32s<-32768)?-32768:((tmp32s>32767)?32767:tmp32s);
+ }
+ }
+ break;
case 0x08: /* PSIGNB Gx, Ex */
nextop = F8;
GETEX(0);
@@ -367,14 +424,27 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
GX->ud[i] = EX->ud[i];
}
break;
+ case 0x15: /* BLENDVPD Gx, Ex */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ for (int i=0; i<2; ++i) {
+ if(emu->xmm[0].q[i]&0x8000000000000000LL)
+ GX->q[i] = EX->q[i];
+ }
+ break;
case 0x17: // PTEST GX, EX
nextop = F8;
GETEX(0);
GETGX;
- CHECK_FLAGS(emu);
+ RESET_FLAGS(emu);
CONDITIONAL_SET_FLAG(!(GX->u128&EX->u128), F_ZF);
CONDITIONAL_SET_FLAG(!((~GX->u128)&EX->u128), F_CF);
+ CLEAR_FLAG(F_AF);
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_SF);
+ CLEAR_FLAG(F_PF);
break;
case 0x1C: /* PABSB Gx, Ex */
@@ -445,6 +515,40 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
GX->sq[i] = EX->sd[i];
break;
+ case 0x28: /* PMULDQ Gx, Ex */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ GX->sq[1] = ((int64_t)GX->sd[2])*(int64_t)EX->sd[2];
+ GX->sq[0] = ((int64_t)GX->sd[0])*(int64_t)EX->sd[0];
+ break;
+ case 0x29: /* PCMPEQQ Gx, Ex */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ for(int i=1; i>=0; --i)
+ GX->sq[i] = (GX->sq[i]==EX->sq[i])?-1LL:0LL;
+ break;
+ case 0x2A: /* MOVNTDQA Gx, Ex */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ GX->q[0] = EX->q[0];
+ GX->q[1] = EX->q[1];
+ break;
+ case 0x2B: /* PACKUSDW Gx, Ex */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ for(int i=0; i<4; ++i)
+ GX->uw[i] = (GX->sd[i]<0)?0:((GX->sd[i]>65535)?65535:GX->sd[i]);
+ if(GX==EX)
+ GX->q[1] = GX->q[0];
+ else
+ for(int i=0; i<4; ++i)
+ GX->uw[i+4] = (EX->sd[i]<0)?0:((EX->sd[i]>65535)?65535:EX->sd[i]);
+ break;
+
case 0x30: /* PMOVZXBW Gx, Ex */
nextop = F8;
GETEX(0);
@@ -487,7 +591,13 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
for(int i=1; i>=0; --i)
GX->q[i] = EX->ud[i];
break;
-
+ case 0x37: /* PCMPGTQ Gx, Ex */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ for(int i=1; i>=0; --i)
+ GX->sq[i] = (GX->sq[i]>EX->sq[i])?-1LL:0LL;
+ break;
case 0x38: /* PMINSB Gx, Ex */
nextop = F8;
GETEX(0);
@@ -552,6 +662,30 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
if(GX->ud[i]<EX->ud[i])
GX->ud[i] = EX->ud[i];
break;
+ case 0x40: /* PMULLD Gx, Ex */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ for(int i=0; i<4; ++i)
+ GX->ud[i] *= EX->ud[i];
+ break;
+ case 0x41: /* PHMINPOSUW Gx, Ex */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ tmp16u = EX->uw[0];
+ tmp16s = 0;
+ for(int i=1; i<8; ++i) {
+ if(EX->uw[i]<tmp16u) {
+ tmp16u = EX->uw[i];
+ tmp16s = i;
+ }
+ }
+ GX->q[1] = 0;
+ GX->uw[0] = tmp16u;
+ GX->uw[1] = tmp16s;
+ GX->ud[1] = 0;
+ break;
case 0xDB: /* AESIMC Gx, Ex */
nextop = F8;
@@ -654,7 +788,18 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
GX->q[0] ^= EX->q[0];
GX->q[1] ^= EX->q[1];
break;
-
+ case 0xF0: /* MOVBE Gw, Ew */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ GX->uw[0] = __builtin_bswap16(EX->uw[0]);
+ break;
+ case 0xF1: /* MOVBE Ew, Gw */
+ nextop = F8;
+ GETEX(0);
+ GETGX;
+ EX->uw[0] = __builtin_bswap16(GX->uw[0]);
+ break;
default:
return 0;
}
@@ -663,6 +808,62 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
case 0x3A: // these are some SSE3 & SSE4.x opcodes
opcode = F8;
switch(opcode) {
+ case 0x08: // ROUNDPS Gx, Ex, u8
+ nextop = F8;
+ GETEX(1);
+ GETGX;
+ tmp8u = F8; // ignoring bit 3 interupt thingy
+ if(tmp8u&4)
+ tmp8u = emu->mxcsr.f.MXCSR_RC;
+ else
+ tmp8u &= 3;
+ switch(tmp8u) {
+ case ROUND_Nearest:
+ for(int i=0; i<4; ++i)
+ GX->f[i] = nearbyintf(EX->f[i]);
+ break;
+ case ROUND_Down:
+ for(int i=0; i<4; ++i)
+ GX->f[i] = floorf(EX->f[i]);
+ break;
+ case ROUND_Up:
+ for(int i=0; i<4; ++i)
+ GX->f[i] = ceilf(EX->f[i]);
+ break;
+ case ROUND_Chop:
+ for(int i=0; i<4; ++i)
+ GX->f[i] = truncf(EX->f[i]);
+ break;
+ }
+ break;
+ case 0x09: // ROUNDPD Gx, Ex, u8
+ nextop = F8;
+ GETEX(1);
+ GETGX;
+ tmp8u = F8; // ignoring bit 3 interupt thingy
+ if(tmp8u&4)
+ tmp8u = emu->mxcsr.f.MXCSR_RC;
+ else
+ tmp8u &= 3;
+ switch(tmp8u) {
+ case ROUND_Nearest:
+ GX->d[0] = nearbyint(EX->d[0]);
+ GX->d[1] = nearbyint(EX->d[1]);
+ break;
+ case ROUND_Down:
+ GX->d[0] = floor(EX->d[0]);
+ GX->d[1] = floor(EX->d[1]);
+ break;
+ case ROUND_Up:
+ GX->d[0] = ceil(EX->d[0]);
+ GX->d[1] = ceil(EX->d[1]);
+ break;
+ case ROUND_Chop:
+ GX->d[0] = trunc(EX->d[0]);
+ GX->d[1] = trunc(EX->d[1]);
+ break;
+ }
+ break;
case 0x0A: // ROUNDSS Gx, Ex, u8
nextop = F8;
GETEX(1);
@@ -683,7 +884,7 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
GX->f[0] = ceilf(EX->f[0]);
break;
case ROUND_Chop:
- GX->f[0] = EX->f[0];
+ GX->f[0] = truncf(EX->f[0]);
break;
}
break;
@@ -707,11 +908,22 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
GX->d[0] = ceil(EX->d[0]);
break;
case ROUND_Chop:
- GX->d[0] = EX->d[0];
+ GX->d[0] = trunc(EX->d[0]);
break;
}
break;
+ case 0x0C: /* PBLENDPS Gx, Ex, Ib */
+ nextop = F8;
+ GETEX(1);
+ GETGX;
+ tmp8u = F8;
+ for (int i=0; i<4; ++i) {
+ if(tmp8u&(1<<i))
+ GX->ud[i] = EX->ud[i];
+ }
+ break;
+
case 0x0E: /* PBLENDW Gx, Ex, Ib */
nextop = F8;
GETEX(1);
@@ -738,14 +950,26 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
}
break;
- case 0x14: // PEXTRB EB, GX, u8
+ case 0x14: // PEXTRB ED, GX, u8
nextop = F8;
- GETEB(1);
+ GETED(1);
GETGX;
tmp8u = F8;
- EB->byte[0] = GX->ub[tmp8u&0x0f];
+ if(MODREG)
+ ED->q[0] = GX->ub[tmp8u&0x0f];
+ else
+ ED->byte[0] = GX->ub[tmp8u&0x0f];
+ break;
+ case 0x15: // PEXTRW Ew,Gx,Ib
+ nextop = F8;
+ GETED(1);
+ GETGX;
+ tmp8u = F8;
+ if(MODREG)
+ ED->q[0] = GX->uw[tmp8u&7]; // 16bits extract, 0 extended
+ else
+ ED->word[0] = GX->uw[tmp8u&7];
break;
-
case 0x16: // PEXTRD/Q ED, GX, u8
nextop = F8;
GETED(1);
@@ -754,7 +978,10 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
if(rex.w) {
ED->q[0] = GX->q[tmp8u&1];
} else {
- ED->q[0] = GX->ud[tmp8u&3];
+ if(MODREG)
+ ED->q[0] = GX->ud[tmp8u&3];
+ else
+ ED->dword[0] = GX->ud[tmp8u&3];
}
break;
case 0x17: // EXTRACTPS ED, GX, u8
@@ -807,6 +1034,40 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
for(int i=0; i<4; ++i)
GX->f[i] = (tmp8u&(1<<i))?tmpf:0.0f;
break;
+ case 0x41: /* DPPD Gx, Ex, Ib */
+ nextop = F8;
+ GETEX(1);
+ GETGX;
+ tmp8u = F8;
+ tmpd = 0.0;
+ if(tmp8u&(1<<(4+0)))
+ tmpd += GX->d[0]*EX->d[0];
+ if(tmp8u&(1<<(4+1)))
+ tmpd += GX->d[1]*EX->d[1];
+ GX->d[0] = (tmp8u&(1<<(0)))?tmpd:0.0;
+ GX->d[1] = (tmp8u&(1<<(1)))?tmpd:0.0;
+ break;
+
+ case 0x42: /* MPSADBW Gx, Ex, Ib */
+ nextop = F8;
+ GETEX(1);
+ GETGX;
+ tmp8u = F8;
+ {
+ int src = tmp8u&3;
+ int dst = (tmp8u>>2)&1;
+ int b[11];
+ for (int i=0; i<11; ++i)
+ b[i] = GX->ub[dst*4+i];
+ for(int i=0; i<8; ++i) {
+ int tmp = abs(b[i+0]-EX->ub[src*4+0]);
+ tmp += abs(b[i+1]-EX->ub[src*4+1]);
+ tmp += abs(b[i+2]-EX->ub[src*4+2]);
+ tmp += abs(b[i+3]-EX->ub[src*4+3]);
+ GX->uw[i] = tmp;
+ }
+ }
+ break;
case 0x44: /* PCLMULQDQ Gx, Ex, Ib */
nextop = F8;
@@ -952,24 +1213,30 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
nextop = F8;
GETEX(0);
GETGX;
- for(int i=0; i<4; ++i)
- if(isnanf(EX->f[i]) || isinff(EX->f[i]) || EX->f[i]>0x7fffffff || EX->f[i]<-0x80000000)
- GX->sd[i] = 0x80000000;
+ for(int i=0; i<4; ++i) {
+ if(isnanf(EX->f[i]))
+ tmp64s = INT32_MIN;
else
switch(emu->mxcsr.f.MXCSR_RC) {
case ROUND_Nearest:
- GX->sd[i] = nearbyintf(EX->f[i]);
+ tmp64s = nearbyintf(EX->f[i]);
break;
case ROUND_Down:
- GX->sd[i] = floorf(EX->f[i]);
+ tmp64s = floorf(EX->f[i]);
break;
case ROUND_Up:
- GX->sd[i] = ceilf(EX->f[i]);
+ tmp64s = ceilf(EX->f[i]);
break;
case ROUND_Chop:
- GX->sd[i] = EX->f[i];
+ tmp64s = EX->f[i];
break;
}
+ if (tmp64s==(int32_t)tmp64s) {
+ GX->sd[i] = (int32_t)tmp64s;
+ } else {
+ GX->sd[i] = INT32_MIN;
+ }
+ }
break;
case 0x5C: /* SUBPD Gx, Ex */
nextop = F8;
@@ -1263,7 +1530,7 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
tmp8u = F8;
if(tmp8u>15)
{EX->q[0] = EX->q[1] = 0;}
- else {
+ else if (tmp8u!=0) {
tmp8u*=8;
if (tmp8u < 64) {
EX->q[0] = (EX->q[0] >> tmp8u) | (EX->q[1] << (64 - tmp8u));
@@ -1285,7 +1552,7 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
tmp8u = F8;
if(tmp8u>15)
{EX->q[0] = EX->q[1] = 0;}
- else {
+ else if (tmp8u!=0) {
tmp8u*=8;
if (tmp8u < 64) {
EX->q[1] = (EX->q[1] << tmp8u) | (EX->q[0] >> (64 - tmp8u));
@@ -1516,7 +1783,15 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
tmp32s >>= (rex.w?6:4);
if(!MODREG)
{
+ #ifdef TEST_INTERPRETER
+ test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:1)));
+ if(rex.w)
+ *(uint64_t*)test->mem = *(uint64_t*)test->memaddr;
+ else
+ *(uint16_t*)test->mem = *(uint16_t*)test->memaddr;
+ #else
EW=(reg64_t*)(((uintptr_t)(EW))+(tmp32s<<(rex.w?3:1)));
+ #endif
}
if(rex.w) {
if(EW->q[0] & (1LL<<tmp8u)) {
@@ -2198,4 +2473,4 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
return 0;
}
return addr;
-} \ No newline at end of file
+}
diff --git a/src/emu/x64run6664.c b/src/emu/x64run6664.c
index 9753dfc..48a3be9 100644
--- a/src/emu/x64run6664.c
+++ b/src/emu/x64run6664.c
@@ -22,21 +22,29 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test6664(x64test_t *test, rex_t rex, int seg, uintptr_t addr)
+#else
uintptr_t Run6664(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
+#endif
{
uint8_t opcode;
uint8_t nextop;
reg64_t *oped, *opgd;
sse_regs_t *opex, *opgx;
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
uintptr_t tlsdata = GetSegmentBaseEmu(emu, seg);
opcode = F8;
// REX prefix before the F0 are ignored
rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ if(!rex.is32bits)
+ while(opcode>=0x40 && opcode<=0x4f) {
+ rex.rex = opcode;
+ opcode = F8;
+ }
switch(opcode) {
@@ -84,7 +92,7 @@ uintptr_t Run6664(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
}
break;
- case 0x89: /* MOV Ew,Gw */
+ case 0x89: /* MOV FS:Ew,Gw */
nextop = F8;
GETEW_OFFS(0, tlsdata);
GETGW;
@@ -93,8 +101,7 @@ uintptr_t Run6664(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
else
EW->word[0] = GW->word[0];
break;
-
- case 0x8B: /* MOV Gd,Ed */
+ case 0x8B: /* MOV Gw,FS:Ew */
nextop = F8;
GETEW_OFFS(0, tlsdata);
GETGW;
@@ -103,9 +110,16 @@ uintptr_t Run6664(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
else
GW->word[0] = EW->word[0];
break;
-
+ case 0xC7: /* MOV FS:Ew,Iw */
+ nextop = F8;
+ GETEW_OFFS(2, tlsdata);
+ if(rex.w)
+ EW->q[0] = F16S;
+ else
+ EW->word[0] = F16;
+ break;
default:
return 0;
}
return addr;
-} \ No newline at end of file
+}
diff --git a/src/emu/x64run66d9.c b/src/emu/x64run66d9.c
index 198c3a8..84b554d 100644
--- a/src/emu/x64run66d9.c
+++ b/src/emu/x64run66d9.c
@@ -22,10 +22,17 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test66D9(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t Run66D9(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t nextop;
reg64_t *oped;
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
nextop = F8;
switch (nextop) {
@@ -84,7 +91,9 @@ uintptr_t Run66D9(x64emu_t *emu, rex_t rex, uintptr_t addr)
case 6: /* FNSTENV m */
// warning, incomplete
GETEW(0);
+ #ifndef TEST_INTERPRETER
fpu_savenv(emu, (char*)ED, 1);
+ #endif
break;
default:
return 0;
diff --git a/src/emu/x64run66dd.c b/src/emu/x64run66dd.c
index d0fc703..e8465dd 100644
--- a/src/emu/x64run66dd.c
+++ b/src/emu/x64run66dd.c
@@ -22,10 +22,17 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test66DD(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t Run66DD(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t nextop;
reg64_t *oped;
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
nextop = F8;
switch (nextop) {
@@ -92,6 +99,7 @@ uintptr_t Run66DD(x64emu_t *emu, rex_t rex, uintptr_t addr)
case 6: /* FNSAVE m94byte */
GETEW(0);
// ENV first...
+ #ifndef TEST_INTERPRETER
fpu_savenv(emu, (char*)ED, 1);
// save the STx
{
@@ -102,6 +110,7 @@ uintptr_t Run66DD(x64emu_t *emu, rex_t rex, uintptr_t addr)
p+=10;
}
}
+ #endif
reset_fpu(emu);
break;
default:
diff --git a/src/emu/x64run66f0.c b/src/emu/x64run66f0.c
index 7bf48a4..77c0249 100644
--- a/src/emu/x64run66f0.c
+++ b/src/emu/x64run66f0.c
@@ -25,25 +25,37 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test66F0(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t opcode;
uint8_t nextop;
+ int16_t tmp16s;
uint16_t tmp16u, tmp16u2;
int32_t tmp32s;
int64_t tmp64s;
uint64_t tmp64u, tmp64u2;
reg64_t *oped, *opgd;
-
+ #ifdef USE_CAS
+ uint64_t tmpcas;
+ #endif
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
opcode = F8;
// REX prefix before the F0 are ignored
rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ uintptr_t addr_entry = addr;
+ if(!rex.is32bits)
+ while(opcode>=0x40 && opcode<=0x4f) {
+ rex.rex = opcode;
+ opcode = F8;
+ }
- if(rex.w) return RunF0(emu, rex, addr);
+ if(rex.w) return RunF0(emu, rex, addr_entry);
switch(opcode) {
@@ -55,7 +67,7 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr)
nextop = F8;
GETEW(0);
GETGW;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
do {
tmp16u = native_lock_read_h(EW);
cmp16(emu, R_AX, tmp16u);
@@ -67,14 +79,14 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr)
}
} while(tmp32s);
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
cmp16(emu, R_AX, EW->word[0]);
if(ACCESS_FLAG(F_ZF)) {
EW->word[0] = GW->word[0];
} else {
R_AX = EW->word[0];
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
@@ -82,41 +94,27 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr)
nextop = F8;
GETEW(0);
GETGW;
-#ifdef DYNAREC
- if(rex.w) {
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
+ if(((uintptr_t)ED)&1) {
do {
- tmp64u = native_lock_read_dd(ED);
- tmp64u2 = add64(emu, tmp64u, GD->q[0]);
- } while(native_lock_write_dd(ED, tmp64u2));
- GD->q[0] = tmp64u;
+ tmp16u = ED->word[0] & ~0xff;
+ tmp16u |= native_lock_read_h(ED);
+ tmp16u2 = add16(emu, tmp16u, GD->word[0]);
+ } while(native_lock_write_h(ED, tmp16u2&0xff));
+ ED->word[0] = tmp16u2;
} else {
- if(((uintptr_t)ED)&1) {
- do {
- tmp16u = ED->word[0] & ~0xff;
- tmp16u |= native_lock_read_h(ED);
- tmp16u2 = add16(emu, tmp16u, GD->word[0]);
- } while(native_lock_write_h(ED, tmp16u2&0xff));
- ED->word[0] = tmp16u2;
- } else {
- do {
- tmp16u = native_lock_read_h(ED);
- tmp16u2 = add16(emu, tmp16u, GD->word[0]);
- } while(native_lock_write_h(ED, tmp16u2));
- }
- GD->word[0] = tmp16u;
+ do {
+ tmp16u = native_lock_read_h(ED);
+ tmp16u2 = add16(emu, tmp16u, GD->word[0]);
+ } while(native_lock_write_h(ED, tmp16u2));
}
+ GD->word[0] = tmp16u;
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
- if(rex.w) {
- tmp64u = add64(emu, ED->q[0], GD->q[0]);
- GD->q[0] = ED->q[0];
- ED->q[0] = tmp64u;
- } else {
- tmp16u = add16(emu, ED->word[0], GD->word[0]);
- GD->word[0] = ED->word[0];
- ED->word[0] = tmp16u;
- }
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
+ tmp16u = add16(emu, ED->word[0], GD->word[0]);
+ GD->word[0] = ED->word[0];
+ ED->word[0] = tmp16u;
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
@@ -125,38 +123,24 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr)
}
break;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
#define GO(B, OP) \
case B+1: \
nextop = F8; \
GETEW(0); \
GETGW; \
- if(rex.w) { \
- do { \
- tmp64u = native_lock_read_dd(ED); \
- tmp64u = OP##64(emu, tmp64u, GD->q[0]); \
- } while (native_lock_write_dd(ED, tmp64u)); \
- } else { \
- do { \
- tmp16u = native_lock_read_h(ED); \
- tmp16u = OP##16(emu, tmp16u, GW->word[0]); \
- } while (native_lock_write_h(ED, tmp16u)); \
- } \
+ do { \
+ tmp16u = native_lock_read_h(ED); \
+ tmp16u = OP##16(emu, tmp16u, GW->word[0]); \
+ } while (native_lock_write_h(ED, tmp16u)); \
break; \
case B+3: \
nextop = F8; \
GETEW(0); \
GETGW; \
- if(rex.w) \
- GD->q[0] = OP##64(emu, GD->q[0], ED->q[0]); \
- else \
- GW->word[0] = OP##16(emu, GW->word[0], EW->word[0]);\
- break; \
+ GW->word[0] = OP##16(emu, GW->word[0], EW->word[0]); \
case B+5: \
- if(rex.w) \
- R_RAX = OP##64(emu, R_RAX, F32S64); \
- else \
- R_AX = OP##16(emu, R_AX, F16); \
+ R_AX = OP##16(emu, R_AX, F16); \
break;
#else
#define GO(B, OP) \
@@ -164,31 +148,22 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr)
nextop = F8; \
GETEW(0); \
GETGW; \
- pthread_mutex_lock(&emu->context->mutex_lock); \
- if(rex.w) \
- ED->q[0] = OP##64(emu, ED->q[0], GD->q[0]); \
- else \
- EW->word[0] = OP##16(emu, EW->word[0], GW->word[0]);\
- pthread_mutex_unlock(&emu->context->mutex_lock); \
+ pthread_mutex_lock(&my_context->mutex_lock); \
+ EW->word[0] = OP##16(emu, EW->word[0], GW->word[0]); \
+ pthread_mutex_unlock(&my_context->mutex_lock); \
break; \
case B+3: \
nextop = F8; \
GETEW(0); \
GETGW; \
- pthread_mutex_lock(&emu->context->mutex_lock); \
- if(rex.w) \
- GD->q[0] = OP##64(emu, GD->q[0], ED->q[0]); \
- else \
- GW->word[0] = OP##16(emu, GW->word[0], EW->word[0]);\
- pthread_mutex_unlock(&emu->context->mutex_lock); \
+ pthread_mutex_lock(&my_context->mutex_lock); \
+ GW->word[0] = OP##16(emu, GW->word[0], EW->word[0]); \
+ pthread_mutex_unlock(&my_context->mutex_lock); \
break; \
case B+5: \
- pthread_mutex_lock(&emu->context->mutex_lock); \
- if(rex.w) \
- R_RAX = OP##64(emu, R_RAX, F32S64); \
- else \
- R_AX = OP##16(emu, R_AX, F16); \
- pthread_mutex_unlock(&emu->context->mutex_lock); \
+ pthread_mutex_lock(&my_context->mutex_lock); \
+ R_AX = OP##16(emu, R_AX, F16); \
+ pthread_mutex_unlock(&my_context->mutex_lock); \
break;
#endif
GO(0x00, add) /* ADD 0x00 -> 0x05 */
@@ -204,44 +179,44 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr)
case 0x83: /* GRP Ew,Ib */
nextop = F8;
GETED((opcode==0x83)?1:2);
- tmp64s = (opcode==0x83)?(F8S):(F16S);
- tmp64u = (uint64_t)tmp64s;
-#ifdef DYNAREC
+ tmp16s = (opcode==0x83)?(F8S):(F16S);
+ tmp16u = (uint16_t)tmp16s;
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(MODREG)
switch((nextop>>3)&7) {
- case 0: ED->word[0] = add16(emu, ED->word[0], tmp64u); break;
- case 1: ED->word[0] = or16(emu, ED->word[0], tmp64u); break;
- case 2: ED->word[0] = adc16(emu, ED->word[0], tmp64u); break;
- case 3: ED->word[0] = sbb16(emu, ED->word[0], tmp64u); break;
- case 4: ED->word[0] = and16(emu, ED->word[0], tmp64u); break;
- case 5: ED->word[0] = sub16(emu, ED->word[0], tmp64u); break;
- case 6: ED->word[0] = xor16(emu, ED->word[0], tmp64u); break;
- case 7: cmp16(emu, ED->word[0], tmp64u); break;
+ case 0: ED->word[0] = add16(emu, ED->word[0], tmp16u); break;
+ case 1: ED->word[0] = or16(emu, ED->word[0], tmp16u); break;
+ case 2: ED->word[0] = adc16(emu, ED->word[0], tmp16u); break;
+ case 3: ED->word[0] = sbb16(emu, ED->word[0], tmp16u); break;
+ case 4: ED->word[0] = and16(emu, ED->word[0], tmp16u); break;
+ case 5: ED->word[0] = sub16(emu, ED->word[0], tmp16u); break;
+ case 6: ED->word[0] = xor16(emu, ED->word[0], tmp16u); break;
+ case 7: cmp16(emu, ED->word[0], tmp16u); break;
}
else
switch((nextop>>3)&7) {
- case 0: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = add16(emu, tmp16u2, tmp64u);} while(native_lock_write_h(ED, tmp16u2)); break;
- case 1: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = or16(emu, tmp16u2, tmp64u);} while(native_lock_write_h(ED, tmp16u2)); break;
- case 2: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = adc16(emu, tmp16u2, tmp64u);} while(native_lock_write_h(ED, tmp16u2)); break;
- case 3: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = sbb16(emu, tmp16u2, tmp64u);} while(native_lock_write_h(ED, tmp16u2)); break;
- case 4: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = and16(emu, tmp16u2, tmp64u);} while(native_lock_write_h(ED, tmp16u2)); break;
- case 5: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = sub16(emu, tmp16u2, tmp64u);} while(native_lock_write_h(ED, tmp16u2)); break;
- case 6: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = xor16(emu, tmp16u2, tmp64u);} while(native_lock_write_h(ED, tmp16u2)); break;
- case 7: cmp16(emu, ED->word[0], tmp64u); break;
+ case 0: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = add16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break;
+ case 1: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = or16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break;
+ case 2: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = adc16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break;
+ case 3: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = sbb16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break;
+ case 4: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = and16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break;
+ case 5: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = sub16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break;
+ case 6: do { tmp16u2 = native_lock_read_h(ED); tmp16u2 = xor16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break;
+ case 7: cmp16(emu, ED->word[0], tmp16u); break;
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
switch((nextop>>3)&7) {
- case 0: ED->word[0] = add16(emu, ED->word[0], tmp64u); break;
- case 1: ED->word[0] = or16(emu, ED->word[0], tmp64u); break;
- case 2: ED->word[0] = adc16(emu, ED->word[0], tmp64u); break;
- case 3: ED->word[0] = sbb16(emu, ED->word[0], tmp64u); break;
- case 4: ED->word[0] = and16(emu, ED->word[0], tmp64u); break;
- case 5: ED->word[0] = sub16(emu, ED->word[0], tmp64u); break;
- case 6: ED->word[0] = xor16(emu, ED->word[0], tmp64u); break;
- case 7: cmp16(emu, ED->word[0], tmp64u); break;
+ case 0: ED->word[0] = add16(emu, ED->word[0], tmp16u); break;
+ case 1: ED->word[0] = or16(emu, ED->word[0], tmp16u); break;
+ case 2: ED->word[0] = adc16(emu, ED->word[0], tmp16u); break;
+ case 3: ED->word[0] = sbb16(emu, ED->word[0], tmp16u); break;
+ case 4: ED->word[0] = and16(emu, ED->word[0], tmp16u); break;
+ case 5: ED->word[0] = sub16(emu, ED->word[0], tmp16u); break;
+ case 6: ED->word[0] = xor16(emu, ED->word[0], tmp16u); break;
+ case 7: cmp16(emu, ED->word[0], tmp16u); break;
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
@@ -250,76 +225,36 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr)
GETED(0);
switch((nextop>>3)&7) {
case 0: /* INC Ed */
-#ifdef DYNAREC
- if(rex.w)
- if(((uintptr_t)ED)&7) {
- // unaligned
- do {
- tmp64u = ED->q[0] & 0xffffffffffffff00LL;
- tmp64u |= native_lock_read_b(ED);
- tmp64u = inc64(emu, tmp64u);
- } while(native_lock_write_b(ED, tmp64u&0xff));
- ED->q[0] = tmp64u;
- }
- else
- do {
- tmp64u = native_lock_read_dd(ED);
- } while(native_lock_write_dd(ED, inc64(emu, tmp64u)));
- else {
- if((uintptr_t)ED&1) {
- //meh.
- do {
- tmp16u = ED->word[0];
- tmp16u &=~0xff;
- tmp16u |= native_lock_read_b(ED);
- tmp16u = inc16(emu, tmp16u);
- } while(native_lock_write_b(ED, tmp16u&0xff));
- ED->word[0] = tmp16u;
- } else {
- do {
- tmp16u = native_lock_read_h(ED);
- } while(native_lock_write_h(ED, inc16(emu, tmp16u)));
- }
- }
-#else
- pthread_mutex_lock(&emu->context->mutex_lock);
- if(rex.w) {
- ED->q[0] = inc64(emu, ED->q[0]);
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
+ if((uintptr_t)ED&1) {
+ //meh.
+ do {
+ tmp16u = ED->word[0];
+ tmp16u &=~0xff;
+ tmp16u |= native_lock_read_b(ED);
+ tmp16u = inc16(emu, tmp16u);
+ } while(native_lock_write_b(ED, tmp16u&0xff));
+ ED->word[0] = tmp16u;
} else {
- ED->word[0] = inc16(emu, ED->word[0]);
+ do {
+ tmp16u = native_lock_read_h(ED);
+ } while(native_lock_write_h(ED, inc16(emu, tmp16u)));
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+#else
+ pthread_mutex_lock(&my_context->mutex_lock);
+ ED->word[0] = inc16(emu, ED->word[0]);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 1: /* DEC Ed */
-#ifdef DYNAREC
- if(rex.w)
- if(((uintptr_t)ED)&7) {
- // unaligned
- do {
- tmp64u = ED->q[0] & 0xffffffffffffff00LL;
- tmp64u |= native_lock_read_b(ED);
- tmp64u = dec64(emu, tmp64u);
- } while(native_lock_write_b(ED, tmp64u&0xff));
- ED->q[0] = tmp64u;
- }
- else
- do {
- tmp64u = native_lock_read_dd(ED);
- } while(native_lock_write_dd(ED, dec64(emu, tmp64u)));
- else {
- do {
- tmp16u = native_lock_read_h(ED);
- } while(native_lock_write_h(ED, dec16(emu, tmp16u)));
- }
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
+ do {
+ tmp16u = native_lock_read_h(ED);
+ } while(native_lock_write_h(ED, dec16(emu, tmp16u)));
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
- if(rex.w) {
- ED->q[0] = dec64(emu, ED->q[0]);
- } else {
- ED->word[0] = dec16(emu, ED->word[0]);
- }
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
+ ED->word[0] = dec16(emu, ED->word[0]);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
default:
diff --git a/src/emu/x64run67.c b/src/emu/x64run67.c
index 034fd64..5d9f41c 100644
--- a/src/emu/x64run67.c
+++ b/src/emu/x64run67.c
@@ -22,7 +22,11 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test67(x64test_t *test, rex_t rex, int rep, uintptr_t addr)
+#else
uintptr_t Run67(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
+#endif
{
uint8_t opcode;
uint8_t nextop;
@@ -32,6 +36,15 @@ uintptr_t Run67(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
int32_t tmp32s;
uint64_t tmp64u;
reg64_t *oped, *opgd;
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
+ if(rex.is32bits)
+ #ifdef TEST_INTERPRETER
+ return Test67_32(test, rex, rep, addr);
+ #else
+ return Run67_32(emu, rex, rep, addr);
+ #endif
opcode = F8;
@@ -145,8 +158,25 @@ uintptr_t Run67(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
cmp32(emu, R_EAX, F32);
break;
+ case 0x63: /* MOVSXD Gd,Ed */
+ nextop = F8;
+ GETED32(0);
+ GETGD;
+ if(rex.w)
+ GD->sq[0] = ED->sdword[0];
+ else
+ if(MODREG)
+ GD->q[0] = ED->dword[0]; // not really a sign extension
+ else
+ GD->sdword[0] = ED->sdword[0]; // meh?
+ break;
+
case 0x66:
+ #ifdef TEST_INTERPRETER
+ return Test6766(test, rex, rep, addr);
+ #else
return Run6766(emu, rex, rep, addr);
+ #endif
case 0x80: /* GRP Eb,Ib */
nextop = F8;
@@ -249,7 +279,7 @@ uintptr_t Run67(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
case 0x8D: /* LEA Gd,M */
nextop = F8;
- GETED32(0);
+ _GETED32(0);
GETGD;
if(rex.w)
GD->q[0] = (uint64_t)ED;
@@ -338,7 +368,7 @@ uintptr_t Run67(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
case 0xE8: /* CALL Id */
tmp32s = F32S; // call is relative
- Push(emu, addr);
+ Push64(emu, addr);
addr += tmp32s;
break;
diff --git a/src/emu/x64run670f.c b/src/emu/x64run670f.c
index d122d0e..015b371 100644
--- a/src/emu/x64run670f.c
+++ b/src/emu/x64run670f.c
@@ -26,7 +26,11 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test670F(x64test_t *test, rex_t rex, int rep, uintptr_t addr)
+#else
uintptr_t Run670F(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
+#endif
{
(void)rep;
uint8_t opcode;
@@ -40,10 +44,26 @@ uintptr_t Run670F(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
sse_regs_t *opex, *opgx, eax1; (void)eax1;
mmx87_regs_t *opem, *opgm, eam1; (void)opem; (void)opgm; (void)eam1;
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
opcode = F8;
switch(opcode) {
+ case 0x11:
+ switch(rep) {
+ case 0: /* MOVUPS Ex,Gx */
+ nextop = F8;
+ GETEX32(0);
+ GETGX;
+ EX->u128 = GX->u128;
+ break;
+ default:
+ return 0;
+ }
+ break;
+
case 0x2E:
// same for now
case 0x2F:
@@ -77,6 +97,12 @@ uintptr_t Run670F(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
GETGM;
GM->q = EM->q;
break;
+ case 2: /* MOVDQU Gx, Ex */
+ nextop = F8;
+ GETEX32(0);
+ GETGX;
+ memcpy(GX, EX, 16); // unaligned...
+ break;
default:
return 0;
}
@@ -95,18 +121,34 @@ uintptr_t Run670F(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
}
break;
+ case 0xB6: /* MOVZX Gd,Eb */
+ nextop = F8;
+ GETEB32(0);
+ GETGD;
+ GD->q[0] = EB->byte[0];
+ break;
+
case 0xB9:
switch(rep) {
case 0: /* UD1 Ed */
nextop = F8;
- GETED32(0);
+ FAKEED32(0);
+ #ifndef TEST_INTERPRETER
emit_signal(emu, SIGILL, (void*)R_RIP, 0);
+ #endif
break;
default:
return 0;
}
break;
+ case 0xB7: /* MOVZX Gd,Ew */
+ nextop = F8;
+ GETEW32(0);
+ GETGD;
+ GD->q[0] = EW->word[0];
+ break;
+
default:
return 0;
}
diff --git a/src/emu/x64run6764_32.c b/src/emu/x64run6764_32.c
new file mode 100644
index 0000000..6f6b060
--- /dev/null
+++ b/src/emu/x64run6764_32.c
@@ -0,0 +1,67 @@
+#define _GNU_SOURCE
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "debug.h"
+#include "box64stack.h"
+#include "x64emu.h"
+#include "x64run.h"
+#include "x64emu_private.h"
+#include "x64run_private.h"
+#include "x64primop.h"
+#include "x64trace.h"
+#include "x87emu_private.h"
+#include "box64context.h"
+#include "bridge.h"
+
+#include "modrm.h"
+
+#ifdef TEST_INTERPRETER
+uintptr_t Test6764_32(x64test_t *test, rex_t rex, int rep, int seg, uintptr_t addr)
+#else
+uintptr_t Run6764_32(x64emu_t *emu, rex_t rex, int rep, int seg, uintptr_t addr)
+#endif
+{
+ uint8_t opcode;
+ uint8_t nextop;
+ int8_t tmp8s;
+ uint8_t tmp8u;
+ uint32_t tmp32u;
+ int32_t tmp32s;
+ uint64_t tmp64u;
+ reg64_t *oped, *opgd;
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
+ uintptr_t tlsdata = GetSegmentBaseEmu(emu, seg);
+ opcode = F8;
+
+ while(opcode==0x67)
+ opcode = F8;
+
+ rex.rex = 0;
+ while((opcode==0xF2) || (opcode==0xF3)) {
+ rep = opcode-0xF1;
+ opcode = F8;
+ }
+
+ switch(opcode) {
+
+ case 0x8B: /* MOV Gw, FS:Ew */
+ nextop = F8;
+ GETEW_OFFS_16(tlsdata);
+ GETGW;
+ GW->word[0] = EW->word[0];
+ break;
+
+ default:
+ return 0;
+ }
+ return addr;
+} \ No newline at end of file
diff --git a/src/emu/x64run6766.c b/src/emu/x64run6766.c
index c12e903..35219b2 100644
--- a/src/emu/x64run6766.c
+++ b/src/emu/x64run6766.c
@@ -25,7 +25,11 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test6766(x64test_t *test, rex_t rex, int rep, uintptr_t addr)
+#else
uintptr_t Run6766(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
+#endif
{
// Hmmmm....
(void)rep;
@@ -39,7 +43,9 @@ uintptr_t Run6766(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
int64_t tmp64s; (void)tmp64s;
uint64_t tmp64u, tmp64u2, tmp64u3; (void)tmp64u; (void)tmp64u2; (void)tmp64u3;
reg64_t *oped, *opgd; (void)oped; (void)opgd;
-
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
opcode = F8;
while((opcode==0x2E) || (opcode==0x66)) // ignoring CS: or multiple 0x66
@@ -51,15 +57,30 @@ uintptr_t Run6766(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
}
// REX prefix before the 66 are ignored
rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ if(!rex.is32bits)
+ while(opcode>=0x40 && opcode<=0x4f) {
+ rex.rex = opcode;
+ opcode = F8;
+ }
switch(opcode) {
case 0x0F: /* more opcodes */
+ #ifdef TEST_INTERPRETER
+ return Test67660F(test, rex, addr);
+ #else
return Run67660F(emu, rex, addr);
+ #endif
+
+ case 0x89: /* MOV Ew,Gw */
+ nextop = F8;
+ GETEW32(0);
+ GETGW;
+ if(rex.w)
+ EW->q[0] = GW->q[0];
+ else
+ EW->word[0] = GW->word[0];
+ break;
default:
return 0;
diff --git a/src/emu/x64run67660f.c b/src/emu/x64run67660f.c
index 7550642..ba031c8 100644
--- a/src/emu/x64run67660f.c
+++ b/src/emu/x64run67660f.c
@@ -22,7 +22,11 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t Test67660F(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t Run67660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t opcode;
uint8_t nextop;
@@ -36,7 +40,9 @@ uintptr_t Run67660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
uint64_t tmp64u; (void)tmp64u;
reg64_t *oped, *opgd; (void)oped; (void)opgd;
sse_regs_t *opex, *opgx;
-
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
opcode = F8;
switch(opcode) {
diff --git a/src/emu/x64run67_32.c b/src/emu/x64run67_32.c
new file mode 100644
index 0000000..a1df3ba
--- /dev/null
+++ b/src/emu/x64run67_32.c
@@ -0,0 +1,100 @@
+#define _GNU_SOURCE
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "debug.h"
+#include "box64stack.h"
+#include "x64emu.h"
+#include "x64run.h"
+#include "x64emu_private.h"
+#include "x64run_private.h"
+#include "x64primop.h"
+#include "x64trace.h"
+#include "x87emu_private.h"
+#include "box64context.h"
+#include "bridge.h"
+
+#include "modrm.h"
+
+#ifdef TEST_INTERPRETER
+uintptr_t Test67_32(x64test_t *test, rex_t rex, int rep, uintptr_t addr)
+#else
+uintptr_t Run67_32(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
+#endif
+{
+ uint8_t opcode;
+ uint8_t nextop;
+ int8_t tmp8s;
+ uint8_t tmp8u;
+ uint32_t tmp32u;
+ int32_t tmp32s;
+ uint64_t tmp64u;
+ reg64_t *oped, *opgd;
+ #ifdef TEST_INTERPRETER
+ x64emu_t* emu = test->emu;
+ #endif
+ opcode = F8;
+
+ while(opcode==0x67)
+ opcode = F8;
+
+ rex.rex = 0;
+ while((opcode==0xF2) || (opcode==0xF3)) {
+ rep = opcode-0xF1;
+ opcode = F8;
+ }
+
+ switch(opcode) {
+
+ case 0x64: /* FS: prefix */
+ #ifdef TEST_INTERPRETER
+ return Test6764_32(test, rex, rep, _FS, addr);
+ #else
+ return Run6764_32(emu, rex, rep, _FS, addr);
+ #endif
+ break;
+ case 0x65: /* GS: prefix */
+ #ifdef TEST_INTERPRETER
+ return Test6764_32(test, rex, rep, _GS, addr);
+ #else
+ return Run6764_32(emu, rex, rep, _GS, addr);
+ #endif
+ break;
+
+ case 0xE0: /* LOOPNZ */
+ CHECK_FLAGS(emu);
+ tmp8s = F8S;
+ --R_CX; // don't update flags
+ if(R_CX && !ACCESS_FLAG(F_ZF))
+ addr += tmp8s;
+ break;
+ case 0xE1: /* LOOPZ */
+ CHECK_FLAGS(emu);
+ tmp8s = F8S;
+ --R_CX; // don't update flags
+ if(R_CX && ACCESS_FLAG(F_ZF))
+ addr += tmp8s;
+ break;
+ case 0xE2: /* LOOP */
+ tmp8s = F8S;
+ --R_CX; // don't update flags
+ if(R_CX)
+ addr += tmp8s;
+ break;
+ case 0xE3: /* JECXZ Ib */
+ tmp8s = F8S;
+ if(!R_CX)
+ addr += tmp8s;
+ break;
+
+ default:
+ return 0;
+ }
+ return addr;
+} \ No newline at end of file
diff --git a/src/emu/x64run_private.c b/src/emu/x64run_private.c
index a78ca67..ffddd73 100755..100644
--- a/src/emu/x64run_private.c
+++ b/src/emu/x64run_private.c
@@ -33,6 +33,8 @@ int32_t EXPORT my___libc_start_main(x64emu_t* emu, int *(main) (int, char * *, c
(void)argc; (void)ubp_av; (void)fini; (void)rtld_fini; (void)stack_end;
if(init) {
+ uintptr_t old_rsp = GetRSP(emu);
+ uintptr_t old_rbp = GetRBP(emu); // should not be needed, but seems to be without dynarec
Push64(emu, GetRBP(emu)); // set frame pointer
SetRBP(emu, GetRSP(emu)); // save RSP
SetRSP(emu, GetRSP(emu)&~0xFLL); // Align RSP
@@ -47,11 +49,17 @@ int32_t EXPORT my___libc_start_main(x64emu_t* emu, int *(main) (int, char * *, c
return 0;
SetRSP(emu, GetRBP(emu)); // restore RSP
SetRBP(emu, Pop64(emu)); // restore RBP
+ SetRSP(emu, old_rsp);
+ SetRBP(emu, old_rbp);
emu->quit = 0;
} else {
- RunElfInit(my_context->elfs[0], emu);
+ if(my_context->elfs[0]) {
+ RunElfInit(my_context->elfs[0], emu);
+ }
+ }
+ if(my_context->elfs[0]) {
+ MarkElfInitDone(my_context->elfs[0]);
}
- MarkElfInitDone(my_context->elfs[0]);
printf_log(LOG_DEBUG, "Transfert to main(%d, %p, %p)=>%p from __libc_start_main\n", my_context->argc, my_context->argv, my_context->envv, main);
// call main and finish
Push64(emu, GetRBP(emu)); // set frame pointer
@@ -939,7 +947,7 @@ void UpdateFlags(x64emu_t *emu)
case d_rcr32:
case d_rcr64:
case d_unknown:
- printf_log(LOG_NONE, "Box64: %p trying to evaluate Unknown defered Flags\n", (void*)R_RIP);
+ printf_log(LOG_NONE, "Box64: %p trying to evaluate Unknown deferred Flags\n", (void*)R_RIP);
break;
case d_dec8i:
@@ -951,7 +959,7 @@ void UpdateFlags(x64emu_t *emu)
case d_inc32i:
case d_inc64i:
{
- defered_flags_t df = emu->df - (d_dec8i - d_dec8);
+ deferred_flags_t df = emu->df - (d_dec8i - d_dec8);
if(emu->df_sav!=d_none) {
// compute CF
multiuint_t op1 = emu->op1;
@@ -1006,7 +1014,7 @@ const char* getAddrFunctionName(uintptr_t addr)
return ret;
}
-void printFunctionAddr(uintptr_t nextaddr, const char* text)
+int printFunctionAddr(uintptr_t nextaddr, const char* text)
{
uint64_t sz = 0;
uintptr_t start = 0;
@@ -1017,7 +1025,9 @@ void printFunctionAddr(uintptr_t nextaddr, const char* text)
printf_log(LOG_NONE, " (%s%s:%s)", text, ElfName(FindElfAddress(my_context, nextaddr)), symbname);
else
printf_log(LOG_NONE, " (%s%s:%s + %ld)", text, ElfName(FindElfAddress(my_context, nextaddr)), symbname, nextaddr - start);
+ return 1;
}
+ return 0;
}
#ifdef HAVE_TRACE
@@ -1028,6 +1038,7 @@ extern uint64_t start_cnt;
void PrintTrace(x64emu_t* emu, uintptr_t ip, int dynarec)
{
+ int is32bits = (emu->segs[_CS]==0x23);
if(start_cnt) --start_cnt;
if(!start_cnt && my_context->dec && (
(trace_end == 0)
@@ -1047,7 +1058,7 @@ void PrintTrace(x64emu_t* emu, uintptr_t ip, int dynarec)
my_context->trace_tid = tid;
}
#endif
- printf_log(LOG_NONE, "%s", DumpCPURegs(emu, ip));
+ printf_log(LOG_NONE, "%s", DumpCPURegs(emu, ip, is32bits));
if(R_RIP==0) {
printf_log(LOG_NONE, "Running at NULL address\n");
mutex_unlock(&my_context->mutex_trace);
@@ -1061,32 +1072,51 @@ void PrintTrace(x64emu_t* emu, uintptr_t ip, int dynarec)
printf_log(LOG_NONE, "%p: Native call to %p => %s\n", (void*)ip, (void*)a, GetNativeName(*(void**)(ip+11)));
}
} else {
- printf_log(LOG_NONE, "%s", DecodeX64Trace(my_context->dec, ip));
+ printf_log(LOG_NONE, "%s", DecodeX64Trace(is32bits?my_context->dec32:my_context->dec, ip));
uint8_t peek = PK(0);
rex_t rex = {0};
- if(peek>=0x40 && peek<=0x4f) {
+ if(!is32bits && peek>=0x40 && peek<=0x4f) {
rex.rex = peek;
ip++;
peek = PK(0);
}
if(peek==0xC3 || peek==0xC2 || (peek==0xF3 && PK(1)==0xC3)) {
- printf_log(LOG_NONE, " => %p", *(void**)(R_RSP));
- printFunctionAddr(*(uintptr_t*)(R_RSP), "=> ");
+ if(is32bits) {
+ printf_log(LOG_NONE, " => %p", (void*)(uintptr_t)*(uint32_t*)(R_RSP));
+ printFunctionAddr(*(uint32_t*)(R_RSP), "=> ");
+ } else {
+ printf_log(LOG_NONE, " => %p", *(void**)(R_RSP));
+ printFunctionAddr(*(uintptr_t*)(R_RSP), "=> ");
+ }
} else if(peek==0x57 && rex.b) {
printf_log(LOG_NONE, " => STACK_TOP: %p", *(void**)(R_RSP));
printFunctionAddr(ip, "here: ");
- } else if(peek==0x55 || peek==0x53) {
+ } else if((peek==0x55 || peek==0x53) && !is32bits) {
printFunctionAddr(*(uintptr_t*)(R_RSP), " STACK_TOP: ");
- } else if(peek==0xF3 && PK(1)==0x0F && PK(2)==0x1E && PK(3)==0xFA) {
+ } else if((peek==0x55 || peek==0x56) && is32bits) {
+ if(!printFunctionAddr(*(uint32_t*)(R_RSP), " STACK_TOP: "))
+ printf_log(LOG_NONE, " STACK_TOP: %p ", (void*)(uintptr_t)*(uint32_t*)(R_RSP));
+ } else if(peek==0xF3 && PK(1)==0x0F && PK(2)==0x1E && PK(3)==0xFA && !is32bits) {
printFunctionAddr(*(uintptr_t*)(R_RSP), " STACK_TOP: ");
- } else if(peek==0xE8) { // Call
- uintptr_t nextaddr = ip + 5 + PK64(1);
+ } else if(peek==0xE8 || peek==0xE9) { // Call & Jmp
+ uintptr_t nextaddr = ip + 5 + PK32(1);
printFunctionAddr(nextaddr, "=> ");
} else if(peek==0xFF) {
if(PK(1)==0x25) {
- uintptr_t nextaddr = ip + 6 + PK64(2);
+ uintptr_t nextaddr = *(uintptr_t*)(ip + 6 + PK32(2));
+ if(!printFunctionAddr(nextaddr, "=> "))
+ printf_log(LOG_NONE, " => %p", (void*)nextaddr);
+ } else if((PK(1)==0x14) && (PK(2)==0x25)) {
+ uintptr_t nextaddr = *(uintptr_t*)(uintptr_t)PK32(3);
+ printf_log(LOG_NONE, " => %p", (void*)nextaddr);
printFunctionAddr(nextaddr, "=> ");
+ } else if((PK(1)==0x14) && (PK(2)==0xC2) && rex.rex==0x41) {
+ uintptr_t nextaddr = *(uintptr_t*)(R_R10 + R_RAX*8);
+ printf_log(LOG_NONE, " => %p", (void*)nextaddr);
+ printFunctionAddr(nextaddr, "=> ");
+
}
+
}
printf_log(LOG_NONE, "\n");
}
@@ -1132,8 +1162,56 @@ static uint64_t F64(uintptr_t* addr) {
return ret;
}
+reg64_t* GetECommon_32(x64emu_t* emu, uintptr_t* addr, uint8_t m, uint32_t base)
+{
+ if (m<=7) {
+ if(m==0x4) {
+ uint8_t sib = F8(addr);
+ base += ((sib&0x7)==5)?((uint32_t)F32S(addr)):(emu->regs[(sib&0x7)].dword[0]); // base
+ base += (emu->sbiidx[((sib>>3)&7)]->sdword[0] << (sib>>6));
+ return (reg64_t*)(uintptr_t)base;
+ } else if (m==0x5) { //disp32
+ base += F32S(addr);
+ return (reg64_t*)(uintptr_t)base;
+ }
+ return (reg64_t*)(uintptr_t)(base + emu->regs[m].dword[0]);
+ } else {
+ if((m&7)==4) {
+ uint8_t sib = F8(addr);
+ base += emu->regs[(sib&0x7)].dword[0]; // base
+ base += (emu->sbiidx[((sib>>3)&7)]->sdword[0] << (sib>>6));
+ } else {
+ base += emu->regs[(m&0x7)].dword[0];
+ }
+ base+=(m&0x80)?F32S(addr):F8S(addr);
+ return (reg64_t*)(uintptr_t)base;
+ }
+}
+reg64_t* GetEw16_32(x64emu_t *emu, uintptr_t* addr, uint8_t m, uint32_t base)
+{
+ switch(m&7) {
+ case 0: base+= R_BX+R_SI; break;
+ case 1: base+= R_BX+R_DI; break;
+ case 2: base+= R_BP+R_SI; break;
+ case 3: base+= R_BP+R_DI; break;
+ case 4: base+= R_SI; break;
+ case 5: base+= R_DI; break;
+ case 6: base+= R_BP; break;
+ case 7: base+= R_BX; break;
+ }
+ switch((m>>6)&3) {
+ case 0: if((m&7)==6) base= F16S(addr); break;
+ case 1: base += F8S(addr); break;
+ case 2: base += F16S(addr); break;
+ // case 3 is C0..C7, already dealt with
+ }
+ return (reg64_t*)(uintptr_t)base;
+}
+
reg64_t* GetECommon(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta)
{
+ if(rex.is32bits)
+ return GetECommon_32(emu, addr, m, 0);
if (m<=7) {
if(m==0x4) {
uint8_t sib = F8(addr);
@@ -1161,6 +1239,8 @@ reg64_t* GetECommon(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_
reg64_t* GetECommonO(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t base)
{
+ if(rex.is32bits)
+ return GetECommon_32(emu, addr, m, base);
if (m<=7) {
if(m==0x4) {
uint8_t sib = F8(addr);
@@ -1187,6 +1267,8 @@ reg64_t* GetECommonO(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8
reg64_t* GetECommon32O(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t base)
{
+ if(rex.is32bits)
+ return GetEw16_32(emu, addr, m, base);
if (m<=7) {
if(m==0x4) {
uint8_t sib = F8(addr);
@@ -1225,6 +1307,26 @@ reg64_t* GetEb(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t del
} else return GetECommon(emu, addr, rex, m, delta);
}
+reg64_t* TestEb(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
+{
+ // rex ignored here
+ uint8_t m = v&0xC7; // filter Eb
+ if(m>=0xC0) {
+ if(rex.rex) {
+ return &test->emu->regs[(m&0x07)+(rex.b<<3)];
+ } else {
+ int lowhigh = (m&4)>>2;
+ return (reg64_t *)(((char*)(&test->emu->regs[(m&0x03)]))+lowhigh); //?
+ }
+ } else {
+ reg64_t* ret = GetECommon(test->emu, addr, rex, m, delta);
+ test->memsize = 1;
+ test->memaddr = (uintptr_t)ret;
+ test->mem[0] = ret->byte[0];
+ return (reg64_t*)test->mem;
+ }
+}
+
reg64_t* GetEbO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
{
// rex ignored here
@@ -1239,6 +1341,26 @@ reg64_t* GetEbO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t de
} else return GetECommonO(emu, addr, rex, m, delta, offset);
}
+reg64_t* TestEbO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
+{
+ // rex ignored here
+ uint8_t m = v&0xC7; // filter Eb
+ if(m>=0xC0) {
+ if(rex.rex) {
+ return &test->emu->regs[(m&0x07)+(rex.b<<3)];
+ } else {
+ int lowhigh = (m&4)>>2;
+ return (reg64_t *)(((char*)(&test->emu->regs[(m&0x03)]))+lowhigh); //?
+ }
+ } else {
+ reg64_t* ret = GetECommonO(test->emu, addr, rex, m, delta, offset);
+ test->memsize = 1;
+ test->memaddr = (uintptr_t)ret;
+ test->mem[0] = ret->byte[0];
+ return (reg64_t*)test->mem;
+ }
+}
+
reg64_t* GetEd(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
{
uint8_t m = v&0xC7; // filter Ed
@@ -1247,6 +1369,85 @@ reg64_t* GetEd(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t del
} else return GetECommon(emu, addr, rex, m, delta);
}
+reg64_t* TestEd(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->regs[(m&0x07)+(rex.b<<3)];
+ } else {
+ reg64_t* ret = GetECommon(test->emu, addr, rex, m, delta);
+ test->memsize = 4<<rex.w;
+ test->memaddr = (uintptr_t)ret;
+ if(rex.w)
+ *(uint64_t*)test->mem = ret->q[0];
+ else
+ *(uint32_t*)test->mem = ret->dword[0];
+ return (reg64_t*)test->mem;
+ }
+}
+reg64_t* TestEd4(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->regs[(m&0x07)+(rex.b<<3)];
+ } else {
+ reg64_t* ret = GetECommon(test->emu, addr, rex, m, delta);
+ test->memsize = 4;
+ test->memaddr = (uintptr_t)ret;
+ *(uint32_t*)test->mem = ret->dword[0];
+ return (reg64_t*)test->mem;
+ }
+}
+reg64_t* TestEd8(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->regs[(m&0x07)+(rex.b<<3)];
+ } else {
+ reg64_t* ret = GetECommon(test->emu, addr, rex, m, delta);
+ test->memsize = 8;
+ test->memaddr = (uintptr_t)ret;
+ *(uint64_t*)test->mem = ret->q[0];
+ return (reg64_t*)test->mem;
+ }
+}
+reg64_t* TestEdt(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->regs[(m&0x07)+(rex.b<<3)];
+ } else {
+ reg64_t* ret = GetECommon(test->emu, addr, rex, m, delta);
+ test->memsize = 4;
+ test->memaddr = (uintptr_t)ret;
+ memcpy(test->mem, ret, 10);
+ return (reg64_t*)test->mem;
+ }
+}
+reg64_t* TestEd8xw(x64test_t *test, int w, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->regs[(m&0x07)+(rex.b<<3)];
+ } else {
+ reg64_t* ret = GetECommon(test->emu, addr, rex, m, delta);
+ test->memsize = 8<<w;
+ test->memaddr = (uintptr_t)ret;
+ *(uint64_t*)test->mem = ret->q[0];
+ if(w)
+ ((uint64_t*)test->mem)[1] = ret->q[1];
+ return (reg64_t*)test->mem;
+ }
+}
+
+uintptr_t GetEA(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return (uintptr_t)&emu->regs[(m&0x07)+(rex.b<<3)];
+ } else return (uintptr_t)GetECommon(emu, addr, rex, m, delta);
+}
+
reg64_t* GetEdO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
{
uint8_t m = v&0xC7; // filter Ed
@@ -1255,6 +1456,23 @@ reg64_t* GetEdO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t de
} else return GetECommonO(emu, addr, rex, m, delta, offset);
}
+reg64_t* TestEdO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->regs[(m&0x07)+(rex.b<<3)];
+ } else {
+ reg64_t* ret = GetECommonO(test->emu, addr, rex, m, delta, offset);
+ test->memsize = 4<<rex.w;
+ test->memaddr = (uintptr_t)ret;
+ if(rex.w)
+ *(uint64_t*)test->mem = ret->q[0];
+ else
+ *(uint32_t*)test->mem = ret->dword[0];
+ return (reg64_t*)test->mem;
+ }
+}
+
reg64_t* GetEd32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
{
uint8_t m = v&0xC7; // filter Ed
@@ -1263,6 +1481,23 @@ reg64_t* GetEd32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t
} else return GetECommon32O(emu, addr, rex, m, delta, offset);
}
+reg64_t* TestEd32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->regs[(m&0x07)+(rex.b<<3)];
+ } else {
+ reg64_t* ret = GetECommon32O(test->emu, addr, rex, m, delta, offset);
+ test->memsize = 4<<rex.w;
+ test->memaddr = (uintptr_t)ret;
+ if(rex.w)
+ *(uint64_t*)test->mem = ret->q[0];
+ else
+ *(uint32_t*)test->mem = ret->dword[0];
+ return (reg64_t*)test->mem;
+ }
+}
+
reg64_t* GetEb32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
{
uint8_t m = v&0xC7; // filter Eb
@@ -1276,7 +1511,27 @@ reg64_t* GetEb32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t
} else return GetECommon32O(emu, addr, rex, m, delta, offset);
}
+reg64_t* TestEb32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
+{
+ uint8_t m = v&0xC7; // filter Eb
+ if(m>=0xC0) {
+ if(rex.rex) {
+ return &test->emu->regs[(m&0x07)+(rex.b<<3)];
+ } else {
+ int lowhigh = (m&4)>>2;
+ return (reg64_t *)(((char*)(&test->emu->regs[(m&0x03)]))+lowhigh); //?
+ }
+ } else {
+ reg64_t* ret = GetECommon32O(test->emu, addr, rex, m, delta, offset);
+ test->memsize = 1;
+ test->memaddr = (uintptr_t)ret;
+ test->mem[0] = ret->byte[0];
+ return (reg64_t*)test->mem;
+ }
+}
+
#define GetEw GetEd
+#define TestEw TestEd
reg64_t* GetEw16(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v)
{
@@ -1298,7 +1553,7 @@ reg64_t* GetEw16(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v)
case 7: base = R_BX; break;
}
switch((m>>6)&3) {
- case 0: if(m==6) base = F16(addr); break;
+ case 0: if((m&7)==6) base = F16S(addr); break;
case 1: base += F8S(addr); break;
case 2: base += F16S(addr); break;
// case 3 is C0..C7, already dealt with
@@ -1307,6 +1562,39 @@ reg64_t* GetEw16(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v)
}
}
+reg64_t* TestEw16(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v)
+{
+ (void)rex;
+ x64emu_t* emu = test->emu;
+
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &emu->regs[(m&0x07)];
+ } else {
+ uintptr_t base = 0;
+ switch(m&7) {
+ case 0: base = R_BX+R_SI; break;
+ case 1: base = R_BX+R_DI; break;
+ case 2: base = R_BP+R_SI; break;
+ case 3: base = R_BP+R_DI; break;
+ case 4: base = R_SI; break;
+ case 5: base = R_DI; break;
+ case 6: base = R_BP; break;
+ case 7: base = R_BX; break;
+ }
+ switch((m>>6)&3) {
+ case 0: if((m&7)==6) base = F16S(addr); break;
+ case 1: base += F8S(addr); break;
+ case 2: base += F16S(addr); break;
+ // case 3 is C0..C7, already dealt with
+ }
+ test->memsize = 2;
+ *(uint16_t*)test->mem = *(uint16_t*)base;
+ test->memaddr = (uintptr_t)base;
+ return (reg64_t*)test->mem;
+ }
+}
+
reg64_t* GetEw16off(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uintptr_t offset)
{
(void)rex;
@@ -1327,7 +1615,7 @@ reg64_t* GetEw16off(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uintpt
case 7: base = R_BX; break;
}
switch((m>>6)&3) {
- case 0: if(m==6) base = F16(addr); break;
+ case 0: if((m&7)==6) base = F16S(addr); break;
case 1: base += F8S(addr); break;
case 2: base += F16S(addr); break;
// case 3 is C0..C7, already dealt with
@@ -1336,6 +1624,39 @@ reg64_t* GetEw16off(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uintpt
}
}
+reg64_t* TestEw16off(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uintptr_t offset)
+{
+ (void)rex;
+ x64emu_t* emu = test->emu;
+
+ uint32_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &emu->regs[(m&0x07)];
+ } else {
+ uint32_t base = 0;
+ switch(m&7) {
+ case 0: base = R_BX+R_SI; break;
+ case 1: base = R_BX+R_DI; break;
+ case 2: base = R_BP+R_SI; break;
+ case 3: base = R_BP+R_DI; break;
+ case 4: base = R_SI; break;
+ case 5: base = R_DI; break;
+ case 6: base = R_BP; break;
+ case 7: base = R_BX; break;
+ }
+ switch((m>>6)&3) {
+ case 0: if((m&7)==6) base = F16S(addr); break;
+ case 1: base += F8S(addr); break;
+ case 2: base += F16S(addr); break;
+ // case 3 is C0..C7, already dealt with
+ }
+ test->memsize = 2;
+ *(uint16_t*)test->mem = *(uint16_t*)(base+offset);
+ test->memaddr = (uintptr_t)(base+offset);
+ return (reg64_t*)test->mem;
+ }
+}
+
mmx87_regs_t* GetEm(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
{
uint8_t m = v&0xC7; // filter Ed
@@ -1344,6 +1665,20 @@ mmx87_regs_t* GetEm(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_
} else return (mmx87_regs_t*)GetECommon(emu, addr, rex, m, delta);
}
+mmx87_regs_t* TestEm(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->mmx[m&0x07];
+ } else {
+ mmx87_regs_t* ret = (mmx87_regs_t*)GetECommon(test->emu, addr, rex, m, delta);
+ test->memsize = 8;
+ *(uint64_t*)test->mem = ret->q;
+ test->memaddr = (uintptr_t)ret;
+ return (mmx87_regs_t*)test->mem;
+ }
+}
+
sse_regs_t* GetEx(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
{
uint8_t m = v&0xC7; // filter Ed
@@ -1352,6 +1687,22 @@ sse_regs_t* GetEx(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t
} else return (sse_regs_t*)GetECommon(emu, addr, rex, m, delta);
}
+sse_regs_t* TestEx(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ test->memsize=0;
+ return &test->emu->xmm[(m&0x07)+(rex.b<<3)];
+ } else {
+ sse_regs_t* ret = (sse_regs_t*)GetECommon(test->emu, addr, rex, m, delta);
+ test->memsize = 16;
+ ((uint64_t*)test->mem)[0] = ret->q[0];
+ ((uint64_t*)test->mem)[1] = ret->q[1];
+ test->memaddr = (uintptr_t)ret;
+ return (sse_regs_t*)test->mem;
+ }
+}
+
sse_regs_t* GetExO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
{
uint8_t m = v&0xC7; // filter Ed
@@ -1360,6 +1711,21 @@ sse_regs_t* GetExO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t
} else return (sse_regs_t*)GetECommonO(emu, addr, rex, m, delta, offset);
}
+sse_regs_t* TestExO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->xmm[(m&0x07)+(rex.b<<3)];
+ } else {
+ sse_regs_t* ret = (sse_regs_t*)GetECommonO(test->emu, addr, rex, m, delta, offset);
+ test->memsize = 16;
+ ((uint64_t*)test->mem)[0] = ret->q[0];
+ ((uint64_t*)test->mem)[1] = ret->q[1];
+ test->memaddr = (uintptr_t)ret;
+ return (sse_regs_t*)test->mem;
+ }
+}
+
sse_regs_t* GetEx32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
{
uint8_t m = v&0xC7; // filter Ed
@@ -1368,6 +1734,21 @@ sse_regs_t* GetEx32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8
} else return (sse_regs_t*)GetECommon32O(emu, addr, rex, m, delta, offset);
}
+sse_regs_t* TestEx32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->xmm[(m&0x07)+(rex.b<<3)];
+ } else {
+ sse_regs_t* ret = (sse_regs_t*)GetECommon32O(test->emu, addr, rex, m, delta, offset);
+ test->memsize = 16;
+ ((uint64_t*)test->mem)[0] = ret->q[0];
+ ((uint64_t*)test->mem)[1] = ret->q[1];
+ test->memaddr = (uintptr_t)ret;
+ return (sse_regs_t*)test->mem;
+ }
+}
+
mmx87_regs_t* GetEm32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
{
uint8_t m = v&0xC7; // filter Ed
@@ -1376,6 +1757,19 @@ mmx87_regs_t* GetEm32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uin
} else return (mmx87_regs_t*)GetECommon32O(emu, addr, rex, m, delta, offset);
}
+mmx87_regs_t* TestEm32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
+{
+ uint8_t m = v&0xC7; // filter Ed
+ if(m>=0xC0) {
+ return &test->emu->mmx[(m&0x07)];
+ } else {
+ mmx87_regs_t* ret = (mmx87_regs_t*)GetECommon32O(test->emu, addr, rex, m, delta, offset);
+ test->memsize = 8;
+ *(uint64_t*)test->mem = ret->q;
+ test->memaddr = (uintptr_t)ret;
+ return (mmx87_regs_t*)test->mem;
+ }
+}
reg64_t* GetGd(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v)
{
diff --git a/src/emu/x64run_private.h b/src/emu/x64run_private.h
index c4704a7..dcda399 100755..100644
--- a/src/emu/x64run_private.h
+++ b/src/emu/x64run_private.h
@@ -4,34 +4,75 @@
#include <stdint.h>
#include "regs.h"
#include "x64emu_private.h"
+#include "box64context.h"
typedef struct x64emu_s x64emu_t;
-typedef union rex_s {
- uint8_t rex;
- struct {
- unsigned int b:1;
- unsigned int x:1;
- unsigned int r:1;
- unsigned int w:1;
- unsigned int s:4;
+typedef struct rex_s {
+ union {
+ uint8_t rex;
+ struct {
+ unsigned int b:1;
+ unsigned int x:1;
+ unsigned int r:1;
+ unsigned int w:1;
+ unsigned int s:4;
+ };
};
+ int is32bits;
} rex_t;
static inline uint8_t Peek(x64emu_t *emu, int offset){return *(uint8_t*)(R_RIP + offset);}
-static inline uint64_t Pop(x64emu_t *emu)
+#ifdef TEST_INTERPRETER
+#define Push16(E, V) do{E->regs[_SP].q[0] -=2; test->memsize = 2; *(uint16_t*)test->mem = (V); test->memaddr = E->regs[_SP].q[0];}while(0)
+#define Push32(E, V) do{E->regs[_SP].q[0] -=4; test->memsize = 4; *(uint32_t*)test->mem = (V); test->memaddr = E->regs[_SP].q[0];}while(0)
+#define Push64(E, V) do{E->regs[_SP].q[0] -=8; test->memsize = 8; *(uint64_t*)test->mem = (V); test->memaddr = E->regs[_SP].q[0];}while(0)
+#else
+static inline void Push16(x64emu_t *emu, uint16_t v)
{
- uint64_t* st = ((uint64_t*)(R_RSP));
- R_RSP += 8;
- return *st;
+ R_RSP -= 2;
+ *((uint16_t*)R_RSP) = v;
+}
+
+static inline void Push32(x64emu_t *emu, uint32_t v)
+{
+ R_RSP -= 4;
+ *((uint32_t*)R_RSP) = v;
}
-static inline void Push(x64emu_t *emu, uint64_t v)
+static inline void Push64(x64emu_t *emu, uint64_t v)
{
R_RSP -= 8;
*((uint64_t*)R_RSP) = v;
}
+#endif
+
+static inline uint16_t Pop16(x64emu_t *emu)
+{
+ uint16_t* st = (uint16_t*)R_RSP;
+ R_RSP += 2;
+ return *st;
+}
+
+static inline uint32_t Pop32(x64emu_t *emu)
+{
+ uint32_t* st = (uint32_t*)R_RSP;
+ R_RSP += 4;
+ return *st;
+}
+
+static inline uint64_t Pop64(x64emu_t *emu)
+{
+ uint64_t* st = (uint64_t*)R_RSP;
+ R_RSP += 8;
+ return *st;
+}
+static inline void PushExit(x64emu_t* emu)
+{
+ R_RSP -= 8;
+ *((uint64_t*)R_RSP) = my_context->exit_bridge;
+}
// the op code definition can be found here: http://ref.x86asm.net/geek32.html
@@ -39,24 +80,44 @@ reg64_t* GetECommon(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_
reg64_t* GetECommonO(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t offset);
reg64_t* GetECommon32O(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t offset);
reg64_t* GetEb(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
+reg64_t* TestEb(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
reg64_t* GetEbO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
+reg64_t* TestEbO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
reg64_t* GetEd(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
+reg64_t* TestEd(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
+reg64_t* TestEd4(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
+reg64_t* TestEd8(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
+reg64_t* TestEd8xw(x64test_t *test, int w, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
+reg64_t* TestEdt(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
+uintptr_t GetEA(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
reg64_t* GetEdO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
+reg64_t* TestEdO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
reg64_t* GetEd32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
+reg64_t* TestEd32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
reg64_t* GetEb32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
+reg64_t* TestEb32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
#define GetEw GetEd
+#define TestEw TestEd
#define GetEw32O GetEd32O
+#define TestEw32O TestEd32O
reg64_t* GetEw16(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v);
+reg64_t* TestEw16(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v);
reg64_t* GetEw16off(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uintptr_t offset);
+reg64_t* TestEw16off(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uintptr_t offset);
mmx87_regs_t* GetEm(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
+mmx87_regs_t* TestEm(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
sse_regs_t* GetEx(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
+sse_regs_t* TestEx(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta);
sse_regs_t* GetExO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
+sse_regs_t* TestExO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
sse_regs_t* GetEx32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
+sse_regs_t* TestEx32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
reg64_t* GetGd(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v);
#define GetGw GetGd
reg64_t* GetGb(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v);
mmx87_regs_t* GetGm(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v);
mmx87_regs_t* GetEm32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
+mmx87_regs_t* TestEm32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
sse_regs_t* GetGx(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v);
void UpdateFlags(x64emu_t *emu);
@@ -73,6 +134,8 @@ uintptr_t Run66D9(x64emu_t *emu, rex_t rex, uintptr_t addr);
uintptr_t Run66DD(x64emu_t *emu, rex_t rex, uintptr_t addr);
uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr);
uintptr_t Run67(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr);
+uintptr_t Run67_32(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr);
+uintptr_t Run6764_32(x64emu_t *emu, rex_t rex, int rep, int seg, uintptr_t addr);
uintptr_t Run670F(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr);
uintptr_t Run6766(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr);
uintptr_t Run67660F(x64emu_t *emu, rex_t rex, uintptr_t addr);
@@ -88,9 +151,37 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr);
uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step);
uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr);
+uintptr_t Test0F(x64test_t *test, rex_t rex, uintptr_t addr, int *step);
+uintptr_t Test64(x64test_t *test, rex_t rex, int seg, uintptr_t addr);
+uintptr_t Test66(x64test_t *test, rex_t rex, int rep, uintptr_t addr);
+uintptr_t Test660F(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t Test6664(x64test_t *test, rex_t rex, int seg, uintptr_t addr);
+uintptr_t Test66D9(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t Test66DD(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t Test66F0(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t Test67(x64test_t *test, rex_t rex, int rep, uintptr_t addr);
+uintptr_t Test67_32(x64test_t *test, rex_t rex, int rep, uintptr_t addr);
+uintptr_t Test6764_32(x64test_t *test, rex_t rex, int rep, int seg, uintptr_t addr);
+uintptr_t Test670F(x64test_t *test, rex_t rex, int rep, uintptr_t addr);
+uintptr_t Test6766(x64test_t *test, rex_t rex, int rep, uintptr_t addr);
+uintptr_t Test67660F(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t TestD8(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t TestD9(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t TestDA(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t TestDB(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t TestDC(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t TestDD(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t TestDE(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t TestDF(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t TestF0(x64test_t *test, rex_t rex, uintptr_t addr);
+uintptr_t TestF20F(x64test_t *test, rex_t rex, uintptr_t addr, int *step);
+uintptr_t TestF30F(x64test_t *test, rex_t rex, uintptr_t addr);
+
+
void x64Syscall(x64emu_t *emu);
void x64Int3(x64emu_t* emu, uintptr_t* addr);
x64emu_t* x64emu_fork(x64emu_t* e, int forktype);
+void x86Syscall(x64emu_t *emu); //32bits syscall
uintptr_t GetSegmentBaseEmu(x64emu_t* emu, int seg);
#define GetGSBaseEmu(emu) GetSegmentBaseEmu(emu, _GS)
diff --git a/src/emu/x64rund8.c b/src/emu/x64rund8.c
index 1f851bb..c44ca5b 100644
--- a/src/emu/x64rund8.c
+++ b/src/emu/x64rund8.c
@@ -22,11 +22,18 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestD8(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t nextop;
float f;
reg64_t *oped;
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
nextop = F8;
switch (nextop) {
@@ -115,36 +122,36 @@ uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr)
default:
switch((nextop>>3)&7) {
case 0: /* FADD ST0, float */
- GETED(0);
+ GETE4(0);
ST0.d += *(float*)ED;
break;
case 1: /* FMUL ST0, float */
- GETED(0);
+ GETE4(0);
ST0.d *= *(float*)ED;
break;
case 2: /* FCOM ST0, float */
- GETED(0);
+ GETE4(0);
fpu_fcom(emu, *(float*)ED);
break;
case 3: /* FCOMP */
- GETED(0);
+ GETE4(0);
fpu_fcom(emu, *(float*)ED);
fpu_do_pop(emu);
break;
case 4: /* FSUB ST0, float */
- GETED(0);
+ GETE4(0);
ST0.d -= *(float*)ED;
break;
case 5: /* FSUBR ST0, float */
- GETED(0);
+ GETE4(0);
ST0.d = *(float*)ED - ST0.d;
break;
case 6: /* FDIV ST0, float */
- GETED(0);
+ GETE4(0);
ST0.d /= *(float*)ED;
break;
case 7: /* FDIVR ST0, float */
- GETED(0);
+ GETE4(0);
ST0.d = *(float*)ED / ST0.d;
break;
default:
diff --git a/src/emu/x64rund9.c b/src/emu/x64rund9.c
index e50f5bf..1b097f9 100644
--- a/src/emu/x64rund9.c
+++ b/src/emu/x64rund9.c
@@ -22,13 +22,20 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestD9(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t RunD9(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t nextop;
int32_t tmp32s;
uint64_t ll;
float f;
reg64_t *oped;
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
nextop = F8;
switch (nextop) {
@@ -230,22 +237,22 @@ uintptr_t RunD9(x64emu_t *emu, rex_t rex, uintptr_t addr)
default:
switch((nextop>>3)&7) {
case 0: /* FLD ST0, Ed float */
- GETED(0);
+ GETE4(0);
fpu_do_push(emu);
ST0.d = *(float*)ED;
break;
case 2: /* FST Ed, ST0 */
- GETED(0);
+ GETE4(0);
*(float*)ED = ST0.d;
break;
case 3: /* FSTP Ed, ST0 */
- GETED(0);
+ GETE4(0);
*(float*)ED = ST0.d;
fpu_do_pop(emu);
break;
case 4: /* FLDENV m */
// warning, incomplete
- GETED(0);
+ _GETED(0);
fpu_loadenv(emu, (char*)ED, 0);
break;
case 5: /* FLDCW Ew */
@@ -255,8 +262,10 @@ uintptr_t RunD9(x64emu_t *emu, rex_t rex, uintptr_t addr)
break;
case 6: /* FNSTENV m */
// warning, incomplete
- GETED(0);
+ _GETED(0);
+ #ifndef TEST_INTERPRETER
fpu_savenv(emu, (char*)ED, 0);
+ #endif
// intruction pointer: 48bits
// data (operand) pointer: 48bits
// last opcode: 11bits save: 16bits restaured (1st and 2nd opcode only)
diff --git a/src/emu/x64runda.c b/src/emu/x64runda.c
index 8a0f793..bb678a8 100644
--- a/src/emu/x64runda.c
+++ b/src/emu/x64runda.c
@@ -22,10 +22,17 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestDA(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t RunDA(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t nextop;
reg64_t *oped;
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
nextop = F8;
switch (nextop) {
@@ -98,36 +105,36 @@ uintptr_t RunDA(x64emu_t *emu, rex_t rex, uintptr_t addr)
default:
switch((nextop>>3)&7) {
case 0: /* FIADD ST0, Ed int */
- GETED(0);
+ GETE4(0);
ST0.d += ED->sdword[0];
break;
case 1: /* FIMUL ST0, Ed int */
- GETED(0);
+ GETE4(0);
ST0.d *= ED->sdword[0];
break;
case 2: /* FICOM ST0, Ed int */
- GETED(0);
+ GETE4(0);
fpu_fcom(emu, ED->sdword[0]);
break;
case 3: /* FICOMP ST0, Ed int */
- GETED(0);
+ GETE4(0);
fpu_fcom(emu, ED->sdword[0]);
fpu_do_pop(emu);
break;
case 4: /* FISUB ST0, Ed int */
- GETED(0);
+ GETE4(0);
ST0.d -= ED->sdword[0];
break;
case 5: /* FISUBR ST0, Ed int */
- GETED(0);
+ GETE4(0);
ST0.d = (double)ED->sdword[0] - ST0.d;
break;
case 6: /* FIDIV ST0, Ed int */
- GETED(0);
+ GETE4(0);
ST0.d /= ED->sdword[0];
break;
case 7: /* FIDIVR ST0, Ed int */
- GETED(0);
+ GETE4(0);
ST0.d = (double)ED->sdword[0] / ST0.d;
break;
}
diff --git a/src/emu/x64rundb.c b/src/emu/x64rundb.c
index 5791b58..ad5952b 100644
--- a/src/emu/x64rundb.c
+++ b/src/emu/x64rundb.c
@@ -22,11 +22,18 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestDB(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t RunDB(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t nextop;
int32_t tmp32s;
reg64_t *oped;
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
nextop = F8;
switch(nextop) {
@@ -127,21 +134,21 @@ uintptr_t RunDB(x64emu_t *emu, rex_t rex, uintptr_t addr)
default:
switch((nextop>>3)&7) {
case 0: /* FILD ST0, Ed */
- GETED(0);
+ GETE4(0);
fpu_do_push(emu);
ST0.d = ED->sdword[0];
break;
case 1: /* FISTTP Ed, ST0 */
- GETED(0);
- if(isgreater(ST0.d, (double)(int32_t)0x7fffffff) || isless(ST0.d, (double)(int32_t)0x80000000) || !isfinite(ST0.d))
+ GETE4(0);
+ if(isgreater(ST0.d, (double)0x7fffffff) || isless(ST0.d, -(double)0x80000000U) || !isfinite(ST0.d))
ED->sdword[0] = 0x80000000;
else
ED->sdword[0] = ST0.d;
fpu_do_pop(emu);
break;
case 2: /* FIST Ed, ST0 */
- GETED(0);
- if(isgreater(ST0.d, (double)(int32_t)0x7fffffff) || isless(ST0.d, (double)(int32_t)0x80000000) || !isfinite(ST0.d))
+ GETE4(0);
+ if(isgreater(ST0.d, (double)0x7fffffff) || isless(ST0.d, -(double)0x80000000U) || !isfinite(ST0.d))
ED->sdword[0] = 0x80000000;
else {
volatile int32_t tmp = fpu_round(emu, ST0.d); // tmp to avoid BUS ERROR
@@ -149,8 +156,8 @@ uintptr_t RunDB(x64emu_t *emu, rex_t rex, uintptr_t addr)
}
break;
case 3: /* FISTP Ed, ST0 */
- GETED(0);
- if(isgreater(ST0.d, (double)(int32_t)0x7fffffff) || isless(ST0.d, (double)(int32_t)0x80000000) || !isfinite(ST0.d))
+ GETE4(0);
+ if(isgreater(ST0.d, (double)0x7fffffff) || isless(ST0.d, -(double)0x80000000U) || !isfinite(ST0.d))
ED->sdword[0] = 0x80000000;
else {
volatile int32_t tmp = fpu_round(emu, ST0.d); // tmp to avoid BUS ERROR
@@ -159,14 +166,14 @@ uintptr_t RunDB(x64emu_t *emu, rex_t rex, uintptr_t addr)
fpu_do_pop(emu);
break;
case 5: /* FLD ST0, Et */
- GETED(0);
+ GETET(0);
fpu_do_push(emu);
memcpy(&STld(0).ld, ED, 10);
LD2D(&STld(0), &ST(0).d);
STld(0).uref = ST0.q;
break;
case 7: /* FSTP tbyte */
- GETED(0);
+ GETET(0);
if(ST0.q!=STld(0).uref)
D2LD(&ST0.d, ED);
else
diff --git a/src/emu/x64rundc.c b/src/emu/x64rundc.c
index dbe4d45..0893113 100644
--- a/src/emu/x64rundc.c
+++ b/src/emu/x64rundc.c
@@ -22,10 +22,17 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestDC(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t RunDC(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t nextop;
reg64_t *oped;
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
nextop = F8;
switch(nextop) {
@@ -111,7 +118,7 @@ uintptr_t RunDC(x64emu_t *emu, rex_t rex, uintptr_t addr)
ST(nextop&7).d /= ST0.d;
break;
default:
- GETED(0);
+ GETE8(0);
switch((nextop>>3)&7) {
case 0: /* FADD ST0, double */
ST0.d += *(double*)ED;
diff --git a/src/emu/x64rundd.c b/src/emu/x64rundd.c
index abb18f7..fc65f01 100644
--- a/src/emu/x64rundd.c
+++ b/src/emu/x64rundd.c
@@ -22,10 +22,17 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestDD(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t RunDD(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t nextop;
reg64_t *oped;
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
nextop = F8;
switch (nextop) {
@@ -112,26 +119,33 @@ uintptr_t RunDD(x64emu_t *emu, rex_t rex, uintptr_t addr)
default:
switch((nextop>>3)&7) {
case 0: /* FLD double */
- GETED(0);
+ GETE8(0);
fpu_do_push(emu);
ST0.d = *(double*)ED;
break;
case 1: /* FISTTP ED qword */
- GETED(0);
- *(int64_t*)ED = ST0.d;
+ GETE8(0);
+ if(STll(0).sref==ST(0).sq)
+ ED->sq[0] = STll(0).sq;
+ else {
+ if(isgreater(ST0.d, (double)0x7fffffffffffffffLL) || isless(ST0.d, -(double)0x8000000000000000LL) || !isfinite(ST0.d))
+ *(uint64_t*)ED = 0x8000000000000000LL;
+ else
+ *(int64_t*)ED = ST0.d;
+ }
fpu_do_pop(emu);
break;
case 2: /* FST double */
- GETED(0);
+ GETE8(0);
*(double*)ED = ST0.d;
break;
case 3: /* FSTP double */
- GETED(0);
+ GETE8(0);
*(double*)ED = ST0.d;
fpu_do_pop(emu);
break;
case 4: /* FRSTOR m108byte */
- GETED(0);
+ _GETED(0);
fpu_loadenv(emu, (char*)ED, 0);
// get the STx
{
@@ -144,9 +158,10 @@ uintptr_t RunDD(x64emu_t *emu, rex_t rex, uintptr_t addr)
}
break;
case 6: /* FNSAVE m108byte */
- GETED(0);
+ _GETED(0);
// ENV first...
// warning, incomplete
+ #ifndef TEST_INTERPRETER
fpu_savenv(emu, (char*)ED, 0);
// save the STx
{
@@ -157,10 +172,11 @@ uintptr_t RunDD(x64emu_t *emu, rex_t rex, uintptr_t addr)
p+=10;
}
}
+ #endif
reset_fpu(emu);
break;
case 7: /* FNSTSW m2byte */
- GETED(0);
+ GETEW(0);
emu->sw.f.F87_TOP = emu->top&7;
*(uint16_t*)ED = emu->sw.x16;
break;
diff --git a/src/emu/x64runde.c b/src/emu/x64runde.c
index 4911be3..4ec5828 100644
--- a/src/emu/x64runde.c
+++ b/src/emu/x64runde.c
@@ -22,10 +22,17 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestDE(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t RunDE(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t nextop;
reg64_t *oped;
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
nextop = F8;
switch(nextop) {
diff --git a/src/emu/x64rundf.c b/src/emu/x64rundf.c
index 657c1a4..d707863 100644
--- a/src/emu/x64rundf.c
+++ b/src/emu/x64rundf.c
@@ -22,12 +22,19 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestDF(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t RunDF(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t nextop;
int16_t tmp16s;
int64_t tmp64s;
reg64_t *oped;
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
nextop = F8;
switch(nextop) {
@@ -124,7 +131,10 @@ uintptr_t RunDF(x64emu_t *emu, rex_t rex, uintptr_t addr)
case 1: /* FISTTP Ew, ST0 */
GETEW(0);
tmp16s = ST0.d;
- EW->sword[0] = tmp16s;
+ if(isgreater(ST0.d, (double)(int32_t)0x7fff) || isless(ST0.d, -(double)(int32_t)0x8000) || !isfinite(ST0.d))
+ EW->sword[0] = 0x8000;
+ else
+ EW->sword[0] = tmp16s;
fpu_do_pop(emu);
break;
case 2: /* FIST Ew, ST0 */
@@ -143,12 +153,12 @@ uintptr_t RunDF(x64emu_t *emu, rex_t rex, uintptr_t addr)
fpu_do_pop(emu);
break;
case 4: /* FBLD ST0, tbytes */
- GETED(0);
+ GETET(0);
fpu_do_push(emu);
fpu_fbld(emu, (uint8_t*)ED);
break;
case 5: /* FILD ST0, Gq */
- GETED(0);
+ GETE8(0);
tmp64s = ED->sq[0];
fpu_do_push(emu);
ST0.d = tmp64s;
@@ -156,16 +166,16 @@ uintptr_t RunDF(x64emu_t *emu, rex_t rex, uintptr_t addr)
STll(0).sref = ST0.sq;
break;
case 6: /* FBSTP tbytes, ST0 */
- GETED(0);
+ GETET(0);
fpu_fbst(emu, (uint8_t*)ED);
fpu_do_pop(emu);
break;
case 7: /* FISTP i64 */
- GETED(0);
+ GETE8(0);
if(STll(0).sref==ST(0).sq)
ED->sq[0] = STll(0).sq;
else {
- if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, (double)(int64_t)0x8000000000000000LL) || !isfinite(ST0.d))
+ if(isgreater(ST0.d, (double)0x7fffffffffffffffLL) || isless(ST0.d, -(double)0x8000000000000000LL) || !isfinite(ST0.d))
ED->sq[0] = 0x8000000000000000LL;
else
ED->sq[0] = fpu_round(emu, ST0.d);
diff --git a/src/emu/x64runf0.c b/src/emu/x64runf0.c
index 13eed9a..e1dbace 100644
--- a/src/emu/x64runf0.c
+++ b/src/emu/x64runf0.c
@@ -26,7 +26,11 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestF0(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t opcode;
uint8_t nextop;
@@ -36,17 +40,24 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
int64_t tmp64s;
uint64_t tmp64u, tmp64u2;
reg64_t *oped, *opgd;
+ #ifdef USE_CAS
+ uint64_t tmpcas;
+ #endif
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
opcode = F8;
// REX prefix before the F0 are ignored
rex.rex = 0;
- while(opcode>=0x40 && opcode<=0x4f) {
- rex.rex = opcode;
- opcode = F8;
- }
+ if(!rex.is32bits)
+ while(opcode>=0x40 && opcode<=0x4f) {
+ rex.rex = opcode;
+ opcode = F8;
+ }
switch(opcode) {
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
#define GO(B, OP) \
case B+0: \
nextop = F8; \
@@ -105,15 +116,15 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
nextop = F8; \
GETEB(0); \
GETGB; \
- pthread_mutex_lock(&emu->context->mutex_lock); \
+ pthread_mutex_lock(&my_context->mutex_lock); \
EB->byte[0] = OP##8(emu, EB->byte[0], GB); \
- pthread_mutex_unlock(&emu->context->mutex_lock); \
+ pthread_mutex_unlock(&my_context->mutex_lock); \
break; \
case B+1: \
nextop = F8; \
GETED(0); \
GETGD; \
- pthread_mutex_lock(&emu->context->mutex_lock); \
+ pthread_mutex_lock(&my_context->mutex_lock); \
if(rex.w) \
ED->q[0] = OP##64(emu, ED->q[0], GD->q[0]); \
else \
@@ -121,39 +132,39 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
ED->q[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \
else \
ED->dword[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \
- pthread_mutex_unlock(&emu->context->mutex_lock); \
+ pthread_mutex_unlock(&my_context->mutex_lock); \
break; \
case B+2: \
nextop = F8; \
GETEB(0); \
GETGB; \
- pthread_mutex_lock(&emu->context->mutex_lock); \
+ pthread_mutex_lock(&my_context->mutex_lock); \
GB = OP##8(emu, GB, EB->byte[0]); \
- pthread_mutex_unlock(&emu->context->mutex_lock); \
+ pthread_mutex_unlock(&my_context->mutex_lock); \
break; \
case B+3: \
nextop = F8; \
GETED(0); \
GETGD; \
- pthread_mutex_lock(&emu->context->mutex_lock); \
+ pthread_mutex_lock(&my_context->mutex_lock); \
if(rex.w) \
GD->q[0] = OP##64(emu, GD->q[0], ED->q[0]); \
else \
GD->q[0] = OP##32(emu, GD->dword[0], ED->dword[0]); \
- pthread_mutex_unlock(&emu->context->mutex_lock); \
+ pthread_mutex_unlock(&my_context->mutex_lock); \
break; \
case B+4: \
- pthread_mutex_lock(&emu->context->mutex_lock); \
+ pthread_mutex_lock(&my_context->mutex_lock); \
R_AL = OP##8(emu, R_AL, F8); \
- pthread_mutex_unlock(&emu->context->mutex_lock); \
+ pthread_mutex_unlock(&my_context->mutex_lock); \
break; \
case B+5: \
- pthread_mutex_lock(&emu->context->mutex_lock); \
+ pthread_mutex_lock(&my_context->mutex_lock); \
if(rex.w) \
R_RAX = OP##64(emu, R_RAX, F32S64); \
else \
R_RAX = OP##32(emu, R_EAX, F32); \
- pthread_mutex_unlock(&emu->context->mutex_lock); \
+ pthread_mutex_unlock(&my_context->mutex_lock); \
break;
#endif
GO(0x00, add) /* ADD 0x00 -> 0x05 */
@@ -178,9 +189,17 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
tmp64s >>= (rex.w?6:5);
if(!MODREG)
{
+ #ifdef TEST_INTERPRETER
+ test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:2)));
+ if(rex.w)
+ *(uint64_t*)test->mem = *(uint64_t*)test->memaddr;
+ else
+ *(uint32_t*)test->mem = *(uint32_t*)test->memaddr;
+ #else
ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2)));
+ #endif
}
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w) {
tmp8u&=63;
if(MODREG) {
@@ -226,7 +245,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
} while(tmp32s);
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
tmp8u&=63;
if(ED->q[0] & (1LL<<tmp8u))
@@ -246,7 +265,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
if(MODREG)
ED->dword[1] = 0;
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
@@ -255,7 +274,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
nextop = F8;
GETGB;
GETEB(0);
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
do {
tmp8u = native_lock_read_b(EB);
cmp8(emu, R_AL, tmp8u);
@@ -267,21 +286,21 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
}
} while(tmp32s);
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
cmp8(emu, R_AL, EB->byte[0]);
if(ACCESS_FLAG(F_ZF)) {
EB->byte[0] = GB;
} else {
R_AL = EB->byte[0];
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 0xB1: /* CMPXCHG Ed,Gd */
nextop = F8;
GETED(0);
GETGD;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w)
if(((uintptr_t)ED)&7) {
do {
@@ -324,7 +343,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
ED->dword[1] = 0;
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
cmp64(emu, R_RAX, ED->q[0]);
if(ACCESS_FLAG(F_ZF)) {
@@ -343,7 +362,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
if(MODREG)
ED->dword[1] = 0;
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
@@ -357,10 +376,18 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
tmp64s >>= (rex.w?6:5);
if(!MODREG)
{
+ #ifdef TEST_INTERPRETER
+ test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:2)));
+ if(rex.w)
+ *(uint64_t*)test->mem = *(uint64_t*)test->memaddr;
+ else
+ *(uint32_t*)test->mem = *(uint32_t*)test->memaddr;
+ #else
ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2)));
+ #endif
}
tmp8u&=rex.w?63:31;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w)
do {
tmp64u = native_lock_read_dd(ED);
@@ -389,7 +416,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
ED->dword[1] = 0;
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
if(ED->q[0] & (1<<tmp8u)) {
SET_FLAG(F_CF);
@@ -405,7 +432,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
if(MODREG)
ED->dword[1] = 0;
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
@@ -434,7 +461,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
CHECK_FLAGS(emu);
GETED(1);
tmp8u = F8;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w) {
tmp8u&=63;
do {
@@ -463,7 +490,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
} while(tmp32s);
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
tmp8u&=63;
if(ED->q[0] & (1LL<<tmp8u)) {
@@ -481,14 +508,14 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
CLEAR_FLAG(F_CF);
}
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 6: /* BTR Ed, Ib */
CHECK_FLAGS(emu);
GETED(1);
tmp8u = F8;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w) {
do {
tmp8u&=63;
@@ -517,7 +544,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
} while(tmp32s);
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
tmp8u&=63;
if(ED->q[0] & (1LL<<tmp8u)) {
@@ -533,14 +560,14 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
} else
CLEAR_FLAG(F_CF);
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 7: /* BTC Ed, Ib */
CHECK_FLAGS(emu);
GETED(1);
tmp8u = F8;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w) {
tmp8u&=63;
do {
@@ -565,7 +592,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
} while(tmp32s);
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
tmp8u&=63;
if(ED->q[0] & (1LL<<tmp8u))
@@ -581,7 +608,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
CLEAR_FLAG(F_CF);
ED->dword[0] ^= (1<<tmp8u);
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
@@ -594,25 +621,25 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
nextop = F8;
GETEB(0);
GETGB;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
do {
tmp8u = native_lock_read_b(EB);
tmp8u2 = add8(emu, tmp8u, GB);
} while(native_lock_write_b(EB, tmp8u2));
GB = tmp8u;
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
tmp8u = add8(emu, EB->byte[0], GB);
GB = EB->byte[0];
EB->byte[0] = tmp8u;
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 0xC1: /* XADD Gd,Ed */
nextop = F8;
GETED(0);
GETGD;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w) {
do {
tmp64u = native_lock_read_dd(ED);
@@ -638,7 +665,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
ED->dword[1] = 0;
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
tmp64u = add64(emu, ED->q[0], GD->q[0]);
GD->q[0] = ED->q[0];
@@ -651,18 +678,18 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
else
ED->dword[0] = tmp32u;
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 0xC7: /* CMPXCHG8B Gq */
nextop = F8;
- GETED(0);
+ GETE8xw(0);
switch((nextop>>3)&7) {
case 1:
CHECK_FLAGS(emu);
GETGD;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w)
do {
native_lock_read_dq(&tmp64u, &tmp64u2, ED);
@@ -690,8 +717,11 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
}
} while(tmp32s);
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
+ #ifdef TEST_INTERPRETER
+ test->memsize = 16;
+ #endif
tmp64u = ED->q[0];
tmp64u2= ED->q[1];
if(R_RAX == tmp64u && R_RDX == tmp64u2) {
@@ -704,6 +734,9 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
R_RDX = tmp64u2;
}
} else {
+ #ifdef TEST_INTERPRETER
+ test->memsize = 8;
+ #endif
tmp32u = ED->dword[0];
tmp32u2= ED->dword[1];
if(R_EAX == tmp32u && R_EDX == tmp32u2) {
@@ -716,7 +749,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
R_RDX = tmp32u2;
}
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
default:
@@ -730,13 +763,17 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
break;
case 0x66:
+ #ifdef TEST_INTERPRETER
+ return Test66F0(test, rex, addr);
+ #else
return Run66F0(emu, rex, addr); // more opcode F0 66 and 66 F0 is the same
+ #endif
case 0x80: /* GRP Eb,Ib */
nextop = F8;
GETEB(1);
tmp8u = F8;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
switch((nextop>>3)&7) {
case 0: do { tmp8u2 = native_lock_read_b(EB); tmp8u2 = add8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break;
case 1: do { tmp8u2 = native_lock_read_b(EB); tmp8u2 = or8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break;
@@ -748,7 +785,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
case 7: cmp8(emu, EB->byte[0], tmp8u); break;
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
switch((nextop>>3)&7) {
case 0: EB->byte[0] = add8(emu, EB->byte[0], tmp8u); break;
case 1: EB->byte[0] = or8(emu, EB->byte[0], tmp8u); break;
@@ -759,7 +796,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
case 6: EB->byte[0] = xor8(emu, EB->byte[0], tmp8u); break;
case 7: cmp8(emu, EB->byte[0], tmp8u); break;
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 0x81: /* GRP Ed,Id */
@@ -771,7 +808,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
tmp64u = (uint64_t)tmp64s;
} else
tmp64u = F32S64;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w) {
switch((nextop>>3)&7) {
case 0: do { tmp64u2 = native_lock_read_dd(ED); tmp64u2 = add64(emu, tmp64u2, tmp64u);} while(native_lock_write_dd(ED, tmp64u2)); break;
@@ -808,7 +845,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
}
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
switch((nextop>>3)&7) {
case 0: ED->q[0] = add64(emu, ED->q[0], tmp64u); break;
@@ -844,13 +881,13 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
case 7: cmp32(emu, ED->dword[0], tmp64u); break;
}
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 0x86: /* XCHG Eb,Gb */
nextop = F8;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
GETEB(0);
GETGB;
if(MODREG) { // reg / reg: no lock
@@ -867,17 +904,17 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
GETEB(0);
GETGB;
if(!MODREG)
- pthread_mutex_lock(&emu->context->mutex_lock); // XCHG always LOCK (but when accessing memory only)
+ pthread_mutex_lock(&my_context->mutex_lock); // XCHG always LOCK (but when accessing memory only)
tmp8u = GB;
GB = EB->byte[0];
EB->byte[0] = tmp8u;
if(!MODREG)
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 0x87: /* XCHG Ed,Gd */
nextop = F8;
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
GETED(0);
GETGD;
if(MODREG) {
@@ -892,7 +929,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
}
} else {
if(rex.w) {
- GD->q[0] = native_lock_xchg(ED, GD->q[0]);
+ GD->q[0] = native_lock_xchg_dd(ED, GD->q[0]);
} else {
GD->dword[0] = native_lock_xchg_d(ED, GD->dword[0]);
}
@@ -900,7 +937,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
#else
GETED(0);
GETGD;
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
tmp64u = GD->q[0];
GD->q[0] = ED->q[0];
@@ -913,7 +950,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
else
ED->dword[0] = tmp32u;
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
@@ -923,15 +960,15 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
GETEB((tmp8u<2)?1:0);
switch(tmp8u) {
case 2: /* NOT Eb */
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
do {
tmp8u2 = native_lock_read_b(EB);
tmp8u2 = not8(emu, tmp8u2);
} while(native_lock_write_b(EB, tmp8u2));
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
EB->byte[0] = not8(emu, EB->byte[0]);
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
default:
@@ -944,25 +981,25 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
GETED(0);
switch((nextop>>3)&7) {
case 0: /* INC Eb */
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
do {
tmp8u = native_lock_read_b(ED);
} while(native_lock_write_b(ED, inc8(emu, tmp8u)));
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
ED->byte[0] = inc8(emu, ED->byte[0]);
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 1: /* DEC Ed */
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
do {
tmp8u = native_lock_read_b(ED);
} while(native_lock_write_b(ED, dec8(emu, tmp8u)));
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
ED->byte[0] = dec8(emu, ED->byte[0]);
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
default:
@@ -977,7 +1014,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
GETED(0);
switch((nextop>>3)&7) {
case 0: /* INC Ed */
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w)
if(((uintptr_t)ED)&7) {
// unaligned
@@ -1010,7 +1047,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
if(MODREG) ED->dword[1] = 0;
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
ED->q[0] = inc64(emu, ED->q[0]);
} else {
@@ -1019,11 +1056,11 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
else
ED->dword[0] = inc32(emu, ED->dword[0]);
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
case 1: /* DEC Ed */
-#ifdef DYNAREC
+#if defined(DYNAREC) && !defined(TEST_INTERPRETER)
if(rex.w)
if(((uintptr_t)ED)&7) {
// unaligned
@@ -1045,7 +1082,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
if(MODREG) ED->dword[1] = 0;
}
#else
- pthread_mutex_lock(&emu->context->mutex_lock);
+ pthread_mutex_lock(&my_context->mutex_lock);
if(rex.w) {
ED->q[0] = dec64(emu, ED->q[0]);
} else {
@@ -1054,7 +1091,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
else
ED->dword[0] = dec32(emu, ED->dword[0]);
}
- pthread_mutex_unlock(&emu->context->mutex_lock);
+ pthread_mutex_unlock(&my_context->mutex_lock);
#endif
break;
default:
diff --git a/src/emu/x64runf20f.c b/src/emu/x64runf20f.c
index a2c0e8e..3375031 100644
--- a/src/emu/x64runf20f.c
+++ b/src/emu/x64runf20f.c
@@ -22,19 +22,27 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestF20F(x64test_t *test, rex_t rex, uintptr_t addr, int *step)
+#else
uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
+#endif
{
uint8_t opcode;
uint8_t nextop;
int8_t tmp8s;
uint8_t tmp8u;
int32_t tmp32s;
+ int64_t tmp64s0, tmp64s1;
reg64_t *oped, *opgd;
sse_regs_t *opex, *opgx, eax1;
mmx87_regs_t *opgm;
#ifndef NOALIGN
int is_nan;
#endif
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
opcode = F8;
@@ -197,6 +205,8 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
nextop = F8;
GETEX(0);
GETGX;
+ if (GX->d[0] == 0.0 && EX->d[0] == 0.0)
+ GX->d[0] = EX->d[0];
if (isnan(GX->d[0]) || isnan(EX->d[0]) || isless(EX->d[0], GX->d[0]))
GX->d[0] = EX->d[0];
break;
@@ -217,6 +227,8 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
nextop = F8;
GETEX(0);
GETGX;
+ if (GX->d[0] == 0.0 && EX->d[0] == 0.0)
+ GX->d[0] = EX->d[0];
if (isnan(GX->d[0]) || isnan(EX->d[0]) || isgreater(EX->d[0], GX->d[0]))
GX->d[0] = EX->d[0];
break;
@@ -314,22 +326,33 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
GETGX;
switch(emu->mxcsr.f.MXCSR_RC) {
case ROUND_Nearest:
- GX->sd[0] = nearbyint(EX->d[0]);
- GX->sd[1] = nearbyint(EX->d[1]);
+ tmp64s0 = nearbyint(EX->d[0]);
+ tmp64s1 = nearbyint(EX->d[1]);
break;
case ROUND_Down:
- GX->sd[0] = floor(EX->d[0]);
- GX->sd[1] = floor(EX->d[1]);
+ tmp64s0 = floor(EX->d[0]);
+ tmp64s1 = floor(EX->d[1]);
break;
case ROUND_Up:
- GX->sd[0] = ceil(EX->d[0]);
- GX->sd[1] = ceil(EX->d[1]);
+ tmp64s0 = ceil(EX->d[0]);
+ tmp64s1 = ceil(EX->d[1]);
break;
case ROUND_Chop:
- GX->sd[0] = EX->d[0];
- GX->sd[1] = EX->d[1];
+ tmp64s0 = EX->d[0];
+ tmp64s1 = EX->d[1];
break;
}
+ if (tmp64s0==(int32_t)tmp64s0 && !isnan(EX->d[0])) {
+ GX->sd[0] = (int32_t)tmp64s0;
+ } else {
+ GX->sd[0] = INT32_MIN;
+ }
+ if (tmp64s1==(int32_t)tmp64s1 && !isnan(EX->d[1])) {
+ GX->sd[1] = (int32_t)tmp64s1;
+ } else {
+ GX->sd[1] = INT32_MIN;
+ }
+
GX->q[1] = 0;
break;
@@ -344,4 +367,4 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
return 0;
}
return addr;
-} \ No newline at end of file
+}
diff --git a/src/emu/x64runf30f.c b/src/emu/x64runf30f.c
index acfd789..d5b70b2 100644
--- a/src/emu/x64runf30f.c
+++ b/src/emu/x64runf30f.c
@@ -22,17 +22,25 @@
#include "modrm.h"
+#ifdef TEST_INTERPRETER
+uintptr_t TestF30F(x64test_t *test, rex_t rex, uintptr_t addr)
+#else
uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr)
+#endif
{
uint8_t opcode;
uint8_t nextop;
int8_t tmp8s;
uint8_t tmp8u;
uint32_t tmp32u;
+ int64_t tmp64s;
uint64_t tmp64u;
reg64_t *oped, *opgd;
sse_regs_t *opex, *opgx, eax1;
mmx87_regs_t *opem;
+ #ifdef TEST_INTERPRETER
+ x64emu_t*emu = test->emu;
+ #endif
opcode = F8;
@@ -89,12 +97,12 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr)
nextop = F8;
GETEX(0);
GETGD;
- if (rex.w)
- if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>0x7fffffffffffffffLL)
+ if (rex.w) {
+ if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>(float)0x7fffffffffffffffLL)
GD->q[0] = 0x8000000000000000LL;
else
GD->sq[0] = EX->f[0];
- else {
+ } else {
if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>0x7fffffff)
GD->dword[0] = 0x80000000;
else
@@ -107,7 +115,7 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr)
GETEX(0);
GETGD;
if(rex.w) {
- if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>0x7fffffffffffffffLL)
+ if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>(float)0x7fffffffffffffffLL)
GD->q[0] = 0x8000000000000000LL;
else
switch(emu->mxcsr.f.MXCSR_RC) {
@@ -125,23 +133,27 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr)
break;
}
} else {
- if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>0x7fffffff)
- GD->dword[0] = 0x80000000;
+ if(isnanf(EX->f[0]))
+ tmp64s = INT32_MIN;
else
switch(emu->mxcsr.f.MXCSR_RC) {
case ROUND_Nearest:
- GD->sdword[0] = nearbyintf(EX->f[0]);
+ tmp64s = nearbyintf(EX->f[0]);
break;
case ROUND_Down:
- GD->sdword[0] = floorf(EX->f[0]);
+ tmp64s = floorf(EX->f[0]);
break;
case ROUND_Up:
- GD->sdword[0] = ceilf(EX->f[0]);
+ tmp64s = ceilf(EX->f[0]);
break;
case ROUND_Chop:
- GD->sdword[0] = EX->f[0];
+ tmp64s = EX->f[0];
break;
}
+ if (tmp64s==(int32_t)tmp64s)
+ GD->sdword[0] = (int32_t)tmp64s;
+ else
+ GD->sdword[0] = INT32_MIN;
GD->dword[1] = 0;
}
break;
@@ -187,10 +199,17 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr)
nextop = F8;
GETEX(0);
GETGX;
- GX->sd[0] = EX->f[0];
- GX->sd[1] = EX->f[1];
- GX->sd[2] = EX->f[2];
- GX->sd[3] = EX->f[3];
+ for(int i=0; i<4; ++i) {
+ if(isnanf(EX->f[i]))
+ tmp64s = INT32_MIN;
+ else
+ tmp64s = EX->f[i];
+ if (tmp64s==(int32_t)tmp64s) {
+ GX->sd[i] = (int32_t)tmp64s;
+ } else {
+ GX->sd[i] = INT32_MIN;
+ }
+ }
break;
case 0x5C: /* SUBSS Gx, Ex */
nextop = F8;
diff --git a/src/emu/x64syscall.c b/src/emu/x64syscall.c
index f0faea7..24dd442 100755..100644
--- a/src/emu/x64syscall.c
+++ b/src/emu/x64syscall.c
@@ -62,6 +62,7 @@ int32_t my_epoll_pwait(x64emu_t* emu, int32_t epfd, void* events, int32_t maxeve
pid_t my_vfork(x64emu_t* emu);
#endif
int32_t my_fcntl(x64emu_t* emu, int32_t a, int32_t b, void* c);
+int32_t my_execve(x64emu_t* emu, const char* path, char* const argv[], char* const envp[]);
// cannot include <fcntl.h>, it conflict with some asm includes...
#ifndef O_NONBLOCK
@@ -77,7 +78,7 @@ typedef struct scwrap_s {
int nbpars;
} scwrap_t;
-scwrap_t syscallwrap[] = {
+static scwrap_t syscallwrap[] = {
//{ 0, __NR_read, 3 }, // wrapped so SA_RESTART can be handled by libc
//{ 1, __NR_write, 3 }, // same
//{ 2, __NR_open, 3 }, // flags need transformation
@@ -124,6 +125,8 @@ scwrap_t syscallwrap[] = {
{ 45, __NR_recvfrom, 6},
{ 46, __NR_sendmsg, 3},
{ 47, __NR_recvmsg, 3},
+ { 49, __NR_bind, 3},
+ { 50, __NR_listen, 2},
{ 51, __NR_getsockname, 3},
{ 52, __NR_getpeername, 3},
{ 53, __NR_socketpair, 4},
@@ -134,6 +137,7 @@ scwrap_t syscallwrap[] = {
{ 57, __NR_fork, 0 }, // should wrap this one, because of the struct pt_regs (the only arg)?
#endif
//{58, __NR_vfork, 0},
+ //{59, __NR_execve, 3},
{ 60, __NR_exit, 1}, // Nees wrapping?
{ 61, __NR_wait4, 4},
{ 62, __NR_kill, 2 },
@@ -146,6 +150,7 @@ scwrap_t syscallwrap[] = {
{ 78, __NR_getdents, 3},
#endif
{ 79, __NR_getcwd, 2},
+ { 80, __NR_chdir, 1},
#ifdef __NR_rename
{ 82, __NR_rename, 2},
#endif
@@ -159,7 +164,18 @@ scwrap_t syscallwrap[] = {
{ 96, __NR_gettimeofday, 2},
{ 97, __NR_getrlimit, 2},
{ 101, __NR_ptrace, 4},
+ { 102, __NR_getuid, 0},
+ { 104, __NR_getgid, 0},
+ { 105, __NR_setuid, 1},
+ { 106, __NR_setgid, 1},
+ { 107, __NR_geteuid, 0},
+ { 108, __NR_getegid, 0},
+ { 109, __NR_setpgid, 2},
+ { 110, __NR_getppid, 0},
+ //{ 111, __NR_getpgrp, 0},
{ 112, __NR_setsid, 0},
+ { 113, __NR_setreuid, 2},
+ { 114, __NR_setregid, 2},
{ 118, __NR_getresuid, 3},
{ 120, __NR_getresgid, 3},
{ 125, __NR_capget, 2},
@@ -167,9 +183,11 @@ scwrap_t syscallwrap[] = {
{ 127, __NR_rt_sigpending, 2},
{ 128, __NR_rt_sigtimedwait, 4},
//{ 131, __NR_sigaltstack, 2}, // wrapped to use my_sigaltstack*
+ { 140, __NR_getpriority, 2},
{ 155, __NR_pivot_root, 2},
{ 157, __NR_prctl, 5 }, // needs wrapping?
//{ 158, __NR_arch_prctl, 2}, //need wrapping
+ { 160, __NR_setrlimit, 2},
{ 161, __NR_chroot, 1},
{ 186, __NR_gettid, 0 }, //0xBA
{ 200, __NR_tkill, 2 },
@@ -184,6 +202,7 @@ scwrap_t syscallwrap[] = {
{ 208, __NR_io_getevents, 4},
{ 209, __NR_io_submit, 3},
{ 210, __NR_io_cancel, 3},
+ { 212, __NR_lookup_dcookie, 3},
#ifdef __NR_epoll_create
{ 213, __NR_epoll_create, 1},
#endif
@@ -201,6 +220,8 @@ scwrap_t syscallwrap[] = {
{ 233, __NR_epoll_ctl, 4},
#endif
{ 234, __NR_tgkill, 3},
+ { 238, __NR_set_mempolicy, 3},
+ { 239, __NR_get_mempolicy, 5},
{ 247, __NR_waitid, 5},
#ifdef __NR_inotify_init
{ 253, __NR_inotify_init, 0}, //0xFD
@@ -217,6 +238,7 @@ scwrap_t syscallwrap[] = {
{ 264, __NR_renameat, 4},
#endif
{ 267, __NR_readlinkat, 4},
+ { 268, __NR_fchmodat, 3},
{ 270, __NR_pselect6, 6},
{ 272, __NR_unshare, 1},
{ 273, __NR_set_robust_list, 2},
@@ -227,6 +249,8 @@ scwrap_t syscallwrap[] = {
#ifdef _NR_eventfd
{ 284, __NR_eventfd, 1},
#endif
+ { 285, __NR_fallocate, 4},
+ { 288, __NR_accept4, 4},
{ 290, __NR_eventfd2, 2},
{ 291, __NR_epoll_create1, 1},
{ 292, __NR_dup3, 3},
@@ -541,8 +565,8 @@ void EXPORT x64Syscall(x64emu_t *emu)
}
}
x64emu_t * newemu = NewX64Emu(emu->context, R_RIP, (uintptr_t)stack_base, stack_size, (R_RSI)?0:1);
- SetupX64Emu(newemu);
- CloneEmu(newemu, emu);
+ SetupX64Emu(newemu, emu);
+ //CloneEmu(newemu, emu);
Push64(newemu, 0);
PushExit(newemu);
void* mystack = NULL;
@@ -580,6 +604,14 @@ void EXPORT x64Syscall(x64emu_t *emu)
R_RAX = (uint64_t)-errno;
}
break;
+ case 59: // execve
+ {
+ int64_t r = my_execve(emu, (const char*)R_RDI, (char* const*)R_RSI, (char* const*)R_RDX);
+ R_RAX = r;
+ if(R_EAX==0xffffffff)
+ R_RAX = (uint64_t)-errno;
+ }
+ break;
case 63: //uname
{
old_utsname_t *old = (old_utsname_t*)R_RDI;
@@ -733,7 +765,7 @@ uintptr_t EXPORT my_syscall(x64emu_t *emu)
{
static uint32_t warned = 0;
uint32_t s = R_EDI;
- printf_dump(LOG_DEBUG, "%p: Calling libc syscall 0x%02X (%d) %p %p %p %p %p\n", (void*)R_RIP, s, s, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9);
+ printf_dump(LOG_DEBUG, "%04d| %p: Calling libc syscall 0x%02X (%d) %p %p %p %p %p\n", GetTID(), (void*)R_RIP, s, s, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9);
// check wrapper first
int cnt = sizeof(syscallwrap) / sizeof(scwrap_t);
for (int i=0; i<cnt; i++) {
@@ -842,8 +874,8 @@ uintptr_t EXPORT my_syscall(x64emu_t *emu)
}
}
x64emu_t * newemu = NewX64Emu(emu->context, R_RIP, (uintptr_t)stack_base, stack_size, (R_RDX)?0:1);
- SetupX64Emu(newemu);
- CloneEmu(newemu, emu);
+ SetupX64Emu(newemu, emu);
+ //CloneEmu(newemu, emu);
Push64(newemu, 0);
PushExit(newemu);
void* mystack = NULL;
@@ -876,6 +908,8 @@ uintptr_t EXPORT my_syscall(x64emu_t *emu)
#endif
case 58: // vfork
return my_vfork(emu);
+ case 59: // execve
+ return my_execve(emu, (const char*)R_RSI, (char* const*)R_RDX, (char* const*)R_RCX);
case 63: //uname
{
old_utsname_t *old = (old_utsname_t*)R_RSI;
diff --git a/src/emu/x64test.c b/src/emu/x64test.c
new file mode 100644
index 0000000..8e0327a
--- /dev/null
+++ b/src/emu/x64test.c
@@ -0,0 +1,160 @@
+#define _GNU_SOURCE
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <stddef.h>
+
+#include "debug.h"
+#include "box64stack.h"
+#include "x64emu.h"
+#include "x64run.h"
+#include "x64emu_private.h"
+#include "x64run_private.h"
+#include "x64primop.h"
+#include "x64trace.h"
+#include "x87emu_private.h"
+#include "box64context.h"
+#include "bridge.h"
+#include "signals.h"
+
+void print_banner(x64emu_t* ref)
+{
+ printf_log(LOG_NONE, "Warning, difference between Interpreter and Dynarec in %p (%02x %02x %02x %02x %02x %02x %02x %02x)\n"\
+ "=======================================\n",
+ (void*)ref->old_ip,
+ ((uint8_t*)ref->old_ip)[0], ((uint8_t*)ref->old_ip)[1], ((uint8_t*)ref->old_ip)[2], ((uint8_t*)ref->old_ip)[3],
+ ((uint8_t*)ref->old_ip)[4], ((uint8_t*)ref->old_ip)[5], ((uint8_t*)ref->old_ip)[6], ((uint8_t*)ref->old_ip)[7]
+ );
+ printf_log(LOG_NONE, "DIFF: Dynarec | Interpreter\n----------------------\n");
+}
+#define BANNER if(!banner) {banner=1; print_banner(ref);}
+void x64test_check(x64emu_t* ref, uintptr_t ip)
+{
+ int banner = 0;
+ x64test_t* test = &ref->test;
+ x64emu_t* emu = test->emu;
+ if(memcmp(ref->regs, emu->regs, sizeof(emu->regs))) {
+ static const char* regname[] = {"RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI",
+ " R8", " R9", "R10", "R11", "R12", "R13", "R14", "R15"};
+ BANNER;
+ for(int i=0; i<16; ++i) {
+ if(ref->regs[i].q[0]!=emu->regs[i].q[0]) {
+ printf_log(LOG_NONE, "%s: %016zx | %016zx\n", regname[i], ref->regs[i].q[0], emu->regs[i].q[0]);
+ }
+ }
+ }
+ if(ip!=emu->ip.q[0]) {
+ BANNER;
+ printf_log(LOG_NONE, "RIP: %016zx | %016zx\n", ip, emu->ip.q[0]);
+ }
+ // flags are volatile, so don't test them
+ //memcpy(&ref->eflags, &emu->eflags, sizeof(emu->eflags));
+ if(memcmp(ref->segs, emu->segs, sizeof(emu->segs))) {
+ static const char* segname[] = {"ES", "CS", "SS", "DS", "FS", "GS"};
+ BANNER;
+ for(int i=0; i<6; ++i) {
+ if(ref->segs[i]!=emu->segs[i]) {
+ printf_log(LOG_NONE, "%s: %04x | %04x\n", segname[i], ref->segs[i], emu->segs[i]);
+ }
+ }
+ }
+ if(ref->top != emu->top) {
+ BANNER;
+ printf_log(LOG_NONE, "X87 TOP: %d | %d\n", ref->top, emu->top);
+ }
+ if(ref->fpu_stack != emu->fpu_stack) {
+ BANNER;
+ printf_log(LOG_NONE, "X87 STACK: %d | %d\n", ref->fpu_stack, emu->fpu_stack);
+ }
+ if(ref->fpu_stack && memcmp(ref->x87, emu->x87, sizeof(emu->x87))) {
+ // need to check each regs, unused one might have different left over value
+ for(int i=0; i<ref->fpu_stack; ++i) {
+ if(ref->x87[(ref->top+i)&7].d != emu->x87[(emu->top+i)&7].d) {
+ BANNER;
+ printf_log(LOG_NONE, "ST%d: %g | %g\n", i, ref->x87[(ref->top+i)&7].d, emu->x87[(emu->top+i)&7].d);
+ }
+ }
+ }
+ //memcpy(ref->fpu_ld, emu->fpu_ld, sizeof(emu->fpu_ld));
+ //memcpy(ref->fpu_ll, emu->fpu_ll, sizeof(emu->fpu_ll));
+ /*if(ref->p_regs != emu->p_regs) {
+ BANNER;
+ printf_log(LOG_NONE, "X87 PREG: %x | %x\n", ref->p_regs, emu->p_regs);
+ }*/
+ if(ref->cw.x16 != emu->cw.x16) {
+ BANNER;
+ printf_log(LOG_NONE, "X87 CW: %x | %x\n", ref->cw.x16, emu->cw.x16);
+ }
+ if(ref->sw.x16 != emu->sw.x16) {
+ BANNER;
+ printf_log(LOG_NONE, "X87 SW: %x | %x\n", ref->sw.x16, emu->sw.x16);
+ }
+ if(memcmp(ref->mmx, emu->mmx, sizeof(emu->mmx))) {
+ BANNER;
+ for(int i=0; i<8; ++i) {
+ if(ref->mmx[i].q!=emu->mmx[i].q) {
+ printf_log(LOG_NONE, "EMM[%d]: %016x | %016x\n", i, ref->mmx[i].q, emu->mmx[i].q);
+ }
+ }
+ }
+ if(ref->mxcsr.x32 != emu->mxcsr.x32) {
+ BANNER;
+ printf_log(LOG_NONE, "MXCSR: %x | %x\n", ref->mxcsr.x32, emu->mxcsr.x32);
+ }
+ if(memcmp(ref->xmm, emu->xmm, sizeof(emu->xmm))) {
+ BANNER;
+ for(int i=0; i<16; ++i) {
+ if(ref->xmm[i].q[0]!=emu->xmm[i].q[0] || ref->xmm[i].q[1]!=emu->xmm[i].q[1] ) {
+ printf_log(LOG_NONE, "XMM[%02d]: %016zx-%016zx | %016zx-%016zx\n", i, ref->xmm[i].q[1], ref->xmm[i].q[0], emu->xmm[i].q[1], emu->xmm[i].q[0]);
+ }
+ }
+ }
+ if(test->memsize) {
+ if(memcmp(test->mem, (void*)test->memaddr, test->memsize)) {
+ BANNER;
+ printf_log(LOG_NONE, "MEM: @%p :", (void*)test->memaddr);
+ for(int i=0; i<test->memsize; ++i)
+ printf_log(LOG_NONE, " %02x", test->mem[i]);
+ printf_log(LOG_NONE, " |");
+ for(int i=0; i<test->memsize; ++i)
+ printf_log(LOG_NONE, " %02x", ((uint8_t*)test->memaddr)[i]);
+ printf_log(LOG_NONE, "\n");
+ }
+ }
+ if(banner) // there was an error, re-sync!
+ CopyEmu(emu, ref);
+}
+#undef BANNER
+
+void x64test_init(x64emu_t* ref, uintptr_t ip)
+{
+ x64test_t* test = &ref->test;
+ if(!test->test) {
+ test->clean = 0;
+ return;
+ }
+ // check if test as a valid emu struct
+ if(!test->emu) {
+ test->emu = NewX64Emu(my_context, ip, (uintptr_t)ref->init_stack, ref->size_stack, 0);
+ CopyEmu(test->emu, ref);
+ } else {
+ // check if IP is same, else, sync
+ uintptr_t prev_ip = test->emu->ip.q[0];
+ if(test->clean)
+ x64test_check(ref, ip);
+ if(ip != prev_ip || !test->test || !test->clean) {
+ CopyEmu(test->emu, ref);
+ }
+ }
+ // Do a Dry single Step
+ test->memsize = 0;
+ test->clean = 1;
+ ref->old_ip = ip;
+ RunTest(test);
+ // this will be anakyzed next step
+}
diff --git a/src/emu/x64tls.c b/src/emu/x64tls.c
index a059ecf..83fc1f6 100755..100644
--- a/src/emu/x64tls.c
+++ b/src/emu/x64tls.c
@@ -15,7 +15,7 @@
typedef struct thread_area_s
{
int entry_number;
- uintptr_t base_addr;
+ uint64_t base_addr;
unsigned int limit;
unsigned int seg_32bit:1;
unsigned int contents:2;
@@ -23,29 +23,26 @@ typedef struct thread_area_s
unsigned int limit_in_pages:1;
unsigned int seg_not_present:1;
unsigned int useable:1;
+ unsigned int lm:1;
} thread_area_t;
+typedef struct thread_area_32_s
+{
+ int entry_number;
+ uint32_t base_addr;
+ unsigned int limit;
+ unsigned int seg_32bit:1;
+ unsigned int contents:2;
+ unsigned int read_exec_only:1;
+ unsigned int limit_in_pages:1;
+ unsigned int seg_not_present:1;
+ unsigned int useable:1;
+} thread_area_32_t;
-static pthread_once_t thread_key_once0 = PTHREAD_ONCE_INIT;
-static pthread_once_t thread_key_once1 = PTHREAD_ONCE_INIT;
-static pthread_once_t thread_key_once2 = PTHREAD_ONCE_INIT;
-static pthread_once_t thread_key_once3 = PTHREAD_ONCE_INIT;
-
-static void thread_key_alloc0() {
- pthread_key_create(&my_context->segtls[0].key, NULL);
-}
-static void thread_key_alloc1() {
- pthread_key_create(&my_context->segtls[1].key, NULL);
-}
-static void thread_key_alloc2() {
- pthread_key_create(&my_context->segtls[2].key, NULL);
-}
-static void thread_key_alloc3() {
- pthread_key_create(&my_context->segtls[3].key, NULL);
-}
+int GetTID();
-uint32_t my_set_thread_area(thread_area_t* td)
+uint32_t my_set_thread_area_32(x64emu_t* emu, thread_area_32_t* td)
{
- printf_log(LOG_DEBUG, "set_thread_area(%p[%d/base=%p/limit=%u/32bits:%u/%u/%u...])\n", td, td->entry_number, (void*)td->base_addr, td->limit_in_pages, td->seg_32bit, td->contents, td->read_exec_only);
+ printf_log(LOG_DEBUG, "%04d| set_thread_area_32(%p[%d/base=%p/limit=%u/32bits:%u/%u/%u...])\n", GetTID(), td, td->entry_number, (void*)(uintptr_t)td->base_addr, td->limit_in_pages, td->seg_32bit, td->contents, td->read_exec_only);
int isempty = 0;
// first, check if the "user_desc", here td, is "empty"
@@ -60,48 +57,47 @@ uint32_t my_set_thread_area(thread_area_t* td)
int idx = td->entry_number;
if(idx==-1) {
// find a free one
- for (int i=0; i<3 && idx==-1; ++i)
+ for (int i=9; i<15 && idx==-1; ++i)
if(!my_context->segtls[i].present)
idx=i;
if(idx==-1) {
errno = ESRCH;
return (uint32_t)-1;
}
- idx+=7;
td->entry_number = idx;
}
- if(isempty && (td->entry_number<7 || td->entry_number>7+2)) {
+ if(isempty && (td->entry_number<9 || td->entry_number>15)) {
errno = EINVAL;
return (uint32_t)-1;
}
if(isempty) {
- memset(&my_context->segtls[td->entry_number-7], 0, sizeof(base_segment_t));
+ memset(&my_context->segtls[td->entry_number], 0, sizeof(base_segment_t));
return 0;
}
- if((idx<7 || idx>7+2)) {
+ if((idx<9 || idx>15)) {
errno = EINVAL;
return (uint32_t)-1;
}
- my_context->segtls[idx-7].base = td->base_addr;
- my_context->segtls[idx-7].limit = td->limit;
- my_context->segtls[idx-7].present = 1;
- switch (idx-7) {
- case 0: pthread_once(&thread_key_once0, thread_key_alloc0); break;
- case 1: pthread_once(&thread_key_once1, thread_key_alloc1); break;
- case 2: pthread_once(&thread_key_once2, thread_key_alloc2); break;
+ my_context->segtls[idx].base = td->base_addr;
+ my_context->segtls[idx].limit = td->limit;
+ my_context->segtls[idx].present = 1;
+ my_context->segtls[idx].is32bits = 1;
+ if(!my_context->segtls[idx].key_init) {
+ pthread_key_create(&my_context->segtls[idx].key, NULL);
+ my_context->segtls[idx].key_init = 1;
}
- pthread_setspecific(my_context->segtls[idx-7].key, (void*)my_context->segtls[idx-7].base);
+ pthread_setspecific(my_context->segtls[idx].key, (void*)my_context->segtls[idx].base);
- ResetSegmentsCache(thread_get_emu());
+ ResetSegmentsCache(emu);
return 0;
}
uint32_t my_modify_ldt(x64emu_t* emu, int op, thread_area_t* td, int size)
{
- printf_log(/*LOG_DEBUG*/LOG_INFO, "modify_ldt(0x%x, %p[0x%x/base=%p/limit=%u/32bits:%u/%u/%u...], %d)\n", op, td, td->entry_number, (void*)td->base_addr, td->limit_in_pages, td->seg_32bit, td->contents, td->read_exec_only, size);
+ printf_log(LOG_DEBUG, "%04d| modify_ldt(0x%x, %p[0x%x/base=%p/limit=%u/32bits:%u/%u/%u...], %d)\n", GetTID(), op, td, td->entry_number, (void*)td->base_addr, td->limit_in_pages, td->seg_32bit, td->contents, td->read_exec_only, size);
if(!td) {
errno = EFAULT;
return (uint32_t)-1;
@@ -116,8 +112,8 @@ uint32_t my_modify_ldt(x64emu_t* emu, int op, thread_area_t* td, int size)
return (uint32_t)-1;
}
- int idx = td->entry_number - 7;
- if(idx<0 || idx>2) {
+ int idx = td->entry_number;
+ if(idx<9 || idx>15) {
errno = EINVAL;
return (uint32_t)-1;
}
@@ -133,33 +129,78 @@ uint32_t my_modify_ldt(x64emu_t* emu, int op, thread_area_t* td, int size)
return 0;
}
+static void* GetSeg43Base();
+static const char* arch_prctl_param(int code)
+{
+ static char ret[10] = {0};
+ switch (code) {
+ case 0x1001: return "ARCH_SET_GS";
+ case 0x1002: return "ARCH_SET_FS";
+ case 0x1003: return "ARCH_GET_FS";
+ case 0x1004: return "ARCH_GET_GS";
+ }
+ sprintf(ret, "0x%x", code);
+ return ret;
+}
int my_arch_prctl(x64emu_t *emu, int code, void* addr)
{
+ printf_log(LOG_DEBUG, "%04d| arch_prctl(%s, %p) (RSP=%p, FS=0x%x, GS=0x%x)\n", GetTID(), arch_prctl_param(code), addr,(void*)R_RSP, emu->segs[_FS], emu->segs[_GS]);
+
#define ARCH_SET_GS 0x1001
#define ARCH_SET_FS 0x1002
#define ARCH_GET_FS 0x1003
#define ARCH_GET_GS 0x1004
+ int seg = 0;
+ int idx = 0;
switch(code) {
case ARCH_GET_GS:
*(void**)addr = GetSegmentBase(emu->segs[_GS]);
return 0;
- case ARCH_SET_GS:
- pthread_once(&thread_key_once3, thread_key_alloc3);
- if(emu->segs[_GS]!=(0xa<<3))
- emu->segs[_GS] = 0xa<<3; // should not move!
- emu->segs_serial[_GS] = 0;
- my_context->segtls[3].base = (uintptr_t)addr;
- my_context->segtls[3].limit = 0;
- my_context->segtls[3].present = 1;
- pthread_setspecific(my_context->segtls[3].key, (void*)my_context->segtls[3].base);
- ResetSegmentsCache(emu);
- return 0;
case ARCH_GET_FS:
*(void**)addr = GetSegmentBase(emu->segs[_FS]);
return 0;
+ case ARCH_SET_FS:
+ case ARCH_SET_GS:
+ seg=(code==ARCH_SET_FS)?_FS:_GS;
+ int idx = -1;
+ // search if it's a TLS base
+ if(GetSeg43Base()==addr)
+ idx = 0x43>>3;
+ // Is this search only occurs when seg==0?
+ for (int i=9; i<15 && idx==-1; ++i)
+ if(my_context->segtls[i].present && my_context->segtls[i].base==(uintptr_t)addr)
+ idx=i;
+ // found...
+ if(idx!=-1) {
+ printf_log(LOG_DEBUG, "Changing segment selector from 0x%x to 0x%x\n", emu->segs[seg], (idx<<3) +3);
+ emu->segs[seg]=(idx<<3) +3;
+ }
+ if(emu->segs[seg]==0) {
+ printf_log(LOG_DEBUG, "Warning, set seg, but it's 0!\n");
+ errno = EINVAL;
+ return -1;
+ }
+ idx = emu->segs[seg] >> 3;
+ if(idx<0 || idx>15) {
+ errno = EINVAL;
+ return -1;
+ }
+ emu->segs_serial[seg] = 0;
+ my_context->segtls[idx].base = (uintptr_t)addr;
+ my_context->segtls[idx].limit = 0;
+ my_context->segtls[idx].present = 1;
+ if(idx>8 && !my_context->segtls[idx].key_init) {
+ pthread_key_create(&my_context->segtls[idx].key, NULL);
+ my_context->segtls[idx].key_init = 1;
+ }
+ if(my_context->segtls[idx].key_init)
+ pthread_setspecific(my_context->segtls[idx].key, addr);
+ ResetSegmentsCache(emu);
+ return 0;
}
// other are unsupported
printf_log(LOG_INFO, "warning, call to unsupported arch_prctl(0x%x, %p)\n", code, addr);
+ errno = ENOSYS;
return -1;
}
@@ -227,7 +268,7 @@ static tlsdatasize_t* setupTLSData(box64context_t* context)
return data;
}
-void* fillTLSData(box64context_t *context)
+static void* fillTLSData(box64context_t *context)
{
mutex_lock(&context->mutex_tls);
tlsdatasize_t *data = setupTLSData(context);
@@ -235,12 +276,12 @@ void* fillTLSData(box64context_t *context)
return data;
}
-void* resizeTLSData(box64context_t *context, void* oldptr)
+static void* resizeTLSData(box64context_t *context, void* oldptr)
{
mutex_lock(&context->mutex_tls);
tlsdatasize_t* oldata = (tlsdatasize_t*)oldptr;
if(sizeTLSData(oldata->tlssize)!=sizeTLSData(context->tlssize) || (oldata->n_elfs/0xff)!=(context->elfsize/0xff)) {
- printf_log(LOG_INFO, "Warning, resizing of TLS occured! size: %d->%d / n_elfs: %d->%d\n", sizeTLSData(oldata->tlssize), sizeTLSData(context->tlssize), 1+(oldata->n_elfs/0xff), 1+(context->elfsize/0xff));
+ printf_log(LOG_INFO, "Warning, resizing of TLS occurred! size: %d->%d / n_elfs: %d->%d\n", sizeTLSData(oldata->tlssize), sizeTLSData(context->tlssize), 1+(oldata->n_elfs/0xff), 1+(context->elfsize/0xff));
tlsdatasize_t *data = setupTLSData(context);
// copy the relevent old part, in case something changed
memcpy((void*)((uintptr_t)data->data-oldata->tlssize), (void*)((uintptr_t)oldata->data-oldata->tlssize), oldata->tlssize);
@@ -272,14 +313,21 @@ void* resizeTLSData(box64context_t *context, void* oldptr)
}
}
-static void* GetSeg33Base()
+tlsdatasize_t* getTLSData(box64context_t *context)
{
- tlsdatasize_t* ptr;
- if ((ptr = (tlsdatasize_t*)pthread_getspecific(my_context->tlskey)) == NULL) {
- ptr = (tlsdatasize_t*)fillTLSData(my_context);
- }
- if(ptr->tlssize != my_context->tlssize)
- ptr = (tlsdatasize_t*)resizeTLSData(my_context, ptr);
+ tlsdatasize_t* ptr = NULL;
+ if(!ptr)
+ if ((ptr = (tlsdatasize_t*)pthread_getspecific(context->tlskey)) == NULL) {
+ ptr = (tlsdatasize_t*)fillTLSData(context);
+ }
+ if(ptr->tlssize != context->tlssize)
+ ptr = (tlsdatasize_t*)resizeTLSData(context, ptr);
+ return ptr;
+}
+
+static void* GetSeg43Base()
+{
+ tlsdatasize_t* ptr = getTLSData(my_context);
return ptr->data;
}
@@ -290,16 +338,17 @@ void* GetSegmentBase(uint32_t desc)
return NULL;
}
int base = desc>>3;
- if(base==0xe || base==0xf)
- return NULL; // regular value...
- if(base==0x6)
- return GetSeg33Base();
-
- if(base>6 && base<11 && my_context->segtls[base-7].present) {
- void* ptr = pthread_getspecific(my_context->segtls[base-7].key);
+ if(base==0x8 && !my_context->segtls[base].key_init)
+ return GetSeg43Base();
+ if(base>15) {
+ printf_log(LOG_NONE, "Warning, accessing segment unknown 0x%x or unset\n", desc);
+ return NULL;
+ }
+ if(my_context->segtls[base].key_init) {
+ void* ptr = pthread_getspecific(my_context->segtls[base].key);
return ptr;
}
-
- printf_log(LOG_NONE, "Warning, accessing segment unknown 0x%x or unset\n", desc);
- return NULL;
+
+ void* ptr = (void*)my_context->segtls[base].base;
+ return ptr;
}
diff --git a/src/emu/x64trace.c b/src/emu/x64trace.c
index b5ddb5b..ac65504 100755..100644
--- a/src/emu/x64trace.c
+++ b/src/emu/x64trace.c
@@ -59,6 +59,7 @@ int InitX64Trace(box64context_t *context)
#undef GO
context->dec = InitX64TraceDecoder(context);
+ context->dec32 = InitX86TraceDecoder(context);
return 0;
}
@@ -73,6 +74,24 @@ void DeleteX64Trace(box64context_t *context)
context->zydis = NULL;
}
+zydis_dec_t* InitX86TraceDecoder(box64context_t *context)
+{
+ if(!context->zydis)
+ return NULL;
+ zydis_dec_t *dec = (zydis_dec_t*)box_calloc(1, sizeof(zydis_dec_t));
+ dec->ZydisDecoderDecodeBuffer = context->zydis->ZydisDecoderDecodeBuffer;
+ dec->ZydisFormatterFormatInstruction = context->zydis->ZydisFormatterFormatInstruction;
+ context->zydis->ZydisDecoderInit(&dec->decoder, ZYDIS_MACHINE_MODE_LEGACY_32, ZYDIS_ADDRESS_WIDTH_32);
+ context->zydis->ZydisFormatterInit(&dec->formatter, ZYDIS_FORMATTER_STYLE_INTEL);
+
+ return dec;
+}
+void DeleteX86TraceDecoder(zydis_dec_t **dec)
+{
+ box_free(*dec);
+ *dec = NULL;
+}
+
zydis_dec_t* InitX64TraceDecoder(box64context_t *context)
{
if(!context->zydis)
diff --git a/src/emu/x86syscall.c b/src/emu/x86syscall.c
new file mode 100755
index 0000000..b41b006
--- /dev/null
+++ b/src/emu/x86syscall.c
@@ -0,0 +1,284 @@
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <sys/syscall.h> /* For SYS_xxx definitions */
+#include <unistd.h>
+#include <time.h>
+#include <sys/mman.h>
+#include <sys/select.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <asm/stat.h>
+#include <errno.h>
+#include <sched.h>
+#include <sys/wait.h>
+#include <sys/utsname.h>
+#ifndef __NR_socketcall
+#include <linux/net.h>
+#include <sys/socket.h>
+#endif
+#include <sys/resource.h>
+#include <poll.h>
+
+#include "debug.h"
+#include "box64stack.h"
+#include "x64emu.h"
+#include "x64run.h"
+#include "x64emu_private.h"
+#include "x64trace.h"
+#include "myalign.h"
+#include "box64context.h"
+#include "callback.h"
+#include "signals.h"
+#include "x64tls.h"
+
+
+// Syscall table for x86_64 can be found
+typedef struct scwrap_s {
+ uint32_t x86s;
+ int nats;
+ int nbpars;
+} scwrap_t;
+
+static scwrap_t syscallwrap[] = {
+ //{ 2, __NR_fork, 1 },
+ //{ 3, __NR_read, 3 }, // wrapped so SA_RESTART can be handled by libc
+ //{ 4, __NR_write, 3 }, // same
+ //{ 5, __NR_open, 3 }, // flags need transformation
+ //{ 6, __NR_close, 1 }, // wrapped so SA_RESTART can be handled by libc
+ //{ 7, __NR_waitpid, 3 },
+ //{ 10, __NR_unlink, 1 },
+ //{ 12, __NR_chdir, 1 },
+ //{ 13, __NR_time, 1 },
+ //{ 15, __NR_chmod, 2 },
+ //{ 19, __NR_lseek, 3 },
+ //{ 20, __NR_getpid, 0 },
+ //{ 24, __NR_getuid, 0 },
+ //{ 33, __NR_access, 2 },
+ //{ 37, __NR_kill, 2 },
+ //{ 38, __NR_rename, 2 },
+ //{ 39, __NR_mkdir, 2 },
+ //{ 40, __NR_rmdir, 1 },
+ //{ 41, __NR_dup, 1 },
+ //{ 42, __NR_pipe, 1 },
+ //{ 45, __NR_brk, 1 },
+ //{ 47, __NR_getgid, 0 },
+ //{ 49, __NR_geteuid, 0 },
+ //{ 50, __NR_getegid, 0 },
+ //{ 54, __NR_ioctl, 3 }, // should be wrapped to allow SA_RESTART handling by libc, but syscall is only 3 arguments, ioctl can be 5
+ //{ 55, __NR_fcntl, 3 }, // wrapped to allow filter of F_SETFD
+ //{ 60, __NR_umask, 1 },
+ //{ 63, __NR_dup2, 2 },
+ //{ 64, __NR_getppid, 0 },
+ //{ 66, __NR_setsid, 0 },
+ //{ 75, __NR_setrlimit, 2 },
+ //{ 76, __NR_getrlimit, 2 },
+ //{ 77, __NR_getrusage, 2 },
+ //{ 78, __NR_gettimeofday, 2 },
+ //{ 83, __NR_symlink, 2 },
+ //{ 82, __NR_select, 5 },
+ //{ 85, __NR_readlink, 3 },
+ //{ 91, __NR_munmap, 2 },
+ //{ 94, __NR_fchmod, 2 },
+ //{ 99, __NR_statfs, 2 },
+ //{ 102, __NR_socketcall, 2 },
+ //{ 104, __NR_setitimer, 3 },
+ //{ 105, __NR_getitimer, 2 },
+ //{ 106, __NR_newstat, 2 },
+ //{ 106, __NR_stat, 2 },
+ //{ 107, __NR_newlstat, 2 },
+ //{ 107, __NR_lstat, 2 },
+ //{ 108, __NR_newfstat, 2 },
+ //{ 108, __NR_fstat, 2 },
+ //{ 109, __NR_olduname, 1 },
+ //{ 110, __NR_iopl, 1 },
+ //{ 114, __NR_wait4, 4 }, //TODO: check struct rusage alignment
+ //{ 117, __NR_ipc, 6 },
+ //{ 119, __NR_sigreturn, 0},
+ //{ 120, __NR_clone, 5 }, // need works
+ //{ 122, __NR_uname, 1 },
+ //{ 123, __NR_modify_ldt },
+ //{ 125, __NR_mprotect, 3 },
+ //{ 136, __NR_personality, 1 },
+ //{ 140, __NR__llseek, 5 },
+ //{ 141, __NR_getdents, 3 },
+ //{ 142, __NR__newselect, 5 },
+ //{ 143, __NR_flock, 2 },
+ //{ 144, __NR_msync, 3 },
+ //{ 145, __NR_readv, 3 },
+ //{ 146, __NR_writev, 3 },
+ //{ 148, __NR_fdatasync, 1 },
+ //{ 149, __NR__sysctl, 1 }, // need wrapping?
+ //{ 156, __NR_sched_setscheduler, 3 },
+ //{ 157, __NR_sched_getscheduler, 1 },
+ //{ 158, __NR_sched_yield, 0 },
+ //{ 162, __NR_nanosleep, 2 },
+ //{ 164, __NR_setresuid, 3 },
+ //{ 168, __NR_poll, 3 }, // wrapped to allow SA_RESTART wrapping by libc
+ //{ 172, __NR_prctl, 5 },
+ //{ 173, __NR_rt_sigreturn, 0 },
+ //{ 175, __NR_rt_sigprocmask, 4 },
+ //{ 179, __NR_rt_sigsuspend, 2 },
+ //{ 183, __NR_getcwd, 2 },
+ //{ 184, __NR_capget, 2},
+ //{ 185, __NR_capset, 2},
+ //{ 186, __NR_sigaltstack, 2 }, // neeed wrap or something?
+ //{ 191, __NR_ugetrlimit, 2 },
+// { 192, __NR_mmap2, 6},
+ //{ 195, __NR_stat64, 2 }, // need proprer wrap because of structure size change
+ //{ 196, __NR_lstat64, 2 }, // need proprer wrap because of structure size change
+ //{ 197, __NR_fstat64, 2 }, // need proprer wrap because of structure size change
+ //{ 199, __NR_getuid32, 0 },
+ //{ 200, __NR_getgid32, 0 },
+ //{ 201, __NR_geteuid32, 0 },
+ //{ 202, __NR_getegid32, 0 },
+ //{ 208, __NR_setresuid32, 3 },
+ //{ 209, __NR_getresuid32, 3 },
+ //{ 210, __NR_setresgid32, 3 },
+ //{ 211, __NR_getresgid32, 3 },
+ //{ 220, __NR_getdents64, 3 },
+ //{ 221, __NR_fcntl64, 3 },
+ { 224, __NR_gettid, 0 },
+ //{ 240, __NR_futex, 6 },
+ //{ 241, __NR_sched_setaffinity, 3 },
+ //{ 242, __NR_sched_getaffinity, 3 },
+ //{ 252, __NR_exit_group, 1 },
+ //{ 254, __NR_epoll_create, 1 },
+ //{ 255, __NR_epoll_ctl, 4 },
+ //{ 256, __NR_epoll_wait, 4 },
+ //{ 265, __NR_clock_gettime, 2 },
+ //{ 266, __NR_clock_getres, 2 },
+ //{ 270, __NR_tgkill, 3 },
+ //{ 271, __NR_utimes, 2 },
+ //{ 291, __NR_inotify_init, 0},
+ //{ 292, __NR_inotify_add_watch, 3},
+ //{ 293, __NR_inotify_rm_watch, 2},
+ //{ 311, __NR_set_robust_list, 2 },
+ //{ 312, __NR_get_robust_list, 4 },
+ //{ 318, __NR_getcpu, 3},
+ //{ 328, __NR_eventfd2, 2},
+ //{ 329, __NR_epoll_create1, 1 },
+ //{ 331, __NR_pipe2, 2},
+ //{ 332, __NR_inotify_init1, 1},
+ //{ 355, __NR_getrandom, 3 },
+ //{ 356, __NR_memfd_create, 2},
+ //{ 449, __NR_futex_waitv, 5},
+};
+
+struct mmap_arg_struct {
+ unsigned long addr;
+ unsigned long len;
+ unsigned long prot;
+ unsigned long flags;
+ unsigned long fd;
+ unsigned long offset;
+};
+
+#undef st_atime
+#undef st_ctime
+#undef st_mtime
+
+struct x64_pt_regs {
+ long ebx;
+ long ecx;
+ long edx;
+ long esi;
+ long edi;
+ long ebp;
+ long eax;
+ int xds;
+ int xes;
+ int xfs;
+ int xgs;
+ long orig_eax;
+ long eip;
+ int xcs;
+ long eflags;
+ long esp;
+ int xss;
+};
+
+#ifndef __NR_olduname
+struct oldold_utsname {
+ char sysname[9];
+ char nodename[9];
+ char release[9];
+ char version[9];
+ char machine[9];
+};
+#endif
+struct old_utsname {
+ char sysname[65];
+ char nodename[65];
+ char release[65];
+ char version[65];
+ char machine[65];
+};
+
+struct i386_user_desc {
+ unsigned int entry_number;
+ unsigned long base_addr;
+ unsigned int limit;
+ unsigned int seg_32bit:1;
+ unsigned int contents:2;
+ unsigned int read_exec_only:1;
+ unsigned int limit_in_pages:1;
+ unsigned int seg_not_present:1;
+ unsigned int useable:1;
+};
+
+void EXPORT x86Syscall(x64emu_t *emu)
+{
+ uint32_t s = R_EAX;
+ printf_log(LOG_DEBUG, "%p: Calling 32bits syscall 0x%02X (%d) %p %p %p %p %p", (void*)R_RIP, s, s, (void*)(uintptr_t)R_EBX, (void*)(uintptr_t)R_ECX, (void*)(uintptr_t)R_EDX, (void*)(uintptr_t)R_ESI, (void*)(uintptr_t)R_EDI);
+ // check wrapper first
+ int cnt = sizeof(syscallwrap) / sizeof(scwrap_t);
+ for (int i=0; i<cnt; i++) {
+ if(syscallwrap[i].x86s == s) {
+ int sc = syscallwrap[i].nats;
+ switch(syscallwrap[i].nbpars) {
+ case 0: *(int32_t*)&R_EAX = syscall(sc); break;
+ case 1: *(int32_t*)&R_EAX = syscall(sc, R_EBX); break;
+ case 2: *(int32_t*)&R_EAX = syscall(sc, R_EBX, R_ECX); break;
+ case 3: *(int32_t*)&R_EAX = syscall(sc, R_EBX, R_ECX, R_EDX); break;
+ case 4: *(int32_t*)&R_EAX = syscall(sc, R_EBX, R_ECX, R_EDX, R_ESI); break;
+ case 5: *(int32_t*)&R_EAX = syscall(sc, R_EBX, R_ECX, R_EDX, R_ESI, R_EDI); break;
+ case 6: *(int32_t*)&R_EAX = syscall(sc, R_EBX, R_ECX, R_EDX, R_ESI, R_EDI, R_EBP); break;
+ default:
+ printf_log(LOG_NONE, "ERROR, Unimplemented syscall wrapper (%d, %d)\n", s, syscallwrap[i].nbpars);
+ emu->quit = 1;
+ return;
+ }
+ if(R_EAX==0xffffffff && errno>0)
+ R_EAX = (uint32_t)-errno;
+ printf_log(LOG_DEBUG, " => 0x%x\n", R_EAX);
+ return;
+ }
+ }
+ switch (s) {
+ case 1: // sys_exit
+ emu->quit = 1;
+ emu->exit = 1;
+ //R_EAX = syscall(__NR_exit, R_EBX); // the syscall should exit only current thread
+ R_EAX = R_EBX; // faking the syscall here, we don't want to really terminate the thread now
+ break;
+ /*case 123: // SYS_modify_ldt
+ R_EAX = my_modify_ldt(emu, R_EBX, (thread_area_t*)(uintptr_t)R_ECX, R_EDX);
+ if(R_EAX==0xffffffff && errno>0)
+ R_EAX = (uint32_t)-errno;
+ break;*/
+ case 243: // set_thread_area
+ R_EAX = my_set_thread_area_32(emu, (thread_area_32_t*)(uintptr_t)R_EBX);
+ if(R_EAX==0xffffffff && errno>0)
+ R_EAX = (uint32_t)-errno;
+ break;
+ default:
+ printf_log(LOG_INFO, "Warning: Unsupported Syscall 0x%02Xh (%d)\n", s, s);
+ R_EAX = (uint32_t)-ENOSYS;
+ return;
+ }
+ printf_log(LOG_DEBUG, " => 0x%x\n", R_EAX);
+}
diff --git a/src/emu/x86zydis.h b/src/emu/x86zydis.h
index ec7aea7..ec7aea7 100755..100644
--- a/src/emu/x86zydis.h
+++ b/src/emu/x86zydis.h
diff --git a/src/emu/x87emu_private.c b/src/emu/x87emu_private.c
index 9f4b8af..67573c3 100755..100644
--- a/src/emu/x87emu_private.c
+++ b/src/emu/x87emu_private.c
@@ -339,8 +339,6 @@ void fpu_fxsave32(x64emu_t* emu, void* ed)
p->ErrorSelector = 0;
p->DataOffset = 0;
p->DataSelector = 0;
- p->MxCsr = 0;
- p->MxCsr_Mask = 0;
// copy FPU/MMX regs...
for(int i=0; i<8; ++i)
memcpy(&p->FloatRegisters[i].q[0], (i<stack)?&ST(i):&emu->mmx[i], sizeof(mmx87_regs_t));
@@ -367,8 +365,6 @@ void fpu_fxsave64(x64emu_t* emu, void* ed)
p->ErrorOpcode = 0;
p->ErrorOffset = 0;
p->DataOffset = 0;
- p->MxCsr = 0;
- p->MxCsr_Mask = 0;
// copy FPU/MMX regs...
for(int i=0; i<8; ++i)
memcpy(&p->FloatRegisters[i].q[0], (i<stack)?&ST(i):&emu->mmx[i], sizeof(mmx87_regs_t));
diff --git a/src/emu/x87emu_private.h b/src/emu/x87emu_private.h
index a228705..5721088 100755..100644
--- a/src/emu/x87emu_private.h
+++ b/src/emu/x87emu_private.h
@@ -129,14 +129,14 @@ static inline void fpu_fxam(x64emu_t* emu) {
return;
}
if(isinf(ST0.d))
- { // TODO: Unsuported and denormal not analysed...
+ { // TODO: Unsupported and denormal not analysed...
emu->sw.f.F87_C3 = 0;
emu->sw.f.F87_C2 = 1;
emu->sw.f.F87_C0 = 1;
return;
}
if(isnan(ST0.d))
- { // TODO: Unsuported and denormal not analysed...
+ { // TODO: Unsupported and denormal not analysed...
emu->sw.f.F87_C3 = 0;
emu->sw.f.F87_C2 = 0;
emu->sw.f.F87_C0 = 1;
@@ -159,7 +159,7 @@ static inline void fpu_fxam(x64emu_t* emu) {
static inline void fpu_ftst(x64emu_t* emu) {
emu->sw.f.F87_C1 = 0;
if(isinf(ST0.d) || isnan(ST0.d))
- { // TODO: Unsuported and denormal not analysed...
+ { // TODO: Unsupported and denormal not analysed...
emu->sw.f.F87_C3 = 1;
emu->sw.f.F87_C2 = 1;
emu->sw.f.F87_C0 = 1;
diff --git a/src/include/auxval.h b/src/include/auxval.h
index ecbdf55..ecbdf55 100755..100644
--- a/src/include/auxval.h
+++ b/src/include/auxval.h
diff --git a/src/include/bitutils.h b/src/include/bitutils.h
new file mode 100644
index 0000000..50622da
--- /dev/null
+++ b/src/include/bitutils.h
@@ -0,0 +1,10 @@
+#ifndef __BITUTILS_H_
+#define __BITUTILS_H_
+#include <stdint.h>
+
+extern const uint8_t deBruijn64tab[64];
+extern const uint8_t lead0tab[16];
+
+int TrailingZeros64(uint64_t x);
+
+#endif //__BITUTILS_H_
diff --git a/src/include/box64context.h b/src/include/box64context.h
index 010521e..aa8c95b 100755..100644
--- a/src/include/box64context.h
+++ b/src/include/box64context.h
@@ -8,6 +8,11 @@
#include "dynarec/native_lock.h"
#endif
+#ifdef DYNAREC
+// disabling for now, seems to have a negative impact on performances
+//#define USE_CUSTOM_MUTEX
+#endif
+
typedef struct elfheader_s elfheader_t;
typedef struct cleanup_s cleanup_t;
typedef struct x64emu_s x64emu_t;
@@ -18,6 +23,7 @@ typedef struct bridge_s bridge_t;
typedef struct dlprivate_s dlprivate_t;
typedef struct kh_symbolmap_s kh_symbolmap_t;
typedef struct kh_defaultversion_s kh_defaultversion_t;
+typedef struct kh_mapsymbols_s kh_mapsymbols_t;
typedef struct library_s library_t;
typedef struct linkmap_s linkmap_t;
typedef struct kh_threadstack_s kh_threadstack_t;
@@ -57,13 +63,17 @@ typedef struct needed_libs_s {
void free_neededlib(needed_libs_t* needed);
needed_libs_t* new_neededlib(int n);
+needed_libs_t* copy_neededlib(needed_libs_t* needed);
void add1_neededlib(needed_libs_t* needed);
+void add1lib_neededlib(needed_libs_t* needed, library_t* lib, const char* name);
typedef struct base_segment_s {
uintptr_t base;
uint64_t limit;
- int present;
pthread_key_t key;
+ uint8_t present;
+ uint8_t is32bits;
+ uint8_t key_init;
} base_segment_t;
typedef struct box64context_s {
@@ -107,10 +117,12 @@ typedef struct box64context_s {
lib_t *maplib; // lib and symbols handling
lib_t *local_maplib; // libs and symbols openned has local (only collection of libs, no symbols)
- dic_t *versym; // dictionnary of versionned symbols
+ dic_t *versym; // dictionnary of versioned symbols
+ kh_mapsymbols_t *globdata; // GLOBAL_DAT relocation for COPY mapping in main elf
kh_threadstack_t *stacksizes; // stack sizes attributes for thread (temporary)
bridge_t *system; // other bridges
+ uintptr_t exit_bridge; // exit bridge value
uintptr_t vsyscall; // vsyscall bridge value
uintptr_t vsyscalls[3]; // the 3 x86 VSyscall pseudo bridges (mapped at 0xffffffffff600000+)
dlprivate_t *dlprivate; // dlopen library map
@@ -118,8 +130,6 @@ typedef struct box64context_s {
kh_symbolmap_t *almymap; // link to the mysymbolmap if libOpenAL
kh_symbolmap_t *vkwrappers; // the map of wrapper for VulkanProcs (TODO: check SDL2)
kh_symbolmap_t *vkmymap; // link to the mysymbolmap of libGL
- kh_defaultversion_t *globaldefver; // the global default version for symbols (the XXX@@vvvv of symbols)
- kh_defaultversion_t *weakdefver; // the weak default version for symbols (the XXX@@vvvv of symbols)
vkprocaddess_t vkprocaddress;
#ifndef DYNAREC
@@ -129,13 +139,25 @@ typedef struct box64context_s {
pthread_mutex_t mutex_thread;
pthread_mutex_t mutex_bridge;
#else
+ #ifdef USE_CUSTOM_MUTEX
uint32_t mutex_dyndump;
uint32_t mutex_trace;
uint32_t mutex_tls;
uint32_t mutex_thread;
uint32_t mutex_bridge;
+ #else
+ pthread_mutex_t mutex_dyndump;
+ pthread_mutex_t mutex_trace;
+ pthread_mutex_t mutex_tls;
+ pthread_mutex_t mutex_thread;
+ pthread_mutex_t mutex_bridge;
+ #endif
uintptr_t max_db_size; // the biggest (in x86_64 instructions bytes) built dynablock
int trace_dynarec;
+ pthread_mutex_t mutex_lock; // this is for the Test interpreter
+ #ifdef __riscv
+ uint32_t mutex_16b;
+ #endif
#endif
library_t *libclib; // shortcut to libc library (if loaded, so probably yes)
@@ -148,15 +170,15 @@ typedef struct box64context_s {
void* sdl2allocrw; // SDL2 AllocRW/FreeRW function
void* sdl2freerw;
- int deferedInit;
- elfheader_t **deferedInitList;
- int deferedInitSz;
- int deferedInitCap;
+ int deferredInit;
+ elfheader_t **deferredInitList;
+ int deferredInitSz;
+ int deferredInitCap;
pthread_key_t tlskey; // then tls key to have actual tlsdata
void* tlsdata; // the initial global tlsdata
int64_t tlssize; // wanted size of tlsdata
- base_segment_t segtls[4]; // only handling 0/1/2 descriptors (3 is internal use)
+ base_segment_t segtls[16];
uintptr_t *auxval_start;
@@ -165,6 +187,7 @@ typedef struct box64context_s {
int clean_cap;
zydis_dec_t *dec; // trace
+ zydis_dec_t *dec32; // trace
int forked; // how many forks... cleanup only when < 0
@@ -191,12 +214,12 @@ typedef struct box64context_s {
} box64context_t;
-#ifndef DYNAREC
+#ifndef USE_CUSTOM_MUTEX
#define mutex_lock(A) pthread_mutex_lock(A)
#define mutex_trylock(A) pthread_mutex_trylock(A)
#define mutex_unlock(A) pthread_mutex_unlock(A)
#else
-int GetTID();
+int GetTID(void);
#define mutex_lock(A) {uint32_t tid = (uint32_t)GetTID(); while(native_lock_storeifnull_d(A, tid)) sched_yield();}
#define mutex_trylock(A) native_lock_storeifnull_d(A, (uint32_t)GetTID())
#define mutex_unlock(A) native_lock_storeifref_d(A, 0, (uint32_t)GetTID())
@@ -214,16 +237,18 @@ void print_cycle_log(int loglevel);
// return the index of the added header
int AddElfHeader(box64context_t* ctx, elfheader_t* head);
+// remove an elf from list (but list is never reduced, so there can be holes)
+void RemoveElfHeader(box64context_t* ctx, elfheader_t* head);
// return the tlsbase (negative) for the new TLS partition created (no partition index is stored in the context)
int AddTLSPartition(box64context_t* context, int tlssize);
// defined in fact in threads.c
void thread_set_emu(x64emu_t* emu);
-x64emu_t* thread_get_emu();
+x64emu_t* thread_get_emu(void);
// unlock mutex that are locked by current thread (for signal handling). Return a mask of unlock mutex
-int unlockMutex();
+int unlockMutex(void);
// relock the muxtex that were unlocked
void relockMutex(int locks);
diff --git a/src/include/box64stack.h b/src/include/box64stack.h
index 997e064..0607f23 100755..100644
--- a/src/include/box64stack.h
+++ b/src/include/box64stack.h
@@ -9,11 +9,4 @@ typedef struct x64emu_s x64emu_t;
int CalcStackSize(box64context_t *context);
void SetupInitialStack(x64emu_t *emu);
-uint16_t Pop16(x64emu_t *emu);
-void Push16(x64emu_t *emu, uint16_t v);
-uint32_t Pop32(x64emu_t *emu);
-void Push32(x64emu_t *emu, uint32_t v);
-uint64_t Pop64(x64emu_t *emu);
-void Push64(x64emu_t *emu, uint64_t v);
-
-#endif //__BOX64_STACK_H_ \ No newline at end of file
+#endif //__BOX64_STACK_H_
diff --git a/src/include/bridge.h b/src/include/bridge.h
index 9859ae8..0c23808 100755..100644
--- a/src/include/bridge.h
+++ b/src/include/bridge.h
@@ -7,13 +7,13 @@ typedef struct bridge_s bridge_t;
typedef struct box64context_s box64context_t;
typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
-bridge_t *NewBridge();
+bridge_t *NewBridge(void);
void FreeBridge(bridge_t** bridge);
uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name);
uintptr_t CheckBridged(bridge_t* bridge, void* fnc);
uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name);
-uintptr_t AddAutomaticBridge(x64emu_t* emu, bridge_t* bridge, wrapper_t w, void* fnc, int N);
+uintptr_t AddAutomaticBridge(x64emu_t* emu, bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name);
void* GetNativeFnc(uintptr_t fnc);
void* GetNativeFncOrFnc(uintptr_t fnc);
@@ -22,13 +22,13 @@ uintptr_t AddVSyscall(bridge_t* bridge, int num);
int hasAlternate(void* addr);
void* getAlternate(void* addr);
void addAlternate(void* addr, void* alt);
-void cleanAlternate();
+void cleanAlternate(void);
#ifdef HAVE_TRACE
const char* getBridgeName(void* addr);
#endif
-void init_bridge_helper();
-void fini_bridge_helper();
+void init_bridge_helper(void);
+void fini_bridge_helper(void);
#endif //__BRIDGE_H_ \ No newline at end of file
diff --git a/src/include/callback.h b/src/include/callback.h
index eecbc3d..48d360c 100755..100644
--- a/src/include/callback.h
+++ b/src/include/callback.h
@@ -5,13 +5,14 @@
typedef struct x64emu_s x64emu_t;
-uint64_t RunFunction(box64context_t *context, uintptr_t fnc, int nargs, ...);
+uint64_t RunFunction(uintptr_t fnc, int nargs, ...);
+uint64_t RunFunctionFmt(uintptr_t fnc, const char* fmt, ...);
// save all modified register
-uint64_t RunSafeFunction(box64context_t *context, uintptr_t fnc, int nargs, ...);
+uint64_t RunSafeFunction(uintptr_t fnc, int nargs, ...);
// use emu state to run function
uint64_t RunFunctionWithEmu(x64emu_t *emu, int QuitOnLongJumpExit, uintptr_t fnc, int nargs, ...);
// using the Windows x64 calling convention
-uint64_t RunFunctionWindows(box64context_t *context, uintptr_t fnc, int nargs, ...);
+uint64_t RunFunctionWindows(uintptr_t fnc, int nargs, ...);
#endif //__CALLBACK_H__ \ No newline at end of file
diff --git a/src/include/complext.h b/src/include/complext.h
new file mode 100644
index 0000000..60d2215
--- /dev/null
+++ b/src/include/complext.h
@@ -0,0 +1,33 @@
+#ifndef __COMPLEX_T__H_
+#define __COMPLEX_T__H_
+
+typedef struct complex_s { double r; double i;} complex_t;
+typedef struct complexf_s { float r; float i;} complexf_t;
+
+#endif //__COMPLEX_T__H_
+
+#ifdef COMPLEX_IMPL
+#ifndef __COMPLEX_T_IMPL_H_
+#define __COMPLEX_T_IMPL_H_
+static inline complexf_t to_complexf(x64emu_t* emu, int i) {
+ complexf_t ret;
+ ret.r = emu->xmm[i].f[0];
+ ret.i = emu->xmm[i].f[1];
+ return ret;
+}
+static inline complex_t to_complex(x64emu_t* emu, int i) {
+ complex_t ret;
+ ret.r = emu->xmm[i].d[0];
+ ret.i = emu->xmm[i+1].d[0];
+ return ret;
+}
+static inline void from_complexf(x64emu_t* emu, complexf_t v) {
+ emu->xmm[0].f[0]=v.r;
+ emu->xmm[0].f[1]=v.i;
+}
+static inline void from_complex(x64emu_t* emu, complex_t v) {
+ emu->xmm[0].d[0]=v.r;
+ emu->xmm[1].d[0]=v.i;
+}
+#endif // __COMPLEX_T_IMPL_H_
+#endif // COMPLEX_IMPL
diff --git a/src/include/cpu_info.h b/src/include/cpu_info.h
index 18c4a1b..18c4a1b 100755..100644
--- a/src/include/cpu_info.h
+++ b/src/include/cpu_info.h
diff --git a/src/include/custommem.h b/src/include/custommem.h
index e03db81..13e73c4 100644
--- a/src/include/custommem.h
+++ b/src/include/custommem.h
@@ -26,12 +26,13 @@ void addDBFromAddressRange(uintptr_t addr, size_t size);
void cleanDBFromAddressRange(uintptr_t addr, size_t size, int destroy);
dynablock_t* getDB(uintptr_t idx);
+int getNeedTest(uintptr_t idx);
int addJumpTableIfDefault64(void* addr, void* jmp); // return 1 if write was succesfull
int setJumpTableIfRef64(void* addr, void* jmp, void* ref); // return 1 if write was succesfull
void setJumpTableDefault64(void* addr);
void setJumpTableDefaultRef64(void* addr, void* jmp);
int isJumpTableDefault64(void* addr);
-uintptr_t getJumpTable64();
+uintptr_t getJumpTable64(void);
uintptr_t getJumpTableAddress64(uintptr_t addr);
uintptr_t getJumpAddress64(uintptr_t addr);
@@ -51,9 +52,10 @@ uintptr_t getJumpAddress64(uintptr_t addr);
#define PROT_DYNAREC 0x80
#define PROT_DYNAREC_R 0x40
-#define PROT_MMAP 0x20
-#define PROT_DYN (PROT_DYNAREC | PROT_DYNAREC_R)
-#define PROT_CUSTOM (PROT_DYNAREC | PROT_DYNAREC_R | PROT_MMAP)
+#define PROT_NOPROT 0x20
+#define PROT_MMAP 0x10
+#define PROT_DYN (PROT_DYNAREC | PROT_DYNAREC_R | PROT_NOPROT)
+#define PROT_CUSTOM (PROT_DYNAREC | PROT_DYNAREC_R | PROT_MMAP | PROT_NOPROT)
void updateProtection(uintptr_t addr, size_t size, uint32_t prot);
void setProtection(uintptr_t addr, size_t size, uint32_t prot);
@@ -62,7 +64,7 @@ void freeProtection(uintptr_t addr, size_t size);
void refreshProtection(uintptr_t addr);
uint32_t getProtection(uintptr_t addr);
int getMmapped(uintptr_t addr);
-void loadProtectionFromMap();
+void loadProtectionFromMap(void);
#ifdef DYNAREC
void protectDB(uintptr_t addr, size_t size);
void unprotectDB(uintptr_t addr, size_t size, int mark); // if mark==0, the blocks are not marked as potentially dirty
@@ -77,7 +79,7 @@ void* find47bitBlock(size_t size);
void* find47bitBlockNearHint(void* hint, size_t size);
// unlock mutex that are locked by current thread (for signal handling). Return a mask of unlock mutex
-int unlockCustommemMutex();
+int unlockCustommemMutex(void);
// relock the muxtex that were unlocked
void relockCustommemMutex(int locks);
diff --git a/src/include/debug.h b/src/include/debug.h
index e13de64..8397d6c 100755..100644
--- a/src/include/debug.h
+++ b/src/include/debug.h
@@ -23,15 +23,23 @@ extern int box64_dynarec_x87double;
extern int box64_dynarec_safeflags;
extern int box64_dynarec_callret;
extern int box64_dynarec_bleeding_edge;
+extern int box64_dynarec_jvm;
extern int box64_dynarec_hotpage;
extern int box64_dynarec_fastpage;
extern int box64_dynarec_wait;
+extern int box64_dynarec_test;
+extern int box64_dynarec_missing;
#ifdef ARM64
extern int arm64_asimd;
extern int arm64_aes;
extern int arm64_pmull;
extern int arm64_crc32;
extern int arm64_atomics;
+#elif defined(RV64)
+extern int rv64_zba;
+extern int rv64_zbb;
+extern int rv64_zbc;
+extern int rv64_zbs;
#endif
#endif
extern int box64_libcef;
@@ -95,7 +103,7 @@ void printf_ftrace(const char* fmt, ...);
#define EXPORTDYN
#endif
-void init_malloc_hook();
+void init_malloc_hook(void);
extern size_t(*box_malloc_usable_size)(void*);
#ifdef ANDROID
extern void*(*__libc_malloc)(size_t);
diff --git a/src/include/dictionnary.h b/src/include/dictionnary.h
index e2ec146..efa5e1c 100755..100644
--- a/src/include/dictionnary.h
+++ b/src/include/dictionnary.h
@@ -4,7 +4,7 @@
typedef void dic_t;
-dic_t *NewDictionnary();
+dic_t *NewDictionnary(void);
void FreeDictionnary(dic_t **dic);
const char* AddDictionnary(dic_t* dic, const char* s);
diff --git a/src/include/dynablock.h b/src/include/dynablock.h
index 1868dee..757ca4a 100755..100644
--- a/src/include/dynablock.h
+++ b/src/include/dynablock.h
@@ -9,14 +9,16 @@ void FreeDynablock(dynablock_t* db, int need_lock);
void MarkDynablock(dynablock_t* db);
void MarkRangeDynablock(dynablock_t* db, uintptr_t addr, uintptr_t size);
int FreeRangeDynablock(dynablock_t* db, uintptr_t addr, uintptr_t size);
+void FreeInvalidDynablock(dynablock_t* db, int need_lock);
+dynablock_t* InvalidDynablock(dynablock_t* db, int need_lock);
dynablock_t* FindDynablockFromNativeAddress(void* addr); // defined in box64context.h
// Handling of Dynarec block (i.e. an exectable chunk of x64 translated code)
-dynablock_t* DBGetBlock(x64emu_t* emu, uintptr_t addr, int create); // return NULL if block is not found / cannot be created. Don't create if create==0
-dynablock_t* DBAlternateBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr);
+dynablock_t* DBGetBlock(x64emu_t* emu, uintptr_t addr, int create, int is32bits); // return NULL if block is not found / cannot be created. Don't create if create==0
+dynablock_t* DBAlternateBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr, int is32bits);
// for use in signal handler
-void cancelFillBlock();
+void cancelFillBlock(void);
#endif //__DYNABLOCK_H_ \ No newline at end of file
diff --git a/src/include/dynarec.h b/src/include/dynarec.h
index a68c6d6..64da604 100755..100644
--- a/src/include/dynarec.h
+++ b/src/include/dynarec.h
@@ -5,4 +5,7 @@ typedef struct x64emu_s x64emu_t;
void DynaCall(x64emu_t* emu, uintptr_t addr); // try to use DynaRec... Fallback to EmuCall if no dynarec available
+void x64test_init(x64emu_t* ref, uintptr_t ip);
+void x64test_check(x64emu_t* ref, uintptr_t ip);
+
#endif // __DYNAREC_H_ \ No newline at end of file
diff --git a/src/include/dynarec_native.h b/src/include/dynarec_native.h
index eff5a6b..05bfc3b 100755..100644
--- a/src/include/dynarec_native.h
+++ b/src/include/dynarec_native.h
@@ -5,9 +5,22 @@ typedef struct dynablock_s dynablock_t;
typedef struct x64emu_s x64emu_t;
typedef struct instsize_s instsize_t;
+//#define USE_CUSTOM_MEM
+#ifdef USE_CUSTOM_MEM
+#define dynaMalloc customMalloc
+#define dynaCalloc customCalloc
+#define dynaRealloc customRealloc
+#define dynaFree customFree
+#else
+#define dynaMalloc box_malloc
+#define dynaCalloc box_calloc
+#define dynaRealloc box_realloc
+#define dynaFree box_free
+#endif
+
void addInst(instsize_t* insts, size_t* size, int x64_size, int native_size);
void CancelBlock64(int need_lock);
-void* FillBlock64(dynablock_t* block, uintptr_t addr);
+void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bits);
#endif //__DYNAREC_ARM_H_ \ No newline at end of file
diff --git a/src/include/dynarec_rv64.h b/src/include/dynarec_rv64.h
new file mode 100644
index 0000000..dd3b734
--- /dev/null
+++ b/src/include/dynarec_rv64.h
@@ -0,0 +1,10 @@
+#ifndef __DYNAREC_RV64_H_
+#define __DYNAREC_RV64_H_
+
+typedef struct dynablock_s dynablock_t;
+typedef struct x64emu_s x64emu_t;
+
+void CancelBlock64(void);
+void* FillBlock64(dynablock_t* block, uintptr_t addr);
+
+#endif //__DYNAREC_RV64_H_ \ No newline at end of file
diff --git a/src/include/elfload_dump.h b/src/include/elfload_dump.h
index ce0e9c1..ce0e9c1 100755..100644
--- a/src/include/elfload_dump.h
+++ b/src/include/elfload_dump.h
diff --git a/src/include/elfloader.h b/src/include/elfloader.h
index d5116f5..ca8839d 100755..100644
--- a/src/include/elfloader.h
+++ b/src/include/elfloader.h
@@ -9,6 +9,7 @@ typedef struct kh_mapsymbols_s kh_mapsymbols_t;
typedef struct box64context_s box64context_t;
typedef struct x64emu_s x64emu_t;
typedef struct needed_libs_s needed_libs_t;
+typedef struct kh_defaultversion_s kh_defaultversion_t;
#ifdef DYNAREC
typedef struct dynablock_s dynablock_t;
#endif
@@ -24,6 +25,7 @@ int CalcLoadAddr(elfheader_t* head);
int AllocElfMemory(box64context_t* context, elfheader_t* head, int mainbin);
void FreeElfMemory(elfheader_t* head);
int LoadElfMemory(FILE* f, box64context_t* context, elfheader_t* head);
+int isElfHasNeededVer(elfheader_t* head, const char* libname, elfheader_t* verneeded);
int ReloadElfMemory(FILE* f, box64context_t* context, elfheader_t* head);
int RelocateElf(lib_t *maplib, lib_t* local_maplib, int bindnow, elfheader_t* head);
int RelocateElfPlt(lib_t *maplib, lib_t* local_maplib, int bindnow, elfheader_t* head);
@@ -37,7 +39,7 @@ uintptr_t GetElfFini(elfheader_t* h);
void RefreshElfTLS(elfheader_t* h);
void RunElfInit(elfheader_t* h, x64emu_t *emu);
void RunElfFini(elfheader_t* h, x64emu_t *emu);
-void RunDeferedElfInit(x64emu_t *emu);
+void RunDeferredElfInit(x64emu_t *emu);
void MarkElfInitDone(elfheader_t* h);
void* GetBaseAddress(elfheader_t* h);
void* GetElfDelta(elfheader_t* h);
@@ -60,15 +62,19 @@ int ElfCheckIfUseTCMallocMinimal(elfheader_t* h); // return 1 if tcmalloc is u
const char* GetSymbolVersion(elfheader_t* h, int version);
const char* GetParentSymbolVersion(elfheader_t* h, int index);
-const char* VersionnedName(const char* name, int ver, const char* vername);
-int SameVersionnedSymbol(const char* name1, int ver1, const char* vername1, const char* name2, int ver2, const char* vername2);
+const char* VersionedName(const char* name, int ver, const char* vername);
+int SameVersionedSymbol(const char* name1, int ver1, const char* vername1, const char* name2, int ver2, const char* vername2);
int GetVersionIndice(elfheader_t* h, const char* vername);
+int GetNeededVersionCnt(elfheader_t* h, const char* libname);
+const char* GetNeededVersionString(elfheader_t* h, const char* libname, int idx);
kh_mapsymbols_t* GetMapSymbols(elfheader_t* h);
kh_mapsymbols_t* GetWeakSymbols(elfheader_t* h);
kh_mapsymbols_t* GetLocalSymbols(elfheader_t* h);
+kh_defaultversion_t* GetGlobalDefaultVersion(elfheader_t* h);
+kh_defaultversion_t* GetWeakDefaultVersion(elfheader_t* h);
-void* GetNativeSymbolUnversionned(void* lib, const char* name);
+void* GetNativeSymbolUnversioned(void* lib, const char* name);
void AddMainElfToLinkmap(elfheader_t* lib);
diff --git a/src/include/fileutils.h b/src/include/fileutils.h
index c666f0b..2e983c7 100755..100644
--- a/src/include/fileutils.h
+++ b/src/include/fileutils.h
@@ -19,13 +19,13 @@ int FileIsX64ELF(const char* filename);
int FileIsShell(const char* filename);
// return temp folder (will return /tmp if nothing is correct)
-const char* GetTmpDir();
+const char* GetTmpDir(void);
// will lower case the string and return a copy. Nothing fancy here, just A..Z transformed to a..z, rest is untouched
char* LowerCase(const char* s);
#if defined(RPI) || defined(RK3399) || defined(RK3326)
-void sanitize_mojosetup_gtk_background();
+void sanitize_mojosetup_gtk_background(void);
#endif
#endif //__FILEUTILS_H_ \ No newline at end of file
diff --git a/src/include/globalsymbols.h b/src/include/globalsymbols.h
index fc2753e..d0eb301 100755..100644
--- a/src/include/globalsymbols.h
+++ b/src/include/globalsymbols.h
@@ -2,18 +2,18 @@
#define _GLOBAL_SYMBOLS_H_
//GTK stuff
-void my_checkGlobalGdkDisplay();
-void my_setGlobalGThreadsInit();
+void my_checkGlobalGdkDisplay(void);
+void my_setGlobalGThreadsInit(void);
-//void** my_GetGTKDisplay();
-void** my_GetGthreadsGotInitialized(); // defined in wrappedgthread2
+//void** my_GetGTKDisplay(void);
+void** my_GetGthreadsGotInitialized(void); // defined in wrappedgthread2
// NCurse / TInfo
-void my_checkGlobalTInfo();
-void my_updateGlobalTInfo();
+void my_checkGlobalTInfo(void);
+void my_updateGlobalTInfo(void);
// getopt
-void my_checkGlobalOpt();
-void my_updateGlobalOpt();
+void my_checkGlobalOpt(void);
+void my_updateGlobalOpt(void);
#endif //_GLOBAL_SYMBOLS_H_ \ No newline at end of file
diff --git a/src/include/gtkclass.h b/src/include/gtkclass.h
index 6e8d302..8a88a0d 100755..100644
--- a/src/include/gtkclass.h
+++ b/src/include/gtkclass.h
@@ -55,6 +55,41 @@ typedef struct my_GInitiallyUnownedClass_s
void* pdummy[6];
} my_GInitiallyUnownedClass_t;
+typedef struct my_GamesScoresImporterClass_s
+{
+ my_GObjectClass_t parent_class;
+ void (*importOldScores) (void *self, void* context, void* new_scores_dir, void *error);
+}my_GamesScoresImporterClass_t;
+
+typedef struct my_GApplicationClass_s
+{
+ void* construct_properties;
+ void (* startup) (void* application);
+ void (* activate) (void* application);
+ void (* open) (void* application, void* files, int n_files, void* hint);
+ int (* command_line) (void* application, void* command_line);
+ int (* local_command_line) (void* application, void* arguments, void* exit_status);
+ void (* before_emit) (void* application, void* platform_data);
+ void (* after_emit) (void* application, void* platform_data);
+ void (* add_platform_data) (void* application, void* builder);
+ void (* quit_mainloop) (void* application);
+ void (* run_mainloop) (void* application);
+ void (* shutdown) (void* application);
+ int (* dbus_register) (void* application, void* connection, void* object_path, void* error);
+ void (* dbus_unregister) (void* appvoidlication, void* connection, void* object_path);
+ int (* handle_local_options) (void* application, void* options);
+ int (* name_lost) (void* application);
+ uint32_t flags;
+ void* pdummy[6];
+} my_GApplicationClass_t;
+
+typedef struct my_GtkApplicationClass_s
+{
+ my_GApplicationClass_t parent_class;
+ void (*window_added) (void* application, void* window);
+ void (*window_removed) (void* application, void* window);
+} my_GtkApplicationClass_t;
+
typedef struct my_GtkObjectClass_s
{
my_GObjectClass_t parent_class;
@@ -283,6 +318,7 @@ typedef struct my_GtkActionClass_s
void (* connect_proxy) (void* action, void* proxy);
void (* disconnect_proxy) (void* action, void* proxy);
void* (* create_menu) (void* action);
+ void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
@@ -293,6 +329,21 @@ typedef struct my_GtkMisc2Class_s
my_GtkWidget2Class_t parent_class;
} my_GtkMisc2Class_t;
+typedef struct my_GtkMisc3Class_s
+{
+ my_GtkWidget3Class_t parent_class;
+ void (*_gtk_reserved1) (void);
+ void (*_gtk_reserved2) (void);
+ void (*_gtk_reserved3) (void);
+ void (*_gtk_reserved4) (void);
+} my_GtkMisc3Class_t;
+
+typedef struct my_GtkMenuButtonClass_s
+{
+ my_GtkWidget3Class_t parent_class;
+ void (* activate) (void *self);
+}my_GtkMenuButtonClass_t;
+
typedef struct my_GtkLabel2Class_s
{
my_GtkMisc2Class_t parent_class;
@@ -305,6 +356,23 @@ typedef struct my_GtkLabel2Class_s
void (*_gtk_reserved3) (void);
} my_GtkLabel2Class_t;
+typedef struct my_GtkLabel3Class_s
+{
+ my_GtkMisc3Class_t parent_class;
+ void (* move_cursor) (void* label, int step, int count, int extend_selection);
+ void (* copy_clipboard) (void* label);
+ void (* populate_popup) (void* label, void* menu);
+ int (*activate_link) (void* label, void* uri);
+ void (*_gtk_reserved1) (void);
+ void (*_gtk_reserved2) (void);
+ void (*_gtk_reserved3) (void);
+ void (*_gtk_reserved4) (void);
+ void (*_gtk_reserved5) (void);
+ void (*_gtk_reserved6) (void);
+ void (*_gtk_reserved7) (void);
+ void (*_gtk_reserved8) (void);
+} my_GtkLabel3Class_t;
+
typedef struct my_GtkTreeView2Class_s
{
my_GtkContainer2Class_t parent_class;
@@ -340,6 +408,15 @@ typedef struct my_GtkBin2Class_s
void (*_gtk_reserved4) (void);
} my_GtkBin2Class_t;
+typedef struct my_GtkBin3Class_s
+{
+ my_GtkContainer3Class_t parent_class;
+ void (*_gtk_reserved1) (void);
+ void (*_gtk_reserved2) (void);
+ void (*_gtk_reserved3) (void);
+ void (*_gtk_reserved4) (void);
+} my_GtkBin3Class_t;
+
typedef struct my_GtkWindow2Class_s {
my_GtkBin2Class_t parent_class;
void (* set_focus) (void* window, void* focus);
@@ -354,6 +431,47 @@ typedef struct my_GtkWindow2Class_s {
void (*_gtk_reserved4) (void);
} my_GtkWindow2Class_t;
+typedef struct my_GtkWindow3Class_s
+{
+ my_GtkBin3Class_t parent_class;
+ void (* set_focus) (void* window, void* focus);
+ void (* activate_focus) (void* window);
+ void (* activate_default) (void* window);
+ void (* keys_changed) (void* window);
+ int (* enable_debugging) (void* window, int toggle);
+ void (* _gtk_reserved1) (void);
+ void (* _gtk_reserved2) (void);
+ void (* _gtk_reserved3) (void);
+}my_GtkWindow3Class_t;
+
+typedef struct my_GtkApplicationWindowClass_s
+{
+ my_GtkWindow3Class_t parent_class;
+}my_GtkApplicationWindowClass_t;
+
+typedef struct my_GtkListBoxClass_s
+{
+ my_GtkContainer3Class_t parent_class;
+ void (*row_selected) (void *box, void *row);
+ void (*row_activated) (void *box, void *row);
+ void (*activate_cursor_row) (void *box);
+ void (*toggle_cursor_row) (void *box);
+ void (*move_cursor) (void *box, int step, int count);
+ void (*selected_rows_changed) (void *box);
+ void (*select_all) (void *box);
+ void (*unselect_all) (void *box);
+ void (* _gtk_reserved1) (void);
+ void (* _gtk_reserved2) (void);
+ void (* _gtk_reserved3) (void);
+}my_GtkListBoxClass_t;
+
+typedef struct my_GtkListBoxRowClass_s {
+ my_GtkBin3Class_t parent_class;
+ void (* activate) (void* row);
+ void (* _gtk_reserved1) (void);
+ void (* _gtk_reserved2) (void);
+}my_GtkListBoxRowClass_t;
+
typedef struct my_GtkButton2Class_s {
my_GtkBin2Class_t parent_class;
void (* pressed) (void *button);
@@ -368,6 +486,20 @@ typedef struct my_GtkButton2Class_s {
void (*_gtk_reserved4) (void);
} my_GtkButton2Class_t;
+typedef struct my_GtkButton3Class_s {
+ my_GtkBin3Class_t parent_class;
+ void (* pressed) (void *button);
+ void (* released) (void *button);
+ void (* clicked) (void *button);
+ void (* enter) (void *button);
+ void (* leave) (void *button);
+ void (* activate) (void *button);
+ void (*_gtk_reserved1) (void);
+ void (*_gtk_reserved2) (void);
+ void (*_gtk_reserved3) (void);
+ void (*_gtk_reserved4) (void);
+} my_GtkButton3Class_t;
+
typedef struct my_GtkToggleButton2Class_s {
my_GtkButton2Class_t parent_class;
void (* toggled) (void* toggle_button);
@@ -517,6 +649,53 @@ typedef struct my_GtkTextView3Class_s {
void (*_gtk_reserved4) (void);
} my_GtkTextView3Class_t;
+typedef struct my_GtkGrid3Class_s {
+ my_GtkContainer3Class_t parent_class;
+ void (* _gtk_reserved1) (void);
+ void (* _gtk_reserved2) (void);
+ void (* _gtk_reserved3) (void);
+ void (* _gtk_reserved4) (void);
+ void (* _gtk_reserved5) (void);
+ void (* _gtk_reserved6) (void);
+ void (* _gtk_reserved7) (void);
+ void (* _gtk_reserved8) (void);
+}my_GtkGrid3Class_t;
+
+typedef struct my_GtkEventControllerClass_s {
+ my_GObjectClass_t parent_class;
+ void (* set_widget) (void *controller, void *widget);
+ void (* unset_widget) (void *controller);
+ int (* handle_event) (void *controller, void *event, double x, double y);
+ void (* reset) (void *controller);
+ void (* handle_crossing) (void *controller, void *crossing, double x, double y);
+ int (* filter_event) (void *controller, void *event);
+ void* padding[10];
+}my_GtkEventControllerClass_t;
+
+typedef struct my_GtkGestureClass_s {
+ my_GtkEventControllerClass_t parent_class;
+ int (* check) (void *gesture);
+ void (* begin) (void *gesture, void *sequence);
+ void (* update) (void *gesture, void *sequence);
+ void (* end) (void *gesture, void *sequence);
+ void (* cancel) (void *gesture, void *sequence);
+ void (* sequence_state_changed) (void *gesture, void *sequence, int state);
+ void* padding[10];
+}my_GtkGestureClass_t;
+
+typedef struct my_GtkGestureSingleClass_s {
+ my_GtkGestureClass_t parent_class;
+ void* padding[10];
+}my_GtkGestureSingleClass_t;
+
+typedef struct my_GtkGestureLongPressClass_s {
+ my_GtkGestureSingleClass_t parent_class;
+ void (* pressed) (void *gesture, double x, double y);
+ void (* cancelled) (void *gesture);
+ /*< private >*/
+ void* padding[10];
+}my_GtkGestureLongPressClass_t;
+
typedef struct my_MetaFrames2Class_s
{
my_GtkWindow2Class_t parent_class;
@@ -599,6 +778,22 @@ typedef struct my_GstAllocatorClass_s {
void* _gst_reserved[4];
} my_GstAllocatorClass_t;
+typedef struct my_GstTaskPoolClass_s {
+ my_GstObjectClass_t parent_class;
+ void (*prepare) (void* pool, void* error);
+ void (*cleanup) (void* pool);
+ void* (*push) (void* pool, void* func, void* user_data, void* error);
+ void (*join) (void* pool, void* id);
+ void (*dispose_handle) (void* pool, void* id);
+ void* _gst_reserved[4-1];
+} my_GstTaskPoolClass_t;
+
+typedef struct my_GDBusProxyClass_s {
+ my_GObjectClass_t parent_class;
+ void (*g_properties_changed) (void* proxy, void* changed_properties, const char* const* invalidated_properties);
+ void (*g_signal) (void* proxy, const char* sender_name, const char* signal_name, void* parameters);
+ void* padding[32];
+} my_GDBusProxyClass_t;
// GTypeValueTable
typedef struct my_GTypeValueTable_s {
@@ -652,11 +847,14 @@ my_GTypeInfo_t* findFreeGTypeInfo(my_GTypeInfo_t* fcts, size_t parent);
my_GtkTypeInfo_t* findFreeGtkTypeInfo(my_GtkTypeInfo_t* fcts, size_t parent);
void InitGTKClass(bridge_t *bridge);
-void FiniGTKClass();
+void FiniGTKClass(void);
#define GTKCLASSES() \
GTKCLASS(GObject) \
GTKCLASS(GInitiallyUnowned) \
+GTKCLASS(GamesScoresImporter) \
+GTKCLASS(GApplication) \
+GTKCLASS(GtkApplication) \
GTKCLASS(GtkObject) \
GTKCLASS(GtkWidget2) \
GTKCLASS(GtkWidget3) \
@@ -664,13 +862,21 @@ GTKCLASS(GtkContainer2) \
GTKCLASS(GtkContainer3) \
GTKCLASS(GtkAction) \
GTKCLASS(GtkLabel2) \
+GTKCLASS(GtkLabel3) \
GTKCLASS(GtkMisc2) \
+GTKCLASS(GtkMisc3) \
GTKCLASS(GtkTreeView2) \
GTKCLASS(GtkBin2) \
+GTKCLASS(GtkBin3) \
GTKCLASS(GtkWindow2) \
+GTKCLASS(GtkWindow3) \
GTKCLASS(GtkTable2) \
GTKCLASS(GtkFixed2) \
+GTKCLASS(GtkApplicationWindow) \
+GTKCLASS(GtkListBox) \
+GTKCLASS(GtkListBoxRow) \
GTKCLASS(GtkButton2) \
+GTKCLASS(GtkButton3) \
GTKCLASS(GtkComboBox2) \
GTKCLASS(GtkToggleButton2) \
GTKCLASS(GtkCheckButton2) \
@@ -683,12 +889,19 @@ GTKCLASS(GtkMenuShell2) \
GTKCLASS(GtkMenuBar2) \
GTKCLASS(GtkTextView2) \
GTKCLASS(GtkTextView3) \
+GTKCLASS(GtkGrid3) \
+GTKCLASS(GtkEventController) \
+GTKCLASS(GtkGesture) \
+GTKCLASS(GtkGestureSingle) \
+GTKCLASS(GtkGestureLongPress) \
GTKCLASS(MetaFrames2) \
GTKCLASS(GDBusObjectManagerClient) \
GTKCLASS(AtkObject) \
GTKCLASS(AtkUtil) \
GTKCLASS(GstObject) \
GTKCLASS(GstAllocator) \
+GTKCLASS(GstTaskPool) \
+GTKCLASS(GDBusProxy) \
#define GTKCLASS(A) void Set##A##ID(size_t id);
GTKCLASSES()
@@ -717,4 +930,4 @@ int my_signal_cb(void* a, void* b, void* c, void* d);
void my_add_signal_offset(size_t klass, uint32_t offset, int n);
-#endif //__GTKCLASS_H__ \ No newline at end of file
+#endif //__GTKCLASS_H__
diff --git a/src/include/khash.h b/src/include/khash.h
index 9d20a0e..9d20a0e 100755..100644
--- a/src/include/khash.h
+++ b/src/include/khash.h
diff --git a/src/include/librarian.h b/src/include/librarian.h
index 5c1fe0f..6fc8932 100755..100644
--- a/src/include/librarian.h
+++ b/src/include/librarian.h
@@ -16,21 +16,29 @@ typedef char* cstr_t;
lib_t *NewLibrarian(box64context_t* context, int ownlibs);
void FreeLibrarian(lib_t **maplib, x64emu_t* emu);
-dlprivate_t *NewDLPrivate();
+dlprivate_t *NewDLPrivate(void);
void FreeDLPrivate(dlprivate_t **lib);
box64context_t* GetLibrarianContext(lib_t* maplib);
kh_mapsymbols_t* GetGlobalData(lib_t* maplib);
-int AddNeededLib(lib_t* maplib, int local, int bindnow, needed_libs_t* needed, box64context_t* box64, x64emu_t* emu); // 0=success, 1=error
+int AddNeededLib(lib_t* maplib, int local, int bindnow, needed_libs_t* needed, elfheader_t* verneeded, box64context_t* box64, x64emu_t* emu); // 0=success, 1=error
+void RemoveNeededLib(lib_t* maplib, int local, needed_libs_t* needed, box64context_t* box64, x64emu_t* emu);
library_t* GetLibMapLib(lib_t* maplib, const char* name);
library_t* GetLibInternal(const char* name);
+void promoteLocalLibGlobal(library_t* lib);
+int isLibLocal(library_t* lib);
uintptr_t FindGlobalSymbol(lib_t *maplib, const char* name, int version, const char* vername);
-int GetNoSelfSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, size_t size, int version, const char* vername);
-int GetGlobalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t *self, int version, const char* vername);
-int GetGlobalNoWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, int version, const char* vername);
-int GetLocalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t *self, int version, const char* vername);
+int GetNoSelfSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, size_t size, int version, const char* vername, const char* globdefver, const char* weakdefver);
+int GetGlobalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t *self, int version, const char* vername, const char* globdefver, const char* weakdefver);
+int GetGlobalWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t *self, int version, const char* vername, const char* globdefver, const char* weakdefver);
+int GetGlobalNoWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, int version, const char* vername, const char* defver);
+int GetLocalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t *self, int version, const char* vername, const char* globdefver, const char* weakdefver);
elfheader_t* GetGlobalSymbolElf(lib_t *maplib, const char* name, int version, const char* vername);
-int IsGlobalNoWeakSymbolInNative(lib_t *maplib, const char* name, int version, const char* vername);
+int IsGlobalNoWeakSymbolInNative(lib_t *maplib, const char* name, int version, const char* vername, const char* defver);
+
+void MapLibRemoveLib(lib_t* maplib, library_t* lib);
+
+const char* GetMaplibDefaultVersion(lib_t *maplib, lib_t *local_maplib, int isweak, const char* symname);
const char* FindSymbolName(lib_t *maplib, void* p, void** start, uint64_t* sz, const char** libname, void** base, library_t** lib);
diff --git a/src/include/library.h b/src/include/library.h
index afe108e..b08927e 100755..100644
--- a/src/include/library.h
+++ b/src/include/library.h
@@ -15,19 +15,15 @@ typedef struct elfheader_s elfheader_t;
#define LIB_EMULATED 1
#define LIB_UNNKNOW -1
-library_t *NewLibrary(const char* path, box64context_t* box64);
+library_t *NewLibrary(const char* path, box64context_t* box64, elfheader_t* verneeded);
int AddSymbolsLibrary(lib_t* maplib, library_t* lib, x64emu_t* emu);
int FinalizeLibrary(library_t* lib, lib_t* local_maplib, int bindnow, x64emu_t* emu);
-int ReloadLibrary(library_t* lib, x64emu_t* emu);
-int FiniLibrary(library_t* lib, x64emu_t* emu);
-void InactiveLibrary(library_t* lib);
-void Free1Library(library_t **lib, x64emu_t* emu);
char* GetNameLib(library_t *lib);
int IsSameLib(library_t* lib, const char* path); // check if lib is same (path -> name)
-int GetLibGlobalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local);
-int GetLibWeakSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local);
-int GetLibLocalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local);
+int GetLibGlobalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local, const char* defver);
+int GetLibWeakSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local, const char* defver);
+int GetLibLocalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local, const char* defver);
char** GetNeededLibsNames(library_t* lib);
int GetNeededLibsN(library_t* lib);
library_t* GetNeededLib(library_t* lib, int idx);
@@ -37,5 +33,8 @@ int GetElfIndex(library_t* lib); // -1 if no elf (i.e. wrapped)
elfheader_t* GetElf(library_t* lib); // NULL if no elf (i.e. wrapped)
void* GetHandle(library_t* lib); // NULL if not wrapped
void IncRefCount(library_t* lib, x64emu_t* emu);
+int DecRefCount(library_t** lib, x64emu_t* emu); // might unload the lib!
+int GetRefCount(library_t* lib);
+void SetDlOpenIdx(library_t* lib, int dlopen);
#endif //__LIBRARY_H_
diff --git a/src/include/myalign.h b/src/include/myalign.h
index cc4922b..247ea1b 100755..100644
--- a/src/include/myalign.h
+++ b/src/include/myalign.h
@@ -114,8 +114,8 @@ typdef struct {
{ \
uintptr_t *p = (uintptr_t*)(SCRATCH); \
int n = (X64_VA_MAX_REG - (VA)->gp_offset)/8; \
- if(n) memcpy(&p[0], (VA)->reg_save_area, n*8); \
- memcpy(&p[n], (VA)->overflow_arg_area, 100*8); \
+ if(n) memcpy(&p[0], (VA)->reg_save_area+X64_VA_MAX_REG-n*8, n*8); \
+ memcpy(&p[n], (VA)->overflow_arg_area, 20*8); \
sysv_varargs.__offset = (VA)->gp_offset; \
sysv_varargs.__base = (char*)p; \
}
@@ -126,7 +126,7 @@ typdef struct {
uintptr_t *p = (uintptr_t*)(SCRATCH); \
p[0]=R_RDI; p[1]=R_RSI; p[2]=R_RDX; \
p[3]=R_RCX; p[4]=R_R8; p[5]=R_R9; \
- memcpy(&p[8+N], STACK, 100*8 - (8+N)*8); \
+ memcpy(&p[8+N], STACK, 20*8); \
sysv_varargs.__offset = N*8; \
sysv_varargs.__base = (char*)p; \
}
@@ -139,10 +139,11 @@ typdef struct {
#define CREATE_VALIST_FROM_VALIST(VA, SCRATCH) \
va_list sysv_varargs; \
{ \
+ if((VA)->fp_offset!=X64_VA_MAX_XMM) printf_log(LOG_DEBUG, "Warning: %s: CREATE_VALIST_FROM_VALIST with %d XMM register!\n", __FUNCTION__, (X64_VA_MAX_XMM - (VA)->fp_offset)/16);\
uintptr_t *p = (uintptr_t*)(SCRATCH); \
int n = (X64_VA_MAX_REG - (VA)->gp_offset)/8; \
- if(n) memcpy(&p[0], (VA)->reg_save_area, n*8); \
- memcpy(&p[n], (VA)->overflow_arg_area, 100*8); \
+ if(n) memcpy(&p[0], (VA)->reg_save_area+X64_VA_MAX_REG-n*8, n*8); \
+ memcpy(&p[n], (VA)->overflow_arg_area, 20*8); \
sysv_varargs = (va_list)p; \
}
// this is an approximation, and if the va_list have some float/double, it will fail!
@@ -153,7 +154,7 @@ typdef struct {
uintptr_t *p = (uintptr_t*)(SCRATCH); \
p[0]=R_RDI; p[1]=R_RSI; p[2]=R_RDX; \
p[3]=R_RCX; p[4]=R_R8; p[5]=R_R9; \
- memcpy(&p[6], STACK, 100*8); \
+ memcpy(&p[6], STACK, 20*8); \
sysv_varargs = (va_list)&p[N]; \
}
#else
@@ -213,4 +214,4 @@ void AlignSemidDs(void *dest, const void* source);
uintptr_t getVArgs(x64emu_t* emu, int pos, uintptr_t* b, int N);
-#endif //__MY_ALIGN__H_ \ No newline at end of file
+#endif //__MY_ALIGN__H_
diff --git a/src/include/pathcoll.h b/src/include/pathcoll.h
index 5b730d3..5b730d3 100755..100644
--- a/src/include/pathcoll.h
+++ b/src/include/pathcoll.h
diff --git a/src/include/rcfile.h b/src/include/rcfile.h
index c194e9a..ebad704 100644
--- a/src/include/rcfile.h
+++ b/src/include/rcfile.h
@@ -2,7 +2,7 @@
#define __RCFILE_H__
void LoadRCFile(const char* filename);
-void DeleteParams();
+void DeleteParams(void);
void ApplyParams(const char* name);
#endif //__RCFILE_H__ \ No newline at end of file
diff --git a/src/include/regs.h b/src/include/regs.h
index 0097e72..a80b393 100755..100644
--- a/src/include/regs.h
+++ b/src/include/regs.h
@@ -17,7 +17,7 @@ enum {
#define _DI _RDI
enum {
- _CS, _DS, _SS, _ES, _FS, _GS
+ _ES, _CS, _SS, _DS, _FS, _GS
};
@@ -131,7 +131,7 @@ typedef enum {
d_rcr16,
d_rcr32,
d_rcr64,
- d_dec8i, // interpretor version, to handle the CF flags that is untouched
+ d_dec8i, // interpreter version, to handle the CF flags that is untouched
d_dec16i,
d_dec32i,
d_dec64i,
@@ -140,7 +140,7 @@ typedef enum {
d_inc32i,
d_inc64i,
d_unknown //95
-} defered_flags_t;
+} deferred_flags_t;
#pragma pack(push, 1)
diff --git a/src/include/sdl1rwops.h b/src/include/sdl1rwops.h
index 46b7351..76fd890 100755..100644
--- a/src/include/sdl1rwops.h
+++ b/src/include/sdl1rwops.h
@@ -4,7 +4,7 @@
typedef struct SDL1_RWops_s SDL1_RWops_t; // the actual SDL1 SDL_RWops
typedef struct x64emu_s x64emu_t;
-typedef SDL1_RWops_t* (*sdl1_allocrw)();
+typedef SDL1_RWops_t* (*sdl1_allocrw)(void);
typedef void (*sdl1_freerw)(SDL1_RWops_t*);
// each function will be added to dictionary, and each native functions will be wrapped so they run in emulated world
diff --git a/src/include/sdl2rwops.h b/src/include/sdl2rwops.h
index f03f17c..1b13c09 100755..100644
--- a/src/include/sdl2rwops.h
+++ b/src/include/sdl2rwops.h
@@ -4,7 +4,7 @@
typedef struct SDL2_RWops_s SDL2_RWops_t; // the actual SDL2 SDL_RWops
typedef struct x64emu_s x64emu_t;
-typedef SDL2_RWops_t* (*sdl2_allocrw)();
+typedef SDL2_RWops_t* (*sdl2_allocrw)(void);
typedef void (*sdl2_freerw)(SDL2_RWops_t*);
typedef struct SDL2RWSave_s {
diff --git a/src/include/signals.h b/src/include/signals.h
index 22e96d1..3fe8a2f 100755..100644
--- a/src/include/signals.h
+++ b/src/include/signals.h
@@ -34,8 +34,9 @@ int my___sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_si
int my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigaction_restorer_t *act, x64_sigaction_restorer_t *oldact, int sigsetsize);
void init_signal_helper(box64context_t* context);
-void fini_signal_helper();
+void fini_signal_helper(void);
void emit_signal(x64emu_t* emu, int sig, void* addr, int code);
+void emit_interruption(x64emu_t* emu, int num, void* addr);
#endif //__SIGNALS_H__
diff --git a/src/include/symbols.h b/src/include/symbols.h
index b00a354..32e54b2 100644
--- a/src/include/symbols.h
+++ b/src/include/symbols.h
@@ -9,14 +9,15 @@ typedef struct versymbols_s versymbols_t;
KHASH_MAP_DECLARE_STR(mapsymbols, versymbols_t)
-kh_mapsymbols_t* NewMapSymbols();
+kh_mapsymbols_t* NewMapSymbols(void);
void FreeMapSymbols(kh_mapsymbols_t** map);
// replace if already there
void AddSymbol(kh_mapsymbols_t *mapsymbols, const char* name, uintptr_t addr, uint32_t sz, int ver, const char* vername);
uintptr_t FindSymbol(kh_mapsymbols_t *mapsymbols, const char* name, int ver, const char* vername, int local, const char* defver);
+// Update addr and sz of existing symbols
+void ForceUpdateSymbol(kh_mapsymbols_t *mapsymbols, const char* name, uintptr_t addr, uint32_t sz);
// don't add if already there
-
void AddUniqueSymbol(kh_mapsymbols_t *mapsymbols, const char* name, uintptr_t addr, uint32_t sz, int ver, const char* vername);
int GetSymbolStartEnd(kh_mapsymbols_t* mapsymbols, const char* name, uintptr_t* start, uintptr_t* end, int ver, const char* vername, int local, const char* defver);
int GetSizedSymbolStartEnd(kh_mapsymbols_t* mapsymbols, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int ver, const char* vername, int local, const char* defver);
@@ -24,7 +25,7 @@ const char* GetSymbolName(kh_mapsymbols_t* mapsymbols, void* p, uintptr_t* offs,
// default version handling
KHASH_MAP_DECLARE_STR(defaultversion, const char*)
-kh_defaultversion_t* NewDefaultVersion();
+kh_defaultversion_t* NewDefaultVersion(void);
void FreeDefaultVersion(kh_defaultversion_t** def);
void AddDefaultVersion(kh_defaultversion_t* def, const char* symname, const char* vername);
diff --git a/src/include/threads.h b/src/include/threads.h
index d094dc0..af58046 100755..100644
--- a/src/include/threads.h
+++ b/src/include/threads.h
@@ -4,25 +4,15 @@
typedef struct box64context_s box64context_t;
typedef struct x64emu_s x64emu_t;
-typedef struct emu_jmpbuf_s {
- x64emu_t* emu;
- void* jmpbuf;
- int jmpbuf_ok;
-} emu_jmpbuf_t;
-
void CleanStackSize(box64context_t* context);
-emu_jmpbuf_t* GetJmpBuf();
-
-void init_pthread_helper();
+void init_pthread_helper(void);
void fini_pthread_helper(box64context_t* context);
// prepare an "emuthread structure" in pet and return address of function pointer for a "thread creation routine"
void* my_prepare_thread(x64emu_t *emu, void* f, void* arg, int ssize, void** pet);
-#ifndef DYNAREC
//check and unlock if a mutex is locked by current thread (works only for PTHREAD_MUTEX_ERRORCHECK typed mutex)
int checkUnlockMutex(void* m);
-#endif
#endif //_THREADS_H_ \ No newline at end of file
diff --git a/src/include/wine_tools.h b/src/include/wine_tools.h
index 52993ce..5c60fec 100755..100644
--- a/src/include/wine_tools.h
+++ b/src/include/wine_tools.h
@@ -4,10 +4,10 @@
void wine_prereserve(const char* reserve);
extern int wine_preloaded;
-void* get_wine_prereserve();
+void* get_wine_prereserve(void);
#ifdef DYNAREC
-void dynarec_wine_prereserve();
+void dynarec_wine_prereserve(void);
#endif
#endif //__WINE_TOOLS_H__
diff --git a/src/include/wrappedlibs.h b/src/include/wrappedlibs.h
index 07014e4..2d87a93 100755..100644
--- a/src/include/wrappedlibs.h
+++ b/src/include/wrappedlibs.h
@@ -7,7 +7,7 @@ typedef struct box64context_s box64context_t;
typedef int (*wrappedlib_init_t)(library_t * lib, box64context_t* box64); // 0 = success
typedef void (*wrappedlib_fini_t)(library_t * lib);
-typedef int (*wrappedlib_get_t)(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t size, int* weak, int version, const char* vername, int local);
+typedef int (*wrappedlib_get_t)(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t size, int* weak, int version, const char* vername, int local, const char* defver);
void setNeededLibs(library_t* lib, int n, ...);
#define SETALT(A) lib->w.altmy = box_strdup(#A)
diff --git a/src/include/x64emu.h b/src/include/x64emu.h
index e7efbb0..51a27a1 100755..100644
--- a/src/include/x64emu.h
+++ b/src/include/x64emu.h
@@ -6,14 +6,15 @@ typedef struct box64context_s box64context_t;
x64emu_t *NewX64Emu(box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack);
x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack);
-void SetupX64Emu(x64emu_t *emu);
+void SetupX64Emu(x64emu_t *emu, x64emu_t *ref);
void FreeX64Emu(x64emu_t **x64emu);
void FreeX64EmuFromStack(x64emu_t **emu);
void CloneEmu(x64emu_t *newemu, const x64emu_t* emu);
+void CopyEmu(x64emu_t *newemu, const x64emu_t* emu);
void SetTraceEmu(uintptr_t trace_start, uintptr_t trace_end);
box64context_t* GetEmuContext(x64emu_t* emu);
-uint32_t* GetParityTab();
+uint32_t* GetParityTab(void);
uint32_t GetEAX(x64emu_t *emu);
uint64_t GetRAX(x64emu_t *emu);
@@ -40,17 +41,15 @@ uint64_t GetRSP(x64emu_t *emu);
uint64_t GetRBP(x64emu_t *emu);
void ResetFlags(x64emu_t *emu);
void ResetSegmentsCache(x64emu_t *emu);
-const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip);
+const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits);
-void StopEmu(x64emu_t* emu, const char* reason);
-void PushExit(x64emu_t* emu);
-void* GetExit();
+void StopEmu(x64emu_t* emu, const char* reason, int is32bits);
void EmuCall(x64emu_t* emu, uintptr_t addr);
-void AddCleanup(x64emu_t *emu, void *p);
-void AddCleanup1Arg(x64emu_t *emu, void *p, void* a);
+void AddCleanup(x64emu_t *emu, void *p, void* dso_handle);
+void AddCleanup1Arg(x64emu_t *emu, void *p, void* a, void* dso_handle);
void CallCleanup(x64emu_t *emu, void* p);
void CallAllCleanup(x64emu_t *emu);
-void UnimpOpcode(x64emu_t* emu);
+void UnimpOpcode(x64emu_t* emu, int is32bits);
uint64_t ReadTSC(x64emu_t* emu);
@@ -59,7 +58,7 @@ long double LD2localLD(void* ld); // long double (80bits pointer) -> long
void LD2D(void* ld, void* d); // long double (80bits) -> double (64bits)
void D2LD(void* d, void* ld); // double (64bits) -> long double (64bits)
-void printFunctionAddr(uintptr_t nextaddr, const char* text);
+int printFunctionAddr(uintptr_t nextaddr, const char* text); // 0 if nothing was found
const char* getAddrFunctionName(uintptr_t addr);
#endif //__X86EMU_H_ \ No newline at end of file
diff --git a/src/include/x64run.h b/src/include/x64run.h
index 78903bb..b6c9e96 100755..100644
--- a/src/include/x64run.h
+++ b/src/include/x64run.h
@@ -3,12 +3,14 @@
#include <stdint.h>
typedef struct x64emu_s x64emu_t;
+typedef struct x64test_s x64test_t;
int Run(x64emu_t *emu, int step); // 0 if run was successfull, 1 if error in x86 world
-int DynaRun(x64emu_t *emu);
+int RunTest(x64test_t *test);
+void DynaRun(x64emu_t *emu);
uint32_t LibSyscall(x64emu_t *emu);
void PltResolver(x64emu_t* emu);
extern uintptr_t pltResolver;
-int GetTID();
+int GetTID(void);
#endif //__X64RUN_H_ \ No newline at end of file
diff --git a/src/include/x64tls.h b/src/include/x64tls.h
index f26827c..66f0d9e 100755..100644
--- a/src/include/x64tls.h
+++ b/src/include/x64tls.h
@@ -2,12 +2,12 @@
#define __X64_TLS_H__
typedef struct thread_area_s thread_area_t;
+typedef struct thread_area_32_s thread_area_32_t;
-uint32_t my_set_thread_area(thread_area_t* td);
+uint32_t my_set_thread_area_32(x64emu_t* emu, thread_area_32_t* td);
uint32_t my_modify_ldt(x64emu_t* emu, int op, thread_area_t* td, int size);
-void* fillTLSData(box64context_t *context);
-void* resizeTLSData(box64context_t *context, void* oldptr);
+tlsdatasize_t* getTLSData(box64context_t *context);
void* GetSegmentBase(uint32_t desc);
int my_arch_prctl(x64emu_t *emu, int code, void* addr);
diff --git a/src/include/x64trace.h b/src/include/x64trace.h
index 662f274..e7c3efd 100755..100644
--- a/src/include/x64trace.h
+++ b/src/include/x64trace.h
@@ -8,10 +8,11 @@ typedef struct zydis_dec_s zydis_dec_t;
int InitX64Trace(box64context_t *context);
void DeleteX64Trace(box64context_t *context);
+zydis_dec_t* InitX86TraceDecoder(box64context_t *context);
+void DeleteX86TraceDecoder(zydis_dec_t **dec);
zydis_dec_t* InitX64TraceDecoder(box64context_t *context);
void DeleteX64TraceDecoder(zydis_dec_t **dec);
-const char* DecodeX64Trace(zydis_dec_t *dec, uintptr_t p);
-#define ZYDIS_RUNTIME_ADDRESS_NONE (uint64_t)(-1)
+const char* DecodeX64Trace(zydis_dec_t *dec, uintptr_t p);
#endif //__X64TRACE_H_ \ No newline at end of file
diff --git a/src/librarian/dictionnary.c b/src/librarian/dictionnary.c
index 9d5e375..9d5e375 100755..100644
--- a/src/librarian/dictionnary.c
+++ b/src/librarian/dictionnary.c
diff --git a/src/librarian/globalsymbols.c b/src/librarian/globalsymbols.c
index 3a932d8..462af7f 100755..100644
--- a/src/librarian/globalsymbols.c
+++ b/src/librarian/globalsymbols.c
@@ -16,16 +16,24 @@
// workaround for Globals symbols
-#define GLOB(A) \
- if (GetGlobalNoWeakSymbolStartEnd(my_context->maplib, #A, &globoffs, &globend, -1, NULL)) { \
- printf_log(LOG_DEBUG, "Global " #A " workaround, @%p <- %p\n", (void*)globoffs, &A); \
- memcpy((void*)globoffs, &A, sizeof(A)); \
+#define GLOB(A, B) \
+ if (GetGlobalNoWeakSymbolStartEnd(my_context->maplib, #A, &globoffs, &globend, -1, NULL, NULL)) { \
+ printf_log(LOG_DEBUG, "Global " #A " workaround, @%p <- %p\n", (void*)globoffs, &A); \
+ memcpy((void*)globoffs, &A, sizeof(A)); \
+ } \
+ if (B && GetGlobalNoWeakSymbolStartEnd(my_context->maplib, #A, &globoffs, &globend, -1, NULL, B)) { \
+ printf_log(LOG_DEBUG, "Global " #A " workaround, @%p <- %p\n", (void*)globoffs, &A); \
+ memcpy((void*)globoffs, &A, sizeof(A)); \
}
-#define TOGLOB(A) \
- if (GetGlobalNoWeakSymbolStartEnd(my_context->maplib, #A, &globoffs, &globend, -1, NULL)) { \
- printf_log(LOG_DEBUG, "Global " #A " workaround, @%p -> %p\n", (void*)globoffs, &A); \
- memcpy(&A, (void*)globoffs, sizeof(A)); \
+#define TOGLOB(A, B) \
+ if (GetGlobalNoWeakSymbolStartEnd(my_context->maplib, #A, &globoffs, &globend, -1, NULL, NULL)) { \
+ printf_log(LOG_DEBUG, "Global " #A " workaround, @%p -> %p\n", (void*)globoffs, &A); \
+ memcpy(&A, (void*)globoffs, sizeof(A)); \
+ } \
+ if (B && GetGlobalNoWeakSymbolStartEnd(my_context->maplib, #A, &globoffs, &globend, -1, NULL, B)) { \
+ printf_log(LOG_DEBUG, "Global " #A " workaround, @%p -> %p\n", (void*)globoffs, &A); \
+ memcpy(&A, (void*)globoffs, sizeof(A)); \
}
@@ -35,14 +43,14 @@ EXPORT void* gdk_display = NULL; // in case it's used...
void my_checkGlobalGdkDisplay()
{
uintptr_t globoffs, globend;
- GLOB(gdk_display)
+ GLOB(gdk_display, NULL)
}
void my_setGlobalGThreadsInit()
{
int val = 1;
uintptr_t globoffs, globend;
- if (GetGlobalNoWeakSymbolStartEnd(my_context->maplib, "g_threads_got_initialized", &globoffs, &globend, -1, NULL)) {
+ if (GetGlobalNoWeakSymbolStartEnd(my_context->maplib, "g_threads_got_initialized", &globoffs, &globend, -1, NULL, NULL)) {
printf_log(LOG_DEBUG, "Global g_threads_got_initialized workaround, @%p <= %d\n", (void*)globoffs, val);
memcpy((void*)globoffs, &val, sizeof(val));
}
@@ -79,35 +87,35 @@ EXPORT void* ttytype;
void my_checkGlobalTInfo()
{
uintptr_t globoffs, globend;
- GLOB(COLS)
- GLOB(LINES)
- GLOB(TABSIZE)
- GLOB(curscr)
- GLOB(newscr)
- GLOB(stdscr)
- GLOB(acs_map)
- GLOB(UP)
- GLOB(BC)
- GLOB(PC)
- GLOB(ospeed)
- GLOB(ttytype)
+ GLOB(COLS, NULL)
+ GLOB(LINES, NULL)
+ GLOB(TABSIZE, NULL)
+ GLOB(curscr, NULL)
+ GLOB(newscr, NULL)
+ GLOB(stdscr, NULL)
+ GLOB(acs_map, NULL)
+ GLOB(UP, NULL)
+ GLOB(BC, NULL)
+ GLOB(PC, NULL)
+ GLOB(ospeed, NULL)
+ GLOB(ttytype, NULL)
}
void my_updateGlobalTInfo()
{
uintptr_t globoffs, globend;
- TOGLOB(COLS)
- TOGLOB(LINES)
- TOGLOB(TABSIZE)
- TOGLOB(curscr)
- TOGLOB(newscr)
- TOGLOB(stdscr)
- TOGLOB(acs_map)
- TOGLOB(UP)
- TOGLOB(BC)
- TOGLOB(PC)
- TOGLOB(ospeed)
- TOGLOB(ttytype)
+ TOGLOB(COLS, NULL)
+ TOGLOB(LINES, NULL)
+ TOGLOB(TABSIZE, NULL)
+ TOGLOB(curscr, NULL)
+ TOGLOB(newscr, NULL)
+ TOGLOB(stdscr, NULL)
+ TOGLOB(acs_map, NULL)
+ TOGLOB(UP, NULL)
+ TOGLOB(BC, NULL)
+ TOGLOB(PC, NULL)
+ TOGLOB(ospeed, NULL)
+ TOGLOB(ttytype, NULL)
}
// **************** getopts ****************
@@ -117,17 +125,17 @@ EXPORT int optind, opterr, optopt;
void my_updateGlobalOpt()
{
uintptr_t globoffs, globend;
- TOGLOB(optarg);
- TOGLOB(optind);
- TOGLOB(opterr);
- TOGLOB(optopt);
+ TOGLOB(optarg, "GLIBC_2.2.5");
+ TOGLOB(optind, "GLIBC_2.2.5");
+ TOGLOB(opterr, "GLIBC_2.2.5");
+ TOGLOB(optopt, "GLIBC_2.2.5");
}
void my_checkGlobalOpt()
{
uintptr_t globoffs, globend;
- GLOB(optarg);
- GLOB(optind);
- GLOB(opterr);
- GLOB(optopt);
+ GLOB(optarg, "GLIBC_2.2.5");
+ GLOB(optind, "GLIBC_2.2.5");
+ GLOB(opterr, "GLIBC_2.2.5");
+ GLOB(optopt, "GLIBC_2.2.5");
} \ No newline at end of file
diff --git a/src/librarian/librarian.c b/src/librarian/librarian.c
index 919389b..072ef81 100755..100644
--- a/src/librarian/librarian.c
+++ b/src/librarian/librarian.c
@@ -39,15 +39,12 @@ void FreeLibrarian(lib_t **maplib, x64emu_t *emu)
library_t* owner = (*maplib)->owner;
(*maplib)->owner = NULL; // to avoid recursive free...
- // free the memory only. All the uninit logic is elsewhere
-
-
- if((*maplib)->ownlibs && (*maplib)->libsz) {
+ /*if((*maplib)->ownlibs && (*maplib)->libsz) {
for(int i=0; i<(*maplib)->libsz; ++i) {
printf_log(LOG_DEBUG, "Unloading %s\n", (*maplib)->libraries[i]->name);
- Free1Library(&(*maplib)->libraries[i], emu);
+ DecRefCount(&(*maplib)->libraries[i], emu);
}
- }
+ }*/
box_free((*maplib)->libraries);
(*maplib)->libraries = NULL;
@@ -108,8 +105,6 @@ void MapLibAddLib(lib_t* maplib, library_t* lib)
++maplib->libsz;
}
-static void MapLibRemoveLib(lib_t* maplib, library_t* lib);
-
static void MapLibAddMapLib(lib_t* dest, library_t* lib_src, lib_t* src)
{
if(!src)
@@ -130,7 +125,7 @@ static void MapLibAddMapLib(lib_t* dest, library_t* lib_src, lib_t* src)
FreeLibrarian(&src, NULL);
}
-static void MapLibRemoveLib(lib_t* maplib, library_t* lib)
+void MapLibRemoveLib(lib_t* maplib, library_t* lib)
{
if(!maplib || !lib)
return;
@@ -161,7 +156,28 @@ static void MapLibRemoveMapLib(lib_t* dest, lib_t* src)
}
}
-int AddNeededLib_add(lib_t* maplib, int local, needed_libs_t* needed, int n, box64context_t* box64, x64emu_t* emu)
+void promoteLocalLibGlobal(library_t* lib)
+{
+ if(!lib || !my_context)
+ return;
+ // promote lib from local to global...
+ // for add the depending local libs...
+ if(lib->maplib) {
+ MapLibAddMapLib(my_context->maplib, lib, lib->maplib);
+ }
+ if(!libraryInMapLib(my_context->maplib, lib))
+ MapLibAddLib(my_context->maplib, lib);
+ MapLibRemoveMapLib(my_context->local_maplib, my_context->maplib);
+}
+
+int isLibLocal(library_t* lib)
+{
+ if(!lib || !my_context)
+ return 0;
+ return libraryInMapLib(my_context->local_maplib, lib);
+}
+
+static int AddNeededLib_add(lib_t* maplib, int local, needed_libs_t* needed, int n, elfheader_t* verneeded, box64context_t* box64, x64emu_t* emu)
{
const char* path = needed->names[n];
printf_log(LOG_DEBUG, "Trying to add \"%s\" to maplib%s\n", path, local?" (local)":"");
@@ -192,18 +208,12 @@ int AddNeededLib_add(lib_t* maplib, int local, needed_libs_t* needed, int n, box
}
} else {
// promote lib from local to global...
- // for add the depending local libs...
- if(lib->maplib) {
- MapLibAddMapLib(my_context->maplib, lib, lib->maplib);
- }
- if(!libraryInMapLib(my_context->maplib, lib))
- MapLibAddLib(my_context->maplib, lib);
- MapLibRemoveMapLib(my_context->local_maplib, my_context->maplib);
+ promoteLocalLibGlobal(lib);
}
return 0;
}
// load a new one
- needed->libs[n] = lib = NewLibrary(path, box64);
+ needed->libs[n] = lib = NewLibrary(path, box64, verneeded);
if(!lib) {
printf_log(LOG_DEBUG, "Faillure to create lib => fail\n");
return 1; //Error
@@ -240,28 +250,28 @@ int AddNeededLib_add(lib_t* maplib, int local, needed_libs_t* needed, int n, box
printf_log(LOG_DEBUG, "Failure to add lib linkmap\n");
return 1;
}
- lm->l_addr = (Elf64_Addr)GetElfDelta(my_context->elfs[lib->e.elf_index]);
+ lm->l_addr = (Elf64_Addr)GetElfDelta(lib->e.elf);
lm->l_name = lib->name;
- lm->l_ld = GetDynamicSection(my_context->elfs[lib->e.elf_index]);
+ lm->l_ld = GetDynamicSection(lib->e.elf);
}
return 0;
}
-int AddNeededLib_init(lib_t* maplib, int local, int bindnow, library_t* lib, box64context_t* box64, x64emu_t* emu)
+int AddNeededLib_init(lib_t* maplib, int local, int bindnow, library_t* lib, elfheader_t* verneeded, box64context_t* box64, x64emu_t* emu)
{
if(!lib) // no lib, error is already detected, no need to return a new one
return 0;
if(!maplib)
maplib = (local)?lib->maplib:my_context->maplib;
- int mainelf = GetElfIndex(lib);
+ elfheader_t* mainelf = GetElf(lib);
- if(mainelf==-1) {
+ if(!mainelf) {
// It's a native libs, nothing else to do
} else {
// it's an emulated lib,
// load dependancies and launch init sequence
- if(LoadNeededLibs(box64->elfs[mainelf], maplib, 0, bindnow, box64, emu)) {
+ if(LoadNeededLibs(mainelf, maplib, 0, bindnow, box64, emu)) {
printf_log(LOG_DEBUG, "Failure to Add dependant lib => fail\n");
return 1;
}
@@ -273,7 +283,7 @@ int AddNeededLib_init(lib_t* maplib, int local, int bindnow, library_t* lib, box
tmp.size = tmp.cap = 1;
tmp.names = names;
tmp.libs = libs;
- AddNeededLib(maplib, 0, 0, &tmp, box64, emu);
+ AddNeededLib(maplib, 0, 0, &tmp, verneeded, box64, emu);
}
if(!strcmp(GetNameLib(lib), "libmss.so.6")) {
char* names[] = {"libSDL-1.2.so.0", "libdl.so.2"}; // TODO: they will never be uninit...
@@ -282,7 +292,7 @@ int AddNeededLib_init(lib_t* maplib, int local, int bindnow, library_t* lib, box
tmp.size = tmp.cap = 2;
tmp.names = names;
tmp.libs = libs;
- AddNeededLib(maplib, 0, 0, &tmp, box64, emu);
+ AddNeededLib(maplib, 0, 0, &tmp, verneeded, box64, emu);
}
// finalize the lib
@@ -296,9 +306,19 @@ int AddNeededLib_init(lib_t* maplib, int local, int bindnow, library_t* lib, box
return 0;
}
+void AddNeededLib_remove(lib_t* maplib, int local, library_t** lib, box64context_t* box64, x64emu_t* emu)
+{
+
+ if(!lib || !*lib) // no lib, error is already detected, no need to return a new one
+ return;
+ if(!maplib)
+ maplib = (local)?(*lib)->maplib:my_context->maplib;
+
+ DecRefCount(lib, emu);
+}
EXPORTDYN
-int AddNeededLib(lib_t* maplib, int local, int bindnow, needed_libs_t* needed, box64context_t* box64, x64emu_t* emu)
+int AddNeededLib(lib_t* maplib, int local, int bindnow, needed_libs_t* needed, elfheader_t* verneeded, box64context_t* box64, x64emu_t* emu)
{
if(!needed) // no needed libs, no problems
return 0;
@@ -306,19 +326,35 @@ int AddNeededLib(lib_t* maplib, int local, int bindnow, needed_libs_t* needed, b
int ret = 0;
// Add libs and symbol
for(int i=0; i<needed->size; ++i) {
- if(AddNeededLib_add(maplib, local, needed, i, box64, emu)) {
+ if(AddNeededLib_add(maplib, local, needed, i, verneeded, box64, emu)) {
printf_log(strchr(needed->names[i],'/')?LOG_DEBUG:LOG_INFO, "Error loading needed lib %s\n", needed->names[i]);
ret = 1;
}
}
+ // error while loadind lib, unload...
+ if(ret) {
+ return ret;
+ }
// add dependant libs and init them
for (int i=0; i<needed->size; ++i)
- if(AddNeededLib_init(maplib, local, bindnow, needed->libs[i], box64, emu)) {
+ if(AddNeededLib_init(maplib, local, bindnow, needed->libs[i], verneeded, box64, emu)) {
printf_log(LOG_INFO, "Error initializing needed lib %s\n", needed->names[i]);
if(!allow_missing_libs) ret = 1;
}
+ // error while loadind lib, unload...
return ret;
}
+EXPORTDYN
+void RemoveNeededLib(lib_t* maplib, int local, needed_libs_t* needed, box64context_t* box64, x64emu_t* emu)
+{
+ if(!needed) // no needed libs, no problems
+ return;
+ for(int i=0; i<needed->size; ++i) {
+ if(box64_log>=LOG_DEBUG && needed->libs[i])
+ printf_log(LOG_DEBUG, "Will remove after failed init %s\n", needed->names[i]);
+ AddNeededLib_remove(maplib, local, &needed->libs[i], box64, emu);
+ }
+}
library_t* GetLibMapLib(lib_t* maplib, const char* name)
{
@@ -338,7 +374,9 @@ EXPORTDYN
uintptr_t FindGlobalSymbol(lib_t *maplib, const char* name, int version, const char* vername)
{
uintptr_t start = 0, end = 0;
- if(GetGlobalSymbolStartEnd(maplib, name, &start, &end, (void*)1, version, vername))
+ const char *globdefver = GetMaplibDefaultVersion(my_context->maplib, (my_context->maplib==maplib)?NULL:maplib, 0, name);
+ const char *weakdefver = GetMaplibDefaultVersion(my_context->maplib, (my_context->maplib==maplib)?NULL:maplib, 1, name);
+ if(GetGlobalSymbolStartEnd(maplib, name, &start, &end, (void*)1, version, vername, globdefver, weakdefver))
return start;
return 0;
}
@@ -350,7 +388,7 @@ static int isLocal(elfheader_t* self, library_t* l)
return 0;
}
-int GetNoSelfSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, size_t size, int version, const char* vername)
+int GetNoSelfSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, size_t size, int version, const char* vername, const char* globdefver, const char* weakdefver)
{
assert(self); // need self for this one
//search for the self, to start "next"
@@ -362,39 +400,40 @@ int GetNoSelfSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, u
}
if(go<0)
go = 0; // not found...
+ if(maplib)
for(int i=go; i<maplib->libsz; ++i) {
- if(GetElfIndex(maplib->libraries[i])==-1 || (my_context->elfs[GetElfIndex(maplib->libraries[i])]!=self))
- if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 0))
+ if(GetElfIndex(maplib->libraries[i])==-1 || (GetElf(maplib->libraries[i])!=self))
+ if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 0, globdefver))
if(*start)
return 1;
}
+ if(maplib)
for(int i=go; i<maplib->libsz; ++i)
- if(GetElfIndex(maplib->libraries[i])==-1 || (my_context->elfs[GetElfIndex(maplib->libraries[i])]!=self))
- GetLibWeakSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 0);
+ if(GetElfIndex(maplib->libraries[i])==-1 || (GetElf(maplib->libraries[i])!=self))
+ GetLibWeakSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 0, weakdefver);
// loop done, weak symbol found
if(weak && *start)
return 1;
// if self defined, give it another chance with self...
if(self) {
if(my_context->elfs[0]!=self) {
- const char* defver = GetDefaultVersion(my_context->globaldefver, name);
- if(GetSizedSymbolStartEnd(GetMapSymbols(my_context->elfs[0]), name, start, end, size, version, vername, 1, defver))
+ if(GetSizedSymbolStartEnd(GetMapSymbols(my_context->elfs[0]), name, start, end, size, version, vername, 1, globdefver))
if(*start)
return 1;
- defver = GetDefaultVersion(my_context->weakdefver, name);
- if(GetSizedSymbolStartEnd(GetWeakSymbols(my_context->elfs[0]), name, start, end, size, version, vername, 1, defver))
+ if(GetSizedSymbolStartEnd(GetWeakSymbols(my_context->elfs[0]), name, start, end, size, version, vername, 1, weakdefver))
if(*start)
weak = 1;
}
for(int i=0; i<go; ++i) {
- if(GetElfIndex(maplib->libraries[i])==-1 || (my_context->elfs[GetElfIndex(maplib->libraries[i])]!=self))
- if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 1))
+ if(GetElfIndex(maplib->libraries[i])==-1 || (GetElf(maplib->libraries[i])!=self))
+ if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 1, globdefver))
if(*start)
return 1;
}
+ if(maplib)
for(int i=0; i<go; ++i) {
- if(GetElfIndex(maplib->libraries[i])==-1 || (my_context->elfs[GetElfIndex(maplib->libraries[i])]!=self))
- GetLibWeakSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 1);
+ if(GetElfIndex(maplib->libraries[i])==-1 || (GetElf(maplib->libraries[i])!=self))
+ GetLibWeakSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 1, weakdefver);
}
if(weak && *start)
return 1;
@@ -402,63 +441,146 @@ int GetNoSelfSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, u
// nope, not found
return 0;
}
-static int GetGlobalSymbolStartEnd_internal(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, int version, const char* vername)
+static int GetGlobalSymbolStartEnd_internal(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, int version, const char* vername, const char* globdefver, const char* weakdefver)
{
int weak = 0;
size_t size = 0;
+ // search in needed libs from preloaded first, in order
+ if(my_context->preload)
+ for(int i=0; i<my_context->preload->size; ++i)
+ if(GetLibGlobalSymbolStartEnd(my_context->preload->libs[i], name, start, end, size, &weak, version, vername, isLocal(self, my_context->preload->libs[i]), globdefver))
+ if(*start)
+ return 1;
+ // search non-weak symbol, from older to newer (first GLOBAL object wins, starting with self)
+ if(GetSymbolStartEnd(GetMapSymbols(my_context->elfs[0]), name, start, end, version, vername, (my_context->elfs[0]==self || !self)?1:0, globdefver))
+ if(*start)
+ return 1;
+ // TODO: create a temporary map to search lib only 1 time, and in order of needed...
+ // search in needed libs from neededlibs first, in order
+ if(my_context->neededlibs)
+ for(int i=0; i<my_context->neededlibs->size; ++i)
+ if(GetLibGlobalSymbolStartEnd(my_context->neededlibs->libs[i], name, start, end, size, &weak, version, vername, isLocal(self, my_context->neededlibs->libs[i]), globdefver))
+ if(*start)
+ return 1;
+ // search in global symbols
+ if(maplib) {
+ if(self && self!=my_context->elfs[0] && self!=(void*)1)
+ if(GetSymbolStartEnd(GetMapSymbols(self), name, start, end, version, vername, 1, globdefver))
+ if(*start)
+ return 1;
+ for(int i=0; i<maplib->libsz; ++i) {
+ if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, isLocal(self, maplib->libraries[i]), globdefver))
+ if(*start)
+ return 1;
+ }
+ }
+
// check with default version...
- const char* defver = GetDefaultVersion(my_context->globaldefver, name);
+ int ok = 0;
+ // GetSymbolStartEnd should not change start/end if symbol is not found
+ if(GetSymbolStartEnd(GetWeakSymbols(my_context->elfs[0]), name, start, end, version, vername, (my_context->elfs[0]==self || !self)?1:0, weakdefver))
+ if(*start)
+ ok = 1;
+
+ if(maplib)
+ for(int i=0; i<maplib->libsz; ++i) {
+ if(GetLibWeakSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, isLocal(self, maplib->libraries[i]), weakdefver))
+ if(*start)
+ ok = 1;
+ }
+ // nope, not found
+ return (ok && *start)?1:0;
+}
+void** my_GetGTKDisplay();
+void** my_GetGthreadsGotInitialized();
+int GetGlobalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, int version, const char* vername, const char* globdefver, const char* weakdefver)
+{
+ if(GetGlobalSymbolStartEnd_internal(maplib, name, start, end, self, version, vername, globdefver, weakdefver)) {
+ if(start && end && *end==*start) { // object is of 0 sized, try to see an "_END" object of null size
+ uintptr_t start2, end2;
+ char* buff = (char*)malloc(strlen(name) + strlen("_END") + 1);
+ strcpy(buff, name);
+ strcat(buff, "_END");
+ if(GetGlobalSymbolStartEnd_internal(maplib, buff, &start2, &end2, self, version, vername, globdefver, weakdefver)) {
+ if(end2>*end && start2==end2)
+ *end = end2;
+ }
+ box_free(buff);
+ }
+ return 1;
+ }
+ // some special case symbol, defined inside box64 itself
+ if(!strcmp(name, "gdk_display")) {
+ *start = (uintptr_t)my_GetGTKDisplay();
+ *end = *start+sizeof(void*);
+ printf_log(LOG_INFO, "Using global gdk_display for gdk-x11 (%p:%p)\n", start, *(void**)start);
+ return 1;
+ }
+ if(!strcmp(name, "g_threads_got_initialized")) {
+ *start = (uintptr_t)my_GetGthreadsGotInitialized();
+ *end = *start+sizeof(int);
+ printf_log(LOG_INFO, "Using global g_threads_got_initialized for gthread2 (%p:%p)\n", start, *(void**)start);
+ return 1;
+ }
+ // not found...
+ return 0;
+}
+
+static int GetGlobalWeakSymbolStartEnd_internal(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, int version, const char* vername, const char* globdefver, const char* weakdefver)
+{
+ int weak = 0;
+ size_t size = 0;
// search in needed libs from preloaded first, in order
if(my_context->preload)
for(int i=0; i<my_context->preload->size; ++i)
- if(GetLibGlobalSymbolStartEnd(my_context->preload->libs[i], name, start, end, size, &weak, version, vername, isLocal(self, my_context->preload->libs[i])))
+ if(GetLibGlobalSymbolStartEnd(my_context->preload->libs[i], name, start, end, size, &weak, version, vername, isLocal(self, my_context->preload->libs[i]), globdefver))
if(*start)
return 1;
// search non-weak symbol, from older to newer (first GLOBAL object wins)
- if(GetSymbolStartEnd(GetMapSymbols(my_context->elfs[0]), name, start, end, version, vername, (my_context->elfs[0]==self || !self)?1:0, defver))
+ if(GetSymbolStartEnd(GetMapSymbols(my_context->elfs[0]), name, start, end, version, vername, (my_context->elfs[0]==self || !self)?1:0, globdefver))
if(*start)
return 1;
// TODO: create a temporary map to search lib only 1 time, and in order of needed...
// search in needed libs from neededlibs first, in order
if(my_context->neededlibs)
for(int i=0; i<my_context->neededlibs->size; ++i)
- if(GetLibGlobalSymbolStartEnd(my_context->neededlibs->libs[i], name, start, end, size, &weak, version, vername, isLocal(self, my_context->neededlibs->libs[i])))
+ if(GetLibGlobalSymbolStartEnd(my_context->neededlibs->libs[i], name, start, end, size, &weak, version, vername, isLocal(self, my_context->neededlibs->libs[i]), globdefver))
if(*start)
return 1;
// search in global symbols
+ if(maplib)
for(int i=0; i<maplib->libsz; ++i) {
- if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, isLocal(self, maplib->libraries[i])))
+ if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, isLocal(self, maplib->libraries[i]), globdefver))
if(*start)
return 1;
}
// check with default version...
- defver = GetDefaultVersion(my_context->weakdefver, name);
int ok = 0;
// GetSymbolStartEnd should not change start/end if symbol is not found
- if(GetSymbolStartEnd(GetWeakSymbols(my_context->elfs[0]), name, start, end, version, vername, (my_context->elfs[0]==self || !self)?1:0, defver))
+ if(GetSymbolStartEnd(GetWeakSymbols(my_context->elfs[0]), name, start, end, version, vername, (my_context->elfs[0]==self || !self)?1:0, weakdefver))
if(*start)
ok = 1;
+ if(maplib)
for(int i=0; i<maplib->libsz; ++i) {
- if(GetLibWeakSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, isLocal(self, maplib->libraries[i])))
+ if(GetLibWeakSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, isLocal(self, maplib->libraries[i]), weakdefver))
if(*start)
ok = 1;
}
// nope, not found
return (ok && *start)?1:0;
}
-void** my_GetGTKDisplay();
-void** my_GetGthreadsGotInitialized();
-int GetGlobalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, int version, const char* vername)
+
+int GetGlobalWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, int version, const char* vername, const char* globdefver, const char* weakdefver)
{
- if(GetGlobalSymbolStartEnd_internal(maplib, name, start, end, self, version, vername)) {
+ if(GetGlobalWeakSymbolStartEnd_internal(maplib, name, start, end, self, version, vername, globdefver, weakdefver)) {
if(start && end && *end==*start) { // object is of 0 sized, try to see an "_END" object of null size
uintptr_t start2, end2;
char* buff = (char*)malloc(strlen(name) + strlen("_END") + 1);
strcpy(buff, name);
strcat(buff, "_END");
- if(GetGlobalSymbolStartEnd_internal(maplib, buff, &start2, &end2, self, version, vername)) {
+ if(GetGlobalWeakSymbolStartEnd_internal(maplib, buff, &start2, &end2, self, version, vername, globdefver, weakdefver)) {
if(end2>*end && start2==end2)
*end = end2;
}
@@ -483,6 +605,30 @@ int GetGlobalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, u
return 0;
}
+const char* GetMaplibDefaultVersion(lib_t *maplib, lib_t* local_maplib, int isweak, const char* symname)
+{
+ const char* ret = GetDefaultVersion(isweak?GetWeakDefaultVersion(my_context->elfs[0]):GetGlobalDefaultVersion(my_context->elfs[0]), symname);
+ if(ret)
+ return ret;
+ for(int i=0; i<maplib->libsz; ++i) {
+ elfheader_t *h = GetElf(maplib->libraries[i]);
+ if(h)
+ ret = GetDefaultVersion(isweak?GetWeakDefaultVersion(h):GetGlobalDefaultVersion(h), symname);
+ if(ret)
+ return ret;
+ }
+ if(local_maplib)
+ for(int i=0; i<local_maplib->libsz; ++i) {
+ elfheader_t *h = GetElf(local_maplib->libraries[i]);
+ if(h)
+ ret = GetDefaultVersion(isweak?GetWeakDefaultVersion(h):GetGlobalDefaultVersion(h), symname);
+ if(ret)
+ return ret;
+ }
+
+ return NULL;
+}
+
elfheader_t* GetGlobalSymbolElf(lib_t *maplib, const char* name, int version, const char* vername)
{
uintptr_t start = 0;
@@ -491,63 +637,65 @@ elfheader_t* GetGlobalSymbolElf(lib_t *maplib, const char* name, int version, co
int weak = 0;
elfheader_t* ret = NULL;
// check with default version...
- const char* defver = GetDefaultVersion(my_context->globaldefver, name);
+ const char* defver = GetMaplibDefaultVersion(my_context->maplib, (my_context->maplib==maplib)?NULL:maplib, 0, name);
if(GetSymbolStartEnd(GetMapSymbols(my_context->elfs[0]), name, &start, &end, version, vername, 1, defver))
return my_context->elfs[0];
for(int i=0; i<maplib->libsz; ++i) {
- if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, &start, &end, size, &weak, version, vername, 1)) {
- int idx = GetElfIndex(maplib->libraries[i]);
- if(idx==-1) {
+ if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, &start, &end, size, &weak, version, vername, 1, defver)) {
+ elfheader_t* h = GetElf(maplib->libraries[i]);
+ if(!h) {
printf_log(LOG_NONE, "Warning, getting Elf info for a native symbol \"%s\" from lib \"%s\"\n", name, GetNameLib(maplib->libraries[i]));
return NULL;
}
if(weak)
- ret = my_context->elfs[idx];
+ ret = h;
else
- return my_context->elfs[idx];
+ return h;
}
}
- defver = GetDefaultVersion(my_context->weakdefver, name);
+ defver = GetMaplibDefaultVersion(my_context->maplib, (my_context->maplib==maplib)?NULL:maplib, 1, name);
if(GetSymbolStartEnd(GetWeakSymbols(my_context->elfs[0]), name, &start, &end, version, vername, 1, defver))
ret = my_context->elfs[0];
for(int i=0; i<maplib->libsz; ++i) {
- if(GetLibWeakSymbolStartEnd(maplib->libraries[i], name, &start, &end, size, &weak, version, vername, 1)) {
- int idx = GetElfIndex(maplib->libraries[i]);
- if(idx==-1) {
+ if(GetLibWeakSymbolStartEnd(maplib->libraries[i], name, &start, &end, size, &weak, version, vername, 1, defver)) {
+ elfheader_t* h = GetElf(maplib->libraries[i]);
+ if(!h) {
printf_log(LOG_NONE, "Warning, getting Elf info for a native symbol \"%s\" from lib \"%s\"\n", name, GetNameLib(maplib->libraries[i]));
return NULL;
}
if(weak)
- ret = my_context->elfs[idx];
+ ret = h;
else
- return my_context->elfs[idx];
+ return h;
}
}
// return what has been found (maybe nothing)
return ret;
}
-int GetGlobalNoWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, int version, const char* vername)
+int GetGlobalNoWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, int version, const char* vername, const char* defver)
{
int weak = 0;
size_t size = 0;
+ // check global GLOB_DAT kind of symbols
+ if(GetSymbolStartEnd(GetGlobalData(maplib), name, start, end, version, vername, 1, defver))
+ if(*start || *end)
+ return 1;
// check with default version...
- const char* defver = GetDefaultVersion(my_context->globaldefver, name);
-
if(GetSymbolStartEnd(GetMapSymbols(my_context->elfs[0]), name, start, end, version, vername, 1, defver))
if(*start || *end)
return 1;
for(int i=0; i<maplib->libsz; ++i)
- if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 1))
+ if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 1, defver))
if(*start || *end)
return 1;
// nope, not found
return 0;
}
-int IsGlobalNoWeakSymbolInNative(lib_t *maplib, const char* name, int version, const char* vername)
+int IsGlobalNoWeakSymbolInNative(lib_t *maplib, const char* name, int version, const char* vername, const char* defver)
{
uintptr_t start, end;
size_t size = 0;
@@ -555,7 +703,7 @@ int IsGlobalNoWeakSymbolInNative(lib_t *maplib, const char* name, int version, c
// check with default version...
for(int i=0; i<maplib->libsz; ++i)
if(GetElfIndex(maplib->libraries[i])==-1)
- if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, &start, &end, size, &weak, version, vername, 1))
+ if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, &start, &end, size, &weak, version, vername, 1, defver))
if(start || end)
return 1;
// nope, not found
@@ -563,22 +711,23 @@ int IsGlobalNoWeakSymbolInNative(lib_t *maplib, const char* name, int version, c
}
-int GetLocalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t *self, int version, const char* vername)
+int GetLocalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t *self, int version, const char* vername, const char* globdefver, const char* weakdefver)
{
// check with default version...
int weak;
size_t size = 0;
+ const char* defver = globdefver?globdefver:weakdefver;
if(my_context->elfs[0]==self || !self) {
- if(GetSymbolStartEnd(GetLocalSymbols(my_context->elfs[0]), name, start, end, version, vername, 1, NULL))
+ if(GetSymbolStartEnd(GetLocalSymbols(my_context->elfs[0]), name, start, end, version, vername, 1, defver))
if(*start || *end)
return 1;
if(self)
return 0;
}
for(int i=0; i<maplib->libsz; ++i) {
- if(GetElfIndex(maplib->libraries[i])!=-1 && (!self || my_context->elfs[GetElfIndex(maplib->libraries[i])]==self)) {
- if(GetLibLocalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 1))
+ if(GetElfIndex(maplib->libraries[i])!=-1 && (!self || GetElf(maplib->libraries[i])==self)) {
+ if(GetLibLocalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, version, vername, 1, defver))
if(*start || *end)
return 1;
if(self)
@@ -613,15 +762,15 @@ const char* FindSymbolName(lib_t *maplib, void* p, void** start, uint64_t* sz, c
*lib = NULL; // main elf
else {
for(int i=0; i<my_context->maplib->libsz; ++i) {
- int idx = GetElfIndex(my_context->maplib->libraries[i]);
- if((idx!=-1) && (my_context->elfs[idx]==h)) {
+ elfheader_t* head = GetElf(my_context->maplib->libraries[i]);
+ if((head) && (head==h)) {
*lib = my_context->maplib->libraries[i];
return ret;
}
}
for(int i=0; i<my_context->local_maplib->libsz; ++i) {
- int idx = GetElfIndex(my_context->local_maplib->libraries[i]);
- if((idx!=-1) && (my_context->elfs[idx]==h)) {
+ elfheader_t* head = GetElf(my_context->local_maplib->libraries[i]);
+ if((head) && (head==h)) {
*lib = my_context->local_maplib->libraries[i];
return ret;
}
diff --git a/src/librarian/librarian_private.h b/src/librarian/librarian_private.h
index b7ff5c0..b7ff5c0 100755..100644
--- a/src/librarian/librarian_private.h
+++ b/src/librarian/librarian_private.h
diff --git a/src/librarian/library.c b/src/librarian/library.c
index 4891922..18fbe24 100755..100644
--- a/src/librarian/library.c
+++ b/src/librarian/library.c
@@ -116,7 +116,7 @@ void WrappedLib_FinishFini(library_t* lib)
FreeBridge(&lib->w.bridge);
}
-int WrappedLib_GetWeak(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int* weak, int version, const char* vername, int local)
+int WrappedLib_GetWeak(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int* weak, int version, const char* vername, int local, const char* defver)
{
// ignoring asked size on wrapped libs
uintptr_t addr = 0;
@@ -134,11 +134,10 @@ int WrappedLib_GetWeak(library_t* lib, const char* name, uintptr_t *offs, uintpt
*weak = wk;
return 1;
}
-int EmuLib_GetWeak(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int*weak, int version, const char* vername, int local)
+int EmuLib_GetWeak(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int*weak, int version, const char* vername, int local, const char* defver)
{
// symbols...
uintptr_t start, end;
- const char* defver = GetDefaultVersion(my_context->weakdefver, name);
// weak symbols...
if(GetSizedSymbolStartEnd(GetWeakSymbols(lib->e.elf), name, &start, &end, asked_size, version, vername, local, defver))
{
@@ -149,7 +148,7 @@ int EmuLib_GetWeak(library_t* lib, const char* name, uintptr_t *offs, uintptr_t
}
return 0;
}
-int WrappedLib_GetGlobal(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int* weak, int version, const char* vername, int local)
+int WrappedLib_GetGlobal(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int* weak, int version, const char* vername, int local, const char* defver)
{
// ignoring asked size on wrapped libs
uintptr_t addr = 0;
@@ -167,10 +166,9 @@ int WrappedLib_GetGlobal(library_t* lib, const char* name, uintptr_t *offs, uint
*weak = 0;
return 1;
}
-int EmuLib_GetGlobal(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int* weak, int version, const char* vername, int local)
+int EmuLib_GetGlobal(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int* weak, int version, const char* vername, int local, const char* defver)
{
uintptr_t start, end;
- const char* defver = GetDefaultVersion(my_context->globaldefver, name);
if(GetSizedSymbolStartEnd(GetMapSymbols(lib->e.elf), name, &start, &end, asked_size, version, vername, local, defver))
{
*offs = start;
@@ -180,12 +178,10 @@ int EmuLib_GetGlobal(library_t* lib, const char* name, uintptr_t *offs, uintptr_
}
return 0;
}
-int EmuLib_GetLocal(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int* weak, int version, const char* vername, int local)
+int EmuLib_GetLocal(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int* weak, int version, const char* vername, int local, const char* defver)
{
// ignoring asked size on wrapped libs
uintptr_t start, end;
- const char* defver = GetDefaultVersion(my_context->globaldefver, name);
- if(!defver) defver = GetDefaultVersion(my_context->weakdefver, name);
if(GetSymbolStartEnd(GetLocalSymbols(lib->e.elf), name, &start, &end, version, vername, local, defver))
{
*offs = start;
@@ -196,7 +192,7 @@ int EmuLib_GetLocal(library_t* lib, const char* name, uintptr_t *offs, uintptr_t
return 0;
}
-int WrappedLib_GetLocal(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int* weak, int version, const char* vername, int local)
+int WrappedLib_GetLocal(library_t* lib, const char* name, uintptr_t *offs, uintptr_t *sz, size_t asked_size, int* weak, int version, const char* vername, int local, const char* defver)
{
(void)lib; (void)name; (void)offs; (void)sz; (void)version; (void)vername; (void)local;
return 0;
@@ -221,7 +217,7 @@ static void initWrappedLib(library_t *lib, box64context_t* context) {
lib->type = LIB_WRAPPED;
lib->w.refcnt = 1;
// Call librarian to load all dependant elf
- if(AddNeededLib(context->maplib, 0, 0, lib->w.needed, context, thread_get_emu())) {
+ if(AddNeededLib(context->maplib, 0, 0, lib->w.needed, NULL, context, thread_get_emu())) {
printf_log(LOG_NONE, "Error: loading a needed libs in elf %s\n", lib->name);
return;
}
@@ -244,7 +240,7 @@ static void initWrappedLib(library_t *lib, box64context_t* context) {
}
}
-static int loadEmulatedLib(const char* libname, library_t *lib, box64context_t* context)
+static int loadEmulatedLib(const char* libname, library_t *lib, box64context_t* context, elfheader_t* verneeded)
{
if(FileExist(libname, IS_FILE))
{
@@ -259,28 +255,36 @@ static int loadEmulatedLib(const char* libname, library_t *lib, box64context_t*
fclose(f);
return 0;
}
- int mainelf = AddElfHeader(context, elf_header);
if(CalcLoadAddr(elf_header)) {
printf_log(LOG_NONE, "Error: reading elf header of %s\n", libname);
+ FreeElfHeader(&elf_header);
fclose(f);
return 0;
}
// allocate memory
if(AllocElfMemory(context, elf_header, 0)) {
printf_log(LOG_NONE, "Error: allocating memory for elf %s\n", libname);
+ FreeElfHeader(&elf_header);
fclose(f);
return 0;
}
// Load elf into memory
if(LoadElfMemory(f, context, elf_header)) {
printf_log(LOG_NONE, "Error: loading in memory elf %s\n", libname);
+ FreeElfHeader(&elf_header);
fclose(f);
return 0;
}
// can close the file now
fclose(f);
+ if(verneeded && !isElfHasNeededVer(elf_header, lib->name, verneeded)) {
+ // incompatible, discard and continue the search
+ FreeElfHeader(&elf_header);
+ return 0;
+ }
+ int mainelf = AddElfHeader(context, elf_header);
ElfAttachLib(elf_header, lib);
lib->type = LIB_EMULATED;
@@ -305,6 +309,11 @@ static int loadEmulatedLib(const char* libname, library_t *lib, box64context_t*
box64_dynarec_bigblock = 0;
box64_dynarec_strongmem = 1;
}
+ if(libname && box64_dynarec_jvm && strstr(libname, "libjvm.so")) {
+ printf_log(LOG_INFO, "libjvm detected, disable Dynarec BigBlock and enable Dynarec StrongMem\n");
+ box64_dynarec_bigblock = 0;
+ box64_dynarec_strongmem = 1;
+ }
#endif
if(libname && box64_libcef && strstr(libname, "libcef.so")) {
printf_log(LOG_INFO, "libcef detected, using malloc_hack_2\n");
@@ -315,13 +324,13 @@ static int loadEmulatedLib(const char* libname, library_t *lib, box64context_t*
return 0;
}
-static void initEmulatedLib(const char* path, library_t *lib, box64context_t* context)
+static void initEmulatedLib(const char* path, library_t *lib, box64context_t* context, elfheader_t* verneeded)
{
char libname[MAX_PATH];
strcpy(libname, path);
int found = FileIsX64ELF(libname);
if(found)
- if(loadEmulatedLib(libname, lib, context))
+ if(loadEmulatedLib(libname, lib, context, verneeded))
return;
if(!strchr(path, '/'))
for(int i=0; i<context->box64_ld_lib.size; ++i)
@@ -329,8 +338,15 @@ static void initEmulatedLib(const char* path, library_t *lib, box64context_t* co
strcpy(libname, context->box64_ld_lib.paths[i]);
strcat(libname, path);
if(FileIsX64ELF(libname))
- if(loadEmulatedLib(libname, lib, context))
+ if(loadEmulatedLib(libname, lib, context, verneeded))
return;
+ // also try x86_64 variant
+ strcpy(libname, context->box64_ld_lib.paths[i]);
+ strcat(libname, "x86_64/");
+ strcat(libname, path);
+ if(FileIsX64ELF(libname))
+ if(loadEmulatedLib(libname, lib, context, verneeded))
+ return;
}
}
@@ -352,7 +368,7 @@ static int isEssentialLib(const char* name) {
return 0;
}
-library_t *NewLibrary(const char* path, box64context_t* context)
+library_t *NewLibrary(const char* path, box64context_t* context, elfheader_t* verneeded)
{
printf_log(LOG_DEBUG, "Trying to load \"%s\"\n", path);
library_t *lib = (library_t*)box_calloc(1, sizeof(library_t));
@@ -398,7 +414,7 @@ library_t *NewLibrary(const char* path, box64context_t* context)
initWrappedLib(lib, context);
// then look for a native one
if(lib->type==LIB_UNNKNOW)
- initEmulatedLib(path, lib, context);
+ initEmulatedLib(path, lib, context, verneeded);
// still not loaded but notwrapped indicated: use wrapped...
if(lib->type==LIB_UNNKNOW && notwrapped && !precise)
initWrappedLib(lib, context);
@@ -420,7 +436,6 @@ int AddSymbolsLibrary(lib_t *maplib, library_t* lib, x64emu_t* emu)
{
(void)emu;
- lib->active = 1;
if(lib->type==LIB_EMULATED) {
elfheader_t *elf_header = lib->e.elf;
// add symbols
@@ -449,12 +464,12 @@ int FinalizeLibrary(library_t* lib, lib_t* local_maplib, int bindnow, x64emu_t*
#ifdef HAVE_TRACE
if(trace_func) {
int weak;
- if (GetGlobalSymbolStartEnd(local_maplib, trace_func, &trace_start, &trace_end, elf_header, -1, NULL)) {
+ if (GetGlobalSymbolStartEnd(local_maplib, trace_func, &trace_start, &trace_end, elf_header, -1, NULL, NULL, NULL)) {
SetTraceEmu(trace_start, trace_end);
printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", trace_func, (void*)trace_start, (void*)trace_end);
box_free(trace_func);
trace_func = NULL;
- } else if(GetLibLocalSymbolStartEnd(lib, trace_func, &trace_start, &trace_end, 0, &weak, -1, NULL, 0)) {
+ } else if(GetLibLocalSymbolStartEnd(lib, trace_func, &trace_start, &trace_end, 0, &weak, -1, NULL, 0, NULL)) {
SetTraceEmu(trace_start, trace_end);
printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", trace_func, (void*)trace_start, (void*)trace_end);
box_free(trace_func);
@@ -469,7 +484,6 @@ int FinalizeLibrary(library_t* lib, lib_t* local_maplib, int bindnow, x64emu_t*
int ReloadLibrary(library_t* lib, x64emu_t* emu)
{
- lib->active = 1;
if(lib->type==LIB_EMULATED) {
elfheader_t *elf_header = lib->e.elf;
// reload image in memory and re-run the mapping
@@ -514,90 +528,94 @@ int ReloadLibrary(library_t* lib, x64emu_t* emu)
int FiniLibrary(library_t* lib, x64emu_t* emu)
{
- if(!lib->active)
- return 0; // nothing to do
switch (lib->type) {
case LIB_WRAPPED:
- if(!--lib->w.refcnt)
- lib->active = 0;
return 0;
case LIB_EMULATED:
- if(!--lib->e.elf->refcnt) {
- if(emu)
- RunElfFini(lib->e.elf, emu);
- lib->active = 0;
- }
+ RunElfFini(lib->e.elf, emu);
return 0;
}
return 1; // bad type
}
-void InactiveLibrary(library_t* lib)
+void Free1Library(library_t **the_lib, x64emu_t* emu)
{
- lib->active = 0;
-}
+ if(!(*the_lib)) return;
-void Free1Library(library_t **lib, x64emu_t* emu)
-{
- if(!(*lib)) return;
+ library_t* lib = *the_lib;
+
+ printf_log(LOG_DEBUG, "Free1Library %s\n", lib->name);
+ // remove lib from maplib/local_maplib...
+ if(my_context) {
+ MapLibRemoveLib(my_context->maplib, lib);
+ MapLibRemoveLib(my_context->local_maplib, lib);
+ }
+ // free elf is relevant
+ if(lib->type==LIB_EMULATED) {
+ FreeElfHeader(&lib->e.elf);
+ }
// No "Fini" logic here, only memory handling
- if((*lib)->maplib)
- FreeLibrarian(&(*lib)->maplib, emu);
+ if(lib->maplib)
+ FreeLibrarian(&lib->maplib, emu);
- if((*lib)->type!=LIB_UNNKNOW && (*lib)->fini) {
- (*lib)->fini(*lib);
+ if(lib->type!=LIB_UNNKNOW && lib->fini) {
+ lib->fini(lib);
}
- box_free((*lib)->name);
- box_free((*lib)->path);
+ box_free(lib->name);
+ box_free(lib->path);
- if((*lib)->gbridgemap) {
+ if(lib->gbridgemap) {
bridged_t *br;
- kh_foreach_value_ref((*lib)->gbridgemap, br,
+ kh_foreach_value_ref(lib->gbridgemap, br,
box_free(br->name);
);
- kh_destroy(bridgemap, (*lib)->gbridgemap);
+ kh_destroy(bridgemap, lib->gbridgemap);
}
- if((*lib)->wbridgemap) {
+ if(lib->wbridgemap) {
bridged_t *br;
- kh_foreach_value_ref((*lib)->wbridgemap, br,
+ kh_foreach_value_ref(lib->wbridgemap, br,
box_free(br->name);
);
- kh_destroy(bridgemap, (*lib)->wbridgemap);
+ kh_destroy(bridgemap, lib->wbridgemap);
}
- if((*lib)->lbridgemap) {
+ if(lib->lbridgemap) {
bridged_t *br;
- kh_foreach_value_ref((*lib)->lbridgemap, br,
+ kh_foreach_value_ref(lib->lbridgemap, br,
box_free(br->name);
);
- kh_destroy(bridgemap, (*lib)->lbridgemap);
+ kh_destroy(bridgemap, lib->lbridgemap);
}
- if((*lib)->type == LIB_WRAPPED) {
- if((*lib)->w.symbolmap)
- kh_destroy(symbolmap, (*lib)->w.symbolmap);
- if((*lib)->w.wsymbolmap)
- kh_destroy(symbolmap, (*lib)->w.wsymbolmap);
- if((*lib)->w.datamap)
- kh_destroy(datamap, (*lib)->w.datamap);
- if((*lib)->w.wdatamap)
- kh_destroy(datamap, (*lib)->w.wdatamap);
- if((*lib)->w.mydatamap)
- kh_destroy(datamap, (*lib)->w.mydatamap);
- if((*lib)->w.mysymbolmap)
- kh_destroy(symbolmap, (*lib)->w.mysymbolmap);
- if((*lib)->w.wmysymbolmap)
- kh_destroy(symbolmap, (*lib)->w.wmysymbolmap);
- if((*lib)->w.stsymbolmap)
- kh_destroy(symbolmap, (*lib)->w.stsymbolmap);
- if((*lib)->w.symbol2map)
- kh_destroy(symbol2map, (*lib)->w.symbol2map);
+ if(lib->type == LIB_WRAPPED) {
+ if(lib->w.symbolmap)
+ kh_destroy(symbolmap, lib->w.symbolmap);
+ if(lib->w.wsymbolmap)
+ kh_destroy(symbolmap, lib->w.wsymbolmap);
+ if(lib->w.datamap)
+ kh_destroy(datamap, lib->w.datamap);
+ if(lib->w.wdatamap)
+ kh_destroy(datamap, lib->w.wdatamap);
+ if(lib->w.mydatamap)
+ kh_destroy(datamap, lib->w.mydatamap);
+ if(lib->w.mysymbolmap)
+ kh_destroy(symbolmap, lib->w.mysymbolmap);
+ if(lib->w.wmysymbolmap)
+ kh_destroy(symbolmap, lib->w.wmysymbolmap);
+ if(lib->w.stsymbolmap)
+ kh_destroy(symbolmap, lib->w.stsymbolmap);
+ if(lib->w.symbol2map)
+ kh_destroy(symbol2map, lib->w.symbol2map);
}
- box_free(*lib);
- *lib = NULL;
+ // remove frim the dlopen collection
+ if(lib->dlopen)
+ RemoveDlopen(the_lib, lib->dlopen);
+ box_free(lib);
+ if(*the_lib == lib)
+ *the_lib = NULL;
}
-char* GetNameLib(library_t *lib)
+char* GetNameLib(library_t* lib)
{
return lib->name;
}
@@ -606,15 +624,22 @@ int IsSameLib(library_t* lib, const char* path)
int ret = 0;
if(!lib)
return 0;
+ if(lib->type==LIB_UNNKNOW)
+ return 0;
char* name = Path2Name(path);
if(!strchr(path, '/') || lib->type==LIB_WRAPPED || !lib->path) {
if(strcmp(name, lib->name)==0)
ret=1;
+ if(lib->type==LIB_EMULATED && lib->e.elf->soname && !strcmp(lib->e.elf->soname, path))
+ ret=1;
} else {
char rpath[PATH_MAX];
box_realpath(path, rpath);
if(!strcmp(rpath, lib->path))
ret=1;
+ if(lib->type==LIB_EMULATED && lib->e.elf->path && !strcmp(lib->e.elf->path, rpath)) {
+ ret=1;
+ }
}
if(!ret) {
int n = NbDot(name);
@@ -626,23 +651,23 @@ int IsSameLib(library_t* lib, const char* path)
box_free(name);
return ret;
}
-int GetLibWeakSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local)
+int GetLibWeakSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local, const char* defver)
{
- if(!name[0] || !lib->active)
+ if(!name[0])
return 0;
khint_t k;
// get a new symbol
- if(lib->getweak(lib, name, start, end, size, weak, version, vername, local)) {
+ if(lib->getweak(lib, name, start, end, size, weak, version, vername, local, defver)) {
*end += *start; // lib->get(...) gives size, not end
kh_bridgemap_t *map = local?lib->lbridgemap:((*weak)?lib->wbridgemap:lib->gbridgemap);
// check first if already in the map
- k = kh_get(bridgemap, map, VersionnedName(name, version, vername));
+ k = kh_get(bridgemap, map, VersionedName(name, version, vername));
if(k!=kh_end(map)) {
*start = kh_value(map, k).start;
*end = kh_value(map, k).end;
return 1;
}
- char* symbol = box_strdup(VersionnedName(name, version, vername));
+ char* symbol = box_strdup(VersionedName(name, version, vername));
int ret;
k = kh_put(bridgemap, map, symbol, &ret);
kh_value(map, k).name = symbol;
@@ -653,23 +678,23 @@ int GetLibWeakSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start,
// nope
return 0;
}
-int GetLibGlobalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local)
+int GetLibGlobalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local, const char* defver)
{
- if(!name[0] || !lib || !lib->active)
+ if(!name[0] || !lib)
return 0;
khint_t k;
// get a new symbol
- if(lib->getglobal(lib, name, start, end, size, weak, version, vername, local)) {
+ if(lib->getglobal(lib, name, start, end, size, weak, version, vername, local, defver)) {
*end += *start; // lib->get(...) gives size, not end
kh_bridgemap_t *map = local?lib->lbridgemap:((*weak)?lib->wbridgemap:lib->gbridgemap);
// check if already in the map
- k = kh_get(bridgemap, map, VersionnedName(name, version, vername));
+ k = kh_get(bridgemap, map, VersionedName(name, version, vername));
if(k!=kh_end(map)) {
*start = kh_value(map, k).start;
*end = kh_value(map, k).end;
return 1;
}
- char* symbol = box_strdup(VersionnedName(name, version, vername));
+ char* symbol = box_strdup(VersionedName(name, version, vername));
int ret;
k = kh_put(bridgemap, map, symbol, &ret);
kh_value(map, k).name = symbol;
@@ -680,22 +705,22 @@ int GetLibGlobalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* star
// nope
return 0;
}
-int GetLibLocalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local)
+int GetLibLocalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, size_t size, int* weak, int version, const char* vername, int local, const char* defver)
{
- if(!name[0] || !lib->active)
+ if(!name[0])
return 0;
khint_t k;
// get a new symbol
- if(lib->getlocal(lib, name, start, end, size, weak, version, vername, local)) {
+ if(lib->getlocal(lib, name, start, end, size, weak, version, vername, local, defver)) {
*end += *start; // lib->get(...) gives size, not end
// check first if already in the map
- k = kh_get(bridgemap, lib->lbridgemap, VersionnedName(name, version, vername));
+ k = kh_get(bridgemap, lib->lbridgemap, VersionedName(name, version, vername));
if(k!=kh_end(lib->lbridgemap)) {
*start = kh_value(lib->lbridgemap, k).start;
*end = kh_value(lib->lbridgemap, k).end;
return 1;
}
- char* symbol = box_strdup(VersionnedName(name, version, vername));
+ char* symbol = box_strdup(VersionedName(name, version, vername));
int ret;
k = kh_put(bridgemap, lib->lbridgemap, symbol, &ret);
kh_value(lib->lbridgemap, k).name = symbol;
@@ -820,12 +845,12 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui
symbol = dlsym(lib->w.lib, newname);
}
if(!symbol)
- symbol = GetNativeSymbolUnversionned(lib->w.lib, name);
+ symbol = GetNativeSymbolUnversioned(lib->w.lib, name);
if(!symbol && lib->w.altprefix) {
char newname[200];
strcpy(newname, lib->w.altprefix);
strcat(newname, name);
- symbol = GetNativeSymbolUnversionned(lib->w.lib, newname);
+ symbol = GetNativeSymbolUnversioned(lib->w.lib, newname);
}
if(!symbol) {
printf_log(LOG_INFO, "Warning, function %s not found in lib %s\n", name, lib->name);
@@ -867,12 +892,12 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui
symbol = dlsym(lib->w.lib, newname);
}
if(!symbol)
- symbol = GetNativeSymbolUnversionned(lib->w.lib, name);
+ symbol = GetNativeSymbolUnversioned(lib->w.lib, name);
if(!symbol && lib->w.altprefix) {
char newname[200];
strcpy(newname, lib->w.altprefix);
strcat(newname, name);
- symbol = GetNativeSymbolUnversionned(lib->w.lib, newname);
+ symbol = GetNativeSymbolUnversioned(lib->w.lib, newname);
}
if(!symbol) {
printf_log(LOG_INFO, "Warning, function %s not found in lib %s\n", name, lib->name);
@@ -894,7 +919,7 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui
if(!symbol)
symbol = dlsym(RTLD_DEFAULT, kh_value(lib->w.symbol2map, k).name); // search globaly maybe
if(!symbol)
- symbol = GetNativeSymbolUnversionned(lib->w.lib, kh_value(lib->w.symbol2map, k).name);
+ symbol = GetNativeSymbolUnversioned(lib->w.lib, kh_value(lib->w.symbol2map, k).name);
if(!symbol) {
printf_log(LOG_INFO, "Warning, function %s not found in lib %s\n", kh_value(lib->w.symbol2map, k).name, lib->name);
return 0;
@@ -911,15 +936,13 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui
int getSymbolInMaps(library_t *lib, const char* name, int noweak, uintptr_t *addr, uintptr_t *size, int* weak, int version, const char* vername, int local)
{
- if(!lib->active)
- return 0;
if(version==-2) // don't send global native symbol for a version==-2 search
return 0;
// check in datamaps (but no version, it's not handled there)
if(getSymbolInDataMaps(lib, name, noweak, addr, size, weak))
return 1;
- if(getSymbolInSymbolMaps(lib, VersionnedName(name, version, vername), noweak, addr, size, weak))
+ if(getSymbolInSymbolMaps(lib, VersionedName(name, version, vername), noweak, addr, size, weak))
return 1;
if(getSymbolInSymbolMaps(lib, name, noweak, addr, size, weak))
@@ -984,6 +1007,16 @@ linkmap_t* getLinkMapLib(library_t* lib)
}
return NULL;
}
+linkmap_t* getLinkMapElf(elfheader_t* h)
+{
+ linkmap_t* lm = my_context->linkmap;
+ while(lm) {
+ if(lm->l_lib && lm->l_lib->type==LIB_EMULATED && lm->l_lib->e.elf == h)
+ return lm;
+ lm = lm->l_next;
+ }
+ return NULL;
+}
linkmap_t* addLinkMapLib(library_t* lib)
{
if(!my_context->linkmap) {
@@ -1049,6 +1082,37 @@ void add1_neededlib(needed_libs_t* needed)
needed->names = (char**)realloc(needed->names, needed->cap*sizeof(char*));
needed->size++;
}
+void add1lib_neededlib(needed_libs_t* needed, library_t* lib, const char* name)
+{
+ if(!needed || !lib)
+ return;
+ // check if lib is already present
+ for (int i=0; i<needed->size; ++i)
+ if(needed->libs[i]==lib)
+ return;
+ // add it
+ if(needed->size+1<=needed->cap)
+ return;
+ needed->cap = needed->size+1;
+ needed->libs = (library_t**)realloc(needed->libs, needed->cap*sizeof(library_t*));
+ needed->names = (char**)realloc(needed->names, needed->cap*sizeof(char*));
+ needed->libs[needed->size] = lib;
+ needed->names[needed->size] = (char*)name;
+ needed->size++;
+}
+needed_libs_t* copy_neededlib(needed_libs_t* needed)
+{
+ if(!needed)
+ return NULL;
+ needed_libs_t* ret = (needed_libs_t*)calloc(1, sizeof(needed_libs_t));
+ ret->cap = needed->cap;
+ ret->size = needed->size;
+ ret->libs = (library_t**)calloc(ret->cap, sizeof(library_t*));
+ ret->names = (char**)calloc(ret->cap, sizeof(char*));
+ memcpy(ret->libs, needed->libs, ret->size*sizeof(library_t*));
+ memcpy(ret->names, needed->names, ret->size*sizeof(char*));
+ return ret;
+}
void setNeededLibs(library_t* lib, int n, ...)
{
@@ -1065,15 +1129,80 @@ void setNeededLibs(library_t* lib, int n, ...)
void IncRefCount(library_t* lib, x64emu_t* emu)
{
- if(lib->type==LIB_UNNKNOW)
+ if(!lib || lib->type==LIB_UNNKNOW)
return;
- if(!lib->active)
- ReloadLibrary(lib, emu);
switch (lib->type) {
case LIB_WRAPPED:
++lib->w.refcnt;
+ /*if(lib->w.needed)
+ for(int i=0; i<lib->w.needed->size; ++i) {
+ IncRefCount(lib->w.needed->libs[i], emu);
+ }*/
break;
case LIB_EMULATED:
++lib->e.elf->refcnt;
+ /*if(lib->e.elf->needed)
+ for(int i=0; i<lib->e.elf->needed->size; ++i) // some libs may not be loaded yet
+ IncRefCount(lib->e.elf->needed->libs[i], emu);*/
}
-} \ No newline at end of file
+}
+
+int DecRefCount(library_t** lib, x64emu_t* emu)
+{
+ if(!lib || !*lib)
+ return 1;
+ if((*lib)->type==LIB_UNNKNOW) {
+ Free1Library(lib, emu);
+ return 0;
+ }
+ int ret = 1;
+ needed_libs_t* needed = NULL;
+ int freed = 0;
+ switch ((*lib)->type) {
+ case LIB_WRAPPED:
+ needed = (*lib)->w.needed;
+ ret=--(*lib)->w.refcnt;
+ if(!ret) {
+ needed = copy_neededlib(needed);
+ freed=1;
+ Free1Library(lib, emu);
+ }
+ break;
+ case LIB_EMULATED:
+ needed = (*lib)->e.elf->needed;
+ ret=--(*lib)->e.elf->refcnt;
+ if(!ret) {
+ needed = copy_neededlib(needed);
+ freed=1;
+ removeLinkMapLib(*lib);
+ FiniLibrary(*lib, emu);
+ Free1Library(lib, emu);
+ }
+ break;
+ }
+ /*if(needed)
+ for(int i=0; i<needed->size; ++i)
+ DecRefCount(&needed->libs[i], emu);*/
+ if(freed)
+ free_neededlib(needed);
+ return ret;
+}
+
+int GetRefCount(library_t* lib)
+{
+ switch (lib->type) {
+ case LIB_WRAPPED:
+ return lib->w.refcnt;
+ break;
+ case LIB_EMULATED:
+ return lib->e.elf->refcnt;
+ default:
+ return 0;
+ }
+}
+
+void SetDlOpenIdx(library_t* lib, int dlopen)
+{
+ if(lib)
+ lib->dlopen = dlopen;
+}
diff --git a/src/librarian/library_private.h b/src/librarian/library_private.h
index 2b2c5ef..27d3fef 100755..100644
--- a/src/librarian/library_private.h
+++ b/src/librarian/library_private.h
@@ -62,7 +62,6 @@ typedef struct library_s {
char* path; // original path
int nbdot; // nombre of "." after .so
int type; // 0: native(wrapped) 1: emulated(elf) -1: undetermined
- int active;
wrappedlib_fini_t fini;
wrappedlib_get_t getglobal; // get global (non-weak)
wrappedlib_get_t getweak; // get weak symbol
@@ -75,6 +74,7 @@ typedef struct library_s {
kh_bridgemap_t *gbridgemap; // global symbol bridgemap
kh_bridgemap_t *wbridgemap; // weak symbol bridgemap
kh_bridgemap_t *lbridgemap; // local symbol bridgemap
+ int dlopen; // idx to the dlopen idx (or 0 if not dlopen)
} library_t;
// type for map elements
@@ -109,7 +109,13 @@ typedef struct linkmap_s {
} linkmap_t;
linkmap_t* getLinkMapLib(library_t* lib);
+linkmap_t* getLinkMapElf(elfheader_t* h);
linkmap_t* addLinkMapLib(library_t* lib);
void removeLinkMapLib(library_t* lib);
+int FiniLibrary(library_t* lib, x64emu_t* emu);
+void Free1Library(library_t **lib, x64emu_t* emu);
+
+void RemoveDlopen(library_t** lib, int idx); // defined in wrappedlibdl.c
+
#endif //__LIBRARY_PRIVATE_H_
diff --git a/src/librarian/symbols.c b/src/librarian/symbols.c
index 4584c8f..cb59430 100644
--- a/src/librarian/symbols.c
+++ b/src/librarian/symbols.c
@@ -17,7 +17,7 @@ typedef struct onesymbol_s {
} onesymbol_t;
typedef struct versymbol_s {
- int version; // -1 = no-version, 0=local, 1=global, X=versionned
+ int version; // -1 = no-version, 0=local, 1=global, X=versioned
const char* vername; // NULL or version name if version=X
onesymbol_t sym;
} versymbol_t;
@@ -170,6 +170,19 @@ void AddSymbol(kh_mapsymbols_t *mapsymbols, const char* name, uintptr_t addr, ui
v->syms[idx].sym.sz = sz;
}
+void ForceUpdateSymbol(kh_mapsymbols_t *mapsymbols, const char* name, uintptr_t addr, uint32_t sz)
+{
+ int ret;
+ khint_t k = kh_put(mapsymbols, mapsymbols, name, &ret);
+ versymbols_t * v = &kh_val(mapsymbols, k);
+ if(ret) {v->sz = v->cap = 0; v->syms = NULL;}
+ // now check if that version already exist, and update record and exit if yes
+ for(int i=0; i<v->sz; ++i) {
+ v->syms[i].sym.offs = addr;
+ v->syms[i].sym.sz = sz;
+ }
+}
+
uintptr_t FindSymbol(kh_mapsymbols_t *mapsymbols, const char* name, int ver, const char* vername, int local, const char* defver)
{
if(!mapsymbols)
diff --git a/src/library_list.h b/src/library_list.h
index 9fbb551..9770518 100755..100644
--- a/src/library_list.h
+++ b/src/library_list.h
@@ -3,7 +3,7 @@
#endif
GO("libc.so.6", libc)
-GO("libc.musl-x86_64.so.1", libdl)
+GO("libc.musl-x86_64.so.1", libcmusl)
GO("libpthread.so.0", libpthread)
GO("librt.so.1", librt)
GO("libEGL.so.1", libegl)
@@ -15,6 +15,7 @@ GO("libGLX.so.0", libglx)
GO("libGLX.so", libglx)
GO("libX11.so.6", libx11)
GO("libasound.so.2", libasound)
+GO("libasound.so", libasound)
GO("libdl.so.2", libdl)
GO("libm.so.6", libm)
GO("libSDL2-2.0.so.0", sdl2)
@@ -106,6 +107,8 @@ GO("libexpat.so.1", expat)
GO("libexpat.so", expat)
GO("libcrypto.so.1", crypto)
GO("libssl.so.1", libssl)
+GO("libcrypto.so.3", crypto3)
+GO("libssl.so.3", libssl3)
GO("libcrypt.so.1", libcrypt)
GO("libgcrypt.so.20", gcrypt)
GO("libutil.so.1", util)
@@ -150,6 +153,7 @@ GO("libpango-1.0.so", pango)
GO("libibus-1.0.so.5", libibus)
GO("libfontconfig.so.1", fontconfig)
GO("libfreetype.so.6", freetype)
+GO("libharfbuzz.so.0", libharfbuzz)
GO("libbz2.so.1", bz2)
GO("liblzma.so.5", lzma)
GO("libSM.so.6", libsm)
@@ -166,19 +170,21 @@ GO("libncurses.so.6", libncurses6)
GO("libtinfo.so.6", libtinfo6)
GO("libtbbmalloc.so.2", tbbmalloc)
GO("libtbbmalloc_proxy.so.2", tbbmallocproxy)
+GO("libtbbbind_2_5.so", tbbbind)
GO("libtcmalloc_minimal.so.0", tcmallocminimal)
GO("libtcmalloc_minimal.so.4", tcmallocminimal)
GO("libmpg123.so.0", mpg123)
GO("libgnutls.so.30", gnutls)
GO("libpcre.so.3", libpcre)
GO("libcups.so.2", libcups)
-//GO("d3dadapter9.so.1", d3dadapter9)
GO("libvulkan.so.1", vulkan)
GO("libvulkan.so", vulkan)
//GO("libwayland-client.so.0", waylandclient)
GO("libgbm.so.1", gbm)
GO("libxml2.so.2", xml2)
GO("libxslt.so.1", xslt)
+GO("libgomp.so.1", gomp)
+GO("libcap.so.2", cap)
GO("libldap_r-2.4.so.2", ldapr)
GO("liblber-2.4.so.2", lber)
//GO("libnsl.so.1", nsl)
@@ -220,7 +226,13 @@ GO("libva-drm.so.2", libvadrm)
GO("libva-x11.so.2", libvax11)
GO("libva-wayland.so.2", libvawayland)
GO("libvdpau.so.1", libvdpau)
+GO("libnuma.so.1", libnuma)
+GO("libnuma.so", libnuma)
GO("d3dadapter9.so.1", d3dadapter9)
+GO("libicuuc.so.67", icuuc67)
+GO("libicui18n.so.67", icui18n67)
+GO("libicuuc.so.72", icuuc72)
+GO("libicui18n.so.72", icui18n72)
GO("ld-linux-x86-64.so.2", ldlinux)
diff --git a/src/libtools/auxval.c b/src/libtools/auxval.c
index 789902d..789902d 100755..100644
--- a/src/libtools/auxval.c
+++ b/src/libtools/auxval.c
diff --git a/src/libtools/myalign.c b/src/libtools/myalign.c
index 3d2e49a..36873cb 100755..100644
--- a/src/libtools/myalign.c
+++ b/src/libtools/myalign.c
@@ -717,7 +717,7 @@ void myStackAlignValist(x64emu_t* emu, const char* fmt, uint64_t* mystack, x64_v
case 15: //%zg, meh.. double?
if(fprs<X64_VA_MAX_XMM) {
*mystack = area[fprs/8];
- fprs+=8;
+ fprs+=16;
mystack++;
} else {
*mystack = *st;
@@ -862,7 +862,7 @@ void myStackAlignWValist(x64emu_t* emu, const char* fmt, uint64_t* mystack, x64_
case 15: //%zg, meh .. double
if(fprs<X64_VA_MAX_XMM) {
*mystack = area[fprs/8];
- fprs+=8;
+ fprs+=16;
mystack++;
} else {
*mystack = *st;
@@ -1130,4 +1130,4 @@ void myStackAlignScanfWValist(x64emu_t* emu, const char* fmt, uint64_t* mystack,
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/libtools/obstack.c b/src/libtools/obstack.c
index 42b9356..b3f2fc5 100755..100644
--- a/src/libtools/obstack.c
+++ b/src/libtools/obstack.c
@@ -44,7 +44,7 @@ GO(4)
static uintptr_t my_chunkfun_fct_##A = 0; \
static void* my_chunkfun_##A(size_t a) \
{ \
- return (void*)RunFunction(my_context, my_chunkfun_fct_##A, 1, a); \
+ return (void*)RunFunction(my_chunkfun_fct_##A, 1, a); \
}
SUPER()
#undef GO
@@ -77,7 +77,7 @@ static void* reverse_chunkfunFct(library_t* lib, void* fct)
static uintptr_t my_freefun_fct_##A = 0; \
static void my_freefun_##A(void* a) \
{ \
- RunFunction(my_context, my_freefun_fct_##A, 1, a); \
+ RunFunction(my_freefun_fct_##A, 1, a); \
}
SUPER()
#undef GO
@@ -239,7 +239,7 @@ void actual_obstack_alloc_failed_handler()
{
if(ref_obstack_alloc_failed_handler == my_obstack_alloc_failed_handler)
real_obstack_alloc_failed_handler();
- RunFunction(my_context, (uintptr_t)my_obstack_alloc_failed_handler, 0);
+ RunFunction((uintptr_t)my_obstack_alloc_failed_handler, 0);
}
void obstackSetup()
{
diff --git a/src/libtools/sdl1rwops.c b/src/libtools/sdl1rwops.c
index c7349af..ec3f8ab 100755..100644
--- a/src/libtools/sdl1rwops.c
+++ b/src/libtools/sdl1rwops.c
@@ -72,20 +72,20 @@ EXPORT int32_t my_native_close(SDL1_RWops_t *context)
}
EXPORT int32_t my_emulated_seek(SDL1_RWops_t *context, int32_t offset, int32_t whence)
{
- return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->seek, 3, context->hidden.my.orig, offset, whence);
+ return (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->seek, "pii", context->hidden.my.orig, offset, whence);
}
EXPORT int32_t my_emulated_read(SDL1_RWops_t *context, void *ptr, int32_t size, int32_t maxnum)
{
- return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->read, 4, context->hidden.my.orig, ptr, size, maxnum);
+ return (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->read, "ppii", context->hidden.my.orig, ptr, size, maxnum);
}
EXPORT int32_t my_emulated_write(SDL1_RWops_t *context, const void *ptr, int32_t size, int32_t num)
{
- return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->write, 4, context->hidden.my.orig, ptr, size, num);
+ return (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->write, "ppii", context->hidden.my.orig, ptr, size, num);
}
EXPORT int32_t my_emulated_close(SDL1_RWops_t *context)
{
- return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->close, 1, context->hidden.my.orig);
+ return (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->close, "p", context->hidden.my.orig);
}
SDL1_RWops_t* AddNativeRW(x64emu_t* emu, SDL1_RWops_t* ops)
@@ -180,4 +180,4 @@ void RWSetType(SDL1_RWops_t* r, int awesome)
{
if(r)
r->type = awesome; // I like shoot'em up :D
-} \ No newline at end of file
+}
diff --git a/src/libtools/sdl2rwops.c b/src/libtools/sdl2rwops.c
index f57dc56..085c783 100755..100644
--- a/src/libtools/sdl2rwops.c
+++ b/src/libtools/sdl2rwops.c
@@ -13,6 +13,7 @@
#include "librarian/library_private.h"
#include "bridge.h"
#include "callback.h"
+#include "librarian.h"
typedef struct SDL2_RWops_s SDL2_RWops_t;
@@ -84,31 +85,56 @@ EXPORT int32_t my2_native_close(SDL2_RWops_t *context)
}
EXPORT int64_t my2_emulated_size(SDL2_RWops_t *context)
{
- return (int64_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->size, 1, context->hidden.my.orig);
+ return (int64_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->size, "p", context->hidden.my.orig);
}
EXPORT int64_t my2_emulated_seek(SDL2_RWops_t *context, int64_t offset, int32_t whence)
{
- return (int64_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->seek, 3, context->hidden.my.orig, offset, whence);
+ return (int64_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->seek, "pIi", context->hidden.my.orig, offset, whence);
}
EXPORT int32_t my2_emulated_read(SDL2_RWops_t *context, void *ptr, int32_t size, int32_t maxnum)
{
- return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->read, 4, context->hidden.my.orig, ptr, size, maxnum);
+ return (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->read, "ppii", context->hidden.my.orig, ptr, size, maxnum);
}
EXPORT int32_t my2_emulated_write(SDL2_RWops_t *context, const void *ptr, int32_t size, int32_t num)
{
- return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->write, 4, context->hidden.my.orig, ptr, size, num);
+ return (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->write, "ppii", context->hidden.my.orig, ptr, size, num);
}
EXPORT int32_t my2_emulated_close(SDL2_RWops_t *context)
{
- int ret = (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->close, 1, context->hidden.my.orig);
+ int ret = (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->close, "p", context->hidden.my.orig);
context->hidden.my.custom_free(context);
return ret;
}
+static uintptr_t emulated_sdl2allocrw = 0;
+EXPORT SDL2_RWops_t* my_wrapped_sdl2allocrw()
+{
+ return (SDL2_RWops_t*)RunFunctionFmt(emulated_sdl2allocrw, "");
+}
+static uintptr_t emulated_sdl2freerw = 0;
+EXPORT void my_wrapped_sdl2freerw(SDL2_RWops_t* p)
+{
+ RunFunctionFmt(emulated_sdl2freerw, "p", p);
+}
+
+static void checkSDL2isNative()
+{
+ if(my_context->sdl2allocrw)
+ return;
+ emulated_sdl2allocrw = FindGlobalSymbol(my_context->maplib, "SDL_AllocRW", -1, NULL);
+ emulated_sdl2freerw = FindGlobalSymbol(my_context->maplib, "SDL_FreeRW", -1, NULL);
+ if(emulated_sdl2allocrw && emulated_sdl2freerw) {
+ my_context->sdl2allocrw = my_wrapped_sdl2allocrw;
+ my_context->sdl2freerw = my_wrapped_sdl2freerw;
+ } else
+ printf_log(LOG_NONE, "Warning, cannot find SDL_AllocRW and/or SDL_FreeRW function in loaded libs");
+}
+
SDL2_RWops_t* AddNativeRW2(x64emu_t* emu, SDL2_RWops_t* ops)
{
if(!ops)
return NULL;
+ checkSDL2isNative();
uintptr_t fnc;
bridge_t* system = emu->context->system;
@@ -141,13 +167,14 @@ SDL2_RWops_t* RWNativeStart2(x64emu_t* emu, SDL2_RWops_t* ops)
if(ops->type == BOX64RW)
return ops->hidden.my.orig;
+ checkSDL2isNative();
sdl2_allocrw Alloc = (sdl2_allocrw)emu->context->sdl2allocrw;
SDL2_RWops_t* newrw = Alloc();
newrw->type = BOX64RW;
newrw->hidden.my.orig = ops;
newrw->hidden.my.custom_free = (sdl2_freerw)emu->context->sdl2freerw;
-
+
// create wrapper
#define GO(A, W) \
newrw->A = my2_emulated_##A;
@@ -202,4 +229,4 @@ int32_t RWNativeWrite2(SDL2_RWops_t *ops, const void *ptr, int32_t size, int32_t
int32_t RWNativeClose2(SDL2_RWops_t* ops)
{
return ops->close(ops);
-} \ No newline at end of file
+}
diff --git a/src/libtools/signals.c b/src/libtools/signals.c
index 0558a88..e47a3da 100755..100644
--- a/src/libtools/signals.c
+++ b/src/libtools/signals.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
@@ -269,7 +270,7 @@ static void sigstack_key_alloc() {
//1<<8 is mutex_dyndump
#define is_dyndump_locked (1<<8)
-uint64_t RunFunctionHandler(int* exit, x64_ucontext_t* sigcontext, uintptr_t fnc, int nargs, ...)
+uint64_t RunFunctionHandler(int* exit, int dynarec, x64_ucontext_t* sigcontext, uintptr_t fnc, int nargs, ...)
{
if(fnc==0 || fnc==1) {
va_list va;
@@ -291,8 +292,10 @@ uint64_t RunFunctionHandler(int* exit, x64_ucontext_t* sigcontext, uintptr_t fnc
#endif
x64emu_t *emu = thread_get_emu();
-
- printf_log(LOG_DEBUG, "%04d|signal function handler %p called, RSP=%p\n", GetTID(), (void*)fnc, (void*)R_RSP);
+ #ifdef DYNAREC
+ if(box64_dynarec_test)
+ emu->test.test = 0;
+ #endif
/*SetFS(emu, default_fs);*/
for (int i=0; i<6; ++i)
@@ -316,19 +319,37 @@ uint64_t RunFunctionHandler(int* exit, x64_ucontext_t* sigcontext, uintptr_t fnc
}
va_end (va);
- int oldquitonlongjmp = emu->quitonlongjmp;
- emu->quitonlongjmp = 2;
+ printf_log(LOG_DEBUG, "%04d|signal #%d function handler %p called, RSP=%p\n", GetTID(), R_EDI, (void*)fnc, (void*)R_RSP);
+
+ int oldquitonlongjmp = emu->flags.quitonlongjmp;
+ emu->flags.quitonlongjmp = 2;
+ int old_cs = R_CS;
+ R_CS = 0x33;
- EmuCall(emu, fnc); // avoid DynaCall for now
- //DynaCall(emu, fnc);
- if(nargs>6)
+ emu->eflags.x64 &= ~(1<<F_TF); // this one needs to cleared
+
+ if(dynarec)
+ DynaCall(emu, fnc);
+ else
+ EmuCall(emu, fnc);
+
+ if(nargs>6 && !emu->flags.longjmp)
R_RSP+=((nargs-6)*sizeof(void*));
- emu->quitonlongjmp = oldquitonlongjmp;
+ if(!emu->flags.longjmp && R_CS==0x33)
+ R_CS = old_cs;
+
+ emu->flags.quitonlongjmp = oldquitonlongjmp;
+
+ #ifdef DYNAREC
+ if(box64_dynarec_test)
+ emu->test.test = 0;
+ emu->test.clean = 0;
+ #endif
- if(emu->longjmp) {
+ if(emu->flags.longjmp) {
// longjmp inside signal handler, lets grab all relevent value and do the actual longjmp in the signal handler
- emu->longjmp = 0;
+ emu->flags.longjmp = 0;
if(sigcontext) {
sigcontext->uc_mcontext.gregs[X64_R8] = R_R8;
sigcontext->uc_mcontext.gregs[X64_R9] = R_R9;
@@ -439,6 +460,25 @@ uintptr_t getX64Address(dynablock_t* db, uintptr_t arm_addr)
} while(db->instsize[i].x64 || db->instsize[i].nat);
return x64addr;
}
+x64emu_t* getEmuSignal(x64emu_t* emu, ucontext_t* p, dynablock_t* db)
+{
+#if defined(ARM64)
+ if(db && p->uc_mcontext.regs[0]>0x10000) {
+ emu = (x64emu_t*)p->uc_mcontext.regs[0];
+ }
+#elif defined(LA464)
+ if(db && p->uc_mcontext.__gregs[4]>0x10000) {
+ emu = (x64emu_t*)p->uc_mcontext.__gregs[4];
+ }
+#elif defined(RV64)
+ if(db && p->uc_mcontext.__gregs[10]>0x10000) {
+ emu = (x64emu_t*)p->uc_mcontext.__gregs[10];
+ }
+#else
+#error Unsupported Architecture
+#endif //arch
+ return emu;
+}
#endif
void copyUCTXreg2Emu(x64emu_t* emu, ucontext_t* p, uintptr_t ip) {
@@ -481,6 +521,25 @@ void copyUCTXreg2Emu(x64emu_t* emu, ucontext_t* p, uintptr_t ip) {
emu->regs[_R15].q[0] = p->uc_mcontext.__gregs[30];
emu->ip.q[0] = ip;
emu->eflags.x64 = p->uc_mcontext.__gregs[31];
+#elif defined(RV64)
+ emu->regs[_AX].q[0] = p->uc_mcontext.__gregs[16];
+ emu->regs[_CX].q[0] = p->uc_mcontext.__gregs[17];
+ emu->regs[_DX].q[0] = p->uc_mcontext.__gregs[18];
+ emu->regs[_BX].q[0] = p->uc_mcontext.__gregs[19];
+ emu->regs[_SP].q[0] = p->uc_mcontext.__gregs[20];
+ emu->regs[_BP].q[0] = p->uc_mcontext.__gregs[21];
+ emu->regs[_SI].q[0] = p->uc_mcontext.__gregs[22];
+ emu->regs[_DI].q[0] = p->uc_mcontext.__gregs[23];
+ emu->regs[_R8].q[0] = p->uc_mcontext.__gregs[24];
+ emu->regs[_R9].q[0] = p->uc_mcontext.__gregs[25];
+ emu->regs[_R10].q[0] = p->uc_mcontext.__gregs[26];
+ emu->regs[_R11].q[0] = p->uc_mcontext.__gregs[27];
+ emu->regs[_R12].q[0] = p->uc_mcontext.__gregs[28];
+ emu->regs[_R13].q[0] = p->uc_mcontext.__gregs[29];
+ emu->regs[_R14].q[0] = p->uc_mcontext.__gregs[30];
+ emu->regs[_R15].q[0] = p->uc_mcontext.__gregs[31];
+ emu->ip.q[0] = ip;
+ emu->eflags.x64 = p->uc_mcontext.__gregs[5];
#else
#error Unsupported architecture
#endif
@@ -512,12 +571,22 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void
if(db) {
frame = (uintptr_t)p->uc_mcontext.__gregs[12+_SP];
}
+#elif defined(RV64)
+ ucontext_t *p = (ucontext_t *)ucntx;
+ void * pc = (void*)p->uc_mcontext.__gregs[0];
+ dynablock_t* db = (dynablock_t*)cur_db;//FindDynablockFromNativeAddress(pc);
+ if(db) {
+ frame = (uintptr_t)p->uc_mcontext.__gregs[16+_SP];
+ }
#else
#error Unsupported architecture
#endif
#else
(void)ucntx; (void)cur_db;
#endif
+ // setup libc context stack frame, on caller stack
+ frame = frame&~15;
+
// stack tracking
x64_stack_t *new_ss = my_context->onstack[sig]?(x64_stack_t*)pthread_getspecific(sigstack_key):NULL;
int used_stack = 0;
@@ -604,6 +673,26 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void
sigcontext->uc_mcontext.gregs[X64_R15] = p->uc_mcontext.__gregs[30];
sigcontext->uc_mcontext.gregs[X64_RIP] = getX64Address(db, (uintptr_t)pc);
}
+#elif defined(RV64)
+ if(db) {
+ sigcontext->uc_mcontext.gregs[X64_RAX] = p->uc_mcontext.__gregs[16];
+ sigcontext->uc_mcontext.gregs[X64_RCX] = p->uc_mcontext.__gregs[17];
+ sigcontext->uc_mcontext.gregs[X64_RDX] = p->uc_mcontext.__gregs[18];
+ sigcontext->uc_mcontext.gregs[X64_RBX] = p->uc_mcontext.__gregs[19];
+ sigcontext->uc_mcontext.gregs[X64_RSP] = p->uc_mcontext.__gregs[20];
+ sigcontext->uc_mcontext.gregs[X64_RBP] = p->uc_mcontext.__gregs[21];
+ sigcontext->uc_mcontext.gregs[X64_RSI] = p->uc_mcontext.__gregs[22];
+ sigcontext->uc_mcontext.gregs[X64_RDI] = p->uc_mcontext.__gregs[23];
+ sigcontext->uc_mcontext.gregs[X64_R8] = p->uc_mcontext.__gregs[24];
+ sigcontext->uc_mcontext.gregs[X64_R9] = p->uc_mcontext.__gregs[25];
+ sigcontext->uc_mcontext.gregs[X64_R10] = p->uc_mcontext.__gregs[26];
+ sigcontext->uc_mcontext.gregs[X64_R11] = p->uc_mcontext.__gregs[27];
+ sigcontext->uc_mcontext.gregs[X64_R12] = p->uc_mcontext.__gregs[28];
+ sigcontext->uc_mcontext.gregs[X64_R13] = p->uc_mcontext.__gregs[29];
+ sigcontext->uc_mcontext.gregs[X64_R14] = p->uc_mcontext.__gregs[30];
+ sigcontext->uc_mcontext.gregs[X64_R15] = p->uc_mcontext.__gregs[31];
+ sigcontext->uc_mcontext.gregs[X64_RIP] = getX64Address(db, (uintptr_t)pc);
+ }
#else
#error Unsupported architecture
#endif
@@ -648,8 +737,8 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void
sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 17;
else if(sig==SIGSEGV) {
if((uintptr_t)info->si_addr == sigcontext->uc_mcontext.gregs[X64_RIP]) {
- sigcontext->uc_mcontext.gregs[X64_ERR] = (info->si_errno==0x1234)?0:0x0010; // execution flag issue (probably), unless it's a #GP(0)
- sigcontext->uc_mcontext.gregs[X64_TRAPNO] = (info->si_code == SEGV_ACCERR || (info->si_errno==0x1234) || (uintptr_t)info->si_addr==0)?13:14;
+ sigcontext->uc_mcontext.gregs[X64_ERR] = (info->si_errno==0x1234)?0:((info->si_errno==0xdead)?(0x2|(info->si_code<<3)):0x0010); // execution flag issue (probably), unless it's a #GP(0)
+ sigcontext->uc_mcontext.gregs[X64_TRAPNO] = (info->si_code == SEGV_ACCERR || (info->si_errno==0x1234) || (info->si_errno==0xdead) || (uintptr_t)info->si_addr==0)?13:14;
} else if(info->si_code==SEGV_ACCERR && !(prot&PROT_WRITE)) {
sigcontext->uc_mcontext.gregs[X64_ERR] = 0x0002; // write flag issue
if(labs((intptr_t)info->si_addr-(intptr_t)sigcontext->uc_mcontext.gregs[X64_RSP])<16)
@@ -657,16 +746,21 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void
else
sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 14; // PAGE_FAULT
} else {
- sigcontext->uc_mcontext.gregs[X64_TRAPNO] = (info->si_code == SEGV_ACCERR)?13:14;
+ sigcontext->uc_mcontext.gregs[X64_TRAPNO] = (info->si_code == SEGV_ACCERR)?14:13;
//X64_ERR seems to be INT:8 CODE:8. So for write access segfault it's 0x0002 For a read it's 0x0004 (and 8 for exec). For an int 2d it could be 0x2D01 for example
sigcontext->uc_mcontext.gregs[X64_ERR] = 0x0004; // read error? there is no execute control in box64 anyway
}
if(info->si_code == SEGV_ACCERR && old_code)
*old_code = -1;
- } else if(sig==SIGFPE)
- sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 19;
- else if(sig==SIGILL)
+ } else if(sig==SIGFPE) {
+ if (info->si_code == FPE_INTOVF)
+ sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 4;
+ else
+ sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 19;
+ } else if(sig==SIGILL)
sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 6;
+ else if(sig==SIGTRAP)
+ sigcontext->uc_mcontext.gregs[X64_TRAPNO] = info->si_code;
//TODO: SIGABRT generate what?
// call the signal handler
x64_ucontext_t sigcontext_copy = *sigcontext;
@@ -688,10 +782,15 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void
int exits = 0;
int ret;
- if (simple)
- ret = RunFunctionHandler(&exits, sigcontext, my_context->signals[sig], 1, sig);
- else
- ret = RunFunctionHandler(&exits, sigcontext, my_context->signals[sig], 3, sig, info2, sigcontext);
+ int dynarec = 0;
+ #ifdef DYNAREC
+ if(sig!=SIGSEGV && !(Locks&is_dyndump_locked))
+ dynarec = 1;
+ #endif
+ /*if (simple)
+ ret = RunFunctionHandler(&exits, dynarec, sigcontext, my_context->signals[sig], 1, sig);
+ else*/
+ ret = RunFunctionHandler(&exits, dynarec, sigcontext, my_context->signals[sig], 3, sig, info2, sigcontext);
// restore old value from emu
if(used_stack) // release stack
new_ss->ss_flags = 0;
@@ -707,9 +806,8 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void
#undef GO
if(memcmp(sigcontext, &sigcontext_copy, sizeof(x64_ucontext_t))) {
- emu_jmpbuf_t* ejb = GetJmpBuf();
- if(ejb->jmpbuf_ok) {
- #define GO(R) ejb->emu->regs[_##R].q[0]=sigcontext->uc_mcontext.gregs[X64_R##R]
+ if(emu->jmpbuf) {
+ #define GO(R) emu->regs[_##R].q[0]=sigcontext->uc_mcontext.gregs[X64_R##R]
GO(AX);
GO(CX);
GO(DX);
@@ -719,7 +817,7 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void
GO(SP);
GO(BX);
#undef GO
- #define GO(R) ejb->emu->regs[_##R].q[0]=sigcontext->uc_mcontext.gregs[X64_##R]
+ #define GO(R) emu->regs[_##R].q[0]=sigcontext->uc_mcontext.gregs[X64_##R]
GO(R8);
GO(R9);
GO(R10);
@@ -729,20 +827,22 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void
GO(R14);
GO(R15);
#undef GO
- ejb->emu->ip.q[0]=sigcontext->uc_mcontext.gregs[X64_RIP];
+ emu->ip.q[0]=sigcontext->uc_mcontext.gregs[X64_RIP];
sigcontext->uc_mcontext.gregs[X64_RIP] = R_RIP;
// flags
- ejb->emu->eflags.x64=sigcontext->uc_mcontext.gregs[X64_EFL];
+ emu->eflags.x64=sigcontext->uc_mcontext.gregs[X64_EFL];
// get segments
uint16_t seg;
seg = (sigcontext->uc_mcontext.gregs[X64_CSGSFS] >> 0)&0xffff;
- #define GO(S) if(ejb->emu->segs[_##S]!=seg) {ejb->emu->segs[_##S]=seg; ejb->emu->segs_serial[_##S] = 0;}
+ #define GO(S) if(emu->segs[_##S]!=seg) emu->segs[_##S]=seg
GO(CS);
seg = (sigcontext->uc_mcontext.gregs[X64_CSGSFS] >> 16)&0xffff;
GO(GS);
seg = (sigcontext->uc_mcontext.gregs[X64_CSGSFS] >> 32)&0xffff;
GO(FS);
#undef GO
+ for(int i=0; i<6; ++i)
+ emu->segs_serial[i] = 0;
printf_log(LOG_DEBUG, "Context has been changed in Sigactionhanlder, doing siglongjmp to resume emu at %p\n", (void*)R_RIP);
if(old_code)
*old_code = -1; // re-init the value to allow another segfault at the same place
@@ -753,7 +853,7 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void
if(Locks & is_dyndump_locked)
CancelBlock64(1);
#endif
- siglongjmp(ejb->jmpbuf, 1);
+ siglongjmp(emu->jmpbuf, 1);
}
printf_log(LOG_INFO, "Warning, context has been changed in Sigactionhanlder%s\n", (sigcontext->uc_mcontext.gregs[X64_RIP]!=sigcontext_copy.uc_mcontext.gregs[X64_RIP])?" (EIP changed)":"");
}
@@ -798,13 +898,23 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void
exit(ret);
}
if(restorer)
- RunFunctionHandler(&exits, NULL, restorer, 0);
+ RunFunctionHandler(&exits, 0, NULL, restorer, 0);
relockMutex(Locks);
}
extern void* current_helper;
-#ifdef DYNAREC
+#define USE_SIGNAL_MUTEX
+#ifdef USE_SIGNAL_MUTEX
+#ifdef USE_CUSTOM_MUTEX
static uint32_t mutex_dynarec_prot = 0;
+#else
+static pthread_mutex_t mutex_dynarec_prot = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+#endif
+#define lock_signal() mutex_lock(&mutex_dynarec_prot)
+#define unlock_signal() mutex_unlock(&mutex_dynarec_prot)
+#else // USE_SIGNAL_MUTEX
+#define lock_signal()
+#define unlock_signal()
#endif
extern int box64_quit;
@@ -820,6 +930,7 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
ucontext_t *p = (ucontext_t *)ucntx;
void* addr = (void*)info->si_addr; // address that triggered the issue
void* rsp = NULL;
+ x64emu_t* emu = thread_get_emu();
#ifdef __aarch64__
void * pc = (void*)p->uc_mcontext.pc;
struct fpsimd_context *fpsimd = NULL;
@@ -859,14 +970,15 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
#endif
#ifdef DYNAREC
if((Locks & is_dyndump_locked) && (sig==SIGSEGV) && current_helper) {
- relockMutex(Locks);
+ printf_log(LOG_INFO, "FillBlock triggered a segfault at %p from %p\n", addr, pc);
CancelBlock64(0);
cancelFillBlock(); // Segfault inside a Fillblock, cancel it's creation...
+ relockMutex(Locks);
}
dynablock_t* db = NULL;
int db_searched = 0;
if ((sig==SIGSEGV) && (addr) && (info->si_code == SEGV_ACCERR) && (prot&PROT_DYNAREC)) {
- mutex_lock(&mutex_dynarec_prot);
+ lock_signal();
// check if SMC inside block
db = FindDynablockFromNativeAddress(pc);
db_searched = 1;
@@ -883,24 +995,33 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
}
// access error, unprotect the block (and mark them dirty)
unprotectDB((uintptr_t)addr, 1, 1); // unprotect 1 byte... But then, the whole page will be unprotected
- if(db && ((addr>=db->x64_addr && addr<(db->x64_addr+db->x64_size)) || db->need_test)) {
+ int db_need_test = (db && !box64_dynarec_fastpage)?getNeedTest((uintptr_t)db->x64_addr):0;
+ if(db && ((addr>=db->x64_addr && addr<(db->x64_addr+db->x64_size)) || db_need_test)) {
+ emu = getEmuSignal(emu, p, db);
// dynablock got auto-dirty! need to get out of it!!!
- emu_jmpbuf_t* ejb = GetJmpBuf();
- if(ejb->jmpbuf_ok) {
- copyUCTXreg2Emu(ejb->emu, p, getX64Address(db, (uintptr_t)pc));
+ if(emu->jmpbuf) {
+ copyUCTXreg2Emu(emu, p, getX64Address(db, (uintptr_t)pc));
#ifdef ARM64
- if(fpsimd) {
- ejb->emu->xmm[0].u128 = fpsimd->vregs[0];
- ejb->emu->xmm[1].u128 = fpsimd->vregs[1];
- ejb->emu->xmm[2].u128 = fpsimd->vregs[2];
- ejb->emu->xmm[3].u128 = fpsimd->vregs[3];
- }
+ //TODO: Need proper SIMD/x87 register traking!
+ /*if(fpsimd) {
+ emu->xmm[0].u128 = fpsimd->vregs[0];
+ emu->xmm[1].u128 = fpsimd->vregs[1];
+ emu->xmm[2].u128 = fpsimd->vregs[2];
+ emu->xmm[3].u128 = fpsimd->vregs[3];
+ }*/
#elif defined(LA464)
/*if(fpsimd) {
- ejb->emu->xmm[0].u128 = fpsimd->vregs[0];
- ejb->emu->xmm[1].u128 = fpsimd->vregs[1];
- ejb->emu->xmm[2].u128 = fpsimd->vregs[2];
- ejb->emu->xmm[3].u128 = fpsimd->vregs[3];
+ emu->xmm[0].u128 = fpsimd->vregs[0];
+ emu->xmm[1].u128 = fpsimd->vregs[1];
+ emu->xmm[2].u128 = fpsimd->vregs[2];
+ emu->xmm[3].u128 = fpsimd->vregs[3];
+ }*/
+#elif defined(RV64)
+ /*if(fpsimd) {
+ emu->xmm[0].u128 = fpsimd->vregs[0];
+ emu->xmm[1].u128 = fpsimd->vregs[1];
+ emu->xmm[2].u128 = fpsimd->vregs[2];
+ emu->xmm[3].u128 = fpsimd->vregs[3];
}*/
#else
#error Unsupported architecture
@@ -911,30 +1032,31 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
dynarec_log(LOG_INFO, "Dynablock unprotected, getting out!\n");
}
//relockMutex(Locks);
- mutex_unlock(&mutex_dynarec_prot);
- #ifdef DYNAREC
+ unlock_signal();
if(Locks & is_dyndump_locked)
CancelBlock64(1);
- #endif
- siglongjmp(ejb->jmpbuf, 2);
+ emu->test.clean = 0;
+ siglongjmp(emu->jmpbuf, 2);
}
dynarec_log(LOG_INFO, "Warning, Auto-SMC (%p for db %p/%p) detected, but jmpbuffer not ready!\n", (void*)addr, db, (void*)db->x64_addr);
}
// done
- if((prot&PROT_WRITE) || (prot&PROT_DYNAREC)) {
- mutex_unlock(&mutex_dynarec_prot);
+ if((prot&PROT_WRITE)/*|| (prot&PROT_DYNAREC)*/) {
+ unlock_signal();
// if there is no write permission, don't return and continue to program signal handling
relockMutex(Locks);
return;
}
- mutex_unlock(&mutex_dynarec_prot);
+ unlock_signal();
} else if ((sig==SIGSEGV) && (addr) && (info->si_code == SEGV_ACCERR) && ((prot&(PROT_READ|PROT_WRITE))==(PROT_READ|PROT_WRITE))) {
- mutex_lock(&mutex_dynarec_prot);
+ lock_signal();
db = FindDynablockFromNativeAddress(pc);
db_searched = 1;
if(db && db->x64_addr>= addr && (db->x64_addr+db->x64_size)<addr) {
dynarec_log(LOG_INFO, "Warning, addr inside current dynablock!\n");
}
+ // mark stuff as unclean
+ cleanDBFromAddressRange(((uintptr_t)addr)&~(box64_pagesize-1), box64_pagesize, 0);
static void* glitch_pc = NULL;
static void* glitch_addr = NULL;
static int glitch_prot = 0;
@@ -946,7 +1068,7 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
glitch_addr = addr;
glitch_prot = prot;
relockMutex(Locks);
- mutex_unlock(&mutex_dynarec_prot);
+ unlock_signal();
return; // try again
}
dynarec_log(/*LOG_DEBUG*/LOG_INFO, "Repeated SIGSEGV with Access error on %p for %p, db=%p, prot=0x%x\n", pc, addr, db, prot);
@@ -968,14 +1090,14 @@ dynarec_log(/*LOG_DEBUG*/LOG_INFO, "Repeated SIGSEGV with Access error on %p for
refreshProtection((uintptr_t)addr);
relockMutex(Locks);
sched_yield(); // give time to the other process
- mutex_unlock(&mutex_dynarec_prot);
+ unlock_signal();
return; // try again
}
glitch2_pc = NULL;
glitch2_addr = NULL;
glitch2_prot = 0;
}
- mutex_unlock(&mutex_dynarec_prot);
+ unlock_signal();
} else if ((sig==SIGSEGV) && (addr) && (info->si_code == SEGV_ACCERR) && (prot&PROT_DYNAREC_R)) {
// unprotect and continue to signal handler, because Write is not there on purpose
unprotectDB((uintptr_t)addr, 1, 1); // unprotect 1 byte... But then, the whole page will be unprotected
@@ -994,10 +1116,13 @@ dynarec_log(/*LOG_DEBUG*/LOG_INFO, "Repeated SIGSEGV with Access error on %p for
printf_log(log_minimum, "%04d|Double %s (code=%d, pc=%p, addr=%p)!\n", GetTID(), signame, old_code, old_pc, old_addr);
exit(-1);
} else {
- if(sig==SIGSEGV && info->si_code==2 && ((prot&~PROT_DYN)==5 || (prot&~PROT_DYN)==7)) {
+ if((sig==SIGSEGV) && (info->si_code == SEGV_ACCERR) && ((prot&~PROT_CUSTOM)==5 || (prot&~PROT_CUSTOM)==7)) {
static uintptr_t old_addr = 0;
printf_log(/*LOG_DEBUG*/LOG_INFO, "Strange SIGSEGV with Access error on %p for %p, db=%p, prot=0x%x (old_addr=%p)\n", pc, addr, db, prot, (void*)old_addr);
- if(old_addr!=(uintptr_t)addr) {
+ #ifdef DYNAREC
+ cleanDBFromAddressRange(((uintptr_t)addr)&~(box64_pagesize-1), box64_pagesize, 0);
+ #endif
+ if(old_addr!=(uintptr_t)addr || getMmapped((uintptr_t)addr)) {
old_addr = (uintptr_t)addr;
refreshProtection(old_addr);
relockMutex(Locks);
@@ -1009,11 +1134,10 @@ exit(-1);
old_pc = pc;
old_addr = addr;
old_tid = GetTID();
- const char* name = GetNativeName(pc);
+ const char* name = (log_minimum<=box64_log)?GetNativeName(pc):NULL;
uintptr_t x64pc = (uintptr_t)-1;
const char* x64name = NULL;
const char* elfname = NULL;
- x64emu_t* emu = thread_get_emu();
// Adjust RIP for special case of NULL function run
if(sig==SIGSEGV && R_RIP==0x1 && (uintptr_t)info->si_addr==0x0)
R_RIP = 0x0;
@@ -1021,9 +1145,6 @@ exit(-1);
rsp = (void*)R_RSP;
#if defined(DYNAREC)
#if defined(ARM64)
- if(db && p->uc_mcontext.regs[0]>0x10000) {
- emu = (x64emu_t*)p->uc_mcontext.regs[0];
- }
if(db) {
x64pc = getX64Address(db, (uintptr_t)pc);
rsp = (void*)p->uc_mcontext.regs[10+_SP];
@@ -1036,16 +1157,26 @@ exit(-1);
x64pc = getX64Address(db, (uintptr_t)pc);
rsp = (void*)p->uc_mcontext.__gregs[12+_SP];
}
+#elif defined(RV64)
+ if(db && p->uc_mcontext.__gregs[10]>0x10000) {
+ emu = (x64emu_t*)p->uc_mcontext.__gregs[10];
+ }
+ if(db) {
+ x64pc = getX64Address(db, (uintptr_t)pc);
+ rsp = (void*)p->uc_mcontext.__gregs[16+_SP];
+ }
#else
#error Unsupported Architecture
#endif //arch
#endif //DYNAREC
if(!db && (sig==SIGSEGV) && ((uintptr_t)addr==x64pc-1))
x64pc--;
- x64name = getAddrFunctionName(x64pc);
- elfheader_t* elf = FindElfAddress(my_context, x64pc);
- if(elf)
- elfname = ElfName(elf);
+ if(log_minimum<=box64_log) {
+ x64name = getAddrFunctionName(x64pc);
+ elfheader_t* elf = FindElfAddress(my_context, x64pc);
+ if(elf)
+ elfname = ElfName(elf);
+ }
if(jit_gdb) {
pid_t pid = getpid();
int v = vfork(); // is this ok in a signal handler???
@@ -1138,50 +1269,75 @@ exit(-1);
GO(RIP);
#undef GO
}
- static const char* reg_name[] = {"RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI", " R8", " R9","R10","R11", "R12","R13","R14","R15"};
- int shown_regs = 0;
+ if(log_minimum<=box64_log) {
+ static const char* reg_name[] = {"RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI", " R8", " R9","R10","R11", "R12","R13","R14","R15"};
+ static const char* seg_name[] = {"ES", "CS", "SS", "DS", "FS", "GS"};
+ int shown_regs = 0;
#ifdef DYNAREC
- uint32_t hash = 0;
- if(db)
- hash = X31_hash_code(db->x64_addr, db->x64_size);
- printf_log(log_minimum, "%04d|%s @%p (%s) (x64pc=%p/%s:\"%s\", rsp=%p, stack=%p:%p own=%p fp=%p), for accessing %p (code=%d/prot=%x), db=%p(%p:%p/%p:%p/%s:%s, hash:%x/%x) handler=%p",
- GetTID(), signame, pc, name, (void*)x64pc, elfname?elfname:"???", x64name?x64name:"???", rsp,
- emu->init_stack, emu->init_stack+emu->size_stack, emu->stack2free, (void*)R_RBP,
- addr, info->si_code,
- prot, db, db?db->block:0, db?(db->block+db->size):0,
- db?db->x64_addr:0, db?(db->x64_addr+db->x64_size):0,
- getAddrFunctionName((uintptr_t)(db?db->x64_addr:0)),
- (db?db->need_test:0)?"need_stest":"clean", db?db->hash:0, hash,
- (void*)my_context->signals[sig]);
+ uint32_t hash = 0;
+ if(db)
+ hash = X31_hash_code(db->x64_addr, db->x64_size);
+ printf_log(log_minimum, "%04d|%s @%p (%s) (x64pc=%p/%s:\"%s\", rsp=%p, stack=%p:%p own=%p fp=%p), for accessing %p (code=%d/prot=%x), db=%p(%p:%p/%p:%p/%s:%s, hash:%x/%x) handler=%p",
+ GetTID(), signame, pc, name, (void*)x64pc, elfname?elfname:"???", x64name?x64name:"???", rsp,
+ emu->init_stack, emu->init_stack+emu->size_stack, emu->stack2free, (void*)R_RBP,
+ addr, info->si_code,
+ prot, db, db?db->block:0, db?(db->block+db->size):0,
+ db?db->x64_addr:0, db?(db->x64_addr+db->x64_size):0,
+ getAddrFunctionName((uintptr_t)(db?db->x64_addr:0)),
+ (db?getNeedTest((uintptr_t)db->x64_addr):0)?"need_stest":"clean", db?db->hash:0, hash,
+ (void*)my_context->signals[sig]);
#if defined(ARM64)
- if(db) {
- shown_regs = 1;
- for (int i=0; i<16; ++i) {
- if(!(i%4)) printf_log(log_minimum, "\n");
- printf_log(log_minimum, "%s:0x%016llx ", reg_name[i], p->uc_mcontext.regs[10+i]);
+ if(db) {
+ shown_regs = 1;
+ for (int i=0; i<16; ++i) {
+ if(!(i%4)) printf_log(log_minimum, "\n");
+ printf_log(log_minimum, "%s:0x%016llx ", reg_name[i], p->uc_mcontext.regs[10+i]);
+ }
+ printf_log(log_minimum, "\n");
+ for (int i=0; i<6; ++i)
+ printf_log(log_minimum, "%s:0x%04x ", seg_name[i], emu->segs[i]);
}
- }
- if(rsp!=addr)
- for (int i=-4; i<4; ++i) {
- printf_log(log_minimum, "%sRSP%c0x%02x:0x%016lx", (i%4)?" ":"\n", i<0?'-':'+', abs(i)*8, *(uintptr_t*)(rsp+i*8));
+ if(rsp!=addr && getProtection((uintptr_t)rsp-4*8) && getProtection((uintptr_t)rsp+4*8))
+ for (int i=-4; i<4; ++i) {
+ printf_log(log_minimum, "%sRSP%c0x%02x:0x%016lx", (i%4)?" ":"\n", i<0?'-':'+', abs(i)*8, *(uintptr_t*)(rsp+i*8));
+ }
+#elif defined(RV64)
+ if(db) {
+ shown_regs = 1;
+ for (int i=0; i<16; ++i) {
+ if(!(i%4)) printf_log(log_minimum, "\n");
+ printf_log(log_minimum, "%s:0x%016llx ", reg_name[i], p->uc_mcontext.__gregs[16+i]);
+ }
+ printf_log(log_minimum, "\n");
+ for (int i=0; i<6; ++i)
+ printf_log(log_minimum, "%s:0x%04x ", seg_name[i], emu->segs[i]);
}
+ if(rsp!=addr && getProtection((uintptr_t)rsp-4*8) && getProtection((uintptr_t)rsp+4*8))
+ for (int i=-4; i<4; ++i) {
+ printf_log(log_minimum, "%sRSP%c0x%02x:0x%016lx", (i%4)?" ":"\n", i<0?'-':'+', abs(i)*8, *(uintptr_t*)(rsp+i*8));
+ }
#else
- #warning TODO
+ #warning TODO
#endif
#else
- printf_log(log_minimum, "%04d|%s @%p (%s) (x64pc=%p/%s:\"%s\", rsp=%p), for accessing %p (code=%d)", GetTID(), signame, pc, name, (void*)x64pc, elfname?elfname:"???", x64name?x64name:"???", rsp, addr, info->si_code);
+ printf_log(log_minimum, "%04d|%s @%p (%s) (x64pc=%p/%s:\"%s\", rsp=%p), for accessing %p (code=%d)", GetTID(), signame, pc, name, (void*)x64pc, elfname?elfname:"???", x64name?x64name:"???", rsp, addr, info->si_code);
#endif
- if(!shown_regs)
- for (int i=0; i<16; ++i) {
- if(!(i%4)) printf_log(log_minimum, "\n");
- printf_log(log_minimum, "%s:0x%016llx ", reg_name[i], emu->regs[i].q[0]);
+ if(!shown_regs) {
+ for (int i=0; i<16; ++i) {
+ if(!(i%4)) printf_log(log_minimum, "\n");
+ printf_log(log_minimum, "%s:0x%016llx ", reg_name[i], emu->regs[i].q[0]);
+ }
+ printf_log(log_minimum, "\n");
+ for (int i=0; i<6; ++i)
+ printf_log(log_minimum, "%s:0x%04x ", seg_name[i], emu->segs[i]);
}
- if(sig==SIGILL)
- printf_log(log_minimum, " opcode=%02X %02X %02X %02X %02X %02X %02X %02X (%02X %02X %02X %02X %02X)\n", ((uint8_t*)pc)[0], ((uint8_t*)pc)[1], ((uint8_t*)pc)[2], ((uint8_t*)pc)[3], ((uint8_t*)pc)[4], ((uint8_t*)pc)[5], ((uint8_t*)pc)[6], ((uint8_t*)pc)[7], ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4]);
- else if(sig==SIGBUS)
- printf_log(log_minimum, " x86opcode=%02X %02X %02X %02X %02X %02X %02X %02X\n", ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4], ((uint8_t*)x64pc)[5], ((uint8_t*)x64pc)[6], ((uint8_t*)x64pc)[7]);
- else
- printf_log(log_minimum, "\n");
+ if(sig==SIGILL)
+ printf_log(log_minimum, " opcode=%02X %02X %02X %02X %02X %02X %02X %02X (%02X %02X %02X %02X %02X)\n", ((uint8_t*)pc)[0], ((uint8_t*)pc)[1], ((uint8_t*)pc)[2], ((uint8_t*)pc)[3], ((uint8_t*)pc)[4], ((uint8_t*)pc)[5], ((uint8_t*)pc)[6], ((uint8_t*)pc)[7], ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4]);
+ else if(sig==SIGBUS)
+ printf_log(log_minimum, " x86opcode=%02X %02X %02X %02X %02X %02X %02X %02X\n", ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4], ((uint8_t*)x64pc)[5], ((uint8_t*)x64pc)[6], ((uint8_t*)x64pc)[7]);
+ else
+ printf_log(log_minimum, "\n");
+ }
}
relockMutex(Locks);
if(my_context->signals[sig] && my_context->signals[sig]!=1) {
@@ -1203,6 +1359,8 @@ void my_sigactionhandler(int32_t sig, siginfo_t* info, void * ucntx)
void * pc = (void*)p->uc_mcontext.pc;
#elif defined(LA464)
void * pc = (void*)p->uc_mcontext.__pc;
+ #elif defined(RV64)
+ void * pc = (void*)p->uc_mcontext.__gregs[0];
#else
#error Unsupported architecture
#endif
@@ -1234,6 +1392,26 @@ void emit_signal(x64emu_t* emu, int sig, void* addr, int code)
my_sigactionhandler_oldcode(sig, 0, &info, &ctx, NULL, NULL);
}
+void emit_interruption(x64emu_t* emu, int num, void* addr)
+{
+ ucontext_t ctx = {0};
+ siginfo_t info = {0};
+ info.si_signo = SIGSEGV;
+ info.si_errno = 0xdead;
+ info.si_code = num;
+ info.si_addr = addr;
+ const char* x64name = NULL;
+ const char* elfname = NULL;
+ if(box64_log>LOG_INFO) {
+ x64name = getAddrFunctionName(R_RIP);
+ elfheader_t* elf = FindElfAddress(my_context, R_RIP);
+ if(elf)
+ elfname = ElfName(elf);
+ printf_log(LOG_NONE, "Emit Interruption 0x%x at IP=%p(%s / %s) / addr=%p\n", num, (void*)R_RIP, x64name?x64name:"???", elfname?elfname:"?", addr);
+ }
+ my_sigactionhandler_oldcode(SIGSEGV, 0, &info, &ctx, NULL, NULL);
+}
+
EXPORT sighandler_t my_signal(x64emu_t* emu, int signum, sighandler_t handler)
{
if(signum<0 || signum>=MAX_SIGNAL)
@@ -1266,6 +1444,7 @@ EXPORT sighandler_t my_sysv_signal(x64emu_t* emu, int signum, sighandler_t handl
int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_sigaction_t *oldact)
{
+ printf_log(LOG_DEBUG, "Sigaction(signum=%d, act=%p(f=%p, flags=0x%x), old=%p)\n", signum, act, act?act->_u._sa_handler:NULL, act?act->sa_flags:0, oldact);
if(signum<0 || signum>=MAX_SIGNAL) {
errno = EINVAL;
return -1;
@@ -1278,6 +1457,7 @@ int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x
return 0;
struct sigaction newact = {0};
struct sigaction old = {0};
+ uintptr_t old_handler = my_context->signals[signum];
if(act) {
newact.sa_mask = act->sa_mask;
newact.sa_flags = act->sa_flags&~0x04000000; // No sa_restorer...
@@ -1310,6 +1490,8 @@ int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x
oldact->_u._sa_sigaction = old.sa_sigaction; //TODO should wrap...
else
oldact->_u._sa_handler = old.sa_handler; //TODO should wrap...
+ if((uintptr_t)oldact->_u._sa_sigaction == (uintptr_t)my_sigactionhandler && old_handler)
+ oldact->_u._sa_sigaction = (void*)old_handler;
oldact->sa_restorer = NULL; // no handling for now...
}
return ret;
@@ -1377,7 +1559,7 @@ int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigactio
struct sigaction newact = {0};
struct sigaction old = {0};
if(act) {
- printf_log(LOG_DEBUG, " New action flags=0x%x mask=0x%lx\n", act->sa_flags, *(uint64_t*)&act->sa_mask);
+ printf_log(LOG_DEBUG, " New action for signal #%d flags=0x%x mask=0x%lx\n", signum, act->sa_flags, *(uint64_t*)&act->sa_mask);
newact.sa_mask = act->sa_mask;
newact.sa_flags = act->sa_flags&~0x04000000; // No sa_restorer...
if(act->sa_flags&0x04) {
@@ -1554,7 +1736,7 @@ EXPORT int my_makecontext(x64emu_t* emu, void* ucp, void* fnc, int32_t argc, int
}
// push the return value
--rsp;
- *rsp = (uintptr_t)GetExit();
+ *rsp = my_context->exit_bridge;
u->uc_mcontext.gregs[X64_RSP] = (uintptr_t)rsp;
return 0;
@@ -1569,10 +1751,15 @@ EXPORT int my_swapcontext(x64emu_t* emu, void* ucp1, void* ucp2)
my_setcontext(emu, ucp2);
return 0;
}
-#ifdef DYNAREC
+#ifdef USE_SIGNAL_MUTEX
static void atfork_child_dynarec_prot(void)
{
+ #ifdef USE_CUSTOM_MUTEX
native_lock_store(&mutex_dynarec_prot, 0);
+ #else
+ pthread_mutex_t tmp = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+ memcpy(&mutex_dynarec_prot, &tmp, sizeof(mutex_dynarec_prot));
+ #endif
}
#endif
void init_signal_helper(box64context_t* context)
@@ -1596,7 +1783,7 @@ void init_signal_helper(box64context_t* context)
sigaction(SIGABRT, &action, NULL);
pthread_once(&sigstack_key_once, sigstack_key_alloc);
-#ifdef DYNAREC
+#ifdef USE_SIGNAL_MUTEX
atfork_child_dynarec_prot();
pthread_atfork(NULL, NULL, atfork_child_dynarec_prot);
#endif
diff --git a/src/libtools/threads.c b/src/libtools/threads.c
index 32b9c7f..90c665e 100755..100644
--- a/src/libtools/threads.c
+++ b/src/libtools/threads.c
@@ -14,7 +14,6 @@
#include "box64context.h"
#include "threads.h"
#include "emu/x64emu_private.h"
-#include "tools/bridge_private.h"
#include "x64run.h"
#include "x64emu.h"
#include "box64stack.h"
@@ -128,7 +127,7 @@ int GetStackSize(x64emu_t* emu, uintptr_t attr, void** stack, size_t* stacksize)
}
mutex_unlock(&my_context->mutex_thread);
}
- // should a Warning be emited?
+ // should a Warning be emitted?
*stack = emu->init_stack;
*stacksize = emu->size_stack;
return 0;
@@ -215,7 +214,7 @@ x64emu_t* thread_get_emu()
}
void* stack = my_mmap(NULL, NULL, stacksize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0);
x64emu_t *emu = NewX64Emu(my_context, 0, (uintptr_t)stack, stacksize, 1);
- SetupX64Emu(emu);
+ SetupX64Emu(emu, NULL);
thread_set_emu(emu);
return emu;
}
@@ -490,7 +489,7 @@ EXPORT int my_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_rou
emuthread_t *et = (emuthread_t*)box_calloc(1, sizeof(emuthread_t));
x64emu_t *emuthread = NewX64Emu(my_context, (uintptr_t)start_routine, (uintptr_t)stack, stacksize, own);
- SetupX64Emu(emuthread);
+ SetupX64Emu(emuthread, emu);
//SetFS(emuthread, GetFS(emu));
et->emu = emuthread;
et->fnc = (uintptr_t)start_routine;
@@ -498,7 +497,7 @@ EXPORT int my_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_rou
#ifdef DYNAREC
if(box64_dynarec) {
// pre-creation of the JIT code for the entry point of the thread
- DBGetBlock(emu, (uintptr_t)start_routine, 1);
+ DBGetBlock(emu, (uintptr_t)start_routine, 1, 0); // function wrapping are 64bits only on box64
}
#endif
// create thread
@@ -512,14 +511,14 @@ void* my_prepare_thread(x64emu_t *emu, void* f, void* arg, int ssize, void** pet
void* stack = my_mmap(NULL, NULL, stacksize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0);
emuthread_t *et = (emuthread_t*)box_calloc(1, sizeof(emuthread_t));
x64emu_t *emuthread = NewX64Emu(emu->context, (uintptr_t)f, (uintptr_t)stack, stacksize, 1);
- SetupX64Emu(emuthread);
+ SetupX64Emu(emuthread, emu );
//SetFS(emuthread, GetFS(emu));
et->emu = emuthread;
et->fnc = (uintptr_t)f;
et->arg = arg;
#ifdef DYNAREC
// pre-creation of the JIT code for the entry point of the thread
- DBGetBlock(emu, (uintptr_t)f, 1);
+ DBGetBlock(emu, (uintptr_t)f, 1, 0); // function wrapping are 64bits only on box64
#endif
*pet = et;
return pthread_routine;
@@ -535,7 +534,7 @@ EXPORT void my___pthread_register_cancel(void* E, void* B)
{
// get a stack local copy of the args, as may be live in some register depending the architecture (like ARM)
if(cancel_deep<0) {
- printf_log(LOG_NONE/*LOG_INFO*/, "BOX64: Warning, inconsistant value in __pthread_register_cancel (%d)\n", cancel_deep);
+ printf_log(LOG_NONE/*LOG_INFO*/, "BOX64: Warning, inconsistent value in __pthread_register_cancel (%d)\n", cancel_deep);
cancel_deep = 0;
}
if(cancel_deep!=CANCEL_MAX-1)
@@ -619,7 +618,7 @@ GO(29)
static uintptr_t my_key_destructor_fct_##A = 0; \
static void my_key_destructor_##A(void* a) \
{ \
- RunFunction(my_context, my_key_destructor_fct_##A, 1, a);\
+ RunFunction(my_key_destructor_fct_##A, 1, a);\
}
SUPER()
#undef GO
@@ -641,7 +640,7 @@ static void* findkey_destructorFct(void* fct)
static uintptr_t my_cleanup_routine_fct_##A = 0; \
static void my_cleanup_routine_##A(void* a) \
{ \
- RunFunction(my_context, my_cleanup_routine_fct_##A, 1, a);\
+ RunFunction(my_cleanup_routine_fct_##A, 1, a);\
}
SUPER()
#undef GO
@@ -807,11 +806,6 @@ EXPORT int my_pthread_kill_old(x64emu_t* emu, void* thread, int sig)
//}
#ifndef NOALIGN
-EXPORT int my_pthread_mutex_destroy(pthread_mutex_t *m)
-{
- int ret = pthread_mutex_destroy(m);
- return ret;
-}
typedef union my_mutexattr_s {
int x86;
pthread_mutexattr_t nat;
@@ -851,6 +845,14 @@ EXPORT int my_pthread_mutexattr_gettype(x64emu_t* emu, my_mutexattr_t *attr, voi
attr->x86 = mattr.x86;
return ret;
}
+EXPORT int my_pthread_mutexattr_getrobust(x64emu_t* emu, my_mutexattr_t *attr, void* p)
+{
+ my_mutexattr_t mattr = {0};
+ mattr.x86 = attr->x86;
+ int ret = pthread_mutexattr_getrobust(&mattr.nat, p);
+ attr->x86 = mattr.x86;
+ return ret;
+}
EXPORT int my_pthread_mutexattr_init(x64emu_t* emu, my_mutexattr_t *attr)
{
my_mutexattr_t mattr = {0};
@@ -894,9 +896,14 @@ EXPORT int my_pthread_mutexattr_settype(x64emu_t* emu, my_mutexattr_t *attr, int
return ret;
}
EXPORT int my___pthread_mutexattr_settype(x64emu_t* emu, my_mutexattr_t *attr, int t) __attribute__((alias("my_pthread_mutexattr_settype")));
-
-// mutex
-int my___pthread_mutex_destroy(pthread_mutex_t *m) __attribute__((alias("my_pthread_mutex_destroy")));
+EXPORT int my_pthread_mutexattr_setrobust(x64emu_t* emu, my_mutexattr_t *attr, int t)
+{
+ my_mutexattr_t mattr = {0};
+ mattr.x86 = attr->x86;
+ int ret = pthread_mutexattr_setrobust(&mattr.nat, t);
+ attr->x86 = mattr.x86;
+ return ret;
+}
#ifdef __SIZEOF_PTHREAD_MUTEX_T
#if __SIZEOF_PTHREAD_MUTEX_T == 48
@@ -914,7 +921,7 @@ EXPORT int my_pthread_mutex_init(pthread_mutex_t *m, my_mutexattr_t *att)
#ifdef MUTEX_OVERSIZED_8
uint64_t save = *(uint64_t*)(((uintptr_t)m) + 40);
int ret = pthread_mutex_init(m, att?(&mattr.nat):NULL);
- *(uint64_t*)(((uintptr_t)m) + 40) = save; // put back overwriten value. Nasty but should be fast and quite safe
+ *(uint64_t*)(((uintptr_t)m) + 40) = save; // put back overwritten value. Nasty but should be fast and quite safe
#elif defined(MUTEX_SIZE_X64)
int ret = pthread_mutex_init(m, att?(&mattr.nat):NULL);
#else
@@ -926,33 +933,6 @@ EXPORT int my_pthread_mutex_init(pthread_mutex_t *m, my_mutexattr_t *att)
}
EXPORT int my___pthread_mutex_init(pthread_mutex_t *m, my_mutexattr_t *att) __attribute__((alias("my_pthread_mutex_init")));
-EXPORT int my_pthread_mutex_lock(pthread_mutex_t *m)
-{
- int ret = pthread_mutex_lock(m);
- return ret;
-}
-EXPORT int my___pthread_mutex_lock(pthread_mutex_t *m) __attribute__((alias("my_pthread_mutex_lock")));
-
-EXPORT int my_pthread_mutex_timedlock(pthread_mutex_t *m, const struct timespec * t)
-{
- int ret = pthread_mutex_timedlock(m, t);
- return ret;
-}
-EXPORT int my___pthread_mutex_trylock(pthread_mutex_t *m, const struct timespec * t) __attribute__((alias("my_pthread_mutex_timedlock")));
-
-EXPORT int my_pthread_mutex_trylock(pthread_mutex_t *m)
-{
- int ret = pthread_mutex_trylock(m);
- return ret;
-}
-EXPORT int my___pthread_mutex_unlock(pthread_mutex_t *m) __attribute__((alias("my_pthread_mutex_trylock")));
-
-EXPORT int my_pthread_mutex_unlock(pthread_mutex_t *m)
-{
- int ret = pthread_mutex_unlock(m);
- return ret;
-}
-
typedef union my_condattr_s {
int x86;
pthread_condattr_t nat;
@@ -1086,28 +1066,6 @@ EXPORT int my_pthread_barrier_init(x64emu_t* emu, pthread_barrier_t* bar, my_bar
#endif
-static void emujmpbuf_destroy(void* p)
-{
- emu_jmpbuf_t *ej = (emu_jmpbuf_t*)p;
- if(ej) {
- box_free(ej->jmpbuf);
- box_free(ej);
- }
-}
-
-static pthread_key_t jmpbuf_key;
-
-emu_jmpbuf_t* GetJmpBuf()
-{
- emu_jmpbuf_t *ejb = (emu_jmpbuf_t*)pthread_getspecific(jmpbuf_key);
- if(!ejb) {
- ejb = (emu_jmpbuf_t*)box_calloc(1, sizeof(emu_jmpbuf_t));
- ejb->jmpbuf = box_calloc(1, sizeof(struct __jmp_buf_tag));
- pthread_setspecific(jmpbuf_key, ejb);
- }
- return ejb;
-}
-
void init_pthread_helper()
{
real_pthread_cleanup_push_defer = (vFppp_t)dlsym(NULL, "_pthread_cleanup_push_defer");
@@ -1128,8 +1086,6 @@ void init_pthread_helper()
}
InitCancelThread();
- pthread_key_create(&jmpbuf_key, emujmpbuf_destroy);
- pthread_setspecific(jmpbuf_key, NULL);
pthread_key_create(&thread_key, emuthread_destroy);
pthread_setspecific(thread_key, NULL);
}
@@ -1138,11 +1094,6 @@ void fini_pthread_helper(box64context_t* context)
{
FreeCancelThread(context);
CleanStackSize(context);
- emu_jmpbuf_t *ejb = (emu_jmpbuf_t*)pthread_getspecific(jmpbuf_key);
- if(ejb) {
- pthread_setspecific(jmpbuf_key, NULL);
- emujmpbuf_destroy(ejb);
- }
emuthread_t *et = (emuthread_t*)pthread_getspecific(thread_key);
if(et) {
pthread_setspecific(thread_key, NULL);
@@ -1150,7 +1101,6 @@ void fini_pthread_helper(box64context_t* context)
}
}
-#ifndef DYNAREC
int checkUnlockMutex(void* m)
{
pthread_mutex_t* mutex = (pthread_mutex_t*)m;
@@ -1160,4 +1110,3 @@ int checkUnlockMutex(void* m)
}
return 0;
}
-#endif \ No newline at end of file
diff --git a/src/main.c b/src/main.c
index 8f95636..14e04d1 100755..100644
--- a/src/main.c
+++ b/src/main.c
@@ -35,6 +35,7 @@
#include "x64run.h"
#include "symbols.h"
#include "rcfile.h"
+#include "emu/x64run_private.h"
box64context_t *my_context = NULL;
int box64_quit = 0;
@@ -58,10 +59,13 @@ int box64_dynarec_fastnan = 1;
int box64_dynarec_fastround = 1;
int box64_dynarec_safeflags = 1;
int box64_dynarec_callret = 0;
-int box64_dynarec_hotpage = 4;
+int box64_dynarec_hotpage = 0;
int box64_dynarec_fastpage = 0;
int box64_dynarec_bleeding_edge = 1;
+int box64_dynarec_jvm = 1;
int box64_dynarec_wait = 1;
+int box64_dynarec_test = 0;
+int box64_dynarec_missing = 0;
uintptr_t box64_nodynarec_start = 0;
uintptr_t box64_nodynarec_end = 0;
#ifdef ARM64
@@ -70,6 +74,11 @@ int arm64_aes = 0;
int arm64_pmull = 0;
int arm64_crc32 = 0;
int arm64_atomics = 0;
+#elif defined(RV64)
+int rv64_zba = 0;
+int rv64_zbb = 0;
+int rv64_zbc = 0;
+int rv64_zbs = 0;
#endif
#else //DYNAREC
int box64_dynarec = 0;
@@ -113,7 +122,7 @@ int box64_isglibc234 = 0;
char* box64_libGL = NULL;
uintptr_t fmod_smc_start = 0;
uintptr_t fmod_smc_end = 0;
-uint32_t default_gs = 0xa<<3;
+uint32_t default_gs = 0x53;
int jit_gdb = 0;
int box64_tcmalloc_minimal = 0;
@@ -353,6 +362,17 @@ HWCAP2_ECV
#elif defined(LA464)
printf_log(LOG_INFO, "Dynarec for LoongArch");
printf_log(LOG_INFO, " PageSize:%zd ", box64_pagesize);
+#elif defined(RV64)
+ void RV64_Detect_Function();
+ if(!getenv("BOX64_DYNAREC_RV64NOEXT"))
+ RV64_Detect_Function();
+ printf_log(LOG_INFO, "Dynarec for RISC-V ");
+ printf_log(LOG_INFO, "With extension: I M A F D C");
+ if(rv64_zba) printf_log(LOG_INFO, " Zba");
+ if(rv64_zbb) printf_log(LOG_INFO, " Zbb");
+ if(rv64_zbc) printf_log(LOG_INFO, " Zbc");
+ if(rv64_zbs) printf_log(LOG_INFO, " Zbs");
+ printf_log(LOG_INFO, " PageSize:%zd ", box64_pagesize);
#else
#error Unsupported architecture
#endif
@@ -374,7 +394,7 @@ void LoadLogEnv()
}
// grab BOX64_TRACE_FILE envvar, and change %pid to actual pid is present in the name
openFTrace(NULL);
- box64_log = ftrace_name?LOG_INFO:(isatty(fileno(ftrace))?LOG_INFO:LOG_NONE); //default LOG value different if stdout is redirected or not
+ box64_log = ftrace_name?LOG_INFO:(isatty(fileno(stdout))?LOG_INFO:LOG_NONE); //default LOG value different if stdout is redirected or not
p = getenv("BOX64_LOG");
if(p) {
if(strlen(p)==1) {
@@ -557,6 +577,15 @@ void LoadLogEnv()
if(!box64_dynarec_bleeding_edge)
printf_log(LOG_INFO, "Dynarec will not detect MonoBleedingEdge\n");
}
+ p = getenv("BOX64_DYNAREC_JVM");
+ if(p) {
+ if(strlen(p)==1) {
+ if(p[0]>='0' && p[0]<='1')
+ box64_dynarec_jvm = p[0]-'0';
+ }
+ if(!box64_dynarec_jvm)
+ printf_log(LOG_INFO, "Dynarec will not detect libjvm\n");
+ }
p = getenv("BOX64_DYNAREC_WAIT");
if(p) {
if(strlen(p)==1) {
@@ -587,6 +616,15 @@ void LoadLogEnv()
if(box64_dynarec_fastpage)
printf_log(LOG_INFO, "Dynarec will use Fast HotPage\n");
}
+ p = getenv("BOX64_DYNAREC_MISSING");
+ if(p) {
+ if(strlen(p)==1) {
+ if(p[0]>='0' && p[0]<='1')
+ box64_dynarec_missing = p[0]-'0';
+ }
+ if(box64_dynarec_missing)
+ printf_log(LOG_INFO, "Dynarec will print missing opcodes\n");
+ }
p = getenv("BOX64_NODYNAREC");
if(p) {
if (strchr(p,'-')) {
@@ -597,6 +635,19 @@ void LoadLogEnv()
printf_log(LOG_INFO, "No dynablock creation that start in the range %p - %p\n", (void*)box64_nodynarec_start, (void*)box64_nodynarec_end);
}
}
+ p = getenv("BOX64_DYNAREC_TEST");
+ if(p) {
+ if(strlen(p)==1) {
+ if(p[0]>='0' && p[0]<='1')
+ box64_dynarec_test = p[0]-'0';
+ }
+ if(box64_dynarec_test) {
+ box64_dynarec_fastnan = 0;
+ box64_dynarec_fastround = 0;
+ box64_dynarec_callret = 0;
+ printf_log(LOG_INFO, "Dynarec will compare it's execution with the interpreter (super slow, only for testing)\n");
+ }
+ }
#endif
#ifdef HAVE_TRACE
@@ -722,7 +773,7 @@ void LoadLogEnv()
if(box64_malloc_hack==1) {
printf_log(LOG_INFO, "Malloc hook will not be redirected\n");
} else
- printf_log(LOG_INFO, "Malloc hook will check for mmap/free occurences\n");
+ printf_log(LOG_INFO, "Malloc hook will check for mmap/free occurrences\n");
}
}
p = getenv("BOX64_NOPULSE");
@@ -866,7 +917,7 @@ int GatherEnv(char*** dest, char** env, char* prog)
(*dest)[idx++] = box_strdup("BOX64_PATH=.:bin");
}
if(!ld_path) {
- (*dest)[idx++] = box_strdup("BOX64_LD_LIBRARY_PATH=.:lib:lib64");
+ (*dest)[idx++] = box_strdup("BOX64_LD_LIBRARY_PATH=.:lib:lib64:x86_64:bin64:libs64");
}
// add "_=prog" at the end...
if(prog) {
@@ -920,9 +971,9 @@ void PrintHelp() {
printf(" BOX64_NOSIGILL=1 to disable handling of SigILL\n");
printf(" BOX64_SHOWSEGV=1 to show Segfault signal even if a signal handler is present\n");
printf(" BOX64_X11THREADS=1 to call XInitThreads when loading X11 (for old Loki games with Loki_Compat lib)");
- printf(" BOX64_LIBGL=libXXXX set the name (and optionnaly full path) for libGL.so.1\n");
+ printf(" BOX64_LIBGL=libXXXX set the name (and optionnally full path) for libGL.so.1\n");
printf(" BOX64_LD_PRELOAD=XXXX[:YYYYY] force loading XXXX (and YYYY...) libraries with the binary\n");
- printf(" BOX64_ALLOWMISSINGLIBS with 1 to allow to continue even if a lib is missing (unadvised, will probably crash later)\n");
+ printf(" BOX64_ALLOWMISSINGLIBS with 1 to allow one to continue even if a lib is missing (unadvised, will probably crash later)\n");
printf(" BOX64_PREFER_EMULATED=1 to prefer emulated libs first (execpt for glibc, alsa, pulse, GL, vulkan and X11\n");
printf(" BOX64_PREFER_WRAPPED if box64 will use wrapped libs even if the lib is specified with absolute path\n");
printf(" BOX64_CRASHHANDLER=0 to not use a dummy crashhandler lib\n");
@@ -976,6 +1027,8 @@ void LoadEnvVars(box64context_t *context)
AddPath("/lib/x86_64-linux-gnu", &context->box64_ld_lib, 1);
if(FileExist("/usr/lib/x86_64-linux-gnu", 0))
AddPath("/usr/lib/x86_64-linux-gnu", &context->box64_ld_lib, 1);
+ if(FileExist("/usr/x86_64-linux-gnu/lib", 0))
+ AddPath("/usr/x86_64-linux-gnu/lib", &context->box64_ld_lib, 1);
if(getenv("LD_LIBRARY_PATH"))
PrependList(&context->box64_ld_lib, getenv("LD_LIBRARY_PATH"), 1); // in case some of the path are for x86 world
if(getenv("BOX64_EMULATED_LIBS")) {
@@ -994,6 +1047,7 @@ void LoadEnvVars(box64context_t *context)
AddPath("libcrypto.so.1", &context->box64_emulated_libs, 0);
AddPath("libcrypto.so.1.0.0", &context->box64_emulated_libs, 0);
AddPath("libunwind.so.8", &context->box64_emulated_libs, 0);
+ AddPath("libpng12.so.0", &context->box64_emulated_libs, 0);
if(getenv("BOX64_SSE_FLUSHTO0")) {
if (strcmp(getenv("BOX64_SSE_FLUSHTO0"), "1")==0) {
@@ -1079,10 +1133,10 @@ void setupTraceInit()
if(s_trace_start || s_trace_end)
SetTraceEmu(s_trace_start, s_trace_end);
} else {
- if (GetGlobalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL)) {
+ if (GetGlobalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, NULL, NULL)) {
SetTraceEmu(s_trace_start, s_trace_end);
printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end);
- } else if(GetLocalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL)) {
+ } else if(GetLocalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, NULL, NULL)) {
SetTraceEmu(s_trace_start, s_trace_end);
printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end);
} else {
@@ -1123,10 +1177,10 @@ void setupTrace()
}
}
} else {
- if (GetGlobalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL)) {
+ if (GetGlobalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, NULL, NULL)) {
SetTraceEmu(s_trace_start, s_trace_end);
printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end);
- } else if(GetLocalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL)) {
+ } else if(GetLocalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, NULL, NULL)) {
SetTraceEmu(s_trace_start, s_trace_end);
printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end);
} else {
@@ -1140,12 +1194,14 @@ void setupTrace()
}
#endif
}
+void endMallocHook();
void endBox64()
{
if(!my_context || box64_quit)
return;
-
+
+ endMallocHook();
x64emu_t* emu = thread_get_emu();
// atexit first
printf_log(LOG_DEBUG, "Calling atexit registered functions (exiting box64)\n");
@@ -1154,10 +1210,6 @@ void endBox64()
box64_quit = 1;
printf_log(LOG_DEBUG, "Calling fini for all loaded elfs and unload native libs\n");
RunElfFini(my_context->elfs[0], emu);
- #ifdef DYNAREC
- // disable dynarec now
- box64_dynarec = 0;
- #endif
FreeLibrarian(&my_context->local_maplib, emu); // unload all libs
FreeLibrarian(&my_context->maplib, emu); // unload all libs
#if 0
@@ -1201,6 +1253,10 @@ void endBox64()
#endif
// all done, free context
FreeBox64Context(&my_context);
+ #ifdef DYNAREC
+ // disable dynarec now
+ box64_dynarec = 0;
+ #endif
if(box64_libGL) {
box_free(box64_libGL);
box64_libGL = NULL;
@@ -1326,8 +1382,13 @@ int main(int argc, const char **argv, char **env) {
wine_prereserve(prereserve);
// special case for winedbg, doesn't work anyway
if(argv[nextarg+1] && strstr(argv[nextarg+1], "winedbg")==argv[nextarg+1]) {
- printf_log(LOG_NONE, "winedbg detected, not launching it!\n");
- exit(0); // exiting, it doesn't work anyway
+ if(getenv("BOX64_WINEDBG")) {
+ box64_nobanner = 1;
+ box64_log = 0;
+ } else {
+ printf_log(LOG_NONE, "winedbg detected, not launching it!\n");
+ exit(0); // exiting, it doesn't work anyway
+ }
}
box64_wine = 1;
} else
@@ -1362,7 +1423,7 @@ int main(int argc, const char **argv, char **env) {
LoadEnvVars(my_context);
// Append ld_list if it exist
if(ld_libs_args!=-1)
- AppendList(&my_context->box64_ld_lib, argv[ld_libs_args], 1);
+ PrependList(&my_context->box64_ld_lib, argv[ld_libs_args], 1);
my_context->box64path = ResolveFile(argv[0], &my_context->box64_path);
// prepare all other env. var
@@ -1652,7 +1713,7 @@ int main(int argc, const char **argv, char **env) {
x64emu_t *emu = NewX64Emu(my_context, my_context->ep, (uintptr_t)my_context->stack, my_context->stacksz, 0);
// stack setup is much more complicated then just that!
SetupInitialStack(emu); // starting here, the argv[] don't need free anymore
- SetupX64Emu(emu);
+ SetupX64Emu(emu, NULL);
SetRSI(emu, my_context->argc);
SetRDX(emu, (uint64_t)my_context->argv);
SetRCX(emu, (uint64_t)my_context->envv);
@@ -1684,12 +1745,19 @@ int main(int argc, const char **argv, char **env) {
AddMainElfToLinkmap(elf_header);
// pre-load lib if needed
if(ld_preload.size) {
- my_context->preload = new_neededlib(ld_preload.size);
- for(int i=0; i<ld_preload.size; ++i)
- my_context->preload->names[i] = ld_preload.paths[i];
- if(AddNeededLib(my_context->maplib, 0, 0, my_context->preload, my_context, emu)) {
- printf_log(LOG_INFO, "Warning, cannot pre-load of the libs\n");
- }
+ my_context->preload = new_neededlib(0);
+ for(int i=0; i<ld_preload.size; ++i) {
+ needed_libs_t* tmp = new_neededlib(1);
+ tmp->names[0] = ld_preload.paths[i];
+ if(AddNeededLib(my_context->maplib, 0, 0, tmp, elf_header, my_context, emu)) {
+ printf_log(LOG_INFO, "Warning, cannot pre-load of %s\n", tmp->names[0]);
+ RemoveNeededLib(my_context->maplib, 0, tmp, my_context, emu);
+ } else {
+ for(int j=0; j<tmp->size; ++j)
+ add1lib_neededlib(my_context->preload, tmp->libs[j], tmp->names[j]);
+ free_neededlib(tmp);
+ }
+ }
}
FreeCollection(&ld_preload);
// Call librarian to load all dependant elf
@@ -1707,9 +1775,9 @@ int main(int argc, const char **argv, char **env) {
}
// and handle PLT
RelocateElfPlt(my_context->maplib, NULL, 0, elf_header);
- // defered init
+ // deferred init
setupTraceInit();
- RunDeferedElfInit(emu);
+ RunDeferredElfInit(emu);
// update TLS of main elf
RefreshElfTLS(elf_header);
// do some special case check, _IO_2_1_stderr_ and friends, that are setup by libc, but it's already done here, so need to do a copy
@@ -1727,7 +1795,7 @@ int main(int argc, const char **argv, char **env) {
// Stack is ready, with stacked: NULL env NULL argv argc
SetRIP(emu, my_context->ep);
ResetFlags(emu);
- PushExit(emu); // push to pop it just after
+ Push64(emu, my_context->exit_bridge); // push to pop it just after
SetRDX(emu, Pop64(emu)); // RDX is exit function
Run(emu, 0);
// Get EAX
diff --git a/src/mallochook.c b/src/mallochook.c
index e502a1a..885e38c 100644
--- a/src/mallochook.c
+++ b/src/mallochook.c
@@ -13,6 +13,7 @@
#include "librarian.h"
#include "elfs/elfloader_private.h"
#include "custommem.h"
+#include "symbols.h"
/*
This file here is for handling overriding of malloc functions
@@ -26,8 +27,8 @@
The 2 different strategies to handle this can be defined as "Embrace" and "Exterminate" (as it cannot simply be ignored,
or you end up with mixing free/realloc from one lib and malloc/free from libc)
- In the "Embrace" strategy, the overriden malloc function are taken into account as soon as possible, and are used for all loaded lib, including native
- In the "Exterminate" strategy, the overriden malloc function are erased, and replaced with libc malloc as soon as they are defined.
+ In the "Embrace" strategy, the overridden malloc function are taken into account as soon as possible, and are used for all loaded lib, including native
+ In the "Exterminate" strategy, the overridden malloc function are erased, and replaced with libc malloc as soon as they are defined.
The advantage of "Embrace" is that the system will run the function it supposed to be using, and potential side-effect and staticaly linked functions
will run as intended.
@@ -42,7 +43,6 @@
*/
#include "bridge.h"
-#include "tools/bridge_private.h"
#include "wrapper.h"
#define SUPER() \
@@ -146,6 +146,9 @@ uint32_t getProtection(uintptr_t addr);
// mmap history
static int malloc_hack_2 = 0;
+#define ALLOC 0
+#define FREE 1
+
char* box_strdup(const char* s) {
char* ret = box_calloc(1, strlen(s)+1);
memcpy(ret, s, strlen(s));
@@ -180,18 +183,29 @@ static int ispot(size_t l) {
return pot(l)==l;
}
+#define GO(A, B) static uintptr_t real_##A = 0;
+#define GO2(A, B) static uintptr_t real_##A = 0;
+SUPER()
+#undef GO2
+#undef GO
+
// redefining all libc memory allocation routines
EXPORT void* malloc(size_t l)
{
+ if(malloc_hack_2 && ALLOC && real_malloc) {
+ return (void*)RunFunctionFmt(real_malloc, "L", l);
+ }
return box_calloc(1, l);
}
EXPORT void free(void* p)
{
- if(malloc_hack_2 && p) {
+ if(malloc_hack_2 && FREE && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real_free)
+ RunFunctionFmt(real_free, "p", p);
return;
}
}
@@ -200,19 +214,30 @@ EXPORT void free(void* p)
EXPORT void* calloc(size_t n, size_t s)
{
+ if(malloc_hack_2 && ALLOC && real_calloc) {
+ return (void*)RunFunctionFmt(real_calloc, "LL", n,s);
+ }
return box_calloc(n, s);
}
EXPORT void* realloc(void* p, size_t s)
{
if(malloc_hack_2)
- if(getMmapped((uintptr_t)p)) {
- // found! Will realloc using regular malloc then copy from old address as much as possible, but need to check size first
- void* ret = box_malloc(s);
- printf_log(LOG_DEBUG, "Malloc_Hack_2: hacking realloc(%p, %zu)", p, s);
- while(s && !(getProtection((uintptr_t)p+s)&PROT_READ)) {if(s>box64_pagesize) s-=box64_pagesize; else s=0;}
- memcpy(ret, p, s);
- printf_log(LOG_DEBUG, " -> %p (copied %zu from old)\n", ret, s);
+ if(getMmapped((uintptr_t)p) || (!p && ALLOC && real_realloc)) {
+ void* ret = p;
+ if(real_realloc) {
+ ret = (void*)RunFunctionFmt(real_realloc, "pL", p, s);
+ } else {
+ // found! Will realloc using regular malloc then copy from old address as much as possible, but need to check size first
+ ret = box_malloc(s);
+ printf_log(LOG_DEBUG, "Malloc_Hack_2: hacking realloc(%p, %zu)", p, s);
+ while(s && !(getProtection((uintptr_t)p+s)&PROT_READ)) {if(s>box64_pagesize) s-=box64_pagesize; else s=0;}
+ memcpy(ret, p, s);
+ printf_log(LOG_DEBUG, " -> %p (copied %zu from old)\n", ret, s);
+ // Mmaped, free with original function
+ if(real_free)
+ RunFunctionFmt(real_free, "p", p);
+ }
return ret;
}
return box_realloc(p, s);
@@ -220,16 +245,25 @@ EXPORT void* realloc(void* p, size_t s)
EXPORT void* aligned_alloc(size_t align, size_t size)
{
+ if(malloc_hack_2 && ALLOC && real_aligned_alloc) {
+ return (void*)RunFunctionFmt(real_aligned_alloc, "LL", align, size);
+ }
return box_memalign(align, size);
}
EXPORT void* memalign(size_t align, size_t size)
{
+ if(malloc_hack_2 && ALLOC && real_aligned_alloc) {
+ return (void*)RunFunctionFmt(real_aligned_alloc, "LL", align, size);
+ }
return box_memalign(align, size);
}
EXPORT int posix_memalign(void** p, size_t align, size_t size)
{
+ if(malloc_hack_2 && ALLOC && real_posix_memalign) {
+ return RunFunctionFmt(real_posix_memalign, "pLL", p, align, size);
+ }
if(align%sizeof(void*) || pot(align)!=align)
return EINVAL;
void* ret = box_memalign(align, size);
@@ -241,20 +275,28 @@ EXPORT int posix_memalign(void** p, size_t align, size_t size)
EXPORT void* valloc(size_t size)
{
+ if(malloc_hack_2 && ALLOC && real_valloc) {
+ return (void*)RunFunctionFmt(real_valloc, "L", size);
+ }
return box_memalign(box64_pagesize, size);
}
EXPORT void* pvalloc(size_t size)
{
+ if(malloc_hack_2 && ALLOC && real_pvalloc) {
+ return (void*)RunFunctionFmt(real_pvalloc, "L", size);
+ }
return box_memalign(box64_pagesize, (size+box64_pagesize-1)&~(box64_pagesize-1));
}
EXPORT void cfree(void* p)
{
- if(malloc_hack_2 && p) {
+ if(malloc_hack_2 && FREE && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real_free)
+ RunFunctionFmt(real_free, "p", p);
return;
}
}
@@ -263,26 +305,42 @@ EXPORT void cfree(void* p)
EXPORT size_t malloc_usable_size(void* p)
{
+ if(malloc_hack_2 && real_malloc_usable_size) {
+ if(getMmapped((uintptr_t)p))
+ return RunFunctionFmt(real_malloc_usable_size, "p", p);
+ }
return box_malloc_usable_size(p);
}
EXPORT void* my__Znwm(size_t sz) //operator new(size_t)
{
+ if(malloc_hack_2 && real__Znwm) {
+ return (void*)RunFunctionFmt(real__Znwm, "L", sz);
+ }
return box_malloc(sz);
}
EXPORT void* my__ZnwmRKSt9nothrow_t(size_t sz, void* p) //operator new(size_t, std::nothrow_t const&)
{
+ if(malloc_hack_2 && real__ZnwmRKSt9nothrow_t) {
+ return (void*)RunFunctionFmt(real__ZnwmRKSt9nothrow_t, "Lp", sz, p);
+ }
return box_malloc(sz);
}
EXPORT void* my__Znam(size_t sz) //operator new[](size_t)
{
+ if(malloc_hack_2 && real__Znam) {
+ return (void*)RunFunctionFmt(real__Znam, "L", sz);
+ }
return box_malloc(sz);
}
EXPORT void* my__ZnamRKSt9nothrow_t(size_t sz, void* p) //operator new[](size_t, std::nothrow_t const&)
{
+ if(malloc_hack_2 && real__ZnamRKSt9nothrow_t) {
+ return (void*)RunFunctionFmt(real__ZnamRKSt9nothrow_t, "Lp", sz, p);
+ }
return box_malloc(sz);
}
@@ -292,7 +350,9 @@ EXPORT void my__ZdaPv(void* p) //operator delete[](void*)
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real__ZdaPv)
+ RunFunctionFmt(real__ZdaPv, "p", p);
return;
}
}
@@ -304,7 +364,9 @@ EXPORT void my__ZdaPvm(void* p, size_t sz) //operator delete[](void*, size_t)
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real__ZdaPvm)
+ RunFunctionFmt(real__ZdaPvm, "pL", p, sz);
return;
}
}
@@ -316,7 +378,9 @@ EXPORT void my__ZdaPvmSt11align_val_t(void* p, size_t sz, size_t align) //oper
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real__ZdaPvmSt11align_val_t)
+ RunFunctionFmt(real__ZdaPvmSt11align_val_t, "pLL", p, sz, align);
return;
}
}
@@ -328,7 +392,9 @@ EXPORT void my__ZdlPv(void* p) //operator delete(void*)
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real__ZdlPv)
+ RunFunctionFmt(real__ZdlPv, "p", p);
return;
}
}
@@ -340,7 +406,9 @@ EXPORT void my__ZdlPvm(void* p, size_t sz) //operator delete(void*, size_t)
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real__ZdlPvm)
+ RunFunctionFmt(real__ZdlPvm, "pL", p, sz);
return;
}
}
@@ -349,21 +417,33 @@ EXPORT void my__ZdlPvm(void* p, size_t sz) //operator delete(void*, size_t)
EXPORT void* my__ZnwmSt11align_val_t(size_t sz, size_t align) //// operator new(unsigned long, std::align_val_t)
{
+ if(malloc_hack_2 && real__ZnwmSt11align_val_t) {
+ return (void*)RunFunctionFmt(real__ZnwmSt11align_val_t, "LL", sz, align);
+ }
return box_memalign(align, sz);
}
EXPORT void* my__ZnwmSt11align_val_tRKSt9nothrow_t(size_t sz, size_t align, void* p) //// operator new(unsigned long, std::align_val_t, std::nothrow_t const&)
{
+ if(malloc_hack_2 && real__ZnwmSt11align_val_tRKSt9nothrow_t) {
+ return (void*)RunFunctionFmt(real__ZnwmSt11align_val_tRKSt9nothrow_t, "LLp", sz, align, p);
+ }
return box_memalign(align, sz);
}
EXPORT void* my__ZnamSt11align_val_t(size_t sz, size_t align) //// operator new[](unsigned long, std::align_val_t)
{
+ if(malloc_hack_2 && real__ZnamSt11align_val_t) {
+ return (void*)RunFunctionFmt(real__ZnamSt11align_val_t, "LL", sz, align);
+ }
return box_memalign(align, sz);
}
EXPORT void* my__ZnamSt11align_val_tRKSt9nothrow_t(size_t sz, size_t align, void* p) //// operator new[](unsigned long, std::align_val_t, std::nothrow_t const&)
{
+ if(malloc_hack_2 && real__ZnamSt11align_val_tRKSt9nothrow_t) {
+ return (void*)RunFunctionFmt(real__ZnamSt11align_val_tRKSt9nothrow_t, "LLp", sz, align, p);
+ }
return box_memalign(align, sz);
}
@@ -372,7 +452,9 @@ EXPORT void my__ZdlPvRKSt9nothrow_t(void* p, void* n) //operator delete(void*,
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real__ZdlPvRKSt9nothrow_t)
+ RunFunctionFmt(real__ZdlPvRKSt9nothrow_t, "pp", p, n);
return;
}
}
@@ -384,7 +466,9 @@ EXPORT void my__ZdaPvSt11align_val_tRKSt9nothrow_t(void* p, size_t align, void*
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real_free)
+ RunFunctionFmt(real_free, "p", p);
return;
}
}
@@ -396,7 +480,9 @@ EXPORT void my__ZdlPvmSt11align_val_t(void* p, size_t sz, size_t align) //oper
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real_free)
+ RunFunctionFmt(real_free, "p", p);
return;
}
}
@@ -408,7 +494,9 @@ EXPORT void my__ZdaPvRKSt9nothrow_t(void* p, void* n) //operator delete[](void
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real_free)
+ RunFunctionFmt(real_free, "p", p);
return;
}
}
@@ -420,7 +508,9 @@ EXPORT void my__ZdaPvSt11align_val_t(void* p, size_t align) //operator delete[
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real_free)
+ RunFunctionFmt(real_free, "p", p);
return;
}
}
@@ -432,7 +522,9 @@ EXPORT void my__ZdlPvSt11align_val_t(void* p, size_t align) //operator delete(
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real_free)
+ RunFunctionFmt(real_free, "p", p);
return;
}
}
@@ -444,7 +536,9 @@ EXPORT void my__ZdlPvSt11align_val_tRKSt9nothrow_t(void* p, size_t align, void*
if(malloc_hack_2 && p) {
if(getMmapped((uintptr_t)p)) {
printf_log(LOG_DEBUG, "%04d|Malloc_Hack_2: not freeing %p\n", GetTID(), p);
- // Mmaped, do not free...
+ // Mmaped, free with original function
+ if(real__ZdlPvSt11align_val_tRKSt9nothrow_t)
+ RunFunctionFmt(real__ZdlPvSt11align_val_tRKSt9nothrow_t, "pLp", p, align, n);
return;
}
}
@@ -674,34 +768,15 @@ typedef struct simple_jmp_s {
} simple_jmp_t;
#pragma pack(pop)
-static void addRelocJmp(void* offs, void* where, size_t size, const char* name)
+static void addRelocJmp(void* offs, void* where, size_t size, const char* name, elfheader_t* h, uintptr_t *real)
{
- reloc_jmp_t r_jmp = {0};
- simple_jmp_t s_jmp = {0};
- size_t sz = 0;
- intptr_t off64 = (intptr_t)where - ((intptr_t)offs+5);
- void* p = NULL;
- int32_t off32 = (int32_t)off64;
- if(off32 == off64) {
- s_jmp._e9 = 0xe9;
- s_jmp.delta = (uint32_t)off32;
- p = &s_jmp;
- sz = sizeof(s_jmp);
- } else {
- r_jmp._ff = 0xff;
- r_jmp._25 = 0x25;
- r_jmp.addr = where;
- p = &r_jmp;
- sz = sizeof(r_jmp);
- }
- if(size>=sz)
- memcpy(offs, p, sz);
- else {
- printf_log(LOG_INFO, "Warning, cannot redirect %s, too small %zu vs %zu\n", name, size, sz);
+ if(real && !*real) {
+ *real = (uintptr_t)offs;
}
+ addAlternate(offs, where);
}
-void checkHookedSymbols(lib_t *maplib, elfheader_t* h)
+void checkHookedSymbols(elfheader_t* h)
{
int hooked = 0;
if(box64_malloc_hack==1)
@@ -716,7 +791,7 @@ void checkHookedSymbols(lib_t *maplib, elfheader_t* h)
uintptr_t offs = h->DynSym[i].st_value + h->delta;
size_t sz = h->DynSym[i].st_size;
if(bind!=STB_LOCAL && bind!=STB_WEAK && sz>=sizeof(reloc_jmp_t)) {
- #define GO(A, B) if(!strcmp(symname, #A)) ++hooked; else if(!strcmp(symname, "scalable_" #A)) ++hooked; else if(!strcmp(symname, "__TBB_internal_" #A)) ++hooked;
+ #define GO(A, B) if(!strcmp(symname, #A)) ++hooked; else if(!strcmp(symname, "__libc_" #A)) ++hooked;
#define GO2(A, B)
SUPER()
#undef GO
@@ -726,9 +801,7 @@ void checkHookedSymbols(lib_t *maplib, elfheader_t* h)
}
if(hooked<2)
return; // only redirect on lib that hooked / redefined the operators
- if(box64_malloc_hack==2)
- malloc_hack_2 = 1;
- printf_log(LOG_INFO, "Redirecting overriden malloc%s function for %s\n", malloc_hack_2?" with hack":"", ElfName(h));
+ printf_log(LOG_INFO, "Redirecting overridden malloc%s function for %s\n", malloc_hack_2?" with hack":"", ElfName(h));
for (size_t i=0; i<h->numDynSym; ++i) {
const char * symname = h->DynStr+h->DynSym[i].st_name;
int bind = ELF64_ST_BIND(h->DynSym[i].st_info);
@@ -739,29 +812,30 @@ void checkHookedSymbols(lib_t *maplib, elfheader_t* h)
uintptr_t offs = h->DynSym[i].st_value + h->delta;
size_t sz = h->DynSym[i].st_size;
if(bind!=STB_LOCAL && bind!=STB_WEAK) {
- #define GO(A, B) if(!strcmp(symname, "__libc_" #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, #A);}
+ #define GO(A, B) if(!strcmp(symname, "__libc_" #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, "__libc_" #A, h, NULL);}
#define GO2(A, B)
SUPER()
#undef GO
#undef GO2
- #define GO(A, B) if(!strcmp(symname, "scalable_" #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, #A);}
- #define GO2(A, B)
- SUPER()
- #undef GO
- #undef GO2
- #define GO(A, B) if(!strcmp(symname, "__TBB_internal_" #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, #A);}
- #define GO2(A, B)
- SUPER()
- #undef GO
- #undef GO2
- #define GO(A, B) if(!strcmp(symname, #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, #A);}
- #define GO2(A, B) if(!strcmp(symname, #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, my_##A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, #A);}
+ #define GO(A, B) if(!strcmp(symname, #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, #A, h, &real_##A);}
+ #define GO2(A, B) if(!strcmp(symname, #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, my_##A, 0, "my_" #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, "my_" #A, h, &real_##A);}
SUPER()
#undef GO
#undef GO2
}
}
}
+ if(box64_malloc_hack==2)
+ h->malloc_hook_2 = 1;
+}
+
+void startMallocHook()
+{
+ malloc_hack_2 = 1;
+}
+void endMallocHook()
+{
+ malloc_hack_2 = 0;
}
EXPORT int my___TBB_internal_find_original_malloc(int n, char* names[], void* ptr[])
diff --git a/src/rv64detect.c b/src/rv64detect.c
new file mode 100644
index 0000000..9976d1d
--- /dev/null
+++ b/src/rv64detect.c
@@ -0,0 +1,70 @@
+#include <string.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <signal.h>
+#include <sys/mman.h>
+#include <setjmp.h>
+
+#include "debug.h"
+#include "dynarec/rv64/rv64_emitter.h"
+
+// Detect RV64 extensions, by executing on of the opcode with a SIGILL signal handler
+
+static sigjmp_buf sigbuf = {0};
+typedef void(*vFii_t)(int, int);
+static void detect_sigill(int sig)
+{
+ siglongjmp(sigbuf, 1);
+}
+
+static int Check(void* block)
+{
+ // Clear instruction cache
+ __clear_cache(block, block+box64_pagesize);
+ // Setup SIGILL signal handler
+ __sighandler_t old = signal(SIGILL, detect_sigill);
+ if(sigsetjmp(sigbuf, 1)) {
+ // didn't work, extension not present
+ signal(SIGILL, old);
+ return 0;
+ }
+ ((vFii_t)block)(0, 1);
+ // done...
+ signal(SIGILL, old);
+ return 1;
+}
+
+void RV64_Detect_Function()
+{
+ // Alloc memory to execute stuffs
+ void* my_block = mmap(NULL, box64_pagesize, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
+ if(my_block==(void*)-1) {
+ return;
+ }
+ uint32_t* block;
+ #define EMIT(A) *block = (A); ++block
+ // Test Zba with ADDUW
+ block = (uint32_t*)my_block;
+ ADDUW(A0, A0, A1);
+ BR(xRA);
+ rv64_zba = Check(my_block);
+ // Test Zbb with ANDN
+ block = (uint32_t*)my_block;
+ ANDN(A0, A0, A1);
+ BR(xRA);
+ rv64_zbb = Check(my_block);
+ // Test Zbc with CLMUL
+ block = (uint32_t*)my_block;
+ CLMUL(A0, A0, A1);
+ BR(xRA);
+ rv64_zbc = Check(my_block);
+ // Test Zbs with BCLR
+ block = (uint32_t*)my_block;
+ BCLR(A0, A0, A1);
+ BR(xRA);
+ rv64_zbs = Check(my_block);
+
+ // Finish
+ // Free the memory my_block
+ munmap(my_block, box64_pagesize);
+} \ No newline at end of file
diff --git a/src/tools/bitutils.c b/src/tools/bitutils.c
new file mode 100644
index 0000000..7d4b3a3
--- /dev/null
+++ b/src/tools/bitutils.c
@@ -0,0 +1,22 @@
+#include <stdint.h>
+
+const uint8_t deBruijn64tab[64] = {
+ 0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4,
+ 62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5,
+ 63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11,
+ 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6,
+};
+
+int TrailingZeros64(uint64_t x) {
+ static const uint64_t deBruijn64 = 0x03f79d71b4ca8b09ULL;
+ if (x == 0) {
+ return 64;
+ }
+
+ return (int)deBruijn64tab[(x&-x)*deBruijn64>>(64-6)];
+}
+
+const uint8_t lead0tab[16] = {
+ //0b0000 0b0001 0b0010 0b0011 0b0100 0b0101 0b0110 0b0111 0b1000...
+ 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
+}; \ No newline at end of file
diff --git a/src/tools/box64stack.c b/src/tools/box64stack.c
index 42412e2..44596b9 100755..100644
--- a/src/tools/box64stack.c
+++ b/src/tools/box64stack.c
@@ -35,45 +35,6 @@ int CalcStackSize(box64context_t *context)
return 0;
}
-uint16_t Pop16(x64emu_t *emu)
-{
- uint16_t* st = ((uint16_t*)(R_RSP));
- R_RSP += 2;
- return *st;
-}
-
-void Push16(x64emu_t *emu, uint16_t v)
-{
- R_RSP -= 2;
- *((uint16_t*)R_RSP) = v;
-}
-
-uint32_t Pop32(x64emu_t *emu)
-{
- uint32_t* st = ((uint32_t*)(R_RSP));
- R_RSP += 4;
- return *st;
-}
-
-void Push32(x64emu_t *emu, uint32_t v)
-{
- R_RSP -= 4;
- *((uint32_t*)R_RSP) = v;
-}
-
-uint64_t Pop64(x64emu_t *emu)
-{
- uint64_t* st = ((uint64_t*)(R_RSP));
- R_RSP += 8;
- return *st;
-}
-
-void Push64(x64emu_t *emu, uint64_t v)
-{
- R_RSP -= 8;
- *((uint64_t*)R_RSP) = v;
-}
-
void PushString(x64emu_t *emu, const char* s)
{
int sz = strlen(s) + 1;
@@ -86,7 +47,7 @@ EXPORTDYN
void SetupInitialStack(x64emu_t *emu)
{
// start with 0
- Push(emu, 0);
+ Push64(emu, 0);
// push program executed
PushString(emu, emu->context->argv[0]);
uintptr_t p_arg0 = R_RSP;
@@ -116,7 +77,7 @@ void SetupInitialStack(x64emu_t *emu)
uintptr_t p_random = real_getauxval(25);
if(!p_random) {
for (int i=0; i<4; ++i)
- Push(emu, random());
+ Push64(emu, random());
p_random = R_RSP;
}
// align
@@ -146,21 +107,21 @@ void SetupInitialStack(x64emu_t *emu)
31 0x7ffd5074efea
33 0x7ffd507e6000
*/
- Push(emu, 0); Push(emu, 0); //AT_NULL(0)=0
- //Push(emu, ); Push(emu, 3); //AT_PHDR(3)=address of the PH of the executable
- //Push(emu, ); Push(emu, 4); //AT_PHENT(4)=size of PH entry
- //Push(emu, ); Push(emu, 5); //AT_PHNUM(5)=number of elf headers
- Push(emu, box64_pagesize); Push(emu, 6); //AT_PAGESZ(6)
- //Push(emu, real_getauxval(7)); Push(emu, 7); //AT_BASE(7)=ld-2.27.so start (in memory)
- Push(emu, 0); Push(emu, 8); //AT_FLAGS(8)=0
- Push(emu, R_RIP); Push(emu, 9); //AT_ENTRY(9)=entrypoint
- Push(emu, real_getauxval(11)); Push(emu, 11); //AT_UID(11)
- Push(emu, real_getauxval(12)); Push(emu, 12); //AT_EUID(12)
- Push(emu, real_getauxval(13)); Push(emu, 13); //AT_GID(13)
- Push(emu, real_getauxval(14)); Push(emu, 14); //AT_EGID(14)
- Push(emu, p_x86_64); Push(emu, 15); //AT_PLATFORM(15)=&"x86_64"
- // Push HWCAP: same as CPUID 1.EDX
- Push(emu, 1 // fpu
+ Push64(emu, 0); Push64(emu, 0); //AT_NULL(0)=0
+ //Push64(emu, ); Push64(emu, 3); //AT_PHDR(3)=address of the PH of the executable
+ //Push64(emu, ); Push64(emu, 4); //AT_PHENT(4)=size of PH entry
+ //Push64(emu, ); Push64(emu, 5); //AT_PHNUM(5)=number of elf headers
+ Push64(emu, box64_pagesize); Push64(emu, 6); //AT_PAGESZ(6)
+ //Push64(emu, real_getauxval(7)); Push64(emu, 7); //AT_BASE(7)=ld-2.27.so start (in memory)
+ Push64(emu, 0); Push64(emu, 8); //AT_FLAGS(8)=0
+ Push64(emu, R_RIP); Push64(emu, 9); //AT_ENTRY(9)=entrypoint
+ Push64(emu, real_getauxval(11)); Push64(emu, 11); //AT_UID(11)
+ Push64(emu, real_getauxval(12)); Push64(emu, 12); //AT_EUID(12)
+ Push64(emu, real_getauxval(13)); Push64(emu, 13); //AT_GID(13)
+ Push64(emu, real_getauxval(14)); Push64(emu, 14); //AT_EGID(14)
+ Push64(emu, p_x86_64); Push64(emu, 15); //AT_PLATFORM(15)=&"x86_64"
+ // Push64 HWCAP: same as CPUID 1.EDX
+ Push64(emu, 1<<0 // fpu
| 1<<4 // rdtsc
| 1<<8 // cmpxchg8
| 1<<11 // sep (sysenter & sysexit)
@@ -170,28 +131,30 @@ void SetupInitialStack(x64emu_t *emu)
| 1<<24 // fxsr (fxsave, fxrestore)
| 1<<25 // SSE
| 1<<26 // SSE2
+ | 1<<28 // hyper threading
+ | 1<<30 // ia64
);
- Push(emu, 16); //AT_HWCAP(16)=...
- //Push(emu, sysconf(_SC_CLK_TCK)); Push(emu, 17); //AT_CLKTCK(17)=times() frequency
- Push(emu, real_getauxval(23)); Push(emu, 23); //AT_SECURE(23)
- Push(emu, p_random); Push(emu, 25); //AT_RANDOM(25)=p_random
- Push(emu, 0); Push(emu, 26); //AT_HWCAP2(26)=0
- Push(emu, p_arg0); Push(emu, 31); //AT_EXECFN(31)=p_arg0
- Push(emu, emu->context->vsyscall); Push(emu, 32); //AT_SYSINFO(32)=vsyscall
- //Push(emu, 0); Push(emu, 33); //AT_SYSINFO_EHDR(33)=address of vDSO
+ Push64(emu, 16); //AT_HWCAP(16)=...
+ //Push64(emu, sysconf(_SC_CLK_TCK)); Push64(emu, 17); //AT_CLKTCK(17)=times() frequency
+ Push64(emu, real_getauxval(23)); Push64(emu, 23); //AT_SECURE(23)
+ Push64(emu, p_random); Push64(emu, 25); //AT_RANDOM(25)=p_random
+ Push64(emu, 0); Push64(emu, 26); //AT_HWCAP2(26)=0
+ Push64(emu, p_arg0); Push64(emu, 31); //AT_EXECFN(31)=p_arg0
+ Push64(emu, emu->context->vsyscall); Push64(emu, 32); //AT_SYSINFO(32)=vsyscall
+ //Push64(emu, 0); Push64(emu, 33); //AT_SYSINFO_EHDR(33)=address of vDSO
if(!emu->context->auxval_start) // store auxval start if needed
emu->context->auxval_start = (uintptr_t*)R_RSP;
// push nil / envs / nil / args / argc
- Push(emu, 0);
+ Push64(emu, 0);
for (int i=emu->context->envc-1; i>=0; --i)
- Push(emu, p_envv[i]);
+ Push64(emu, p_envv[i]);
box_free(emu->context->envv);
emu->context->envv = (char**)R_RSP;
- Push(emu, 0);
+ Push64(emu, 0);
for (int i=emu->context->argc-1; i>=0; --i)
- Push(emu, p_argv[i]);
+ Push64(emu, p_argv[i]);
box_free(emu->context->argv);
emu->context->argv = (char**)R_RSP;
- Push(emu, emu->context->argc);
+ Push64(emu, emu->context->argc);
}
diff --git a/src/tools/bridge.c b/src/tools/bridge.c
index 3bc7ca2..220e06a 100755..100644
--- a/src/tools/bridge.c
+++ b/src/tools/bridge.c
@@ -60,6 +60,9 @@ brick_t* NewBrick(void* old)
if(ptr == MAP_FAILED) {
printf_log(LOG_NONE, "Warning, cannot allocate 0x%lx aligned bytes for bridge, will probably crash later\n", NBRICK*sizeof(onebridge_t));
}
+ #ifdef DYNAREC
+ setProtection((uintptr_t)ptr, NBRICK * sizeof(onebridge_t), PROT_READ | PROT_WRITE | PROT_EXEC | PROT_NOPROT | PROT_MMAP);
+ #endif
dynarec_log(LOG_INFO, "New Bridge brick at %p (size 0x%zx)\n", ptr, NBRICK*sizeof(onebridge_t));
ret->b = ptr;
return ret;
@@ -82,10 +85,7 @@ void FreeBridge(bridge_t** bridge)
x64emu_t* emu = thread_get_emu();
while(b) {
brick_t *n = b->next;
- #ifdef DYNAREC
- if(getProtection((uintptr_t)b->b)&(PROT_DYNAREC|PROT_DYNAREC_R))
- unprotectDB((uintptr_t)b->b, NBRICK*sizeof(onebridge_t), 0);
- #endif
+ dynarec_log(LOG_INFO, "FreeBridge brick at %p (size 0x%zx)\n", b->b, NBRICK*sizeof(onebridge_t));
my_munmap(emu, b->b, NBRICK*sizeof(onebridge_t));
box_free(b);
b = n;
@@ -119,24 +119,12 @@ uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char*
kh_value(bridge->bridgemap, k) = (uintptr_t)&b->b[sz].CC;
mutex_unlock(&my_context->mutex_bridge);
- #ifdef DYNAREC
- int prot = 0;
- if(box64_dynarec) {
- prot=(getProtection((uintptr_t)b->b)&(PROT_DYNAREC|PROT_DYNAREC_R))?1:0;
- if(prot)
- unprotectDB((uintptr_t)b->b, NBRICK*sizeof(onebridge_t), 0); // don't mark blocks, it's only new one
- }
- #endif
b->b[sz].CC = 0xCC;
b->b[sz].S = 'S'; b->b[sz].C='C';
b->b[sz].w = w;
b->b[sz].f = (uintptr_t)fnc;
b->b[sz].C3 = N?0xC2:0xC3;
b->b[sz].N = N;
- #ifdef DYNAREC
- if(box64_dynarec)
- protectDB((uintptr_t)b->b, NBRICK*sizeof(onebridge_t));
- #endif
#ifdef HAVE_TRACE
if(name)
addBridgeName(fnc, name);
@@ -164,7 +152,7 @@ uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const
return ret;
}
-uintptr_t AddAutomaticBridge(x64emu_t* emu, bridge_t* bridge, wrapper_t w, void* fnc, int N)
+uintptr_t AddAutomaticBridge(x64emu_t* emu, bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name)
{
(void)emu;
@@ -172,14 +160,14 @@ uintptr_t AddAutomaticBridge(x64emu_t* emu, bridge_t* bridge, wrapper_t w, void*
return 0;
uintptr_t ret = CheckBridged(bridge, fnc);
if(!ret)
- ret = AddBridge(bridge, w, fnc, N, NULL);
+ ret = AddBridge(bridge, w, fnc, N, name);
if(!hasAlternate(fnc)) {
printf_log(LOG_DEBUG, "Adding AutomaticBridge for %p to %p\n", fnc, (void*)ret);
addAlternate(fnc, (void*)ret);
#ifdef DYNAREC
// now, check if dynablock at native address exist
if(box64_dynarec)
- DBAlternateBlock(emu, (uintptr_t)fnc, ret);
+ DBAlternateBlock(emu, (uintptr_t)fnc, ret, 0); // function wrapping is exclusive to 64bits on box64
#endif
}
return ret;
@@ -230,41 +218,22 @@ uintptr_t AddVSyscall(bridge_t* bridge, int num)
{
brick_t *b = NULL;
int sz = -1;
- #ifdef DYNAREC
- int prot = 0;
- do {
- #endif
- mutex_lock(&my_context->mutex_bridge);
- b = bridge->last;
- if(b->sz == NBRICK) {
- b->next = NewBrick(b->b);
- b = b->next;
- bridge->last = b;
- }
- sz = b->sz;
- #ifdef DYNAREC
- mutex_unlock(&my_context->mutex_bridge);
- if(box64_dynarec) {
- prot=(getProtection((uintptr_t)b->b)&(PROT_DYNAREC|PROT_DYNAREC_R))?1:0;
- if(prot)
- unprotectDB((uintptr_t)b->b, NBRICK*sizeof(onebridge_t), 1);
- else // only add DB if there is no protection
- addDBFromAddressRange((uintptr_t)&b->b[b->sz].CC, sizeof(onebridge_t));
- }
- } while(sz!=b->sz); // this while loop if someone took the slot when the bridge mutex was unlocked doing memory protection managment
mutex_lock(&my_context->mutex_bridge);
- #endif
+ b = bridge->last;
+ if(b->sz == NBRICK) {
+ b->next = NewBrick(b->b);
+ b = b->next;
+ bridge->last = b;
+ }
+ sz = b->sz;
b->sz++;
+ mutex_unlock(&my_context->mutex_bridge);
+
b->b[sz].B8 = 0xB8;
b->b[sz].num = num;
b->b[sz]._0F = 0x0F;
b->b[sz]._05 = 0x05;
b->b[sz]._C3 = 0xC3;
- mutex_unlock(&my_context->mutex_bridge);
- #ifdef DYNAREC
- if(box64_dynarec)
- protectDB((uintptr_t)b->b, NBRICK*sizeof(onebridge_t));
- #endif
return (uintptr_t)&b->b[sz].CC;
}
diff --git a/src/tools/bridge_private.h b/src/tools/bridge_private.h
index 0983cea..0983cea 100755..100644
--- a/src/tools/bridge_private.h
+++ b/src/tools/bridge_private.h
diff --git a/src/tools/callback.c b/src/tools/callback.c
index 9aafa6d..162c801 100755..100644
--- a/src/tools/callback.c
+++ b/src/tools/callback.c
@@ -14,10 +14,8 @@
#include "dynarec.h"
EXPORTDYN
-uint64_t RunFunction(box64context_t *context, uintptr_t fnc, int nargs, ...)
+uint64_t RunFunction(uintptr_t fnc, int nargs, ...)
{
- (void)context;
-
x64emu_t *emu = thread_get_emu();
int align = (nargs>6)?(((nargs-6)&1)):0;
int stackn = align + ((nargs>6)?(nargs-6):0);
@@ -56,11 +54,101 @@ uint64_t RunFunction(box64context_t *context, uintptr_t fnc, int nargs, ...)
}
EXPORTDYN
-uint64_t RunSafeFunction(box64context_t *context, uintptr_t fnc, int nargs, ...)
+uint64_t RunFunctionFmt(uintptr_t fnc, const char* fmt, ...)
{
- (void)context;
-
x64emu_t *emu = thread_get_emu();
+ int nargs = 0;
+ int ni = 0;
+ int ndf = 0;
+ for (int i=0; fmt[i]; ++i) {
+ switch(fmt[i]) {
+ case 'f':
+ case 'd': if(ndf<8) ++ndf; else ++nargs; break;
+ case 'p':
+ case 'i':
+ case 'u':
+ case 'I':
+ case 'U':
+ case 'L':
+ case 'l':
+ case 'w':
+ case 'W':
+ case 'c':
+ case 'C': if(ni<6) ++ni; else ++nargs; break;
+ default:
+ if(ni<6) ++ni; else ++nargs; break;
+ }
+ }
+ ni = 0;
+ ndf = 0;
+ int align = nargs&1;
+ int stackn = align + nargs;
+
+ Push64(emu, R_RBP); // push rbp
+ R_RBP = R_RSP; // mov rbp, rsp
+
+ R_RSP -= stackn*sizeof(void*); // need to push in reverse order
+
+ uint64_t *p = (uint64_t*)R_RSP;
+
+ static const int nn[] = {_DI, _SI, _DX, _CX, _R8, _R9};
+ #define GO(c, A, B, B2, C) case c: if(ni<6) emu->regs[nn[ni++]].A[0] = C va_arg(va, B2); else {*p = 0; *((B*)p) = va_arg(va, B2); ++p;}; break;
+ va_list va;
+ va_start (va, fmt);
+ for (int i=0; fmt[i]; ++i) {
+ switch(fmt[i]) {
+ case 'f': if(ndf<8)
+ emu->xmm[ndf++].f[0] = va_arg(va, double); // float are promoted to double in ...
+ else {
+ *p = 0;
+ *((float*)p) = va_arg(va, double);
+ ++p;
+ }
+ break;
+ case 'd': if(ndf<8)
+ emu->xmm[ndf++].d[0] = va_arg(va, double);
+ else {
+ *((double*)p) = va_arg(va, double);
+ ++p;
+ }
+ break;
+ GO('p', q, void*, void*, (uintptr_t))
+ GO('i', sdword, int, int, )
+ GO('u', dword, uint32_t, uint32_t, )
+ GO('I', sq, int64_t, int64_t, )
+ GO('U', q, uint64_t, uint64_t, )
+ GO('L', q, uint64_t, uint64_t, )
+ GO('l', sq, int64_t, int64_t, )
+ GO('w', sword, int16_t, int, )
+ GO('W', word, uint16_t, int, )
+ GO('c', sbyte, int8_t, int, )
+ GO('C', byte, uint8_t, int, )
+ default:
+ printf_log(LOG_NONE, "Error, unhandled arg %d: '%c' in RunFunctionFmt\n", i, fmt[i]);
+ if(ni<6) emu->regs[nn[ni++]].q[0] = va_arg(va, uint64_t); else {*p = va_arg(va, uint64_t); ++p;};
+ break;
+ }
+ }
+ va_end (va);
+
+ uintptr_t oldip = R_RIP;
+ DynaCall(emu, fnc);
+
+ if(oldip==R_RIP) {
+ R_RSP = R_RBP; // mov rsp, rbp
+ R_RBP = Pop64(emu); // pop rbp
+ }
+
+ uint64_t ret = R_RAX;
+
+ return ret;
+}
+
+EXPORTDYN
+uint64_t RunSafeFunction(uintptr_t fnc, int nargs, ...)
+{
+ x64emu_t * emu = thread_get_emu();
+
int align = (nargs>6)?(((nargs-6)&1)):0;
int stackn = align + ((nargs>6)?(nargs-6):0);
@@ -145,10 +233,10 @@ uint64_t RunFunctionWithEmu(x64emu_t *emu, int QuitOnLongJump, uintptr_t fnc, in
uintptr_t oldip = R_RIP;
int old_quit = emu->quit;
- int oldlong = emu->quitonlongjmp;
+ int oldlong = emu->flags.quitonlongjmp;
emu->quit = 0;
- emu->quitonlongjmp = QuitOnLongJump;
+ emu->flags.quitonlongjmp = QuitOnLongJump;
DynaCall(emu, fnc);
@@ -158,17 +246,15 @@ uint64_t RunFunctionWithEmu(x64emu_t *emu, int QuitOnLongJump, uintptr_t fnc, in
}
emu->quit = old_quit;
- emu->quitonlongjmp = oldlong;
+ emu->flags.quitonlongjmp = oldlong;
return R_RAX;
}
EXPORTDYN
-uint64_t RunFunctionWindows(box64context_t *context, uintptr_t fnc, int nargs, ...)
+uint64_t RunFunctionWindows(uintptr_t fnc, int nargs, ...)
{
- (void)context;
-
x64emu_t *emu = thread_get_emu();
int align = (nargs>4)?(((nargs-4)&1)):0;
int stackn = align + ((nargs>4)?(nargs-4):0);
diff --git a/src/tools/fileutils.c b/src/tools/fileutils.c
index d6d1556..d6d1556 100755..100644
--- a/src/tools/fileutils.c
+++ b/src/tools/fileutils.c
diff --git a/src/tools/gtkclass.c b/src/tools/gtkclass.c
index 0335154..269d842 100755..100644
--- a/src/tools/gtkclass.c
+++ b/src/tools/gtkclass.c
@@ -58,12 +58,12 @@ GO(10) \
GO(11) \
GO(12)
-#define WRAPPED(A, NAME, RET, DEF, N, ...) \
+#define WRAPPED(A, NAME, RET, DEF, FMT, ...) \
static uintptr_t my_##NAME##_fct_##A = 0; \
static RET my_##NAME##_##A DEF \
{ \
printf_log(LOG_DEBUG, "Calling " #NAME "_" #A " wrapper\n"); \
- return (RET)RunFunction(my_context, my_##NAME##_fct_##A, N, __VA_ARGS__);\
+ return (RET)RunFunctionFmt(my_##NAME##_fct_##A, FMT, __VA_ARGS__);\
}
#define FIND(A, NAME) \
@@ -117,32 +117,32 @@ static void autobridge_##NAME##_##A(wrapper_t W, void* fct) \
return; \
Dl_info info; \
if(dladdr(fct, &info)) \
- AddAutomaticBridge(thread_get_emu(), my_bridge, W, fct, 0); \
-}
-
-#define WRAPPER(A, NAME, RET, DEF, N, ...) \
-WRAPPED(0, NAME##_##A, RET, DEF, N, __VA_ARGS__) \
-WRAPPED(1, NAME##_##A, RET, DEF, N, __VA_ARGS__) \
-WRAPPED(2, NAME##_##A, RET, DEF, N, __VA_ARGS__) \
-WRAPPED(3, NAME##_##A, RET, DEF, N, __VA_ARGS__) \
-WRAPPED(4, NAME##_##A, RET, DEF, N, __VA_ARGS__) \
-WRAPPED(5, NAME##_##A, RET, DEF, N, __VA_ARGS__) \
-WRAPPED(6, NAME##_##A, RET, DEF, N, __VA_ARGS__) \
-WRAPPED(7, NAME##_##A, RET, DEF, N, __VA_ARGS__) \
+ AddAutomaticBridge(thread_get_emu(), my_bridge, W, fct, 0, #NAME "_" #A); \
+}
+
+#define WRAPPER(A, NAME, RET, DEF, FMT, ...) \
+WRAPPED(0, NAME##_##A, RET, DEF, FMT, __VA_ARGS__) \
+WRAPPED(1, NAME##_##A, RET, DEF, FMT, __VA_ARGS__) \
+WRAPPED(2, NAME##_##A, RET, DEF, FMT, __VA_ARGS__) \
+WRAPPED(3, NAME##_##A, RET, DEF, FMT, __VA_ARGS__) \
+WRAPPED(4, NAME##_##A, RET, DEF, FMT, __VA_ARGS__) \
+WRAPPED(5, NAME##_##A, RET, DEF, FMT, __VA_ARGS__) \
+WRAPPED(6, NAME##_##A, RET, DEF, FMT, __VA_ARGS__) \
+WRAPPED(7, NAME##_##A, RET, DEF, FMT, __VA_ARGS__) \
FIND(A, NAME) \
REVERSE(A, NAME) \
AUTOBRIDGE(A, NAME)
// ----- GObjectClass ------
// wrapper x64 -> natives of callbacks
-WRAPPER(GObject, constructor, void*, (size_t type, uint32_t n_construct_properties, void* construct_properties), 3, type, n_construct_properties, construct_properties);
-WRAPPER(GObject, set_property, void, (void* object, uint32_t property_id, void* value, void* pspec), 4, object, property_id, value, pspec);
-WRAPPER(GObject, get_property, void, (void* object, uint32_t property_id, void* value, void* pspec), 4, object, property_id, value, pspec);
-WRAPPER(GObject, dispose, void, (void* object), 1, object);
-WRAPPER(GObject, finalize, void, (void* object), 1, object);
-WRAPPER(GObject, dispatch_properties_changed, void*, (size_t type, uint32_t n_pspecs, void* pspecs), 3, type, n_pspecs, pspecs);
-WRAPPER(GObject, notify, void*, (size_t type, void* pspecs), 2, type, pspecs);
-WRAPPER(GObject, constructed, void, (void* object), 1, object);
+WRAPPER(GObject, constructor, void*, (size_t type, uint32_t n_construct_properties, void* construct_properties), "Lup", type, n_construct_properties, construct_properties);
+WRAPPER(GObject, set_property, void, (void* object, uint32_t property_id, void* value, void* pspec), "pupp", object, property_id, value, pspec);
+WRAPPER(GObject, get_property, void, (void* object, uint32_t property_id, void* value, void* pspec), "pupp", object, property_id, value, pspec);
+WRAPPER(GObject, dispose, void, (void* object), "p", object);
+WRAPPER(GObject, finalize, void, (void* object), "p", object);
+WRAPPER(GObject, dispatch_properties_changed, void*, (size_t type, uint32_t n_pspecs, void* pspecs), "Lup", type, n_pspecs, pspecs);
+WRAPPER(GObject, notify, void*, (size_t type, void* pspecs), "Lp", type, pspecs);
+WRAPPER(GObject, constructed, void, (void* object), "p", object);
#define SUPERGO() \
GO(constructor, pFLup); \
@@ -163,7 +163,7 @@ static void wrapGObjectClass(my_GObjectClass_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGObjectClass(my_GObjectClass_t* class)
-{
+{
#define GO(A, W) class->A = find_##A##_GObject (class->A)
SUPERGO()
#undef GO
@@ -179,14 +179,14 @@ static void bridgeGObjectClass(my_GObjectClass_t* class)
// ----- GInitiallyUnownedClass ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GInitiallyUnowned, constructor, void*, (size_t type, uint32_t n_construct_properties, void* construct_properties), 3, type, n_construct_properties, construct_properties);
-WRAPPER(GInitiallyUnowned, set_property, void, (void* object, uint32_t property_id, void* value, void* pspec), 4, object, property_id, value, pspec);
-WRAPPER(GInitiallyUnowned, get_property, void, (void* object, uint32_t property_id, void* value, void* pspec), 4, object, property_id, value, pspec);
-WRAPPER(GInitiallyUnowned, dispose, void, (void* object), 1, object);
-WRAPPER(GInitiallyUnowned, finalize, void, (void* object), 1, object);
-WRAPPER(GInitiallyUnowned, dispatch_properties_changed, void*, (size_t type, uint32_t n_pspecs, void* pspecs), 3, type, n_pspecs, pspecs);
-WRAPPER(GInitiallyUnowned, notify, void*, (size_t type, void* pspecs), 2, type, pspecs);
-WRAPPER(GInitiallyUnowned, constructed, void, (void* object), 1, object);
+WRAPPER(GInitiallyUnowned, constructor, void*, (size_t type, uint32_t n_construct_properties, void* construct_properties), "Lup", type, n_construct_properties, construct_properties);
+WRAPPER(GInitiallyUnowned, set_property, void, (void* object, uint32_t property_id, void* value, void* pspec), "pupp", object, property_id, value, pspec);
+WRAPPER(GInitiallyUnowned, get_property, void, (void* object, uint32_t property_id, void* value, void* pspec), "pupp", object, property_id, value, pspec);
+WRAPPER(GInitiallyUnowned, dispose, void, (void* object), "p", object);
+WRAPPER(GInitiallyUnowned, finalize, void, (void* object), "p", object);
+WRAPPER(GInitiallyUnowned, dispatch_properties_changed, void*, (size_t type, uint32_t n_pspecs, void* pspecs), "Lup", type, n_pspecs, pspecs);
+WRAPPER(GInitiallyUnowned, notify, void*, (size_t type, void* pspecs), "Lp", type, pspecs);
+WRAPPER(GInitiallyUnowned, constructed, void, (void* object), "p", object);
#define SUPERGO() \
GO(constructor, pFLup); \
@@ -207,7 +207,7 @@ static void wrapGInitiallyUnownedClass(my_GInitiallyUnownedClass_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGInitiallyUnownedClass(my_GInitiallyUnownedClass_t* class)
-{
+{
#define GO(A, W) class->A = find_##A##_GInitiallyUnowned (class->A)
SUPERGO()
#undef GO
@@ -221,11 +221,138 @@ static void bridgeGInitiallyUnownedClass(my_GInitiallyUnownedClass_t* class)
}
#undef SUPERGO
+// ----- GamesScoresImporterClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GamesScoresImporter, importOldScores, void, (void *self, void* context, void* new_scores_dir, void *error), "pppp", self, context, new_scores_dir, error);
+
+#define SUPERGO() \
+ GO(importOldScores, vFpppp);
+
+// wrap (so bridge all calls, just in case)
+static void wrapGamesScoresImporterClass(my_GamesScoresImporterClass_t* class)
+{
+ wrapGObjectClass(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GamesScoresImporter (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGamesScoresImporterClass(my_GamesScoresImporterClass_t* class)
+{
+ unwrapGObjectClass(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GamesScoresImporter (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGamesScoresImporterClass(my_GamesScoresImporterClass_t* class)
+{
+ bridgeGObjectClass(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GamesScoresImporter (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+#undef SUPERGO
+
+// ----- GApplicationClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GApplication, startup, void, (void* application), "p", application);
+WRAPPER(GApplication, activate, void, (void* application), "p", application);
+WRAPPER(GApplication, open, void, (void* application, void* files, int n_files, void* hint), "ppip", application, files, n_files, hint);
+WRAPPER(GApplication, command_line, void, (void* application, void* command_line), "pp", application, command_line);
+WRAPPER(GApplication, local_command_line, void, (void* application, void* arguments, void* exit_status), "ppp", application, arguments, exit_status);
+WRAPPER(GApplication, before_emit, void*, (void* application, void* platform_data), "pp", application, platform_data);
+WRAPPER(GApplication, after_emit, void, (void* application, void* platform_data), "pp", application, platform_data);
+WRAPPER(GApplication, add_platform_data, void, (void* application, void* builder), "pp", application, builder);
+WRAPPER(GApplication, quit_mainloop, void, (void* application), "p", application);
+WRAPPER(GApplication, run_mainloop, void, (void* application), "p", application);
+WRAPPER(GApplication, shutdown, void, (void* application), "p", application);
+WRAPPER(GApplication, dbus_register, void, (void* application, void* connection, void* object_path, void* error), "pppp", application, connection, object_path, error);
+WRAPPER(GApplication, dbus_unregister, void, (void* application, void* connection, void* object_path), "ppp", application, connection, object_path);
+WRAPPER(GApplication, handle_local_options, void, (void* application, void* options), "pp", application, options);
+WRAPPER(GApplication, name_lost, void, (void* application), "p", application);
+
+#define SUPERGO() \
+ GO(startup, vFp); \
+ GO(activate, vFp); \
+ GO(open, vFppip); \
+ GO(command_line, vFpp); \
+ GO(local_command_line, vFppp); \
+ GO(before_emit, vFpp); \
+ GO(after_emit, vFpp); \
+ GO(add_platform_data, vFpp); \
+ GO(quit_mainloop, vFp); \
+ GO(run_mainloop, vFp); \
+ GO(shutdown, vFp); \
+ GO(dbus_register, vFpppp); \
+ GO(dbus_unregister, vFppp); \
+ GO(handle_local_options, vFpp); \
+ GO(name_lost, vFp);
+
+// wrap (so bridge all calls, just in case)
+static void wrapGApplicationClass(my_GApplicationClass_t* class)
+{
+ #define GO(A, W) class->A = reverse_##A##_GApplication (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGApplicationClass(my_GApplicationClass_t* class)
+{
+ #define GO(A, W) class->A = find_##A##_GApplication (class->A) //SUPERGO() defined but not used
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGApplicationClass(my_GApplicationClass_t* class)
+{
+ #define GO(A, W) autobridge_##A##_GApplication (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
+// ----- GtkApplicationClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GtkApplication, window_added, void, (void* application, void* window), "pp", application, window);
+WRAPPER(GtkApplication, window_removed, void, (void* application, void* window), "pp", application, window);
+
+#define SUPERGO() \
+ GO(window_added, pFpp); \
+ GO(window_removed, vFpp);
+
+static void wrapGtkApplicationClass(my_GtkApplicationClass_t* class)
+{
+ wrapGApplicationClass(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkApplication (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+static void unwrapGtkApplicationClass(my_GtkApplicationClass_t* class)
+{
+ unwrapGApplicationClass(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkApplication (class->A)
+ SUPERGO()
+ #undef GO
+}
+
+static void bridgeGtkApplicationClass(my_GtkApplicationClass_t* class)
+{
+ bridgeGApplicationClass(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkApplication (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
// ----- GtkObjectClass ------
// wrapper x64 -> natives of callbacks
-WRAPPER(GtkObject, set_arg, void, (void* object, void* arg, uint32_t arg_id), 3, object, arg, arg_id);
-WRAPPER(GtkObject, get_arg, void, (void* object, void* arg, uint32_t arg_id), 3, object, arg, arg_id);
-WRAPPER(GtkObject, destroy, void, (void* object), 1, object);
+WRAPPER(GtkObject, set_arg, void, (void* object, void* arg, uint32_t arg_id), "ppu", object, arg, arg_id);
+WRAPPER(GtkObject, get_arg, void, (void* object, void* arg, uint32_t arg_id), "ppu", object, arg, arg_id);
+WRAPPER(GtkObject, destroy, void, (void* object), "p", object);
#define SUPERGO() \
GO(set_arg, vFppu); \
@@ -241,7 +368,7 @@ static void wrapGtkObjectClass(my_GtkObjectClass_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkObjectClass(my_GtkObjectClass_t* class)
-{
+{
unwrapGObjectClass(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkObject (class->A)
SUPERGO()
@@ -260,72 +387,72 @@ static void bridgeGtkObjectClass(my_GtkObjectClass_t* class)
// ----- GtkWidget2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkWidget2, dispatch_child_properties_changed, void, (void* widget, uint32_t n_pspecs, void* pspecs), 3, widget, n_pspecs, pspecs);
-WRAPPER(GtkWidget2, show, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget2, show_all, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget2, hide, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget2, hide_all, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget2, map, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget2, unmap, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget2, realize, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget2, unrealize, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget2, size_request, void, (void* widget, void* requisition), 2, widget, requisition);
-WRAPPER(GtkWidget2, size_allocate, void, (void* widget, void* allocation), 2, widget, allocation);
-WRAPPER(GtkWidget2, state_changed, void, (void* widget, int previous_state), 2, widget, previous_state);
-WRAPPER(GtkWidget2, parent_set, void, (void* widget, void* previous_parent), 2, widget, previous_parent);
-WRAPPER(GtkWidget2, hierarchy_changed, void, (void* widget, void* previous_toplevel), 2, widget, previous_toplevel);
-WRAPPER(GtkWidget2, style_set, void, (void* widget, void* previous_style), 2, widget, previous_style);
-WRAPPER(GtkWidget2, direction_changed, void, (void* widget, int previous_direction), 2, widget, previous_direction);
-WRAPPER(GtkWidget2, grab_notify, void, (void* widget, int was_grabbed), 2, widget, was_grabbed);
-WRAPPER(GtkWidget2, child_notify, void, (void* widget, void* pspec), 2, widget, pspec);
-WRAPPER(GtkWidget2, mnemonic_activate, int, (void* widget, int group_cycling), 2, widget, group_cycling);
-WRAPPER(GtkWidget2, grab_focus, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget2, focus, int, (void* widget, int direction), 2, widget, direction);
-WRAPPER(GtkWidget2, event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, button_press_event,int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, button_release_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, scroll_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, motion_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, delete_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, destroy_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, expose_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, key_press_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, key_release_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, enter_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, leave_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, configure_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, focus_in_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, focus_out_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, map_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, unmap_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, property_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, selection_clear_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, selection_request_event,int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, selection_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, proximity_in_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, proximity_out_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, visibility_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, client_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, no_expose_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, window_state_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, selection_get, void, (void* widget, void* selection_data, uint32_t info, uint32_t time_), 4, widget, selection_data, info, time_);
-WRAPPER(GtkWidget2, selection_received, void, (void* widget, void* selection_data, uint32_t time_), 3, widget, selection_data, time_);
-WRAPPER(GtkWidget2, drag_begin, void, (void* widget, void* context), 2, widget, context);
-WRAPPER(GtkWidget2, drag_end, void, (void* widget, void* context), 2, widget, context);
-WRAPPER(GtkWidget2, drag_data_get, void, (void* widget, void* context, void* selection_data, uint32_t info, uint32_t time_), 5, widget, context, selection_data, info, time_);
-WRAPPER(GtkWidget2, drag_data_delete, void, (void* widget, void* context), 2, widget, context);
-WRAPPER(GtkWidget2, drag_leave, void, (void* widget, void* context, uint32_t time_), 3, widget, context, time_);
-WRAPPER(GtkWidget2, drag_motion, int, (void* widget, void* context, int32_t x, int32_t y, uint32_t time_), 5, widget, context, x, y, time_);
-WRAPPER(GtkWidget2, drag_drop, int, (void* widget, void* context, int32_t x, int32_t y, uint32_t time_), 5, widget, context, x, y, time_);
-WRAPPER(GtkWidget2, drag_data_received, void, (void* widget, void* context, int32_t x, int32_t y, void* selection_data, uint32_t info, uint32_t time_), 7, widget, context, x, y, selection_data, info, time_);
-WRAPPER(GtkWidget2, popup_menu, int , (void* widget), 1, widget);
-WRAPPER(GtkWidget2, show_help, int , (void* widget, int help_type), 2, widget, help_type);
-WRAPPER(GtkWidget2, get_accessible, void*, (void* widget), 1, widget);
-WRAPPER(GtkWidget2, screen_changed, void , (void* widget, void* previous_screen), 2, widget, previous_screen);
-WRAPPER(GtkWidget2, can_activate_accel, int , (void* widget, uint32_t signal_id), 2, widget, signal_id);
-WRAPPER(GtkWidget2, grab_broken_event, int , (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget2, composited_changed, void , (void* widget), 1, widget);
-WRAPPER(GtkWidget2, query_tooltip, int , (void* widget, int32_t x, int32_t y, int keyboard_tooltip, void* tooltip), 5, widget, x, y, keyboard_tooltip, tooltip);
+WRAPPER(GtkWidget2, dispatch_child_properties_changed, void, (void* widget, uint32_t n_pspecs, void* pspecs), "pup", widget, n_pspecs, pspecs);
+WRAPPER(GtkWidget2, show, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget2, show_all, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget2, hide, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget2, hide_all, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget2, map, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget2, unmap, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget2, realize, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget2, unrealize, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget2, size_request, void, (void* widget, void* requisition), "pp", widget, requisition);
+WRAPPER(GtkWidget2, size_allocate, void, (void* widget, void* allocation), "pp", widget, allocation);
+WRAPPER(GtkWidget2, state_changed, void, (void* widget, int previous_state), "pi", widget, previous_state);
+WRAPPER(GtkWidget2, parent_set, void, (void* widget, void* previous_parent), "pp", widget, previous_parent);
+WRAPPER(GtkWidget2, hierarchy_changed, void, (void* widget, void* previous_toplevel), "pp", widget, previous_toplevel);
+WRAPPER(GtkWidget2, style_set, void, (void* widget, void* previous_style), "pp", widget, previous_style);
+WRAPPER(GtkWidget2, direction_changed, void, (void* widget, int previous_direction), "pi", widget, previous_direction);
+WRAPPER(GtkWidget2, grab_notify, void, (void* widget, int was_grabbed), "pi", widget, was_grabbed);
+WRAPPER(GtkWidget2, child_notify, void, (void* widget, void* pspec), "pp", widget, pspec);
+WRAPPER(GtkWidget2, mnemonic_activate, int, (void* widget, int group_cycling), "pi", widget, group_cycling);
+WRAPPER(GtkWidget2, grab_focus, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget2, focus, int, (void* widget, int direction), "pi", widget, direction);
+WRAPPER(GtkWidget2, event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, button_press_event,int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, button_release_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, scroll_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, motion_notify_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, delete_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, destroy_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, expose_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, key_press_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, key_release_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, enter_notify_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, leave_notify_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, configure_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, focus_in_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, focus_out_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, map_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, unmap_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, property_notify_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, selection_clear_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, selection_request_event,int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, selection_notify_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, proximity_in_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, proximity_out_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, visibility_notify_event, int, (void* widget, void* event), "p", widget, event);
+WRAPPER(GtkWidget2, client_event, int, (void* widget, void* event), "p", widget, event);
+WRAPPER(GtkWidget2, no_expose_event, int, (void* widget, void* event), "p", widget, event);
+WRAPPER(GtkWidget2, window_state_event, int, (void* widget, void* event), "p", widget, event);
+WRAPPER(GtkWidget2, selection_get, void, (void* widget, void* selection_data, uint32_t info, uint32_t time_), "ppuu", widget, selection_data, info, time_);
+WRAPPER(GtkWidget2, selection_received, void, (void* widget, void* selection_data, uint32_t time_), "ppu", widget, selection_data, time_);
+WRAPPER(GtkWidget2, drag_begin, void, (void* widget, void* context), "pp", widget, context);
+WRAPPER(GtkWidget2, drag_end, void, (void* widget, void* context), "pp", widget, context);
+WRAPPER(GtkWidget2, drag_data_get, void, (void* widget, void* context, void* selection_data, uint32_t info, uint32_t time_), "pppuu", widget, context, selection_data, info, time_);
+WRAPPER(GtkWidget2, drag_data_delete, void, (void* widget, void* context), "pp", widget, context);
+WRAPPER(GtkWidget2, drag_leave, void, (void* widget, void* context, uint32_t time_), "ppu", widget, context, time_);
+WRAPPER(GtkWidget2, drag_motion, int, (void* widget, void* context, int32_t x, int32_t y, uint32_t time_), "ppiiu", widget, context, x, y, time_);
+WRAPPER(GtkWidget2, drag_drop, int, (void* widget, void* context, int32_t x, int32_t y, uint32_t time_), "ppiiu", widget, context, x, y, time_);
+WRAPPER(GtkWidget2, drag_data_received, void, (void* widget, void* context, int32_t x, int32_t y, void* selection_data, uint32_t info, uint32_t time_), "ppiipuu", widget, context, x, y, selection_data, info, time_);
+WRAPPER(GtkWidget2, popup_menu, int , (void* widget), "p", widget);
+WRAPPER(GtkWidget2, show_help, int , (void* widget, int help_type), "pi", widget, help_type);
+WRAPPER(GtkWidget2, get_accessible, void*, (void* widget), "p", widget);
+WRAPPER(GtkWidget2, screen_changed, void , (void* widget, void* previous_screen), "pp", widget, previous_screen);
+WRAPPER(GtkWidget2, can_activate_accel, int , (void* widget, uint32_t signal_id), "pu", widget, signal_id);
+WRAPPER(GtkWidget2, grab_broken_event, int , (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget2, composited_changed, void , (void* widget), "p", widget);
+WRAPPER(GtkWidget2, query_tooltip, int , (void* widget, int32_t x, int32_t y, int keyboard_tooltip, void* tooltip), "piiip", widget, x, y, keyboard_tooltip, tooltip);
#define SUPERGO() \
GO(dispatch_child_properties_changed, vFpup); \
@@ -405,7 +532,7 @@ static void wrapGtkWidget2Class(my_GtkWidget2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkWidget2Class(my_GtkWidget2Class_t* class)
-{
+{
unwrapGtkObjectClass(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkWidget2 (class->A)
SUPERGO()
@@ -424,88 +551,88 @@ static void bridgeGtkWidget2Class(my_GtkWidget2Class_t* class)
// ----- GtkWidget3Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkWidget3, dispatch_child_properties_changed, void, (void* widget, uint32_t n_pspecs, void* pspecs), 3, widget, n_pspecs, pspecs);
-WRAPPER(GtkWidget3, destroy, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, show, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, show_all, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, hide, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, map, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, unmap, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, realize, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, unrealize, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, size_allocate, void, (void* widget, void* allocation), 2, widget, allocation);
-WRAPPER(GtkWidget3, state_changed, void, (void* widget, int previous_state), 2, widget, previous_state);
-WRAPPER(GtkWidget3, state_flags_changed, void, (void* widget, int previous_state_flags), 2, widget, previous_state_flags);
-WRAPPER(GtkWidget3, parent_set, void, (void* widget, void* previous_parent), 2, widget, previous_parent);
-WRAPPER(GtkWidget3, hierarchy_changed, void, (void* widget, void* previous_toplevel), 2, widget, previous_toplevel);
-WRAPPER(GtkWidget3, style_set, void, (void* widget, void* previous_style), 2, widget, previous_style);
-WRAPPER(GtkWidget3, direction_changed, void, (void* widget, int previous_direction), 2, widget, previous_direction);
-WRAPPER(GtkWidget3, grab_notify, void, (void* widget, int was_grabbed), 2, widget, was_grabbed);
-WRAPPER(GtkWidget3, child_notify, void, (void* widget, void* child_property), 2, widget, child_property);
-WRAPPER(GtkWidget3, draw, int, (void* widget, void* cr), 2, widget, cr);
-WRAPPER(GtkWidget3, get_request_mode, int, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, get_preferred_height, void, (void* widget, void* minimum_height, void* natural_height), 3, widget, minimum_height, natural_height);
-WRAPPER(GtkWidget3, get_preferred_width_for_height, void, (void* widget, int height, void* minimum_width, void* natural_width), 4, widget, height, minimum_width, natural_width);
-WRAPPER(GtkWidget3, get_preferred_width, void, (void* widget, void* minimum_width, void* natural_width), 3, widget, minimum_width, natural_width);
-WRAPPER(GtkWidget3, get_preferred_height_for_width, void, (void* widget, int width, void* minimum_height, void* natural_height), 4, widget, width, minimum_height, natural_height);
-WRAPPER(GtkWidget3, mnemonic_activate, int, (void* widget, int group_cycling), 2, widget, group_cycling);
-WRAPPER(GtkWidget3, grab_focus, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, focus, int, (void* widget, int direction), 2, widget, direction);
-WRAPPER(GtkWidget3, move_focus, void, (void* widget, int direction), 2, widget, direction);
-WRAPPER(GtkWidget3, keynav_failed, int, (void* widget, int direction), 2, widget, direction);
-WRAPPER(GtkWidget3, event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, button_press_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, button_release_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, scroll_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, motion_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, delete_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, destroy_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, key_press_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, key_release_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, enter_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, leave_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, configure_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, focus_in_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, focus_out_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, map_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, unmap_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, property_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, selection_clear_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, selection_request_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, selection_notify_event, int,(void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, proximity_in_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, proximity_out_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, visibility_notify_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, window_state_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, damage_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, grab_broken_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, selection_get, void, (void* widget, void* selection_data, uint32_t info, uint32_t time_), 4, widget, selection_data, info, time_);
-WRAPPER(GtkWidget3, selection_received, void, (void* widget, void* selection_data, uint32_t time_), 3, widget, selection_data, time_);
-WRAPPER(GtkWidget3, drag_begin, void, (void* widget, void* context), 2, widget, context);
-WRAPPER(GtkWidget3, drag_end, void, (void* widget, void* context), 2, widget, context);
-WRAPPER(GtkWidget3, drag_data_get, void, (void* widget, void* context, void* selection_data, uint32_t info, uint32_t time_), 5, widget, context, selection_data, info, time_);
-WRAPPER(GtkWidget3, drag_data_delete, void, (void* widget, void* context), 2, widget, context);
-WRAPPER(GtkWidget3, drag_leave, void, (void* widget, void* context, uint32_t time_), 3, widget, context, time_);
-WRAPPER(GtkWidget3, drag_motion, int, (void* widget, void* context, int x, int y, uint32_t time_), 5, widget, context, x, y, time_);
-WRAPPER(GtkWidget3, drag_drop, int, (void* widget, void* context, int x, int y, uint32_t time_), 5, widget, context, x, y, time_);
-WRAPPER(GtkWidget3, drag_data_received, void, (void* widget, void* context, int x, int y, void* selection_data, uint32_t info, uint32_t time_), 7, widget, context, x, y, selection_data, info, time_);
-WRAPPER(GtkWidget3, drag_failed, int, (void* widget, void* context, int result), 3, widget, context, result);
-WRAPPER(GtkWidget3, popup_menu, int, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, show_help, int, (void* widget, int help_type), 2, widget, help_type);
-WRAPPER(GtkWidget3, get_accessible, void*, (void *widget), 1, widget);
-WRAPPER(GtkWidget3, screen_changed, void, (void* widget, void* previous_screen), 2, widget, previous_screen);
-WRAPPER(GtkWidget3, can_activate_accel, int, (void* widget, uint32_t signal_id), 2, widget, signal_id);
-WRAPPER(GtkWidget3, composited_changed, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, query_tooltip, int, (void* widget, int x, int y, int keyboard_tooltip, void* tooltip), 5, widget, x, y, keyboard_tooltip, tooltip);
-WRAPPER(GtkWidget3, compute_expand, void, (void* widget, void* hexpand_p, void* vexpand_p), 3, widget, hexpand_p, vexpand_p);
-WRAPPER(GtkWidget3, adjust_size_request, void, (void* widget, int orientation, void* minimum_size, void* natural_size), 4, widget, orientation, minimum_size, natural_size);
-WRAPPER(GtkWidget3, adjust_size_allocation, void, (void*widget, int orientation, void* minimum_size, void* natural_size, void* allocated_pos, void* allocated_size), 6, widget, orientation, minimum_size, natural_size, allocated_pos, allocated_size);
-WRAPPER(GtkWidget3, style_updated, void, (void* widget), 1, widget);
-WRAPPER(GtkWidget3, touch_event, int, (void* widget, void* event), 2, widget, event);
-WRAPPER(GtkWidget3, get_preferred_height_and_baseline_for_width, void, (void* widget, int width, void* minimum_height, void* natural_height, void* minimum_baseline, void* natural_baseline), 6, widget, width, minimum_height, natural_height, minimum_baseline, natural_baseline);
-WRAPPER(GtkWidget3, adjust_baseline_request, void, (void* widget, void* minimum_baseline, void* natural_baseline), 3, widget, minimum_baseline, natural_baseline);
-WRAPPER(GtkWidget3, adjust_baseline_allocation, void, (void* widget, void* baseline), 2, widget, baseline);
-WRAPPER(GtkWidget3, queue_draw_region, void, (void* widget, void* region), 2, widget, region);
+WRAPPER(GtkWidget3, dispatch_child_properties_changed, void, (void* widget, uint32_t n_pspecs, void* pspecs), "pup", widget, n_pspecs, pspecs);
+WRAPPER(GtkWidget3, destroy, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, show, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, show_all, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, hide, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, map, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, unmap, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, realize, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, unrealize, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, size_allocate, void, (void* widget, void* allocation), "pp", widget, allocation);
+WRAPPER(GtkWidget3, state_changed, void, (void* widget, int previous_state), "pi", widget, previous_state);
+WRAPPER(GtkWidget3, state_flags_changed, void, (void* widget, int previous_state_flags), "pi", widget, previous_state_flags);
+WRAPPER(GtkWidget3, parent_set, void, (void* widget, void* previous_parent), "pp", widget, previous_parent);
+WRAPPER(GtkWidget3, hierarchy_changed, void, (void* widget, void* previous_toplevel), "pp", widget, previous_toplevel);
+WRAPPER(GtkWidget3, style_set, void, (void* widget, void* previous_style), "pp", widget, previous_style);
+WRAPPER(GtkWidget3, direction_changed, void, (void* widget, int previous_direction), "pi", widget, previous_direction);
+WRAPPER(GtkWidget3, grab_notify, void, (void* widget, int was_grabbed), "pi", widget, was_grabbed);
+WRAPPER(GtkWidget3, child_notify, void, (void* widget, void* child_property), "pp", widget, child_property);
+WRAPPER(GtkWidget3, draw, int, (void* widget, void* cr), "pp", widget, cr);
+WRAPPER(GtkWidget3, get_request_mode, int, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, get_preferred_height, void, (void* widget, void* minimum_height, void* natural_height), "ppp", widget, minimum_height, natural_height);
+WRAPPER(GtkWidget3, get_preferred_width_for_height, void, (void* widget, int height, void* minimum_width, void* natural_width), "pipp", widget, height, minimum_width, natural_width);
+WRAPPER(GtkWidget3, get_preferred_width, void, (void* widget, void* minimum_width, void* natural_width), "ppp", widget, minimum_width, natural_width);
+WRAPPER(GtkWidget3, get_preferred_height_for_width, void, (void* widget, int width, void* minimum_height, void* natural_height), "pipp", widget, width, minimum_height, natural_height);
+WRAPPER(GtkWidget3, mnemonic_activate, int, (void* widget, int group_cycling), "pi", widget, group_cycling);
+WRAPPER(GtkWidget3, grab_focus, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, focus, int, (void* widget, int direction), "pi", widget, direction);
+WRAPPER(GtkWidget3, move_focus, void, (void* widget, int direction), "pi", widget, direction);
+WRAPPER(GtkWidget3, keynav_failed, int, (void* widget, int direction), "pi", widget, direction);
+WRAPPER(GtkWidget3, event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, button_press_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, button_release_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, scroll_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, motion_notify_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, delete_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, destroy_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, key_press_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, key_release_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, enter_notify_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, leave_notify_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, configure_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, focus_in_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, focus_out_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, map_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, unmap_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, property_notify_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, selection_clear_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, selection_request_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, selection_notify_event, int,(void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, proximity_in_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, proximity_out_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, visibility_notify_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, window_state_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, damage_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, grab_broken_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, selection_get, void, (void* widget, void* selection_data, uint32_t info, uint32_t time_), "ppuu", widget, selection_data, info, time_);
+WRAPPER(GtkWidget3, selection_received, void, (void* widget, void* selection_data, uint32_t time_), "ppu", widget, selection_data, time_);
+WRAPPER(GtkWidget3, drag_begin, void, (void* widget, void* context), "pp", widget, context);
+WRAPPER(GtkWidget3, drag_end, void, (void* widget, void* context), "pp", widget, context);
+WRAPPER(GtkWidget3, drag_data_get, void, (void* widget, void* context, void* selection_data, uint32_t info, uint32_t time_), "pppuu", widget, context, selection_data, info, time_);
+WRAPPER(GtkWidget3, drag_data_delete, void, (void* widget, void* context), "pp", widget, context);
+WRAPPER(GtkWidget3, drag_leave, void, (void* widget, void* context, uint32_t time_), "ppu", widget, context, time_);
+WRAPPER(GtkWidget3, drag_motion, int, (void* widget, void* context, int x, int y, uint32_t time_), "ppiiu", widget, context, x, y, time_);
+WRAPPER(GtkWidget3, drag_drop, int, (void* widget, void* context, int x, int y, uint32_t time_), "ppiiu", widget, context, x, y, time_);
+WRAPPER(GtkWidget3, drag_data_received, void, (void* widget, void* context, int x, int y, void* selection_data, uint32_t info, uint32_t time_), "ppiipuu", widget, context, x, y, selection_data, info, time_);
+WRAPPER(GtkWidget3, drag_failed, int, (void* widget, void* context, int result), "ppi", widget, context, result);
+WRAPPER(GtkWidget3, popup_menu, int, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, show_help, int, (void* widget, int help_type), "pi", widget, help_type);
+WRAPPER(GtkWidget3, get_accessible, void*, (void *widget), "p", widget);
+WRAPPER(GtkWidget3, screen_changed, void, (void* widget, void* previous_screen), "pp", widget, previous_screen);
+WRAPPER(GtkWidget3, can_activate_accel, int, (void* widget, uint32_t signal_id), "pu", widget, signal_id);
+WRAPPER(GtkWidget3, composited_changed, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, query_tooltip, int, (void* widget, int x, int y, int keyboard_tooltip, void* tooltip), "piiip", widget, x, y, keyboard_tooltip, tooltip);
+WRAPPER(GtkWidget3, compute_expand, void, (void* widget, void* hexpand_p, void* vexpand_p), "ppp", widget, hexpand_p, vexpand_p);
+WRAPPER(GtkWidget3, adjust_size_request, void, (void* widget, int orientation, void* minimum_size, void* natural_size), "pipp", widget, orientation, minimum_size, natural_size);
+WRAPPER(GtkWidget3, adjust_size_allocation, void, (void*widget, int orientation, void* minimum_size, void* natural_size, void* allocated_pos, void* allocated_size), "pipppp", widget, orientation, minimum_size, natural_size, allocated_pos, allocated_size);
+WRAPPER(GtkWidget3, style_updated, void, (void* widget), "p", widget);
+WRAPPER(GtkWidget3, touch_event, int, (void* widget, void* event), "pp", widget, event);
+WRAPPER(GtkWidget3, get_preferred_height_and_baseline_for_width, void, (void* widget, int width, void* minimum_height, void* natural_height, void* minimum_baseline, void* natural_baseline), "pipppp", widget, width, minimum_height, natural_height, minimum_baseline, natural_baseline);
+WRAPPER(GtkWidget3, adjust_baseline_request, void, (void* widget, void* minimum_baseline, void* natural_baseline), "ppp", widget, minimum_baseline, natural_baseline);
+WRAPPER(GtkWidget3, adjust_baseline_allocation, void, (void* widget, void* baseline), "pp", widget, baseline);
+WRAPPER(GtkWidget3, queue_draw_region, void, (void* widget, void* region), "pp", widget, region);
#define SUPERGO() \
GO(dispatch_child_properties_changed, vFpup); \
@@ -602,7 +729,7 @@ static void wrapGtkWidget3Class(my_GtkWidget3Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkWidget3Class(my_GtkWidget3Class_t* class)
-{
+{
unwrapGInitiallyUnownedClass(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkWidget3 (class->A)
SUPERGO()
@@ -621,15 +748,15 @@ static void bridgeGtkWidget3Class(my_GtkWidget3Class_t* class)
// ----- GtkContainer2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkContainer2, add, void, (void* container, void* widget), 2, container, widget);
-WRAPPER(GtkContainer2, remove, void, (void* container, void* widget), 2, container, widget);
-WRAPPER(GtkContainer2, check_resize, void, (void* container), 1, container);
-WRAPPER(GtkContainer2, forall, void, (void* container, int include_internals, void* callback, void* callback_data), 4, container, include_internals, AddCheckBridge(my_bridge, vFpp, callback, 0, NULL), callback_data);
-WRAPPER(GtkContainer2, set_focus_child, void, (void* container, void* widget), 2, container, widget);
-WRAPPER(GtkContainer2, child_type, int, (void* container), 1, container);
-WRAPPER(GtkContainer2, composite_name, void*, (void* container, void* child), 2, container, child);
-WRAPPER(GtkContainer2, set_child_property, void, (void* container, void* child, uint32_t property_id, void* value, void* pspec), 5, container, child, property_id, value, pspec);
-WRAPPER(GtkContainer2, get_child_property, void, (void* container, void* child, uint32_t property_id, void* value, void* pspec), 5, container, child, property_id, value, pspec);
+WRAPPER(GtkContainer2, add, void, (void* container, void* widget), "pp", container, widget);
+WRAPPER(GtkContainer2, remove, void, (void* container, void* widget), "pp", container, widget);
+WRAPPER(GtkContainer2, check_resize, void, (void* container), "p", container);
+WRAPPER(GtkContainer2, forall, void, (void* container, int include_internals, void* callback, void* callback_data), "pipp", container, include_internals, AddCheckBridge(my_bridge, vFpp, callback, 0, NULL), callback_data);
+WRAPPER(GtkContainer2, set_focus_child, void, (void* container, void* widget), "pp", container, widget);
+WRAPPER(GtkContainer2, child_type, int, (void* container), "p", container);
+WRAPPER(GtkContainer2, composite_name, void*, (void* container, void* child), "pp", container, child);
+WRAPPER(GtkContainer2, set_child_property, void, (void* container, void* child, uint32_t property_id, void* value, void* pspec), "ppupp", container, child, property_id, value, pspec);
+WRAPPER(GtkContainer2, get_child_property, void, (void* container, void* child, uint32_t property_id, void* value, void* pspec), "ppupp", container, child, property_id, value, pspec);
#define SUPERGO() \
GO(add, vFpp); \
@@ -652,7 +779,7 @@ static void wrapGtkContainer2Class(my_GtkContainer2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkContainer2Class(my_GtkContainer2Class_t* class)
-{
+{
unwrapGtkWidget2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkContainer2 (class->A)
SUPERGO()
@@ -671,16 +798,16 @@ static void bridgeGtkContainer2Class(my_GtkContainer2Class_t* class)
// ----- GtkContainer3Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkContainer3, add, void, (void* container, void* widget), 2, container, widget);
-WRAPPER(GtkContainer3, remove, void, (void* container, void* widget), 2, container, widget);
-WRAPPER(GtkContainer3, check_resize, void, (void* container), 1, container);
-WRAPPER(GtkContainer3, forall, void, (void* container, int include_internals, void* callback, void* callback_data), 4, container, include_internals, AddCheckBridge(my_bridge, vFpp, callback, 0, NULL), callback_data);
-WRAPPER(GtkContainer3, set_focus_child, void, (void* container, void* widget), 2, container, widget);
-WRAPPER(GtkContainer3, child_type, int, (void* container), 1, container);
-WRAPPER(GtkContainer3, composite_name, void*, (void* container, void* child), 2, container, child);
-WRAPPER(GtkContainer3, set_child_property, void, (void* container, void* child, uint32_t property_id, void* value, void* pspec), 5, container, child, property_id, value, pspec);
-WRAPPER(GtkContainer3, get_child_property, void, (void* container, void* child, uint32_t property_id, void* value, void* pspec), 5, container, child, property_id, value, pspec);
-WRAPPER(GtkContainer3, get_path_for_child, void*, (void* container, void* child), 2, container, child);
+WRAPPER(GtkContainer3, add, void, (void* container, void* widget), "pp", container, widget);
+WRAPPER(GtkContainer3, remove, void, (void* container, void* widget), "pp", container, widget);
+WRAPPER(GtkContainer3, check_resize, void, (void* container), "p", container);
+WRAPPER(GtkContainer3, forall, void, (void* container, int include_internals, void* callback, void* callback_data), "pipp", container, include_internals, AddCheckBridge(my_bridge, vFpp, callback, 0, NULL), callback_data);
+WRAPPER(GtkContainer3, set_focus_child, void, (void* container, void* widget), "pp", container, widget);
+WRAPPER(GtkContainer3, child_type, int, (void* container), "p", container);
+WRAPPER(GtkContainer3, composite_name, void*, (void* container, void* child), "pp", container, child);
+WRAPPER(GtkContainer3, set_child_property, void, (void* container, void* child, uint32_t property_id, void* value, void* pspec), "ppupp", container, child, property_id, value, pspec);
+WRAPPER(GtkContainer3, get_child_property, void, (void* container, void* child, uint32_t property_id, void* value, void* pspec), "ppupp", container, child, property_id, value, pspec);
+WRAPPER(GtkContainer3, get_path_for_child, void*, (void* container, void* child), "pp", container, child);
#define SUPERGO() \
GO(add, vFpp); \
@@ -704,7 +831,7 @@ static void wrapGtkContainer3Class(my_GtkContainer3Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkContainer3Class(my_GtkContainer3Class_t* class)
-{
+{
unwrapGtkWidget3Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkContainer3 (class->A)
SUPERGO()
@@ -723,12 +850,12 @@ static void bridgeGtkContainer3Class(my_GtkContainer3Class_t* class)
// ----- GtkActionClass ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkAction, activate, void, (void* action), 1, action);
-WRAPPER(GtkAction, create_menu_item, void*, (void* action), 1, action);
-WRAPPER(GtkAction, create_tool_item, void*, (void* action), 1, action);
-WRAPPER(GtkAction, connect_proxy, void , (void* action, void* proxy), 2, action, proxy);
-WRAPPER(GtkAction, disconnect_proxy, void , (void* action, void* proxy), 2, action, proxy);
-WRAPPER(GtkAction, create_menu, void*, (void* action), 1, action);
+WRAPPER(GtkAction, activate, void, (void* action), "p", action);
+WRAPPER(GtkAction, create_menu_item, void*, (void* action), "p", action);
+WRAPPER(GtkAction, create_tool_item, void*, (void* action), "p", action);
+WRAPPER(GtkAction, connect_proxy, void , (void* action, void* proxy), "pp", action, proxy);
+WRAPPER(GtkAction, disconnect_proxy, void , (void* action, void* proxy), "pp", action, proxy);
+WRAPPER(GtkAction, create_menu, void*, (void* action), "p", action);
#define SUPERGO() \
GO(activate, vFp); \
@@ -748,7 +875,7 @@ static void wrapGtkActionClass(my_GtkActionClass_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkActionClass(my_GtkActionClass_t* class)
-{
+{
unwrapGObjectClass(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkAction (class->A)
SUPERGO()
@@ -773,7 +900,7 @@ static void wrapGtkMisc2Class(my_GtkMisc2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkMisc2Class(my_GtkMisc2Class_t* class)
-{
+{
unwrapGtkWidget2Class(&class->parent_class);
}
// autobridge
@@ -782,13 +909,77 @@ static void bridgeGtkMisc2Class(my_GtkMisc2Class_t* class)
bridgeGtkWidget2Class(&class->parent_class);
}
+// ----- GtkMisc3Class ------
+// no wrapper x86 -> natives of callbacks
+
+#define SUPERGO() \
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkMisc3Class(my_GtkMisc3Class_t* class)
+{
+ wrapGtkWidget3Class(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkMisc3 (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkMisc3Class(my_GtkMisc3Class_t* class)
+{
+ unwrapGtkWidget3Class(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkMisc3 (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkMisc3Class(my_GtkMisc3Class_t* class)
+{
+ bridgeGtkWidget3Class(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkMisc3 (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
+// ----- GtkGtkMenuButtonClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GtkMenuButton, activate, void, (void* self), "p", self);
+
+#define SUPERGO() \
+ GO(activate, vFp);
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkMenuButtonClass(my_GtkMenuButtonClass_t* class)
+{
+ wrapGtkWidget3Class(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkMenuButton (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkMenuButtonClass(my_GtkMenuButtonClass_t* class)
+{
+ unwrapGtkWidget3Class(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkMenuButton (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkMenuButtonClass(my_GtkMenuButtonClass_t* class)
+{
+ bridgeGtkWidget3Class(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkMenuButton (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+#undef SUPERGO
// ----- GtkLabel2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkMisc2, move_cursor, void, (void* label, int step, int count, int extend_selection), 4, label, step, count, extend_selection);
-WRAPPER(GtkMisc2, copy_clipboard, void, (void* label), 1, label);
-WRAPPER(GtkMisc2, populate_popup, void, (void* label, void* menu), 2, label, menu);
-WRAPPER(GtkMisc2, activate_link, int, (void* label, void* uri), 2, label, uri);
+WRAPPER(GtkLabel2, move_cursor, void, (void* label, int step, int count, int extend_selection), "piii", label, step, count, extend_selection);
+WRAPPER(GtkLabel2, copy_clipboard, void, (void* label), "p", label);
+WRAPPER(GtkLabel2, populate_popup, void, (void* label, void* menu), "pp", label, menu);
+WRAPPER(GtkLabel2, activate_link, int, (void* label, void* uri), "pp", label, uri);
#define SUPERGO() \
GO(move_cursor, vFpiii); \
@@ -800,15 +991,15 @@ WRAPPER(GtkMisc2, activate_link, int, (void* label, void* uri), 2, label, uri);
static void wrapGtkLabel2Class(my_GtkLabel2Class_t* class)
{
wrapGtkMisc2Class(&class->parent_class);
- #define GO(A, W) class->A = reverse_##A##_GtkMisc2 (W, class->A)
+ #define GO(A, W) class->A = reverse_##A##_GtkLabel2 (W, class->A)
SUPERGO()
#undef GO
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkLabel2Class(my_GtkLabel2Class_t* class)
-{
+{
unwrapGtkMisc2Class(&class->parent_class);
- #define GO(A, W) class->A = find_##A##_GtkMisc2 (class->A)
+ #define GO(A, W) class->A = find_##A##_GtkLabel2 (class->A)
SUPERGO()
#undef GO
}
@@ -816,30 +1007,70 @@ static void unwrapGtkLabel2Class(my_GtkLabel2Class_t* class)
static void bridgeGtkLabel2Class(my_GtkLabel2Class_t* class)
{
bridgeGtkMisc2Class(&class->parent_class);
- #define GO(A, W) autobridge_##A##_GtkMisc2 (W, class->A)
+ #define GO(A, W) autobridge_##A##_GtkLabel2 (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+#undef SUPERGO
+
+// ----- GtkLabel3Class ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GtkLabel3, move_cursor, void, (void* label, int step, int count, int extend_selection), "piii", label, step, count, extend_selection);
+WRAPPER(GtkLabel3, copy_clipboard, void, (void* label), "p", label);
+WRAPPER(GtkLabel3, populate_popup, void, (void* label, void* menu), "pp", label, menu);
+WRAPPER(GtkLabel3, activate_link, int, (void* label, void* uri), "pp", label, uri);
+
+#define SUPERGO() \
+ GO(move_cursor, vFpiii); \
+ GO(copy_clipboard, vFp); \
+ GO(populate_popup, vFpp); \
+ GO(activate_link, iFpp); \
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkLabel3Class(my_GtkLabel3Class_t* class)
+{
+ wrapGtkMisc3Class(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkLabel3 (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkLabel3Class(my_GtkLabel3Class_t* class)
+{
+ unwrapGtkMisc3Class(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkLabel3 (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkLabel3Class(my_GtkLabel3Class_t* class)
+{
+ bridgeGtkMisc3Class(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkLabel3 (W, class->A)
SUPERGO()
#undef GO
}
+
#undef SUPERGO
// ----- GtkTreeView2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkTreeView2, set_scroll_adjustments, void, (void* tree_view, void* hadjustment, void* vadjustment), 3, tree_view, hadjustment, vadjustment);
-WRAPPER(GtkTreeView2, row_activated, void, (void* tree_view, void* path, void* column), 3, tree_view, path, column);
-WRAPPER(GtkTreeView2, test_expand_row, int, (void* tree_view, void* iter, void* path), 3, tree_view, iter, path);
-WRAPPER(GtkTreeView2, test_collapse_row, int, (void* tree_view, void* iter, void* path), 3, tree_view, iter, path);
-WRAPPER(GtkTreeView2, row_expanded, void, (void* tree_view, void* iter, void* path), 3, tree_view, iter, path);
-WRAPPER(GtkTreeView2, row_collapsed, void, (void* tree_view, void* iter, void* path), 3, tree_view, iter, path);
-WRAPPER(GtkTreeView2, columns_changed, void, (void* tree_view), 1, tree_view);
-WRAPPER(GtkTreeView2, cursor_changed, void, (void* tree_view), 1, tree_view);
-WRAPPER(GtkTreeView2, move_cursor, int, (void* tree_view, int step, int count), 3, tree_view, step, count);
-WRAPPER(GtkTreeView2, select_all, int, (void* tree_view), 1, tree_view);
-WRAPPER(GtkTreeView2, unselect_all, int, (void* tree_view), 1, tree_view);
-WRAPPER(GtkTreeView2, select_cursor_row, int, (void* tree_view, int start_editing), 2, tree_view, start_editing);
-WRAPPER(GtkTreeView2, toggle_cursor_row, int, (void* tree_view), 1, tree_view);
-WRAPPER(GtkTreeView2, expand_collapse_cursor_row, int, (void* tree_view, int logical, int expand, int open_all), 4, tree_view, logical, expand, open_all);
-WRAPPER(GtkTreeView2, select_cursor_parent, int, (void* tree_view), 1, tree_view);
-WRAPPER(GtkTreeView2, start_interactive_search, int, (void* tree_view), 1, tree_view);
+WRAPPER(GtkTreeView2, set_scroll_adjustments, void, (void* tree_view, void* hadjustment, void* vadjustment), "ppp", tree_view, hadjustment, vadjustment);
+WRAPPER(GtkTreeView2, row_activated, void, (void* tree_view, void* path, void* column), "ppp", tree_view, path, column);
+WRAPPER(GtkTreeView2, test_expand_row, int, (void* tree_view, void* iter, void* path), "ppp", tree_view, iter, path);
+WRAPPER(GtkTreeView2, test_collapse_row, int, (void* tree_view, void* iter, void* path), "ppp", tree_view, iter, path);
+WRAPPER(GtkTreeView2, row_expanded, void, (void* tree_view, void* iter, void* path), "ppp", tree_view, iter, path);
+WRAPPER(GtkTreeView2, row_collapsed, void, (void* tree_view, void* iter, void* path), "ppp", tree_view, iter, path);
+WRAPPER(GtkTreeView2, columns_changed, void, (void* tree_view), "p", tree_view);
+WRAPPER(GtkTreeView2, cursor_changed, void, (void* tree_view), "p", tree_view);
+WRAPPER(GtkTreeView2, move_cursor, int, (void* tree_view, int step, int count), "pii", tree_view, step, count);
+WRAPPER(GtkTreeView2, select_all, int, (void* tree_view), "p", tree_view);
+WRAPPER(GtkTreeView2, unselect_all, int, (void* tree_view), "p", tree_view);
+WRAPPER(GtkTreeView2, select_cursor_row, int, (void* tree_view, int start_editing), "pi", tree_view, start_editing);
+WRAPPER(GtkTreeView2, toggle_cursor_row, int, (void* tree_view), "p", tree_view);
+WRAPPER(GtkTreeView2, expand_collapse_cursor_row, int, (void* tree_view, int logical, int expand, int open_all), "piii", tree_view, logical, expand, open_all);
+WRAPPER(GtkTreeView2, select_cursor_parent, int, (void* tree_view), "p", tree_view);
+WRAPPER(GtkTreeView2, start_interactive_search, int, (void* tree_view), "p", tree_view);
#define SUPERGO() \
GO(set_scroll_adjustments, vFppp); \
@@ -869,7 +1100,7 @@ static void wrapGtkTreeView2Class(my_GtkTreeView2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkTreeView2Class(my_GtkTreeView2Class_t* class)
-{
+{
unwrapGtkContainer2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkTreeView2 (class->A)
SUPERGO()
@@ -895,7 +1126,7 @@ static void wrapGtkBin2Class(my_GtkBin2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkBin2Class(my_GtkBin2Class_t* class)
-{
+{
unwrapGtkContainer2Class(&class->parent_class);
}
// autobridge
@@ -904,14 +1135,30 @@ static void bridgeGtkBin2Class(my_GtkBin2Class_t* class)
bridgeGtkContainer2Class(&class->parent_class);
}
+// ----- GtkBin3Class ------
+static void wrapGtkBin3Class(my_GtkBin3Class_t* class)
+{
+ wrapGtkContainer3Class(&class->parent_class);
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkBin3Class(my_GtkBin3Class_t* class)
+{
+ unwrapGtkContainer3Class(&class->parent_class);
+}
+// autobridge
+static void bridgeGtkBin3Class(my_GtkBin3Class_t* class)
+{
+ bridgeGtkContainer3Class(&class->parent_class);
+}
+
// ----- GtkWindow2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkWindow2, set_focus, void, (void* window, void* focus), 2, window, focus);
-WRAPPER(GtkWindow2, frame_event, int, (void* window, void* event), 2, window, event);
-WRAPPER(GtkWindow2, activate_focus, void, (void* window), 1, window);
-WRAPPER(GtkWindow2, activate_default, void, (void* window), 1, window);
-WRAPPER(GtkWindow2, move_focus, void, (void* window, int direction), 2, window, direction);
-WRAPPER(GtkWindow2, keys_changed, void, (void* window), 1, window);
+WRAPPER(GtkWindow2, set_focus, void, (void* window, void* focus), "pp", window, focus);
+WRAPPER(GtkWindow2, frame_event, int, (void* window, void* event), "pp", window, event);
+WRAPPER(GtkWindow2, activate_focus, void, (void* window), "p", window);
+WRAPPER(GtkWindow2, activate_default, void, (void* window), "p", window);
+WRAPPER(GtkWindow2, move_focus, void, (void* window, int direction), "pi", window, direction);
+WRAPPER(GtkWindow2, keys_changed, void, (void* window), "p", window);
#define SUPERGO() \
GO(set_focus, vFpp); \
@@ -932,7 +1179,7 @@ static void wrapGtkWindow2Class(my_GtkWindow2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkWindow2Class(my_GtkWindow2Class_t* class)
-{
+{
unwrapGtkBin2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkWindow2 (class->A)
SUPERGO()
@@ -949,6 +1196,148 @@ static void bridgeGtkWindow2Class(my_GtkWindow2Class_t* class)
#undef SUPERGO
+// ----- GtkWindow3Class ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GtkWindow3, set_focus, void, (void* window, void* focus), "pp", window, focus);
+WRAPPER(GtkWindow3, activate_focus, void, (void* window), "p", window);
+WRAPPER(GtkWindow3, activate_default, void, (void* window), "p", window);
+WRAPPER(GtkWindow3, keys_changed, void, (void* window), "p", window);
+WRAPPER(GtkWindow3, enable_debugging, int, (void* window, int toggle), "pi", window, toggle);
+
+#define SUPERGO() \
+ GO(set_focus, vFpp); \
+ GO(activate_focus, vFp); \
+ GO(activate_default, vFp); \
+ GO(keys_changed, vFp); \
+ GO(enable_debugging, iFpi);
+
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkWindow3Class(my_GtkWindow3Class_t* class)
+{
+ wrapGtkBin3Class(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkWindow3 (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkWindow3Class(my_GtkWindow3Class_t* class)
+{
+ unwrapGtkBin3Class(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkWindow3 (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkWindow3Class(my_GtkWindow3Class_t* class)
+{
+ bridgeGtkBin3Class(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkWindow3 (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
+// ----- GtkApplicationWindowClass ------
+// wrap (so bridge all calls, just in case)
+static void wrapGtkApplicationWindowClass(my_GtkApplicationWindowClass_t* class)
+{
+ wrapGtkWindow3Class(&class->parent_class);
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkApplicationWindowClass(my_GtkApplicationWindowClass_t* class)
+{
+ unwrapGtkWindow3Class(&class->parent_class);
+}
+// autobridge
+static void bridgeGtkApplicationWindowClass(my_GtkApplicationWindowClass_t* class)
+{
+ bridgeGtkWindow3Class(&class->parent_class);
+}
+
+// ----- GtkListBoxClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GtkListBoxClass,row_selected, void, (void *box, void *row), "pp", box, row);
+WRAPPER(GtkListBoxClass,row_activated, void, (void *box, void *row), "pp", box, row);
+WRAPPER(GtkListBoxClass,activate_cursor_row, void, (void *box), "p", box);
+WRAPPER(GtkListBoxClass,toggle_cursor_row, void, (void *box), "p", box);
+WRAPPER(GtkListBoxClass,move_cursor, void, (void *box, int step, int count), "pii", box, step, count);
+WRAPPER(GtkListBoxClass,selected_rows_changed, void, (void *box), "p", box);
+WRAPPER(GtkListBoxClass,select_all, void, (void *box), "p", box);
+WRAPPER(GtkListBoxClass,unselect_all, void, (void *box), "p", box);
+
+#define SUPERGO() \
+ GO(row_selected, vFpp); \
+ GO(row_activated, vFpp); \
+ GO(activate_cursor_row, vFp); \
+ GO(toggle_cursor_row, vFp); \
+ GO(move_cursor, vFpii); \
+ GO(selected_rows_changed, vFp); \
+ GO(select_all, vFp); \
+ GO(unselect_all, vFp);
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkListBoxClass(my_GtkListBoxClass_t* class)
+{
+ wrapGtkContainer3Class(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkListBoxClass (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkListBoxClass(my_GtkListBoxClass_t* class)
+{
+ unwrapGtkContainer3Class(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkListBoxClass (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkListBoxClass(my_GtkListBoxClass_t* class)
+{
+ bridgeGtkContainer3Class(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkListBoxClass (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
+// ----- GtkListBoxRowClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GtkListBoxRowClass, activate, void, (void *row), "p", row);
+
+#define SUPERGO() \
+ GO(activate, vFpp);
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkListBoxRowClass(my_GtkListBoxRowClass_t* class)
+{
+ wrapGtkBin3Class(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkListBoxRowClass (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkListBoxRowClass(my_GtkListBoxRowClass_t* class)
+{
+ unwrapGtkBin3Class(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkListBoxRowClass (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkListBoxRowClass(my_GtkListBoxRowClass_t* class)
+{
+ bridgeGtkBin3Class(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkListBoxRowClass (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
// ----- GtkTable2Class ------
// wrap (so bridge all calls, just in case)
static void wrapGtkTable2Class(my_GtkTable2Class_t* class)
@@ -957,7 +1346,7 @@ static void wrapGtkTable2Class(my_GtkTable2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkTable2Class(my_GtkTable2Class_t* class)
-{
+{
unwrapGtkContainer2Class(&class->parent_class);
}
// autobridge
@@ -975,7 +1364,7 @@ static void wrapGtkFixed2Class(my_GtkFixed2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkFixed2Class(my_GtkFixed2Class_t* class)
-{
+{
unwrapGtkContainer2Class(&class->parent_class);
}
// autobridge
@@ -993,7 +1382,7 @@ static void wrapMetaFrames2Class(my_MetaFrames2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapMetaFrames2Class(my_MetaFrames2Class_t* class)
-{
+{
unwrapGtkWindow2Class(&class->parent_class);
}
// autobridge
@@ -1004,8 +1393,8 @@ static void bridgeMetaFrames2Class(my_MetaFrames2Class_t* class)
// ----- GDBusObjectManagerClientClass ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GDBusObjectManagerClient,interface_proxy_signal, void, (void* manager, void* object_proxy, void* interface_proxy, void* sender_name, void* signal_name, void* parameters), 6, manager, object_proxy, interface_proxy, sender_name, signal_name, parameters);
-WRAPPER(GDBusObjectManagerClient,interface_proxy_properties_changed, void, (void* manager, void* object_proxy, void* interface_proxy, void* changed_properties, void* invalidated_properties), 5, manager, object_proxy, interface_proxy, changed_properties, invalidated_properties);
+WRAPPER(GDBusObjectManagerClient,interface_proxy_signal, void, (void* manager, void* object_proxy, void* interface_proxy, void* sender_name, void* signal_name, void* parameters), "pppppp", manager, object_proxy, interface_proxy, sender_name, signal_name, parameters);
+WRAPPER(GDBusObjectManagerClient,interface_proxy_properties_changed, void, (void* manager, void* object_proxy, void* interface_proxy, void* changed_properties, void* invalidated_properties), "ppppp", manager, object_proxy, interface_proxy, changed_properties, invalidated_properties);
#define SUPERGO() \
GO(interface_proxy_signal, vFpppppp); \
@@ -1022,7 +1411,7 @@ static void wrapGDBusObjectManagerClientClass(my_GDBusObjectManagerClientClass_t
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGDBusObjectManagerClientClass(my_GDBusObjectManagerClientClass_t* class)
-{
+{
unwrapGObjectClass(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GDBusObjectManagerClient (class->A)
SUPERGO()
@@ -1041,12 +1430,12 @@ static void bridgeGDBusObjectManagerClientClass(my_GDBusObjectManagerClientClass
// ----- GtkButton2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkButton2, pressed, void, (void* button), 1, button);
-WRAPPER(GtkButton2, released, void, (void* button), 1, button);
-WRAPPER(GtkButton2, clicked, void, (void* button), 1, button);
-WRAPPER(GtkButton2, enter, void, (void* button), 1, button);
-WRAPPER(GtkButton2, leave, void, (void* button), 1, button);
-WRAPPER(GtkButton2, activate, void, (void* button), 1, button);
+WRAPPER(GtkButton2, pressed, void, (void* button), "p", button);
+WRAPPER(GtkButton2, released, void, (void* button), "p", button);
+WRAPPER(GtkButton2, clicked, void, (void* button), "p", button);
+WRAPPER(GtkButton2, enter, void, (void* button), "p", button);
+WRAPPER(GtkButton2, leave, void, (void* button), "p", button);
+WRAPPER(GtkButton2, activate, void, (void* button), "p", button);
#define SUPERGO() \
GO(pressed, vFp); \
@@ -1067,7 +1456,7 @@ static void wrapGtkButton2Class(my_GtkButton2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkButton2Class(my_GtkButton2Class_t* class)
-{
+{
unwrapGtkBin2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkButton2 (class->A)
SUPERGO()
@@ -1084,10 +1473,55 @@ static void bridgeGtkButton2Class(my_GtkButton2Class_t* class)
#undef SUPERGO
+// ----- GtkButton3Class ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GtkButton3, pressed, void, (void* button), "p", button);
+WRAPPER(GtkButton3, released, void, (void* button), "p", button);
+WRAPPER(GtkButton3, clicked, void, (void* button), "p", button);
+WRAPPER(GtkButton3, enter, void, (void* button), "p", button);
+WRAPPER(GtkButton3, leave, void, (void* button), "p", button);
+WRAPPER(GtkButton3, activate, void, (void* button), "p", button);
+
+#define SUPERGO() \
+ GO(pressed, vFp); \
+ GO(released, vFp); \
+ GO(clicked, vFp); \
+ GO(enter, vFp); \
+ GO(leave, vFp); \
+ GO(activate, vFp); \
+
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkButton3Class(my_GtkButton3Class_t* class)
+{
+ wrapGtkBin3Class(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkButton3 (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkButton3Class(my_GtkButton3Class_t* class)
+{
+ unwrapGtkBin3Class(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkButton3 (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkButton3Class(my_GtkButton3Class_t* class)
+{
+ bridgeGtkBin3Class(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkButton3 (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
// ----- GtkComboBox2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkComboBox2, changed, void, (void* combo_box), 1, combo_box);
-WRAPPER(GtkComboBox2, get_active_text, void*, (void* combo_box), 1, combo_box);
+WRAPPER(GtkComboBox2, changed, void, (void* combo_box), "p", combo_box);
+WRAPPER(GtkComboBox2, get_active_text, void*, (void* combo_box), "p", combo_box);
#define SUPERGO() \
GO(changed, vFp); \
@@ -1104,7 +1538,7 @@ static void wrapGtkComboBox2Class(my_GtkComboBox2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkComboBox2Class(my_GtkComboBox2Class_t* class)
-{
+{
unwrapGtkBin2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkComboBox2 (class->A)
SUPERGO()
@@ -1123,7 +1557,7 @@ static void bridgeGtkComboBox2Class(my_GtkComboBox2Class_t* class)
// ----- GtkToggleButton2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkToggleButton2, toggled, void, (void* toggle_button), 1, toggle_button);
+WRAPPER(GtkToggleButton2, toggled, void, (void* toggle_button), "p", toggle_button);
#define SUPERGO() \
GO(toggled, vFp); \
@@ -1139,7 +1573,7 @@ static void wrapGtkToggleButton2Class(my_GtkToggleButton2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkToggleButton2Class(my_GtkToggleButton2Class_t* class)
-{
+{
unwrapGtkButton2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkToggleButton2 (class->A)
SUPERGO()
@@ -1158,7 +1592,7 @@ static void bridgeGtkToggleButton2Class(my_GtkToggleButton2Class_t* class)
// ----- GtkCheckButton2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkCheckButton2, draw_indicator, void, (void* check_button, void* area), 2, check_button, area);
+WRAPPER(GtkCheckButton2, draw_indicator, void, (void* check_button, void* area), "pp", check_button, area);
#define SUPERGO() \
GO(draw_indicator, vFpp); \
@@ -1174,7 +1608,7 @@ static void wrapGtkCheckButton2Class(my_GtkCheckButton2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkCheckButton2Class(my_GtkCheckButton2Class_t* class)
-{
+{
unwrapGtkToggleButton2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkCheckButton2 (class->A)
SUPERGO()
@@ -1193,17 +1627,17 @@ static void bridgeGtkCheckButton2Class(my_GtkCheckButton2Class_t* class)
// ----- GtkEntry2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkEntry2, populate_popup, void, (void* entry, void* menu), 2, entry, menu);
-WRAPPER(GtkEntry2, activate, void, (void* entry), 1, entry);
-WRAPPER(GtkEntry2, move_cursor, void, (void* entry, int step, int count, int extend_selection), 4, entry, step, count, extend_selection);
-WRAPPER(GtkEntry2, insert_at_cursor, void, (void* entry, void* str), 2, entry, str);
-WRAPPER(GtkEntry2, delete_from_cursor, void, (void* entry, size_t type, int count), 3, entry, type, count);
-WRAPPER(GtkEntry2, backspace, void, (void* entry), 1, entry);
-WRAPPER(GtkEntry2, cut_clipboard, void, (void* entry), 1, entry);
-WRAPPER(GtkEntry2, copy_clipboard, void, (void* entry), 1, entry);
-WRAPPER(GtkEntry2, paste_clipboard, void, (void* entry), 1, entry);
-WRAPPER(GtkEntry2, toggle_overwrite, void, (void* entry), 1, entry);
-WRAPPER(GtkEntry2, get_text_area_size, void, (void* entry, void* x, void* y, void* width, void* height), 5, entry, x, y, width, height);
+WRAPPER(GtkEntry2, populate_popup, void, (void* entry, void* menu), "pp", entry, menu);
+WRAPPER(GtkEntry2, activate, void, (void* entry), "p", entry);
+WRAPPER(GtkEntry2, move_cursor, void, (void* entry, int step, int count, int extend_selection), "piii", entry, step, count, extend_selection);
+WRAPPER(GtkEntry2, insert_at_cursor, void, (void* entry, void* str), "pp", entry, str);
+WRAPPER(GtkEntry2, delete_from_cursor, void, (void* entry, size_t type, int count), "pLi", entry, type, count);
+WRAPPER(GtkEntry2, backspace, void, (void* entry), "p", entry);
+WRAPPER(GtkEntry2, cut_clipboard, void, (void* entry), "p", entry);
+WRAPPER(GtkEntry2, copy_clipboard, void, (void* entry), "p", entry);
+WRAPPER(GtkEntry2, paste_clipboard, void, (void* entry), "p", entry);
+WRAPPER(GtkEntry2, toggle_overwrite, void, (void* entry), "p", entry);
+WRAPPER(GtkEntry2, get_text_area_size, void, (void* entry, void* x, void* y, void* width, void* height), "ppppp", entry, x, y, width, height);
#define SUPERGO() \
GO(populate_popup, vFpp); \
@@ -1228,7 +1662,7 @@ static void wrapGtkEntry2Class(my_GtkEntry2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkEntry2Class(my_GtkEntry2Class_t* class)
-{
+{
unwrapGtkWidget2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkEntry2 (class->A)
SUPERGO()
@@ -1247,11 +1681,11 @@ static void bridgeGtkEntry2Class(my_GtkEntry2Class_t* class)
// ----- GtkSpinButton2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkSpinButton2, input, int, (void* spin_button, void* new_value), 2, spin_button, new_value);
-WRAPPER(GtkSpinButton2, output, int, (void* spin_button), 1, spin_button);
-WRAPPER(GtkSpinButton2, value_changed, void, (void* spin_button), 1, spin_button);
-WRAPPER(GtkSpinButton2, change_value, void, (void* spin_button, int scroll), 2, spin_button, scroll);
-WRAPPER(GtkSpinButton2, wrapped, void, (void* spin_button), 1, spin_button);
+WRAPPER(GtkSpinButton2, input, int, (void* spin_button, void* new_value), "pp", spin_button, new_value);
+WRAPPER(GtkSpinButton2, output, int, (void* spin_button), "p", spin_button);
+WRAPPER(GtkSpinButton2, value_changed, void, (void* spin_button), "p", spin_button);
+WRAPPER(GtkSpinButton2, change_value, void, (void* spin_button, int scroll), "pi", spin_button, scroll);
+WRAPPER(GtkSpinButton2, wrapped, void, (void* spin_button), "p", spin_button);
#define SUPERGO() \
GO(input, iFpp); \
@@ -1270,7 +1704,7 @@ static void wrapGtkSpinButton2Class(my_GtkSpinButton2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkSpinButton2Class(my_GtkSpinButton2Class_t* class)
-{
+{
unwrapGtkEntry2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkSpinButton2 (class->A)
SUPERGO()
@@ -1289,9 +1723,9 @@ static void bridgeGtkSpinButton2Class(my_GtkSpinButton2Class_t* class)
// ----- GtkProgress2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkProgress2, paint, void, (void* progress), 1, progress);
-WRAPPER(GtkProgress2, update, void, (void* progress), 1, progress);
-WRAPPER(GtkProgress2, act_mode_enter, void, (void* progress), 1, progress);
+WRAPPER(GtkProgress2, paint, void, (void* progress), "p", progress);
+WRAPPER(GtkProgress2, update, void, (void* progress), "p", progress);
+WRAPPER(GtkProgress2, act_mode_enter, void, (void* progress), "p", progress);
#define SUPERGO() \
GO(paint, vFp); \
@@ -1308,7 +1742,7 @@ static void wrapGtkProgress2Class(my_GtkProgress2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkProgress2Class(my_GtkProgress2Class_t* class)
-{
+{
unwrapGtkWidget2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkProgress2 (class->A)
SUPERGO()
@@ -1340,7 +1774,7 @@ static void wrapGtkProgressBar2Class(my_GtkProgressBar2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkProgressBar2Class(my_GtkProgressBar2Class_t* class)
-{
+{
unwrapGtkProgress2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkProgressBar2 (class->A)
SUPERGO()
@@ -1359,7 +1793,7 @@ static void bridgeGtkProgressBar2Class(my_GtkProgressBar2Class_t* class)
// ----- GtkFrame2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkFrame2, compute_child_allocation, void, (void* frame, void* allocation), 2, frame, allocation);
+WRAPPER(GtkFrame2, compute_child_allocation, void, (void* frame, void* allocation), "pp", frame, allocation);
#define SUPERGO() \
GO(compute_child_allocation, vFpp); \
@@ -1374,7 +1808,7 @@ static void wrapGtkFrame2Class(my_GtkFrame2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkFrame2Class(my_GtkFrame2Class_t* class)
-{
+{
unwrapGtkBin2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkFrame2 (class->A)
SUPERGO()
@@ -1393,15 +1827,15 @@ static void bridgeGtkFrame2Class(my_GtkFrame2Class_t* class)
// ----- GtkMenuShell2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkMenuShell2,deactivate, void, (void* menu_shell), 1, menu_shell);
-WRAPPER(GtkMenuShell2,selection_done, void, (void* menu_shell), 1, menu_shell);
-WRAPPER(GtkMenuShell2,move_current, void, (void* menu_shell, int direction), 2, menu_shell, direction);
-WRAPPER(GtkMenuShell2,activate_current, void,(void* menu_shell, int force_hide), 2, menu_shell, force_hide);
-WRAPPER(GtkMenuShell2,cancel, void, (void* menu_shell), 1, menu_shell);
-WRAPPER(GtkMenuShell2,select_item, void, (void* menu_shell, void* menu_item), 2, menu_shell, menu_item);
-WRAPPER(GtkMenuShell2,insert, void, (void* menu_shell, void* child, int position), 3, menu_shell, child, position);
-WRAPPER(GtkMenuShell2,get_popup_delay, int, (void* menu_shell), 1, menu_shell);
-WRAPPER(GtkMenuShell2,move_selected, int, (void* menu_shell, int distance), 2, menu_shell, distance);
+WRAPPER(GtkMenuShell2,deactivate, void, (void* menu_shell), "p", menu_shell);
+WRAPPER(GtkMenuShell2,selection_done, void, (void* menu_shell), "p", menu_shell);
+WRAPPER(GtkMenuShell2,move_current, void, (void* menu_shell, int direction), "pi", menu_shell, direction);
+WRAPPER(GtkMenuShell2,activate_current, void,(void* menu_shell, int force_hide), "pi", menu_shell, force_hide);
+WRAPPER(GtkMenuShell2,cancel, void, (void* menu_shell), "p", menu_shell);
+WRAPPER(GtkMenuShell2,select_item, void, (void* menu_shell, void* menu_item), "pp", menu_shell, menu_item);
+WRAPPER(GtkMenuShell2,insert, void, (void* menu_shell, void* child, int position), "ppi", menu_shell, child, position);
+WRAPPER(GtkMenuShell2,get_popup_delay, int, (void* menu_shell), "p", menu_shell);
+WRAPPER(GtkMenuShell2,move_selected, int, (void* menu_shell, int distance), "pi", menu_shell, distance);
#define SUPERGO() \
GO(deactivate, vFp); \
@@ -1424,7 +1858,7 @@ static void wrapGtkMenuShell2Class(my_GtkMenuShell2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkMenuShell2Class(my_GtkMenuShell2Class_t* class)
-{
+{
unwrapGtkContainer2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkMenuShell2 (class->A)
SUPERGO()
@@ -1456,7 +1890,7 @@ static void wrapGtkMenuBar2Class(my_GtkMenuBar2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkMenuBar2Class(my_GtkMenuBar2Class_t* class)
-{
+{
unwrapGtkMenuShell2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkMenuBar2 (class->A)
SUPERGO()
@@ -1475,19 +1909,19 @@ static void bridgeGtkMenuBar2Class(my_GtkMenuBar2Class_t* class)
// ----- GtkTextView2Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkTextView2, set_scroll_adjustments, void, (void* text_view, void* hadjustment, void* vadjustment), 3, text_view, hadjustment, vadjustment);
-WRAPPER(GtkTextView2, populate_popup, void, (void* text_view, void* menu), 2, text_view, menu);
-WRAPPER(GtkTextView2, move_cursor, void, (void* text_view, int step, int count, int extend_selection), 4, text_view, step, count, extend_selection);
-WRAPPER(GtkTextView2, page_horizontally, void, (void* text_view, int count, int extend_selection), 3, text_view, count, extend_selection);
-WRAPPER(GtkTextView2, set_anchor, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView2, insert_at_cursor, void, (void* text_view, void* str), 2, text_view, str);
-WRAPPER(GtkTextView2, delete_from_cursor, void, (void* text_view, int type, int count), 3, text_view, type, count);
-WRAPPER(GtkTextView2, backspace, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView2, cut_clipboard, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView2, copy_clipboard, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView2, paste_clipboard, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView2, toggle_overwrite, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView2, move_focus, void, (void* text_view, int direction), 2, text_view, direction);
+WRAPPER(GtkTextView2, set_scroll_adjustments, void, (void* text_view, void* hadjustment, void* vadjustment), "ppp", text_view, hadjustment, vadjustment);
+WRAPPER(GtkTextView2, populate_popup, void, (void* text_view, void* menu), "pp", text_view, menu);
+WRAPPER(GtkTextView2, move_cursor, void, (void* text_view, int step, int count, int extend_selection), "piii", text_view, step, count, extend_selection);
+WRAPPER(GtkTextView2, page_horizontally, void, (void* text_view, int count, int extend_selection), "pii", text_view, count, extend_selection);
+WRAPPER(GtkTextView2, set_anchor, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView2, insert_at_cursor, void, (void* text_view, void* str), "pp", text_view, str);
+WRAPPER(GtkTextView2, delete_from_cursor, void, (void* text_view, int type, int count), "pii", text_view, type, count);
+WRAPPER(GtkTextView2, backspace, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView2, cut_clipboard, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView2, copy_clipboard, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView2, paste_clipboard, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView2, toggle_overwrite, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView2, move_focus, void, (void* text_view, int direction), "pi", text_view, direction);
#define SUPERGO() \
GO(set_scroll_adjustments, vFppp); \
@@ -1514,7 +1948,7 @@ static void wrapGtkTextView2Class(my_GtkTextView2Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkTextView2Class(my_GtkTextView2Class_t* class)
-{
+{
unwrapGtkContainer2Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkTextView2 (class->A)
SUPERGO()
@@ -1533,20 +1967,20 @@ static void bridgeGtkTextView2Class(my_GtkTextView2Class_t* class)
// ----- GtkTextView3Class ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GtkTextView3, populate_popup, void, (void* text_view, void* menu), 2, text_view, menu);
-WRAPPER(GtkTextView3, move_cursor, void, (void* text_view, int step, int count, int extend_selection), 4, text_view, step, count, extend_selection);
-WRAPPER(GtkTextView3, set_anchor, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView3, insert_at_cursor, void, (void* text_view, void* str), 2, text_view, str);
-WRAPPER(GtkTextView3, delete_from_cursor, void, (void* text_view, int type, int count), 3, text_view, type, count);
-WRAPPER(GtkTextView3, backspace, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView3, cut_clipboard, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView3, copy_clipboard, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView3, paste_clipboard, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView3, toggle_overwrite, void, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView3, create_buffer, void*, (void* text_view), 1, text_view);
-WRAPPER(GtkTextView3, draw_layer, void, (void* text_view, int layer, void* cr), 3, text_view, layer, cr);
-WRAPPER(GtkTextView3, extend_selection, int, (void* text_view, int granularity, void* location, void* start, void* end), 5, text_view, granularity, location, start, end);
-WRAPPER(GtkTextView3, insert_emoji, void, (void* text_view), 1, text_view);
+WRAPPER(GtkTextView3, populate_popup, void, (void* text_view, void* menu), "pp", text_view, menu);
+WRAPPER(GtkTextView3, move_cursor, void, (void* text_view, int step, int count, int extend_selection), "piii", text_view, step, count, extend_selection);
+WRAPPER(GtkTextView3, set_anchor, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView3, insert_at_cursor, void, (void* text_view, void* str), "pp", text_view, str);
+WRAPPER(GtkTextView3, delete_from_cursor, void, (void* text_view, int type, int count), "pii", text_view, type, count);
+WRAPPER(GtkTextView3, backspace, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView3, cut_clipboard, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView3, copy_clipboard, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView3, paste_clipboard, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView3, toggle_overwrite, void, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView3, create_buffer, void*, (void* text_view), "p", text_view);
+WRAPPER(GtkTextView3, draw_layer, void, (void* text_view, int layer, void* cr), "pip", text_view, layer, cr);
+WRAPPER(GtkTextView3, extend_selection, int, (void* text_view, int granularity, void* location, void* start, void* end), "pippp", text_view, granularity, location, start, end);
+WRAPPER(GtkTextView3, insert_emoji, void, (void* text_view), "p", text_view);
#define SUPERGO() \
GO(populate_popup, vFpp); \
@@ -1574,7 +2008,7 @@ static void wrapGtkTextView3Class(my_GtkTextView3Class_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGtkTextView3Class(my_GtkTextView3Class_t* class)
-{
+{
unwrapGtkContainer3Class(&class->parent_class);
#define GO(A, W) class->A = find_##A##_GtkTextView3 (class->A)
SUPERGO()
@@ -1591,34 +2025,207 @@ static void bridgeGtkTextView3Class(my_GtkTextView3Class_t* class)
#undef SUPERGO
+// ----- GtkGrid3Class ------
+// no wrapper x86 -> natives of callbacks
+
+#define SUPERGO() \
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkGrid3Class(my_GtkGrid3Class_t* class)
+{
+ wrapGtkContainer3Class(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkGrid3 (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkGrid3Class(my_GtkGrid3Class_t* class)
+{
+ unwrapGtkContainer3Class(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkGrid3 (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkGrid3Class(my_GtkGrid3Class_t* class)
+{
+ bridgeGtkContainer3Class(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkGrid3 (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
+// ----- GtkEventControllerClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GtkEventController, set_widget, void, (void* controller, void* widget), "pp", controller, widget);
+WRAPPER(GtkEventController, unset_widget, void, (void* controller), "p", controller);
+WRAPPER(GtkEventController, handle_event, int, (void *controller, void *event, double x, double y), "ppdd", controller, event, x, y);
+WRAPPER(GtkEventController, reset, void, (void* controller), "p", controller);
+WRAPPER(GtkEventController, handle_crossing, void, (void *controller, void *crossing, double x, double y), "ppdd", controller, crossing, x, y);
+WRAPPER(GtkEventController, filter_event, void, (void *controller, void *event), "pp", controller, event);
+
+#define SUPERGO() \
+ GO(set_widget, vFpp); \
+ GO(unset_widget, vFp); \
+ GO(handle_event, iFppdd); \
+ GO(reset, vFp); \
+ GO(handle_crossing, vFppdd);\
+ GO(filter_event, vFpp);
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkEventControllerClass(my_GtkEventControllerClass_t* class)
+{
+ wrapGObjectClass(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkEventController(W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkEventControllerClass(my_GtkEventControllerClass_t* class)
+{
+ unwrapGObjectClass(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkEventController (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkEventControllerClass(my_GtkEventControllerClass_t* class)
+{
+ bridgeGObjectClass(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkEventController (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
+// ----- GtkGestureClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GtkGesture, check, void, (void* gesture), "p", gesture);
+WRAPPER(GtkGesture, begin, void, (void *gesture, void *sequence), "pp", gesture, sequence);
+WRAPPER(GtkGesture, update, void, (void *gesture, void *sequence), "pp", gesture, sequence);
+WRAPPER(GtkGesture, end, void, (void *gesture, void *sequence), "pp", gesture, sequence);
+WRAPPER(GtkGesture, cancel, void, (void *gesture, void *sequence), "pp", gesture, sequence);
+WRAPPER(GtkGesture, sequence_state_changed, void, (void *gesture, void *sequence, int state), "ppi", gesture, sequence, state);
+
+#define SUPERGO() \
+ GO(check, vFp); \
+ GO(begin, vFpp); \
+ GO(update, vFpp); \
+ GO(end, vFpp); \
+ GO(cancel, vFpp); \
+ GO(sequence_state_changed, vFppi);
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkGestureClass(my_GtkGestureClass_t* class)
+{
+ wrapGtkEventControllerClass(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkGesture(W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkGestureClass(my_GtkGestureClass_t* class)
+{
+ unwrapGtkEventControllerClass(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkGesture (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkGestureClass(my_GtkGestureClass_t* class)
+{
+ bridgeGtkEventControllerClass(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkGesture (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
+// ----- GtkGestureSingleClass ------
+// wrap (so bridge all calls, just in case)
+static void wrapGtkGestureSingleClass(my_GtkGestureSingleClass_t* class)
+{
+ wrapGtkGestureClass(&class->parent_class);
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkGestureSingleClass(my_GtkGestureSingleClass_t* class)
+{
+ unwrapGtkGestureClass(&class->parent_class);
+}
+// autobridge
+static void bridgeGtkGestureSingleClass(my_GtkGestureSingleClass_t* class)
+{
+ bridgeGtkGestureClass(&class->parent_class);
+}
+
+// ----- GtkGestureClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GtkGestureLongPress, pressed, void, (void *gesture, double x, double y), "pdd", gesture, x, y);
+WRAPPER(GtkGestureLongPress, cancelled, void, (void *cancelled), "p", cancelled);
+
+#define SUPERGO() \
+ GO(pressed, vFpdd); \
+ GO(cancelled, vFp);
+
+// wrap (so bridge all calls, just in case)
+static void wrapGtkGestureLongPressClass(my_GtkGestureLongPressClass_t* class)
+{
+ wrapGtkGestureSingleClass(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GtkGestureLongPress(W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGtkGestureLongPressClass(my_GtkGestureLongPressClass_t* class)
+{
+ unwrapGtkGestureSingleClass(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GtkGestureLongPress (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGtkGestureLongPressClass(my_GtkGestureLongPressClass_t* class)
+{
+ bridgeGtkGestureSingleClass(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GtkGestureLongPress (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
// ----- AtkObjectClass ------
// wrapper x86 -> natives of callbacks
-WRAPPER(AtkObject, get_name, void*, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, get_description, void*, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, get_parent, void*, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, get_n_children, int, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, ref_child, void*, (void* accessible, int i), 2, accessible, i);
-WRAPPER(AtkObject, get_index_in_parent, int, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, ref_relation_set, void*, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, get_role, int, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, get_layer, int, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, get_mdi_zorder, int, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, ref_state_set, void*, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, set_name, void, (void* accessible, void* name), 2, accessible, name);
-WRAPPER(AtkObject, set_description, void, (void* accessible, void* description), 2, accessible, description);
-WRAPPER(AtkObject, set_parent, void, (void* accessible, void* parent), 2, accessible, parent);
-WRAPPER(AtkObject, set_role, void, (void* accessible, int role), 2, accessible, role);
-WRAPPER(AtkObject, connect_property_change_handler, uint32_t, (void* accessible, void* handler), 2, accessible, AddCheckBridge(my_bridge, vFpp, handler, 0, NULL));
-WRAPPER(AtkObject, remove_property_change_handler, void, (void* accessible, uint32_t handler_id), 2, accessible, handler_id);
-WRAPPER(AtkObject, initialize, void, (void* accessible, void* data), 2, accessible, data);
-WRAPPER(AtkObject, children_changed, void, (void* accessible, uint32_t change_index, void* changed_child), 3, accessible, change_index, changed_child);
-WRAPPER(AtkObject, focus_event, void, (void* accessible, int focus_in), 2, accessible, focus_in);
-WRAPPER(AtkObject, property_change, void, (void* accessible, void* values), 2, accessible, values);
-WRAPPER(AtkObject, state_change, void, (void* accessible, void* name, int state_set), 3, accessible, name, state_set);
-WRAPPER(AtkObject, visible_data_changed, void, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, active_descendant_changed, void, (void* accessible, void* child), 2, accessible, child);
-WRAPPER(AtkObject, get_attributes, void*, (void* accessible), 1, accessible);
-WRAPPER(AtkObject, get_object_locale, void*, (void* accessible), 1, accessible);
+WRAPPER(AtkObject, get_name, void*, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, get_description, void*, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, get_parent, void*, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, get_n_children, int, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, ref_child, void*, (void* accessible, int i), "pi", accessible, i);
+WRAPPER(AtkObject, get_index_in_parent, int, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, ref_relation_set, void*, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, get_role, int, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, get_layer, int, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, get_mdi_zorder, int, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, ref_state_set, void*, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, set_name, void, (void* accessible, void* name), "pp", accessible, name);
+WRAPPER(AtkObject, set_description, void, (void* accessible, void* description), "pp", accessible, description);
+WRAPPER(AtkObject, set_parent, void, (void* accessible, void* parent), "pp", accessible, parent);
+WRAPPER(AtkObject, set_role, void, (void* accessible, int role), "pi", accessible, role);
+WRAPPER(AtkObject, connect_property_change_handler, uint32_t, (void* accessible, void* handler), "pp", accessible, AddCheckBridge(my_bridge, vFpp, handler, 0, NULL));
+WRAPPER(AtkObject, remove_property_change_handler, void, (void* accessible, uint32_t handler_id), "pu", accessible, handler_id);
+WRAPPER(AtkObject, initialize, void, (void* accessible, void* data), "pp", accessible, data);
+WRAPPER(AtkObject, children_changed, void, (void* accessible, uint32_t change_index, void* changed_child), "pup", accessible, change_index, changed_child);
+WRAPPER(AtkObject, focus_event, void, (void* accessible, int focus_in), "pi", accessible, focus_in);
+WRAPPER(AtkObject, property_change, void, (void* accessible, void* values), "pp", accessible, values);
+WRAPPER(AtkObject, state_change, void, (void* accessible, void* name, int state_set), "ppi", accessible, name, state_set);
+WRAPPER(AtkObject, visible_data_changed, void, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, active_descendant_changed, void, (void* accessible, void* child), "pp", accessible, child);
+WRAPPER(AtkObject, get_attributes, void*, (void* accessible), "p", accessible);
+WRAPPER(AtkObject, get_object_locale, void*, (void* accessible), "p", accessible);
#define SUPERGO() \
GO(get_name, pFp); \
@@ -1658,7 +2265,7 @@ static void wrapAtkObjectClass(my_AtkObjectClass_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapAtkObjectClass(my_AtkObjectClass_t* class)
-{
+{
unwrapGObjectClass(&class->parent);
#define GO(A, W) class->A = find_##A##_AtkObject (class->A)
SUPERGO()
@@ -1677,13 +2284,13 @@ static void bridgeAtkObjectClass(my_AtkObjectClass_t* class)
// ----- AtkUtilClass ------
// wrapper x86 -> natives of callbacks
-WRAPPER(AtkUtil,add_global_event_listener, uint32_t,(void* listener, void* event_type), 2, AddCheckBridge(my_bridge, iFpupp, listener, 0, NULL), event_type);
-WRAPPER(AtkUtil,remove_global_event_listener, void ,(uint32_t listener_id), 1, listener_id);
-WRAPPER(AtkUtil,add_key_event_listener, uint32_t ,(void* listener, void* data), 2, AddCheckBridge(my_bridge, iFpp, listener, 0, NULL), data);
-WRAPPER(AtkUtil,remove_key_event_listener, void ,(uint32_t listener_id), 1, listener_id);
-WRAPPER(AtkUtil,get_root, void* ,(void), 0, 0);
-WRAPPER(AtkUtil,get_toolkit_name, void* ,(void), 0, 0);
-WRAPPER(AtkUtil,get_toolkit_version, void* ,(void), 0, 0);
+WRAPPER(AtkUtil,add_global_event_listener, uint32_t,(void* listener, void* event_type), "pp", AddCheckBridge(my_bridge, iFpupp, listener, 0, NULL), event_type);
+WRAPPER(AtkUtil,remove_global_event_listener, void ,(uint32_t listener_id), "u", listener_id);
+WRAPPER(AtkUtil,add_key_event_listener, uint32_t ,(void* listener, void* data), "pp", AddCheckBridge(my_bridge, iFpp, listener, 0, NULL), data);
+WRAPPER(AtkUtil,remove_key_event_listener, void ,(uint32_t listener_id), "u", listener_id);
+WRAPPER(AtkUtil,get_root, void* ,(void), "", 0);
+WRAPPER(AtkUtil,get_toolkit_name, void* ,(void), "", 0);
+WRAPPER(AtkUtil,get_toolkit_version, void* ,(void), "", 0);
#define SUPERGO() \
GO(add_global_event_listener, uFpp); \
@@ -1704,7 +2311,7 @@ static void wrapAtkUtilClass(my_AtkUtilClass_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapAtkUtilClass(my_AtkUtilClass_t* class)
-{
+{
unwrapGObjectClass(&class->parent);
#define GO(A, W) class->A = find_##A##_AtkUtil (class->A)
SUPERGO()
@@ -1723,7 +2330,7 @@ static void bridgeAtkUtilClass(my_AtkUtilClass_t* class)
// ----- GstObjectClass ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GstObject, deep_notify, void, (void* object, void* origin, void* pspec), 3, object, origin, pspec);
+WRAPPER(GstObject, deep_notify, void, (void* object, void* origin, void* pspec), "ppp", object, origin, pspec);
#define SUPERGO() \
GO(deep_notify, vFppp); \
@@ -1738,7 +2345,7 @@ static void wrapGstObjectClass(my_GstObjectClass_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGstObjectClass(my_GstObjectClass_t* class)
-{
+{
unwrapGInitiallyUnownedClass(&class->parent);
#define GO(A, W) class->A = find_##A##_GstObject (class->A)
SUPERGO()
@@ -1757,8 +2364,8 @@ static void bridgeGstObjectClass(my_GstObjectClass_t* class)
// ----- GstAllocatorClass ------
// wrapper x86 -> natives of callbacks
-WRAPPER(GstAllocator, alloc, void*, (void *allocator, size_t size, void *params), 3, allocator, size, params);
-WRAPPER(GstAllocator,free, void, (void *allocator, void *memory), 2, allocator, memory);
+WRAPPER(GstAllocator, alloc, void*, (void *allocator, size_t size, void *params), "pLp", allocator, size, params);
+WRAPPER(GstAllocator,free, void, (void *allocator, void *memory), "pp", allocator, memory);
#define SUPERGO() \
GO(alloc, pFpLp); \
@@ -1774,7 +2381,7 @@ static void wrapGstAllocatorClass(my_GstAllocatorClass_t* class)
}
// unwrap (and use callback if not a native call anymore)
static void unwrapGstAllocatorClass(my_GstAllocatorClass_t* class)
-{
+{
unwrapGstObjectClass(&class->parent);
#define GO(A, W) class->A = find_##A##_GstAllocator (class->A)
SUPERGO()
@@ -1791,6 +2398,84 @@ static void bridgeGstAllocatorClass(my_GstAllocatorClass_t* class)
#undef SUPERGO
+// ----- GstTaskPoolClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GstTaskPool, prepare, void, (void* pool, void* error), "pp", pool, error);
+WRAPPER(GstTaskPool, cleanup, void, (void* pool), "p", pool);
+WRAPPER(GstTaskPool, push, void*, (void* pool, void* func, void* user_data, void* error), "pppp", pool, AddCheckBridge(my_bridge, vFp, func, 0, NULL), user_data, error);
+WRAPPER(GstTaskPool, join, void, (void* pool, void* id), "pp", pool, id);
+WRAPPER(GstTaskPool, dispose_handle, void, (void* pool, void* id), "pp", pool, id);
+
+#define SUPERGO() \
+ GO(prepare, vFpp); \
+ GO(cleanup, vFp); \
+ GO(push, pFpppp); \
+ GO(join, vFpp); \
+ GO(dispose_handle, vFpp); \
+
+// wrap (so bridge all calls, just in case)
+static void wrapGstTaskPoolClass(my_GstTaskPoolClass_t* class)
+{
+ wrapGstObjectClass(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GstTaskPool (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGstTaskPoolClass(my_GstTaskPoolClass_t* class)
+{
+ unwrapGstObjectClass(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GstTaskPool (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGstTaskPoolClass(my_GstTaskPoolClass_t* class)
+{
+ bridgeGstObjectClass(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GstTaskPool (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
+// ----- GDBusProxyClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GDBusProxy, g_properties_changed, void, (void* proxy, void* changed_properties, const char* const* invalidated_properties), "ppp", proxy, changed_properties, invalidated_properties);
+WRAPPER(GDBusProxy, g_signal, void, (void* proxy, const char* sender_name, const char* signal_name, void* parameters), "pppp", proxy, sender_name, signal_name, parameters);
+
+#define SUPERGO() \
+ GO(g_properties_changed, vFppp);\
+ GO(g_signal, vFpppp); \
+
+// wrap (so bridge all calls, just in case)
+static void wrapGDBusProxyClass(my_GDBusProxyClass_t* class)
+{
+ wrapGObjectClass(&class->parent_class);
+ #define GO(A, W) class->A = reverse_##A##_GDBusProxy (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGDBusProxyClass(my_GDBusProxyClass_t* class)
+{
+ unwrapGObjectClass(&class->parent_class);
+ #define GO(A, W) class->A = find_##A##_GDBusProxy (class->A)
+ SUPERGO()
+ #undef GO
+}
+// autobridge
+static void bridgeGDBusProxyClass(my_GDBusProxyClass_t* class)
+{
+ bridgeGObjectClass(&class->parent_class);
+ #define GO(A, W) autobridge_##A##_GDBusProxy (W, class->A)
+ SUPERGO()
+ #undef GO
+}
+
+#undef SUPERGO
+
// No more wrap/unwrap
#undef WRAPPER
#undef FIND
@@ -1803,11 +2488,12 @@ static void wrapGTKClass(void* cl, size_t type)
#define GTKCLASS(A) \
if(type==my_##A) \
wrap##A##Class((my_##A##Class_t*)cl); \
- else
+ else
printf_log(LOG_DEBUG, "wrapGTKClass(%p, %zd (%s))\n", cl, type, g_type_name(type));
GTKCLASSES()
- {
+ if(type==8) {} // GInterface have no structure
+ else {
if(my_MetaFrames2==-1 && !strcmp(g_type_name(type), "MetaFrames")) {
my_MetaFrames2 = type;
wrapMetaFrames2Class((my_MetaFrames2Class_t*)cl);
@@ -1822,10 +2508,12 @@ static void unwrapGTKClass(void* cl, size_t type)
#define GTKCLASS(A) \
if(type==my_##A) \
unwrap##A##Class((my_##A##Class_t*)cl); \
- else
+ else
printf_log(LOG_DEBUG, "unwrapGTKClass(%p, %zd (%s))\n", cl, type, g_type_name(type));
GTKCLASSES()
+ if(type==8) {} // GInterface have no structure
+ else
{} // else no warning, one is enough...
#undef GTKCLASS
}
@@ -1835,11 +2523,12 @@ static void bridgeGTKClass(void* cl, size_t type)
#define GTKCLASS(A) \
if(type==my_##A) \
bridge##A##Class((my_##A##Class_t*)cl); \
- else
+ else
printf_log(LOG_DEBUG, "bridgeGTKClass(%p, %zd (%s))\n", cl, type, g_type_name(type));
GTKCLASSES()
- {
+ if(type==8) {} // GInterface have no structure
+ else {
printf_log(LOG_NONE, "Warning, AutoBridge GTK Class with unknown class type %zd (%s)\n", type, g_type_name(type));
}
#undef GTKCLASS
@@ -1869,7 +2558,8 @@ void* unwrapCopyGTKClass(void* klass, size_t type)
size_t sz = 0;
#define GTKCLASS(A) if(type==my_##A) sz = sizeof(my_##A##Class_t); else
GTKCLASSES()
- {
+ if(type==8) {} // GInterface have no structure
+ else {
printf_log(LOG_NONE, "Warning, unwrapCopyGTKClass called with unknown class type %zu (%s)\n", type, g_type_name(type));
return klass;
}
@@ -1906,7 +2596,8 @@ void* wrapCopyGTKClass(void* klass, size_t type)
int sz = 0;
#define GTKCLASS(A) if(type==my_##A) sz = sizeof(my_##A##Class_t); else
GTKCLASSES()
- {
+ if(type==8) {} // GInterface have no structure
+ else {
if(my_MetaFrames2==-1 && !strcmp(g_type_name(type), "MetaFrames")) {
my_MetaFrames2 = type;
sz = sizeof(my_MetaFrames2Class_t);
@@ -1941,10 +2632,10 @@ SUPER()
// Then the static functions callback that may be used with the structure
// value_init ...
#define GO(A) \
-static uintptr_t my_value_init_fct_##A = 0; \
-static void my_value_init_##A(void* a) \
-{ \
- RunFunction(my_context, my_value_init_fct_##A, 1, a); \
+static uintptr_t my_value_init_fct_##A = 0; \
+static void my_value_init_##A(void* a) \
+{ \
+ RunFunctionFmt(my_value_init_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -1963,10 +2654,10 @@ static void* find_value_init_Fct(void* fct)
}
// value_free ...
#define GO(A) \
-static uintptr_t my_value_free_fct_##A = 0; \
-static void my_value_free_##A(void* a) \
-{ \
- RunFunction(my_context, my_value_free_fct_##A, 1, a); \
+static uintptr_t my_value_free_fct_##A = 0; \
+static void my_value_free_##A(void* a) \
+{ \
+ RunFunctionFmt(my_value_free_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -1985,10 +2676,10 @@ static void* find_value_free_Fct(void* fct)
}
// value_copy ...
#define GO(A) \
-static uintptr_t my_value_copy_fct_##A = 0; \
-static void my_value_copy_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_value_copy_fct_##A, 2, a, b);\
+static uintptr_t my_value_copy_fct_##A = 0; \
+static void my_value_copy_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_value_copy_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -2007,10 +2698,10 @@ static void* find_value_copy_Fct(void* fct)
}
// value_peek_pointer ...
#define GO(A) \
-static uintptr_t my_value_peek_pointer_fct_##A = 0; \
-static void* my_value_peek_pointer_##A(void* a) \
-{ \
- return (void*)RunFunction(my_context, my_value_peek_pointer_fct_##A, 1, a); \
+static uintptr_t my_value_peek_pointer_fct_##A = 0; \
+static void* my_value_peek_pointer_##A(void* a) \
+{ \
+ return (void*)RunFunctionFmt(my_value_peek_pointer_fct_##A, "p", a);\
}
SUPER()
#undef GO
@@ -2029,10 +2720,10 @@ static void* find_value_peek_pointer_Fct(void* fct)
}
// collect_value ...
#define GO(A) \
-static uintptr_t my_collect_value_fct_##A = 0; \
-static void* my_collect_value_##A(void* a, uint32_t b, void* c, uint32_t d) \
-{ \
- return (void*)RunFunction(my_context, my_collect_value_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_collect_value_fct_##A = 0; \
+static void* my_collect_value_##A(void* a, uint32_t b, void* c, uint32_t d) \
+{ \
+ return (void*)RunFunctionFmt(my_collect_value_fct_##A, "pupu", a, b, c, d); \
}
SUPER()
#undef GO
@@ -2051,10 +2742,10 @@ static void* find_collect_value_Fct(void* fct)
}
// lcopy_value ...
#define GO(A) \
-static uintptr_t my_lcopy_value_fct_##A = 0; \
-static void* my_lcopy_value_##A(void* a, uint32_t b, void* c, uint32_t d) \
-{ \
- return (void*)RunFunction(my_context, my_lcopy_value_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_lcopy_value_fct_##A = 0; \
+static void* my_lcopy_value_##A(void* a, uint32_t b, void* c, uint32_t d) \
+{ \
+ return (void*)RunFunctionFmt(my_lcopy_value_fct_##A, "pupu", a, b, c, d); \
}
SUPER()
#undef GO
@@ -2098,10 +2789,10 @@ my_GTypeValueTable_t* findFreeGTypeValueTable(my_GTypeValueTable_t* fcts)
// signal2 ...
#define GO(A) \
-static uintptr_t my_signal2_fct_##A = 0; \
-static void* my_signal2_##A(void* a, void* b) \
-{ \
- return (void*)RunFunction(my_context, my_signal2_fct_##A, 2, a, b); \
+static uintptr_t my_signal2_fct_##A = 0; \
+static void* my_signal2_##A(void* a, void* b) \
+{ \
+ return (void*)RunFunctionFmt(my_signal2_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -2120,10 +2811,10 @@ static void* find_signal2_Fct(void* fct)
}
// signal3 ...
#define GO(A) \
-static uintptr_t my_signal3_fct_##A = 0; \
-static void* my_signal3_##A(void* a, void* b, void* c) \
-{ \
- return (void*)RunFunction(my_context, my_signal3_fct_##A, 3, a, b, c); \
+static uintptr_t my_signal3_fct_##A = 0; \
+static void* my_signal3_##A(void* a, void* b, void* c) \
+{ \
+ return (void*)RunFunctionFmt(my_signal3_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -2142,10 +2833,10 @@ static void* find_signal3_Fct(void* fct)
}
// signal4 ...
#define GO(A) \
-static uintptr_t my_signal4_fct_##A = 0; \
-static void* my_signal4_##A(void* a, void* b, void* c, void* d) \
-{ \
- return (void*)RunFunction(my_context, my_signal4_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_signal4_fct_##A = 0; \
+static void* my_signal4_##A(void* a, void* b, void* c, void* d) \
+{ \
+ return (void*)RunFunctionFmt(my_signal4_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -2164,10 +2855,10 @@ static void* find_signal4_Fct(void* fct)
}
// signal5 ...
#define GO(A) \
-static uintptr_t my_signal5_fct_##A = 0; \
-static void* my_signal5_##A(void* a, void* b, void* c, void* d, void* e) \
-{ \
- return (void*)RunFunction(my_context, my_signal5_fct_##A, 5, a, b, c, d, e);\
+static uintptr_t my_signal5_fct_##A = 0; \
+static void* my_signal5_##A(void* a, void* b, void* c, void* d, void* e) \
+{ \
+ return (void*)RunFunctionFmt(my_signal5_fct_##A, "ppppp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -2186,10 +2877,10 @@ static void* find_signal5_Fct(void* fct)
}
// signal6 ...
#define GO(A) \
-static uintptr_t my_signal6_fct_##A = 0; \
-static void* my_signal6_##A(void* a, void* b, void* c, void* d, void* e, void* f) \
-{ \
- return (void*)RunFunction(my_context, my_signal6_fct_##A, 6, a, b, c, d, e, f); \
+static uintptr_t my_signal6_fct_##A = 0; \
+static void* my_signal6_##A(void* a, void* b, void* c, void* d, void* e, void* f) \
+{ \
+ return (void*)RunFunctionFmt(my_signal6_fct_##A, "pppppp", a, b, c, d, e, f); \
}
SUPER()
#undef GO
@@ -2208,10 +2899,10 @@ static void* find_signal6_Fct(void* fct)
}
// signal7 ...
#define GO(A) \
-static uintptr_t my_signal7_fct_##A = 0; \
-static void* my_signal7_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g) \
-{ \
- return (void*)RunFunction(my_context, my_signal7_fct_##A, 7, a, b, c, d, e, f, g); \
+static uintptr_t my_signal7_fct_##A = 0; \
+static void* my_signal7_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g) \
+{ \
+ return (void*)RunFunctionFmt(my_signal7_fct_##A, "ppppppp", a, b, c, d, e, f, g); \
}
SUPER()
#undef GO
@@ -2300,7 +2991,7 @@ SUPER()
static uintptr_t my_base_init_fct_##A = 0; \
static int my_base_init_##A(void* a) \
{ \
- return RunFunction(my_context, my_base_init_fct_##A, 1, a); \
+ return RunFunctionFmt(my_base_init_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -2322,7 +3013,7 @@ static void* find_base_init_Fct(void* fct)
static uintptr_t my_base_finalize_fct_##A = 0; \
static int my_base_finalize_##A(void* a) \
{ \
- return RunFunction(my_context, my_base_finalize_fct_##A, 1, a); \
+ return RunFunctionFmt(my_base_finalize_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -2341,21 +3032,21 @@ static void* find_base_finalize_Fct(void* fct)
}
// class_init ...
#define GO(A) \
-static uintptr_t my_class_init_fct_##A = 0; \
-static size_t parent_class_init_##A = 0; \
-static int my_class_init_##A(void* a, void* b) \
-{ \
+static uintptr_t my_class_init_fct_##A = 0; \
+static size_t parent_class_init_##A = 0; \
+static int my_class_init_##A(void* a, void* b) \
+{ \
printf_log(LOG_DEBUG, "Custom Class init %d for class %p (parent=%p:%s)\n", A, a, (void*)parent_class_init_##A, g_type_name(parent_class_init_##A));\
- int ret = RunFunction(my_context, my_class_init_fct_##A, 2, a, b); \
- unwrapGTKClass(a, parent_class_init_##A); \
- bridgeGTKClass(a, parent_class_init_##A); \
- my_unwrap_signal_offset(a); \
- if(!strcmp(g_type_name(parent_class_init_##A), "AtkUtil")) { \
+ int ret = RunFunctionFmt(my_class_init_fct_##A, "pp", a, b);\
+ unwrapGTKClass(a, parent_class_init_##A); \
+ bridgeGTKClass(a, parent_class_init_##A); \
+ my_unwrap_signal_offset(a); \
+ if(!strcmp(g_type_name(parent_class_init_##A), "AtkUtil")) { \
my_AtkUtilClass_t* p = (my_AtkUtilClass_t*)g_type_class_peek(parent_class_init_##A);\
- unwrapGTKClass(p, parent_class_init_##A); \
- bridgeGTKClass(p, parent_class_init_##A); \
- } \
- return ret; \
+ unwrapGTKClass(p, parent_class_init_##A); \
+ bridgeGTKClass(p, parent_class_init_##A); \
+ } \
+ return ret; \
}
SUPER()
#undef GO
@@ -2374,10 +3065,10 @@ static void* find_class_init_Fct(void* fct, size_t parent)
}
// class_finalize ...
#define GO(A) \
-static uintptr_t my_class_finalize_fct_##A = 0; \
-static int my_class_finalize_##A(void* a, void* b) \
-{ \
- return RunFunction(my_context, my_class_finalize_fct_##A, 2, a, b); \
+static uintptr_t my_class_finalize_fct_##A = 0; \
+static int my_class_finalize_##A(void* a, void* b) \
+{ \
+ return RunFunctionFmt(my_class_finalize_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -2396,10 +3087,10 @@ static void* find_class_finalize_Fct(void* fct)
}
// instance_init ...
#define GO(A) \
-static uintptr_t my_instance_init_fct_##A = 0; \
-static int my_instance_init_##A(void* a, void* b) \
-{ \
- return RunFunction(my_context, my_instance_init_fct_##A, 2, a, b); \
+static uintptr_t my_instance_init_fct_##A = 0; \
+static int my_instance_init_##A(void* a, void* b) \
+{ \
+ return RunFunctionFmt(my_instance_init_fct_##A, "pp", a, b);\
}
SUPER()
#undef GO
@@ -2459,20 +3150,20 @@ static int fct_gtk_parent_##A = 0 ; \
static uintptr_t fct_gtk_class_init_##A = 0; \
static int my_gtk_class_init_##A(void* g_class) { \
printf_log(LOG_DEBUG, "Calling fct_gtk_class_init_" #A " wrapper\n"); \
- int ret = (int)RunFunction(my_context, fct_gtk_class_init_##A, 1, g_class); \
+ int ret = (int)RunFunctionFmt(fct_gtk_class_init_##A, "p", g_class);\
unwrapGTKClass(g_class, fct_gtk_parent_##A); \
bridgeGTKClass(g_class, fct_gtk_parent_##A); \
return ret; \
} \
-static uintptr_t fct_gtk_object_init_##A = 0; \
-static int my_gtk_object_init_##A(void* object, void* data) { \
- printf_log(LOG_DEBUG, "Calling fct_gtk_object_init_" #A " wrapper\n"); \
- return (int)RunFunction(my_context, fct_gtk_object_init_##A, 2, object, data); \
+static uintptr_t fct_gtk_object_init_##A = 0; \
+static int my_gtk_object_init_##A(void* object, void* data) { \
+ printf_log(LOG_DEBUG, "Calling fct_gtk_object_init_" #A " wrapper\n"); \
+ return (int)RunFunctionFmt(fct_gtk_object_init_##A, "pp", object, data);\
} \
-static uintptr_t fct_gtk_base_class_init_##A = 0; \
-static int my_gtk_base_class_init_##A(void* instance, void* data) { \
- printf_log(LOG_DEBUG, "Calling fct_gtk_base_class_init_" #A " wrapper\n"); \
- return (int)RunFunction(my_context, fct_gtk_base_class_init_##A, 2, instance, data); \
+static uintptr_t fct_gtk_base_class_init_##A = 0; \
+static int my_gtk_base_class_init_##A(void* instance, void* data) { \
+ printf_log(LOG_DEBUG, "Calling fct_gtk_base_class_init_" #A " wrapper\n"); \
+ return (int)RunFunctionFmt(fct_gtk_base_class_init_##A, "pp", instance, data); \
}
SUPER()
@@ -2588,7 +3279,7 @@ void my_signal_delete(my_signal_t* sig)
}
uintptr_t d = sig->destroy;
if(d) {
- RunFunction(my_context, d, 1, sig->data);
+ RunFunctionFmt(d, "p", sig->data);
}
printf_log(LOG_DEBUG, "gtk Data deleted, sig=%p, data=%p, destroy=%p\n", sig, sig->data, (void*)d);
box_free(sig);
@@ -2630,10 +3321,10 @@ int my_signal_cb(void* a, void* b, void* c, void* d)
}
printf_log(LOG_DEBUG, "gtk Signal called, sig=%p, NArgs=%d\n", sig, i);
switch(i) {
- case 1: return (int)RunFunction(my_context, sig->c_handler, 1, sig->data);
- case 2: return (int)RunFunction(my_context, sig->c_handler, 2, a, sig->data);
- case 3: return (int)RunFunction(my_context, sig->c_handler, 3, a, b, sig->data);
- case 4: return (int)RunFunction(my_context, sig->c_handler, 4, a, b, c, sig->data);
+ case 1: return (int)RunFunctionFmt(sig->c_handler, "p", sig->data);
+ case 2: return (int)RunFunctionFmt(sig->c_handler, "pp", a, sig->data);
+ case 3: return (int)RunFunctionFmt(sig->c_handler, "ppp", a, b, sig->data);
+ case 4: return (int)RunFunctionFmt(sig->c_handler, "pppp", a, b, c, sig->data);
}
printf_log(LOG_NONE, "Warning, Gtk signal callback but no data found!");
return 0;
diff --git a/src/tools/my_cpuid.c b/src/tools/my_cpuid.c
index 06b725a..c80a531 100644
--- a/src/tools/my_cpuid.c
+++ b/src/tools/my_cpuid.c
@@ -87,7 +87,9 @@ void my_cpuid(x64emu_t* emu, uint32_t tmp32u)
| 1<<9 // SSSE3
| 1<<12 // fma
| 1<<13 // cx16 (cmpxchg16)
+ | 1<<19 // SSE4_1
| 1<<22 // MOVBE
+ | 1<<23 // POPCOUNT
| 1<<25 // aesni
;
break;
@@ -144,8 +146,10 @@ void my_cpuid(x64emu_t* emu, uint32_t tmp32u)
R_EDX = 0;
break;
case 0x7: // extended bits...
- if(R_ECX==1) R_EAX = 0; // Bit 5 is avx512_bf16
- else R_EAX = R_ECX = R_EBX = R_EDX = 0; // TODO
+ if(R_ECX==1) {
+ R_EAX = 0; // Bit 5 is avx512_bf16
+ } else
+ R_EAX = R_ECX = R_EBX = R_EDX = 0; // TODO
break;
case 0xB: // Extended Topology Enumeration Leaf
//TODO!
diff --git a/src/tools/pathcoll.c b/src/tools/pathcoll.c
index 1ee5572..1ee5572 100755..100644
--- a/src/tools/pathcoll.c
+++ b/src/tools/pathcoll.c
diff --git a/src/tools/rcfile.c b/src/tools/rcfile.c
index 2e99bf2..e41980c 100644
--- a/src/tools/rcfile.c
+++ b/src/tools/rcfile.c
@@ -32,13 +32,22 @@ static const char default_rcfile[] =
"BOX64_CRASHHANDLER=1\n"
"BOX64_DYNAREC_STRONGMEM=1\n"
"\n"
+"[factorio]\n"
+"BOX64_DYNAREC_FASTROUND=0\n"
+"\n"
"[heroic]\n"
"BOX64_NOSANDBOX=1\n"
"BOX64_MALLOC_HACK=2\n"
"\n"
+"[LotCG.x86_64]\n"
+"BOX64_DYNAREC_FASTROUND=0\n"
+"\n"
"[pressure-vessel-wrap]\n"
"BOX64_NOGTK=1\n"
"\n"
+"[Soma.bin.x86_64]\n"
+"BOX64_DYNAREC_FASTROUND=0\n"
+"\n"
"[streaming_client]\n"
"BOX64_EMULATED_LIBS=libSDL2-2.0.so.0:libSDL2_ttf-2.0.so.0\n"
"\n"
@@ -46,7 +55,7 @@ static const char default_rcfile[] =
"BOX64_NOSANDBOX=1\n"
"BOX64_MALLOC_HACK=2\n"
"BOX64_LOG=0\n"
-"BOX64_NOGTK=1\n"
+"BOX64_DYNAREC_BIGBLOCK=0\n"
"\n"
"[steam-runtime-check-requirements]\n"
"BOX64_EXIT=1\n"
@@ -120,10 +129,13 @@ ENTRYBOOL(BOX64_DYNAREC_FASTROUND, box64_dynarec_fastround) \
ENTRYINT(BOX64_DYNAREC_SAFEFLAGS, box64_dynarec_safeflags, 0, 2, 2) \
ENTRYBOOL(BOX64_DYNAREC_CALLRET, box64_dynarec_callret) \
ENTRYBOOL(BOX64_DYNAREC_BLEEDING_EDGE, box64_dynarec_bleeding_edge) \
+ENTRYBOOL(BOX64_DYNAREC_JVM, box64_dynarec_jvm) \
ENTRYINT(BOX64_DYNAREC_HOTPAGE, box64_dynarec_hotpage, 0, 255, 8) \
ENTRYBOOL(BOX64_DYNAREC_FASTPAGE, box64_dynarec_fastpage) \
ENTRYBOOL(BOX64_DYNAREC_WAIT, box64_dynarec_wait) \
ENTRYSTRING_(BOX64_NODYNAREC, box64_nodynarec) \
+ENTRYBOOL(BOX64_DYNAREC_TEST, box64_dynarec_test) \
+ENTRYBOOL(BOX64_DYNAREC_MISSING, box64_dynarec_missing) \
#else
#define SUPER3() \
@@ -139,10 +151,13 @@ IGNORE(BOX64_DYNAREC_FASTROUND) \
IGNORE(BOX64_DYNAREC_SAFEFLAGS) \
IGNORE(BOX64_DYNAREC_CALLRET) \
IGNORE(BOX64_DYNAREC_BLEEDING_EDGE) \
+IGNORE(BOX64_DYNAREC_JVM) \
IGNORE(BOX64_DYNAREC_HOTPAGE) \
IGNORE(BOX64_DYNAREC_FASTPAGE) \
IGNORE(BOX64_DYNAREC_WAIT) \
IGNORE(BOX64_NODYNAREC) \
+IGNORE(BOX64_DYNAREC_TEST) \
+IGNORE(BOX64_DYNAREC_MISSING) \
#endif
diff --git a/src/tools/wine_tools.c b/src/tools/wine_tools.c
index 130ce92..199a0fc 100755..100644
--- a/src/tools/wine_tools.c
+++ b/src/tools/wine_tools.c
@@ -31,8 +31,8 @@ static int get_prereserve(const char* reserve, void** addr, size_t* size)
if(*reserve>='0' && *reserve<='9') r=r*16+(*reserve)-'0';
else if(*reserve>='A' && *reserve<='F') r=r*16+(*reserve)-'A'+10;
else if(*reserve>='a' && *reserve<='f') r=r*16+(*reserve)-'a'+10;
- else if(*reserve=='-') {if(first) {*addr=(void*)(r&~(box64_pagesize-1)); r=0; first=0;} else {printf_log(LOG_NONE, "Warning, Wine prereserve badly formated\n"); return 0;}}
- else {printf_log(LOG_NONE, "Warning, Wine prereserve badly formated\n"); return 0;}
+ else if(*reserve=='-') {if(first) {*addr=(void*)(r&~(box64_pagesize-1)); r=0; first=0;} else {printf_log(LOG_NONE, "Warning, Wine prereserve badly formatted\n"); return 0;}}
+ else {printf_log(LOG_NONE, "Warning, Wine prereserve badly formatted\n"); return 0;}
++reserve;
}
*size = r;
diff --git a/src/wrapped/wrappedalure.c b/src/wrapped/wrappedalure.c
index 6491903..6491903 100755..100644
--- a/src/wrapped/wrappedalure.c
+++ b/src/wrapped/wrappedalure.c
diff --git a/src/wrapped/wrappedalure_private.h b/src/wrapped/wrappedalure_private.h
index bda31cb..bda31cb 100755..100644
--- a/src/wrapped/wrappedalure_private.h
+++ b/src/wrapped/wrappedalure_private.h
diff --git a/src/wrapped/wrappedalut.c b/src/wrapped/wrappedalut.c
index a74eaa7..a74eaa7 100755..100644
--- a/src/wrapped/wrappedalut.c
+++ b/src/wrapped/wrappedalut.c
diff --git a/src/wrapped/wrappedalut_private.h b/src/wrapped/wrappedalut_private.h
index 04b403d..04b403d 100755..100644
--- a/src/wrapped/wrappedalut_private.h
+++ b/src/wrapped/wrappedalut_private.h
diff --git a/src/wrapped/wrappedatk.c b/src/wrapped/wrappedatk.c
index f785817..773212d 100755..100644
--- a/src/wrapped/wrappedatk.c
+++ b/src/wrapped/wrappedatk.c
@@ -44,7 +44,7 @@ GO(4)
static uintptr_t my_AtkEventListenerInit_fct_##A = 0; \
static void my_AtkEventListenerInit_##A() \
{ \
- RunFunction(my_context, my_AtkEventListenerInit_fct_##A, 0); \
+ RunFunctionFmt(my_AtkEventListenerInit_fct_##A, ""); \
}
SUPER()
#undef GO
@@ -66,7 +66,7 @@ static void* find_AtkEventListenerInit_Fct(void* fct)
static uintptr_t my_AtkEventListener_fct_##A = 0; \
static void my_AtkEventListener_##A(void* a) \
{ \
- RunFunction(my_context, my_AtkEventListener_fct_##A, 1, a); \
+ RunFunctionFmt(my_AtkEventListener_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -88,7 +88,7 @@ static void* find_AtkEventListener_Fct(void* fct)
static uintptr_t my_AtkKeySnoopFunc_fct_##A = 0; \
static int my_AtkKeySnoopFunc_##A(void* a, void* b) \
{ \
- return (int)RunFunction(my_context, my_AtkKeySnoopFunc_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_AtkKeySnoopFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -105,6 +105,28 @@ static void* find_AtkKeySnoopFunc_Fct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for atk AtkKeySnoopFunc callback\n");
return NULL;
}
+// GSignalEmissionHook ...
+#define GO(A) \
+static uintptr_t my_GSignalEmissionHook_fct_##A = 0; \
+static int my_GSignalEmissionHook_##A(void* a, uint32_t b, void* c, void* d) \
+{ \
+ return (int)RunFunctionFmt(my_GSignalEmissionHook_fct_##A, "pupp", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_GSignalEmissionHook_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_GSignalEmissionHook_fct_##A == (uintptr_t)fct) return my_GSignalEmissionHook_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GSignalEmissionHook_fct_##A == 0) {my_GSignalEmissionHook_fct_##A = (uintptr_t)fct; return my_GSignalEmissionHook_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for atk GSignalEmissionHook callback\n");
+ return NULL;
+}
#undef SUPER
@@ -123,6 +145,11 @@ EXPORT uint32_t my_atk_add_key_event_listener(x64emu_t* emu, void* f, void* p)
return my->atk_add_key_event_listener(find_AtkEventListener_Fct(f), p);
}
+EXPORT uint32_t my_atk_add_global_event_listener(x64emu_t* emu, void* f, void* p)
+{
+ return my->atk_add_global_event_listener(find_GSignalEmissionHook_Fct(f), p);
+}
+
#define PRE_INIT \
if(box64_nogtk) \
return -1;
diff --git a/src/wrapped/wrappedatk_private.h b/src/wrapped/wrappedatk_private.h
index 6bfd50e..ec08108 100755..100644
--- a/src/wrapped/wrappedatk_private.h
+++ b/src/wrapped/wrappedatk_private.h
@@ -9,49 +9,49 @@ GO(atk_action_get_localized_name, pFpi)
GO(atk_action_get_n_actions, iFp)
GO(atk_action_get_name, pFpi)
GO(atk_action_get_type, LFv)
-GO(atk_action_set_description, pFpi)
+GO(atk_action_set_description, iFpip)
GOM(atk_add_focus_tracker, uFEp)
-//GOM(atk_add_global_event_listener, uFEpp)
+GOM(atk_add_global_event_listener, uFEpp)
GOM(atk_add_key_event_listener, uFEpp)
-//GO(atk_attribute_set_free,
+GO(atk_attribute_set_free, vFp)
//GOM(atk_component_add_focus_handler, uFpp)
GO(atk_component_contains, iFpiii)
GO(atk_component_get_alpha, dFp)
-GO(atk_component_get_extents, vFpppppi)
-GO(atk_component_get_layer, iFp)
+GO(atk_component_get_extents, vFpppppu)
+GO(atk_component_get_layer, uFp)
GO(atk_component_get_mdi_zorder, iFp)
-GO(atk_component_get_position, vFpppi)
+GO(atk_component_get_position, vFpppu)
GO(atk_component_get_size, vFppp)
GO(atk_component_get_type, LFv)
GO(atk_component_grab_focus, iFp)
-GO(atk_component_ref_accessible_at_point, pFpiii)
+GO(atk_component_ref_accessible_at_point, pFpiiu)
GO(atk_component_remove_focus_handler, vFpu)
-GO(atk_component_scroll_to_point, iFpiii)
-GO(atk_component_set_extents, iFpiiiii)
-GO(atk_component_set_position, iFpiii)
+GO(atk_component_scroll_to_point, iFpuii)
+GO(atk_component_set_extents, iFpiiiiu)
+GO(atk_component_set_position, iFpiiu)
GO(atk_component_set_size, iFpii)
GO(atk_coord_type_get_type, LFv)
-//GO(atk_document_get_attributes,
-//GO(atk_document_get_attribute_value,
-//GO(atk_document_get_document,
+GO(atk_document_get_attributes, pFp)
+GO(atk_document_get_attribute_value, pFpp)
+GO(atk_document_get_document, pFp)
//GO(atk_document_get_document_type,
-//GO(atk_document_get_locale,
+GO(atk_document_get_locale, pFp)
GO(atk_document_get_type, LFv)
-//GO(atk_document_set_attribute_value,
+GO(atk_document_set_attribute_value, iFppp)
//GO(atk_editable_text_copy_text,
//GO(atk_editable_text_cut_text,
-//GO(atk_editable_text_delete_text,
-//GO(atk_editable_text_get_type,
-//GO(atk_editable_text_insert_text,
-//GO(atk_editable_text_paste_text,
-//GO(atk_editable_text_set_run_attributes,
-//GO(atk_editable_text_set_text_contents,
+GO(atk_editable_text_delete_text, vFpii)
+GO(atk_editable_text_get_type, LFv)
+GO(atk_editable_text_insert_text, vFppip)
+GO(atk_editable_text_paste_text, vFpi)
+GO(atk_editable_text_set_run_attributes, iFppii)
+GO(atk_editable_text_set_text_contents, vFpp)
GOM(atk_focus_tracker_init, vFEp)
GO(atk_focus_tracker_notify, vFp)
//GO(atk_get_binary_age,
GO(atk_get_default_registry, pFv)
GO(atk_get_focus_object, pFv)
-//GO(atk_get_interface_age,
+GO(atk_get_interface_age, uFv)
//GO(atk_get_major_version,
//GO(atk_get_micro_version,
//GO(atk_get_minor_version,
@@ -60,30 +60,30 @@ GO(atk_get_toolkit_name, pFv)
GO(atk_get_toolkit_version, pFv)
GO(atk_get_version, pFv)
//GO(atk_gobject_accessible_for_object,
-//GO(atk_gobject_accessible_get_object,
+GO(atk_gobject_accessible_get_object, pFp)
//GO(atk_gobject_accessible_get_type,
//GO(atk_hyperlink_get_end_index,
-//GO(atk_hyperlink_get_n_anchors,
-//GO(atk_hyperlink_get_object,
-//GO(atk_hyperlink_get_start_index,
-//GO(atk_hyperlink_get_type,
-//GO(atk_hyperlink_get_uri,
-//GO(atk_hyperlink_impl_get_hyperlink,
+GO(atk_hyperlink_get_n_anchors, iFp)
+GO(atk_hyperlink_get_object, pFpi)
+GO(atk_hyperlink_get_start_index, iFp)
+GO(atk_hyperlink_get_type, LFv)
+GO(atk_hyperlink_get_uri, pFpi)
+GO(atk_hyperlink_impl_get_hyperlink, pFp)
GO(atk_hyperlink_impl_get_type, LFv)
//GO(atk_hyperlink_is_inline,
-//GO(atk_hyperlink_is_selected_link,
+GO(atk_hyperlink_is_selected_link, iFp)
//GO(atk_hyperlink_is_valid,
//GO(atk_hyperlink_state_flags_get_type,
-//GO(atk_hypertext_get_link,
-//GO(atk_hypertext_get_link_index,
-//GO(atk_hypertext_get_n_links,
+GO(atk_hypertext_get_link, pFpi)
+GO(atk_hypertext_get_link_index, iFpi)
+GO(atk_hypertext_get_n_links, iFp)
GO(atk_hypertext_get_type, LFv)
//GO(atk_image_get_image_description,
-//GO(atk_image_get_image_locale,
-//GO(atk_image_get_image_position,
-//GO(atk_image_get_image_size,
+GO(atk_image_get_image_locale, pFp)
+GO(atk_image_get_image_position, vFpppu)
+GO(atk_image_get_image_size, vFppp)
GO(atk_image_get_type, LFv)
-//GO(atk_image_set_image_description,
+GO(atk_image_set_image_description, iFpp)
GO(atk_implementor_get_type, LFv)
GO(atk_implementor_ref_accessible, pFp)
GO(atk_key_event_type_get_type, LFv)
@@ -98,73 +98,73 @@ GO(atk_misc_threads_enter, vFp)
GO(atk_misc_threads_leave, vFp)
DATA(atk_misc_instance, sizeof(void*))
//GO(atk_no_op_object_factory_get_type,
-//GO(atk_no_op_object_factory_new,
+GO(atk_no_op_object_factory_new, pFv)
GO(atk_no_op_object_get_type, LFv)
-//GO(atk_no_op_object_new,
+GO(atk_no_op_object_new, pFp)
GO(atk_object_add_relationship, iFpip)
//GOM(atk_object_connect_property_change_handler, uFEpp)
-//GO(atk_object_factory_create_accessible,
-GO(atk_object_factory_get_accessible_type, iFp)
+GO(atk_object_factory_create_accessible, pFpp)
+GO(atk_object_factory_get_accessible_type, LFp)
GO(atk_object_factory_get_type, LFv)
//GO(atk_object_factory_invalidate,
GO(atk_object_get_attributes, pFp)
GO(atk_object_get_description, pFp)
GO(atk_object_get_index_in_parent, iFp)
-GO(atk_object_get_layer, iFp)
+GO(atk_object_get_layer, uFp)
GO(atk_object_get_mdi_zorder, iFp)
GO(atk_object_get_n_accessible_children, iFp)
GO(atk_object_get_name, pFp)
GO(atk_object_get_object_locale, pFp)
GO(atk_object_get_parent, pFp)
-GO(atk_object_get_role, iFp)
+GO(atk_object_get_role, uFp)
GO(atk_object_get_type, LFv)
GO(atk_object_initialize, vFpp)
-GO(atk_object_notify_state_change, vFpii)
+GO(atk_object_notify_state_change, vFpLi)
GO(atk_object_ref_accessible_child, pFpi)
GO(atk_object_ref_relation_set, pFp)
GO(atk_object_ref_state_set, pFp)
GO(atk_object_remove_property_change_handler, vFpu)
-GO(atk_object_remove_relationship, iFpip)
+GO(atk_object_remove_relationship, iFpup)
GO(atk_object_set_description, vFpp)
GO(atk_object_set_name, vFpp)
GO(atk_object_set_parent, vFpp)
-GO(atk_object_set_role, vFpi)
-//GO(atk_plug_get_id,
+GO(atk_object_set_role, vFpu)
+GO(atk_plug_get_id, pFp)
//GO(atk_plug_get_type,
//GO(atk_plug_new,
//GO(atk_rectangle_get_type,
-GO(atk_registry_get_factory, pFpi)
-GO(atk_registry_get_factory_type, iFpi)
+GO(atk_registry_get_factory, pFpL)
+GO(atk_registry_get_factory_type, LFpL)
//GO(atk_registry_get_type,
-GO(atk_registry_set_factory_type, vFpii)
-//GO(atk_relation_add_target,
-//GO(atk_relation_get_relation_type,
-//GO(atk_relation_get_target,
+GO(atk_registry_set_factory_type, vFpLL)
+GO(atk_relation_add_target, vFpp)
+GO(atk_relation_get_relation_type, uFp)
+GO(atk_relation_get_target, pFp)
//GO(atk_relation_get_type,
-//GO(atk_relation_new,
-//GO(atk_relation_remove_target,
-//GO(atk_relation_set_add,
-//GO(atk_relation_set_add_relation_by_type,
-//GO(atk_relation_set_contains,
-//GO(atk_relation_set_contains_target,
-//GO(atk_relation_set_get_n_relations,
-//GO(atk_relation_set_get_relation,
-//GO(atk_relation_set_get_relation_by_type,
+GO(atk_relation_new, pFpiu)
+GO(atk_relation_remove_target, iFpp)
+GO(atk_relation_set_add, vFpp)
+GO(atk_relation_set_add_relation_by_type, vFpup)
+GO(atk_relation_set_contains, iFpu)
+GO(atk_relation_set_contains_target, iFpup)
+GO(atk_relation_set_get_n_relations, iFp)
+GO(atk_relation_set_get_relation, pFpi)
+GO(atk_relation_set_get_relation_by_type, pFpu)
//GO(atk_relation_set_get_type,
-//GO(atk_relation_set_new,
+GO(atk_relation_set_new, pFv)
//GO(atk_relation_set_remove,
-//GO(atk_relation_type_for_name,
-//GO(atk_relation_type_get_name,
-//GO(atk_relation_type_get_type,
+GO(atk_relation_type_for_name, uFp)
+GO(atk_relation_type_get_name, pFu)
+GO(atk_relation_type_get_type, LFv)
//GO(atk_relation_type_register,
GO(atk_remove_focus_tracker, vFu)
GO(atk_remove_global_event_listener, vFu)
GO(atk_remove_key_event_listener, vFu)
GO(atk_role_for_name, iFp)
-GO(atk_role_get_localized_name, pFp)
+GO(atk_role_get_localized_name, pFu)
GO(atk_role_get_name, pFp)
GO(atk_role_get_type, LFv)
-GO(atk_role_register, iFp)
+GO(atk_role_register, uFp)
GO(atk_selection_add_selection, iFpi)
GO(atk_selection_clear_selection, iFp)
GO(atk_selection_get_selection_count, iFp)
@@ -173,96 +173,96 @@ GO(atk_selection_is_child_selected, iFpi)
GO(atk_selection_ref_selection, pFpi)
GO(atk_selection_remove_selection, iFpi)
GO(atk_selection_select_all_selection, iFp)
-//GO(atk_socket_embed,
-//GO(atk_socket_get_type,
-//GO(atk_socket_is_occupied,
-//GO(atk_socket_new,
-//GO(atk_state_set_add_state,
-//GO(atk_state_set_add_states,
+GO(atk_socket_embed, vFpp)
+GO(atk_socket_get_type, iFv)
+GO(atk_socket_is_occupied, iFp)
+GO(atk_socket_new, pFv)
+GO(atk_state_set_add_state, iFpi)
+GO(atk_state_set_add_states, vFppi)
//GO(atk_state_set_and_sets,
//GO(atk_state_set_clear_states,
-//GO(atk_state_set_contains_state,
-//GO(atk_state_set_contains_states,
+GO(atk_state_set_contains_state, iFpi)
+GO(atk_state_set_contains_states, iFppi)
//GO(atk_state_set_get_type,
-//GO(atk_state_set_is_empty,
-//GO(atk_state_set_new,
+GO(atk_state_set_is_empty, iFp)
+GO(atk_state_set_new, pFv)
//GO(atk_state_set_or_sets,
-//GO(atk_state_set_remove_state,
-//GO(atk_state_set_xor_sets,
-//GO(atk_state_type_for_name,
-//GO(atk_state_type_get_name,
-//GO(atk_state_type_get_type,
+GO(atk_state_set_remove_state, iFpu)
+GO(atk_state_set_xor_sets, pFpp)
+GO(atk_state_type_for_name, uFp)
+GO(atk_state_type_get_name, pFu)
+GO(atk_state_type_get_type, LFv)
//GO(atk_state_type_register,
-//GO(atk_streamable_content_get_mime_type,
-//GO(atk_streamable_content_get_n_mime_types,
+GO(atk_streamable_content_get_mime_type, pFpi)
+GO(atk_streamable_content_get_n_mime_types, iFp)
//GO(atk_streamable_content_get_stream,
//GO(atk_streamable_content_get_type,
-//GO(atk_streamable_content_get_uri,
+GO(atk_streamable_content_get_uri, pFpp)
//GO(atk_table_add_column_selection,
//GO(atk_table_add_row_selection,
-//GO(atk_table_get_caption,
+GO(atk_table_get_caption, pFp)
//GO(atk_table_get_column_at_index,
-//GO(atk_table_get_column_description,
-//GO(atk_table_get_column_extent_at,
+GO(atk_table_get_column_description, pFpi)
+GO(atk_table_get_column_extent_at, iFpii)
//GO(atk_table_get_column_header,
//GO(atk_table_get_index_at,
-//GO(atk_table_get_n_columns,
-//GO(atk_table_get_n_rows,
-//GO(atk_table_get_row_at_index,
-//GO(atk_table_get_row_description,
-//GO(atk_table_get_row_extent_at,
-//GO(atk_table_get_row_header,
+GO(atk_table_get_n_columns, iFp)
+GO(atk_table_get_n_rows, iFp)
+GO(atk_table_get_row_at_index, iFpi)
+GO(atk_table_get_row_description, pFpi)
+GO(atk_table_get_row_extent_at, iFpii)
+GO(atk_table_get_row_header, pFpi)
//GO(atk_table_get_selected_columns,
-//GO(atk_table_get_selected_rows,
-//GO(atk_table_get_summary,
-//GO(atk_table_get_type,
+GO(atk_table_get_selected_rows, iFpp)
+GO(atk_table_get_summary, pFp)
+GO(atk_table_get_type, LFv)
//GO(atk_table_is_column_selected,
//GO(atk_table_is_row_selected,
-//GO(atk_table_is_selected,
-//GO(atk_table_ref_at,
-//GO(atk_table_remove_column_selection,
+GO(atk_table_is_selected, iFpii)
+GO(atk_table_ref_at, pFpii)
+GO(atk_table_remove_column_selection, iFpi)
//GO(atk_table_remove_row_selection,
//GO(atk_table_set_caption,
//GO(atk_table_set_column_description,
//GO(atk_table_set_column_header,
-//GO(atk_table_set_row_description,
-//GO(atk_table_set_row_header,
-//GO(atk_table_set_summary,
-//GO(atk_text_add_selection,
-//GO(atk_text_attribute_for_name,
-//GO(atk_text_attribute_get_name,
+GO(atk_table_set_row_description, vFpip)
+GO(atk_table_set_row_header, vFpip)
+GO(atk_table_set_summary, vFpp)
+GO(atk_text_add_selection, iFpii)
+GO(atk_text_attribute_for_name, uFp)
+GO(atk_text_attribute_get_name, pFu)
//GO(atk_text_attribute_get_type,
-//GO(atk_text_attribute_get_value,
+GO(atk_text_attribute_get_value, pFui)
//GO(atk_text_attribute_register,
//GO(atk_text_boundary_get_type,
//GO(atk_text_clip_type_get_type,
-//GO(atk_text_free_ranges,
-//GO(atk_text_get_bounded_ranges,
-//GO(atk_text_get_caret_offset,
-//GO(atk_text_get_character_at_offset,
-//GO(atk_text_get_character_count,
-//GO(atk_text_get_character_extents,
-//GO(atk_text_get_default_attributes,
-//GO(atk_text_get_n_selections,
-//GO(atk_text_get_offset_at_point,
-//GO(atk_text_get_range_extents,
-//GO(atk_text_get_run_attributes,
-//GO(atk_text_get_selection,
-//GO(atk_text_get_text,
+GO(atk_text_free_ranges, vFp)
+GO(atk_text_get_bounded_ranges, pFppuuu)
+GO(atk_text_get_caret_offset, iFp)
+GO(atk_text_get_character_at_offset, uFpi)
+GO(atk_text_get_character_count, iFp)
+GO(atk_text_get_character_extents, vFpippppu)
+GO(atk_text_get_default_attributes, pFp)
+GO(atk_text_get_n_selections, iFp)
+GO(atk_text_get_offset_at_point, iFpiiu)
+GO(atk_text_get_range_extents, vFpiiup)
+GO(atk_text_get_run_attributes, pFpipp)
+GO(atk_text_get_selection, pFpipp)
+GO(atk_text_get_text, pFpii)
//GO(atk_text_get_text_after_offset,
//GO(atk_text_get_text_at_offset,
-//GO(atk_text_get_text_before_offset,
+GO(atk_text_get_text_before_offset, pFpiupp)
GO(atk_text_get_type, LFv)
GO(atk_text_range_get_type, LFv)
//GO(atk_text_remove_selection,
-GO(atk_text_scroll_substring_to_point, iFpiiiii)
-//GO(atk_text_set_caret_offset,
-//GO(atk_text_set_selection,
+GO(atk_text_scroll_substring_to_point, iFpiiuii)
+GO(atk_text_set_caret_offset, iFpi)
+GO(atk_text_set_selection, iFpiii)
GO(atk_util_get_type, LFv)
-//GO(atk_value_get_current_value,
-//GO(atk_value_get_maximum_value,
-//GO(atk_value_get_minimum_increment,
-//GO(atk_value_get_minimum_value,
+GO(atk_value_get_current_value, vFpp)
+GO(atk_value_get_maximum_value, vFpp)
+GO(atk_value_get_minimum_increment, vFpp)
+GO(atk_value_get_minimum_value, vFpp)
GO(atk_value_get_type, LFv)
-//GO(atk_value_set_current_value,
+GO(atk_value_set_current_value, iFpp)
GO(atk_window_get_type, LFv)
diff --git a/src/wrapped/wrappedatkbridge.c b/src/wrapped/wrappedatkbridge.c
index 88198fa..88198fa 100755..100644
--- a/src/wrapped/wrappedatkbridge.c
+++ b/src/wrapped/wrappedatkbridge.c
diff --git a/src/wrapped/wrappedatkbridge_private.h b/src/wrapped/wrappedatkbridge_private.h
index f77ca36..f77ca36 100755..100644
--- a/src/wrapped/wrappedatkbridge_private.h
+++ b/src/wrapped/wrappedatkbridge_private.h
diff --git a/src/wrapped/wrappedatomic_private.h b/src/wrapped/wrappedatomic_private.h
index 3c7a258..f98dea6 100644
--- a/src/wrapped/wrappedatomic_private.h
+++ b/src/wrapped/wrappedatomic_private.h
@@ -18,7 +18,7 @@ GO(__atomic_compare_exchange, iFpii)
//GO(__atomic_compare_exchange_2,
//GO(__atomic_compare_exchange_4,
//GO(__atomic_compare_exchange_8,
-//GO(__atomic_exchange,
+GO(__atomic_exchange, vFpppi)
//GO(__atomic_exchange_1,
//GO(__atomic_exchange_16,
//GO(__atomic_exchange_2,
@@ -59,8 +59,8 @@ GO(__atomic_compare_exchange, iFpii)
//GO(atomic_flag_clear_explicit,
//GO(atomic_flag_test_and_set,
//GO(atomic_flag_test_and_set_explicit,
-//GO(__atomic_is_lock_free,
-//GO(__atomic_load,
+GO(__atomic_is_lock_free, iFLp)
+GO(__atomic_load, vFppi)
//GO(__atomic_load_1,
//GO(__atomic_load_16,
//GO(__atomic_load_2,
@@ -77,7 +77,7 @@ GO(__atomic_compare_exchange, iFpii)
//GO(__atomic_or_fetch_4,
//GO(__atomic_or_fetch_8,
//GO(atomic_signal_fence,
-//GO(__atomic_store,
+GO(__atomic_store, vFppi)
//GO(__atomic_store_1,
//GO(__atomic_store_16,
//GO(__atomic_store_2,
diff --git a/src/wrapped/wrappedatspi.c b/src/wrapped/wrappedatspi.c
index 9bd6e5c..ee1bd0d 100755..100644
--- a/src/wrapped/wrappedatspi.c
+++ b/src/wrapped/wrappedatspi.c
@@ -11,12 +11,90 @@
#include "bridge.h"
#include "librarian/library_private.h"
#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+#include "myalign.h"
+#include "gtkclass.h"
const char* atspiName = "libatspi.so.0";
#define LIBNAME atspi
+#define ADDED_FUNCTIONS() \
+
+#include "generated/wrappedatspitypes.h"
+
+#include "wrappercallback.h"
+
+#define SUPER() \
+GO(0) \
+GO(1) \
+GO(2) \
+GO(3) \
+GO(4)
+
+// GDestroyNotify ...
+#define GO(A) \
+static uintptr_t my_GDestroyNotify_fct_##A = 0; \
+static void my_GDestroyNotify_##A(void* a) \
+{ \
+ RunFunctionFmt(my_GDestroyNotify_fct_##A, "p", a); \
+}
+SUPER()
+#undef GO
+static void* find_GDestroyNotify_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_GDestroyNotify_fct_##A == (uintptr_t)fct) return my_GDestroyNotify_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GDestroyNotify_fct_##A == 0) {my_GDestroyNotify_fct_##A = (uintptr_t)fct; return my_GDestroyNotify_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for atspi GDestroyNotify callback\n");
+ return NULL;
+}
+// AtspiEventListenerCB ...
+#define GO(A) \
+static uintptr_t my_AtspiEventListenerCB_fct_##A = 0; \
+static void my_AtspiEventListenerCB_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_AtspiEventListenerCB_fct_##A, "pp", a, b); \
+}
+SUPER()
+#undef GO
+static void* find_AtspiEventListenerCB_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_AtspiEventListenerCB_fct_##A == (uintptr_t)fct) return my_AtspiEventListenerCB_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_AtspiEventListenerCB_fct_##A == 0) {my_AtspiEventListenerCB_fct_##A = (uintptr_t)fct; return my_AtspiEventListenerCB_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for atspi AtspiEventListenerCB callback\n");
+ return NULL;
+}
+
+#undef SUPER
+
+EXPORT void* my_atspi_event_listener_new(x64emu_t* emu, void* f, void* data, void* d)
+{
+ return my->atspi_event_listener_new(find_AtspiEventListenerCB_Fct(f), data, find_GDestroyNotify_Fct(d));
+}
+
#define PRE_INIT \
if(box64_nogtk) \
return -1;
+#define CUSTOM_INIT \
+ getMy(lib);
+
+#define CUSTOM_FINI \
+ freeMy();
+
#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedatspi_private.h b/src/wrapped/wrappedatspi_private.h
index 42115eb..b332893 100755..100644
--- a/src/wrapped/wrappedatspi_private.h
+++ b/src/wrapped/wrappedatspi_private.h
@@ -7,18 +7,18 @@
//GO(atspi_accessible_get_accessible_id,
//GO(atspi_accessible_get_action,
//GO(atspi_accessible_get_action_iface,
-//GO(atspi_accessible_get_application,
+GO(atspi_accessible_get_application, pFpp)
//GO(atspi_accessible_get_atspi_version,
-//GO(atspi_accessible_get_attributes,
+GO(atspi_accessible_get_attributes, pFpp)
//GO(atspi_accessible_get_attributes_as_array,
//GO(_atspi_accessible_get_cache_mask,
-//GO(atspi_accessible_get_child_at_index,
-//GO(atspi_accessible_get_child_count,
+GO(atspi_accessible_get_child_at_index, pFpip)
+GO(atspi_accessible_get_child_count, iFpp)
//GO(atspi_accessible_get_collection,
//GO(atspi_accessible_get_collection_iface,
//GO(atspi_accessible_get_component,
//GO(atspi_accessible_get_component_iface,
-//GO(atspi_accessible_get_description,
+GO(atspi_accessible_get_description, pFpp)
//GO(atspi_accessible_get_document,
//GO(atspi_accessible_get_document_iface,
//GO(atspi_accessible_get_editable_text,
@@ -30,18 +30,18 @@
//GO(atspi_accessible_get_image,
//GO(atspi_accessible_get_image_iface,
//GO(atspi_accessible_get_index_in_parent,
-//GO(atspi_accessible_get_interfaces,
+GO(atspi_accessible_get_interfaces, pFp)
//GO(atspi_accessible_get_localized_role_name,
-//GO(atspi_accessible_get_name,
+GO(atspi_accessible_get_name, pFpp)
//GO(atspi_accessible_get_object_locale,
-//GO(atspi_accessible_get_parent,
-//GO(atspi_accessible_get_process_id,
-//GO(atspi_accessible_get_relation_set,
-//GO(atspi_accessible_get_role,
-//GO(atspi_accessible_get_role_name,
+GO(atspi_accessible_get_parent, pFpp)
+GO(atspi_accessible_get_process_id, uFpp)
+GO(atspi_accessible_get_relation_set, pFpp)
+GO(atspi_accessible_get_role, iFpp)
+GO(atspi_accessible_get_role_name, pFpp)
//GO(atspi_accessible_get_selection,
//GO(atspi_accessible_get_selection_iface,
-//GO(atspi_accessible_get_state_set,
+GO(atspi_accessible_get_state_set, pFpp)
//GO(atspi_accessible_get_table,
//GO(atspi_accessible_get_table_cell,
//GO(atspi_accessible_get_table_iface,
@@ -158,14 +158,14 @@
//GO(atspi_editable_text_paste_text,
//GO(atspi_editable_text_set_text_contents,
//GO(_atspi_error_quark,
-//GO(atspi_event_get_type,
-//GO(atspi_event_listener_deregister,
+GO(atspi_event_get_type, LFv)
+GO(atspi_event_listener_deregister, iFppp)
//GO(atspi_event_listener_deregister_from_callback,
//GO(atspi_event_listener_deregister_no_data,
//GO(atspi_event_listener_get_type,
-//GO(atspi_event_listener_new,
+GOM(atspi_event_listener_new, pFppp)
//GO(atspi_event_listener_new_simple,
-//GO(atspi_event_listener_register,
+GO(atspi_event_listener_register, iFppp)
//GO(atspi_event_listener_register_from_callback,
//GO(atspi_event_listener_register_from_callback_full,
//GO(atspi_event_listener_register_full,
@@ -178,7 +178,7 @@
//GO(atspi_generate_mouse_event,
//GO(atspi_get_a11y_bus,
//GO(_atspi_get_allow_sync,
-//GO(atspi_get_desktop,
+GO(atspi_get_desktop, pFi)
//GO(atspi_get_desktop_count,
//GO(atspi_get_desktop_list,
//GO(_atspi_get_iface_num,
@@ -202,7 +202,7 @@
//GO(atspi_image_get_image_position,
//GO(atspi_image_get_image_size,
//GO(atspi_image_get_type,
-//GO(atspi_init,
+GO(atspi_init, iFv)
//DATA(atspi_interface_accessible,
//DATA(atspi_interface_action,
//DATA(atspi_interface_application,
@@ -258,9 +258,9 @@
//GO(_atspi_ref_accessible,
//GO(atspi_register_device_event_listener,
//GO(atspi_register_keystroke_listener,
-//GO(atspi_relation_get_n_targets,
-//GO(atspi_relation_get_relation_type,
-//GO(atspi_relation_get_target,
+GO(atspi_relation_get_n_targets, iFp)
+GO(atspi_relation_get_relation_type, iFp)
+GO(atspi_relation_get_target, pFpi)
//GO(atspi_relation_get_type,
//GO(_atspi_relation_new_from_iter,
//GO(atspi_relation_type_get_type,
@@ -288,7 +288,7 @@
//GO(atspi_state_set_compare,
//GO(atspi_state_set_contains,
//GO(atspi_state_set_equals,
-//GO(atspi_state_set_get_states,
+GO(atspi_state_set_get_states, pFp)
//GO(atspi_state_set_get_type,
//GO(atspi_state_set_is_empty,
//GO(atspi_state_set_new,
diff --git a/src/wrapped/wrappedbz2.c b/src/wrapped/wrappedbz2.c
index e3ff920..8503398 100755..100644
--- a/src/wrapped/wrappedbz2.c
+++ b/src/wrapped/wrappedbz2.c
@@ -37,7 +37,7 @@ GO(4)
static uintptr_t my_alloc_fct_##A = 0; \
static void* my_alloc_##A(void* opaque, int m, int n) \
{ \
- return (void*)RunFunction(my_context, my_alloc_fct_##A, 3, opaque, m, n); \
+ return (void*)RunFunctionFmt(my_alloc_fct_##A, "pii", opaque, m, n); \
}
SUPER()
#undef GO
@@ -69,7 +69,7 @@ static void* reverse_alloc_Fct(void* fct)
static uintptr_t my_free_fct_##A = 0; \
static void my_free_##A(void* opaque, void* p) \
{ \
- RunFunction(my_context, my_free_fct_##A, 2, opaque, p); \
+ RunFunctionFmt(my_free_fct_##A, "pp", opaque, p); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedbz2_private.h b/src/wrapped/wrappedbz2_private.h
index f05e42f..f05e42f 100755..100644
--- a/src/wrapped/wrappedbz2_private.h
+++ b/src/wrapped/wrappedbz2_private.h
diff --git a/src/wrapped/wrappedcairo.c b/src/wrapped/wrappedcairo.c
index a910e72..a910e72 100755..100644
--- a/src/wrapped/wrappedcairo.c
+++ b/src/wrapped/wrappedcairo.c
diff --git a/src/wrapped/wrappedcairo_private.h b/src/wrapped/wrappedcairo_private.h
index 7e484d1..4a92a41 100755..100644
--- a/src/wrapped/wrappedcairo_private.h
+++ b/src/wrapped/wrappedcairo_private.h
@@ -15,9 +15,9 @@ GO(cairo_copy_path, pFp)
GO(cairo_copy_path_flat, pFp)
GO(cairo_create, pFp)
GO(cairo_curve_to, vFpdddddd)
-//GO(cairo_debug_reset_static_data,
+GO(cairo_debug_reset_static_data, vFv)
GO(cairo_destroy, vFp)
-GO(cairo_device_acquire, iFp)
+GO(cairo_device_acquire, uFp)
GO(cairo_device_destroy, vFp)
GO(cairo_device_finish, vFp)
GO(cairo_device_flush, vFp)
@@ -43,26 +43,26 @@ GO(cairo_fill_preserve, vFp)
GO(cairo_font_extents, vFpp)
GO(cairo_font_face_destroy, vFp)
GO(cairo_font_face_get_reference_count, uFp)
-GO(cairo_font_face_get_type, iFp)
+GO(cairo_font_face_get_type, uFp)
GO(cairo_font_face_get_user_data, pFpp)
GO(cairo_font_face_reference, pFp)
//GOM(cairo_font_face_set_user_data, iFpppp)
-GO(cairo_font_face_status, iFp)
+GO(cairo_font_face_status, uFp)
GO(cairo_font_options_copy, pFp)
GO(cairo_font_options_create, pFv)
GO(cairo_font_options_destroy, vFp)
GO(cairo_font_options_equal, iFpp)
-GO(cairo_font_options_get_antialias, iFp)
-GO(cairo_font_options_get_hint_metrics, iFp)
-GO(cairo_font_options_get_hint_style, iFp)
-GO(cairo_font_options_get_subpixel_order, iFp)
+GO(cairo_font_options_get_antialias, uFp)
+GO(cairo_font_options_get_hint_metrics, uFp)
+GO(cairo_font_options_get_hint_style, uFp)
+GO(cairo_font_options_get_subpixel_order, uFp)
GO(cairo_font_options_hash, LFp)
GO(cairo_font_options_merge, vFpp)
-GO(cairo_font_options_set_antialias, vFpi)
-GO(cairo_font_options_set_hint_metrics, vFpi)
-GO(cairo_font_options_set_hint_style, vFpi)
-GO(cairo_font_options_set_subpixel_order, vFpi)
-GO(cairo_font_options_status, iFp)
+GO(cairo_font_options_set_antialias, vFpu)
+GO(cairo_font_options_set_hint_metrics, vFpu)
+GO(cairo_font_options_set_hint_style, vFpu)
+GO(cairo_font_options_set_subpixel_order, vFpu)
+GO(cairo_font_options_status, uFp)
GO(cairo_format_stride_for_width, iFii)
GO(cairo_ft_font_face_create_for_ft_face, pFpi)
GO(cairo_ft_font_face_create_for_pattern, pFp)
@@ -72,21 +72,21 @@ GO(cairo_ft_font_face_unset_synthesize, vFpu)
GO(cairo_ft_font_options_substitute, vFpp)
GO(cairo_ft_scaled_font_lock_face, pFp)
GO(cairo_ft_scaled_font_unlock_face, vFp)
-GO(cairo_get_antialias, iFp)
+GO(cairo_get_antialias, uFp)
GO(cairo_get_current_point, vFppp)
GO(cairo_get_dash, vFppp)
GO(cairo_get_dash_count, iFp)
-GO(cairo_get_fill_rule, iFp)
+GO(cairo_get_fill_rule, uFp)
GO(cairo_get_font_face, pFp)
GO(cairo_get_font_matrix, vFpp)
GO(cairo_get_font_options, vFpp)
GO(cairo_get_group_target, pFp)
-GO(cairo_get_line_cap, iFp)
-GO(cairo_get_line_join, iFp)
+GO(cairo_get_line_cap, uFp)
+GO(cairo_get_line_join, uFp)
GO(cairo_get_line_width, dFp)
GO(cairo_get_matrix, vFpp)
GO(cairo_get_miter_limit, dFp)
-GO(cairo_get_operator, iFp)
+GO(cairo_get_operator, uFp)
GO(cairo_get_reference_count, uFp)
GO(cairo_get_scaled_font, pFp)
GO(cairo_get_source, pFp)
@@ -101,7 +101,7 @@ GO(cairo_has_current_point, iFp)
GO(cairo_identity_matrix, vFp)
GO(cairo_image_surface_create, pFiii)
GO(cairo_image_surface_create_for_data, pFpiiii)
-//GO(cairo_image_surface_create_from_png,
+GO(cairo_image_surface_create_from_png, pFp)
//GO(cairo_image_surface_create_from_png_stream,
GO(cairo_image_surface_get_data, pFp)
GO(cairo_image_surface_get_format, iFp)
@@ -119,7 +119,7 @@ GO(cairo_matrix_init_identity, vFp)
GO(cairo_matrix_init_rotate, vFpd)
GO(cairo_matrix_init_scale, vFpdd)
GO(cairo_matrix_init_translate, vFpdd)
-GO(cairo_matrix_invert, iFp)
+GO(cairo_matrix_invert, uFp)
GO(cairo_matrix_multiply, vFppp)
GO(cairo_matrix_rotate, vFpd)
GO(cairo_matrix_scale, vFpdd)
@@ -129,9 +129,9 @@ GO(cairo_matrix_translate, vFpdd)
GO(cairo_mesh_pattern_begin_patch, vFp)
GO(cairo_mesh_pattern_curve_to, vFpdddddd)
GO(cairo_mesh_pattern_end_patch, vFp)
-GO(cairo_mesh_pattern_get_control_point, iFpuupp)
-GO(cairo_mesh_pattern_get_corner_color_rgba, iFpuupppp)
-GO(cairo_mesh_pattern_get_patch_count, iFpp)
+GO(cairo_mesh_pattern_get_control_point, uFpuupp)
+GO(cairo_mesh_pattern_get_corner_color_rgba, uFpuupppp)
+GO(cairo_mesh_pattern_get_patch_count, uFpp)
GO(cairo_mesh_pattern_get_path, pFpu)
GO(cairo_mesh_pattern_line_to, vFpdd)
GO(cairo_mesh_pattern_move_to, vFpdd)
@@ -151,67 +151,67 @@ GO(cairo_pattern_create_for_surface, pFp)
GO(cairo_pattern_create_linear, pFdddd)
GO(cairo_pattern_create_mesh, pFv)
GO(cairo_pattern_create_radial, pFdddddd)
-//GO(cairo_pattern_create_raster_source,
+GO(cairo_pattern_create_raster_source, pFpuii)
GO(cairo_pattern_create_rgb, pFddd)
GO(cairo_pattern_create_rgba, pFdddd)
GO(cairo_pattern_destroy, vFp)
-GO(cairo_pattern_get_color_stop_count, iFpp)
-GO(cairo_pattern_get_color_stop_rgba, iFpippppp)
-GO(cairo_pattern_get_extend, iFp)
-GO(cairo_pattern_get_filter, iFp)
-GO(cairo_pattern_get_linear_points, iFppppp)
+GO(cairo_pattern_get_color_stop_count, uFpp)
+GO(cairo_pattern_get_color_stop_rgba, uFpippppp)
+GO(cairo_pattern_get_extend, uFp)
+GO(cairo_pattern_get_filter, uFp)
+GO(cairo_pattern_get_linear_points, uFppppp)
GO(cairo_pattern_get_matrix, vFpp)
-GO(cairo_pattern_get_radial_circles, iFppppppp)
+GO(cairo_pattern_get_radial_circles, uFppppppp)
GO(cairo_pattern_get_reference_count, uFp)
GO(cairo_pattern_get_rgba, iFppppp)
-GO(cairo_pattern_get_surface, iFpp)
-GO(cairo_pattern_get_type, iFp)
+GO(cairo_pattern_get_surface, uFpp)
+GO(cairo_pattern_get_type, uFp)
GO(cairo_pattern_get_user_data, pFpp)
GO(cairo_pattern_reference, pFp)
-GO(cairo_pattern_set_extend, vFpi)
-GO(cairo_pattern_set_filter, vFpi)
+GO(cairo_pattern_set_extend, vFpu)
+GO(cairo_pattern_set_filter, vFpu)
GO(cairo_pattern_set_matrix, vFpp)
//GOM(cairo_pattern_set_user_data, iFEpppp)
-GO(cairo_pattern_status, iFp)
-//GO(cairo_pdf_get_versions,
-//GO(cairo_pdf_surface_create,
+GO(cairo_pattern_status, uFp)
+GO(cairo_pdf_get_versions, vFpp)
+GO(cairo_pdf_surface_create, pFpdd)
//GO(cairo_pdf_surface_create_for_stream,
-//GO(cairo_pdf_surface_restrict_to_version,
-//GO(cairo_pdf_surface_set_size,
-//GO(cairo_pdf_version_to_string,
+GO(cairo_pdf_surface_restrict_to_version, vFpu)
+GO(cairo_pdf_surface_set_size, vFpdd)
+GO(cairo_pdf_version_to_string, pFu)
GO(cairo_pop_group, pFp)
GO(cairo_pop_group_to_source, vFp)
-//GO(cairo_ps_get_levels,
-//GO(cairo_ps_level_to_string,
-//GO(cairo_ps_surface_create,
+GO(cairo_ps_get_levels, vFpp)
+GO(cairo_ps_level_to_string, pFu)
+GO(cairo_ps_surface_create, pFpdd)
//GO(cairo_ps_surface_create_for_stream,
-//GO(cairo_ps_surface_dsc_begin_page_setup,
+GO(cairo_ps_surface_dsc_begin_page_setup, vFp)
//GO(cairo_ps_surface_dsc_begin_setup,
-//GO(cairo_ps_surface_dsc_comment,
-//GO(cairo_ps_surface_get_eps,
-//GO(cairo_ps_surface_restrict_to_level,
-//GO(cairo_ps_surface_set_eps,
-//GO(cairo_ps_surface_set_size,
+GO(cairo_ps_surface_dsc_comment, vFpp)
+GO(cairo_ps_surface_get_eps, iFp)
+GO(cairo_ps_surface_restrict_to_level, vFpu)
+GO(cairo_ps_surface_set_eps, vFpi)
+GO(cairo_ps_surface_set_size, vFpdd)
GO(cairo_push_group, vFp)
-GO(cairo_push_group_with_content, vFpi)
-//GO(cairo_raster_source_pattern_get_acquire,
-//GO(cairo_raster_source_pattern_get_callback_data,
-//GO(cairo_raster_source_pattern_get_copy,
-//GO(cairo_raster_source_pattern_get_finish,
-//GO(cairo_raster_source_pattern_get_snapshot,
+GO(cairo_push_group_with_content, vFpu)
+GO(cairo_raster_source_pattern_get_acquire, vFppp)
+GO(cairo_raster_source_pattern_get_callback_data, pFp)
+GO(cairo_raster_source_pattern_get_copy, pFp)
+GO(cairo_raster_source_pattern_get_finish, pFp)
+GO(cairo_raster_source_pattern_get_snapshot, pFp)
//GO(cairo_raster_source_pattern_set_acquire,
-//GO(cairo_raster_source_pattern_set_callback_data,
+GO(cairo_raster_source_pattern_set_callback_data, vFpp)
//GO(cairo_raster_source_pattern_set_copy,
//GO(cairo_raster_source_pattern_set_finish,
//GO(cairo_raster_source_pattern_set_snapshot,
-//GO(cairo_recording_surface_create,
-//GO(cairo_recording_surface_get_extents,
-//GO(cairo_recording_surface_ink_extents,
+GO(cairo_recording_surface_create, pFup)
+GO(cairo_recording_surface_get_extents, iFpp)
+GO(cairo_recording_surface_ink_extents, vFppppp)
GO(cairo_rectangle, vFpdddd)
GO(cairo_rectangle_list_destroy, vFp)
GO(cairo_reference, pFp)
GO(cairo_region_contains_point, iFpii)
-GO(cairo_region_contains_rectangle, iFpp)
+GO(cairo_region_contains_rectangle, uFpp)
GO(cairo_region_copy, pFp)
GO(cairo_region_create, pFv)
GO(cairo_region_create_rectangle, pFp)
@@ -225,14 +225,14 @@ GO(cairo_region_intersect_rectangle, iFpp)
GO(cairo_region_is_empty, iFp)
GO(cairo_region_num_rectangles, iFp)
GO(cairo_region_reference, pFp)
-GO(cairo_region_status, iFp)
+GO(cairo_region_status, uFp)
GO(cairo_region_subtract, iFpp)
GO(cairo_region_subtract_rectangle, iFpp)
GO(cairo_region_translate, vFpii)
GO(cairo_region_union, iFpp)
GO(cairo_region_union_rectangle, iFpp)
-GO(cairo_region_xor, iFpp)
-GO(cairo_region_xor_rectangle, iFpp)
+GO(cairo_region_xor, uFpp)
+GO(cairo_region_xor_rectangle, uFpp)
GO(cairo_rel_curve_to, vFpdddddd)
GO(cairo_rel_line_to, vFpdd)
GO(cairo_rel_move_to, vFpdd)
@@ -250,36 +250,36 @@ GO(cairo_scaled_font_get_font_matrix, vFpp)
GO(cairo_scaled_font_get_font_options, vFpp)
GO(cairo_scaled_font_get_reference_count, uFp)
GO(cairo_scaled_font_get_scale_matrix, vFpp)
-GO(cairo_scaled_font_get_type, iFp)
+GO(cairo_scaled_font_get_type, uFp)
GO(cairo_scaled_font_get_user_data, pFpp)
GO(cairo_scaled_font_glyph_extents, vFppip)
GO(cairo_scaled_font_reference, pFp)
//GOM(cairo_scaled_font_set_user_data, iFEpppp)
-GO(cairo_scaled_font_status, iFp)
+GO(cairo_scaled_font_status, uFp)
GO(cairo_scaled_font_text_extents, vFppp)
-GO(cairo_scaled_font_text_to_glyphs, iFpddpippppp)
-//GO(cairo_script_create,
+GO(cairo_scaled_font_text_to_glyphs, uFpddpippppp)
+GO(cairo_script_create, pFp)
//GO(cairo_script_create_for_stream,
-//GO(cairo_script_from_recording_surface,
-//GO(cairo_script_get_mode,
-//GO(cairo_script_set_mode,
-//GO(cairo_script_surface_create,
-//GO(cairo_script_surface_create_for_target,
-//GO(cairo_script_write_comment,
-GO(cairo_select_font_face, vFppii)
-GO(cairo_set_antialias, vFpi)
+GO(cairo_script_from_recording_surface, uFpp)
+GO(cairo_script_get_mode, uFp)
+GO(cairo_script_set_mode, vFpu)
+GO(cairo_script_surface_create, pFpudd)
+GO(cairo_script_surface_create_for_target, pFpp)
+GO(cairo_script_write_comment, vFppi)
+GO(cairo_select_font_face, vFppuu)
+GO(cairo_set_antialias, vFpu)
GO(cairo_set_dash, vFppid)
-GO(cairo_set_fill_rule, vFpi)
+GO(cairo_set_fill_rule, vFpu)
GO(cairo_set_font_face, vFpp)
GO(cairo_set_font_matrix, vFpp)
GO(cairo_set_font_options, vFpp)
GO(cairo_set_font_size, vFpd)
-GO(cairo_set_line_cap, vFpi)
-GO(cairo_set_line_join, vFpi)
+GO(cairo_set_line_cap, vFpu)
+GO(cairo_set_line_join, vFpu)
GO(cairo_set_line_width, vFpd)
GO(cairo_set_matrix, vFpp)
GO(cairo_set_miter_limit, vFpd)
-GO(cairo_set_operator, vFpi)
+GO(cairo_set_operator, vFpu)
GO(cairo_set_scaled_font, vFpp)
GO(cairo_set_source, vFpp)
GO(cairo_set_source_rgb, vFpddd)
@@ -290,21 +290,21 @@ GO(cairo_set_tolerance, vFpd)
GO(cairo_show_glyphs, vFppi)
GO(cairo_show_page, vFp)
GO(cairo_show_text, vFpp)
-GO(cairo_show_text_glyphs, vFppipipii)
-GO(cairo_status, iFp)
-//GO(cairo_status_to_string,
+GO(cairo_show_text_glyphs, vFppipipiu)
+GO(cairo_status, uFp)
+GO(cairo_status_to_string, pFu)
GO(cairo_stroke, vFp)
GO(cairo_stroke_extents, vFppppp)
GO(cairo_stroke_preserve, vFp)
GO(cairo_surface_copy_page, vFp)
GO(cairo_surface_create_for_rectangle, pFpdddd)
-//GO(cairo_surface_create_observer,
-GO(cairo_surface_create_similar, pFppii)
-GO(cairo_surface_create_similar_image, pFppii)
+GO(cairo_surface_create_observer, pFpu)
+GO(cairo_surface_create_similar, pFpuii)
+GO(cairo_surface_create_similar_image, pFpiii)
GO(cairo_surface_destroy, vFp)
GO(cairo_surface_finish, vFp)
GO(cairo_surface_flush, vFp)
-GO(cairo_surface_get_content, pFp)
+GO(cairo_surface_get_content, uFp)
GO(cairo_surface_get_device, pFp)
GO(cairo_surface_get_device_offset, vFppp)
GO(cairo_surface_get_device_scale, vFpp)
@@ -312,7 +312,7 @@ GO(cairo_surface_get_fallback_resolution, vFppp)
GO(cairo_surface_get_font_options, vFpp)
GO(cairo_surface_get_mime_data, vFpppp)
GO(cairo_surface_get_reference_count, uFp)
-GO(cairo_surface_get_type, iFp)
+GO(cairo_surface_get_type, uFp)
GO(cairo_surface_get_user_data, pFpp)
GO(cairo_surface_has_show_text_glyphs, iFp)
GO(cairo_surface_map_to_image, pFpp)
@@ -325,7 +325,7 @@ GO(cairo_surface_mark_dirty_rectangle, vFpiiii)
//GO(cairo_surface_observer_add_mask_callback,
//GO(cairo_surface_observer_add_paint_callback,
//GO(cairo_surface_observer_add_stroke_callback,
-//GO(cairo_surface_observer_elapsed,
+GO(cairo_surface_observer_elapsed, dFp)
//GO(cairo_surface_observer_print,
GO(cairo_surface_reference, pFp)
GO(cairo_surface_set_device_offset, vFpdd)
@@ -334,65 +334,65 @@ GO(cairo_surface_set_fallback_resolution, vFpdd)
//GOM(cairo_surface_set_mime_data, iFEpppLpp)
//GOM(cairo_surface_set_user_data, iFEpppp)
GO(cairo_surface_show_page, vFp)
-GO(cairo_surface_status, iFp)
+GO(cairo_surface_status, uFp)
GO(cairo_surface_supports_mime_type, iFpp)
GO(cairo_surface_unmap_image, vFpp)
-//GO(cairo_surface_write_to_png,
+GO(cairo_surface_write_to_png, uFpp)
//GO(cairo_surface_write_to_png_stream,
-//GO(cairo_svg_get_versions,
-//GO(cairo_svg_surface_create,
+GO(cairo_svg_get_versions, vFpp)
+GO(cairo_svg_surface_create, pFpdd)
//GO(cairo_svg_surface_create_for_stream,
-//GO(cairo_svg_surface_restrict_to_version,
-//GO(cairo_svg_version_to_string,
+GO(cairo_svg_surface_restrict_to_version, vFpu)
+GO(cairo_svg_version_to_string, pFu)
GO(cairo_text_cluster_allocate, pFi)
GO(cairo_text_cluster_free, vFp)
GO(cairo_text_extents, vFppp)
GO(cairo_text_path, vFpp)
-GO(cairo_toy_font_face_create, pFpii)
+GO(cairo_toy_font_face_create, pFpuu)
GO(cairo_toy_font_face_get_family, pFp)
-GO(cairo_toy_font_face_get_slant, iFp)
-GO(cairo_toy_font_face_get_weight, iFp)
+GO(cairo_toy_font_face_get_slant, uFp)
+GO(cairo_toy_font_face_get_weight, uFp)
GO(cairo_transform, vFpp)
GO(cairo_translate, vFpdd)
-//GO(cairo_user_font_face_create,
-//GO(cairo_user_font_face_get_init_func,
-//GO(cairo_user_font_face_get_render_glyph_func,
-//GO(cairo_user_font_face_get_text_to_glyphs_func,
-//GO(cairo_user_font_face_get_unicode_to_glyph_func,
+GO(cairo_user_font_face_create, pFv)
+GO(cairo_user_font_face_get_init_func, pFp)
+GO(cairo_user_font_face_get_render_glyph_func, pFp)
+GO(cairo_user_font_face_get_text_to_glyphs_func, pFp)
+GO(cairo_user_font_face_get_unicode_to_glyph_func, pFp)
//GO(cairo_user_font_face_set_init_func,
//GO(cairo_user_font_face_set_render_glyph_func,
//GO(cairo_user_font_face_set_text_to_glyphs_func,
//GO(cairo_user_font_face_set_unicode_to_glyph_func,
GO(cairo_user_to_device, vFppp)
GO(cairo_user_to_device_distance, vFppp)
-//GO(cairo_version,
-//GO(cairo_version_string,
-//GO(cairo_xcb_device_debug_cap_xrender_version,
+GO(cairo_version, iFv)
+GO(cairo_version_string, pFv)
+GO(cairo_xcb_device_debug_cap_xrender_version, vFpii)
//GO(cairo_xcb_device_debug_cap_xshm_version,
-//GO(cairo_xcb_device_debug_get_precision,
-//GO(cairo_xcb_device_debug_set_precision,
-//GO(cairo_xcb_device_get_connection,
-//GO(cairo_xcb_surface_create,
-//GO(cairo_xcb_surface_create_for_bitmap,
-//GO(cairo_xcb_surface_create_with_xrender_format,
-//GO(cairo_xcb_surface_set_drawable,
-//GO(cairo_xcb_surface_set_size,
-//GO(cairo_xlib_device_debug_cap_xrender_version,
-//GO(cairo_xlib_device_debug_get_precision,
-//GO(cairo_xlib_device_debug_set_precision,
+GO(cairo_xcb_device_debug_get_precision, iFp)
+GO(cairo_xcb_device_debug_set_precision, vFpi)
+GO(cairo_xcb_device_get_connection, pFp)
+GO(cairo_xcb_surface_create, pFpupii)
+GO(cairo_xcb_surface_create_for_bitmap, pFppuii)
+GO(cairo_xcb_surface_create_with_xrender_format, pFppupii)
+GO(cairo_xcb_surface_set_drawable, vFpuii)
+GO(cairo_xcb_surface_set_size, vFpii)
+GO(cairo_xlib_device_debug_cap_xrender_version, vFpii)
+GO(cairo_xlib_device_debug_get_precision, iFp)
+GO(cairo_xlib_device_debug_set_precision, vFpi)
//GO(cairo_xlib_surface_create,
-//GO(cairo_xlib_surface_create_for_bitmap,
-//GO(cairo_xlib_surface_create_with_xrender_format,
+GO(cairo_xlib_surface_create_for_bitmap, pFpLpii)
+GO(cairo_xlib_surface_create_with_xrender_format, pFpLppii)
//GO(cairo_xlib_surface_get_depth,
-//GO(cairo_xlib_surface_get_display,
-//GO(cairo_xlib_surface_get_drawable,
-//GO(cairo_xlib_surface_get_height,
-//GO(cairo_xlib_surface_get_screen,
+GO(cairo_xlib_surface_get_display, pFp)
+GO(cairo_xlib_surface_get_drawable, LFp)
+GO(cairo_xlib_surface_get_height, iFp)
+GO(cairo_xlib_surface_get_screen, pFp)
//GO(cairo_xlib_surface_get_visual,
//GO(cairo_xlib_surface_get_width,
-//GO(cairo_xlib_surface_get_xrender_format,
-//GO(cairo_xlib_surface_set_drawable,
-//GO(cairo_xlib_surface_set_size,
+GO(cairo_xlib_surface_get_xrender_format, pFp)
+GO(cairo_xlib_surface_set_drawable, vFpLii)
+GO(cairo_xlib_surface_set_size, vFpii)
//GO(cairo_xml_create,
//GO(cairo_xml_create_for_stream,
//GO(cairo_xml_for_recording_surface,
diff --git a/src/wrapped/wrappedcairogobject_private.h b/src/wrapped/wrappedcairogobject_private.h
index 57894ae..3224588 100644
--- a/src/wrapped/wrappedcairogobject_private.h
+++ b/src/wrapped/wrappedcairogobject_private.h
@@ -2,36 +2,36 @@
#error meh!
#endif
-GO(cairo_gobject_antialias_get_type, lFv)
-GO(cairo_gobject_content_get_type, lFv)
-GO(cairo_gobject_context_get_type, lFv)
-GO(cairo_gobject_device_get_type, lFv)
-GO(cairo_gobject_device_type_get_type, lFv)
-GO(cairo_gobject_extend_get_type, lFv)
-GO(cairo_gobject_fill_rule_get_type, lFv)
-GO(cairo_gobject_filter_get_type, lFv)
-GO(cairo_gobject_font_face_get_type, lFv)
-GO(cairo_gobject_font_options_get_type, lFv)
-GO(cairo_gobject_font_slant_get_type, lFv)
-GO(cairo_gobject_font_type_get_type, lFv)
-GO(cairo_gobject_font_weight_get_type, lFv)
-GO(cairo_gobject_format_get_type, lFv)
-GO(cairo_gobject_hint_metrics_get_type, lFv)
-GO(cairo_gobject_hint_style_get_type, lFv)
-GO(cairo_gobject_line_cap_get_type, lFv)
-GO(cairo_gobject_line_join_get_type, lFv)
-GO(cairo_gobject_matrix_get_type, lFv)
-GO(cairo_gobject_operator_get_type, lFv)
-GO(cairo_gobject_path_data_type_get_type, lFv)
-GO(cairo_gobject_pattern_get_type, lFv)
-GO(cairo_gobject_pattern_type_get_type, lFv)
-GO(cairo_gobject_rectangle_get_type, lFv)
-GO(cairo_gobject_rectangle_int_get_type, lFv)
-GO(cairo_gobject_region_get_type, lFv)
-GO(cairo_gobject_region_overlap_get_type, lFv)
-GO(cairo_gobject_scaled_font_get_type, lFv)
-GO(cairo_gobject_status_get_type, lFv)
-GO(cairo_gobject_subpixel_order_get_type, lFv)
-GO(cairo_gobject_surface_get_type, lFv)
-GO(cairo_gobject_surface_type_get_type, lFv)
-GO(cairo_gobject_text_cluster_flags_get_type, lFv)
+GO(cairo_gobject_antialias_get_type, LFv)
+GO(cairo_gobject_content_get_type, LFv)
+GO(cairo_gobject_context_get_type, LFv)
+GO(cairo_gobject_device_get_type, LFv)
+GO(cairo_gobject_device_type_get_type, LFv)
+GO(cairo_gobject_extend_get_type, LFv)
+GO(cairo_gobject_fill_rule_get_type, LFv)
+GO(cairo_gobject_filter_get_type, LFv)
+GO(cairo_gobject_font_face_get_type, LFv)
+GO(cairo_gobject_font_options_get_type, LFv)
+GO(cairo_gobject_font_slant_get_type, LFv)
+GO(cairo_gobject_font_type_get_type, LFv)
+GO(cairo_gobject_font_weight_get_type, LFv)
+GO(cairo_gobject_format_get_type, LFv)
+GO(cairo_gobject_hint_metrics_get_type, LFv)
+GO(cairo_gobject_hint_style_get_type, LFv)
+GO(cairo_gobject_line_cap_get_type, LFv)
+GO(cairo_gobject_line_join_get_type, LFv)
+GO(cairo_gobject_matrix_get_type, LFv)
+GO(cairo_gobject_operator_get_type, LFv)
+GO(cairo_gobject_path_data_type_get_type, LFv)
+GO(cairo_gobject_pattern_get_type, LFv)
+GO(cairo_gobject_pattern_type_get_type, LFv)
+GO(cairo_gobject_rectangle_get_type, LFv)
+GO(cairo_gobject_rectangle_int_get_type, LFv)
+GO(cairo_gobject_region_get_type, LFv)
+GO(cairo_gobject_region_overlap_get_type, LFv)
+GO(cairo_gobject_scaled_font_get_type, LFv)
+GO(cairo_gobject_status_get_type, LFv)
+GO(cairo_gobject_subpixel_order_get_type, LFv)
+GO(cairo_gobject_surface_get_type, LFv)
+GO(cairo_gobject_surface_type_get_type, LFv)
+GO(cairo_gobject_text_cluster_flags_get_type, LFv)
diff --git a/src/wrapped/wrappedcap.c b/src/wrapped/wrappedcap.c
new file mode 100644
index 0000000..a7a3686
--- /dev/null
+++ b/src/wrapped/wrappedcap.c
@@ -0,0 +1,18 @@
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+
+const char* capName = "libcap.so.2";
+#define LIBNAME cap
+
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedcap_private.h b/src/wrapped/wrappedcap_private.h
new file mode 100644
index 0000000..c523ad6
--- /dev/null
+++ b/src/wrapped/wrappedcap_private.h
@@ -0,0 +1,62 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error Meh....
+#endif
+
+//GO(cap_clear,
+//GO(cap_clear_flag,
+//GO(cap_compare,
+//GO(cap_copy_ext,
+//GO(cap_copy_int,
+//GO(cap_drop_bound,
+//GO(cap_dup,
+//GO(cap_free,
+//GO(cap_from_name,
+//GO(cap_from_text,
+//GO(cap_get_ambient,
+//GO(cap_get_bound,
+//GO(cap_get_fd,
+//GO(cap_get_file,
+//GO(cap_get_flag,
+//GO(cap_get_mode,
+//GO(cap_get_nsowner,
+//GO(capgetp,
+//GO(cap_get_pid,
+//GO(cap_get_proc,
+//GO(cap_get_secbits,
+//GO(cap_iab_fill,
+//GO(cap_iab_from_text,
+//GO(cap_iab_get_proc,
+//GO(cap_iab_get_vector,
+//GO(cap_iab_init,
+//GO(cap_iab_set_proc,
+//GO(cap_iab_set_vector,
+//GO(cap_iab_to_text,
+//GO(cap_init,
+//GO(cap_launch,
+//GO(cap_launcher_callback,
+//GO(cap_launcher_set_chroot,
+//GO(cap_launcher_setgroups,
+//GO(cap_launcher_set_iab,
+//GO(cap_launcher_set_mode,
+//GO(cap_launcher_setuid,
+//GO(cap_max_bits,
+//GO(cap_mode_name,
+//GO(cap_new_launcher,
+//GO(cap_reset_ambient,
+//GO(cap_set_ambient,
+//GO(cap_set_fd,
+//GO(cap_set_file,
+//GO(cap_set_flag,
+//GO(cap_setgroups,
+//GO(cap_set_mode,
+//GO(cap_set_nsowner,
+//GO(capsetp,
+//GO(cap_set_proc,
+//GO(cap_set_secbits,
+//GO(cap_set_syscall,
+//GO(cap_setuid,
+//GO(cap_size,
+//GO(cap_to_name,
+//GO(cap_to_text,
+//GO(_libcap_strdup,
+//GOW(psx_load_syscalls,
diff --git a/src/wrapped/wrappedcrashhandler.c b/src/wrapped/wrappedcrashhandler.c
index fe0840b..fe0840b 100755..100644
--- a/src/wrapped/wrappedcrashhandler.c
+++ b/src/wrapped/wrappedcrashhandler.c
diff --git a/src/wrapped/wrappedcrashhandler_private.h b/src/wrapped/wrappedcrashhandler_private.h
index 52ed57d..52ed57d 100755..100644
--- a/src/wrapped/wrappedcrashhandler_private.h
+++ b/src/wrapped/wrappedcrashhandler_private.h
diff --git a/src/wrapped/wrappedcrypto.c b/src/wrapped/wrappedcrypto.c
index 21941bb..d768555 100755..100644
--- a/src/wrapped/wrappedcrypto.c
+++ b/src/wrapped/wrappedcrypto.c
@@ -35,12 +35,180 @@ GO(2) \
GO(3) \
GO(4)
+// BIO_meth_set_write
+#define GO(A) \
+static uintptr_t my_BIO_meth_set_write_fct_##A = 0; \
+static int my_BIO_meth_set_write_##A(void* a, void* b, int c) \
+{ \
+ return (int)RunFunctionFmt(my_BIO_meth_set_write_fct_##A, "ppi", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_BIO_meth_set_write_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_BIO_meth_set_write_fct_##A == (uintptr_t)fct) return my_BIO_meth_set_write_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_BIO_meth_set_write_fct_##A == 0) {my_BIO_meth_set_write_fct_##A = (uintptr_t)fct; return my_BIO_meth_set_write_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto BIO_meth_set_write callback\n");
+ return NULL;
+}
+
+// BIO_meth_set_read
+#define GO(A) \
+static uintptr_t my_BIO_meth_set_read_fct_##A = 0; \
+static int my_BIO_meth_set_read_##A(void* a, void* b, int c)\
+{ \
+ return (int)RunFunctionFmt(my_BIO_meth_set_read_fct_##A, "ppi", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_BIO_meth_set_read_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_BIO_meth_set_read_fct_##A == (uintptr_t)fct) return my_BIO_meth_set_read_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_BIO_meth_set_read_fct_##A == 0) {my_BIO_meth_set_read_fct_##A = (uintptr_t)fct; return my_BIO_meth_set_read_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto BIO_meth_set_read callback\n");
+ return NULL;
+}
+
+// BIO_meth_set_puts
+#define GO(A) \
+static uintptr_t my_BIO_meth_set_puts_fct_##A = 0; \
+static int my_BIO_meth_set_puts_##A(void* a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my_BIO_meth_set_puts_fct_##A, "pp", a, b); \
+}
+SUPER()
+#undef GO
+static void* find_BIO_meth_set_puts_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_BIO_meth_set_puts_fct_##A == (uintptr_t)fct) return my_BIO_meth_set_puts_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_BIO_meth_set_puts_fct_##A == 0) {my_BIO_meth_set_puts_fct_##A = (uintptr_t)fct; return my_BIO_meth_set_puts_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto BIO_meth_set_puts callback\n");
+ return NULL;
+}
+
+// BIO_meth_set_gets
+#define GO(A) \
+static uintptr_t my_BIO_meth_set_gets_fct_##A = 0; \
+static int my_BIO_meth_set_gets_##A(void* a, void* b, int c)\
+{ \
+ return (int)RunFunctionFmt(my_BIO_meth_set_gets_fct_##A, "ppi", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_BIO_meth_set_gets_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_BIO_meth_set_gets_fct_##A == (uintptr_t)fct) return my_BIO_meth_set_gets_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_BIO_meth_set_gets_fct_##A == 0) {my_BIO_meth_set_gets_fct_##A = (uintptr_t)fct; return my_BIO_meth_set_gets_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto BIO_meth_set_gets callback\n");
+ return NULL;
+}
+
+// BIO_meth_set_ctrl
+#define GO(A) \
+static uintptr_t my_BIO_meth_set_ctrl_fct_##A = 0; \
+static long my_BIO_meth_set_ctrl_##A(void* a, int b, long c, void* d) \
+{ \
+ return (long)RunFunctionFmt(my_BIO_meth_set_ctrl_fct_##A, "pilp", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_BIO_meth_set_ctrl_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_BIO_meth_set_ctrl_fct_##A == (uintptr_t)fct) return my_BIO_meth_set_ctrl_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_BIO_meth_set_ctrl_fct_##A == 0) {my_BIO_meth_set_ctrl_fct_##A = (uintptr_t)fct; return my_BIO_meth_set_ctrl_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto BIO_meth_set_ctrl callback\n");
+ return NULL;
+}
+
+// BIO_meth_set_create
+#define GO(A) \
+static uintptr_t my_BIO_meth_set_create_fct_##A = 0;\
+static int my_BIO_meth_set_create_##A(void* a) \
+{ \
+ return (int)RunFunctionFmt(my_BIO_meth_set_create_fct_##A, "p", a); \
+}
+SUPER()
+#undef GO
+static void* find_BIO_meth_set_create_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_BIO_meth_set_create_fct_##A == (uintptr_t)fct) return my_BIO_meth_set_create_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_BIO_meth_set_create_fct_##A == 0) {my_BIO_meth_set_create_fct_##A = (uintptr_t)fct; return my_BIO_meth_set_create_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto BIO_meth_set_create callback\n");
+ return NULL;
+}
+
+// BIO_meth_set_destroy
+#define GO(A) \
+static uintptr_t my_BIO_meth_set_destroy_fct_##A = 0; \
+static int my_BIO_meth_set_destroy_##A(void* a) \
+{ \
+ return (int)RunFunctionFmt(my_BIO_meth_set_destroy_fct_##A, "p", a);\
+}
+SUPER()
+#undef GO
+static void* find_BIO_meth_set_destroy_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_BIO_meth_set_destroy_fct_##A == (uintptr_t)fct) return my_BIO_meth_set_destroy_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_BIO_meth_set_destroy_fct_##A == 0) {my_BIO_meth_set_destroy_fct_##A = (uintptr_t)fct; return my_BIO_meth_set_destroy_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto BIO_meth_set_destroy callback\n");
+ return NULL;
+}
+
// ENGINE_ctrl_cb
#define GO(A) \
-static uintptr_t my_ENGINE_ctrl_cb_fct_##A = 0; \
-static void my_ENGINE_ctrl_cb_##A() \
-{ \
- RunFunction(my_context, my_ENGINE_ctrl_cb_fct_##A, 0); \
+static uintptr_t my_ENGINE_ctrl_cb_fct_##A = 0; \
+static void my_ENGINE_ctrl_cb_##A() \
+{ \
+ RunFunctionFmt(my_ENGINE_ctrl_cb_fct_##A, ""); \
}
SUPER()
#undef GO
@@ -64,7 +232,7 @@ static void* find_ENGINE_ctrl_cb_Fct(void* fct)
static uintptr_t my_cmp_fnc_fct_##A = 0; \
static int my_cmp_fnc_##A(void* a, void* b) \
{ \
- return (int)RunFunction(my_context, my_cmp_fnc_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_cmp_fnc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -88,7 +256,7 @@ static void* find_cmp_fnc_Fct(void* fct)
static uintptr_t my_free_fnc_fct_##A = 0; \
static void my_free_fnc_##A(void* p) \
{ \
- RunFunction(my_context, my_free_fnc_fct_##A, 1, p); \
+ RunFunctionFmt(my_free_fnc_fct_##A, "p", p); \
}
SUPER()
#undef GO
@@ -112,7 +280,7 @@ static void* find_free_fnc_Fct(void* fct)
static uintptr_t my_id_func_fct_##A = 0; \
static unsigned long my_id_func_##A() \
{ \
- return (unsigned long)RunFunction(my_context, my_id_func_fct_##A, 0); \
+ return (unsigned long)RunFunctionFmt(my_id_func_fct_##A, ""); \
}
SUPER()
#undef GO
@@ -136,7 +304,7 @@ static void* find_id_func_Fct(void* fct)
static uintptr_t my_lock_func_fct_##A = 0; \
static void my_lock_func_##A(int mode, int n, void* f, int l) \
{ \
- RunFunction(my_context, my_lock_func_fct_##A, 4, mode, n, f, l); \
+ RunFunctionFmt(my_lock_func_fct_##A, "iipi", mode, n, f, l); \
}
SUPER()
#undef GO
@@ -160,7 +328,7 @@ static void* find_lock_func_Fct(void* fct)
static uintptr_t my_passphrase_fct_##A = 0; \
static int my_passphrase_##A(void* buff, int size, int rw, void* u) \
{ \
- return (int)RunFunction(my_context, my_passphrase_fct_##A, 4, buff, size, rw, u); \
+ return (int)RunFunctionFmt(my_passphrase_fct_##A, "piip", buff, size, rw, u); \
}
SUPER()
#undef GO
@@ -184,7 +352,7 @@ static void* find_passphrase_Fct(void* fct)
static uintptr_t my_xnew_fct_##A = 0; \
static void* my_xnew_##A() \
{ \
- return (void*)RunFunction(my_context, my_xnew_fct_##A, 0); \
+ return (void*)RunFunctionFmt(my_xnew_fct_##A, ""); \
}
SUPER()
#undef GO
@@ -208,7 +376,7 @@ static void* find_xnew_Fct(void* fct)
static uintptr_t my_d2i_fct_##A = 0; \
static void* my_d2i_##A() \
{ \
- return (void*)RunFunction(my_context, my_d2i_fct_##A, 0); \
+ return (void*)RunFunctionFmt(my_d2i_fct_##A, ""); \
}
SUPER()
#undef GO
@@ -232,7 +400,7 @@ static void* find_d2i_Fct(void* fct)
static uintptr_t my_i2d_fct_##A = 0; \
static int my_i2d_##A() \
{ \
- return (int)RunFunction(my_context, my_i2d_fct_##A, 0); \
+ return (int)RunFunctionFmt(my_i2d_fct_##A, ""); \
}
SUPER()
#undef GO
@@ -256,7 +424,7 @@ static void* find_i2d_Fct(void* fct)
static uintptr_t my_pem_password_cb_fct_##A = 0; \
static int my_pem_password_cb_##A(void* a, int b, int c, void* d) \
{ \
- return (int)RunFunction(my_context, my_pem_password_cb_fct_##A, 4, a, b, c, d); \
+ return (int)RunFunctionFmt(my_pem_password_cb_fct_##A, "piip", a, b, c, d); \
}
SUPER()
#undef GO
@@ -275,12 +443,37 @@ static void* find_pem_password_cb_Fct(void* fct)
return NULL;
}
+// ctx_verify_cb
+#define GO(A) \
+static uintptr_t my_ctx_verify_cb_fct_##A = 0; \
+static int my_ctx_verify_cb_##A(int a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my_ctx_verify_cb_fct_##A, "ip", a, b); \
+}
+SUPER()
+#undef GO
+static void* find_ctx_verify_cb_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_ctx_verify_cb_fct_##A == (uintptr_t)fct) return my_ctx_verify_cb_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_ctx_verify_cb_fct_##A == 0) {my_ctx_verify_cb_fct_##A = (uintptr_t)fct; return my_ctx_verify_cb_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto ctx_verify_cb callback\n");
+ return NULL;
+}
+
+
// verify_cb
#define GO(A) \
static uintptr_t my_verify_cb_fct_##A = 0; \
static int my_verify_cb_##A(int a, void* b) \
{ \
- return (int)RunFunction(my_context, my_verify_cb_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_verify_cb_fct_##A, "ip", a, b); \
}
SUPER()
#undef GO
@@ -301,6 +494,42 @@ static void* find_verify_cb_Fct(void* fct)
#undef SUPER
+EXPORT int32_t my_BIO_meth_set_write(x64emu_t* emu, void* biom, void* cb)
+{
+ (void)emu;
+ return my->BIO_meth_set_write(biom, find_BIO_meth_set_write_Fct(cb));
+}
+EXPORT int32_t my_BIO_meth_set_read(x64emu_t* emu, void* biom, void* cb)
+{
+ (void)emu;
+ return my->BIO_meth_set_read(biom, find_BIO_meth_set_read_Fct(cb));
+}
+EXPORT int32_t my_BIO_meth_set_puts(x64emu_t* emu, void* biom, void* cb)
+{
+ (void)emu;
+ return my->BIO_meth_set_puts(biom, find_BIO_meth_set_puts_Fct(cb));
+}
+EXPORT int32_t my_BIO_meth_set_gets(x64emu_t* emu, void* biom, void* cb)
+{
+ (void)emu;
+ return my->BIO_meth_set_gets(biom, find_BIO_meth_set_gets_Fct(cb));
+}
+EXPORT int32_t my_BIO_meth_set_ctrl(x64emu_t* emu, void* biom, void* cb)
+{
+ (void)emu;
+ return my->BIO_meth_set_ctrl(biom, find_BIO_meth_set_ctrl_Fct(cb));
+}
+EXPORT int32_t my_BIO_meth_set_create(x64emu_t* emu, void* biom, void* cb)
+{
+ (void)emu;
+ return my->BIO_meth_set_create(biom, find_BIO_meth_set_create_Fct(cb));
+}
+EXPORT int32_t my_BIO_meth_set_destroy(x64emu_t* emu, void* biom, void* cb)
+{
+ (void)emu;
+ return my->BIO_meth_set_destroy(biom, find_BIO_meth_set_destroy_Fct(cb));
+}
+
EXPORT int32_t my_ENGINE_ctrl(x64emu_t* emu, void* e, int32_t cmd, int32_t i, void* p, void* f)
{
(void)emu;
@@ -373,6 +602,13 @@ EXPORT int my_PEM_write_bio_RSAPrivateKey(x64emu_t* emu, void* bp, void* x, void
return my->PEM_write_bio_RSAPrivateKey(bp, x, e, str, len, find_passphrase_Fct(cb), u);
}
+
+EXPORT int my_PEM_write_bio_PrivateKey(x64emu_t* emu, void* bp, void* x, void* e, void* str, int len, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_write_bio_PrivateKey(bp, x, e, str, len, find_passphrase_Fct(cb), u);
+}
+
EXPORT int my_PEM_write_bio_ECPrivateKey(x64emu_t* emu, void* bp, void* x, void* e, void* str, int len, void* cb, void* u)
{
(void)emu;
@@ -409,6 +645,25 @@ EXPORT void* my_PEM_read_bio_PKCS7(x64emu_t* emu, void* bp, void* x, void* cb, v
return my->PEM_read_bio_PKCS7(bp, x, find_pem_password_cb_Fct(cb), u);
}
+EXPORT void* my_PEM_read_bio_PrivateKey(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_read_bio_PrivateKey(bp, x, find_pem_password_cb_Fct(cb), u);
+}
+
+
+EXPORT void* my_PEM_read_bio_PUBKEY(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_read_bio_PUBKEY(bp, x, find_pem_password_cb_Fct(cb), u);
+}
+
+EXPORT void* my_PEM_read_bio_DHparams(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_read_bio_DHparams(bp, x, find_pem_password_cb_Fct(cb), u);
+}
+
EXPORT void* my_PEM_read_bio_X509(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
{
(void)emu;
@@ -442,7 +697,14 @@ EXPORT void* my_PEM_read_bio_X509_CERT_PAIR(x64emu_t* emu, void* bp, void* x, vo
EXPORT void my_X509_STORE_CTX_set_verify_cb(x64emu_t* emu, void* ctx, void* cb)
{
(void)emu;
- my->X509_STORE_CTX_set_verify_cb(ctx, find_verify_cb_Fct(cb));
+ my->X509_STORE_CTX_set_verify_cb(ctx, find_ctx_verify_cb_Fct(cb));
+}
+
+
+EXPORT void my_X509_STORE_set_verify_cb(x64emu_t* emu, void* ctx, void* cb)
+{
+ (void)emu;
+ my->X509_STORE_set_verify_cb(ctx, find_verify_cb_Fct(cb));
}
EXPORT void my_OPENSSL_sk_pop_free(x64emu_t* emu, void* s, void* cb)
diff --git a/src/wrapped/wrappedcrypto3.c b/src/wrapped/wrappedcrypto3.c
new file mode 100644
index 0000000..a6317af
--- /dev/null
+++ b/src/wrapped/wrappedcrypto3.c
@@ -0,0 +1,466 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "myalign.h"
+
+const char* crypto3Name = "libcrypto.so.3";
+#define LIBNAME crypto3
+
+#include "generated/wrappedcrypto3types.h"
+
+#include "wrappercallback.h"
+
+// utility functions
+#define SUPER() \
+GO(0) \
+GO(1) \
+GO(2) \
+GO(3) \
+GO(4)
+
+// ENGINE_ctrl_cb
+#define GO(A) \
+static uintptr_t my3_ENGINE_ctrl_cb_fct_##A = 0; \
+static void my3_ENGINE_ctrl_cb_##A() \
+{ \
+ RunFunctionFmt(my3_ENGINE_ctrl_cb_fct_##A, ""); \
+}
+SUPER()
+#undef GO
+static void* find_ENGINE_ctrl_cb_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_ENGINE_ctrl_cb_fct_##A == (uintptr_t)fct) return my3_ENGINE_ctrl_cb_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_ENGINE_ctrl_cb_fct_##A == 0) {my3_ENGINE_ctrl_cb_fct_##A = (uintptr_t)fct; return my3_ENGINE_ctrl_cb_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto ENGINE_ctrl_cb callback\n");
+ return NULL;
+}
+
+// cmp_fnc
+#define GO(A) \
+static uintptr_t my3_cmp_fnc_fct_##A = 0; \
+static int my3_cmp_fnc_##A(void* a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my3_cmp_fnc_fct_##A, "pp", a, b); \
+}
+SUPER()
+#undef GO
+static void* find_cmp_fnc_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_cmp_fnc_fct_##A == (uintptr_t)fct) return my3_cmp_fnc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_cmp_fnc_fct_##A == 0) {my3_cmp_fnc_fct_##A = (uintptr_t)fct; return my3_cmp_fnc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto cmp_fnc callback\n");
+ return NULL;
+}
+
+// free_fnc
+#define GO(A) \
+static uintptr_t my3_free_fnc_fct_##A = 0; \
+static void my3_free_fnc_##A(void* p) \
+{ \
+ RunFunctionFmt(my3_free_fnc_fct_##A, "p", p); \
+}
+SUPER()
+#undef GO
+static void* find_free_fnc_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_free_fnc_fct_##A == (uintptr_t)fct) return my3_free_fnc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_free_fnc_fct_##A == 0) {my3_free_fnc_fct_##A = (uintptr_t)fct; return my3_free_fnc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto free_fnc callback\n");
+ return NULL;
+}
+
+// id_func
+#define GO(A) \
+static uintptr_t my3_id_func_fct_##A = 0; \
+static unsigned long my3_id_func_##A() \
+{ \
+ return (unsigned long)RunFunctionFmt(my3_id_func_fct_##A, ""); \
+}
+SUPER()
+#undef GO
+static void* find_id_func_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_id_func_fct_##A == (uintptr_t)fct) return my3_id_func_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_id_func_fct_##A == 0) {my3_id_func_fct_##A = (uintptr_t)fct; return my3_id_func_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto id_func callback\n");
+ return NULL;
+}
+
+// lock_func
+#define GO(A) \
+static uintptr_t my3_lock_func_fct_##A = 0; \
+static void my3_lock_func_##A(int mode, int n, void* f, int l) \
+{ \
+ RunFunctionFmt(my3_lock_func_fct_##A, "iipi", mode, n, f, l); \
+}
+SUPER()
+#undef GO
+static void* find_lock_func_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_lock_func_fct_##A == (uintptr_t)fct) return my3_lock_func_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_lock_func_fct_##A == 0) {my3_lock_func_fct_##A = (uintptr_t)fct; return my3_lock_func_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto lock_func callback\n");
+ return NULL;
+}
+
+// passphrase
+#define GO(A) \
+static uintptr_t my3_passphrase_fct_##A = 0; \
+static int my3_passphrase_##A(void* buff, int size, int rw, void* u) \
+{ \
+ return (int)RunFunctionFmt(my3_passphrase_fct_##A, "piip", buff, size, rw, u); \
+}
+SUPER()
+#undef GO
+static void* find_passphrase_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_passphrase_fct_##A == (uintptr_t)fct) return my3_passphrase_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_passphrase_fct_##A == 0) {my3_passphrase_fct_##A = (uintptr_t)fct; return my3_passphrase_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto passphrase callback\n");
+ return NULL;
+}
+
+// xnew
+#define GO(A) \
+static uintptr_t my3_xnew_fct_##A = 0; \
+static void* my3_xnew_##A() \
+{ \
+ return (void*)RunFunctionFmt(my3_xnew_fct_##A, ""); \
+}
+SUPER()
+#undef GO
+static void* find_xnew_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_xnew_fct_##A == (uintptr_t)fct) return my3_xnew_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_xnew_fct_##A == 0) {my3_xnew_fct_##A = (uintptr_t)fct; return my3_xnew_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto xnew callback\n");
+ return NULL;
+}
+
+// d2i
+#define GO(A) \
+static uintptr_t my3_d2i_fct_##A = 0; \
+static void* my3_d2i_##A() \
+{ \
+ return (void*)RunFunctionFmt(my3_d2i_fct_##A, ""); \
+}
+SUPER()
+#undef GO
+static void* find_d2i_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_d2i_fct_##A == (uintptr_t)fct) return my3_d2i_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_d2i_fct_##A == 0) {my3_d2i_fct_##A = (uintptr_t)fct; return my3_d2i_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto d2i callback\n");
+ return NULL;
+}
+
+// i2d
+#define GO(A) \
+static uintptr_t my3_i2d_fct_##A = 0; \
+static int my3_i2d_##A() \
+{ \
+ return (int)RunFunctionFmt(my3_i2d_fct_##A, ""); \
+}
+SUPER()
+#undef GO
+static void* find_i2d_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_i2d_fct_##A == (uintptr_t)fct) return my3_i2d_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_i2d_fct_##A == 0) {my3_i2d_fct_##A = (uintptr_t)fct; return my3_i2d_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto i2d callback\n");
+ return NULL;
+}
+
+// pem_password_cb
+#define GO(A) \
+static uintptr_t my3_pem_password_cb_fct_##A = 0; \
+static int my3_pem_password_cb_##A(void* a, int b, int c, void* d) \
+{ \
+ return (int)RunFunctionFmt(my3_pem_password_cb_fct_##A, "piip", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_pem_password_cb_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_pem_password_cb_fct_##A == (uintptr_t)fct) return my3_pem_password_cb_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_pem_password_cb_fct_##A == 0) {my3_pem_password_cb_fct_##A = (uintptr_t)fct; return my3_pem_password_cb_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto pem_password_cb callback\n");
+ return NULL;
+}
+
+// verify_cb
+#define GO(A) \
+static uintptr_t my3_verify_cb_fct_##A = 0; \
+static int my3_verify_cb_##A(int a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my3_verify_cb_fct_##A, "ip", a, b); \
+}
+SUPER()
+#undef GO
+static void* find_verify_cb_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_verify_cb_fct_##A == (uintptr_t)fct) return my3_verify_cb_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_verify_cb_fct_##A == 0) {my3_verify_cb_fct_##A = (uintptr_t)fct; return my3_verify_cb_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcrypto verify_cb callback\n");
+ return NULL;
+}
+
+#undef SUPER
+
+EXPORT int32_t my3_ENGINE_ctrl(x64emu_t* emu, void* e, int32_t cmd, int32_t i, void* p, void* f)
+{
+ (void)emu;
+ return my->ENGINE_ctrl(e, cmd, i, p, find_ENGINE_ctrl_cb_Fct(f));
+}
+
+EXPORT int32_t my3_ENGINE_ctrl_cmd(x64emu_t* emu, void* e, void* cmd, long i, void* p, void* f, int optional)
+{
+ (void)emu;
+ return my->ENGINE_ctrl_cmd(e, cmd, i, p, find_ENGINE_ctrl_cb_Fct(f), optional);
+}
+
+EXPORT void my3_CRYPTO_set_id_callback(x64emu_t* emu, void* cb)
+{
+ (void)emu;
+ my->CRYPTO_set_id_callback(find_id_func_Fct(cb));
+}
+
+EXPORT void my3_CRYPTO_set_locking_callback(x64emu_t* emu, void* cb)
+{
+ (void)emu;
+ my->CRYPTO_set_locking_callback(find_lock_func_Fct(cb));
+}
+
+EXPORT void my3_PEM_read_bio_DSAPrivateKey(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ my->PEM_read_bio_DSAPrivateKey(bp, x, find_passphrase_Fct(cb), u);
+}
+
+EXPORT void my3_PEM_read_bio_DSA_PUBKEY(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ my->PEM_read_bio_DSA_PUBKEY(bp, x, find_passphrase_Fct(cb), u);
+}
+
+EXPORT void my3_PEM_read_bio_RSAPrivateKey(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ my->PEM_read_bio_RSAPrivateKey(bp, x, find_passphrase_Fct(cb), u);
+}
+
+EXPORT void my3_PEM_read_bio_RSA_PUBKEY(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ my->PEM_read_bio_RSA_PUBKEY(bp, x, find_passphrase_Fct(cb), u);
+}
+
+EXPORT void my3_PEM_read_bio_ECPrivateKey(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ my->PEM_read_bio_ECPrivateKey(bp, x, find_passphrase_Fct(cb), u);
+}
+
+EXPORT void my3_PEM_read_bio_EC_PUBKEY(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ my->PEM_read_bio_EC_PUBKEY(bp, x, find_passphrase_Fct(cb), u);
+}
+
+EXPORT int my3_PEM_write_bio_DSAPrivateKey(x64emu_t* emu, void* bp, void* x, void* e, void* str, int len, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_write_bio_DSAPrivateKey(bp, x, e, str, len, find_passphrase_Fct(cb), u);
+}
+
+EXPORT int my3_PEM_write_bio_RSAPrivateKey(x64emu_t* emu, void* bp, void* x, void* e, void* str, int len, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_write_bio_RSAPrivateKey(bp, x, e, str, len, find_passphrase_Fct(cb), u);
+}
+
+EXPORT int my3_PEM_write_bio_ECPrivateKey(x64emu_t* emu, void* bp, void* x, void* e, void* str, int len, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_write_bio_ECPrivateKey(bp, x, e, str, len, find_passphrase_Fct(cb), u);
+}
+
+EXPORT void* my3_ASN1_d2i_bio(x64emu_t* emu, void* xnew, void* d2i, void* bp, void* x)
+{
+ (void)emu;
+ return my->ASN1_d2i_bio(find_xnew_Fct(xnew), find_d2i_Fct(d2i), bp, x);
+}
+
+EXPORT int my3_ASN1_i2d_bio(x64emu_t* emu, void* i2d, void* bp, void* x)
+{
+ (void)emu;
+ return my->ASN1_i2d_bio(find_i2d_Fct(i2d), bp, x);
+}
+
+EXPORT void* my3_PEM_read_bio_PKCS7(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_read_bio_PKCS7(bp, x, find_pem_password_cb_Fct(cb), u);
+}
+
+EXPORT void* my3_PEM_read_bio_X509(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_read_bio_X509(bp, x, find_pem_password_cb_Fct(cb), u);
+}
+
+EXPORT void* my3_PEM_read_bio_X509_AUX(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_read_bio_X509_AUX(bp, x, find_pem_password_cb_Fct(cb), u);
+}
+
+EXPORT void* my3_PEM_read_bio_X509_CRL(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_read_bio_X509_CRL(bp, x, find_pem_password_cb_Fct(cb), u);
+}
+
+EXPORT void* my3_PEM_read_bio_X509_REQ(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_read_bio_X509_REQ(bp, x, find_pem_password_cb_Fct(cb), u);
+}
+
+EXPORT void* my3_PEM_read_bio_X509_CERT_PAIR(x64emu_t* emu, void* bp, void* x, void* cb, void* u)
+{
+ (void)emu;
+ return my->PEM_read_bio_X509_CERT_PAIR(bp, x, find_pem_password_cb_Fct(cb), u);
+}
+
+EXPORT void my3_X509_STORE_CTX_set_verify_cb(x64emu_t* emu, void* ctx, void* cb)
+{
+ (void)emu;
+ my->X509_STORE_CTX_set_verify_cb(ctx, find_verify_cb_Fct(cb));
+}
+
+EXPORT void my3_OPENSSL_sk_pop_free(x64emu_t* emu, void* s, void* cb)
+{
+ (void)emu;
+ my->OPENSSL_sk_pop_free(s, find_free_fnc_Fct(cb));
+}
+
+EXPORT void my3_ERR_set_error(x64emu_t* emu, int lib, int reason, void* fmt, uintptr_t* b)
+{
+ myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 3);
+ PREPARE_VALIST;
+ my->ERR_vset_error(lib, reason, fmt, VARARGS);
+}
+EXPORT void my3_ERR_vset_error(x64emu_t* emu, int lib, int reason, void* fmt, x64_va_list_t b)
+{
+ #ifdef CONVERT_VALIST
+ CONVERT_VALIST(b);
+ #else
+ myStackAlignValist(emu, (const char*)fmt, emu->scratch, b);
+ PREPARE_VALIST;
+ #endif
+ my->ERR_vset_error(lib, reason, fmt, VARARGS);
+}
+
+
+#define CUSTOM_INIT \
+ SETALT(my3_); \
+ getMy(lib);
+
+#define CUSTOM_FINI \
+ freeMy();
+
+#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedcrypto3_private.h b/src/wrapped/wrappedcrypto3_private.h
new file mode 100644
index 0000000..40a0c18
--- /dev/null
+++ b/src/wrapped/wrappedcrypto3_private.h
@@ -0,0 +1,3893 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error meh!
+#endif
+
+GO(a2d_ASN1_OBJECT, iFpipi)
+GO(a2i_ASN1_ENUMERATED, iFpppi)
+GO(a2i_ASN1_INTEGER, iFpppi)
+GO(a2i_ASN1_STRING, iFpppi)
+//GO(a2i_GENERAL_NAME,
+//GO(a2i_ipadd,
+//GO(a2i_IPADDRESS,
+//GO(a2i_IPADDRESS_NC,
+//GO(ACCESS_DESCRIPTION_free,
+//GO(ACCESS_DESCRIPTION_new,
+GO(AES_bi_ige_encrypt, vFppLpppi)
+GO(AES_cbc_encrypt, vFppLppi)
+GO(AES_cfb128_encrypt, vFppLpppi)
+GO(AES_cfb1_encrypt, vFppLpppi)
+GO(AES_cfb8_encrypt, vFppLpppi)
+GO(AES_ctr128_encrypt, vFppLpppp)
+GO(AES_decrypt, vFppp)
+GO(AES_ecb_encrypt, vFpppi)
+GO(AES_encrypt, vFppp)
+GO(AES_ige_encrypt, vFppLppi)
+GO(AES_ofb128_encrypt, vFppLppp)
+GO(AES_options, pFv)
+GO(AES_set_decrypt_key, iFpip)
+//GO(AES_set_enc2dec_key,
+GO(AES_set_encrypt_key, iFpip)
+GO(AES_unwrap_key, iFppppu)
+//GO(aes_v8_cbc_encrypt,
+//GO(aes_v8_ctr32_encrypt_blocks,
+//GO(aes_v8_decrypt,
+//GO(aes_v8_encrypt,
+//GO(aes_v8_set_decrypt_key,
+//GO(aes_v8_set_encrypt_key,
+GO(AES_wrap_key, iFppppi)
+//GO(_armv7_neon_probe,
+//GO(_armv7_tick,
+//GO(_armv8_aes_probe,
+//GO(_armv8_pmull_probe,
+//GO(_armv8_sha1_probe,
+//GO(_armv8_sha256_probe,
+//GO(asn1_add_error,
+//GO(ASN1_add_oid_module,
+GO(ASN1_BIT_STRING_check, iFppi)
+GO(ASN1_BIT_STRING_free, vFp)
+GO(ASN1_BIT_STRING_get_bit, iFpi)
+GO(ASN1_BIT_STRING_name_print, iFpppi)
+GO(ASN1_BIT_STRING_new, pFv)
+GO(ASN1_BIT_STRING_num_asc, iFpp)
+GO(ASN1_BIT_STRING_set, iFppi)
+GO(ASN1_BIT_STRING_set_asc, iFppip)
+GO(ASN1_BIT_STRING_set_bit, iFpii)
+GO(ASN1_BMPSTRING_free, vFp)
+GO(ASN1_BMPSTRING_new, pFv)
+GO(ASN1_bn_print, iFppppi)
+GO(ASN1_check_infinite_end, iFpl)
+GO(ASN1_const_check_infinite_end, iFpl)
+//GO(asn1_const_Finish,
+GOM(ASN1_d2i_bio, pFEpppp)
+//GO(ASN1_d2i_fp,
+//GO(ASN1_digest,
+//GO(asn1_do_adb,
+//GO(asn1_do_lock,
+//GO(ASN1_dup,
+//GO(asn1_enc_free,
+//GO(asn1_enc_init,
+//GO(asn1_enc_restore,
+//GO(asn1_enc_save,
+GO(ASN1_ENUMERATED_free, vFp)
+GO(ASN1_ENUMERATED_get, lFp)
+GO(ASN1_ENUMERATED_new, pFv)
+GO(ASN1_ENUMERATED_set, iFpl)
+GO(ASN1_ENUMERATED_to_BN, pFpp)
+//GO(asn1_ex_c2i,
+//GO(asn1_ex_i2c,
+//GO(asn1_Finish,
+GO(ASN1_GENERALIZEDTIME_adj, pFplil)
+GO(ASN1_GENERALIZEDTIME_check, iFp)
+GO(ASN1_GENERALIZEDTIME_free, vFp)
+GO(ASN1_GENERALIZEDTIME_new, pFv)
+GO(ASN1_GENERALIZEDTIME_print, iFpp)
+GO(ASN1_GENERALIZEDTIME_set, pFpl)
+GO(ASN1_GENERALIZEDTIME_set_string, iFpp)
+//GO(asn1_generalizedtime_to_tm,
+GO(ASN1_GENERALSTRING_free, vFp)
+GO(ASN1_GENERALSTRING_new, pFv)
+GO(ASN1_generate_nconf, pFpp)
+GO(ASN1_generate_v3, pFpp)
+//GO(asn1_get_choice_selector,
+//GO(asn1_get_field_ptr,
+GO(ASN1_get_object, iFppppl)
+//GO(asn1_GetSequence,
+GOM(ASN1_i2d_bio, iFEppp)
+//GO(ASN1_i2d_fp,
+GO(ASN1_IA5STRING_free, vFp)
+GO(ASN1_IA5STRING_new, pFv)
+GO(ASN1_INTEGER_cmp, iFpp)
+GO(ASN1_INTEGER_dup, pFp)
+GO(ASN1_INTEGER_free, vFp)
+GO(ASN1_INTEGER_get, lFp)
+GO(ASN1_INTEGER_new, pFv)
+GO(ASN1_INTEGER_set, iFpl)
+GO(ASN1_INTEGER_to_BN, pFpp)
+GO(ASN1_item_d2i, pFpplp)
+GO(ASN1_item_d2i_bio, pFppp)
+GO(ASN1_item_d2i_fp, pFppp)
+//GO(ASN1_item_digest,
+GO(ASN1_item_dup, pFpp)
+//GO(ASN1_item_ex_d2i,
+//GO(ASN1_item_ex_free,
+//GO(ASN1_item_ex_i2d,
+//GO(ASN1_item_ex_new,
+GO(ASN1_item_free, vFpp)
+//GO(ASN1_item_i2d,
+GO(ASN1_item_i2d_bio, iFppp)
+GO(ASN1_item_i2d_fp, iFppp)
+GO(ASN1_item_ndef_i2d, iFppp)
+GO(ASN1_item_new, pFp)
+GO(ASN1_item_pack, pFppp)
+GO(ASN1_item_print, iFppipp)
+//GO(ASN1_item_sign,
+//GO(ASN1_item_sign_ctx,
+GO(ASN1_item_unpack, pFpp)
+//GO(ASN1_item_verify,
+GO(ASN1_mbstring_copy, iFppiiL)
+GO(ASN1_mbstring_ncopy, iFppiiLll)
+GO(ASN1_NULL_free, vFp)
+GO(ASN1_NULL_new, pFv)
+GO(ASN1_OBJECT_create, pFipipp)
+GO(ASN1_OBJECT_free, vFp)
+GO(ASN1_OBJECT_new, pFv)
+GO(ASN1_object_size, iFiii)
+GO(ASN1_OCTET_STRING_cmp, iFpp)
+GO(ASN1_OCTET_STRING_dup, pFp)
+GO(ASN1_OCTET_STRING_free, vFp)
+GO(ASN1_OCTET_STRING_new, pFv)
+GO(ASN1_OCTET_STRING_set, iFppi)
+//GO(ASN1_pack_string,
+GO(ASN1_parse, iFppli)
+GO(ASN1_parse_dump, iFpplii)
+GO(ASN1_PCTX_free, vFp)
+//GO(ASN1_PCTX_get_cert_flags,
+//GO(ASN1_PCTX_get_flags,
+//GO(ASN1_PCTX_get_nm_flags,
+//GO(ASN1_PCTX_get_oid_flags,
+GO(ASN1_PCTX_get_str_flags, LFp)
+GO(ASN1_PCTX_new, pFv)
+//GO(ASN1_PCTX_set_cert_flags,
+//GO(ASN1_PCTX_set_flags,
+//GO(ASN1_PCTX_set_nm_flags,
+//GO(ASN1_PCTX_set_oid_flags,
+GO(ASN1_PCTX_set_str_flags, vFpL)
+//GO(ASN1_primitive_free,
+//GO(ASN1_primitive_new,
+//GO(ASN1_PRINTABLE_free,
+//GO(ASN1_PRINTABLE_new,
+GO(ASN1_PRINTABLESTRING_free, vFp)
+GO(ASN1_PRINTABLESTRING_new, pFv)
+GO(ASN1_PRINTABLE_type, iFpi)
+GO(ASN1_put_eoc, iFp)
+GO(ASN1_put_object, vFpiiii)
+//GO(ASN1_seq_pack,
+//GO(ASN1_seq_unpack,
+//GO(asn1_set_choice_selector,
+//GO(ASN1_sign,
+//GO(ASN1_STRING_clear_free,
+GO(ASN1_STRING_cmp, iFpp)
+GO(ASN1_STRING_copy, iFpp)
+GO(ASN1_STRING_data, pFp)
+GO(ASN1_STRING_dup, pFp)
+GO(ASN1_STRING_free, vFp)
+GO(ASN1_STRING_get_default_mask, LFv)
+GO(ASN1_STRING_length, iFp)
+GO(ASN1_STRING_length_set, vFpi)
+//GO(ASN1_STRING_new,
+GO(ASN1_STRING_print, iFpp)
+GO(ASN1_STRING_print_ex, iFppL)
+GO(ASN1_STRING_print_ex_fp, iFppL)
+GO(ASN1_STRING_set, iFppi)
+GO(ASN1_STRING_set0, vFppi)
+GO(ASN1_STRING_set_by_NID, pFppiii)
+GO(ASN1_STRING_set_default_mask, vFL)
+GO(ASN1_STRING_set_default_mask_asc, iFp)
+GO(ASN1_STRING_TABLE_add, iFillLL)
+//GO(ASN1_STRING_TABLE_cleanup,
+GO(ASN1_STRING_TABLE_get, pFi)
+GO(ASN1_STRING_to_UTF8, iFpp)
+GO(ASN1_STRING_type, iFp)
+GO(ASN1_STRING_type_new, pFi)
+GO(ASN1_T61STRING_free, vFp)
+GO(ASN1_T61STRING_new, pFv)
+GO(ASN1_tag2bit, LFi)
+GO(ASN1_tag2str, pFi)
+//GO(ASN1_template_d2i,
+//GO(ASN1_template_free,
+//GO(ASN1_template_i2d,
+//GO(ASN1_template_new,
+//GO(asn1_template_print_ctx,
+GO(ASN1_TIME_adj, pFplil)
+GO(ASN1_TIME_check, iFp)
+GO(ASN1_TIME_diff, iFpppp)
+GO(ASN1_TIME_free, vFp)
+GO(ASN1_TIME_new, pFv)
+GO(ASN1_TIME_print, iFpp)
+GO(ASN1_TIME_set, pFpl)
+//GO(ASN1_TIME_set_string,
+GO(ASN1_TIME_to_generalizedtime, pFpp)
+GO(ASN1_TYPE_cmp, iFpp)
+GO(ASN1_TYPE_free, vFp)
+GO(ASN1_TYPE_get, iFp)
+GO(ASN1_TYPE_get_int_octetstring, iFpppi)
+GO(ASN1_TYPE_get_octetstring, iFppi)
+GO(ASN1_TYPE_new, pFv)
+GO(ASN1_TYPE_set, vFpip)
+GO(ASN1_TYPE_set1, iFpip)
+GO(ASN1_TYPE_set_int_octetstring, iFplpi)
+GO(ASN1_TYPE_set_octetstring, iFppi)
+GO(ASN1_UNIVERSALSTRING_free, vFp)
+GO(ASN1_UNIVERSALSTRING_new, pFv)
+GO(ASN1_UNIVERSALSTRING_to_string, iFp)
+//GO(ASN1_unpack_string,
+GO(ASN1_UTCTIME_adj, pFplil)
+GO(ASN1_UTCTIME_check, iFp)
+GO(ASN1_UTCTIME_cmp_time_t, iFpl)
+GO(ASN1_UTCTIME_free, vFp)
+GO(ASN1_UTCTIME_new, pFv)
+GO(ASN1_UTCTIME_print, iFpp)
+GO(ASN1_UTCTIME_set, pFpl)
+GO(ASN1_UTCTIME_set_string, iFpp)
+//GO(asn1_utctime_to_tm,
+GO(ASN1_UTF8STRING_free, vFp)
+GO(ASN1_UTF8STRING_new, pFv)
+//GO(ASN1_verify,
+GO(ASN1_VISIBLESTRING_free, vFp)
+GO(ASN1_VISIBLESTRING_new, pFv)
+//GO(AUTHORITY_INFO_ACCESS_free,
+//GO(AUTHORITY_INFO_ACCESS_new,
+GO(AUTHORITY_KEYID_free, vFp)
+GO(AUTHORITY_KEYID_new, pFv)
+//GO(b2i_PrivateKey,
+//GO(b2i_PrivateKey_bio,
+//GO(b2i_PublicKey,
+//GO(b2i_PublicKey_bio,
+//GO(b2i_PVK_bio,
+GO(BASIC_CONSTRAINTS_free, vFp)
+GO(BASIC_CONSTRAINTS_new, pFv)
+GO(BF_cbc_encrypt, vFpplppi)
+GO(BF_cfb64_encrypt, vFpplpppi)
+GO(BF_decrypt, vFpp)
+GO(BF_ecb_encrypt, vFpppi)
+//GO(BF_encrypt,
+GO(BF_ofb64_encrypt, vFpplppp)
+GO(BF_options, pFv)
+GO(BF_set_key, vFpip)
+GO(BIO_accept, iFip)
+//GO(BIO_asn1_get_prefix,
+GO(BIO_asn1_get_suffix, iFppp)
+//GO(BIO_asn1_set_prefix,
+//GO(BIO_asn1_set_suffix,
+//GO(BIO_callback_ctrl,
+//GO(BIO_clear_flags,
+//GO(BIO_CONNECT_free,
+//GO(BIO_CONNECT_new,
+GO(BIO_copy_next_retry, vFp)
+GO(BIO_ctrl, lFpilp)
+GO(BIO_ctrl_get_read_request, LFp)
+//GO(BIO_ctrl_get_write_guarantee,
+GO(BIO_ctrl_pending, LFp)
+//GO(BIO_ctrl_reset_read_request,
+GO(BIO_ctrl_wpending, LFp)
+GO(BIO_debug_callback, lFpipill)
+//GO(BIO_dgram_non_fatal_error,
+GO(BIO_dump, iFppi)
+//GO(BIO_dump_cb,
+GO(BIO_dump_fp, iFppi)
+GO(BIO_dump_indent, iFppii)
+//GO(BIO_dump_indent_cb,
+GO(BIO_dump_indent_fp, iFppii)
+GO(BIO_dup_chain, pFp)
+GO(BIO_eof, iFp)
+GO(BIO_f_asn1, pFv)
+//GO(BIO_f_base64,
+//GO(BIO_f_buffer,
+//GO(BIO_f_cipher,
+//GO(BIO_fd_non_fatal_error,
+//GO(BIO_fd_should_retry,
+GO(BIO_flush, iFp)
+GO(BIO_find_type, pFpi)
+//GO(BIO_f_md,
+//GO(BIO_f_nbio_test,
+//GO(BIO_f_null,
+GO(BIO_free, iFp)
+GO(BIO_free_all, vFp)
+//GO(BIO_f_reliable,
+//GO(BIO_f_zlib,
+GO(BIO_get_accept_socket, iFpi)
+GO(BIO_get_callback, pFp)
+GO(BIO_get_callback_arg, pFp)
+GO(BIO_get_close, iFp)
+GO(BIO_get_ex_data, pFpi)
+//GO(BIO_get_ex_new_index,
+GO(BIO_gethostbyname, pFp)
+GO(BIO_get_host_ip, iFpp)
+GO(BIO_get_port, iFpp)
+GO(BIO_get_retry_BIO, pFpp)
+GO(BIO_get_retry_reason, iFp)
+GO(BIO_gets, iFppi)
+GO(BIO_hex_string, iFpiipi)
+//GO(BIO_indent,
+GO(BIO_int_ctrl, lFpili)
+GO(BIO_method_name, pFp)
+GO(BIO_method_type, iFp)
+GO(BIO_new, pFp)
+GO(BIO_new_accept, pFp)
+GO(BIO_new_bio_pair, iFpLpL)
+//GO(BIO_new_CMS,
+//GO(BIO_new_connect,
+//GO(BIO_new_dgram,
+GO(BIO_new_fd, pFii)
+GO(BIO_new_file, pFpp)
+GO(BIO_new_fp, pFpi)
+GO(BIO_new_mem_buf, pFpi)
+GO(BIO_new_NDEF, pFppp)
+//GO(BIO_new_PKCS7,
+//GO(BIO_new_socket,
+//GO(BIO_next,
+//GO(BIO_nread,
+//GO(BIO_nread0,
+//GO(BIO_number_read,
+GO(BIO_number_written, LFp)
+GO(BIO_nwrite, iFppi)
+GO(BIO_nwrite0, iFpp)
+GO(BIO_pending, iFp)
+//GO(BIO_pop,
+//GO(BIO_printf,
+GO(BIO_ptr_ctrl, pFpil)
+GO(BIO_push, pFpp)
+GO(BIO_puts, iFpp)
+GO(BIO_read, iFppi)
+GO(BIO_reset, iFp)
+//GO(BIO_s_accept,
+//GO(BIO_s_bio,
+//GO(BIO_s_connect,
+GO(BIO_s_datagram, pFv)
+GO(BIO_seek, iFpi)
+GO(BIO_set, iFpp)
+//GO(BIO_set_callback,
+GO(BIO_set_callback_arg, vFpp)
+GO(BIO_set_close, iFpl)
+//GO(BIO_set_cipher,
+GO(BIO_set_ex_data, iFpip)
+//GO(BIO_set_flags,
+GO(BIO_set_tcp_ndelay, iFii)
+//GO(BIO_s_fd,
+//GO(BIO_s_file,
+//GO(BIO_s_log,
+GO(BIO_s_mem, pFv)
+//GO(BIO_snprintf,
+//GO(BIO_s_null,
+//GO(BIO_sock_cleanup,
+//GO(BIO_sock_error,
+GO(BIO_socket_ioctl, iFilp)
+//GO(BIO_socket_nbio,
+GO(BIO_sock_init, iFv)
+//GO(BIO_sock_non_fatal_error,
+//GO(BIO_sock_should_retry,
+//GO(BIO_s_socket,
+GO(BIO_tell, iFp)
+GO(BIO_test_flags, iFpi)
+GO(BIO_up_ref, iFp)
+GO(BIO_vfree, vFp)
+//GO(BIO_vprintf,
+//GO(BIO_vsnprintf,
+GO(BIO_wpending, iFp)
+GO(BIO_write, iFppi)
+GO(BN_add, iFppp)
+//GO(bn_add_part_words,
+GO(BN_add_word, iFpu)
+//GO(bn_add_words,
+GO(BN_asc2bn, iFpp)
+GO(BN_bin2bn, pFpip)
+//GO(BN_BLINDING_convert,
+GO(BN_BLINDING_convert_ex, iFpppp)
+//GO(BN_BLINDING_create_param,
+//GO(BN_BLINDING_free,
+GO(BN_BLINDING_get_flags, LFp)
+//GO(BN_BLINDING_get_thread_id,
+GO(BN_BLINDING_invert, iFppp)
+GO(BN_BLINDING_invert_ex, iFpppp)
+GO(BN_BLINDING_new, pFppp)
+GO(BN_BLINDING_set_flags, vFpL)
+//GO(BN_BLINDING_set_thread_id,
+//GO(BN_BLINDING_thread_id,
+GO(BN_BLINDING_update, iFpp)
+GO(BN_bn2bin, iFpp)
+GO(BN_bn2dec, pFp)
+GO(BN_bn2hex, pFp)
+GO(BN_bn2mpi, iFpp)
+GO(BN_bntest_rand, iFpiii)
+GO(BN_clear, vFp)
+GO(BN_clear_bit, iFpi)
+GO(BN_clear_free, vFp)
+GO(BN_cmp, iFpp)
+//GO(bn_cmp_part_words,
+//GO(bn_cmp_words,
+GO(BN_consttime_swap, vFLppi)
+GO(BN_copy, pFpp)
+GO(BN_CTX_end, vFp)
+GO(BN_CTX_free, vFp)
+GO(BN_CTX_get, pFp)
+GO(BN_CTX_init, vFp)
+GO(BN_CTX_new, pFv)
+//GO(BN_CTX_start,
+GO(BN_dec2bn, iFpp)
+GO(BN_div, iFppppp)
+GO(BN_div_recp, iFppppp)
+GO(BN_div_word, LFpL)
+//GO(bn_div_words,
+GO(BN_dup, pFp)
+//GO(bn_dup_expand,
+GO(BN_exp, iFpppp)
+//GO(bn_expand2,
+GO(BN_free, vFp)
+GO(BN_from_montgomery, iFpppp)
+GO(BN_gcd, iFpppp)
+GO(BN_GENCB_call, iFpii)
+//GO(BN_generate_prime, pFpiippBp) //callback previous last argument...
+GO(BN_generate_prime_ex, iFpiippp)
+//GO(BN_get0_nist_prime_192,
+//GO(BN_get0_nist_prime_224,
+//GO(BN_get0_nist_prime_256,
+//GO(BN_get0_nist_prime_384,
+GO(BN_get0_nist_prime_521, pFv)
+GO(BN_get_params, iFi)
+GO(BN_get_word, LFp)
+//GO(BN_GF2m_add,
+GO(BN_GF2m_arr2poly, iFpp)
+GO(BN_GF2m_mod, iFppp)
+GO(BN_GF2m_mod_arr, iFppp)
+//GO(BN_GF2m_mod_div,
+//GO(BN_GF2m_mod_div_arr,
+GO(BN_GF2m_mod_exp, iFppppp)
+GO(BN_GF2m_mod_exp_arr, iFppppp)
+//GO(BN_GF2m_mod_inv,
+//GO(BN_GF2m_mod_inv_arr,
+//GO(BN_GF2m_mod_mul,
+//GO(BN_GF2m_mod_mul_arr,
+//GO(BN_GF2m_mod_solve_quad,
+GO(BN_GF2m_mod_solve_quad_arr, iFpppp)
+//GO(BN_GF2m_mod_sqr,
+//GO(BN_GF2m_mod_sqr_arr,
+//GO(BN_GF2m_mod_sqrt,
+//GO(BN_GF2m_mod_sqrt_arr,
+//GO(bn_GF2m_mul_2x2,
+GO(BN_GF2m_poly2arr, iFppi)
+GO(BN_hex2bn, iFpp)
+//GO(BN_init,
+GO(BN_is_bit_set, iFpi)
+//GO(BN_is_prime, iFpiBpp) // third argument is a callback
+GO(BN_is_prime_ex, iFpipp)
+//GO(BN_is_prime_fasttest,
+GO(BN_is_prime_fasttest_ex, iFpipip)
+GO(BN_is_zero, iFp)
+GO(BN_kronecker, iFppp)
+GO(BN_lshift, iFppi)
+GO(BN_lshift1, iFpp)
+GO(BN_mask_bits, iFpi)
+GO(BN_mod_add, iFppppp)
+//GO(BN_mod_add_quick,
+GO(BN_mod_exp, iFppppp)
+GO(BN_mod_exp2_mont, iFpppppppp)
+//GO(BN_mod_exp_mont,
+GO(BN_mod_exp_mont_consttime, iFpppppp)
+GO(BN_mod_exp_mont_word, iFpLpppp)
+//GO(BN_mod_exp_recp,
+//GO(BN_mod_exp_simple,
+GO(BN_mod_inverse, pFpppp)
+GO(BN_mod_lshift, iFppipp)
+//GO(BN_mod_lshift1,
+//GO(BN_mod_lshift1_quick,
+GO(BN_mod_lshift_quick, iFppip)
+GO(BN_mod_mul, iFppppp)
+GO(BN_mod_mul_montgomery, iFppppp)
+GO(BN_mod_mul_reciprocal, iFppppp)
+GO(BN_mod_sqr, iFpppp)
+GO(BN_mod_sqrt, pFpppp)
+GO(BN_mod_sub, iFppppp)
+GO(BN_mod_sub_quick, iFpppp)
+GO(BN_mod_word, LFpL)
+GO(BN_MONT_CTX_copy, pFpp)
+GO(BN_MONT_CTX_free, vFp)
+//GO(BN_MONT_CTX_init,
+GO(BN_MONT_CTX_new, pFv)
+GO(BN_MONT_CTX_set, iFppp)
+GO(BN_MONT_CTX_set_locked, pFpppp)
+GO(BN_mpi2bn, pFpip)
+GO(BN_mul, iFpppp)
+//GO(bn_mul_add_words,
+//GO(bn_mul_comba4,
+//GO(bn_mul_comba8,
+//GO(bn_mul_high,
+//GO(bn_mul_low_normal,
+//GO(bn_mul_low_recursive,
+//GO(bn_mul_mont,
+//GO(bn_mul_normal,
+//GO(bn_mul_part_recursive,
+//GO(bn_mul_recursive,
+GO(BN_mul_word, iFpu)
+//GO(bn_mul_words,
+GO(BN_new, pFv)
+//GO(BN_nist_mod_192,
+//GO(BN_nist_mod_224,
+//GO(BN_nist_mod_256,
+//GO(BN_nist_mod_384,
+GO(BN_nist_mod_521, iFpppp)
+GO(BN_nnmod, iFpppp)
+GO(BN_num_bits, iFp)
+GO(BN_num_bits_word, iFL)
+GO(BN_one, iFp)
+GO(BN_options, pFv)
+GO(BN_print, iFpp)
+GO(BN_print_fp, iFpp)
+GO(BN_pseudo_rand, iFpiii)
+GO(BN_pseudo_rand_range, iFpp)
+GO(BN_rand, iFpiii)
+//GO(BN_rand_range,
+GO(BN_reciprocal, iFppip)
+GO(BN_RECP_CTX_free, vFp)
+//GO(BN_RECP_CTX_init,
+GO(BN_RECP_CTX_new, pFv)
+GO(BN_RECP_CTX_set, iFppp)
+GO(BN_rshift, iFppi)
+GO(BN_rshift1, iFpp)
+GO(BN_set_bit, iFpi)
+GO(BN_set_negative, vFpi)
+GO(BN_set_params, vFiiii)
+GO(BN_set_word, iFpL)
+GO(BN_sqr, iFppp)
+//GO(bn_sqr_comba4,
+//GO(bn_sqr_comba8,
+//GO(bn_sqr_normal,
+//GO(bn_sqr_recursive,
+//GO(bn_sqr_words,
+GO(BN_sub, iFppp)
+//GO(bn_sub_part_words,
+GO(BN_sub_word, iFpu)
+//GO(bn_sub_words,
+GO(BN_swap, vFpp)
+GO(BN_to_ASN1_ENUMERATED, pFpp)
+GO(BN_to_ASN1_INTEGER, pFpp)
+//GO(BN_uadd,
+GO(BN_ucmp, iFpp)
+//GO(BN_usub,
+GO(BN_value_one, pFv)
+GO(BN_X931_derive_prime_ex, iFppppppppp)
+GO(BN_X931_generate_prime_ex, iFppppppppp)
+GO(BN_X931_generate_Xpq, iFppip)
+GO(BN_zero, vFp)
+//GO(bsaes_cbc_encrypt,
+//GO(bsaes_ctr32_encrypt_blocks,
+//GO(bsaes_xts_decrypt,
+//GO(bsaes_xts_encrypt,
+//GO(BUF_memdup,
+//GO(BUF_MEM_free,
+//GO(BUF_MEM_grow,
+//GO(BUF_MEM_grow_clean,
+//GO(BUF_MEM_new,
+//GO(BUF_reverse,
+//GO(BUF_strdup,
+//GO(BUF_strlcat,
+//GO(BUF_strlcpy,
+//GO(BUF_strndup,
+//GO(BUF_strnlen,
+//GO(c2i_ASN1_BIT_STRING,
+//GO(c2i_ASN1_INTEGER,
+//GO(c2i_ASN1_OBJECT,
+//GO(Camellia_cbc_encrypt,
+//GO(Camellia_cfb128_encrypt,
+//GO(Camellia_cfb1_encrypt,
+//GO(Camellia_cfb8_encrypt,
+//GO(Camellia_ctr128_encrypt,
+//GO(Camellia_decrypt,
+//GO(Camellia_DecryptBlock,
+//GO(Camellia_DecryptBlock_Rounds,
+//GO(Camellia_ecb_encrypt,
+//GO(Camellia_Ekeygen,
+//GO(Camellia_encrypt,
+//GO(Camellia_EncryptBlock,
+//GO(Camellia_EncryptBlock_Rounds,
+//GO(Camellia_ofb128_encrypt,
+//GO(Camellia_set_key,
+//GO(CAST_cbc_encrypt,
+//GO(CAST_cfb64_encrypt,
+//GO(CAST_decrypt,
+//GO(CAST_ecb_encrypt,
+//GO(CAST_encrypt,
+//GO(CAST_ofb64_encrypt,
+//GO(CAST_set_key,
+//GO(CERTIFICATEPOLICIES_free,
+//GO(CERTIFICATEPOLICIES_new,
+//GO(check_defer,
+//GO(CMAC_CTX_cleanup,
+//GO(CMAC_CTX_copy,
+//GO(CMAC_CTX_free,
+//GO(CMAC_CTX_get0_cipher_ctx,
+//GO(CMAC_CTX_new,
+//GO(CMAC_Final,
+//GO(CMAC_Init,
+//GO(CMAC_resume,
+//GO(CMAC_Update,
+//GO(CMS_add0_cert,
+//GO(CMS_add0_CertificateChoices,
+//GO(CMS_add0_crl,
+//GO(CMS_add0_recipient_key,
+//GO(CMS_add0_recipient_password,
+//GO(CMS_add0_RevocationInfoChoice,
+//GO(CMS_add1_cert,
+//GO(CMS_add1_crl,
+//GO(CMS_add1_ReceiptRequest,
+//GO(CMS_add1_recipient_cert,
+//GO(CMS_add1_signer,
+//GO(CMS_add_simple_smimecap,
+//GO(CMS_add_smimecap,
+//GO(CMS_add_standard_smimecap,
+//GO(CMS_compress,
+//GO(cms_CompressedData_create,
+//GO(cms_CompressedData_init_bio,
+//GO(cms_content_bio,
+//GO(CMS_ContentInfo_free,
+//GO(CMS_ContentInfo_new,
+//GO(CMS_ContentInfo_print_ctx,
+//GO(CMS_data,
+//GO(cms_Data_create,
+//GO(CMS_data_create,
+//GO(CMS_dataFinal,
+//GO(CMS_dataInit,
+//GO(CMS_decrypt,
+//GO(CMS_decrypt_set1_key,
+//GO(CMS_decrypt_set1_password,
+//GO(CMS_decrypt_set1_pkey,
+//GO(cms_DigestAlgorithm_find_ctx,
+//GO(cms_DigestAlgorithm_init_bio,
+//GO(cms_DigestAlgorithm_set,
+//GO(CMS_digest_create,
+//GO(cms_DigestedData_create,
+//GO(cms_DigestedData_do_final,
+//GO(cms_DigestedData_init_bio,
+//GO(CMS_digest_verify,
+//GO(cms_encode_Receipt,
+//GO(CMS_encrypt,
+//GO(cms_EncryptedContent_init,
+//GO(cms_EncryptedContent_init_bio,
+//GO(CMS_EncryptedData_decrypt,
+//GO(CMS_EncryptedData_encrypt,
+//GO(cms_EncryptedData_init_bio,
+//GO(CMS_EncryptedData_set1_key,
+//GO(cms_env_asn1_ctrl,
+//GO(CMS_EnvelopedData_create,
+//GO(cms_EnvelopedData_init_bio,
+//GO(CMS_final,
+//GO(CMS_get0_content,
+//GO(CMS_get0_eContentType,
+//GO(cms_get0_enveloped,
+//GO(CMS_get0_RecipientInfos,
+//GO(CMS_get0_SignerInfos,
+//GO(CMS_get0_signers,
+//GO(CMS_get0_type,
+//GO(CMS_get1_certs,
+//GO(CMS_get1_crls,
+//GO(CMS_get1_ReceiptRequest,
+//GO(cms_ias_cert_cmp,
+//GO(CMS_is_detached,
+//GO(cms_keyid_cert_cmp,
+//GO(cms_msgSigDigest_add1,
+//GO(cms_pkey_get_ri_type,
+//GO(CMS_ReceiptRequest_create0,
+//GO(CMS_ReceiptRequest_free,
+//GO(CMS_ReceiptRequest_get0_values,
+//GO(CMS_ReceiptRequest_new,
+//GO(cms_Receipt_verify,
+//GO(CMS_RecipientEncryptedKey_cert_cmp,
+//GO(CMS_RecipientEncryptedKey_get0_id,
+//GO(CMS_RecipientInfo_decrypt,
+//GO(CMS_RecipientInfo_encrypt,
+//GO(CMS_RecipientInfo_get0_pkey_ctx,
+//GO(CMS_RecipientInfo_kari_decrypt,
+//GO(cms_RecipientInfo_kari_encrypt,
+//GO(CMS_RecipientInfo_kari_get0_alg,
+//GO(CMS_RecipientInfo_kari_get0_ctx,
+//GO(CMS_RecipientInfo_kari_get0_orig_id,
+//GO(CMS_RecipientInfo_kari_get0_reks,
+//GO(cms_RecipientInfo_kari_init,
+//GO(CMS_RecipientInfo_kari_orig_id_cmp,
+//GO(CMS_RecipientInfo_kari_set0_pkey,
+//GO(CMS_RecipientInfo_kekri_get0_id,
+//GO(CMS_RecipientInfo_kekri_id_cmp,
+//GO(CMS_RecipientInfo_ktri_cert_cmp,
+//GO(CMS_RecipientInfo_ktri_get0_algs,
+//GO(CMS_RecipientInfo_ktri_get0_signer_id,
+//GO(cms_RecipientInfo_pwri_crypt,
+//GO(CMS_RecipientInfo_set0_key,
+//GO(CMS_RecipientInfo_set0_password,
+//GO(CMS_RecipientInfo_set0_pkey,
+//GO(CMS_RecipientInfo_type,
+//GO(CMS_set1_eContentType,
+//GO(cms_set1_ias,
+//GO(cms_set1_keyid,
+//GO(cms_set1_SignerIdentifier,
+//GO(CMS_set1_signers_certs,
+//GO(CMS_set_detached,
+//GO(CMS_SharedInfo_encode,
+//GO(CMS_sign,
+//GO(CMS_signed_add1_attr,
+//GO(CMS_signed_add1_attr_by_NID,
+//GO(CMS_signed_add1_attr_by_OBJ,
+//GO(CMS_signed_add1_attr_by_txt,
+//GO(cms_SignedData_final,
+//GO(CMS_SignedData_init,
+//GO(cms_SignedData_init_bio,
+//GO(CMS_signed_delete_attr,
+//GO(CMS_signed_get0_data_by_OBJ,
+//GO(CMS_signed_get_attr,
+//GO(CMS_signed_get_attr_by_NID,
+//GO(CMS_signed_get_attr_by_OBJ,
+//GO(CMS_signed_get_attr_count,
+//GO(cms_SignerIdentifier_cert_cmp,
+//GO(cms_SignerIdentifier_get0_signer_id,
+//GO(CMS_SignerInfo_cert_cmp,
+//GO(CMS_SignerInfo_get0_algs,
+//GO(CMS_SignerInfo_get0_md_ctx,
+//GO(CMS_SignerInfo_get0_pkey_ctx,
+//GO(CMS_SignerInfo_get0_signature,
+//GO(CMS_SignerInfo_get0_signer_id,
+//GO(CMS_SignerInfo_set1_signer_cert,
+//GO(CMS_SignerInfo_sign,
+//GO(CMS_SignerInfo_verify,
+//GO(CMS_SignerInfo_verify_content,
+//GO(CMS_sign_receipt,
+//GO(CMS_stream,
+//GO(CMS_uncompress,
+//GO(CMS_unsigned_add1_attr,
+//GO(CMS_unsigned_add1_attr_by_NID,
+//GO(CMS_unsigned_add1_attr_by_OBJ,
+//GO(CMS_unsigned_add1_attr_by_txt,
+//GO(CMS_unsigned_delete_attr,
+//GO(CMS_unsigned_get0_data_by_OBJ,
+//GO(CMS_unsigned_get_attr,
+//GO(CMS_unsigned_get_attr_by_NID,
+//GO(CMS_unsigned_get_attr_by_OBJ,
+//GO(CMS_unsigned_get_attr_count,
+//GO(CMS_verify,
+//GO(CMS_verify_receipt,
+//GO(COMP_compress_block,
+//GO(COMP_CTX_free,
+//GO(COMP_CTX_new,
+//GO(COMP_expand_block,
+//GO(COMP_rle,
+//GO(COMP_zlib,
+//GO(COMP_zlib_cleanup,
+//GO(_CONF_add_string,
+//GO(CONF_dump_bio,
+//GO(CONF_dump_fp,
+//GO(CONF_free,
+//GO(_CONF_free_data,
+//GO(CONF_get1_default_config_file,
+//GO(CONF_get_number,
+//GO(_CONF_get_section,
+//GO(CONF_get_section,
+//GO(_CONF_get_section_values,
+//GO(_CONF_get_string,
+//GO(CONF_get_string,
+//GO(CONF_imodule_get_flags,
+//GO(CONF_imodule_get_module,
+//GO(CONF_imodule_get_name,
+//GO(CONF_imodule_get_usr_data,
+//GO(CONF_imodule_get_value,
+//GO(CONF_imodule_set_flags,
+//GO(CONF_imodule_set_usr_data,
+//GO(CONF_load,
+//GO(CONF_load_bio,
+//GO(CONF_load_fp,
+//GO(CONF_module_add,
+//GO(CONF_module_get_usr_data,
+//GO(CONF_module_set_usr_data,
+//GO(CONF_modules_finish,
+//GO(CONF_modules_free,
+//GO(CONF_modules_load,
+//GO(CONF_modules_load_file,
+GO(CONF_modules_unload, vFi)
+//GO(_CONF_new_data,
+//GO(_CONF_new_section,
+//GO(CONF_parse_list,
+//GO(CONF_set_default_method,
+//GO(CONF_set_nconf,
+//GO(CRL_DIST_POINTS_free,
+//GO(CRL_DIST_POINTS_new,
+//GO(CRYPTO_128_unwrap,
+//GO(CRYPTO_128_wrap,
+GO(CRYPTO_add_lock, iFpiipi)
+//GO(CRYPTO_cbc128_decrypt,
+//GO(CRYPTO_cbc128_encrypt,
+//GO(CRYPTO_ccm128_aad,
+//GO(CRYPTO_ccm128_decrypt,
+//GO(CRYPTO_ccm128_decrypt_ccm64,
+//GO(CRYPTO_ccm128_encrypt,
+//GO(CRYPTO_ccm128_encrypt_ccm64,
+//GO(CRYPTO_ccm128_init,
+//GO(CRYPTO_ccm128_setiv,
+//GO(CRYPTO_ccm128_tag,
+//GO(CRYPTO_cfb128_1_encrypt,
+//GO(CRYPTO_cfb128_8_encrypt,
+//GO(CRYPTO_cfb128_encrypt,
+GO(CRYPTO_cleanup_all_ex_data, vFv)
+//GO(CRYPTO_ctr128_encrypt,
+//GO(CRYPTO_ctr128_encrypt_ctr32,
+//GO(CRYPTO_cts128_decrypt,
+//GO(CRYPTO_cts128_decrypt_block,
+//GO(CRYPTO_cts128_encrypt,
+//GO(CRYPTO_cts128_encrypt_block,
+//GO(CRYPTO_dbg_free,
+//GO(CRYPTO_dbg_get_options,
+//GO(CRYPTO_dbg_malloc,
+//GO(CRYPTO_dbg_realloc,
+//GO(CRYPTO_dbg_set_options,
+//GO(CRYPTO_destroy_dynlockid,
+GO(CRYPTO_dup_ex_data, iFipp)
+//GO(CRYPTO_ex_data_new_class,
+GO(CRYPTO_free, vFppi)
+GO(CRYPTO_free_ex_data, vFipp)
+//GO(CRYPTO_free_locked,
+//GO(CRYPTO_gcm128_aad,
+//GO(CRYPTO_gcm128_decrypt,
+//GO(CRYPTO_gcm128_decrypt_ctr32,
+//GO(CRYPTO_gcm128_encrypt,
+//GO(CRYPTO_gcm128_encrypt_ctr32,
+//GO(CRYPTO_gcm128_finish,
+//GO(CRYPTO_gcm128_init,
+//GO(CRYPTO_gcm128_new,
+//GO(CRYPTO_gcm128_release,
+//GO(CRYPTO_gcm128_setiv,
+//GO(CRYPTO_gcm128_tag,
+//GO(CRYPTO_get_add_lock_callback,
+//GO(CRYPTO_get_dynlock_create_callback,
+//GO(CRYPTO_get_dynlock_destroy_callback,
+//GO(CRYPTO_get_dynlock_lock_callback,
+//GO(CRYPTO_get_dynlock_value,
+GO(CRYPTO_get_ex_data, pFpi)
+//GO(CRYPTO_get_ex_data_implementation,
+//GO(CRYPTO_get_ex_new_index,
+//GO(CRYPTO_get_id_callback,
+//GO(CRYPTO_get_locked_mem_ex_functions,
+//GO(CRYPTO_get_locked_mem_functions,
+//GO(CRYPTO_get_locking_callback,
+//GO(CRYPTO_get_lock_name,
+//GO(CRYPTO_get_mem_debug_functions,
+//GO(CRYPTO_get_mem_debug_options,
+//GO(CRYPTO_get_mem_ex_functions,
+GO(CRYPTO_get_mem_functions, vFppp)
+//GO(CRYPTO_get_new_dynlockid,
+//GO(CRYPTO_get_new_lockid,
+//GO(CRYPTO_is_mem_check_on,
+//GO(CRYPTO_lock,
+GO(CRYPTO_malloc, pFupi)
+//GO(CRYPTO_malloc_locked,
+GO(CRYPTO_memcmp, iFppL)
+//GO(CRYPTO_mem_ctrl,
+//GO(CRYPTO_mem_leaks,
+//GO(CRYPTO_mem_leaks_cb,
+//GO(CRYPTO_mem_leaks_fp,
+GO(CRYPTO_new_ex_data, iFipp)
+//GO(CRYPTO_nistcts128_decrypt,
+//GO(CRYPTO_nistcts128_decrypt_block,
+//GO(CRYPTO_nistcts128_encrypt,
+//GO(CRYPTO_nistcts128_encrypt_block,
+GO(CRYPTO_num_locks, iFv)
+//GO(CRYPTO_ofb128_encrypt,
+//GO(CRYPTO_pop_info,
+//GO(CRYPTO_push_info_,
+GO(CRYPTO_realloc, pFpLpi)
+//GO(CRYPTO_realloc_clean,
+//GO(CRYPTO_remalloc,
+//GO(CRYPTO_remove_all_info,
+//GO(CRYPTO_set_add_lock_callback,
+//GO(CRYPTO_set_dynlock_create_callback,
+//GO(CRYPTO_set_dynlock_destroy_callback,
+//GO(CRYPTO_set_dynlock_lock_callback,
+GO(CRYPTO_set_ex_data, iFpip)
+//GO(CRYPTO_set_ex_data_implementation,
+GOM(CRYPTO_set_id_callback, vFEp)
+//GO(CRYPTO_set_locked_mem_ex_functions,
+//GO(CRYPTO_set_locked_mem_functions,
+GOM(CRYPTO_set_locking_callback, vFEp)
+//GO(CRYPTO_set_mem_debug_functions,
+//GO(CRYPTO_set_mem_debug_options,
+//GO(CRYPTO_set_mem_ex_functions,
+//GO(CRYPTO_set_mem_functions,
+GO(CRYPTO_strdup, pFppi)
+//GO(CRYPTO_thread_id,
+//GO(CRYPTO_THREADID_cmp,
+//GO(CRYPTO_THREADID_cpy,
+//GO(CRYPTO_THREADID_current,
+//GO(CRYPTO_THREADID_get_callback,
+//GO(CRYPTO_THREADID_hash,
+//GO(CRYPTO_THREADID_set_callback,
+//GO(CRYPTO_THREADID_set_numeric,
+//GO(CRYPTO_THREADID_set_pointer,
+//GO(CRYPTO_xts128_encrypt,
+//GO(d2i_ACCESS_DESCRIPTION,
+GO(d2i_ASN1_BIT_STRING, pFppl)
+GO(d2i_ASN1_BMPSTRING, pFppl)
+//GO(d2i_ASN1_BOOLEAN,
+//GO(d2i_ASN1_bytes,
+GO(d2i_ASN1_ENUMERATED, pFppl)
+GO(d2i_ASN1_GENERALIZEDTIME, pFppl)
+GO(d2i_ASN1_GENERALSTRING, pFppl)
+GO(d2i_ASN1_IA5STRING, pFppl)
+//GO(d2i_ASN1_INTEGER,
+GO(d2i_ASN1_NULL, pFppl)
+GO(d2i_ASN1_OBJECT, pFppl)
+GO(d2i_ASN1_OCTET_STRING, pFppl)
+//GO(d2i_ASN1_PRINTABLE,
+GO(d2i_ASN1_PRINTABLESTRING, pFppl)
+//GO(d2i_ASN1_SEQUENCE_ANY,
+//GO(d2i_ASN1_SET,
+GO(d2i_ASN1_SET_ANY, pFppl)
+GO(d2i_ASN1_T61STRING, pFppl)
+GO(d2i_ASN1_TIME, pFppl)
+GO(d2i_ASN1_TYPE, pFppl)
+//GO(d2i_ASN1_type_bytes,
+GO(d2i_ASN1_UINTEGER, pFppl)
+GO(d2i_ASN1_UNIVERSALSTRING, pFppl)
+GO(d2i_ASN1_UTCTIME, pFppl)
+GO(d2i_ASN1_UTF8STRING, pFppl)
+GO(d2i_ASN1_VISIBLESTRING, pFppl)
+//GO(d2i_AUTHORITY_INFO_ACCESS,
+//GO(d2i_AUTHORITY_KEYID,
+GO(d2i_AutoPrivateKey, pFppl)
+GO(d2i_BASIC_CONSTRAINTS, pFppl)
+//GO(d2i_CERTIFICATEPOLICIES,
+//GO(d2i_CMS_bio,
+//GO(d2i_CMS_ContentInfo,
+//GO(d2i_CMS_ReceiptRequest,
+//GO(d2i_CRL_DIST_POINTS,
+GO(d2i_DHparams, pFppl)
+//GO(d2i_DHxparams,
+//GO(d2i_DIRECTORYSTRING,
+GO(d2i_DISPLAYTEXT, pFppl)
+//GO(d2i_DIST_POINT,
+//GO(d2i_DIST_POINT_NAME,
+//GO(d2i_DSAparams,
+GO(d2i_DSAPrivateKey, pFppl)
+GO(d2i_DSAPrivateKey_bio, pFpp)
+GO(d2i_DSAPrivateKey_fp, pFpp)
+GO(d2i_DSA_PUBKEY, pFppl)
+GO(d2i_DSA_PUBKEY_bio, pFpp)
+GO(d2i_DSA_PUBKEY_fp, pFpp)
+//GO(d2i_DSAPublicKey,
+//GO(d2i_DSA_SIG,
+//GO(d2i_ECDSA_SIG,
+//GO(d2i_ECParameters,
+//GO(d2i_ECPKParameters,
+//GO(d2i_ECPKPARAMETERS,
+//GO(d2i_ECPrivateKey,
+GO(d2i_EC_PRIVATEKEY, pFppl)
+GO(d2i_ECPrivateKey_bio, pFpp)
+GO(d2i_ECPrivateKey_fp, pFpp)
+GO(d2i_EC_PUBKEY, pFppl)
+GO(d2i_EC_PUBKEY_bio, pFpp)
+GO(d2i_EC_PUBKEY_fp, pFpp)
+//GO(d2i_EDIPARTYNAME,
+//GO(d2i_ESS_CERT_ID,
+//GO(d2i_ESS_ISSUER_SERIAL,
+//GO(d2i_ESS_SIGNING_CERT,
+GO(d2i_EXTENDED_KEY_USAGE, pFppl)
+//GO(d2i_GENERAL_NAME,
+//GO(d2i_GENERAL_NAMES,
+//GO(d2i_int_dhx,
+//GO(d2i_ISSUING_DIST_POINT,
+//GO(d2i_KRB5_APREQ,
+//GO(d2i_KRB5_APREQBODY,
+//GO(d2i_KRB5_AUTHDATA,
+//GO(d2i_KRB5_AUTHENT,
+//GO(d2i_KRB5_AUTHENTBODY,
+//GO(d2i_KRB5_CHECKSUM,
+//GO(d2i_KRB5_ENCDATA,
+//GO(d2i_KRB5_ENCKEY,
+//GO(d2i_KRB5_PRINCNAME,
+//GO(d2i_KRB5_TICKET,
+//GO(d2i_KRB5_TKTBODY,
+//GO(d2i_NETSCAPE_CERT_SEQUENCE,
+//GO(d2i_NETSCAPE_ENCRYPTED_PKEY,
+//GO(d2i_NETSCAPE_PKEY,
+//GO(d2i_Netscape_RSA,
+//GO(d2i_NETSCAPE_SPKAC,
+//GO(d2i_NETSCAPE_SPKI,
+//GO(d2i_NETSCAPE_X509,
+//GO(d2i_NOTICEREF,
+//GO(d2i_OCSP_BASICRESP,
+//GO(d2i_OCSP_CERTID,
+//GO(d2i_OCSP_CERTSTATUS,
+//GO(d2i_OCSP_CRLID,
+//GO(d2i_OCSP_ONEREQ,
+//GO(d2i_OCSP_REQINFO,
+//GO(d2i_OCSP_REQUEST,
+//GO(d2i_OCSP_RESPBYTES,
+//GO(d2i_OCSP_RESPDATA,
+//GO(d2i_OCSP_RESPID,
+GO(d2i_OCSP_RESPONSE, pFppl)
+//GO(d2i_OCSP_REVOKEDINFO,
+//GO(d2i_OCSP_SERVICELOC,
+//GO(d2i_OCSP_SIGNATURE,
+//GO(d2i_OCSP_SINGLERESP,
+//GO(d2i_OTHERNAME,
+//GO(d2i_PBE2PARAM,
+//GO(d2i_PBEPARAM,
+//GO(d2i_PBKDF2PARAM,
+GO(d2i_PKCS12, pFppl)
+//GO(d2i_PKCS12_BAGS,
+GO(d2i_PKCS12_bio, pFpp)
+GO(d2i_PKCS12_fp, pFpp)
+//GO(d2i_PKCS12_MAC_DATA,
+//GO(d2i_PKCS12_SAFEBAG,
+GO(d2i_PKCS7, pFppl)
+GO(d2i_PKCS7_bio, pFpp)
+//GO(d2i_PKCS7_DIGEST,
+//GO(d2i_PKCS7_ENC_CONTENT,
+//GO(d2i_PKCS7_ENCRYPT,
+//GO(d2i_PKCS7_ENVELOPE,
+GO(d2i_PKCS7_fp, pFpp)
+//GO(d2i_PKCS7_ISSUER_AND_SERIAL,
+//GO(d2i_PKCS7_RECIP_INFO,
+//GO(d2i_PKCS7_SIGNED,
+//GO(d2i_PKCS7_SIGN_ENVELOPE,
+//GO(d2i_PKCS7_SIGNER_INFO,
+GO(d2i_PKCS8_bio, pFpp)
+GO(d2i_PKCS8_fp, pFpp)
+GO(d2i_PKCS8PrivateKey_bio, pFpp)
+GO(d2i_PKCS8PrivateKey_fp, pFpp)
+GO(d2i_PKCS8_PRIV_KEY_INFO, pFppl)
+GO(d2i_PKCS8_PRIV_KEY_INFO_bio, pFpp)
+GO(d2i_PKCS8_PRIV_KEY_INFO_fp, pFpp)
+//GO(d2i_PKEY_USAGE_PERIOD,
+//GO(d2i_POLICYINFO,
+//GO(d2i_POLICYQUALINFO,
+GO(d2i_PrivateKey, pFppl)
+GO(d2i_PrivateKey_bio, pFpp)
+GO(d2i_PrivateKey_fp, pFpp)
+//GO(d2i_PROXY_CERT_INFO_EXTENSION,
+//GO(d2i_PROXY_POLICY,
+GO(d2i_PUBKEY, pFppl)
+GO(d2i_PUBKEY_bio, pFpp)
+GO(d2i_PUBKEY_fp, pFpp)
+//GO(d2i_PublicKey,
+//GO(d2i_RSA_NET,
+//GO(d2i_RSA_OAEP_PARAMS,
+GO(d2i_RSAPrivateKey, pFppl)
+GO(d2i_RSAPrivateKey_bio, pFpp)
+GO(d2i_RSAPrivateKey_fp, pFpp)
+//GO(d2i_RSA_PSS_PARAMS,
+GO(d2i_RSA_PUBKEY, pFppl)
+GO(d2i_RSA_PUBKEY_bio, pFpp)
+GO(d2i_RSA_PUBKEY_fp, pFpp)
+GO(d2i_RSAPublicKey, pFppl)
+GO(d2i_RSAPublicKey_bio, pFpp)
+GO(d2i_RSAPublicKey_fp, pFpp)
+//GO(d2i_SXNET,
+//GO(d2i_SXNETID,
+//GO(d2i_TS_ACCURACY,
+GO(d2i_TS_MSG_IMPRINT, pFppl)
+GO(d2i_TS_MSG_IMPRINT_bio, pFpp)
+GO(d2i_TS_MSG_IMPRINT_fp, pFpp)
+GO(d2i_TS_REQ, pFppl)
+GO(d2i_TS_REQ_bio, pFpp)
+GO(d2i_TS_REQ_fp, pFpp)
+GO(d2i_TS_RESP, pFppl)
+GO(d2i_TS_RESP_bio, pFpp)
+GO(d2i_TS_RESP_fp, pFpp)
+//GO(d2i_TS_STATUS_INFO,
+GO(d2i_TS_TST_INFO, pFppl)
+GO(d2i_TS_TST_INFO_bio, pFpp)
+GO(d2i_TS_TST_INFO_fp, pFpp)
+//GO(d2i_USERNOTICE,
+GO(d2i_X509, pFppl)
+//GO(d2i_X509_ALGOR,
+//GO(d2i_X509_ALGORS,
+//GO(d2i_X509_ATTRIBUTE,
+//GO(d2i_X509_AUX,
+GO(d2i_X509_bio, pFpp)
+//GO(d2i_X509_CERT_AUX,
+//GO(d2i_X509_CERT_PAIR,
+//GO(d2i_X509_CINF,
+GO(d2i_X509_CRL, pFppl)
+GO(d2i_X509_CRL_bio, pFpp)
+GO(d2i_X509_CRL_fp, pFpp)
+//GO(d2i_X509_CRL_INFO,
+//GO(d2i_X509_EXTENSION,
+//GO(d2i_X509_EXTENSIONS,
+GO(d2i_X509_fp, pFppl)
+GO(d2i_X509_NAME, pFppl)
+//GO(d2i_X509_NAME_ENTRY,
+//GO(d2i_X509_PKEY,
+//GO(d2i_X509_PUBKEY,
+GO(d2i_X509_REQ, pFppl)
+GO(d2i_X509_REQ_bio, pFpp)
+GO(d2i_X509_REQ_fp, pFpp)
+//GO(d2i_X509_REQ_INFO,
+//GO(d2i_X509_REVOKED,
+//GO(d2i_X509_SIG,
+//GO(d2i_X509_VAL,
+GO(DES_cbc_cksum, uFppipp)
+GO(DES_cbc_encrypt, vFppippi)
+GO(DES_cfb64_encrypt, vFppippppi)
+GO(DES_cfb_encrypt, vFppilppi)
+//GO(DES_check_key_parity,
+//GO(_des_crypt,
+GO(DES_crypt, pFpp)
+//GO(DES_decrypt3,
+GO(DES_ecb3_encrypt, vFpppppi)
+GO(DES_ecb_encrypt, vFpppi)
+GO(DES_ede3_cbc_encrypt, vFppippppi)
+//GO(DES_ede3_cbcm_encrypt,
+GO(DES_ede3_cfb64_encrypt, vFpplpppppi)
+//GO(DES_ede3_cfb_encrypt,
+GO(DES_ede3_ofb64_encrypt, vFpplppppp)
+//GO(DES_enc_read,
+//GO(DES_encrypt1,
+//GO(DES_encrypt2,
+//GO(DES_encrypt3,
+//GO(DES_enc_write,
+GO(DES_fcrypt, pFppp)
+GO(DES_is_weak_key, iFp)
+GO(DES_key_sched, iFpp)
+GO(DES_ncbc_encrypt, vFpplppi)
+GO(DES_ofb64_encrypt, vFpplppp)
+GO(DES_ofb_encrypt, vFppilpp)
+//GO(DES_options,
+GO(DES_pcbc_encrypt, vFppippi)
+GO(DES_quad_cksum, uFpplip)
+GO(DES_random_key, vFp)
+//GO(DES_read_2passwords,
+//GO(DES_read_password,
+GO(DES_set_key, iFpp)
+GO(DES_set_key_checked, iFpp)
+GO(DES_set_key_unchecked, iFpp)
+GO(DES_set_odd_parity, vFp)
+GO(DES_string_to_2keys, vFppp)
+GO(DES_string_to_key, vFpp)
+GO(DES_xcbc_encrypt, vFpplppppi)
+//GO(DH_check,
+//GO(DH_check_pub_key,
+//GO(DH_compute_key,
+//GO(DH_compute_key_padded,
+GO(DH_free, vFp)
+//GO(DH_generate_key,
+//GO(DH_generate_parameters,
+//GO(DH_generate_parameters_ex,
+//GO(DH_get_1024_160,
+//GO(DH_get_2048_224,
+//GO(DH_get_2048_256,
+//GO(DH_get_default_method,
+//GO(DH_get_ex_data,
+//GO(DH_get_ex_new_index,
+//GO(DH_KDF_X9_42,
+GO(DH_new, pFv)
+//GO(DH_new_method,
+//GO(DH_OpenSSL,
+//GO(DHparams_dup,
+//GO(DHparams_print,
+//GO(DHparams_print_fp,
+//GO(DH_set_default_method,
+//GO(DH_set_ex_data,
+//GO(DH_set_method,
+//GO(DH_size,
+//GO(DH_up_ref,
+//GO(DIRECTORYSTRING_free,
+//GO(DIRECTORYSTRING_new,
+GO(DISPLAYTEXT_free, vFp)
+GO(DISPLAYTEXT_new, pFv)
+//GO(DIST_POINT_free,
+//GO(DIST_POINT_NAME_free,
+//GO(DIST_POINT_NAME_new,
+//GO(DIST_POINT_new,
+//GO(DIST_POINT_set_dpname,
+//GO(dsa_builtin_paramgen,
+//GO(dsa_builtin_paramgen2,
+//GO(DSA_do_sign,
+//GO(DSA_do_verify,
+//GO(DSA_dup_DH,
+GO(DSA_free, vFp)
+GO(DSA_generate_key, iFp)
+//GO(DSA_generate_parameters,
+GO(DSA_generate_parameters_ex, iFpipippp)
+GO(DSA_get0_key, vFppp)
+GO(DSA_get0_pqg, vFpppp)
+//GO(DSA_get_default_method,
+//GO(DSA_get_ex_data,
+//GO(DSA_get_ex_new_index,
+GO(DSA_get_method, pFp)
+GO(DSA_new, pFv)
+//GO(DSA_new_method,
+GO(DSA_OpenSSL, pFv)
+//GO(dsa_paramgen_check_g,
+GO(DSA_set0_key, iFppp)
+GO(DSA_set0_pqg, iFppp)
+//GO(DSAparams_dup,
+//GO(DSAparams_print,
+//GO(DSAparams_print_fp,
+//GO(DSA_print,
+//GO(DSA_print_fp,
+//GO(DSA_set_default_method,
+//GO(DSA_set_ex_data,
+//GO(DSA_set_method,
+//GO(DSA_SIG_free,
+GO(DSA_sign, iFipippp)
+//GO(DSA_SIG_new,
+//GO(DSA_sign_setup,
+GO(DSA_size, iFp)
+GO(DSA_up_ref, iFp)
+GO(DSA_verify, iFipipip)
+//GO(DSO_bind_func,
+//GO(DSO_bind_var,
+//GO(DSO_convert_filename,
+//GO(DSO_ctrl,
+//GO(DSO_flags,
+//GO(DSO_free,
+//GO(DSO_get_default_method,
+//GO(DSO_get_filename,
+//GO(DSO_get_loaded_filename,
+//GO(DSO_get_method,
+//GO(DSO_global_lookup,
+//GO(DSO_load,
+//GO(DSO_merge,
+//GO(DSO_METHOD_beos,
+//GO(DSO_METHOD_dl,
+//GO(DSO_METHOD_dlfcn,
+//GO(DSO_METHOD_null,
+//GO(DSO_METHOD_openssl,
+//GO(DSO_METHOD_vms,
+//GO(DSO_METHOD_win32,
+//GO(DSO_new,
+//GO(DSO_new_method,
+//GO(DSO_pathbyaddr,
+//GO(DSO_set_default_method,
+//GO(DSO_set_filename,
+//GO(DSO_set_method,
+//GO(DSO_set_name_converter,
+//GO(DSO_up_ref,
+GO(EC_curve_nid2nist, pFi)
+GO(EC_curve_nist2nid, iFp)
+//GO(ecdh_check,
+//GO(ECDH_compute_key,
+//GO(ECDH_get_default_method,
+//GO(ECDH_get_ex_data,
+//GO(ECDH_get_ex_new_index,
+//GO(ECDH_KDF_X9_62,
+//GO(ECDH_OpenSSL,
+//GO(ECDH_set_default_method,
+//GO(ECDH_set_ex_data,
+//GO(ECDH_set_method,
+//GO(ecdsa_check,
+//GO(ECDSA_do_sign,
+GO(ECDSA_do_sign_ex, pFpippp)
+GO(ECDSA_do_verify, iFpipp)
+//GO(ECDSA_get_default_method,
+//GO(ECDSA_get_ex_data,
+//GO(ECDSA_get_ex_new_index,
+//GO(ECDSA_METHOD_free,
+//GO(ECDSA_METHOD_get_app_data,
+//GO(ECDSA_METHOD_new,
+//GO(ECDSA_METHOD_set_app_data,
+//GO(ECDSA_METHOD_set_flags,
+//GO(ECDSA_METHOD_set_name,
+//GO(ECDSA_METHOD_set_sign,
+//GO(ECDSA_METHOD_set_sign_setup,
+//GO(ECDSA_METHOD_set_verify,
+//GO(ECDSA_OpenSSL,
+//GO(ECDSA_set_default_method,
+//GO(ECDSA_set_ex_data,
+//GO(ECDSA_set_method,
+GO(ECDSA_SIG_free, vFp)
+GO(ECDSA_sign, iFipippp)
+GO(ECDSA_SIG_get0, vFppp)
+GO(ECDSA_SIG_new, pFv)
+GO(ECDSA_SIG_set0, iFppp)
+GO(ECDSA_sign_ex, iFipippppp)
+GO(ECDSA_sign_setup, iFpppp)
+GO(ECDSA_size, iFp)
+GO(ECDSA_verify, iFipipip)
+//GO(EC_EX_DATA_clear_free_all_data,
+//GO(EC_EX_DATA_clear_free_data,
+//GO(EC_EX_DATA_free_all_data,
+//GO(EC_EX_DATA_free_data,
+//GO(EC_EX_DATA_get_data,
+//GO(EC_EX_DATA_set_data,
+GO(EC_get_builtin_curves, LFpL)
+//GO(ec_GF2m_have_precompute_mult,
+//GO(ec_GF2m_precompute_mult,
+//GO(ec_GF2m_simple_add,
+//GO(ec_GF2m_simple_cmp,
+//GO(ec_GF2m_simple_dbl,
+//GO(ec_GF2m_simple_field_div,
+//GO(ec_GF2m_simple_field_mul,
+//GO(ec_GF2m_simple_field_sqr,
+//GO(ec_GF2m_simple_group_check_discriminant,
+//GO(ec_GF2m_simple_group_clear_finish,
+//GO(ec_GF2m_simple_group_copy,
+//GO(ec_GF2m_simple_group_finish,
+//GO(ec_GF2m_simple_group_get_curve,
+//GO(ec_GF2m_simple_group_get_degree,
+//GO(ec_GF2m_simple_group_init,
+//GO(ec_GF2m_simple_group_set_curve,
+//GO(ec_GF2m_simple_invert,
+//GO(ec_GF2m_simple_is_at_infinity,
+//GO(ec_GF2m_simple_is_on_curve,
+//GO(ec_GF2m_simple_make_affine,
+GO(EC_GF2m_simple_method, pFv)
+//GO(ec_GF2m_simple_mul,
+//GO(ec_GF2m_simple_oct2point,
+//GO(ec_GF2m_simple_point2oct,
+//GO(ec_GF2m_simple_point_clear_finish,
+//GO(ec_GF2m_simple_point_copy,
+//GO(ec_GF2m_simple_point_finish,
+//GO(ec_GF2m_simple_point_get_affine_coordinates,
+//GO(ec_GF2m_simple_point_init,
+//GO(ec_GF2m_simple_point_set_affine_coordinates,
+//GO(ec_GF2m_simple_point_set_to_infinity,
+//GO(ec_GF2m_simple_points_make_affine,
+//GO(ec_GF2m_simple_set_compressed_coordinates,
+//GO(ec_GFp_mont_field_decode,
+//GO(ec_GFp_mont_field_encode,
+//GO(ec_GFp_mont_field_mul,
+//GO(ec_GFp_mont_field_set_to_one,
+//GO(ec_GFp_mont_field_sqr,
+//GO(ec_GFp_mont_group_clear_finish,
+//GO(ec_GFp_mont_group_copy,
+//GO(ec_GFp_mont_group_finish,
+//GO(ec_GFp_mont_group_init,
+//GO(ec_GFp_mont_group_set_curve,
+GO(EC_GFp_mont_method, pFv)
+//GO(ec_GFp_nist_field_mul,
+//GO(ec_GFp_nist_field_sqr,
+//GO(ec_GFp_nist_group_copy,
+//GO(ec_GFp_nist_group_set_curve,
+GO(EC_GFp_nist_method, pFv)
+GO(EC_GFp_nistp224_method, pFv)
+GO(EC_GFp_nistp256_method, pFv)
+GO(EC_GFp_nistp521_method, pFv)
+//GO(ec_GFp_simple_add,
+//GO(ec_GFp_simple_cmp,
+//GO(ec_GFp_simple_dbl,
+//GO(ec_GFp_simple_field_mul,
+//GO(ec_GFp_simple_field_sqr,
+//GO(ec_GFp_simple_get_Jprojective_coordinates_GFp,
+//GO(ec_GFp_simple_group_check_discriminant,
+//GO(ec_GFp_simple_group_clear_finish,
+//GO(ec_GFp_simple_group_copy,
+//GO(ec_GFp_simple_group_finish,
+//GO(ec_GFp_simple_group_get_curve,
+//GO(ec_GFp_simple_group_get_degree,
+//GO(ec_GFp_simple_group_init,
+//GO(ec_GFp_simple_group_set_curve,
+//GO(ec_GFp_simple_invert,
+//GO(ec_GFp_simple_is_at_infinity,
+//GO(ec_GFp_simple_is_on_curve,
+//GO(ec_GFp_simple_make_affine,
+GO(EC_GFp_simple_method, pFv)
+//GO(ec_GFp_simple_oct2point,
+//GO(ec_GFp_simple_point2oct,
+//GO(ec_GFp_simple_point_clear_finish,
+//GO(ec_GFp_simple_point_copy,
+//GO(ec_GFp_simple_point_finish,
+//GO(ec_GFp_simple_point_get_affine_coordinates,
+//GO(ec_GFp_simple_point_init,
+//GO(ec_GFp_simple_point_set_affine_coordinates,
+//GO(ec_GFp_simple_point_set_to_infinity,
+//GO(ec_GFp_simple_points_make_affine,
+//GO(ec_GFp_simple_set_compressed_coordinates,
+//GO(ec_GFp_simple_set_Jprojective_coordinates_GFp,
+GO(EC_GROUP_check, iFpp)
+GO(EC_GROUP_check_discriminant, iFpp)
+GO(EC_GROUP_clear_free, vFp)
+//GO(EC_GROUP_cmp,
+//GO(EC_GROUP_copy,
+//GO(EC_GROUP_dup,
+GO(EC_GROUP_free, vFp)
+GO(EC_GROUP_get0_generator, pFp)
+GO(EC_GROUP_get0_seed, pFp)
+//GO(EC_GROUP_get_asn1_flag,
+//GO(EC_GROUP_get_basis_type,
+GO(EC_GROUP_get_cofactor, iFppp)
+GO(EC_GROUP_get_curve_GF2m, iFppppp)
+GO(EC_GROUP_get_curve_GFp, iFppppp)
+GO(EC_GROUP_get_curve_name, iFp)
+GO(EC_GROUP_get_degree, iFp)
+GO(EC_GROUP_get_ecparameters, pFpp)
+GO(EC_GROUP_get_ecpkparameters, pFpp)
+//GO(EC_GROUP_get_mont_data,
+GO(EC_GROUP_get_order, iFppp)
+//GO(EC_GROUP_get_pentanomial_basis,
+//GO(EC_GROUP_get_point_conversion_form,
+GO(EC_GROUP_get_seed_len, LFp)
+//GO(EC_GROUP_get_trinomial_basis,
+//GO(EC_GROUP_have_precompute_mult,
+GO(EC_GROUP_method_of, pFp)
+GO(EC_GROUP_new, pFp)
+GO(EC_GROUP_new_by_curve_name, pFi)
+GO(EC_GROUP_new_curve_GF2m, pFpppp)
+GO(EC_GROUP_new_curve_GFp, pFpppp)
+GO(EC_GROUP_new_from_ecparameters, pFp)
+GO(EC_GROUP_new_from_ecpkparameters, pFp)
+GO(EC_GROUP_precompute_mult, iFpp)
+//GO(EC_GROUP_set_asn1_flag,
+GO(EC_GROUP_set_curve_GF2m, iFppppp)
+GO(EC_GROUP_set_curve_GFp, iFppppp)
+//GO(EC_GROUP_set_curve_name,
+GO(EC_GROUP_set_generator, iFpppp)
+//GO(EC_GROUP_set_point_conversion_form,
+GO(EC_GROUP_set_seed, LFppL)
+GO(EC_KEY_check_key, iFp)
+//GO(EC_KEY_clear_flags,
+//GO(EC_KEY_copy,
+GO(EC_KEY_dup, pFp)
+GO(EC_KEY_free, vFp)
+GO(EC_KEY_generate_key, iFp)
+GO(EC_KEY_get0_group, pFp)
+GO(EC_KEY_get0_private_key, pFp)
+GO(EC_KEY_get0_public_key, pFp)
+//GO(EC_KEY_get_conv_form,
+//GO(EC_KEY_get_enc_flags,
+//GO(EC_KEY_get_flags,
+//GO(EC_KEY_get_key_method_data,
+//GO(EC_KEY_insert_key_method_data,
+GO(EC_KEY_new, pFv)
+GO(EC_KEY_new_by_curve_name, pFi)
+//GO(EC_KEY_precompute_mult,
+//GO(EC_KEY_print,
+//GO(EC_KEY_print_fp,
+GO(EC_KEY_set_asn1_flag, vFpi)
+//GO(EC_KEY_set_conv_form,
+//GO(EC_KEY_set_enc_flags,
+//GO(EC_KEY_set_flags,
+GO(EC_KEY_set_group, iFpp)
+GO(EC_KEY_set_private_key, iFpp)
+GO(EC_KEY_set_public_key, iFpp)
+GO(EC_KEY_set_public_key_affine_coordinates, iFppp)
+GO(EC_KEY_up_ref, iFp)
+GO(EC_METHOD_get_field_type, iFp)
+//GO(ECPARAMETERS_free,
+//GO(ECPARAMETERS_new,
+//GO(ECParameters_print,
+//GO(ECParameters_print_fp,
+//GO(ECPKPARAMETERS_free,
+//GO(ECPKPARAMETERS_new,
+//GO(ECPKParameters_print,
+//GO(ECPKParameters_print_fp,
+//GO(EC_POINT_add,
+//GO(EC_POINT_bn2point,
+GO(EC_POINT_clear_free, vFp)
+//GO(EC_POINT_cmp,
+GO(EC_POINT_copy, iFpp)
+//GO(EC_POINT_dbl,
+GO(EC_POINT_dup, pFpp)
+GO(EC_POINT_free, vFp)
+GO(EC_POINT_get_affine_coordinates, iFppppp)
+GO(EC_POINT_get_affine_coordinates_GF2m, iFppppp)
+GO(EC_POINT_get_affine_coordinates_GFp, iFppppp)
+GO(EC_POINT_get_Jprojective_coordinates_GFp, iFpppppp)
+//GO(EC_POINT_hex2point,
+//GO(EC_POINT_invert,
+//GO(EC_POINT_is_at_infinity,
+//GO(EC_POINT_is_on_curve,
+//GO(EC_POINT_make_affine,
+GO(EC_POINT_method_of, pFp)
+GO(EC_POINT_mul, iFpppppp)
+GO(EC_POINT_new, pFp)
+//GO(EC_POINT_oct2point,
+//GO(EC_POINT_point2buf,
+//GO(EC_POINT_point2bn,
+//GO(EC_POINT_point2hex,
+//GO(EC_POINT_point2oct,
+GO(EC_POINT_set_affine_coordinates, iFppppp)
+GO(EC_POINT_set_affine_coordinates_GF2m, iFppppp)
+GO(EC_POINT_set_affine_coordinates_GFp, iFppppp)
+GO(EC_POINT_set_compressed_coordinates, iFpppip)
+GO(EC_POINT_set_compressed_coordinates_GF2m, iFpppip)
+GO(EC_POINT_set_compressed_coordinates_GFp, iFpppip)
+GO(EC_POINT_set_Jprojective_coordinates_GFp, iFpppppp)
+GO(EC_POINT_set_to_infinity, iFpp)
+//GO(EC_POINTs_make_affine,
+//GO(EC_POINTs_mul,
+//GO(ec_precompute_mont_data,
+//GO(EC_PRIVATEKEY_free,
+//GO(EC_PRIVATEKEY_new,
+//GO(ec_wNAF_have_precompute_mult,
+//GO(ec_wNAF_mul,
+//GO(ec_wNAF_precompute_mult,
+//GO(EDIPARTYNAME_free,
+//GO(EDIPARTYNAME_new,
+GO(ENGINE_add, iFp)
+//GO(ENGINE_add_conf_module,
+GO(ENGINE_by_id, pFp)
+GO(ENGINE_cleanup, vFv)
+//GO(engine_cleanup_add_first,
+//GO(engine_cleanup_add_last,
+GO(ENGINE_cmd_is_executable, iFpi)
+GOM(ENGINE_ctrl, iFEpiipp)
+GOM(ENGINE_ctrl_cmd, iFpplppi)
+GO(ENGINE_ctrl_cmd_string, iFpppi)
+GO(ENGINE_finish, iFp)
+GO(ENGINE_free, iFp)
+//GO(engine_free_util,
+//GO(ENGINE_get_cipher,
+GO(ENGINE_get_cipher_engine, pFi)
+//GOM(ENGINE_get_ciphers, pFEp)
+//GOM(ENGINE_get_cmd_defns, pFEp)
+//GOM(ENGINE_get_ctrl_function, pFEp)
+GO(ENGINE_get_default_DH, pFv)
+GO(ENGINE_get_default_DSA, pFv)
+GO(ENGINE_get_default_ECDH, pFv)
+GO(ENGINE_get_default_ECDSA, pFv)
+GO(ENGINE_get_default_RAND, pFv)
+GO(ENGINE_get_default_RSA, pFv)
+//GOM(ENGINE_get_destroy_function, pFEp)
+GO(ENGINE_get_DH, pFp)
+//GOM(ENGINE_get_digest, pFEp)
+GO(ENGINE_get_digest_engine, pFi)
+//GO(ENGINE_get_digests,
+GO(ENGINE_get_DSA, pFp)
+GO(ENGINE_get_ECDH, pFp)
+GO(ENGINE_get_ECDSA, pFp)
+//GO(ENGINE_get_ex_data,
+//GO(ENGINE_get_ex_new_index,
+//GOM(ENGINE_get_finish_function, pFEp)
+GO(ENGINE_get_first, iFp)
+GO(ENGINE_get_flags, iFp)
+GO(ENGINE_get_id, pFp)
+//GOM(ENGINE_get_init_function, pFEp)
+GO(ENGINE_get_last, pFv)
+//GOM(ENGINE_get_load_privkey_function, pFEp)
+//GOM(ENGINE_get_load_pubkey_function, pFEp)
+GO(ENGINE_get_name, pFp)
+GO(ENGINE_get_next, pFp)
+//GO(ENGINE_get_pkey_asn1_meth,
+//GO(ENGINE_get_pkey_asn1_meth_engine,
+//GO(ENGINE_get_pkey_asn1_meths,
+//GO(ENGINE_get_pkey_asn1_meth_str,
+//GO(ENGINE_get_pkey_meth,
+//GO(ENGINE_get_pkey_meth_engine,
+//GO(ENGINE_get_pkey_meths,
+GO(ENGINE_get_prev, pFp)
+GO(ENGINE_get_RAND, pFp)
+GO(ENGINE_get_RSA, pFp)
+//GO(ENGINE_get_ssl_client_cert_function,
+//GO(ENGINE_get_static_state,
+//GO(ENGINE_get_STORE,
+GO(ENGINE_get_table_flags, uFv)
+GO(ENGINE_init, iFp)
+GO(ENGINE_load_builtin_engines, vFv)
+//GO(ENGINE_load_cryptodev,
+//GO(ENGINE_load_dynamic,
+//GO(ENGINE_load_openssl,
+GO(ENGINE_load_private_key, pFpppp)
+GO(ENGINE_load_public_key, pFpppp)
+//GO(ENGINE_load_rdrand,
+//GO(ENGINE_load_ssl_client_cert,
+GO(ENGINE_new, pFv)
+//GO(ENGINE_pkey_asn1_find_str,
+//GO(engine_pkey_asn1_meths_free,
+//GO(engine_pkey_meths_free,
+GO(ENGINE_register_all_ciphers, vFv)
+GO(ENGINE_register_all_complete, iFv)
+GO(ENGINE_register_all_DH, vFv)
+GO(ENGINE_register_all_digests, vFv)
+GO(ENGINE_register_all_DSA, vFv)
+GO(ENGINE_register_all_ECDH, vFv)
+GO(ENGINE_register_all_ECDSA, vFv)
+//GO(ENGINE_register_all_pkey_asn1_meths,
+//GO(ENGINE_register_all_pkey_meths,
+GO(ENGINE_register_all_RAND, vFv)
+GO(ENGINE_register_all_RSA, vFv)
+//GO(ENGINE_register_all_STORE,
+GO(ENGINE_register_ciphers, iFp)
+GO(ENGINE_register_complete, iFp)
+GO(ENGINE_register_DH, iFp)
+GO(ENGINE_register_digests, iFp)
+GO(ENGINE_register_DSA, iFp)
+GO(ENGINE_register_ECDH, iFp)
+GO(ENGINE_register_ECDSA, iFp)
+//GO(ENGINE_register_pkey_asn1_meths,
+//GO(ENGINE_register_pkey_meths,
+GO(ENGINE_register_RAND, iFp)
+GO(ENGINE_register_RSA, iFp)
+//GO(ENGINE_register_STORE,
+GO(ENGINE_remove, iFp)
+//GO(engine_set_all_null,
+//GOM(ENGINE_set_ciphers, iFEpp) //typedef int (*ENGINE_CIPHERS_PTR)(ENGINE *e, const EVP_CIPHER **impl, const int **nids, int nid)
+//GOM(ENGINE_set_cmd_defns, iFEpp)
+//GO(ENGINE_set_ctrl_function,
+GO(ENGINE_set_default, iFpu)
+GO(ENGINE_set_default_ciphers, iFp)
+GO(ENGINE_set_default_DH, iFp)
+GO(ENGINE_set_default_digests, iFp)
+GO(ENGINE_set_default_DSA, iFp)
+GO(ENGINE_set_default_ECDH, iFp)
+GO(ENGINE_set_default_ECDSA, iFp)
+//GO(ENGINE_set_default_pkey_asn1_meths,
+//GO(ENGINE_set_default_pkey_meths,
+GO(ENGINE_set_default_RAND, iFp)
+GO(ENGINE_set_default_RSA, iFp)
+GO(ENGINE_set_default_string, iFpp)
+//GOM(ENGINE_set_destroy_function, iFEpp)
+//GO(ENGINE_set_DH,
+//GOM(ENGINE_set_digests, iFEpp)
+GO(ENGINE_set_DSA, iFpp)
+GO(ENGINE_set_ECDH, iFpp)
+GO(ENGINE_set_ECDSA, iFpp)
+//GO(ENGINE_set_ex_data,
+//GOM(ENGINE_set_finish_function, iFEpp)
+GO(ENGINE_set_flags, iFpi)
+GO(ENGINE_set_id, iFpp)
+//GOM(ENGINE_set_init_function, iFEpp)
+//GOM(ENGINE_set_load_privkey_function, iFEpp)
+//GOM(ENGINE_set_load_pubkey_function, iFEpp)
+//GOM(ENGINE_set_load_ssl_client_cert_function,
+GO(ENGINE_set_name, iFpp)
+//GO(ENGINE_set_pkey_asn1_meths,
+//GO(ENGINE_set_pkey_meths,
+GO(ENGINE_set_RAND, iFpp)
+GO(ENGINE_set_RSA, iFpp)
+//GO(ENGINE_set_STORE,
+GO(ENGINE_set_table_flags, vFu)
+//GO(engine_table_cleanup,
+//GO(engine_table_doall,
+//GO(engine_table_register,
+//GO(engine_table_select,
+//GO(engine_table_unregister,
+//GO(engine_unlocked_finish,
+//GO(engine_unlocked_init,
+GO(ENGINE_unregister_ciphers, vFp)
+GO(ENGINE_unregister_DH, vFp)
+GO(ENGINE_unregister_digests, vFp)
+GO(ENGINE_unregister_DSA, vFp)
+GO(ENGINE_unregister_ECDH, vFp)
+GO(ENGINE_unregister_ECDSA, vFp)
+//GO(ENGINE_unregister_pkey_asn1_meths,
+//GO(ENGINE_unregister_pkey_meths,
+GO(ENGINE_unregister_RAND, vFp)
+GO(ENGINE_unregister_RSA, vFp)
+//GO(ENGINE_unregister_STORE,
+GO(ENGINE_up_ref, iFp)
+//GO(ERR_add_error_data,
+//GO(ERR_add_error_vdata,
+GO(ERR_clear_error, vFv)
+GO(ERR_error_string, pFup)
+GO(ERR_error_string_n, vFupu)
+GO(ERR_free_strings, vFv)
+GO(ERR_func_error_string, pFu)
+GO(ERR_get_error, LFv)
+GO(ERR_get_error_line, LFpp)
+GO(ERR_get_error_line_data, LFpppp)
+//GO(ERR_get_err_state_table,
+//GO(ERR_get_implementation,
+//GO(ERR_get_next_error_library,
+//GO(ERR_get_state,
+//GO(ERR_get_string_table,
+GO(ERR_lib_error_string, pFu)
+//GO(ERR_load_ASN1_strings,
+//GO(ERR_load_BIO_strings,
+//GO(ERR_load_BN_strings,
+//GO(ERR_load_BUF_strings,
+//GO(ERR_load_CMS_strings,
+//GO(ERR_load_COMP_strings,
+//GO(ERR_load_CONF_strings,
+GO(ERR_load_crypto_strings, vFv)
+GO(ERR_load_CRYPTO_strings, vFv)
+//GO(ERR_load_DH_strings,
+//GO(ERR_load_DSA_strings,
+//GO(ERR_load_DSO_strings,
+//GO(ERR_load_ECDH_strings,
+//GO(ERR_load_ECDSA_strings,
+//GO(ERR_load_EC_strings,
+//GO(ERR_load_ENGINE_strings,
+//GO(ERR_load_ERR_strings,
+GO(ERR_load_EVP_strings, vFv)
+//GO(ERR_load_OBJ_strings,
+//GO(ERR_load_OCSP_strings,
+//GO(ERR_load_PEM_strings,
+//GO(ERR_load_PKCS12_strings,
+GO(ERR_load_PKCS7_strings, vFv)
+//GO(ERR_load_RAND_strings,
+//GO(ERR_load_RSA_strings,
+//GO(ERR_load_strings,
+//GO(ERR_load_TS_strings,
+//GO(ERR_load_UI_strings,
+//GO(ERR_load_X509_strings,
+//GO(ERR_load_X509V3_strings,
+GO(ERR_new, vFv)
+GO(ERR_peek_error, LFv)
+GO(ERR_peek_error_line, LFpp)
+GO(ERR_peek_error_line_data, LFpppp)
+GO(ERR_peek_last_error, LFv)
+GO(ERR_peek_last_error_line, LFpp)
+GO(ERR_peek_last_error_line_data, LFpppp)
+//GO(ERR_pop_to_mark,
+//GO(ERR_print_errors,
+//GO(ERR_print_errors_cb,
+//GO(ERR_print_errors_fp,
+GO(ERR_put_error, vFiiipi)
+GO(ERR_reason_error_string, pFu)
+//GO(ERR_release_err_state_table,
+//GO(ERR_remove_state,
+GO(ERR_remove_thread_state, vFp)
+GO(ERR_set_debug, vFpip)
+GOM(ERR_set_error, vFEiipV)
+GOM(ERR_vset_error, vFEiipA)
+//GO(ERR_set_error_data,
+//GO(ERR_set_implementation,
+//GO(ERR_set_mark,
+//GO(ERR_unload_strings,
+//GO(ESS_CERT_ID_dup,
+//GO(ESS_CERT_ID_free,
+//GO(ESS_CERT_ID_new,
+//GO(ESS_ISSUER_SERIAL_dup,
+//GO(ESS_ISSUER_SERIAL_free,
+//GO(ESS_ISSUER_SERIAL_new,
+//GO(ESS_SIGNING_CERT_dup,
+//GO(ESS_SIGNING_CERT_free,
+//GO(ESS_SIGNING_CERT_new,
+//GO(EVP_add_alg_module,
+//GO(EVP_add_cipher,
+//GO(EVP_add_digest,
+GO(EVP_aes_128_cbc, pFv)
+GO(EVP_aes_128_cbc_hmac_sha1, pFv)
+GO(EVP_aes_128_cbc_hmac_sha256, pFv)
+GO(EVP_aes_128_ccm, pFv)
+GO(EVP_aes_128_cfb, pFv)
+GO(EVP_aes_128_cfb1, pFv)
+GO(EVP_aes_128_cfb128, pFv)
+GO(EVP_aes_128_cfb8, pFv)
+GO(EVP_aes_128_ctr, pFv)
+GO(EVP_aes_128_ecb, pFv)
+GO(EVP_aes_128_gcm, pFv)
+GO(EVP_aes_128_ofb, pFv)
+GO(EVP_aes_128_wrap, pFv)
+GO(EVP_aes_128_xts, pFv)
+GO(EVP_aes_192_cbc, pFv)
+GO(EVP_aes_192_ccm, pFv)
+GO(EVP_aes_192_cfb, pFv)
+GO(EVP_aes_192_cfb1, pFv)
+GO(EVP_aes_192_cfb128, pFv)
+GO(EVP_aes_192_cfb8, pFv)
+GO(EVP_aes_192_ctr, pFv)
+GO(EVP_aes_192_ecb, pFv)
+GO(EVP_aes_192_gcm, pFv)
+GO(EVP_aes_192_ofb, pFv)
+GO(EVP_aes_192_wrap, pFv)
+GO(EVP_aes_256_cbc, pFv)
+GO(EVP_aes_256_cbc_hmac_sha1, pFv)
+GO(EVP_aes_256_cbc_hmac_sha256, pFv)
+GO(EVP_aes_256_ccm, pFv)
+GO(EVP_aes_256_cfb, pFv)
+GO(EVP_aes_256_cfb1, pFv)
+GO(EVP_aes_256_cfb128, pFv)
+GO(EVP_aes_256_cfb8, pFv)
+GO(EVP_aes_256_ctr, pFv)
+GO(EVP_aes_256_ecb, pFv)
+GO(EVP_aes_256_gcm, pFv)
+//GO(EVP_aes_256_ofb,
+//GO(EVP_aes_256_wrap,
+//GO(EVP_aes_256_xts,
+//GO(EVP_bf_cbc,
+//GO(EVP_bf_cfb,
+//GO(EVP_bf_cfb64,
+//GO(EVP_bf_ecb,
+//GO(EVP_bf_ofb,
+//GO(EVP_BytesToKey,
+//GO(EVP_camellia_128_cbc,
+//GO(EVP_camellia_128_cfb1,
+//GO(EVP_camellia_128_cfb128,
+//GO(EVP_camellia_128_cfb8,
+//GO(EVP_camellia_128_ecb,
+//GO(EVP_camellia_128_ofb,
+//GO(EVP_camellia_192_cbc,
+//GO(EVP_camellia_192_cfb1,
+//GO(EVP_camellia_192_cfb128,
+//GO(EVP_camellia_192_cfb8,
+//GO(EVP_camellia_192_ecb,
+//GO(EVP_camellia_192_ofb,
+//GO(EVP_camellia_256_cbc,
+//GO(EVP_camellia_256_cfb1,
+//GO(EVP_camellia_256_cfb128,
+//GO(EVP_camellia_256_cfb8,
+//GO(EVP_camellia_256_ecb,
+//GO(EVP_camellia_256_ofb,
+//GO(EVP_cast5_cbc,
+//GO(EVP_cast5_cfb,
+//GO(EVP_cast5_cfb64,
+//GO(EVP_cast5_ecb,
+//GO(EVP_cast5_ofb,
+GO(EVP_chacha20, pFv)
+GO(EVP_chacha20_poly1305, pFv)
+//GO(EVP_Cipher,
+GO(EVP_CIPHER_asn1_to_param, iFpp)
+//GO(EVP_CIPHER_block_size,
+//GO(EVP_CIPHER_CTX_block_size,
+//GO(EVP_CIPHER_CTX_cipher,
+GO(EVP_CIPHER_CTX_cleanup, iFp)
+//GO(EVP_CIPHER_CTX_clear_flags,
+//GO(EVP_CIPHER_CTX_copy,
+GO(EVP_CIPHER_CTX_ctrl, iFpiip)
+//GO(EVP_CIPHER_CTX_flags,
+GO(EVP_CIPHER_CTX_free, vFp)
+//GO(EVP_CIPHER_CTX_get_app_data,
+GO(EVP_CIPHER_CTX_get_original_iv, iFppL)
+GO(EVP_CIPHER_CTX_get_updated_iv, iFppL)
+GO(EVP_CIPHER_CTX_init, vFp)
+//GO(EVP_CIPHER_CTX_iv_length,
+//GO(EVP_CIPHER_CTX_key_length,
+GO(EVP_CIPHER_CTX_new, pFv)
+//GO(EVP_CIPHER_CTX_nid,
+//GO(EVP_CIPHER_CTX_rand_key,
+GO(EVP_CIPHER_CTX_reset, iFp)
+//GO(EVP_CIPHER_CTX_set_app_data,
+//GO(EVP_CIPHER_CTX_set_flags,
+GO(EVP_CIPHER_CTX_set_key_length, iFpi)
+GO(EVP_CIPHER_CTX_set_padding, iFpi)
+//GO(EVP_CIPHER_CTX_test_flags,
+//GO(EVP_CIPHER_do_all,
+//GO(EVP_CIPHER_do_all_sorted,
+GO(EVP_CipherFinal, iFppp)
+GO(EVP_CipherFinal_ex, iFppp)
+//GO(EVP_CIPHER_flags,
+//GO(EVP_CIPHER_get_asn1_iv,
+GO(EVP_CipherInit, iFppppi)
+GO(EVP_CipherInit_ex, iFpppppi)
+//GO(EVP_CIPHER_iv_length,
+//GO(EVP_CIPHER_key_length,
+//GO(EVP_CIPHER_nid,
+GO(EVP_CIPHER_param_to_asn1, iFpp)
+//GO(EVP_CIPHER_set_asn1_iv,
+GO(EVP_CIPHER_type, iFp)
+GO(EVP_CipherUpdate, iFppppi)
+GO(EVP_cleanup, vFv)
+//GO(EVP_DecodeBlock,
+//GO(EVP_DecodeFinal,
+//GO(EVP_DecodeInit,
+//GO(EVP_DecodeUpdate,
+GO(EVP_DecryptFinal, iFppp)
+GO(EVP_DecryptFinal_ex, iFppp)
+GO(EVP_DecryptInit, iFpppp)
+GO(EVP_DecryptInit_ex, iFppppp)
+GO(EVP_DecryptUpdate, iFppppi)
+GO(EVP_des_cbc, pFv)
+GO(EVP_des_cfb, pFv)
+GO(EVP_des_cfb1, pFv)
+GO(EVP_des_cfb64, pFv)
+GO(EVP_des_cfb8, pFv)
+GO(EVP_des_ecb, pFv)
+GO(EVP_des_ede, pFv)
+GO(EVP_des_ede3, pFv)
+GO(EVP_des_ede3_cbc, pFv)
+GO(EVP_des_ede3_cfb, pFv)
+GO(EVP_des_ede3_cfb1, pFv)
+GO(EVP_des_ede3_cfb64, pFv)
+GO(EVP_des_ede3_cfb8, pFv)
+GO(EVP_des_ede3_ecb, pFv)
+GO(EVP_des_ede3_ofb, pFv)
+GO(EVP_des_ede3_wrap, pFv)
+GO(EVP_des_ede_cbc, pFv)
+GO(EVP_des_ede_cfb, pFv)
+GO(EVP_des_ede_cfb64, pFv)
+GO(EVP_des_ede_ecb, pFv)
+GO(EVP_des_ede_ofb, pFv)
+//GO(EVP_des_ofb,
+//GO(EVP_desx_cbc,
+//GO(EVP_Digest,
+//GO(EVP_DigestFinal,
+GO(EVP_DigestFinal_ex, iFppp)
+GO(EVP_DigestInit, iFpp)
+GO(EVP_DigestInit_ex, iFppp)
+GO(EVP_DigestSignFinal, iFppp)
+//GO(EVP_DigestSignInit,
+GO(EVP_DigestUpdate, iFppL)
+//GO(EVP_DigestVerifyFinal,
+//GO(EVP_DigestVerifyInit,
+//GO(EVP_dss,
+//GO(EVP_dss1,
+//GO(EVP_ecdsa,
+//GO(EVP_enc_null,
+//GO(EVP_EncodeBlock,
+//GO(EVP_EncodeFinal,
+//GO(EVP_EncodeInit,
+//GO(EVP_EncodeUpdate,
+GO(EVP_EncryptFinal, iFppp)
+GO(EVP_EncryptFinal_ex, iFppp)
+GO(EVP_EncryptInit, iFpppp)
+GO(EVP_EncryptInit_ex, iFppppp)
+GO(EVP_EncryptUpdate, iFppppi)
+GO(EVP_get_cipherbyname, pFp)
+GO(EVP_get_digestbyname, pFp)
+//GO(EVP_get_pw_prompt,
+//GO(EVP_idea_cbc,
+//GO(EVP_idea_cfb,
+//GO(EVP_idea_cfb64,
+//GO(EVP_idea_ecb,
+//GO(EVP_idea_ofb,
+GO(EVP_md4, pFv)
+GO(EVP_md5, pFv)
+GO(EVP_MD_block_size, iFp)
+//GO(EVP_mdc2,
+GO(EVP_MD_CTX_cleanup, iFp)
+GO(EVP_MD_CTX_clear_flags, vFpi)
+GO(EVP_MD_CTX_copy, iFpp)
+GO(EVP_MD_CTX_copy_ex, iFpp)
+GO(EVP_MD_CTX_create, pFv)
+GO(EVP_MD_CTX_ctrl, vFpiip)
+GO(EVP_MD_CTX_destroy, vFp)
+GO(EVP_MD_CTX_free, vFp)
+//GO(EVP_MD_CTX_init,
+GO(EVP_MD_CTX_md, pFp)
+GO(EVP_MD_CTX_new, pFv)
+GO(EVP_MD_CTX_reset, iFp)
+GO(EVP_MD_CTX_set_flags, vFpi)
+//GO(EVP_MD_CTX_test_flags,
+//GO(EVP_MD_do_all,
+//GO(EVP_MD_do_all_sorted,
+//GO(EVP_MD_flags,
+GO(EVP_MD_get_size, iFp)
+GO(EVP_md_null, pFv)
+GO(EVP_MD_pkey_type, iFp)
+GO(EVP_MD_type, iFp)
+//GO(EVP_OpenFinal,
+//GO(EVP_OpenInit,
+//GO(EVP_PBE_alg_add,
+//GO(EVP_PBE_alg_add_type,
+//GO(EVP_PBE_CipherInit,
+//GO(EVP_PBE_cleanup,
+//GO(EVP_PBE_find,
+GO(EVP_PKCS82PKEY, pFp)
+GO(EVP_PKCS82PKEY_ex, pFppp)
+GO(EVP_PKEY2PKCS8, pFp)
+//GO(EVP_PKEY2PKCS8_broken,
+//GO(EVP_PKEY_add1_attr,
+//GO(EVP_PKEY_add1_attr_by_NID,
+//GO(EVP_PKEY_add1_attr_by_OBJ,
+//GO(EVP_PKEY_add1_attr_by_txt,
+//GO(EVP_PKEY_asn1_add0,
+//GO(EVP_PKEY_asn1_add_alias,
+//GO(EVP_PKEY_asn1_copy,
+//GO(EVP_PKEY_asn1_find,
+//GO(EVP_PKEY_asn1_find_str,
+//GO(EVP_PKEY_asn1_free,
+//GO(EVP_PKEY_asn1_get0,
+//GO(EVP_PKEY_asn1_get0_info,
+//GO(EVP_PKEY_asn1_get_count,
+//GO(EVP_PKEY_asn1_new,
+//GO(EVP_PKEY_asn1_set_ctrl,
+//GO(EVP_PKEY_asn1_set_free,
+//GO(EVP_PKEY_asn1_set_item,
+//GO(EVP_PKEY_asn1_set_param,
+//GO(EVP_PKEY_asn1_set_private,
+//GO(EVP_PKEY_asn1_set_public,
+GO(EVP_PKEY_assign, iFpip)
+//GO(EVP_PKEY_base_id,
+//GO(EVP_PKEY_bits,
+GO(EVP_PKEY_cmp, iFpp)
+GO(EVP_PKEY_cmp_parameters, iFpp)
+GO(EVP_PKEY_copy_parameters, iFpp)
+GO(EVP_PKEY_CTX_ctrl, iFpiiiip)
+GO(EVP_PKEY_CTX_ctrl_str, iFppp)
+GO(EVP_PKEY_CTX_dup, pFp)
+GO(EVP_PKEY_CTX_free, vFp)
+GO(EVP_PKEY_CTX_get0_peerkey, pFp)
+GO(EVP_PKEY_CTX_get0_pkey, pFp)
+GO(EVP_PKEY_CTX_get_app_data, pFp)
+//GO(EVP_PKEY_CTX_get_cb,
+//GO(EVP_PKEY_CTX_get_data,
+GO(EVP_PKEY_CTX_get_keygen_info, iFpi)
+//GO(EVP_PKEY_CTX_get_operation,
+GO(EVP_PKEY_CTX_new, pFpp)
+GO(EVP_PKEY_CTX_new_id, pFip)
+//GO(EVP_PKEY_CTX_set0_keygen_info,
+GO(EVP_PKEY_CTX_set_app_data, vFpp)
+//GO(EVP_PKEY_CTX_set_cb,
+//GO(EVP_PKEY_CTX_set_data,
+GO(EVP_PKEY_CTX_set_rsa_keygen_bits, iFpi)
+GO(EVP_PKEY_CTX_set_rsa_oaep_md, iFpp)
+GO(EVP_PKEY_CTX_set_rsa_padding, iFpi)
+GO(EVP_PKEY_CTX_set_rsa_pss_saltlen, iFpi)
+GO(EVP_PKEY_CTX_set_signature_md, iFpp)
+GO(EVP_PKEY_check, iFp)
+GO(EVP_PKEY_decrypt, iFppppL)
+GO(EVP_PKEY_decrypt_init, iFp)
+//GO(EVP_PKEY_decrypt_old,
+//GO(EVP_PKEY_delete_attr,
+GO(EVP_PKEY_derive, iFppp)
+GO(EVP_PKEY_derive_init, iFp)
+GO(EVP_PKEY_derive_set_peer, iFppi)
+GO(EVP_PKEY_encrypt, iFppppL)
+GO(EVP_PKEY_encrypt_init, iFp)
+//GO(EVP_PKEY_encrypt_old,
+GO(EVP_PKEY_free, vFp)
+//GO(EVP_PKEY_get0,
+//GO(EVP_PKEY_get0_asn1,
+GO(EVP_PKEY_get0_RSA, pFp)
+//GO(EVP_PKEY_get1_DH,
+GO(EVP_PKEY_get1_DSA, pFp)
+GO(EVP_PKEY_get1_EC_KEY, pFp)
+GO(EVP_PKEY_get1_RSA, pFp)
+//GO(EVP_PKEY_get_attr,
+//GO(EVP_PKEY_get_attr_by_NID,
+//GO(EVP_PKEY_get_attr_by_OBJ,
+//GO(EVP_PKEY_get_attr_count,
+GO(EVP_PKEY_get_base_id, iFp)
+//GO(EVP_PKEY_get_default_digest_nid,
+GO(EVP_PKEY_get_size, iFp)
+//GO(EVP_PKEY_id,
+GO(EVP_PKEY_keygen, iFpp)
+GO(EVP_PKEY_keygen_init, iFp)
+//GO(EVP_PKEY_meth_add0,
+//GO(EVP_PKEY_meth_copy,
+//GO(EVP_PKEY_meth_find,
+//GO(EVP_PKEY_meth_free,
+//GO(EVP_PKEY_meth_get0_info,
+//GO(EVP_PKEY_meth_new,
+//GO(EVP_PKEY_meth_set_cleanup,
+//GO(EVP_PKEY_meth_set_copy,
+//GO(EVP_PKEY_meth_set_ctrl,
+//GO(EVP_PKEY_meth_set_decrypt,
+//GO(EVP_PKEY_meth_set_derive,
+//GO(EVP_PKEY_meth_set_encrypt,
+//GO(EVP_PKEY_meth_set_init,
+//GO(EVP_PKEY_meth_set_keygen,
+//GO(EVP_PKEY_meth_set_paramgen,
+//GO(EVP_PKEY_meth_set_sign,
+//GO(EVP_PKEY_meth_set_signctx,
+//GO(EVP_PKEY_meth_set_verify,
+//GO(EVP_PKEY_meth_set_verifyctx,
+//GO(EVP_PKEY_meth_set_verify_recover,
+GO(EVP_PKEY_missing_parameters, iFp)
+GO(EVP_PKEY_new, pFv)
+GO(EVP_PKEY_new_mac_key, pFippi)
+GO(EVP_PKEY_paramgen, iFpp)
+GO(EVP_PKEY_paramgen_init, iFp)
+//GO(EVP_PKEY_print_params,
+//GO(EVP_PKEY_print_private,
+//GO(EVP_PKEY_print_public,
+GO(EVP_PKEY_public_check, iFp)
+//GO(EVP_PKEY_save_parameters,
+//GO(EVP_PKEY_set1_DH,
+GO(EVP_PKEY_set1_DSA, iFpp)
+GO(EVP_PKEY_set1_EC_KEY, iFpp)
+GO(EVP_PKEY_set1_RSA, iFpp)
+//GO(evp_pkey_set_cb_translate,
+//GO(EVP_PKEY_set_type,
+//GO(EVP_PKEY_set_type_str,
+GO(EVP_PKEY_sign, iFppppp)
+GO(EVP_PKEY_sign_init, iFp)
+//GO(EVP_PKEY_size,
+GO(EVP_PKEY_type, iFi)
+GO(EVP_PKEY_up_ref, iFp)
+GO(EVP_PKEY_verify, iFppLpL)
+GO(EVP_PKEY_verify_init, iFp)
+//GO(EVP_PKEY_verify_recover,
+//GO(EVP_PKEY_verify_recover_init,
+GO(EVP_rc2_40_cbc, pFv)
+GO(EVP_rc2_64_cbc, pFv)
+GO(EVP_rc2_cbc, pFv)
+GO(EVP_rc2_cfb, pFv)
+GO(EVP_rc2_cfb64, pFv)
+GO(EVP_rc2_ecb, pFv)
+GO(EVP_rc2_ofb, pFv)
+//GO(EVP_rc4,
+//GO(EVP_rc4_40,
+//GO(EVP_rc4_hmac_md5,
+//GO(EVP_read_pw_string,
+//GO(EVP_read_pw_string_min,
+//GO(EVP_ripemd160,
+//GO(EVP_SealFinal,
+//GO(EVP_SealInit,
+//GO(EVP_seed_cbc,
+//GO(EVP_seed_cfb128,
+//GO(EVP_seed_ecb,
+//GO(EVP_seed_ofb,
+//GO(EVP_set_pw_prompt,
+GO(EVP_sha, pFV)
+GO(EVP_sha1, pFv)
+GO(EVP_sha224, pFv)
+GO(EVP_sha256, pFv)
+GO(EVP_sha384, pFv)
+GO(EVP_sha512, pFv)
+//GO(EVP_SignFinal,
+GO(EVP_VerifyFinal, iFppup)
+GO(EVP_VerifyInit, iFpp) // 1.1.0+
+GO(EVP_VerifyInit_ex, iFppp) // 1.1.0+
+GO(EVP_VerifyUpdate, iFppu) // 1.1.0+
+//GO(EVP_whirlpool,
+GO(EXTENDED_KEY_USAGE_free, vFp)
+//GO(EXTENDED_KEY_USAGE_new,
+//GO(fcrypt_body,
+//GO(_fini,
+//GO(FIPS_mode,
+//GO(FIPS_mode_set,
+//GO(gcm_ghash_4bit,
+//GO(gcm_ghash_neon,
+//GO(gcm_ghash_v8,
+//GO(gcm_gmult_4bit,
+//GO(gcm_gmult_neon,
+//GO(gcm_gmult_v8,
+//GO(gcm_init_neon,
+//GO(gcm_init_v8,
+//GO(GENERAL_NAME_cmp,
+GO(GENERAL_NAME_dup, pFp)
+GO(GENERAL_NAME_free, vFp)
+//GO(GENERAL_NAME_get0_otherName,
+//GO(GENERAL_NAME_get0_value,
+GO(GENERAL_NAME_new, pFv)
+//GO(GENERAL_NAME_print,
+//GO(GENERAL_NAME_set0_othername,
+//GO(GENERAL_NAME_set0_value,
+GO(GENERAL_NAMES_free, vFp)
+GO(GENERAL_NAMES_new, pFv)
+GO(GENERAL_SUBTREE_free, vFp)
+GO(GENERAL_SUBTREE_new, pFv)
+//GO(get_rfc2409_prime_1024,
+//GO(get_rfc2409_prime_768,
+//GO(get_rfc3526_prime_1536,
+//GO(get_rfc3526_prime_2048,
+//GO(get_rfc3526_prime_3072,
+//GO(get_rfc3526_prime_4096,
+//GO(get_rfc3526_prime_6144,
+//GO(get_rfc3526_prime_8192,
+//GO(hex_to_string,
+GO(HMAC, pFppipLpp)
+GO(HMAC_CTX_cleanup, vFp)
+GO(HMAC_CTX_copy, iFpp)
+GO(HMAC_CTX_free, vFp)
+GO(HMAC_CTX_init, vFp)
+GO(HMAC_CTX_new, pFv)
+GO(HMAC_CTX_set_flags, vFpL)
+GO(HMAC_Final, iFppp)
+GO(HMAC_Init, iFppip)
+GO(HMAC_Init_ex, iFppipp)
+GO(HMAC_Update, iFppi)
+//GO(i2a_ACCESS_DESCRIPTION,
+GO(i2a_ASN1_ENUMERATED, iFpp)
+GO(i2a_ASN1_INTEGER, iFpp)
+GO(i2a_ASN1_OBJECT, iFpp)
+GO(i2a_ASN1_STRING, iFppi)
+//GO(i2b_PrivateKey_bio,
+//GO(i2b_PublicKey_bio,
+//GO(i2b_PVK_bio,
+//GO(i2c_ASN1_BIT_STRING,
+//GO(i2c_ASN1_INTEGER,
+//GO(i2d_ACCESS_DESCRIPTION,
+GO(i2d_ASN1_bio_stream, iFpppip)
+GO(i2d_ASN1_BIT_STRING, iFpp)
+GO(i2d_ASN1_BMPSTRING, iFpp)
+//GO(i2d_ASN1_BOOLEAN,
+//GO(i2d_ASN1_bytes,
+GO(i2d_ASN1_ENUMERATED, iFpp)
+GO(i2d_ASN1_GENERALIZEDTIME, iFpp)
+GO(i2d_ASN1_GENERALSTRING, iFpp)
+GO(i2d_ASN1_IA5STRING, iFpp)
+GO(i2d_ASN1_INTEGER, iFpp)
+GO(i2d_ASN1_NULL, iFpp)
+GO(i2d_ASN1_OBJECT, iFpp)
+GO(i2d_ASN1_OCTET_STRING, iFpp)
+//GO(i2d_ASN1_PRINTABLE,
+GO(i2d_ASN1_PRINTABLESTRING, iFpp)
+//GO(i2d_ASN1_SEQUENCE_ANY,
+//GO(i2d_ASN1_SET,
+GO(i2d_ASN1_SET_ANY, iFpp)
+GO(i2d_ASN1_T61STRING, iFpp)
+GO(i2d_ASN1_TIME, iFpp)
+GO(i2d_ASN1_TYPE, iFpp)
+GO(i2d_ASN1_UNIVERSALSTRING, iFpp)
+GO(i2d_ASN1_UTCTIME, iFpp)
+GO(i2d_ASN1_UTF8STRING, iFpp)
+GO(i2d_ASN1_VISIBLESTRING, iFpp)
+//GO(i2d_AUTHORITY_INFO_ACCESS,
+//GO(i2d_AUTHORITY_KEYID,
+//GO(i2d_BASIC_CONSTRAINTS,
+//GO(i2d_CERTIFICATEPOLICIES,
+GO(i2d_CMS_bio, iFpp)
+//GO(i2d_CMS_bio_stream,
+//GO(i2d_CMS_ContentInfo,
+//GO(i2d_CMS_ReceiptRequest,
+//GO(i2d_CRL_DIST_POINTS,
+GO(i2d_DHparams, iFpp)
+//GO(i2d_DHxparams,
+//GO(i2d_DIRECTORYSTRING,
+GO(i2d_DISPLAYTEXT, iFpp)
+//GO(i2d_DIST_POINT,
+//GO(i2d_DIST_POINT_NAME,
+//GO(i2d_DSAparams,
+GO(i2d_DSAPrivateKey, iFpp)
+GO(i2d_DSAPrivateKey_bio, iFpp)
+GO(i2d_DSAPrivateKey_fp, iFpp)
+GO(i2d_DSA_PUBKEY, iFpp)
+GO(i2d_DSA_PUBKEY_bio, iFpp)
+GO(i2d_DSA_PUBKEY_fp, iFpp)
+//GO(i2d_DSAPublicKey,
+//GO(i2d_DSA_SIG,
+//GO(i2d_ECDSA_SIG,
+//GO(i2d_ECParameters,
+//GO(i2d_ECPKParameters,
+//GO(i2d_ECPKPARAMETERS,
+GO(i2d_ECPrivateKey, iFpp)
+//GO(i2d_EC_PRIVATEKEY,
+GO(i2d_ECPrivateKey_bio, iFpp)
+GO(i2d_ECPrivateKey_fp, iFpp)
+GO(i2d_EC_PUBKEY, iFpp)
+GO(i2d_EC_PUBKEY_bio, iFpp)
+GO(i2d_EC_PUBKEY_fp, iFpp)
+GO(i2d_EDIPARTYNAME, iFpp)
+GO(i2d_ESS_CERT_ID, iFpp)
+GO(i2d_ESS_ISSUER_SERIAL, iFpp)
+GO(i2d_ESS_SIGNING_CERT, iFpp)
+GO(i2d_EXTENDED_KEY_USAGE, iFpp)
+GO(i2d_GENERAL_NAME, iFpp)
+GO(i2d_GENERAL_NAMES, iFpp)
+//GO(i2d_int_dhx,
+GO(i2d_ISSUING_DIST_POINT, iFpp)
+GO(i2d_KRB5_APREQ, iFpp)
+GO(i2d_KRB5_APREQBODY, iFpp)
+GO(i2d_KRB5_AUTHDATA, iFpp)
+GO(i2d_KRB5_AUTHENT, iFpp)
+GO(i2d_KRB5_AUTHENTBODY, iFpp)
+GO(i2d_KRB5_CHECKSUM, iFpp)
+GO(i2d_KRB5_ENCDATA, iFpp)
+GO(i2d_KRB5_ENCKEY, iFpp)
+GO(i2d_KRB5_PRINCNAME, iFpp)
+GO(i2d_KRB5_TICKET, iFpp)
+GO(i2d_KRB5_TKTBODY, iFpp)
+GO(i2d_NETSCAPE_CERT_SEQUENCE, iFpp)
+GO(i2d_NETSCAPE_ENCRYPTED_PKEY, iFpp)
+GO(i2d_NETSCAPE_PKEY, iFpp)
+GO(i2d_Netscape_RSA, iFpp)
+GO(i2d_NETSCAPE_SPKAC, iFpp)
+GO(i2d_NETSCAPE_SPKI, iFpp)
+GO(i2d_NETSCAPE_X509, iFpp)
+GO(i2d_NOTICEREF, iFpp)
+GO(i2d_OCSP_BASICRESP, iFpp)
+GO(i2d_OCSP_CERTID, iFpp)
+GO(i2d_OCSP_CERTSTATUS, iFpp)
+GO(i2d_OCSP_CRLID, iFpp)
+GO(i2d_OCSP_ONEREQ, iFpp)
+GO(i2d_OCSP_REQINFO, iFpp)
+GO(i2d_OCSP_REQUEST, iFpp)
+GO(i2d_OCSP_RESPBYTES, iFpp)
+GO(i2d_OCSP_RESPDATA, iFpp)
+GO(i2d_OCSP_RESPID, iFpp)
+GO(i2d_OCSP_RESPONSE, iFpp)
+GO(i2d_OCSP_REVOKEDINFO, iFpp)
+GO(i2d_OCSP_SERVICELOC, iFpp)
+GO(i2d_OCSP_SIGNATURE, iFpp)
+GO(i2d_OCSP_SINGLERESP, iFpp)
+GO(i2d_OTHERNAME, iFpp)
+GO(i2d_PBE2PARAM, iFpp)
+GO(i2d_PBEPARAM, iFpp)
+GO(i2d_PBKDF2PARAM, iFpp)
+GO(i2d_PKCS12, iFpp)
+GO(i2d_PKCS12_BAGS, iFpp)
+GO(i2d_PKCS12_bio, iFpp)
+GO(i2d_PKCS12_fp, iFpp)
+GO(i2d_PKCS12_MAC_DATA, iFpp)
+GO(i2d_PKCS12_SAFEBAG, iFpp)
+GO(i2d_PKCS7, iFpp)
+GO(i2d_PKCS7_bio, iFpp)
+GO(i2d_PKCS7_bio_stream, iFpppi)
+GO(i2d_PKCS7_DIGEST, iFpp)
+GO(i2d_PKCS7_ENC_CONTENT, iFpp)
+GO(i2d_PKCS7_ENCRYPT, iFpp)
+GO(i2d_PKCS7_ENVELOPE, iFpp)
+GO(i2d_PKCS7_fp, iFpp)
+GO(i2d_PKCS7_ISSUER_AND_SERIAL, iFpp)
+GO(i2d_PKCS7_NDEF, iFpp)
+GO(i2d_PKCS7_RECIP_INFO, iFpp)
+GO(i2d_PKCS7_SIGNED, iFpp)
+GO(i2d_PKCS7_SIGN_ENVELOPE, iFpp)
+GO(i2d_PKCS7_SIGNER_INFO, iFpp)
+GO(i2d_PKCS8_bio, iFpp)
+GO(i2d_PKCS8_fp, iFpp)
+GO(i2d_PKCS8PrivateKey_bio, iFpp)
+GO(i2d_PKCS8PrivateKey_fp, iFpp)
+GO(i2d_PKCS8PrivateKeyInfo_bio, iFpp)
+GO(i2d_PKCS8PrivateKeyInfo_fp, iFpp)
+GO(i2d_PKCS8PrivateKey_nid_bio, iFpp)
+GO(i2d_PKCS8PrivateKey_nid_fp, iFpp)
+GO(i2d_PKCS8_PRIV_KEY_INFO, iFpp)
+GO(i2d_PKCS8_PRIV_KEY_INFO_bio, iFpp)
+GO(i2d_PKCS8_PRIV_KEY_INFO_fp, iFpp)
+GO(i2d_PKEY_USAGE_PERIOD, iFpp)
+GO(i2d_POLICYINFO, iFpp)
+GO(i2d_POLICYQUALINFO, iFpp)
+GO(i2d_PrivateKey, iFpp)
+GO(i2d_PrivateKey_bio, iFpp)
+GO(i2d_PrivateKey_fp, iFpp)
+GO(i2d_PROXY_CERT_INFO_EXTENSION, iFpp)
+GO(i2d_PROXY_POLICY, iFpp)
+GO(i2d_PUBKEY, iFpp)
+GO(i2d_PUBKEY_bio, iFpp)
+GO(i2d_PUBKEY_fp, iFpp)
+//GO(i2d_PublicKey,
+//GO(i2d_re_X509_tbs,
+GO(i2d_RSA_NET, iFpp)
+GO(i2d_RSA_OAEP_PARAMS, iFpp)
+GO(i2d_RSAPrivateKey, iFpp)
+GO(i2d_RSAPrivateKey_bio, iFpp)
+GO(i2d_RSAPrivateKey_fp, iFpp)
+GO(i2d_RSA_PSS_PARAMS, iFpp)
+GO(i2d_RSA_PUBKEY, iFpp)
+GO(i2d_RSA_PUBKEY_bio, iFpp)
+GO(i2d_RSA_PUBKEY_fp, iFpp)
+GO(i2d_RSAPublicKey, iFpp)
+GO(i2d_RSAPublicKey_bio, iFpp)
+GO(i2d_RSAPublicKey_fp, iFpp)
+GO(i2d_SXNET, iFpp)
+GO(i2d_SXNETID, iFpp)
+GO(i2d_TS_ACCURACY, iFpp)
+GO(i2d_TS_MSG_IMPRINT, iFpp)
+GO(i2d_TS_MSG_IMPRINT_bio, iFpp)
+GO(i2d_TS_MSG_IMPRINT_fp, iFpp)
+GO(i2d_TS_REQ, iFpp)
+GO(i2d_TS_REQ_bio, iFpp)
+GO(i2d_TS_REQ_fp, iFpp)
+GO(i2d_TS_RESP, iFpp)
+GO(i2d_TS_RESP_bio, iFpp)
+GO(i2d_TS_RESP_fp, iFpp)
+GO(i2d_TS_STATUS_INFO, iFpp)
+GO(i2d_TS_TST_INFO, iFpp)
+GO(i2d_TS_TST_INFO_bio, iFpp)
+GO(i2d_TS_TST_INFO_fp, iFpp)
+GO(i2d_USERNOTICE, iFpp)
+GO(i2d_X509, iFpp)
+GO(i2d_X509_ALGOR, iFpp)
+GO(i2d_X509_ALGORS, iFpp)
+GO(i2d_X509_ATTRIBUTE, iFpp)
+GO(i2d_X509_AUX, iFpp)
+GO(i2d_X509_bio, iFpp)
+GO(i2d_X509_CERT_AUX, iFpp)
+GO(i2d_X509_CERT_PAIR, iFpp)
+GO(i2d_X509_CINF, iFpp)
+GO(i2d_X509_CRL, iFpp)
+GO(i2d_X509_CRL_bio, iFpp)
+GO(i2d_X509_CRL_fp, iFpp)
+GO(i2d_X509_CRL_INFO, iFpp)
+GO(i2d_X509_EXTENSION, iFpp)
+GO(i2d_X509_EXTENSIONS, iFpp)
+GO(i2d_X509_fp, iFpp)
+GO(i2d_X509_NAME, iFpp)
+GO(i2d_X509_NAME_ENTRY, iFpp)
+GO(i2d_X509_PKEY, iFpp)
+GO(i2d_X509_PUBKEY, iFpp)
+GO(i2d_X509_REQ, iFpp)
+GO(i2d_X509_REQ_bio, iFpp)
+GO(i2d_X509_REQ_fp, iFpp)
+GO(i2d_X509_REQ_INFO, iFpp)
+GO(i2d_X509_REVOKED, iFpp)
+GO(i2d_X509_SIG, iFpp)
+GO(i2d_X509_VAL, iFpp)
+//GO(i2o_ECPublicKey,
+//GO(i2s_ASN1_ENUMERATED,
+//GO(i2s_ASN1_ENUMERATED_TABLE,
+//GO(i2s_ASN1_INTEGER,
+//GO(i2s_ASN1_OCTET_STRING,
+GO(i2t_ASN1_OBJECT, iFpip)
+//GO(i2v_ASN1_BIT_STRING,
+//GO(i2v_GENERAL_NAME,
+//GO(i2v_GENERAL_NAMES,
+//GO(idea_cbc_encrypt,
+//GO(idea_cfb64_encrypt,
+//GO(idea_ecb_encrypt,
+//GO(idea_encrypt,
+//GO(idea_ofb64_encrypt,
+//GO(idea_options,
+//GO(idea_set_decrypt_key,
+//GO(idea_set_encrypt_key,
+//GO(_init,
+//GO(int_rsa_verify,
+//GO(ISSUING_DIST_POINT_free,
+//GO(ISSUING_DIST_POINT_new,
+//GO(KRB5_APREQBODY_free,
+//GO(KRB5_APREQBODY_new,
+//GO(KRB5_APREQ_free,
+//GO(KRB5_APREQ_new,
+//GO(KRB5_AUTHDATA_free,
+//GO(KRB5_AUTHDATA_new,
+//GO(KRB5_AUTHENTBODY_free,
+//GO(KRB5_AUTHENTBODY_new,
+//GO(KRB5_AUTHENT_free,
+//GO(KRB5_AUTHENT_new,
+//GO(KRB5_CHECKSUM_free,
+//GO(KRB5_CHECKSUM_new,
+//GO(KRB5_ENCDATA_free,
+//GO(KRB5_ENCDATA_new,
+//GO(KRB5_ENCKEY_free,
+//GO(KRB5_ENCKEY_new,
+//GO(KRB5_PRINCNAME_free,
+//GO(KRB5_PRINCNAME_new,
+//GO(KRB5_TICKET_free,
+//GO(KRB5_TICKET_new,
+//GO(KRB5_TKTBODY_free,
+//GO(KRB5_TKTBODY_new,
+//GO(level_add_node,
+//GO(level_find_node,
+//GO(lh_delete,
+//GO(lh_doall,
+//GO(lh_doall_arg,
+//GO(lh_free,
+//GO(lh_insert,
+//GO(lh_new,
+//GO(lh_node_stats,
+//GO(lh_node_stats_bio,
+//GO(lh_node_usage_stats,
+//GO(lh_node_usage_stats_bio,
+//GO(lh_num_items,
+//GO(lh_retrieve,
+//GO(lh_stats,
+//GO(lh_stats_bio,
+//GO(lh_strhash,
+//GO(MD4,
+//GO(md4_block_data_order,
+GO(MD4_Final, iFpp)
+GO(MD4_Init, iFp)
+//GO(MD4_Transform,
+GO(MD4_Update, iFppu)
+GO(MD5, pFpLp)
+//GO(md5_block_data_order,
+GO(MD5_Final, iFpp)
+GO(MD5_Init, iFp)
+GO(MD5_Transform, vFpp)
+GO(MD5_Update, iFppu)
+//GO(MDC2,
+//GO(MDC2_Final,
+//GO(MDC2_Init,
+//GO(MDC2_Update,
+//GO(name_cmp,
+//GO(NAME_CONSTRAINTS_check,
+//GO(NAME_CONSTRAINTS_free,
+//GO(NAME_CONSTRAINTS_new,
+//GO(NCONF_default,
+//GO(NCONF_dump_bio,
+//GO(NCONF_dump_fp,
+//GO(NCONF_free,
+//GO(NCONF_free_data,
+//GO(NCONF_get_number_e,
+//GO(NCONF_get_section,
+//GO(NCONF_get_string,
+//GO(NCONF_load,
+//GO(NCONF_load_bio,
+//GO(NCONF_load_fp,
+//GO(NCONF_new,
+//GO(NCONF_WIN32,
+//GO(NETSCAPE_CERT_SEQUENCE_free,
+//GO(NETSCAPE_CERT_SEQUENCE_new,
+//GO(NETSCAPE_ENCRYPTED_PKEY_free,
+//GO(NETSCAPE_ENCRYPTED_PKEY_new,
+//GO(NETSCAPE_PKEY_free,
+//GO(NETSCAPE_PKEY_new,
+//GO(NETSCAPE_SPKAC_free,
+//GO(NETSCAPE_SPKAC_new,
+//GO(NETSCAPE_SPKI_b64_decode,
+//GO(NETSCAPE_SPKI_b64_encode,
+//GO(NETSCAPE_SPKI_free,
+//GO(NETSCAPE_SPKI_get_pubkey,
+//GO(NETSCAPE_SPKI_new,
+//GO(NETSCAPE_SPKI_print,
+//GO(NETSCAPE_SPKI_set_pubkey,
+//GO(NETSCAPE_SPKI_sign,
+//GO(NETSCAPE_SPKI_verify,
+GO(NETSCAPE_X509_free, vFp)
+GO(NETSCAPE_X509_new, pFv)
+//GO(NOTICEREF_free,
+//GO(NOTICEREF_new,
+//GO(o2i_ECPublicKey,
+//GO(OBJ_add_object,
+//GO(OBJ_add_sigid,
+//GO(OBJ_bsearch_,
+//GO(OBJ_bsearch_ex_,
+GO(OBJ_cleanup, vFv)
+GO(OBJ_cmp, iFpp)
+GO(OBJ_create, iFppp)
+//GO(OBJ_create_objects,
+GO(OBJ_dup, pFp)
+//GO(OBJ_find_sigid_algs,
+//GO(OBJ_find_sigid_by_algs,
+GO(OBJ_ln2nid, iFp)
+//GO(OBJ_NAME_add,
+//GO(OBJ_NAME_cleanup,
+//GO(OBJ_NAME_do_all,
+//GO(OBJ_NAME_do_all_sorted,
+//GO(OBJ_NAME_get,
+//GO(OBJ_NAME_init,
+//GO(OBJ_NAME_new_index,
+//GO(OBJ_NAME_remove,
+//GO(OBJ_new_nid,
+GO(OBJ_nid2ln, pFi)
+GO(OBJ_nid2obj, pFi)
+GO(OBJ_nid2sn, pFi)
+GO(OBJ_obj2nid, iFp)
+GO(OBJ_obj2txt, iFpipi)
+//GO(OBJ_sigid_free,
+GO(OBJ_sn2nid, iFp)
+GO(OBJ_txt2nid, iFp)
+GO(OBJ_txt2obj, pFpi)
+//GO(OCSP_accept_responses_new,
+//GO(OCSP_archive_cutoff_new,
+//GO(OCSP_basic_add1_cert,
+//GO(OCSP_basic_add1_nonce,
+//GO(OCSP_basic_add1_status,
+//GO(OCSP_BASICRESP_add1_ext_i2d,
+//GO(OCSP_BASICRESP_add_ext,
+//GO(OCSP_BASICRESP_delete_ext,
+GO(OCSP_BASICRESP_free, vFp)
+//GO(OCSP_BASICRESP_get1_ext_d2i,
+//GO(OCSP_BASICRESP_get_ext,
+//GO(OCSP_BASICRESP_get_ext_by_critical,
+//GO(OCSP_BASICRESP_get_ext_by_NID,
+//GO(OCSP_BASICRESP_get_ext_by_OBJ,
+//GO(OCSP_BASICRESP_get_ext_count,
+//GO(OCSP_BASICRESP_new,
+//GO(OCSP_basic_sign,
+GO(OCSP_basic_verify, iFpppL)
+//GO(OCSP_CERTID_dup,
+GO(OCSP_CERTID_free, vFp)
+//GO(OCSP_cert_id_new,
+//GO(OCSP_CERTID_new,
+//GO(OCSP_CERTSTATUS_free,
+//GO(OCSP_CERTSTATUS_new,
+//GO(OCSP_cert_status_str,
+GO(OCSP_cert_to_id, pFppp)
+GO(OCSP_check_nonce, iFpp)
+//GO(OCSP_check_validity,
+//GO(OCSP_copy_nonce,
+//GO(OCSP_CRLID_free,
+//GO(OCSP_crlID_new,
+//GO(OCSP_CRLID_new,
+//GO(OCSP_crl_reason_str,
+//GO(OCSP_id_cmp,
+//GO(OCSP_id_get0_info,
+//GO(OCSP_id_issuer_cmp,
+//GO(OCSP_ONEREQ_add1_ext_i2d,
+//GO(OCSP_ONEREQ_add_ext,
+//GO(OCSP_ONEREQ_delete_ext,
+//GO(OCSP_ONEREQ_free,
+//GO(OCSP_onereq_get0_id,
+//GO(OCSP_ONEREQ_get1_ext_d2i,
+//GO(OCSP_ONEREQ_get_ext,
+//GO(OCSP_ONEREQ_get_ext_by_critical,
+//GO(OCSP_ONEREQ_get_ext_by_NID,
+//GO(OCSP_ONEREQ_get_ext_by_OBJ,
+//GO(OCSP_ONEREQ_get_ext_count,
+//GO(OCSP_ONEREQ_new,
+//GO(OCSP_parse_url,
+//GO(OCSP_REQ_CTX_add1_header,
+//GO(OCSP_REQ_CTX_free,
+//GO(OCSP_REQ_CTX_get0_mem_bio,
+//GO(OCSP_REQ_CTX_http,
+//GO(OCSP_REQ_CTX_i2d,
+//GO(OCSP_REQ_CTX_nbio,
+//GO(OCSP_REQ_CTX_nbio_d2i,
+//GO(OCSP_REQ_CTX_new,
+//GO(OCSP_REQ_CTX_set1_req,
+//GO(OCSP_REQINFO_free,
+//GO(OCSP_REQINFO_new,
+GO(OCSP_request_add0_id, pFpp)
+//GO(OCSP_request_add1_cert,
+//GO(OCSP_REQUEST_add1_ext_i2d,
+GO(OCSP_request_add1_nonce, iFppi)
+//GO(OCSP_REQUEST_add_ext,
+//GO(OCSP_REQUEST_delete_ext,
+GO(OCSP_REQUEST_free, vFp)
+//GO(OCSP_REQUEST_get1_ext_d2i,
+//GO(OCSP_REQUEST_get_ext,
+//GO(OCSP_REQUEST_get_ext_by_critical,
+//GO(OCSP_REQUEST_get_ext_by_NID,
+//GO(OCSP_REQUEST_get_ext_by_OBJ,
+//GO(OCSP_REQUEST_get_ext_count,
+//GO(OCSP_request_is_signed,
+GO(OCSP_REQUEST_new, pFv)
+//GO(OCSP_request_onereq_count,
+//GO(OCSP_request_onereq_get0,
+//GO(OCSP_REQUEST_print,
+//GO(OCSP_request_set1_name,
+//GO(OCSP_request_sign,
+//GO(OCSP_request_verify,
+//GO(OCSP_RESPBYTES_free,
+//GO(OCSP_RESPBYTES_new,
+//GO(OCSP_resp_count,
+//GO(OCSP_RESPDATA_free,
+//GO(OCSP_RESPDATA_new,
+//GO(OCSP_resp_find,
+GO(OCSP_resp_find_status, iFppppppp)
+//GO(OCSP_resp_get0,
+//GO(OCSP_RESPID_free,
+//GO(OCSP_RESPID_new,
+//GO(OCSP_response_create,
+GO(OCSP_RESPONSE_free, vFp)
+GO(OCSP_response_get1_basic, pFp)
+GO(OCSP_RESPONSE_new, pFv)
+//GO(OCSP_RESPONSE_print,
+//GO(OCSP_response_status,
+//GO(OCSP_response_status_str,
+//GO(OCSP_REVOKEDINFO_free,
+//GO(OCSP_REVOKEDINFO_new,
+//GO(OCSP_sendreq_bio,
+//GO(OCSP_sendreq_nbio,
+//GO(OCSP_sendreq_new,
+//GO(OCSP_SERVICELOC_free,
+//GO(OCSP_SERVICELOC_new,
+//GO(OCSP_set_max_response_length,
+//GO(OCSP_SIGNATURE_free,
+//GO(OCSP_SIGNATURE_new,
+//GO(OCSP_single_get0_status,
+//GO(OCSP_SINGLERESP_add1_ext_i2d,
+//GO(OCSP_SINGLERESP_add_ext,
+//GO(OCSP_SINGLERESP_delete_ext,
+//GO(OCSP_SINGLERESP_free,
+//GO(OCSP_SINGLERESP_get1_ext_d2i,
+//GO(OCSP_SINGLERESP_get_ext,
+//GO(OCSP_SINGLERESP_get_ext_by_critical,
+//GO(OCSP_SINGLERESP_get_ext_by_NID,
+//GO(OCSP_SINGLERESP_get_ext_by_OBJ,
+//GO(OCSP_SINGLERESP_get_ext_count,
+//GO(OCSP_SINGLERESP_new,
+//GO(OCSP_url_svcloc_new,
+GO(OPENSSL_add_all_algorithms_conf, vFv)
+GO(OPENSSL_add_all_algorithms_noconf, vFv)
+GO(OpenSSL_add_all_ciphers, vFv)
+//GO(OpenSSL_add_all_digests,
+//GO(OPENSSL_asc2uni,
+//GO(OPENSSL_atomic_add,
+GO(OPENSSL_cleanse, vFpL)
+GO(OPENSSL_config, vFp)
+//GO(OPENSSL_cpuid_setup,
+//GO(OpenSSLDie,
+//GO(OPENSSL_DIR_end,
+//GO(OPENSSL_DIR_read,
+GO(OPENSSL_gmtime, pFpp)
+GO(OPENSSL_gmtime_adj, iFpil)
+GO(OPENSSL_gmtime_diff, iFpppp)
+//GO(OPENSSL_ia32cap_loc,
+//GO(OPENSSL_init,
+GO(OPENSSL_init_crypto, iFLp)
+//GO(OPENSSL_instrument_bus,
+//GO(OPENSSL_instrument_bus2,
+//GO(OPENSSL_isservice,
+//GO(OPENSSL_issetugid,
+//GO(OPENSSL_load_builtin_modules,
+//GO(OPENSSL_memcmp,
+GO(OPENSSL_no_config, vFv)
+//GO(OPENSSL_rdtsc,
+GO(OPENSSL_sk_free, vFp) //1.1+
+GO(OPENSSL_sk_new_null, pFv) //1.1+
+GO(OPENSSL_sk_num, iFp) //1.1+
+GO(OPENSSL_sk_pop, pFp) //1.1+
+GOM(OPENSSL_sk_pop_free, pFEpp) //1.1+
+GO(OPENSSL_sk_push, iFpp) //1.1+
+GO(OPENSSL_sk_value, pFpi) //1.1+
+//GO(OPENSSL_showfatal,
+//GO(OPENSSL_stderr,
+GO(OPENSSL_strcasecmp, iFpp)
+GO(OPENSSL_strncasecmp, iFppL)
+//GO(OPENSSL_uni2asc,
+//GO(OPENSSL_wipe_cpu,
+GO(OpenSSL_version_num, LFv)
+//GO(_ossl_096_des_random_seed,
+//GO(_ossl_old_crypt,
+//GO(_ossl_old_des_cbc_cksum,
+//GO(_ossl_old_des_cbc_encrypt,
+//GO(_ossl_old_des_cfb64_encrypt,
+//GO(_ossl_old_des_cfb_encrypt,
+//GO(_ossl_old_des_crypt,
+//GO(_ossl_old_des_decrypt3,
+//GO(_ossl_old_des_ecb3_encrypt,
+//GO(_ossl_old_des_ecb_encrypt,
+//GO(_ossl_old_des_ede3_cbc_encrypt,
+//GO(_ossl_old_des_ede3_cfb64_encrypt,
+//GO(_ossl_old_des_ede3_ofb64_encrypt,
+//GO(_ossl_old_des_enc_read,
+//GO(_ossl_old_des_encrypt,
+//GO(_ossl_old_des_encrypt2,
+//GO(_ossl_old_des_encrypt3,
+//GO(_ossl_old_des_enc_write,
+//GO(_ossl_old_des_fcrypt,
+//GO(_ossl_old_des_is_weak_key,
+//GO(_ossl_old_des_key_sched,
+//GO(_ossl_old_des_ncbc_encrypt,
+//GO(_ossl_old_des_ofb64_encrypt,
+//GO(_ossl_old_des_ofb_encrypt,
+//GO(_ossl_old_des_options,
+//GO(_ossl_old_des_pcbc_encrypt,
+//GO(_ossl_old_des_quad_cksum,
+//GO(_ossl_old_des_random_key,
+//GO(_ossl_old_des_random_seed,
+//GO(_ossl_old_des_read_2passwords,
+//GO(_ossl_old_des_read_password,
+//GO(_ossl_old_des_read_pw,
+//GO(_ossl_old_des_read_pw_string,
+//GO(_ossl_old_des_set_key,
+//GO(_ossl_old_des_set_odd_parity,
+//GO(_ossl_old_des_string_to_2keys,
+//GO(_ossl_old_des_string_to_key,
+//GO(_ossl_old_des_xcbc_encrypt,
+GO(OSSL_PROVIDER_try_load, pFppi)
+//GO(OTHERNAME_cmp,
+//GO(OTHERNAME_free,
+//GO(OTHERNAME_new,
+//GO(PBE2PARAM_free,
+//GO(PBE2PARAM_new,
+//GO(PBEPARAM_free,
+//GO(PBEPARAM_new,
+//GO(PBKDF2PARAM_free,
+//GO(PBKDF2PARAM_new,
+//GO(PEM_ASN1_read,
+//GO(PEM_ASN1_read_bio,
+//GO(PEM_ASN1_write,
+//GO(PEM_ASN1_write_bio,
+//GO(PEM_bytes_read_bio,
+//GO(pem_check_suffix,
+//GO(PEM_def_callback,
+//GO(PEM_dek_info,
+//GO(PEM_do_header,
+//GO(PEM_get_EVP_CIPHER_INFO,
+//GO(PEM_proc_type,
+//GO(PEM_read,
+//GO(PEM_read_bio,
+//GO(PEM_read_bio_CMS,
+//GO(PEM_read_bio_DHparams,
+//GO(PEM_read_bio_DSAparams,
+GOM(PEM_read_bio_DSAPrivateKey, pFEpppp)
+GOM(PEM_read_bio_DSA_PUBKEY, pFEpppp)
+//GO(PEM_read_bio_ECPKParameters,
+GOM(PEM_read_bio_ECPrivateKey, pFEpppp)
+GOM(PEM_read_bio_EC_PUBKEY, pFEpppp)
+//GO(PEM_read_bio_NETSCAPE_CERT_SEQUENCE,
+//GO(PEM_read_bio_Parameters,
+GOM(PEM_read_bio_PKCS7, pFEpppp)
+//GO(PEM_read_bio_PKCS8,
+//GO(PEM_read_bio_PKCS8_PRIV_KEY_INFO,
+//GO(PEM_read_bio_PrivateKey,
+//GO(PEM_read_bio_PUBKEY,
+GOM(PEM_read_bio_RSAPrivateKey, pFEpppp)
+GOM(PEM_read_bio_RSA_PUBKEY, pFEpppp)
+//GO(PEM_read_bio_RSAPublicKey,
+GOM(PEM_read_bio_X509, pFEpppp)
+GOM(PEM_read_bio_X509_AUX, pFEpppp)
+GOM(PEM_read_bio_X509_CERT_PAIR, pFEpppp)
+GOM(PEM_read_bio_X509_CRL, pFEpppp)
+GOM(PEM_read_bio_X509_REQ, pFEpppp)
+//GO(PEM_read_CMS,
+//GO(PEM_read_DHparams,
+//GO(PEM_read_DSAparams,
+//GO(PEM_read_DSAPrivateKey,
+//GO(PEM_read_DSA_PUBKEY,
+//GO(PEM_read_ECPKParameters,
+//GO(PEM_read_ECPrivateKey,
+//GO(PEM_read_EC_PUBKEY,
+//GO(PEM_read_NETSCAPE_CERT_SEQUENCE,
+//GO(PEM_read_PKCS7,
+//GO(PEM_read_PKCS8,
+//GO(PEM_read_PKCS8_PRIV_KEY_INFO,
+//GO(PEM_read_PrivateKey,
+//GO(PEM_read_PUBKEY,
+//GO(PEM_read_RSAPrivateKey,
+//GO(PEM_read_RSA_PUBKEY,
+//GO(PEM_read_RSAPublicKey,
+GO(PEM_read_X509, pFpppp)
+GO(PEM_read_X509_AUX, pFpppp)
+//GO(PEM_read_X509_CERT_PAIR,
+//GO(PEM_read_X509_CRL,
+//GO(PEM_read_X509_REQ,
+//GO(PEM_SealFinal,
+//GO(PEM_SealInit,
+//GO(PEM_SealUpdate,
+//GO(PEM_SignFinal,
+//GO(PEM_SignInit,
+//GO(PEM_SignUpdate,
+//GO(PEM_write,
+//GO(PEM_write_bio,
+GO(PEM_write_bio_ASN1_stream, iFpppipp)
+//GO(PEM_write_bio_CMS,
+//GO(PEM_write_bio_CMS_stream,
+//GO(PEM_write_bio_DHparams,
+//GO(PEM_write_bio_DHxparams,
+//GO(PEM_write_bio_DSAparams,
+GOM(PEM_write_bio_DSAPrivateKey, iFEppppipp)
+GO(PEM_write_bio_DSA_PUBKEY, iFpp)
+//GO(PEM_write_bio_ECPKParameters,
+GOM(PEM_write_bio_ECPrivateKey, iFEppppipp)
+GO(PEM_write_bio_EC_PUBKEY, iFpp)
+//GO(PEM_write_bio_NETSCAPE_CERT_SEQUENCE,
+//GO(PEM_write_bio_Parameters,
+//GO(PEM_write_bio_PKCS7,
+//GO(PEM_write_bio_PKCS7_stream,
+//GO(PEM_write_bio_PKCS8,
+//GO(PEM_write_bio_PKCS8PrivateKey,
+//GO(PEM_write_bio_PKCS8PrivateKey_nid,
+//GO(PEM_write_bio_PKCS8_PRIV_KEY_INFO,
+//GO(PEM_write_bio_PrivateKey,
+//GO(PEM_write_bio_PUBKEY,
+GOM(PEM_write_bio_RSAPrivateKey, iFEppppipp)
+GO(PEM_write_bio_RSA_PUBKEY, iFpp)
+//GO(PEM_write_bio_RSAPublicKey,
+GO(PEM_write_bio_X509, iFpp)
+GO(PEM_write_bio_X509_AUX, iFpp)
+//GO(PEM_write_bio_X509_CERT_PAIR,
+GO(PEM_write_bio_X509_CRL, iFpp)
+GO(PEM_write_bio_X509_REQ, iFpp)
+//GO(PEM_write_bio_X509_REQ_NEW,
+//GO(PEM_write_CMS,
+//GO(PEM_write_DHparams,
+//GO(PEM_write_DHxparams,
+//GO(PEM_write_DSAparams,
+//GO(PEM_write_DSAPrivateKey,
+//GO(PEM_write_DSA_PUBKEY,
+//GO(PEM_write_ECPKParameters,
+//GO(PEM_write_ECPrivateKey,
+//GO(PEM_write_EC_PUBKEY,
+//GO(PEM_write_NETSCAPE_CERT_SEQUENCE,
+//GO(PEM_write_PKCS7,
+//GO(PEM_write_PKCS8,
+//GO(PEM_write_PKCS8PrivateKey,
+//GO(PEM_write_PKCS8PrivateKey_nid,
+//GO(PEM_write_PKCS8_PRIV_KEY_INFO,
+//GO(PEM_write_PrivateKey,
+//GO(PEM_write_PUBKEY,
+//GO(PEM_write_RSAPrivateKey,
+//GO(PEM_write_RSA_PUBKEY,
+//GO(PEM_write_RSAPublicKey,
+//GO(PEM_write_X509,
+//GO(PEM_write_X509_AUX,
+//GO(PEM_write_X509_CERT_PAIR,
+//GO(PEM_write_X509_CRL,
+//GO(PEM_write_X509_REQ,
+//GO(PEM_write_X509_REQ_NEW,
+//GO(PEM_X509_INFO_read,
+//GO(PEM_X509_INFO_read_bio,
+//GO(PEM_X509_INFO_write_bio,
+//GO(pitem_free,
+//GO(pitem_new,
+//GO(PKCS12_add_cert,
+//GO(PKCS12_add_CSPName_asc,
+//GO(PKCS12_add_friendlyname_asc,
+//GO(PKCS12_add_friendlyname_uni,
+//GO(PKCS12_add_key,
+//GO(PKCS12_add_localkeyid,
+//GO(PKCS12_add_safe,
+//GO(PKCS12_add_safes,
+//GO(PKCS12_BAGS_free,
+//GO(PKCS12_BAGS_new,
+//GO(PKCS12_certbag2x509,
+//GO(PKCS12_certbag2x509crl,
+GO(PKCS12_create, pFppppp)
+//GO(PKCS12_decrypt_skey,
+GO(PKCS12_free, vFp)
+//GO(PKCS12_gen_mac,
+//GO(PKCS12_get_attr_gen,
+//GO(PKCS12_get_friendlyname,
+//GO(PKCS12_init,
+//GO(PKCS12_item_decrypt_d2i,
+//GO(PKCS12_item_i2d_encrypt,
+//GO(PKCS12_item_pack_safebag,
+//GO(PKCS12_key_gen_asc,
+//GO(PKCS12_key_gen_uni,
+//GO(PKCS12_MAC_DATA_free,
+//GO(PKCS12_MAC_DATA_new,
+//GO(PKCS12_MAKE_KEYBAG,
+//GO(PKCS12_MAKE_SHKEYBAG,
+GO(PKCS12_new, pFv)
+//GO(PKCS12_newpass,
+//GO(PKCS12_pack_authsafes,
+//GO(PKCS12_pack_p7data,
+//GO(PKCS12_pack_p7encdata,
+GO(PKCS12_parse, iFppppp)
+GO(PKCS12_PBE_add, vFv)
+//GO(PKCS12_pbe_crypt,
+GO(PKCS12_PBE_keyivgen, iFppipppi)
+//GO(PKCS12_SAFEBAG_free,
+//GO(PKCS12_SAFEBAG_new,
+//GO(PKCS12_set_mac,
+//GO(PKCS12_setup_mac,
+//GO(PKCS12_unpack_authsafes,
+//GO(PKCS12_unpack_p7data,
+//GO(PKCS12_unpack_p7encdata,
+//GO(PKCS12_verify_mac,
+//GO(PKCS12_x5092certbag,
+//GO(PKCS12_x509crl2certbag,
+//GO(PKCS1_MGF1,
+//GO(PKCS5_pbe2_set,
+//GO(PKCS5_pbe2_set_iv,
+//GO(PKCS5_PBE_add,
+//GO(PKCS5_PBE_keyivgen,
+//GO(PKCS5_pbe_set,
+//GO(PKCS5_pbe_set0_algor,
+GO(PKCS5_PBKDF2_HMAC, iFpipiipip)
+GO(PKCS5_PBKDF2_HMAC_SHA1, iFpipiiip)
+//GO(PKCS5_pbkdf2_set,
+//GO(PKCS5_v2_PBE_keyivgen,
+//GO(PKCS5_v2_PBKDF2_keyivgen,
+//GO(PKCS7_add0_attrib_signing_time,
+//GO(PKCS7_add1_attrib_digest,
+//GO(PKCS7_add_attrib_content_type,
+//GO(PKCS7_add_attrib_smimecap,
+//GO(PKCS7_add_attribute,
+//GO(PKCS7_add_certificate,
+//GO(PKCS7_add_crl,
+//GO(PKCS7_add_recipient,
+//GO(PKCS7_add_recipient_info,
+//GO(PKCS7_add_signature,
+//GO(PKCS7_add_signed_attribute,
+//GO(PKCS7_add_signer,
+//GO(PKCS7_cert_from_signer_info,
+//GO(PKCS7_content_new,
+//GO(PKCS7_ctrl,
+//GO(PKCS7_dataDecode,
+//GO(PKCS7_dataFinal,
+//GO(PKCS7_dataInit,
+//GO(PKCS7_dataVerify,
+//GO(PKCS7_decrypt,
+//GO(PKCS7_DIGEST_free,
+//GO(PKCS7_digest_from_attributes,
+//GO(PKCS7_DIGEST_new,
+//GO(PKCS7_dup,
+//GO(PKCS7_ENC_CONTENT_free,
+//GO(PKCS7_ENC_CONTENT_new,
+//GO(PKCS7_encrypt,
+//GO(PKCS7_ENCRYPT_free,
+//GO(PKCS7_ENCRYPT_new,
+//GO(PKCS7_ENVELOPE_free,
+//GO(PKCS7_ENVELOPE_new,
+//GO(PKCS7_final,
+GO(PKCS7_free, vFp)
+//GO(PKCS7_get0_signers,
+//GO(PKCS7_get_attribute,
+//GO(PKCS7_get_issuer_and_serial,
+//GO(PKCS7_get_signed_attribute,
+//GO(PKCS7_get_signer_info,
+//GO(PKCS7_get_smimecap,
+//GO(PKCS7_ISSUER_AND_SERIAL_digest,
+//GO(PKCS7_ISSUER_AND_SERIAL_free,
+//GO(PKCS7_ISSUER_AND_SERIAL_new,
+//GO(PKCS7_new,
+//GO(PKCS7_print_ctx,
+//GO(PKCS7_RECIP_INFO_free,
+//GO(PKCS7_RECIP_INFO_get0_alg,
+//GO(PKCS7_RECIP_INFO_new,
+//GO(PKCS7_RECIP_INFO_set,
+//GO(PKCS7_set0_type_other,
+//GO(PKCS7_set_attributes,
+//GO(PKCS7_set_cipher,
+//GO(PKCS7_set_content,
+//GO(PKCS7_set_digest,
+//GO(PKCS7_set_signed_attributes,
+//GO(PKCS7_set_type,
+GO(PKCS7_sign, pFppppi)
+GO(PKCS7_sign_add_signer, pFppppi)
+GO(PKCS7_signatureVerify, iFpppp)
+//GO(PKCS7_SIGNED_free,
+//GO(PKCS7_SIGNED_new,
+//GO(PKCS7_SIGN_ENVELOPE_free,
+//GO(PKCS7_SIGN_ENVELOPE_new,
+//GO(PKCS7_SIGNER_INFO_free,
+//GO(PKCS7_SIGNER_INFO_get0_algs,
+//GO(PKCS7_SIGNER_INFO_new,
+//GO(PKCS7_SIGNER_INFO_set,
+//GO(PKCS7_SIGNER_INFO_sign,
+//GO(PKCS7_simple_smimecap,
+//GO(PKCS7_stream,
+//GO(PKCS7_to_TS_TST_INFO,
+//GO(PKCS7_verify,
+//GO(PKCS8_add_keyusage,
+//GO(PKCS8_decrypt,
+//GO(PKCS8_encrypt,
+//GO(PKCS8_pkey_get0,
+//GO(PKCS8_pkey_set0,
+GO(PKCS8_PRIV_KEY_INFO_free, vFp)
+GO(PKCS8_PRIV_KEY_INFO_new, pFv)
+//GO(PKCS8_set_broken,
+//GO(PKEY_USAGE_PERIOD_free,
+//GO(PKEY_USAGE_PERIOD_new,
+//GO(policy_cache_find_data,
+//GO(policy_cache_free,
+//GO(policy_cache_set,
+//GO(policy_cache_set_mapping,
+//GO(POLICY_CONSTRAINTS_free,
+//GO(POLICY_CONSTRAINTS_new,
+//GO(policy_data_free,
+//GO(policy_data_new,
+//GO(POLICYINFO_free,
+//GO(POLICYINFO_new,
+//GO(POLICY_MAPPING_free,
+//GO(POLICY_MAPPING_new,
+//GO(policy_node_cmp_new,
+//GO(policy_node_free,
+//GO(policy_node_match,
+//GO(POLICYQUALINFO_free,
+//GO(POLICYQUALINFO_new,
+//GO(pqueue_find,
+//GO(pqueue_free,
+//GO(pqueue_insert,
+//GO(pqueue_iterator,
+//GO(pqueue_new,
+//GO(pqueue_next,
+//GO(pqueue_peek,
+//GO(pqueue_pop,
+//GO(pqueue_print,
+//GO(pqueue_size,
+GO(private_AES_set_decrypt_key, iFpip)
+GO(private_AES_set_encrypt_key, iFpip)
+//GO(private_Camellia_set_key,
+//GO(private_RC4_set_key,
+//GO(PROXY_CERT_INFO_EXTENSION_free,
+//GO(PROXY_CERT_INFO_EXTENSION_new,
+//GO(PROXY_POLICY_free,
+//GO(PROXY_POLICY_new,
+GO(RAND_add, vFpid)
+GO(RAND_bytes, iFpi)
+//GO(RAND_cleanup,
+GO(RAND_egd, iFp)
+GO(RAND_egd_bytes, iFpi)
+GO(RAND_file_name, pFpL)
+//GO(RAND_get_rand_method,
+GO(RAND_load_file, iFpl)
+GO(RAND_poll, iFv)
+GO(RAND_pseudo_bytes, iFpi)
+GO(RAND_query_egd_bytes, iFppi)
+GO(RAND_seed, vFpi)
+//GO(RAND_set_rand_engine,
+//GO(RAND_set_rand_method,
+GO(RAND_SSLeay, pFv)
+GO(RAND_status, iFv)
+GO(RAND_write_file, iFp)
+//GO(RC2_cbc_encrypt,
+//GO(RC2_cfb64_encrypt,
+//GO(RC2_decrypt,
+//GO(RC2_ecb_encrypt,
+//GO(RC2_encrypt,
+//GO(RC2_ofb64_encrypt,
+//GO(RC2_set_key,
+//GO(RC4,
+//GO(RC4_options,
+//GO(RC4_set_key,
+//GO(RIPEMD160,
+//GO(ripemd160_block_data_order,
+//GO(RIPEMD160_Final,
+//GO(RIPEMD160_Init,
+//GO(RIPEMD160_Transform,
+//GO(RIPEMD160_Update,
+//GO(RSA_blinding_off,
+//GO(RSA_blinding_on,
+GO(RSA_check_key, iFp)
+//GO(RSA_flags,
+GO(RSA_free, vFp)
+//GO(RSA_generate_key,
+GO(RSA_generate_key_ex, iFpipp)
+GO(RSA_get0_crt_params, vFpppp)
+GO(RSA_get0_factors, vFppp)
+GO(RSA_get0_key, vFpppp)
+//GO(RSA_get_default_method,
+//GO(RSA_get_ex_data,
+//GO(RSA_get_ex_new_index,
+GO(RSA_get_method, pFp)
+//GO(RSA_memory_lock,
+GO(RSA_meth_get_flags, iFp)
+GO(RSA_new, pFv)
+GO(RSA_new_method, pFp)
+//GO(RSA_null_method,
+//GO(RSA_OAEP_PARAMS_free,
+//GO(RSA_OAEP_PARAMS_new,
+//GO(RSA_padding_add_none,
+//GO(RSA_padding_add_PKCS1_OAEP,
+//GO(RSA_padding_add_PKCS1_OAEP_mgf1,
+//GO(RSA_padding_add_PKCS1_PSS,
+//GO(RSA_padding_add_PKCS1_PSS_mgf1,
+//GO(RSA_padding_add_PKCS1_type_1,
+//GO(RSA_padding_add_PKCS1_type_2,
+//GO(RSA_padding_add_SSLv23,
+//GO(RSA_padding_add_X931,
+//GO(RSA_padding_check_none,
+//GO(RSA_padding_check_PKCS1_OAEP,
+//GO(RSA_padding_check_PKCS1_OAEP_mgf1,
+//GO(RSA_padding_check_PKCS1_type_1,
+//GO(RSA_padding_check_PKCS1_type_2,
+//GO(RSA_padding_check_SSLv23,
+//GO(RSA_padding_check_X931,
+GO(RSA_PKCS1_OpenSSL, pFv)
+GO(RSA_PKCS1_SSLeay, pFv)
+GO(RSA_pkey_ctx_ctrl, iFpiiip)
+//GO(RSA_print,
+//GO(RSA_print_fp,
+GO(RSA_private_decrypt, iFipppi)
+GO(RSA_private_encrypt, iFipppi)
+//GO(RSAPrivateKey_dup,
+//GO(RSA_PSS_PARAMS_free,
+//GO(RSA_PSS_PARAMS_new,
+GO(RSA_public_decrypt, iFipppi)
+GO(RSA_public_encrypt, iFipppi)
+//GO(RSAPublicKey_dup,
+GO(RSA_set0_crt_params, iFpppp)
+GO(RSA_set0_factors, iFppp)
+GO(RSA_set0_key, iFpppp)
+//GO(RSA_set_default_method,
+//GO(RSA_set_ex_data,
+GO(RSA_set_method, iFpp)
+//GO(RSA_setup_blinding,
+GO(RSA_sign, iFipuppp)
+GO(RSA_sign_ASN1_OCTET_STRING, iFipuppp)
+GO(RSA_size, iFp)
+GO(RSA_test_flags, iFpi)
+GO(RSA_up_ref, iFp)
+GO(RSA_verify, iFipupup)
+GO(RSA_verify_ASN1_OCTET_STRING, iFipupup)
+GO(RSA_verify_PKCS1_PSS, iFppppi)
+GO(RSA_verify_PKCS1_PSS_mgf1, iFpppppi)
+//GO(RSA_X931_hash_id,
+//GO(s2i_ASN1_INTEGER,
+//GO(s2i_ASN1_OCTET_STRING,
+//GO(SEED_cbc_encrypt,
+//GO(SEED_cfb128_encrypt,
+//GO(SEED_decrypt,
+//GO(SEED_ecb_encrypt,
+//GO(SEED_encrypt,
+//GO(SEED_ofb128_encrypt,
+//GO(SEED_set_key,
+//GO(SHA,
+GO(SHA1, pFpLp)
+//GO(sha1_block_data_order,
+GO(SHA1_Final, iFpp)
+GO(SHA1_Init, iFp)
+//GO(SHA1_Transform,
+GO(SHA1_Update, iFppL)
+GO(SHA224, pFpLp)
+GO(SHA224_Final, iFpp)
+GO(SHA224_Init, iFp)
+GO(SHA224_Update, iFppL)
+GO(SHA256, pFpLp)
+//GO(sha256_block_data_order,
+//GO(sha256_block_data_order_neon,
+GO(SHA256_Final, iFpp)
+GO(SHA256_Init, iFp)
+//GO(SHA256_Transform,
+GO(SHA256_Update, iFppL)
+GO(SHA384, pFpLp)
+GO(SHA384_Final, iFpp)
+GO(SHA384_Init, iFp)
+GO(SHA384_Update, iFppL)
+GO(SHA512, pFpLp)
+//GO(sha512_block_data_order,
+GO(SHA512_Final, iFpp)
+GO(SHA512_Init, iFp)
+//GO(SHA512_Transform,
+GO(SHA512_Update, iFppL)
+//GO(SHA_Final,
+//GO(SHA_Init,
+//GO(SHA_Transform,
+//GO(SHA_Update,
+GO(SMIME_crlf_copy, iFppi)
+GO(SMIME_read_ASN1, pFppp)
+//GO(SMIME_read_CMS,
+//GO(SMIME_read_PKCS7,
+GO(SMIME_text, iFpp)
+GO(SMIME_write_ASN1, iFpppiiipp)
+//GO(SMIME_write_CMS,
+//GO(SMIME_write_PKCS7,
+//GO(SRP_Calc_A,
+//GO(SRP_Calc_B,
+//GO(SRP_Calc_client_key,
+//GO(SRP_Calc_server_key,
+//GO(SRP_Calc_u,
+//GO(SRP_Calc_x,
+//GO(SRP_check_known_gN_param,
+//GO(SRP_create_verifier,
+//GO(SRP_create_verifier_BN,
+//GO(SRP_get_default_gN,
+//GO(SRP_user_pwd_free,
+//GO(SRP_VBASE_free,
+//GO(SRP_VBASE_get1_by_user,
+//GO(SRP_VBASE_get_by_user,
+//GO(SRP_VBASE_init,
+//GO(SRP_VBASE_new,
+//GO(SRP_Verify_A_mod_N,
+//GO(SRP_Verify_B_mod_N,
+GO(SSLeay, lFv)
+//GO(ssleay_rand_bytes,
+GO(SSLeay_version, pFi)
+//GO(string_to_hex,
+//GO(SXNET_add_id_asc,
+//GO(SXNET_add_id_INTEGER,
+//GO(SXNET_add_id_ulong,
+//GO(SXNET_free,
+//GO(SXNET_get_id_asc,
+//GO(SXNET_get_id_INTEGER,
+//GO(SXNET_get_id_ulong,
+//GO(SXNETID_free,
+//GO(SXNETID_new,
+//GO(SXNET_new,
+//GO(tree_find_sk,
+//GO(TS_ACCURACY_dup,
+//GO(TS_ACCURACY_free,
+//GO(TS_ACCURACY_get_micros,
+//GO(TS_ACCURACY_get_millis,
+//GO(TS_ACCURACY_get_seconds,
+//GO(TS_ACCURACY_new,
+//GO(TS_ACCURACY_set_micros,
+//GO(TS_ACCURACY_set_millis,
+//GO(TS_ACCURACY_set_seconds,
+//GO(TS_ASN1_INTEGER_print_bio,
+//GO(TS_CONF_get_tsa_section,
+//GO(TS_CONF_load_cert,
+//GO(TS_CONF_load_certs,
+//GO(TS_CONF_load_key,
+//GO(TS_CONF_set_accuracy,
+//GO(TS_CONF_set_certs,
+//GO(TS_CONF_set_clock_precision_digits,
+//GO(TS_CONF_set_crypto_device,
+//GO(TS_CONF_set_default_engine,
+//GO(TS_CONF_set_def_policy,
+//GO(TS_CONF_set_digests,
+//GO(TS_CONF_set_ess_cert_id_chain,
+//GO(TS_CONF_set_ordering,
+//GO(TS_CONF_set_policies,
+//GO(TS_CONF_set_serial,
+//GO(TS_CONF_set_signer_cert,
+//GO(TS_CONF_set_signer_key,
+//GO(TS_CONF_set_tsa_name,
+//GO(TS_ext_print_bio,
+//GO(TS_MSG_IMPRINT_dup,
+//GO(TS_MSG_IMPRINT_free,
+//GO(TS_MSG_IMPRINT_get_algo,
+//GO(TS_MSG_IMPRINT_get_msg,
+//GO(TS_MSG_IMPRINT_new,
+//GO(TS_MSG_IMPRINT_print_bio,
+//GO(TS_MSG_IMPRINT_set_algo,
+//GO(TS_MSG_IMPRINT_set_msg,
+//GO(TS_OBJ_print_bio,
+//GO(TS_REQ_add_ext,
+//GO(TS_REQ_delete_ext,
+//GO(TS_REQ_dup,
+//GO(TS_REQ_ext_free,
+//GO(TS_REQ_free,
+//GO(TS_REQ_get_cert_req,
+//GO(TS_REQ_get_ext,
+//GO(TS_REQ_get_ext_by_critical,
+//GO(TS_REQ_get_ext_by_NID,
+//GO(TS_REQ_get_ext_by_OBJ,
+//GO(TS_REQ_get_ext_count,
+//GO(TS_REQ_get_ext_d2i,
+//GO(TS_REQ_get_exts,
+//GO(TS_REQ_get_msg_imprint,
+//GO(TS_REQ_get_nonce,
+//GO(TS_REQ_get_policy_id,
+//GO(TS_REQ_get_version,
+//GO(TS_REQ_new,
+//GO(TS_REQ_print_bio,
+//GO(TS_REQ_set_cert_req,
+//GO(TS_REQ_set_msg_imprint,
+//GO(TS_REQ_set_nonce,
+//GO(TS_REQ_set_policy_id,
+//GO(TS_REQ_set_version,
+//GO(TS_REQ_to_TS_VERIFY_CTX,
+//GO(TS_RESP_create_response,
+//GO(TS_RESP_CTX_add_failure_info,
+//GO(TS_RESP_CTX_add_flags,
+//GO(TS_RESP_CTX_add_md,
+//GO(TS_RESP_CTX_add_policy,
+//GO(TS_RESP_CTX_free,
+//GO(TS_RESP_CTX_get_request,
+//GO(TS_RESP_CTX_get_tst_info,
+//GO(TS_RESP_CTX_new,
+//GO(TS_RESP_CTX_set_accuracy,
+//GO(TS_RESP_CTX_set_certs,
+//GO(TS_RESP_CTX_set_clock_precision_digits,
+//GO(TS_RESP_CTX_set_def_policy,
+//GO(TS_RESP_CTX_set_extension_cb,
+//GO(TS_RESP_CTX_set_serial_cb,
+//GO(TS_RESP_CTX_set_signer_cert,
+//GO(TS_RESP_CTX_set_signer_key,
+//GO(TS_RESP_CTX_set_status_info,
+//GO(TS_RESP_CTX_set_status_info_cond,
+//GO(TS_RESP_CTX_set_time_cb,
+//GO(TS_RESP_dup,
+//GO(TS_RESP_free,
+//GO(TS_RESP_get_status_info,
+//GO(TS_RESP_get_token,
+//GO(TS_RESP_get_tst_info,
+//GO(TS_RESP_new,
+//GO(TS_RESP_print_bio,
+//GO(TS_RESP_set_status_info,
+//GO(TS_RESP_set_tst_info,
+//GO(TS_RESP_verify_response,
+//GO(TS_RESP_verify_signature,
+//GO(TS_RESP_verify_token,
+//GO(TS_STATUS_INFO_dup,
+//GO(TS_STATUS_INFO_free,
+//GO(TS_STATUS_INFO_new,
+//GO(TS_STATUS_INFO_print_bio,
+//GO(TS_TST_INFO_add_ext,
+//GO(TS_TST_INFO_delete_ext,
+//GO(TS_TST_INFO_dup,
+//GO(TS_TST_INFO_ext_free,
+//GO(TS_TST_INFO_free,
+//GO(TS_TST_INFO_get_accuracy,
+//GO(TS_TST_INFO_get_ext,
+//GO(TS_TST_INFO_get_ext_by_critical,
+//GO(TS_TST_INFO_get_ext_by_NID,
+//GO(TS_TST_INFO_get_ext_by_OBJ,
+//GO(TS_TST_INFO_get_ext_count,
+//GO(TS_TST_INFO_get_ext_d2i,
+//GO(TS_TST_INFO_get_exts,
+//GO(TS_TST_INFO_get_msg_imprint,
+//GO(TS_TST_INFO_get_nonce,
+//GO(TS_TST_INFO_get_ordering,
+//GO(TS_TST_INFO_get_policy_id,
+//GO(TS_TST_INFO_get_serial,
+//GO(TS_TST_INFO_get_time,
+//GO(TS_TST_INFO_get_tsa,
+//GO(TS_TST_INFO_get_version,
+//GO(TS_TST_INFO_new,
+//GO(TS_TST_INFO_print_bio,
+//GO(TS_TST_INFO_set_accuracy,
+//GO(TS_TST_INFO_set_msg_imprint,
+//GO(TS_TST_INFO_set_nonce,
+//GO(TS_TST_INFO_set_ordering,
+//GO(TS_TST_INFO_set_policy_id,
+//GO(TS_TST_INFO_set_serial,
+//GO(TS_TST_INFO_set_time,
+//GO(TS_TST_INFO_set_tsa,
+//GO(TS_TST_INFO_set_version,
+//GO(TS_VERIFY_CTX_cleanup,
+//GO(TS_VERIFY_CTX_free,
+//GO(TS_VERIFY_CTX_init,
+//GO(TS_VERIFY_CTX_new,
+//GO(TS_X509_ALGOR_print_bio,
+//GO(TXT_DB_create_index,
+//GO(TXT_DB_free,
+//GO(TXT_DB_get_by_index,
+//GO(TXT_DB_insert,
+//GO(TXT_DB_read,
+//GO(TXT_DB_write,
+GO(UI_add_error_string, iFpp)
+GO(UI_add_info_string, iFpp)
+GO(UI_add_input_boolean, iFpppppip)
+GO(UI_add_input_string, iFppipii)
+GO(UI_add_user_data, pFpp)
+//GO(UI_add_verify_string,
+GO(UI_construct_prompt, pFppp)
+//GO(UI_create_method,
+//GO(UI_ctrl,
+//GO(UI_destroy_method,
+GO(UI_dup_error_string, iFpp)
+GO(UI_dup_info_string, iFpp)
+GO(UI_dup_input_boolean, iFpppppip)
+GO(UI_dup_input_string, iFppipii)
+GO(UI_dup_verify_string, iFppipiip)
+GO(UI_free, vFp)
+//GO(UI_get0_action_string,
+//GO(UI_get0_output_string,
+GO(UI_get0_result, pFpi)
+//GO(UI_get0_result_string,
+//GO(UI_get0_test_string,
+GO(UI_get0_user_data, pFp)
+GO(UI_get_default_method, pFv)
+//GO(UI_get_ex_data,
+//GO(UI_get_ex_new_index,
+//GO(UI_get_input_flags,
+GO(UI_get_method, pFp)
+//GO(UI_get_result_maxsize,
+//GO(UI_get_result_minsize,
+//GO(UI_get_string_type,
+//GO(UI_method_get_closer,
+//GO(UI_method_get_flusher,
+//GO(UI_method_get_opener,
+//GO(UI_method_get_prompt_constructor,
+//GO(UI_method_get_reader,
+//GO(UI_method_get_writer,
+//GO(UI_method_set_closer,
+//GO(UI_method_set_flusher,
+//GO(UI_method_set_opener,
+//GO(UI_method_set_prompt_constructor,
+//GO(UI_method_set_reader,
+//GO(UI_method_set_writer,
+GO(UI_new, pFv)
+GO(UI_new_method, pFp)
+GO(UI_OpenSSL, pFv)
+GO(UI_process, iFp)
+GO(UI_set_default_method, vFp)
+//GO(UI_set_ex_data,
+GO(UI_set_method, pFpp)
+//GO(UI_set_result,
+//GO(UI_UTIL_read_pw,
+//GO(UI_UTIL_read_pw_string,
+//GO(USERNOTICE_free,
+//GO(USERNOTICE_new,
+GO(UTF8_getc, iFpip)
+GO(UTF8_putc, iFpiL)
+//GO(v2i_ASN1_BIT_STRING,
+//GO(v2i_GENERAL_NAME,
+//GO(v2i_GENERAL_NAME_ex,
+//GO(v2i_GENERAL_NAMES,
+//GO(WHIRLPOOL,
+//GO(WHIRLPOOL_BitUpdate,
+//GO(whirlpool_block,
+//GO(WHIRLPOOL_Final,
+//GO(WHIRLPOOL_Init,
+//GO(WHIRLPOOL_Update,
+GO(X509_add1_ext_i2d, iFpipiL)
+//GO(X509_add1_reject_object,
+//GO(X509_add1_trust_object,
+//GO(X509_add_ext,
+//GO(X509_ALGOR_cmp,
+//GO(X509_ALGOR_dup,
+//GO(X509_ALGOR_free,
+//GO(X509_ALGOR_get0,
+//GO(X509_ALGOR_new,
+//GO(X509_ALGOR_set0,
+//GO(X509_ALGOR_set_md,
+//GO(X509_alias_get0,
+//GO(X509_alias_set1,
+//GO(X509at_add1_attr,
+//GO(X509at_add1_attr_by_NID,
+//GO(X509at_add1_attr_by_OBJ,
+//GO(X509at_add1_attr_by_txt,
+//GO(X509at_delete_attr,
+//GO(X509at_get0_data_by_OBJ,
+//GO(X509at_get_attr,
+//GO(X509at_get_attr_by_NID,
+//GO(X509at_get_attr_by_OBJ,
+//GO(X509at_get_attr_count,
+//GO(X509_ATTRIBUTE_count,
+//GO(X509_ATTRIBUTE_create,
+//GO(X509_ATTRIBUTE_create_by_NID,
+//GO(X509_ATTRIBUTE_create_by_OBJ,
+//GO(X509_ATTRIBUTE_create_by_txt,
+//GO(X509_ATTRIBUTE_dup,
+//GO(X509_ATTRIBUTE_free,
+//GO(X509_ATTRIBUTE_get0_data,
+//GO(X509_ATTRIBUTE_get0_object,
+//GO(X509_ATTRIBUTE_get0_type,
+//GO(X509_ATTRIBUTE_new,
+//GO(X509_ATTRIBUTE_set1_data,
+//GO(X509_ATTRIBUTE_set1_object,
+//GO(X509_CERT_AUX_free,
+//GO(X509_CERT_AUX_new,
+//GO(X509_CERT_AUX_print,
+//GO(X509_certificate_type,
+//GO(X509_CERT_PAIR_free,
+//GO(X509_CERT_PAIR_new,
+//GO(X509_chain_check_suiteb,
+//GO(X509_chain_up_ref,
+//GO(X509_check_akid,
+//GO(X509_check_ca,
+//GO(X509_check_email,
+GO(X509_check_host, iFppLup)
+//GO(X509_check_ip,
+//GO(X509_check_ip_asc,
+GO(X509_check_issued, iFpp)
+//GO(X509_check_private_key,
+GO(X509_check_purpose, iFpii)
+//GO(X509_check_trust,
+//GO(X509_CINF_free,
+//GO(X509_CINF_new,
+GO(X509_cmp, iFpp)
+GO(X509_cmp_current_time, iFp)
+GO(X509_cmp_time, iFpp)
+//GO(X509_CRL_add0_revoked,
+GO(X509_CRL_add1_ext_i2d, iFpipiL)
+//GO(X509_CRL_add_ext,
+//GO(X509_CRL_check_suiteb,
+//GO(X509_CRL_cmp,
+//GO(X509_CRL_delete_ext,
+//GO(X509_CRL_diff,
+//GO(X509_CRL_digest,
+//GO(X509_CRL_dup,
+GO(X509_CRL_free, vFp)
+//GO(X509_CRL_get0_by_cert,
+//GO(X509_CRL_get0_by_serial,
+GO(X509_CRL_get0_nextUpdate, pFp)
+//GO(X509_CRL_get_ext,
+//GO(X509_CRL_get_ext_by_critical,
+//GO(X509_CRL_get_ext_by_NID,
+//GO(X509_CRL_get_ext_by_OBJ,
+//GO(X509_CRL_get_ext_count,
+GO(X509_CRL_get_ext_d2i, pFpipp)
+//GO(X509_CRL_get_meth_data,
+//GO(X509_CRL_http_nbio,
+//GO(X509_CRL_INFO_free,
+//GO(X509_CRL_INFO_new,
+//GO(X509_CRL_match,
+//GO(X509_CRL_METHOD_free,
+//GO(X509_CRL_METHOD_new,
+//GO(X509_CRL_new,
+//GO(X509_CRL_print,
+//GO(X509_CRL_print_fp,
+//GO(X509_CRL_set_default_method,
+GO(X509_CRL_set_issuer_name, iFpp)
+//GO(X509_CRL_set_lastUpdate,
+//GO(X509_CRL_set_meth_data,
+//GO(X509_CRL_set_nextUpdate,
+//GO(X509_CRL_set_version,
+//GO(X509_CRL_sign,
+//GO(X509_CRL_sign_ctx,
+//GO(X509_CRL_sort,
+//GO(X509_CRL_verify,
+//GO(X509_delete_ext,
+GO(X509_digest, iFpppp)
+GO(X509_dup, pFp)
+//GO(X509_email_free,
+GO(X509_EXTENSION_create_by_NID, pFpiip)
+GO(X509_EXTENSION_create_by_OBJ, pFppip)
+//GO(X509_EXTENSION_dup,
+GO(X509_EXTENSION_free, vFp)
+GO(X509_EXTENSION_get_critical, iFp)
+GO(X509_EXTENSION_get_data, pFp)
+GO(X509_EXTENSION_get_object, pFp)
+//GO(X509_EXTENSION_new,
+GO(X509_EXTENSION_set_critical, iFpi)
+GO(X509_EXTENSION_set_data, iFpp)
+GO(X509_EXTENSION_set_object, iFpp)
+//GO(X509_find_by_issuer_and_serial,
+//GO(X509_find_by_subject,
+GO(X509_free, vFp)
+GO(X509_get0_pubkey_bitstr, pFp)
+//GO(X509_get0_signature,
+GO(X509_get0_tbs_sigalg, pFp)
+//GO(X509_get1_email,
+//GO(X509_get1_ocsp,
+//GO(X509_get_default_cert_area,
+GO(X509_get_default_cert_dir, pFv)
+GO(X509_get_default_cert_dir_env, pFv)
+GO(X509_get_default_cert_file, pFv)
+GO(X509_get_default_cert_file_env, pFv)
+//GO(X509_get_default_private_dir,
+//GO(X509_get_ex_data,
+//GO(X509_get_ex_new_index,
+GO(X509_get_ext, pFpi)
+GO(X509_get_ext_by_critical, iFpii)
+GO(X509_get_ext_by_NID, iFpii)
+GO(X509_get_ext_by_OBJ, iFppi)
+GO(X509_get_ext_count, iFp)
+GO(X509_get_ext_d2i, pFpipp)
+GO(X509_get_issuer_name, pFp)
+GO(X509_get_pubkey, pFp)
+//GO(X509_get_pubkey_parameters,
+GO(X509_get0_notAfter, pFp)
+GO(X509_get0_notBefore, pFp)
+GO(X509_get0_pubkey, pFp)
+GO(X509_get0_serialNumber, pFp)
+GO(X509_get_serialNumber, pFp)
+//GO(X509_get_signature_nid,
+GO(X509_get_subject_name, pFp)
+GO(X509_get_version, lFp)
+GO(X509_get_X509_PUBKEY, pFp)
+//GO(X509_gmtime_adj,
+//GO(X509_http_nbio,
+//GO(X509_INFO_free,
+//GO(X509_INFO_new,
+//GO(X509_issuer_and_serial_cmp,
+//GO(X509_issuer_and_serial_hash,
+//GO(X509_issuer_name_cmp,
+GO(X509_issuer_name_hash, LFp)
+GO(X509_issuer_name_hash_old, LFp)
+//GO(X509_keyid_get0,
+//GO(X509_keyid_set1,
+GO(X509_load_cert_crl_file, iFppi)
+GO(X509_load_cert_file, iFppi)
+GO(X509_load_crl_file, iFppi)
+//GO(X509_LOOKUP_by_alias,
+//GO(X509_LOOKUP_by_fingerprint,
+//GO(X509_LOOKUP_by_issuer_serial,
+//GO(X509_LOOKUP_by_subject,
+//GO(X509_LOOKUP_ctrl,
+GO(X509_LOOKUP_file, pFv)
+//GO(X509_LOOKUP_free,
+GO(X509_LOOKUP_hash_dir, pFv)
+//GO(X509_LOOKUP_init,
+//GO(X509_LOOKUP_new,
+//GO(X509_LOOKUP_shutdown,
+//GO(X509_NAME_add_entry,
+//GO(X509_NAME_add_entry_by_NID,
+//GO(X509_NAME_add_entry_by_OBJ,
+GO(X509_NAME_add_entry_by_txt, iFppipiii)
+//GO(X509_NAME_cmp,
+//GO(X509_NAME_delete_entry,
+//GO(X509_NAME_digest,
+//GO(X509_NAME_dup,
+GO(X509_NAME_entry_count, iFp)
+GO(X509_NAME_ENTRY_create_by_NID, pFpiipi)
+GO(X509_NAME_ENTRY_create_by_OBJ, pFppipi)
+GO(X509_NAME_ENTRY_create_by_txt, pFppipi)
+//GO(X509_NAME_ENTRY_dup,
+//GO(X509_NAME_ENTRY_free,
+GO(X509_NAME_ENTRY_get_data, pFp)
+GO(X509_NAME_ENTRY_get_object, pFp)
+//GO(X509_NAME_ENTRY_new,
+GO(X509_NAME_ENTRY_set_data, iFpipi)
+GO(X509_NAME_ENTRY_set_object, iFpp)
+GO(X509_NAME_free, vFp)
+GO(X509_NAME_get0_der, iFppp)
+GO(X509_NAME_get_entry, pFpi)
+GO(X509_NAME_get_index_by_NID, iFpii)
+GO(X509_NAME_get_index_by_OBJ, iFppi)
+GO(X509_NAME_get_text_by_NID, iFpipi)
+GO(X509_NAME_get_text_by_OBJ, iFpppi)
+//GO(X509_NAME_hash,
+//GO(X509_NAME_hash_old,
+//GO(X509_NAME_new,
+GO(X509_NAME_oneline, pFppi)
+GO(X509_NAME_print, iFppi)
+GO(X509_NAME_print_ex, iFppiu)
+GO(X509_NAME_print_ex_fp, iFppiu)
+//GO(X509_NAME_set,
+GO(X509_new, pFv)
+//GO(X509_OBJECT_free_contents,
+//GO(X509_OBJECT_idx_by_subject,
+//GO(X509_OBJECT_retrieve_by_subject,
+//GO(X509_OBJECT_retrieve_match,
+//GO(X509_OBJECT_up_ref_count,
+//GO(X509_ocspid_print,
+//GO(X509_PKEY_free,
+//GO(X509_PKEY_new,
+//GO(X509_policy_check,
+//GO(X509_policy_level_get0_node,
+//GO(X509_policy_level_node_count,
+//GO(X509_policy_node_get0_parent,
+//GO(X509_policy_node_get0_policy,
+//GO(X509_policy_node_get0_qualifiers,
+//GO(X509_POLICY_NODE_print,
+//GO(X509_policy_tree_free,
+//GO(X509_policy_tree_get0_level,
+//GO(X509_policy_tree_get0_policies,
+//GO(X509_policy_tree_get0_user_policies,
+//GO(X509_policy_tree_level_count,
+GO(X509_print, iFpp)
+GO(X509_print_ex, iFppLL)
+GO(X509_print_ex_fp, iFppLL)
+GO(X509_print_fp, iFpp)
+//GO(X509_pubkey_digest,
+//GO(X509_PUBKEY_free,
+GO(X509_PUBKEY_get, pFp)
+GO(X509_PUBKEY_get0_param, iFppppp)
+//GO(X509_PUBKEY_new,
+//GO(X509_PUBKEY_set,
+//GO(X509_PUBKEY_set0_param,
+//GO(X509_PURPOSE_add,
+//GO(X509_PURPOSE_cleanup,
+//GO(X509_PURPOSE_get0,
+//GO(X509_PURPOSE_get0_name,
+//GO(X509_PURPOSE_get0_sname,
+//GO(X509_PURPOSE_get_by_id,
+//GO(X509_PURPOSE_get_by_sname,
+//GO(X509_PURPOSE_get_count,
+//GO(X509_PURPOSE_get_id,
+//GO(X509_PURPOSE_get_trust,
+//GO(X509_PURPOSE_set,
+//GO(X509_reject_clear,
+//GO(X509_REQ_add1_attr,
+//GO(X509_REQ_add1_attr_by_NID,
+//GO(X509_REQ_add1_attr_by_OBJ,
+//GO(X509_REQ_add1_attr_by_txt,
+//GO(X509_REQ_add_extensions,
+//GO(X509_REQ_add_extensions_nid,
+//GO(X509_REQ_check_private_key,
+//GO(X509_REQ_delete_attr,
+//GO(X509_REQ_digest,
+//GO(X509_REQ_dup,
+//GO(X509_REQ_extension_nid,
+//GO(X509_REQ_free,
+//GO(X509_REQ_get1_email,
+//GO(X509_REQ_get_attr,
+//GO(X509_REQ_get_attr_by_NID,
+//GO(X509_REQ_get_attr_by_OBJ,
+//GO(X509_REQ_get_attr_count,
+//GO(X509_REQ_get_extension_nids,
+//GO(X509_REQ_get_extensions,
+GO(X509_REQ_get_pubkey, pFp)
+GO(X509_REQ_get_X509_PUBKEY, pFp)
+GO(X509_REQ_get0_pubkey, pFp)
+//GO(X509_REQ_INFO_free,
+//GO(X509_REQ_INFO_new,
+//GO(X509_REQ_new,
+//GO(X509_REQ_print,
+//GO(X509_REQ_print_ex,
+//GO(X509_REQ_print_fp,
+//GO(X509_REQ_set_extension_nids,
+GO(X509_REQ_set_pubkey, iFpp)
+GO(X509_REQ_set_subject_name, iFpp)
+//GO(X509_REQ_set_version,
+//GO(X509_REQ_sign,
+//GO(X509_REQ_sign_ctx,
+//GO(X509_REQ_to_X509,
+//GO(X509_REQ_verify,
+GO(X509_REVOKED_add1_ext_i2d, iFpipiL)
+//GO(X509_REVOKED_add_ext,
+//GO(X509_REVOKED_delete_ext,
+//GO(X509_REVOKED_dup,
+//GO(X509_REVOKED_free,
+//GO(X509_REVOKED_get_ext,
+//GO(X509_REVOKED_get_ext_by_critical,
+//GO(X509_REVOKED_get_ext_by_NID,
+//GO(X509_REVOKED_get_ext_by_OBJ,
+//GO(X509_REVOKED_get_ext_count,
+GO(X509_REVOKED_get_ext_d2i, pFpipp)
+//GO(X509_REVOKED_new,
+//GO(X509_REVOKED_set_revocationDate,
+//GO(X509_REVOKED_set_serialNumber,
+GO(X509_set1_notAfter, iFpp)
+GO(X509_set1_notBefore, iFpp)
+//GO(X509_set_ex_data,
+GO(X509_set_issuer_name, iFpp)
+//GO(X509_set_notAfter,
+//GO(X509_set_notBefore,
+GO(X509_set_pubkey, iFpp)
+GO(X509_set_serialNumber, iFpp)
+GO(X509_set_subject_name, iFpp)
+//GO(X509_set_version,
+//GO(X509_SIG_free,
+GO(X509_sign, iFppp)
+GO(X509_signature_dump, iFppi)
+GO(X509_signature_print, iFppp)
+GO(X509_sign_ctx, iFpp)
+//GO(X509_SIG_new,
+GO(X509_STORE_add_cert, iFpp)
+GO(X509_STORE_add_crl, iFpp)
+GO(X509_STORE_add_lookup, pFpp)
+GO(X509_STORE_CTX_cleanup, vFp)
+GO(X509_STORE_CTX_free, vFp)
+//GO(X509_STORE_CTX_get0_current_crl,
+//GO(X509_STORE_CTX_get0_current_issuer,
+GO(X509_STORE_CTX_get0_param, pFp)
+//GO(X509_STORE_CTX_get0_parent_ctx,
+//GO(X509_STORE_CTX_get0_policy_tree,
+GO(X509_STORE_CTX_get0_cert, pFp)
+GO(X509_STORE_CTX_get0_chain, pFp)
+GO(X509_STORE_CTX_get0_store, pFp)
+GO(X509_STORE_CTX_get0_untrusted, pFp)
+GO(X509_STORE_CTX_get1_chain, pFp)
+GO(X509_STORE_CTX_get1_issuer, iFppp)
+GO(X509_STORE_CTX_get_chain, pFp)
+GO(X509_STORE_CTX_get_current_cert, pFp)
+GO(X509_STORE_CTX_get_error, iFp)
+GO(X509_STORE_CTX_get_error_depth, iFp)
+//GO(X509_STORE_CTX_get_ex_data,
+//GO(X509_STORE_CTX_get_ex_new_index,
+//GO(X509_STORE_CTX_get_explicit_policy,
+GO(X509_STORE_CTX_init, iFpppp)
+GO(X509_STORE_CTX_new, pFv)
+//GO(X509_STORE_CTX_purpose_inherit,
+//GO(X509_STORE_CTX_set0_crls,
+//GO(X509_STORE_CTX_set0_param,
+//GO(X509_STORE_CTX_set_cert,
+//GO(X509_STORE_CTX_set_chain,
+GO(X509_STORE_CTX_set_current_cert, vFpp)
+GO(X509_STORE_CTX_set_default, iFp)
+//GO(X509_STORE_CTX_set_depth,
+GO(X509_STORE_CTX_set_error, vFpi)
+GO(X509_STORE_CTX_set_error_depth, vFpi)
+//GO(X509_STORE_CTX_set_ex_data,
+GO(X509_STORE_CTX_set_flags, vFpL)
+GO(X509_STORE_CTX_set_purpose, iFpi)
+//GO(X509_STORE_CTX_set_time,
+//GO(X509_STORE_CTX_set_trust,
+GOM(X509_STORE_CTX_set_verify_cb, vFEpp)
+//GO(X509_STORE_CTX_trusted_stack,
+GO(X509_STORE_free, vFp)
+GO(X509_STORE_get0_param, pFp)
+//GO(X509_STORE_get1_certs,
+//GO(X509_STORE_get1_crls,
+//GO(X509_STORE_get_by_subject,
+GO(X509_STORE_load_file, iFpp)
+GO(X509_STORE_load_path, iFpp)
+GO(X509_STORE_load_store, iFpp)
+//GO(X509_STORE_load_locations, iFppp)
+GO(X509_STORE_new, pFv)
+//GO(X509_STORE_set1_param,
+//GO(X509_STORE_set_default_paths,
+GO(X509_STORE_set_depth, iFpi)
+GO(X509_STORE_set_flags, iFpL)
+//GO(X509_STORE_set_lookup_crls_cb,
+GO(X509_STORE_set_purpose, iFpi)
+GO(X509_STORE_set_trust, iFpi)
+//GO(X509_STORE_set_verify_cb,
+//GO(X509_subject_name_cmp,
+GO(X509_subject_name_hash, LFp)
+GO(X509_subject_name_hash_old, LFp)
+//GO(X509_supported_extension,
+//GO(X509_time_adj,
+//GO(X509_time_adj_ex,
+//GO(X509_to_X509_REQ,
+//GO(X509_TRUST_add,
+//GO(X509_TRUST_cleanup,
+//GO(X509_trust_clear,
+//GO(X509_TRUST_get0,
+//GO(X509_TRUST_get0_name,
+//GO(X509_TRUST_get_by_id,
+//GO(X509_TRUST_get_count,
+//GO(X509_TRUST_get_flags,
+//GO(X509_TRUST_get_trust,
+//GO(X509_TRUST_set,
+//GO(X509_TRUST_set_default,
+GO(X509_up_ref, iFp)
+GO(X509V3_add1_i2d, iFpipiL)
+//GO(X509v3_add_ext,
+//GO(X509V3_add_standard_extensions,
+//GO(X509V3_add_value,
+//GO(X509V3_add_value_bool,
+//GO(X509V3_add_value_bool_nf,
+//GO(X509V3_add_value_int,
+//GO(X509V3_add_value_uchar,
+//GO(X509V3_conf_free,
+//GO(X509v3_delete_ext,
+//GO(X509V3_EXT_add,
+//GO(X509V3_EXT_add_alias,
+//GO(X509V3_EXT_add_conf,
+//GO(X509V3_EXT_add_list,
+//GO(X509V3_EXT_add_nconf,
+//GO(X509V3_EXT_add_nconf_sk,
+//GO(X509V3_EXT_cleanup,
+//GO(X509V3_EXT_conf,
+//GO(X509V3_EXT_conf_nid,
+//GO(X509V3_EXT_CRL_add_conf,
+//GO(X509V3_EXT_CRL_add_nconf,
+GO(X509V3_EXT_d2i, pFp)
+//GO(X509V3_extensions_print,
+//GO(X509V3_EXT_free,
+GO(X509V3_EXT_get, pFp)
+//GO(X509V3_EXT_get_nid,
+GO(X509V3_EXT_i2d, pFiip)
+//GO(X509V3_EXT_nconf,
+//GO(X509V3_EXT_nconf_nid,
+GO(X509V3_EXT_print, iFppLi)
+GO(X509V3_EXT_print_fp, iFppii)
+//GO(X509V3_EXT_REQ_add_conf,
+//GO(X509V3_EXT_REQ_add_nconf,
+//GO(X509V3_EXT_val_prn,
+GO(X509V3_get_d2i, pFpipp)
+//GO(X509v3_get_ext,
+//GO(X509v3_get_ext_by_critical,
+//GO(X509v3_get_ext_by_NID,
+//GO(X509v3_get_ext_by_OBJ,
+//GO(X509v3_get_ext_count,
+//GO(X509V3_get_section,
+//GO(X509V3_get_string,
+//GO(X509V3_get_value_bool,
+//GO(X509V3_get_value_int,
+//GO(X509V3_NAME_from_section,
+//GO(X509V3_parse_list,
+//GO(X509V3_section_free,
+//GO(X509V3_set_conf_lhash,
+//GO(X509V3_set_ctx,
+//GO(X509V3_set_nconf,
+//GO(X509V3_string_free,
+//GO(X509_VAL_free,
+//GO(X509_VAL_new,
+//GO(X509_verify,
+GO(X509_verify_cert, iFp)
+GO(X509_verify_cert_error_string, pFl)
+//GO(X509_VERIFY_PARAM_add0_policy,
+//GO(X509_VERIFY_PARAM_add0_table,
+//GO(X509_VERIFY_PARAM_add1_host,
+GO(X509_VERIFY_PARAM_clear_flags, iFpL)
+//GO(X509_VERIFY_PARAM_free,
+//GO(X509_VERIFY_PARAM_get0,
+//GO(X509_VERIFY_PARAM_get0_name,
+//GO(X509_VERIFY_PARAM_get0_peername,
+//GO(X509_VERIFY_PARAM_get_count,
+//GO(X509_VERIFY_PARAM_get_depth,
+GO(X509_VERIFY_PARAM_get_flags, LFp)
+//GO(X509_VERIFY_PARAM_inherit,
+//GO(X509_VERIFY_PARAM_lookup,
+//GO(X509_VERIFY_PARAM_new,
+//GO(X509_VERIFY_PARAM_set1,
+//GO(X509_VERIFY_PARAM_set1_email,
+//GO(X509_VERIFY_PARAM_set1_host,
+//GO(X509_VERIFY_PARAM_set1_ip,
+//GO(X509_VERIFY_PARAM_set1_ip_asc,
+//GO(X509_VERIFY_PARAM_set1_name,
+//GO(X509_VERIFY_PARAM_set1_policies,
+//GO(X509_VERIFY_PARAM_set_depth,
+//GO(X509_VERIFY_PARAM_set_flags,
+//GO(X509_VERIFY_PARAM_set_hostflags,
+//GO(X509_VERIFY_PARAM_set_purpose,
+GO(X509_VERIFY_PARAM_set_time, vFpl)
+//GO(X509_VERIFY_PARAM_set_trust,
+//GO(X509_VERIFY_PARAM_table_cleanup,
+//GO(X9_62_CHARACTERISTIC_TWO_free,
+//GO(X9_62_CHARACTERISTIC_TWO_new,
+//GO(X9_62_PENTANOMIAL_free,
+//GO(X9_62_PENTANOMIAL_new,
diff --git a/src/wrapped/wrappedcrypto_private.h b/src/wrapped/wrappedcrypto_private.h
index 87d73af..ab3b3ba 100755..100644
--- a/src/wrapped/wrappedcrypto_private.h
+++ b/src/wrapped/wrappedcrypto_private.h
@@ -96,7 +96,7 @@ GOM(ASN1_i2d_bio, iFEppp)
//GO(ASN1_i2d_fp,
//GO(ASN1_IA5STRING_free,
//GO(ASN1_IA5STRING_new,
-//GO(ASN1_INTEGER_cmp,
+GO(ASN1_INTEGER_cmp, iFpp)
//GO(ASN1_INTEGER_dup,
GO(ASN1_INTEGER_free, vFp)
GO(ASN1_INTEGER_get, lFp)
@@ -172,6 +172,7 @@ GO(ASN1_STRING_data, pFp)
GO(ASN1_STRING_dup, pFp)
GO(ASN1_STRING_free, vFp)
//GO(ASN1_STRING_get_default_mask,
+GO(ASN1_STRING_get0_data, pFp)
GO(ASN1_STRING_length, iFp)
//GO(ASN1_STRING_length_set,
//GO(ASN1_STRING_new,
@@ -255,12 +256,14 @@ GO(BASIC_CONSTRAINTS_new, pFv)
//GO(BF_options,
//GO(BF_set_key,
//GO(BIO_accept,
+GO(BIO_ADDR_free, vFp)
+GO(BIO_ADDR_new, pFv)
//GO(BIO_asn1_get_prefix,
//GO(BIO_asn1_get_suffix,
//GO(BIO_asn1_set_prefix,
//GO(BIO_asn1_set_suffix,
//GO(BIO_callback_ctrl,
-//GO(BIO_clear_flags,
+GO(BIO_clear_flags, vFpi)
//GO(BIO_CONNECT_free,
//GO(BIO_CONNECT_new,
//GO(BIO_copy_next_retry,
@@ -299,17 +302,28 @@ GO(BIO_free_all, vFp)
//GO(BIO_get_callback,
//GO(BIO_get_callback_arg,
GO(BIO_get_close, iFp)
-//GO(BIO_get_ex_data,
+GO(BIO_get_data, pFp)
+GO(BIO_get_ex_data, pFpi)
//GO(BIO_get_ex_new_index,
//GO(BIO_gethostbyname,
//GO(BIO_get_host_ip,
//GO(BIO_get_port,
//GO(BIO_get_retry_BIO,
//GO(BIO_get_retry_reason,
+GO(BIO_get_shutdown, iFp)
GO(BIO_gets, iFppi)
//GO(BIO_hex_string,
//GO(BIO_indent,
GO(BIO_int_ctrl, lFpili)
+GO(BIO_meth_free, vFp)
+GO(BIO_meth_new, pFip)
+GOM(BIO_meth_set_write, iFEpp)
+GOM(BIO_meth_set_read, iFEpp)
+GOM(BIO_meth_set_puts, iFEpp)
+GOM(BIO_meth_set_gets, iFEpp)
+GOM(BIO_meth_set_ctrl, iFEpp)
+GOM(BIO_meth_set_create, iFEpp)
+GOM(BIO_meth_set_destroy, iFEpp)
//GO(BIO_method_name,
//GO(BIO_method_type,
GO(BIO_new, pFp)
@@ -350,8 +364,11 @@ GO(BIO_set, iFpp)
//GO(BIO_set_callback_arg,
GO(BIO_set_close, iFpl)
//GO(BIO_set_cipher,
-//GO(BIO_set_ex_data,
-//GO(BIO_set_flags,
+GO(BIO_set_data, vFpp)
+GO(BIO_set_ex_data, iFpip)
+GO(BIO_set_flags, vFpi)
+GO(BIO_set_init, vFpi)
+GO(BIO_set_shutdown, vFpi)
//GO(BIO_set_tcp_ndelay,
//GO(BIO_s_fd,
//GO(BIO_s_file,
@@ -369,6 +386,7 @@ GO(BIO_s_mem, pFv)
//GO(BIO_s_socket,
GO(BIO_tell, iFp)
//GO(BIO_test_flags,
+GO(BIO_up_ref, iFp)
GO(BIO_vfree, vFp)
//GO(BIO_vprintf,
//GO(BIO_vsnprintf,
@@ -461,6 +479,7 @@ GO(BN_is_bit_set, iFpi)
//GO(BN_is_prime_ex,
//GO(BN_is_prime_fasttest,
//GO(BN_is_prime_fasttest_ex,
+GO(BN_is_word, iFpL)
GO(BN_is_zero, iFp)
//GO(BN_kronecker,
GO(BN_lshift, iFppi)
@@ -847,7 +866,7 @@ GO(CRYPTO_free, vFppi)
//GO(CRYPTO_get_dynlock_value,
//GO(CRYPTO_get_ex_data,
//GO(CRYPTO_get_ex_data_implementation,
-//GO(CRYPTO_get_ex_new_index,
+GO(CRYPTO_get_ex_new_index, iFilpppp)
//GO(CRYPTO_get_id_callback,
//GO(CRYPTO_get_locked_mem_ex_functions,
//GO(CRYPTO_get_locked_mem_functions,
@@ -1147,7 +1166,8 @@ GO(DES_set_odd_parity, vFp)
GO(DES_string_to_2keys, vFppp)
GO(DES_string_to_key, vFpp)
GO(DES_xcbc_encrypt, vFpplppppi)
-//GO(DH_check,
+GO(DH_bits, iFp)
+GO(DH_check, iFpp)
//GO(DH_check_pub_key,
//GO(DH_compute_key,
//GO(DH_compute_key_padded,
@@ -1155,6 +1175,7 @@ GO(DH_free, vFp)
//GO(DH_generate_key,
//GO(DH_generate_parameters,
//GO(DH_generate_parameters_ex,
+GO(DH_get0_pqg, vFpppp)
//GO(DH_get_1024_160,
//GO(DH_get_2048_224,
//GO(DH_get_2048_256,
@@ -1184,6 +1205,7 @@ GO(DH_new, pFv)
//GO(DIST_POINT_set_dpname,
//GO(dsa_builtin_paramgen,
//GO(dsa_builtin_paramgen2,
+GO(DSA_bits, iFp)
//GO(DSA_do_sign,
//GO(DSA_do_verify,
//GO(DSA_dup_DH,
@@ -1191,6 +1213,9 @@ GO(DSA_free, vFp)
GO(DSA_generate_key, iFp)
//GO(DSA_generate_parameters,
GO(DSA_generate_parameters_ex, iFpipippp)
+GO(DSA_get0_key, iFppp)
+GO(DSA_get_method, pFp)
+GO(DSA_get0_pqg, vFpppp)
//GO(DSA_get_default_method,
//GO(DSA_get_ex_data,
//GO(DSA_get_ex_new_index,
@@ -1198,6 +1223,8 @@ GO(DSA_new, pFv)
//GO(DSA_new_method,
GO(DSA_OpenSSL, pFv)
//GO(dsa_paramgen_check_g,
+GO(DSA_set0_key, iFppp)
+GO(DSA_set0_pqg, iFpppp)
//GO(DSAparams_dup,
//GO(DSAparams_print,
//GO(DSAparams_print_fp,
@@ -1807,6 +1834,7 @@ GO(EVP_CIPHER_CTX_init, vFp)
GO(EVP_CIPHER_CTX_new, pFv)
//GO(EVP_CIPHER_CTX_nid,
//GO(EVP_CIPHER_CTX_rand_key,
+GO(EVP_CIPHER_CTX_reset, iFp)
//GO(EVP_CIPHER_CTX_set_app_data,
//GO(EVP_CIPHER_CTX_set_flags,
GO(EVP_CIPHER_CTX_set_key_length, iFpi)
@@ -1947,7 +1975,7 @@ GO(EVP_MD_type, iFp)
//GO(EVP_PKEY_asn1_set_private,
//GO(EVP_PKEY_asn1_set_public,
GO(EVP_PKEY_assign, iFpip)
-//GO(EVP_PKEY_base_id,
+GO(EVP_PKEY_base_id, iFp)
//GO(EVP_PKEY_bits,
GO(EVP_PKEY_cmp, iFpp)
GO(EVP_PKEY_cmp_parameters, iFpp)
@@ -1982,7 +2010,7 @@ GO(EVP_PKEY_derive_set_peer, iFppi)
GO(EVP_PKEY_free, vFp)
//GO(EVP_PKEY_get0,
//GO(EVP_PKEY_get0_asn1,
-//GO(EVP_PKEY_get1_DH,
+GO(EVP_PKEY_get1_DH, pFp)
GO(EVP_PKEY_get1_DSA, pFp)
GO(EVP_PKEY_get1_EC_KEY, pFp)
GO(EVP_PKEY_get1_RSA, pFp)
@@ -2017,13 +2045,14 @@ GO(EVP_PKEY_keygen_init, iFp)
GO(EVP_PKEY_missing_parameters, iFp)
GO(EVP_PKEY_new, pFv)
GO(EVP_PKEY_new_mac_key, pFippi)
+GO(EVP_PKEY_param_check, iFp)
GO(EVP_PKEY_paramgen, iFpp)
GO(EVP_PKEY_paramgen_init, iFp)
//GO(EVP_PKEY_print_params,
//GO(EVP_PKEY_print_private,
//GO(EVP_PKEY_print_public,
//GO(EVP_PKEY_save_parameters,
-//GO(EVP_PKEY_set1_DH,
+GO(EVP_PKEY_set1_DH, iFpp)
GO(EVP_PKEY_set1_DSA, iFpp)
GO(EVP_PKEY_set1_EC_KEY, iFpp)
GO(EVP_PKEY_set1_RSA, iFpp)
@@ -2113,8 +2142,10 @@ GO(HMAC_CTX_copy, iFpp)
GO(HMAC_CTX_init, vFp)
GO(HMAC_CTX_set_flags, vFpL)
GO(HMAC_Final, iFppp)
+GO(HMAC_CTX_free, vFp)
GO(HMAC_Init, iFppip)
GO(HMAC_Init_ex, iFppipp)
+GO(HMAC_CTX_new, pFv)
GO(HMAC_Update, iFppi)
//GO(i2a_ACCESS_DESCRIPTION,
//GO(i2a_ASN1_ENUMERATED,
@@ -2483,7 +2514,7 @@ GO(OBJ_txt2obj, pFpi)
//GO(OCSP_archive_cutoff_new,
//GO(OCSP_basic_add1_cert,
//GO(OCSP_basic_add1_nonce,
-//GO(OCSP_basic_add1_status,
+GO(OCSP_basic_add1_status, pFppiippp)
//GO(OCSP_BASICRESP_add1_ext_i2d,
//GO(OCSP_BASICRESP_add_ext,
//GO(OCSP_BASICRESP_delete_ext,
@@ -2494,8 +2525,8 @@ GO(OCSP_BASICRESP_free, vFp)
//GO(OCSP_BASICRESP_get_ext_by_NID,
//GO(OCSP_BASICRESP_get_ext_by_OBJ,
//GO(OCSP_BASICRESP_get_ext_count,
-//GO(OCSP_BASICRESP_new,
-//GO(OCSP_basic_sign,
+GO(OCSP_BASICRESP_new, pFv)
+GO(OCSP_basic_sign, iFpppppL)
GO(OCSP_basic_verify, iFpppL)
//GO(OCSP_CERTID_dup,
GO(OCSP_CERTID_free, vFp)
@@ -2506,14 +2537,14 @@ GO(OCSP_CERTID_free, vFp)
//GO(OCSP_cert_status_str,
GO(OCSP_cert_to_id, pFppp)
GO(OCSP_check_nonce, iFpp)
-//GO(OCSP_check_validity,
+GO(OCSP_check_validity, iFppll)
//GO(OCSP_copy_nonce,
//GO(OCSP_CRLID_free,
//GO(OCSP_crlID_new,
//GO(OCSP_CRLID_new,
//GO(OCSP_crl_reason_str,
-//GO(OCSP_id_cmp,
-//GO(OCSP_id_get0_info,
+GO(OCSP_id_cmp, iFpp)
+GO(OCSP_id_get0_info, iFppppp)
//GO(OCSP_id_issuer_cmp,
//GO(OCSP_ONEREQ_add1_ext_i2d,
//GO(OCSP_ONEREQ_add_ext,
@@ -2562,21 +2593,22 @@ GO(OCSP_REQUEST_new, pFv)
//GO(OCSP_request_verify,
//GO(OCSP_RESPBYTES_free,
//GO(OCSP_RESPBYTES_new,
-//GO(OCSP_resp_count,
+GO(OCSP_resp_count, iFp)
//GO(OCSP_RESPDATA_free,
//GO(OCSP_RESPDATA_new,
//GO(OCSP_resp_find,
GO(OCSP_resp_find_status, iFppppppp)
-//GO(OCSP_resp_get0,
+GO(OCSP_resp_get0, pFpi)
+GO(OCSP_resp_get0_certs, pFp)
//GO(OCSP_RESPID_free,
//GO(OCSP_RESPID_new,
-//GO(OCSP_response_create,
+GO(OCSP_response_create, pFip)
GO(OCSP_RESPONSE_free, vFp)
GO(OCSP_response_get1_basic, pFp)
GO(OCSP_RESPONSE_new, pFv)
//GO(OCSP_RESPONSE_print,
-//GO(OCSP_response_status,
-//GO(OCSP_response_status_str,
+GO(OCSP_response_status, iFp)
+GO(OCSP_response_status_str, pFl)
//GO(OCSP_REVOKEDINFO_free,
//GO(OCSP_REVOKEDINFO_new,
//GO(OCSP_sendreq_bio,
@@ -2587,11 +2619,12 @@ GO(OCSP_RESPONSE_new, pFv)
//GO(OCSP_set_max_response_length,
//GO(OCSP_SIGNATURE_free,
//GO(OCSP_SIGNATURE_new,
-//GO(OCSP_single_get0_status,
+GO(OCSP_single_get0_status, iFppppp)
//GO(OCSP_SINGLERESP_add1_ext_i2d,
//GO(OCSP_SINGLERESP_add_ext,
//GO(OCSP_SINGLERESP_delete_ext,
//GO(OCSP_SINGLERESP_free,
+GO(OCSP_SINGLERESP_get0_id, pFp)
//GO(OCSP_SINGLERESP_get1_ext_d2i,
//GO(OCSP_SINGLERESP_get_ext,
//GO(OCSP_SINGLERESP_get_ext_by_critical,
@@ -2638,6 +2671,8 @@ GO(OPENSSL_sk_value, pFpi) //1.1+
//GO(OPENSSL_strcasecmp,
//GO(OPENSSL_strncasecmp,
//GO(OPENSSL_uni2asc,
+GO(OpenSSL_version, pFi)
+GO(OpenSSL_version_num, LFv)
//GO(OPENSSL_wipe_cpu,
//GO(_ossl_096_des_random_seed,
//GO(_ossl_old_crypt,
@@ -2700,7 +2735,7 @@ GO(OPENSSL_sk_value, pFpi) //1.1+
//GO(PEM_read,
//GO(PEM_read_bio,
//GO(PEM_read_bio_CMS,
-//GO(PEM_read_bio_DHparams,
+GOM(PEM_read_bio_DHparams, pFEpppp)
//GO(PEM_read_bio_DSAparams,
GOM(PEM_read_bio_DSAPrivateKey, pFEpppp)
GOM(PEM_read_bio_DSA_PUBKEY, pFEpppp)
@@ -2712,8 +2747,8 @@ GOM(PEM_read_bio_EC_PUBKEY, pFEpppp)
GOM(PEM_read_bio_PKCS7, pFEpppp)
//GO(PEM_read_bio_PKCS8,
//GO(PEM_read_bio_PKCS8_PRIV_KEY_INFO,
-//GO(PEM_read_bio_PrivateKey,
-//GO(PEM_read_bio_PUBKEY,
+GOM(PEM_read_bio_PrivateKey, pFEpppp)
+GOM(PEM_read_bio_PUBKEY, pFEpppp)
GOM(PEM_read_bio_RSAPrivateKey, pFEpppp)
GOM(PEM_read_bio_RSA_PUBKEY, pFEpppp)
//GO(PEM_read_bio_RSAPublicKey,
@@ -2771,8 +2806,8 @@ GO(PEM_write_bio_EC_PUBKEY, iFpp)
//GO(PEM_write_bio_PKCS8PrivateKey,
//GO(PEM_write_bio_PKCS8PrivateKey_nid,
//GO(PEM_write_bio_PKCS8_PRIV_KEY_INFO,
-//GO(PEM_write_bio_PrivateKey,
-//GO(PEM_write_bio_PUBKEY,
+GOM(PEM_write_bio_PrivateKey, iFEppppipp)
+GO(PEM_write_bio_PUBKEY, iFpp)
GOM(PEM_write_bio_RSAPrivateKey, iFEppppipp)
GO(PEM_write_bio_RSA_PUBKEY, iFpp)
//GO(PEM_write_bio_RSAPublicKey,
@@ -3021,6 +3056,7 @@ GO(RAND_write_file, iFp)
//GO(RIPEMD160_Init,
//GO(RIPEMD160_Transform,
//GO(RIPEMD160_Update,
+GO(RSA_bits, iFp)
//GO(RSA_blinding_off,
//GO(RSA_blinding_on,
GO(RSA_check_key, iFp)
@@ -3028,11 +3064,15 @@ GO(RSA_check_key, iFp)
GO(RSA_free, vFp)
//GO(RSA_generate_key,
GO(RSA_generate_key_ex, iFpipp)
+GO(RSA_get0_crt_params, vFpppp)
+GO(RSA_get0_factors, vFppp)
+GO(RSA_get0_key, vFpppp)
//GO(RSA_get_default_method,
//GO(RSA_get_ex_data,
//GO(RSA_get_ex_new_index,
GO(RSA_get_method, pFp)
//GO(RSA_memory_lock,
+GO(RSA_meth_get_flags, iFp)
GO(RSA_new, pFv)
GO(RSA_new_method, pFp)
//GO(RSA_null_method,
@@ -3066,6 +3106,9 @@ GO(RSA_private_encrypt, iFipppi)
GO(RSA_public_decrypt, iFipppi)
GO(RSA_public_encrypt, iFipppi)
//GO(RSAPublicKey_dup,
+GO(RSA_set0_crt_params, iFpppp)
+GO(RSA_set0_factors, iFppp)
+GO(RSA_set0_key, iFpppp)
//GO(RSA_set_default_method,
//GO(RSA_set_ex_data,
GO(RSA_set_method, iFpp)
@@ -3438,7 +3481,7 @@ GO(X509_add1_ext_i2d, iFpipiL)
//GO(X509_check_akid,
//GO(X509_check_ca,
//GO(X509_check_email,
-//GO(X509_check_host,
+GO(X509_check_host, iFppLup)
//GO(X509_check_ip,
//GO(X509_check_ip_asc,
GO(X509_check_issued, iFpp)
@@ -3462,6 +3505,7 @@ GO(X509_CRL_add1_ext_i2d, iFpipiL)
GO(X509_CRL_free, vFp)
//GO(X509_CRL_get0_by_cert,
//GO(X509_CRL_get0_by_serial,
+GO(X509_CRL_get0_nextUpdate, pFp)
//GO(X509_CRL_get_ext,
//GO(X509_CRL_get_ext_by_critical,
//GO(X509_CRL_get_ext_by_NID,
@@ -3506,7 +3550,8 @@ GO(X509_EXTENSION_set_object, iFpp)
//GO(X509_find_by_issuer_and_serial,
//GO(X509_find_by_subject,
GO(X509_free, vFp)
-//GO(X509_get0_pubkey_bitstr,
+GO(X509_get0_pubkey_bitstr, pFp)
+GO(X509_get0_tbs_sigalg, pFp)
//GO(X509_get0_signature,
//GO(X509_get1_email,
//GO(X509_get1_ocsp,
@@ -3532,8 +3577,13 @@ GO(X509_get0_serialNumber, pFp)
//GO(X509_get_signature_nid,
GO(X509_get_subject_name, pFp)
GO(X509_get_X509_PUBKEY, pFp)
+GO(X509_get_version, lFp)
+GO(X509_get0_notAfter, pFp)
+GO(X509_get0_notBefore, pFp)
GO(X509_get0_pubkey, pFp)
-//GO(X509_gmtime_adj,
+GO(X509_getm_notBefore, pFp)
+GO(X509_getm_notAfter, pFp)
+GO(X509_gmtime_adj, pFpl)
//GO(X509_http_nbio,
//GO(X509_INFO_free,
//GO(X509_INFO_new,
@@ -3578,6 +3628,7 @@ GO(X509_NAME_ENTRY_get_object, pFp)
GO(X509_NAME_ENTRY_set_data, iFpipi)
GO(X509_NAME_ENTRY_set_object, iFpp)
GO(X509_NAME_free, vFp)
+GO(X509_NAME_get0_der, iFppp)
GO(X509_NAME_get_entry, pFpi)
GO(X509_NAME_get_index_by_NID, iFpii)
GO(X509_NAME_get_index_by_OBJ, iFppi)
@@ -3685,6 +3736,8 @@ GO(X509_REVOKED_get_ext_d2i, pFpipp)
//GO(X509_REVOKED_new,
//GO(X509_REVOKED_set_revocationDate,
//GO(X509_REVOKED_set_serialNumber,
+GO(X509_set1_notAfter, iFpp)
+GO(X509_set1_notBefore, iFpp)
//GO(X509_set_ex_data,
GO(X509_set_issuer_name, iFpp)
//GO(X509_set_notAfter,
@@ -3704,19 +3757,23 @@ GO(X509_STORE_add_crl, iFpp)
GO(X509_STORE_add_lookup, pFpp)
GO(X509_STORE_CTX_cleanup, vFp)
GO(X509_STORE_CTX_free, vFp)
+GO(X509_STORE_CTX_get0_cert, pFp)
+GO(X509_STORE_CTX_get0_chain, pFp)
//GO(X509_STORE_CTX_get0_current_crl,
//GO(X509_STORE_CTX_get0_current_issuer,
GO(X509_STORE_CTX_get0_param, pFp)
//GO(X509_STORE_CTX_get0_parent_ctx,
//GO(X509_STORE_CTX_get0_policy_tree,
-//GO(X509_STORE_CTX_get0_store,
+GO(X509_STORE_CTX_get0_store, pFp)
GO(X509_STORE_CTX_get1_chain, pFp)
+GO(X509_STORE_get0_param, pFp)
+GO(X509_STORE_CTX_get0_untrusted, pFp)
GO(X509_STORE_CTX_get1_issuer, iFppp)
GO(X509_STORE_CTX_get_chain, pFp)
GO(X509_STORE_CTX_get_current_cert, pFp)
GO(X509_STORE_CTX_get_error, iFp)
GO(X509_STORE_CTX_get_error_depth, iFp)
-//GO(X509_STORE_CTX_get_ex_data,
+GO(X509_STORE_CTX_get_ex_data, pFpi)
//GO(X509_STORE_CTX_get_ex_new_index,
//GO(X509_STORE_CTX_get_explicit_policy,
GO(X509_STORE_CTX_init, iFpppp)
@@ -3741,7 +3798,8 @@ GOM(X509_STORE_CTX_set_verify_cb, vFEpp)
GO(X509_STORE_free, vFp)
//GO(X509_STORE_get1_certs,
//GO(X509_STORE_get1_crls,
-//GO(X509_STORE_get_by_subject,
+//GO(X509_STORE_get_by_subject,
+GO(X509_STORE_get_ex_data, pFpi)
GO(X509_STORE_load_file, iFpp)
GO(X509_STORE_load_path, iFpp)
GO(X509_STORE_load_store, iFpp)
@@ -3750,11 +3808,12 @@ GO(X509_STORE_new, pFv)
//GO(X509_STORE_set1_param,
//GO(X509_STORE_set_default_paths,
GO(X509_STORE_set_depth, iFpi)
+GO(X509_STORE_set_ex_data, iFpip)
GO(X509_STORE_set_flags, iFpL)
//GO(X509_STORE_set_lookup_crls_cb,
GO(X509_STORE_set_purpose, iFpi)
GO(X509_STORE_set_trust, iFpi)
-//GO(X509_STORE_set_verify_cb,
+GOM(X509_STORE_set_verify_cb, vFEpp)
//GO(X509_subject_name_cmp,
GO(X509_subject_name_hash, LFp)
GO(X509_subject_name_hash_old, LFp)
@@ -3773,6 +3832,7 @@ GO(X509_subject_name_hash_old, LFp)
//GO(X509_TRUST_get_trust,
//GO(X509_TRUST_set,
//GO(X509_TRUST_set_default,
+GO(X509_up_ref, iFp)
GO(X509V3_add1_i2d, iFpipiL)
//GO(X509v3_add_ext,
//GO(X509V3_add_standard_extensions,
diff --git a/src/wrapped/wrappedcurl.c b/src/wrapped/wrappedcurl.c
index ceda973..490d7f8 100755..100644
--- a/src/wrapped/wrappedcurl.c
+++ b/src/wrapped/wrappedcurl.c
@@ -346,7 +346,7 @@ typedef enum {
static uintptr_t my_write_fct_##A = 0; \
static size_t my_write_##A(char* ptr, size_t size, size_t nmemb, void* userdata) \
{ \
- return (size_t)RunFunction(my_context, my_write_fct_##A, 4, ptr, size, nmemb, userdata);\
+ return (size_t)RunFunctionFmt(my_write_fct_##A, "pLLp", ptr, size, nmemb, userdata);\
}
SUPER()
#undef GO
@@ -369,7 +369,7 @@ static void* find_write_Fct(void* fct)
static uintptr_t my_read_fct_##A = 0; \
static size_t my_read_##A(char* buffer, size_t size, size_t nitems, void* userdata) \
{ \
- return (size_t)RunFunction(my_context, my_read_fct_##A, 4, buffer, size, nitems, userdata);\
+ return (size_t)RunFunctionFmt(my_read_fct_##A, "pLLp", buffer, size, nitems, userdata);\
}
SUPER()
#undef GO
@@ -392,7 +392,7 @@ static void* find_read_Fct(void* fct)
static uintptr_t my_ioctl_fct_##A = 0; \
static size_t my_ioctl_##A(void* handle, int32_t fnc, void* userdata) \
{ \
- return (size_t)RunFunction(my_context, my_ioctl_fct_##A, 3, handle, fnc, userdata);\
+ return (size_t)RunFunctionFmt(my_ioctl_fct_##A, "pip", handle, fnc, userdata);\
}
SUPER()
#undef GO
@@ -415,7 +415,7 @@ static void* find_ioctl_Fct(void* fct)
static uintptr_t my_seek_fct_##A = 0; \
static int32_t my_seek_##A(void* userdata, int64_t off, int32_t origin) \
{ \
- return (int32_t)RunFunction(my_context, my_seek_fct_##A, 4, userdata, (off&0xffffffff), ((off>>32)&0xffffffff), origin);\
+ return (int32_t)RunFunctionFmt(my_seek_fct_##A, "pIi", userdata, off, origin);\
}
SUPER()
#undef GO
@@ -438,7 +438,7 @@ static void* find_seek_Fct(void* fct)
static uintptr_t my_header_fct_##A = 0; \
static size_t my_header_##A(char* buffer, size_t size, size_t nitems, void* userdata) \
{ \
- return (size_t)RunFunction(my_context, my_header_fct_##A, 4, buffer, size, nitems, userdata);\
+ return (size_t)RunFunctionFmt(my_header_fct_##A, "pLLp", buffer, size, nitems, userdata);\
}
SUPER()
#undef GO
@@ -461,7 +461,7 @@ static void* find_header_Fct(void* fct)
static uintptr_t my_progress_fct_##A = 0; \
static int my_progress_##A(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) \
{ \
- return (int)RunFunction(my_context, my_progress_fct_##A, 5, clientp, dltotal, dlnow, ultotal, ulnow);\
+ return (int)RunFunctionFmt(my_progress_fct_##A, "pdddd", clientp, dltotal, dlnow, ultotal, ulnow);\
}
SUPER()
#undef GO
@@ -484,7 +484,7 @@ static void* find_progress_Fct(void* fct)
static uintptr_t my_progress_int_fct_##A = 0; \
static int my_progress_int_##A(void *clientp, uint64_t dltotal, uint64_t dlnow, uint64_t ultotal, uint64_t ulnow) \
{ \
- return (int)RunFunction(my_context, my_progress_int_fct_##A, 5, clientp, dltotal, dlnow, ultotal, ulnow);\
+ return (int)RunFunctionFmt(my_progress_int_fct_##A, "pUUUU", clientp, dltotal, dlnow, ultotal, ulnow);\
}
SUPER()
#undef GO
@@ -507,7 +507,7 @@ static void* find_progress_int_Fct(void* fct)
static uintptr_t my_socket_fct_##A = 0; \
static int my_socket_##A(void *a, int b, int c, void* d, void* e) \
{ \
- return (int)RunFunction(my_context, my_socket_fct_##A, 5, a, b, c, d, e); \
+ return (int)RunFunctionFmt(my_socket_fct_##A, "piipp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -530,7 +530,7 @@ static void* find_socket_Fct(void* fct)
static uintptr_t my_timer_fct_##A = 0; \
static int my_timer_##A(void *a, long b, void* c) \
{ \
- return (int)RunFunction(my_context, my_timer_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_timer_fct_##A, "plp", a, b, c); \
}
SUPER()
#undef GO
@@ -553,7 +553,7 @@ static void* find_timer_Fct(void* fct)
static uintptr_t my_push_fct_##A = 0; \
static int my_push_##A(void *a, void* b, size_t c, void* d, void* e) \
{ \
- return (int)RunFunction(my_context, my_push_fct_##A, 5, a, b, c, d, e); \
+ return (int)RunFunctionFmt(my_push_fct_##A, "ppLpp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -576,7 +576,7 @@ static void* find_push_Fct(void* fct)
static uintptr_t my_debug_fct_##A = 0; \
static int my_debug_##A(void *a, int b, void* c, size_t d, void* e) \
{ \
- return (int)RunFunction(my_context, my_debug_fct_##A, 5, a, b, c, d, e); \
+ return (int)RunFunctionFmt(my_debug_fct_##A, "pipLp", a, b, c, d, e); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedcurl_private.h b/src/wrapped/wrappedcurl_private.h
index ffcc105..ffcc105 100755..100644
--- a/src/wrapped/wrappedcurl_private.h
+++ b/src/wrapped/wrappedcurl_private.h
diff --git a/src/wrapped/wrappedd3dadapter9.c b/src/wrapped/wrappedd3dadapter9.c
index c43331d..3701bba 100644
--- a/src/wrapped/wrappedd3dadapter9.c
+++ b/src/wrapped/wrappedd3dadapter9.c
@@ -225,7 +225,7 @@ static void freeMy()
#define GOV(ns, ret, fn, args, call) \
static uintptr_t my_##ns##_##fn##_fct = 0; \
static ret my_##ns##_##fn(UNPACK args) { \
- ret r = (ret)RunFunctionWindows(my_context, my_##ns##_##fn##_fct, UNPACK call); \
+ ret r = (ret)RunFunctionWindows(my_##ns##_##fn##_fct, UNPACK call); \
/* no closing brace */
#define GOV_1(ns, ret, fn, t1) \
@@ -319,13 +319,13 @@ typedef struct my_Direct3D9 {
unsigned my_Direct3D9_AddRef(void *This)
{
my_Direct3D9 *my = This;
- return RunFunctionWindows(my_context, (uintptr_t)(*my->real)->AddRef, 1, my->real);
+ return RunFunctionWindows((uintptr_t)(*my->real)->AddRef, 1, my->real);
}
unsigned my_Direct3D9_Release(void *This)
{
my_Direct3D9 *my = This;
- return RunFunctionWindows(my_context, (uintptr_t)(*my->real)->Release, 1, my->real);
+ return RunFunctionWindows((uintptr_t)(*my->real)->Release, 1, my->real);
}
IDirect3D9Vtbl my_Direct3D9_vtbl = {
@@ -341,13 +341,13 @@ typedef struct my_Direct3D9Ex {
unsigned my_Direct3D9Ex_AddRef(void *This)
{
my_Direct3D9Ex *my = This;
- return RunFunction(my_context, (uintptr_t)(*my->real)->AddRef, 1, my->real);
+ return RunFunctionFmt((uintptr_t)(*my->real)->AddRef, "p", my->real);
}
unsigned my_Direct3D9Ex_Release(void *This)
{
my_Direct3D9Ex *my = This;
- return RunFunction(my_context, (uintptr_t)(*my->real)->Release, 1, my->real);
+ return RunFunctionFmt((uintptr_t)(*my->real)->Release, "p", my->real);
}
IDirect3D9ExVtbl my_Direct3D9Ex_vtbl = {
diff --git a/src/wrapped/wrappeddbus.c b/src/wrapped/wrappeddbus.c
index 384c0d7..7f04091 100755..100644
--- a/src/wrapped/wrappeddbus.c
+++ b/src/wrapped/wrappeddbus.c
@@ -38,7 +38,7 @@ GO(3)
static uintptr_t my_DBusFreeFunction_fct_##A = 0; \
static void my_DBusFreeFunction_##A(void* p) \
{ \
- RunFunction(my_context, my_DBusFreeFunction_fct_##A, 1, p); \
+ RunFunctionFmt(my_DBusFreeFunction_fct_##A, "p", p); \
}
SUPER()
#undef GO
@@ -60,7 +60,7 @@ static void* find_DBusFreeFunction_Fct(void* fct)
static uintptr_t my_DBusHandleMessageFunction_fct_##A = 0; \
static int my_DBusHandleMessageFunction_##A(void* a, void* b, void* c) \
{ \
- return RunFunction(my_context, my_DBusHandleMessageFunction_fct_##A, 3, a, b, c); \
+ return RunFunctionFmt(my_DBusHandleMessageFunction_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -82,7 +82,7 @@ static void* find_DBusHandleMessageFunction_Fct(void* fct)
static uintptr_t my_DBusAddTimeoutFunction_fct_##A = 0; \
static int my_DBusAddTimeoutFunction_##A(void* a, void* b) \
{ \
- return RunFunction(my_context, my_DBusAddTimeoutFunction_fct_##A, 2, a, b); \
+ return RunFunctionFmt(my_DBusAddTimeoutFunction_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -104,7 +104,7 @@ static void* find_DBusAddTimeoutFunction_Fct(void* fct)
static uintptr_t my_DBusRemoveTimeoutFunction_fct_##A = 0; \
static void my_DBusRemoveTimeoutFunction_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_DBusRemoveTimeoutFunction_fct_##A, 2, a, b); \
+ RunFunctionFmt(my_DBusRemoveTimeoutFunction_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -126,7 +126,7 @@ static void* find_DBusRemoveTimeoutFunction_Fct(void* fct)
static uintptr_t my_DBusTimeoutToggledFunction_fct_##A = 0; \
static void my_DBusTimeoutToggledFunction_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_DBusTimeoutToggledFunction_fct_##A, 2, a, b); \
+ RunFunctionFmt(my_DBusTimeoutToggledFunction_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -148,7 +148,7 @@ static void* find_DBusTimeoutToggledFunction_Fct(void* fct)
static uintptr_t my_DBusWakeupMainFunction_fct_##A = 0; \
static void my_DBusWakeupMainFunction_##A(void* a) \
{ \
- RunFunction(my_context, my_DBusWakeupMainFunction_fct_##A, 1, a); \
+ RunFunctionFmt(my_DBusWakeupMainFunction_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -171,7 +171,7 @@ static void* find_DBusWakeupMainFunction_Fct(void* fct)
static uintptr_t my_DBusPendingCallNotifyFunction_fct_##A = 0; \
static void my_DBusPendingCallNotifyFunction_##A(void* pending, void* data) \
{ \
- RunFunction(my_context, my_DBusPendingCallNotifyFunction_fct_##A, 2, pending, data);\
+ RunFunctionFmt(my_DBusPendingCallNotifyFunction_fct_##A, "pp", pending, data);\
}
SUPER()
#undef GO
@@ -194,7 +194,7 @@ static void* findDBusPendingCallNotifyFunctionFct(void* fct)
static uintptr_t my_DBusDispatchStatusFunction_fct_##A = 0; \
static void my_DBusDispatchStatusFunction_##A(void* connection, int new_status, void* data) \
{ \
- RunFunction(my_context, my_DBusDispatchStatusFunction_fct_##A, 3, connection, new_status, data);\
+ RunFunctionFmt(my_DBusDispatchStatusFunction_fct_##A, "pip", connection, new_status, data);\
}
SUPER()
#undef GO
@@ -217,7 +217,7 @@ static void* findDBusDispatchStatusFunctionFct(void* fct)
static uintptr_t my_DBusAddWatchFunction_fct_##A = 0; \
static int my_DBusAddWatchFunction_##A(void* watch, void* data) \
{ \
- return (int)RunFunction(my_context, my_DBusAddWatchFunction_fct_##A, 2, watch, data);\
+ return (int)RunFunctionFmt(my_DBusAddWatchFunction_fct_##A, "pp", watch, data);\
}
SUPER()
#undef GO
@@ -240,7 +240,7 @@ static void* findDBusAddWatchFunctionFct(void* fct)
static uintptr_t my_DBusRemoveWatchFunction_fct_##A = 0; \
static void my_DBusRemoveWatchFunction_##A(void* watch, void* data) \
{ \
- RunFunction(my_context, my_DBusRemoveWatchFunction_fct_##A, 2, watch, data);\
+ RunFunctionFmt(my_DBusRemoveWatchFunction_fct_##A, "pp", watch, data);\
}
SUPER()
#undef GO
@@ -263,7 +263,7 @@ static void* findDBusRemoveWatchFunctionFct(void* fct)
static uintptr_t my_DBusWatchToggledFunction_fct_##A = 0; \
static void my_DBusWatchToggledFunction_##A(void* watch, void* data) \
{ \
- RunFunction(my_context, my_DBusWatchToggledFunction_fct_##A, 2, watch, data);\
+ RunFunctionFmt(my_DBusWatchToggledFunction_fct_##A, "pp", watch, data);\
}
SUPER()
#undef GO
@@ -286,7 +286,7 @@ static void* findDBusWatchToggledFunctionFct(void* fct)
static uintptr_t my_DBusObjectPathUnregisterFunction_fct_##A = 0; \
static void my_DBusObjectPathUnregisterFunction_##A(void* connection, void* data) \
{ \
- RunFunction(my_context, my_DBusObjectPathUnregisterFunction_fct_##A, 2, connection, data);\
+ RunFunctionFmt(my_DBusObjectPathUnregisterFunction_fct_##A, "pp", connection, data);\
}
SUPER()
#undef GO
@@ -309,7 +309,7 @@ static void* findDBusObjectPathUnregisterFunctionFct(void* fct)
static uintptr_t my_DBusObjectPathMessageFunction_fct_##A = 0; \
static void my_DBusObjectPathMessageFunction_##A(void* connection, void* message, void* data) \
{ \
- RunFunction(my_context, my_DBusObjectPathMessageFunction_fct_##A, 3, connection, message, data);\
+ RunFunctionFmt(my_DBusObjectPathMessageFunction_fct_##A, "ppp", connection, message, data);\
}
SUPER()
#undef GO
@@ -332,7 +332,7 @@ static void* findDBusObjectPathMessageFunctionFct(void* fct)
static uintptr_t my_dbus_internal_pad_fct_##A = 0; \
static void my_dbus_internal_pad_##A(void* a, void* b, void* c, void* d) \
{ \
- RunFunction(my_context, my_dbus_internal_pad_fct_##A, 4, a, b, c, d);\
+ RunFunctionFmt(my_dbus_internal_pad_fct_##A, "pppp", a, b, c, d);\
}
SUPER()
#undef GO
@@ -349,6 +349,31 @@ static void* finddbus_internal_padFct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for dbus dbus_internal_pad callback\n");
return NULL;
}
+
+// DBusNewConnectionFunction
+#define GO(A) \
+static uintptr_t my_DBusNewConnectionFunction_fct_##A = 0; \
+static void my_DBusNewConnectionFunction_##A(void* a, void* b, void* c) \
+{ \
+ RunFunctionFmt(my_DBusNewConnectionFunction_fct_##A, "pppp", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* findDBusNewConnectionFunctionFct(void* fct)
+{
+ if(!fct) return NULL;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_DBusNewConnectionFunction_fct_##A == (uintptr_t)fct) return my_DBusNewConnectionFunction_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_DBusNewConnectionFunction_fct_##A == 0) {my_DBusNewConnectionFunction_fct_##A = (uintptr_t)fct; return my_DBusNewConnectionFunction_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for dbus DBusNewConnectionFunction callback\n");
+ return NULL;
+}
+
+
#undef SUPER
EXPORT void my_dbus_timeout_set_data(x64emu_t* emu, void* e, void* p, void* f)
@@ -404,7 +429,64 @@ EXPORT int my_dbus_message_append_args_valist(x64emu_t* emu, void* message, int
#ifdef CONVERT_VALIST
CONVERT_VALIST(b);
#else
+ #if 1
CREATE_VALIST_FROM_VALIST(b, emu->scratch);
+ #else
+ va_list sysv_varargs;
+ uintptr_t *p = (uintptr_t*)(emu->scratch);
+ int n = (X64_VA_MAX_REG - b->gp_offset)/8;
+ int x = (X64_VA_MAX_XMM - b->fp_offset)/8;
+ int idx = 0;
+ int type = arg;
+ while(arg) {
+ if(arg == (int)'d') {
+ // double
+ if(x)
+ *(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_XMM - (x--)*8);
+ else
+ *(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
+ } else if(arg == (int)'a') {
+ // array
+ // type
+ if(n)
+ *(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
+ else
+ *(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
+ // elements
+ if(n)
+ *(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
+ else
+ *(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
+ // number of elements
+ if(n)
+ *(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
+ else
+ *(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
+ } else if(arg == (int)'s' || arg == (int)'g' || arg == (int)'o') {
+ // elements
+ if(n)
+ *(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
+ else
+ *(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
+ // number of elements
+ if(n)
+ *(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
+ else
+ *(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
+ } else {
+ if(n)
+ *(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
+ else
+ *(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
+ }
+ if(n)
+ arg = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
+ else
+ arg = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
+ *(p++) = arg;
+ }
+ sysv_varargs = (va_list)p;
+ #endif
#endif
return my->dbus_message_append_args_valist(message, arg, VARARGS);
}
@@ -478,6 +560,22 @@ EXPORT int my_dbus_connection_try_register_object_path(x64emu_t* emu, void* conn
return my->dbus_connection_try_register_object_path(connection, path, vtable?&vt:NULL, data, error);
}
+EXPORT int my_dbus_connection_register_fallback(x64emu_t* emu, void* connection, void* path, my_DBusObjectPathVTable_t* vtable, void* data)
+{
+ (void)emu;
+ my_DBusObjectPathVTable_t vt = {0};
+ if(vtable) {
+ vt.unregister_function = findDBusObjectPathUnregisterFunctionFct(vtable->unregister_function);
+ vt.message_function = findDBusObjectPathMessageFunctionFct(vtable->message_function);
+ vt.pad1 = finddbus_internal_padFct(vtable->pad1);
+ vt.pad2 = finddbus_internal_padFct(vtable->pad2);
+ vt.pad3 = finddbus_internal_padFct(vtable->pad3);
+ vt.pad4 = finddbus_internal_padFct(vtable->pad4);
+ }
+
+ return my->dbus_connection_register_fallback(connection, path, vtable?&vt:NULL, data);
+}
+
EXPORT int my_dbus_connection_set_data(x64emu_t* emu, void* connection, int slot, void* data, void* free_func)
{
(void)emu;
@@ -506,7 +604,25 @@ EXPORT int my_dbus_connection_try_register_fallback(x64emu_t* emu, void* connect
return my->dbus_connection_try_register_fallback(connection, path, vtable?&vt:NULL, data, error);
}
+EXPORT int my_dbus_server_set_watch_functions(x64emu_t* emu, void* server, void* add, void* rem, void* toggle, void* data, void* d)
+{
+ return my->dbus_server_set_watch_functions(server, findDBusAddWatchFunctionFct(add), findDBusRemoveWatchFunctionFct(rem), findDBusWatchToggledFunctionFct(toggle), data, find_DBusFreeFunction_Fct(d));
+}
+
+EXPORT void my_dbus_server_set_new_connection_function(x64emu_t* emu, void* server, void* f, void* data, void* d)
+{
+ my->dbus_server_set_new_connection_function(server, findDBusNewConnectionFunctionFct(f), data, find_DBusFreeFunction_Fct(d));
+}
+EXPORT int my_dbus_server_set_timeout_functions(x64emu_t* emu, void* server, void* add, void* rem, void* toggle, void* data, void* d)
+{
+ return my->dbus_server_set_timeout_functions(server, find_DBusAddTimeoutFunction_Fct(add), find_DBusRemoveTimeoutFunction_Fct(rem), find_DBusTimeoutToggledFunction_Fct(toggle), data, find_DBusFreeFunction_Fct(d));
+}
+
+EXPORT int my_dbus_server_set_data(x64emu_t* emu, void* server, int slot, void* data, void* d)
+{
+ return my->dbus_server_set_data(server, slot, data, find_DBusFreeFunction_Fct(d));
+}
#define CUSTOM_INIT \
getMy(lib);
diff --git a/src/wrapped/wrappeddbus_private.h b/src/wrapped/wrappeddbus_private.h
index c72c99c..ccbe2a9 100755..100644
--- a/src/wrapped/wrappeddbus_private.h
+++ b/src/wrapped/wrappeddbus_private.h
@@ -54,7 +54,7 @@ GO(dbus_connection_preallocate_send, pFp)
GO(dbus_connection_read_write, iFpi)
GO(dbus_connection_read_write_dispatch, iFpi)
GO(dbus_connection_ref, pFp)
-//GO(dbus_connection_register_fallback,
+GOM(dbus_connection_register_fallback, iFEpppp)
//GO(dbus_connection_register_object_path,
GOM(dbus_connection_remove_filter, vFEppp)
GO(dbus_connection_return_message, vFpp)
@@ -179,21 +179,21 @@ GOM(dbus_pending_call_set_notify, iFEpppp)
GO(dbus_pending_call_steal_reply, pFp)
GO(dbus_pending_call_unref, vFp)
GO(dbus_realloc, pFpL)
-//GO(dbus_server_allocate_data_slot,
-//GO(dbus_server_disconnect,
-//GO(dbus_server_free_data_slot,
-//GO(dbus_server_get_address,
+GO(dbus_server_allocate_data_slot, iFp)
+GO(dbus_server_disconnect, vFp)
+GO(dbus_server_free_data_slot, vFp)
+GO(dbus_server_get_address, pFp)
//GO(dbus_server_get_data,
//GO(dbus_server_get_id,
-//GO(dbus_server_get_is_connected,
-//GO(dbus_server_listen,
+GO(dbus_server_get_is_connected, iFp)
+GO(dbus_server_listen, pFpp)
//GO(dbus_server_ref,
//GO(dbus_server_set_auth_mechanisms,
-//GO(dbus_server_set_data,
-//GO(dbus_server_set_new_connection_function,
-//GO(dbus_server_set_timeout_functions,
-//GO(dbus_server_set_watch_functions,
-//GO(dbus_server_unref,
+GOM(dbus_server_set_data, iFEpipp)
+GOM(dbus_server_set_new_connection_function, vFEpppp)
+GOM(dbus_server_set_timeout_functions, iFEpppppp)
+GOM(dbus_server_set_watch_functions, iFEpppppp)
+GO(dbus_server_unref, vFp)
GO(dbus_set_error, vFpppppppppp) //vaarg
GO(dbus_set_error_const, vFppp)
GO(dbus_set_error_from_message, iFpp)
diff --git a/src/wrapped/wrappeddbusglib1.c b/src/wrapped/wrappeddbusglib1.c
index b668046..6c9555a 100755..100644
--- a/src/wrapped/wrappeddbusglib1.c
+++ b/src/wrapped/wrappeddbusglib1.c
@@ -33,10 +33,10 @@ const char* dbusglib1Name = "libdbus-glib-1.so.2";
// GDestroyNotify
#define GO(A) \
-static uintptr_t my_GDestroyNotify_fct_##A = 0; \
-static void my_GDestroyNotify_##A(void* data) \
-{ \
- RunFunction(my_context, my_GDestroyNotify_fct_##A, 1, data);\
+static uintptr_t my_GDestroyNotify_fct_##A = 0; \
+static void my_GDestroyNotify_##A(void* data) \
+{ \
+ RunFunctionFmt(my_GDestroyNotify_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -56,10 +56,10 @@ static void* findGDestroyNotifyFct(void* fct)
// GClosureNotify
#define GO(A) \
-static uintptr_t my_GClosureNotify_fct_##A = 0; \
-static void my_GClosureNotify_##A(void* data, void* closure) \
-{ \
- RunFunction(my_context, my_GClosureNotify_fct_##A, 2, data, closure);\
+static uintptr_t my_GClosureNotify_fct_##A = 0; \
+static void my_GClosureNotify_##A(void* data, void* closure) \
+{ \
+ RunFunctionFmt(my_GClosureNotify_fct_##A, "pp", data, closure); \
}
SUPER()
#undef GO
@@ -79,10 +79,10 @@ static void* findGClosureNotifyFct(void* fct)
// DBusGProxyCallNotify
#define GO(A) \
-static uintptr_t my_DBusGProxyCallNotify_fct_##A = 0; \
-static void my_DBusGProxyCallNotify_##A(void* proxy, void* call_id, void* data) \
-{ \
- RunFunction(my_context, my_DBusGProxyCallNotify_fct_##A, 3, proxy, call_id, data);\
+static uintptr_t my_DBusGProxyCallNotify_fct_##A = 0; \
+static void my_DBusGProxyCallNotify_##A(void* proxy, void* call_id, void* data) \
+{ \
+ RunFunctionFmt(my_DBusGProxyCallNotify_fct_##A, "ppp", proxy, call_id, data); \
}
SUPER()
#undef GO
@@ -102,10 +102,10 @@ static void* findDBusGProxyCallNotifyFct(void* fct)
// GCallback
#define GO(A) \
-static uintptr_t my_GCallback_fct_##A = 0; \
-static void my_GCallback_##A(void* a, void* b, void* c, void* d) \
-{ \
- RunFunction(my_context, my_GCallback_fct_##A, 4, a, b, c, d);\
+static uintptr_t my_GCallback_fct_##A = 0; \
+static void my_GCallback_##A(void* a, void* b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_GCallback_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -125,10 +125,10 @@ static void* findGCallbackFct(void* fct)
// DBusGTypeSpecializedCollectionIterator
#define GO(A) \
-static uintptr_t my_DBusGTypeSpecializedCollectionIterator_fct_##A = 0; \
-static void my_DBusGTypeSpecializedCollectionIterator_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_DBusGTypeSpecializedCollectionIterator_fct_##A, 2, a, b); \
+static uintptr_t my_DBusGTypeSpecializedCollectionIterator_fct_##A = 0; \
+static void my_DBusGTypeSpecializedCollectionIterator_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_DBusGTypeSpecializedCollectionIterator_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -147,10 +147,10 @@ static void* findDBusGTypeSpecializedCollectionIteratorFct(void* fct)
}
// DBusGTypeSpecializedMapIterator
#define GO(A) \
-static uintptr_t my_DBusGTypeSpecializedMapIterator_fct_##A = 0; \
-static void my_DBusGTypeSpecializedMapIterator_##A(void* a, void* b, void* c) \
-{ \
- RunFunction(my_context, my_DBusGTypeSpecializedMapIterator_fct_##A, 3, a, b, c); \
+static uintptr_t my_DBusGTypeSpecializedMapIterator_fct_##A = 0; \
+static void my_DBusGTypeSpecializedMapIterator_##A(void* a, void* b, void* c) \
+{ \
+ RunFunctionFmt(my_DBusGTypeSpecializedMapIterator_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappeddbusglib1_private.h b/src/wrapped/wrappeddbusglib1_private.h
index 9485f42..9485f42 100755..100644
--- a/src/wrapped/wrappeddbusglib1_private.h
+++ b/src/wrapped/wrappeddbusglib1_private.h
diff --git a/src/wrapped/wrappedexpat.c b/src/wrapped/wrappedexpat.c
index 4891e37..783b0ca 100755..100644
--- a/src/wrapped/wrappedexpat.c
+++ b/src/wrapped/wrappedexpat.c
@@ -34,10 +34,10 @@ GO(4)
// Start ...
#define GO(A) \
-static uintptr_t my_Start_fct_##A = 0; \
-static void* my_Start_##A(void* data, void* name, void* attr) \
-{ \
- return (void*)RunFunction(my_context, my_Start_fct_##A, 3, data, name, attr); \
+static uintptr_t my_Start_fct_##A = 0; \
+static void* my_Start_##A(void* data, void* name, void* attr) \
+{ \
+ return (void*)RunFunctionFmt(my_Start_fct_##A, "ppp", data, name, attr); \
}
SUPER()
#undef GO
@@ -56,10 +56,10 @@ static void* find_Start_Fct(void* fct)
}
// End ...
#define GO(A) \
-static uintptr_t my_End_fct_##A = 0; \
-static void my_End_##A(void* data, void* name) \
-{ \
- RunFunction(my_context, my_End_fct_##A, 2, data, name);\
+static uintptr_t my_End_fct_##A = 0; \
+static void my_End_##A(void* data, void* name) \
+{ \
+ RunFunctionFmt(my_End_fct_##A, "pp", data, name); \
}
SUPER()
#undef GO
@@ -78,10 +78,10 @@ static void* find_End_Fct(void* fct)
}
// CharData ...
#define GO(A) \
-static uintptr_t my_CharData_fct_##A = 0; \
-static void my_CharData_##A(void* data, void* s, int l) \
-{ \
- RunFunction(my_context, my_CharData_fct_##A, 3, data, s, l);\
+static uintptr_t my_CharData_fct_##A = 0; \
+static void my_CharData_##A(void* data, void* s, int l) \
+{ \
+ RunFunctionFmt(my_CharData_fct_##A, "ppi", data, s, l); \
}
SUPER()
#undef GO
@@ -100,10 +100,10 @@ static void* find_CharData_Fct(void* fct)
}
// StartNamespaceDecl ...
#define GO(A) \
-static uintptr_t my_StartNamespaceDecl_fct_##A = 0; \
-static void my_StartNamespaceDecl_##A(void* data, void* name, void* attr) \
-{ \
- RunFunction(my_context, my_StartNamespaceDecl_fct_##A, 3, data, name, attr); \
+static uintptr_t my_StartNamespaceDecl_fct_##A = 0; \
+static void my_StartNamespaceDecl_##A(void* data, void* name, void* attr) \
+{ \
+ RunFunctionFmt(my_StartNamespaceDecl_fct_##A, "ppp", data, name, attr); \
}
SUPER()
#undef GO
@@ -122,10 +122,10 @@ static void* find_StartNamespaceDecl_Fct(void* fct)
}
// EndNamespaceDecl ...
#define GO(A) \
-static uintptr_t my_EndNamespaceDecl_fct_##A = 0; \
-static void my_EndNamespaceDecl_##A(void* data, void* name) \
-{ \
- RunFunction(my_context, my_EndNamespaceDecl_fct_##A, 2, data, name);\
+static uintptr_t my_EndNamespaceDecl_fct_##A = 0; \
+static void my_EndNamespaceDecl_##A(void* data, void* name) \
+{ \
+ RunFunctionFmt(my_EndNamespaceDecl_fct_##A, "pp", data, name); \
}
SUPER()
#undef GO
@@ -144,10 +144,10 @@ static void* find_EndNamespaceDecl_Fct(void* fct)
}
// StartElement ...
#define GO(A) \
-static uintptr_t my_StartElement_fct_##A = 0; \
-static void my_StartElement_##A(void* data, void* name, void* attr) \
-{ \
- RunFunction(my_context, my_StartElement_fct_##A, 3, data, name, attr); \
+static uintptr_t my_StartElement_fct_##A = 0; \
+static void my_StartElement_##A(void* data, void* name, void* attr) \
+{ \
+ RunFunctionFmt(my_StartElement_fct_##A, "ppp", data, name, attr); \
}
SUPER()
#undef GO
@@ -166,10 +166,10 @@ static void* find_StartElement_Fct(void* fct)
}
// EndElement ...
#define GO(A) \
-static uintptr_t my_EndElement_fct_##A = 0; \
-static void my_EndElement_##A(void* data, void* name) \
-{ \
- RunFunction(my_context, my_EndElement_fct_##A, 2, data, name);\
+static uintptr_t my_EndElement_fct_##A = 0; \
+static void my_EndElement_##A(void* data, void* name) \
+{ \
+ RunFunctionFmt(my_EndElement_fct_##A, "pp", data, name); \
}
SUPER()
#undef GO
@@ -188,10 +188,10 @@ static void* find_EndElement_Fct(void* fct)
}
// CharacterData ...
#define GO(A) \
-static uintptr_t my_CharacterData_fct_##A = 0; \
-static void my_CharacterData_##A(void* data, void* name, int len) \
-{ \
- RunFunction(my_context, my_CharacterData_fct_##A, 3, data, name, len); \
+static uintptr_t my_CharacterData_fct_##A = 0; \
+static void my_CharacterData_##A(void* data, void* name, int len) \
+{ \
+ RunFunctionFmt(my_CharacterData_fct_##A, "ppi", data, name, len); \
}
SUPER()
#undef GO
@@ -210,10 +210,10 @@ static void* find_CharacterData_Fct(void* fct)
}
// ProcessingInstruction ...
#define GO(A) \
-static uintptr_t my_ProcessingInstruction_fct_##A = 0; \
-static void my_ProcessingInstruction_##A(void* a, void* b, void* c) \
-{ \
- RunFunction(my_context, my_ProcessingInstruction_fct_##A, 3, a, b, c); \
+static uintptr_t my_ProcessingInstruction_fct_##A = 0; \
+static void my_ProcessingInstruction_##A(void* a, void* b, void* c) \
+{ \
+ RunFunctionFmt(my_ProcessingInstruction_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -232,10 +232,10 @@ static void* find_ProcessingInstruction_Fct(void* fct)
}
// Comment ...
#define GO(A) \
-static uintptr_t my_Comment_fct_##A = 0; \
-static void my_Comment_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_Comment_fct_##A, 2, a, b); \
+static uintptr_t my_Comment_fct_##A = 0; \
+static void my_Comment_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_Comment_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -254,10 +254,10 @@ static void* find_Comment_Fct(void* fct)
}
// StartCdataSection ...
#define GO(A) \
-static uintptr_t my_StartCdataSection_fct_##A = 0; \
-static void my_StartCdataSection_##A(void* data) \
-{ \
- RunFunction(my_context, my_StartCdataSection_fct_##A, 1, data); \
+static uintptr_t my_StartCdataSection_fct_##A = 0; \
+static void my_StartCdataSection_##A(void* data) \
+{ \
+ RunFunctionFmt(my_StartCdataSection_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -276,10 +276,10 @@ static void* find_StartCdataSection_Fct(void* fct)
}
// EndCdataSection ...
#define GO(A) \
-static uintptr_t my_EndCdataSection_fct_##A = 0; \
-static void my_EndCdataSection_##A(void* data) \
-{ \
- RunFunction(my_context, my_EndCdataSection_fct_##A, 1, data); \
+static uintptr_t my_EndCdataSection_fct_##A = 0; \
+static void my_EndCdataSection_##A(void* data) \
+{ \
+ RunFunctionFmt(my_EndCdataSection_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -298,10 +298,10 @@ static void* find_EndCdataSection_Fct(void* fct)
}
// Default ...
#define GO(A) \
-static uintptr_t my_Default_fct_##A = 0; \
-static void my_Default_##A(void* data, void* name, int len) \
-{ \
- RunFunction(my_context, my_Default_fct_##A, 3, data, name, len); \
+static uintptr_t my_Default_fct_##A = 0; \
+static void my_Default_##A(void* data, void* name, int len) \
+{ \
+ RunFunctionFmt(my_Default_fct_##A, "ppi", data, name, len); \
}
SUPER()
#undef GO
@@ -320,10 +320,10 @@ static void* find_Default_Fct(void* fct)
}
// StartDoctypeDecl ...
#define GO(A) \
-static uintptr_t my_StartDoctypeDecl_fct_##A = 0; \
-static void my_StartDoctypeDecl_##A(void* a, void* b, void* c, void* d, int e) \
-{ \
- RunFunction(my_context, my_StartDoctypeDecl_fct_##A, 5, a, b, c, d, e); \
+static uintptr_t my_StartDoctypeDecl_fct_##A = 0; \
+static void my_StartDoctypeDecl_##A(void* a, void* b, void* c, void* d, int e) \
+{ \
+ RunFunctionFmt(my_StartDoctypeDecl_fct_##A, "ppppi", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -342,10 +342,10 @@ static void* find_StartDoctypeDecl_Fct(void* fct)
}
// EndDoctypeDecl ...
#define GO(A) \
-static uintptr_t my_EndDoctypeDecl_fct_##A = 0; \
-static void my_EndDoctypeDecl_##A(void* data) \
-{ \
- RunFunction(my_context, my_EndDoctypeDecl_fct_##A, 1, data); \
+static uintptr_t my_EndDoctypeDecl_fct_##A = 0; \
+static void my_EndDoctypeDecl_##A(void* data) \
+{ \
+ RunFunctionFmt(my_EndDoctypeDecl_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -364,10 +364,10 @@ static void* find_EndDoctypeDecl_Fct(void* fct)
}
// EntityDecl ...
#define GO(A) \
-static uintptr_t my_EntityDecl_fct_##A = 0; \
-static void my_EntityDecl_##A(void* a, void* b, int c, void* d, int e, void* f, void* g, void* h, void* i) \
-{ \
- RunFunction(my_context, my_EntityDecl_fct_##A, 9, a, b, c, d, e, f, g, h, i); \
+static uintptr_t my_EntityDecl_fct_##A = 0; \
+static void my_EntityDecl_##A(void* a, void* b, int c, void* d, int e, void* f, void* g, void* h, void* i) \
+{ \
+ RunFunctionFmt(my_EntityDecl_fct_##A, "ppipipppp", a, b, c, d, e, f, g, h, i); \
}
SUPER()
#undef GO
@@ -386,10 +386,10 @@ static void* find_EntityDecl_Fct(void* fct)
}
// ElementDecl ...
#define GO(A) \
-static uintptr_t my_ElementDecl_fct_##A = 0; \
-static void my_ElementDecl_##A(void* a, void* b, void* c) \
-{ \
- RunFunction(my_context, my_ElementDecl_fct_##A, 3, a, b, c); \
+static uintptr_t my_ElementDecl_fct_##A = 0; \
+static void my_ElementDecl_##A(void* a, void* b, void* c) \
+{ \
+ RunFunctionFmt(my_ElementDecl_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -408,10 +408,10 @@ static void* find_ElementDecl_Fct(void* fct)
}
// UnknownEncoding ...
#define GO(A) \
-static uintptr_t my_UnknownEncoding_fct_##A = 0; \
-static int my_UnknownEncoding_##A(void* a, void* b, void* c) \
-{ \
- return (int)RunFunction(my_context, my_UnknownEncoding_fct_##A, 3, a, b, c); \
+static uintptr_t my_UnknownEncoding_fct_##A = 0; \
+static int my_UnknownEncoding_##A(void* a, void* b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my_UnknownEncoding_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -433,7 +433,7 @@ static void* find_UnknownEncoding_Fct(void* fct)
static uintptr_t my_UnparsedEntityDecl_fct_##A = 0; \
static void my_UnparsedEntityDecl_##A(void* a, void* b, void* c, void* d, void* e, void* f) \
{ \
- RunFunction(my_context, my_UnparsedEntityDecl_fct_##A, 6, a, b, c, d, e, f); \
+ RunFunctionFmt(my_UnparsedEntityDecl_fct_##A, "pppppp", a, b, c, d, e, f); \
}
SUPER()
#undef GO
@@ -452,10 +452,10 @@ static void* find_UnparsedEntityDecl_Fct(void* fct)
}
// NotationDecl ...
#define GO(A) \
-static uintptr_t my_NotationDecl_fct_##A = 0; \
-static void my_NotationDecl_##A(void* a, void* b, void* c, void* d, void* e) \
-{ \
- RunFunction(my_context, my_NotationDecl_fct_##A, 5, a, b, c, d, e); \
+static uintptr_t my_NotationDecl_fct_##A = 0; \
+static void my_NotationDecl_##A(void* a, void* b, void* c, void* d, void* e) \
+{ \
+ RunFunctionFmt(my_NotationDecl_fct_##A, "ppppp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -474,10 +474,10 @@ static void* find_NotationDecl_Fct(void* fct)
}
// NotStandalone ...
#define GO(A) \
-static uintptr_t my_NotStandalone_fct_##A = 0; \
-static int my_NotStandalone_##A(void* data) \
-{ \
- return (int)RunFunction(my_context, my_NotStandalone_fct_##A, 1, data); \
+static uintptr_t my_NotStandalone_fct_##A = 0; \
+static int my_NotStandalone_##A(void* data) \
+{ \
+ return (int)RunFunctionFmt(my_NotStandalone_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -496,10 +496,10 @@ static void* find_NotStandalone_Fct(void* fct)
}
// ExternalEntityRef ...
#define GO(A) \
-static uintptr_t my_ExternalEntityRef_fct_##A = 0; \
-static int my_ExternalEntityRef_##A(void* a, void* b, void* c, void* d, void* e) \
-{ \
- return (int)RunFunction(my_context, my_ExternalEntityRef_fct_##A, 5, a, b, c, d, e); \
+static uintptr_t my_ExternalEntityRef_fct_##A = 0; \
+static int my_ExternalEntityRef_##A(void* a, void* b, void* c, void* d, void* e) \
+{ \
+ return (int)RunFunctionFmt(my_ExternalEntityRef_fct_##A, "ppppp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -518,10 +518,10 @@ static void* find_ExternalEntityRef_Fct(void* fct)
}
// XmlDecl ...
#define GO(A) \
-static uintptr_t my_XmlDecl_fct_##A = 0; \
-static void my_XmlDecl_##A(void* a, void* b, void* c, int d) \
-{ \
- RunFunction(my_context, my_XmlDecl_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_XmlDecl_fct_##A = 0; \
+static void my_XmlDecl_##A(void* a, void* b, void* c, int d) \
+{ \
+ RunFunctionFmt(my_XmlDecl_fct_##A, "pppi", a, b, c, d); \
}
SUPER()
#undef GO
@@ -543,7 +543,7 @@ static void* find_XmlDecl_Fct(void* fct)
static uintptr_t my_AttlistDecl_fct_##A = 0; \
static void my_AttlistDecl_##A(void* a, void* b, void* c, void* d, void* e, int f) \
{ \
- RunFunction(my_context, my_AttlistDecl_fct_##A, 6, a, b, c, d, e, f); \
+ RunFunctionFmt(my_AttlistDecl_fct_##A, "pppppi", a, b, c, d, e, f); \
}
SUPER()
#undef GO
@@ -562,10 +562,10 @@ static void* find_AttlistDecl_Fct(void* fct)
}
// SkippedEntity ...
#define GO(A) \
-static uintptr_t my_SkippedEntity_fct_##A = 0; \
-static void my_SkippedEntity_##A(void* a, void* b, int c) \
-{ \
- RunFunction(my_context, my_SkippedEntity_fct_##A, 3, a, b, c); \
+static uintptr_t my_SkippedEntity_fct_##A = 0; \
+static void my_SkippedEntity_##A(void* a, void* b, int c) \
+{ \
+ RunFunctionFmt(my_SkippedEntity_fct_##A, "ppi", a, b, c); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedexpat_private.h b/src/wrapped/wrappedexpat_private.h
index c57ad35..5ce94ae 100755..100644
--- a/src/wrapped/wrappedexpat_private.h
+++ b/src/wrapped/wrappedexpat_private.h
@@ -30,7 +30,7 @@ GO(XML_ParserCreate, pFp)
GO(XML_ParserCreate_MM, pFpppp) // return a structure
//GO(XML_ParserCreateNS,
GO(XML_ParserFree, vFp)
-//GO(XML_ParserReset,
+GO(XML_ParserReset, iFpp)
//GO(XML_ResumeParser,
GOM(XML_SetAttlistDeclHandler, vFEpp)
GO(XML_SetBase, iFpp)
diff --git a/src/wrapped/wrappedfaudio.c b/src/wrapped/wrappedfaudio.c
index ae4d337..619799e 100644
--- a/src/wrapped/wrappedfaudio.c
+++ b/src/wrapped/wrappedfaudio.c
@@ -34,10 +34,10 @@ GO(4)
// FAudioMalloc ...
#define GO(A) \
-static uintptr_t my_FAudioMalloc_fct_##A = 0; \
-static void* my_FAudioMalloc_##A(size_t a) \
-{ \
- return (void*)RunFunction(my_context, my_FAudioMalloc_fct_##A, 1, a); \
+static uintptr_t my_FAudioMalloc_fct_##A = 0; \
+static void* my_FAudioMalloc_##A(size_t a) \
+{ \
+ return (void*)RunFunctionFmt(my_FAudioMalloc_fct_##A, "L", a); \
}
SUPER()
#undef GO
@@ -56,10 +56,10 @@ static void* find_FAudioMalloc_Fct(void* fct)
}
// FAudioFree ...
#define GO(A) \
-static uintptr_t my_FAudioFree_fct_##A = 0; \
-static void my_FAudioFree_##A(void* a) \
-{ \
- RunFunction(my_context, my_FAudioFree_fct_##A, 1, a); \
+static uintptr_t my_FAudioFree_fct_##A = 0; \
+static void my_FAudioFree_##A(void* a) \
+{ \
+ RunFunctionFmt(my_FAudioFree_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -78,10 +78,10 @@ static void* find_FAudioFree_Fct(void* fct)
}
// FAudioRealloc ...
#define GO(A) \
-static uintptr_t my_FAudioRealloc_fct_##A = 0; \
-static void* my_FAudioRealloc_##A(void* a, size_t b) \
-{ \
- return (void*)RunFunction(my_context, my_FAudioRealloc_fct_##A, 2, a, b); \
+static uintptr_t my_FAudioRealloc_fct_##A = 0; \
+static void* my_FAudioRealloc_##A(void* a, size_t b) \
+{ \
+ return (void*)RunFunctionFmt(my_FAudioRealloc_fct_##A, "pL", a, b); \
}
SUPER()
#undef GO
@@ -100,10 +100,10 @@ static void* find_FAudioRealloc_Fct(void* fct)
}
// OnCriticalErrorFunc ...
#define GO(A) \
-static uintptr_t my_OnCriticalErrorFunc_fct_##A = 0; \
-static void my_OnCriticalErrorFunc_##A(void* a, uint32_t b) \
-{ \
- RunFunction(my_context, my_OnCriticalErrorFunc_fct_##A, 2, a, b); \
+static uintptr_t my_OnCriticalErrorFunc_fct_##A = 0; \
+static void my_OnCriticalErrorFunc_##A(void* a, uint32_t b) \
+{ \
+ RunFunctionFmt(my_OnCriticalErrorFunc_fct_##A, "pu", a, b); \
}
SUPER()
#undef GO
@@ -122,10 +122,10 @@ static void* find_OnCriticalErrorFunc_Fct(void* fct)
}
// OnProcessingPassEndFunc ...
#define GO(A) \
-static uintptr_t my_OnProcessingPassEndFunc_fct_##A = 0; \
-static void my_OnProcessingPassEndFunc_##A(void* a) \
-{ \
- RunFunction(my_context, my_OnProcessingPassEndFunc_fct_##A, 1, a); \
+static uintptr_t my_OnProcessingPassEndFunc_fct_##A = 0; \
+static void my_OnProcessingPassEndFunc_##A(void* a) \
+{ \
+ RunFunctionFmt(my_OnProcessingPassEndFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -144,10 +144,10 @@ static void* find_OnProcessingPassEndFunc_Fct(void* fct)
}
// OnProcessingPassStartFunc ...
#define GO(A) \
-static uintptr_t my_OnProcessingPassStartFunc_fct_##A = 0; \
-static void my_OnProcessingPassStartFunc_##A(void* a) \
-{ \
- RunFunction(my_context, my_OnProcessingPassStartFunc_fct_##A, 1, a); \
+static uintptr_t my_OnProcessingPassStartFunc_fct_##A = 0; \
+static void my_OnProcessingPassStartFunc_##A(void* a) \
+{ \
+ RunFunctionFmt(my_OnProcessingPassStartFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -172,10 +172,10 @@ typedef struct my_FAudioEngineCallback_s
} my_FAudioEngineCallback_t;
// OnBufferEndFunc ...
#define GO(A) \
-static uintptr_t my_OnBufferEndFunc_fct_##A = 0; \
-static void my_OnBufferEndFunc_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_OnBufferEndFunc_fct_##A, 2, a, b); \
+static uintptr_t my_OnBufferEndFunc_fct_##A = 0; \
+static void my_OnBufferEndFunc_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_OnBufferEndFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -194,10 +194,10 @@ static void* find_OnBufferEndFunc_Fct(void* fct)
}
// OnBufferStartFunc ...
#define GO(A) \
-static uintptr_t my_OnBufferStartFunc_fct_##A = 0; \
-static void my_OnBufferStartFunc_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_OnBufferStartFunc_fct_##A, 2, a, b); \
+static uintptr_t my_OnBufferStartFunc_fct_##A = 0; \
+static void my_OnBufferStartFunc_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_OnBufferStartFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -216,10 +216,10 @@ static void* find_OnBufferStartFunc_Fct(void* fct)
}
// OnLoopEndFunc ...
#define GO(A) \
-static uintptr_t my_OnLoopEndFunc_fct_##A = 0; \
-static void my_OnLoopEndFunc_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_OnLoopEndFunc_fct_##A, 2, a, b); \
+static uintptr_t my_OnLoopEndFunc_fct_##A = 0; \
+static void my_OnLoopEndFunc_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_OnLoopEndFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -238,10 +238,10 @@ static void* find_OnLoopEndFunc_Fct(void* fct)
}
// OnStreamEndFunc ...
#define GO(A) \
-static uintptr_t my_OnStreamEndFunc_fct_##A = 0; \
-static void my_OnStreamEndFunc_##A(void* a) \
-{ \
- RunFunction(my_context, my_OnStreamEndFunc_fct_##A, 1, a); \
+static uintptr_t my_OnStreamEndFunc_fct_##A = 0; \
+static void my_OnStreamEndFunc_##A(void* a) \
+{ \
+ RunFunctionFmt(my_OnStreamEndFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -260,10 +260,10 @@ static void* find_OnStreamEndFunc_Fct(void* fct)
}
// OnVoiceErrorFunc ...
#define GO(A) \
-static uintptr_t my_OnVoiceErrorFunc_fct_##A = 0; \
-static void my_OnVoiceErrorFunc_##A(void* a, void* b, uint32_t c) \
-{ \
- RunFunction(my_context, my_OnVoiceErrorFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_OnVoiceErrorFunc_fct_##A = 0; \
+static void my_OnVoiceErrorFunc_##A(void* a, void* b, uint32_t c) \
+{ \
+ RunFunctionFmt(my_OnVoiceErrorFunc_fct_##A, "ppu", a, b, c); \
}
SUPER()
#undef GO
@@ -282,10 +282,10 @@ static void* find_OnVoiceErrorFunc_Fct(void* fct)
}
// OnVoiceProcessingPassEndFunc ...
#define GO(A) \
-static uintptr_t my_OnVoiceProcessingPassEndFunc_fct_##A = 0; \
-static void my_OnVoiceProcessingPassEndFunc_##A(void* a) \
-{ \
- RunFunction(my_context, my_OnVoiceProcessingPassEndFunc_fct_##A, 1, a); \
+static uintptr_t my_OnVoiceProcessingPassEndFunc_fct_##A = 0; \
+static void my_OnVoiceProcessingPassEndFunc_##A(void* a) \
+{ \
+ RunFunctionFmt(my_OnVoiceProcessingPassEndFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -304,10 +304,10 @@ static void* find_OnVoiceProcessingPassEndFunc_Fct(void* fct)
}
// OnVoiceProcessingPassStartFunc ...
#define GO(A) \
-static uintptr_t my_OnVoiceProcessingPassStartFunc_fct_##A = 0; \
-static void my_OnVoiceProcessingPassStartFunc_##A(void* a, uint32_t b) \
-{ \
- RunFunction(my_context, my_OnVoiceProcessingPassStartFunc_fct_##A, 2, a, b); \
+static uintptr_t my_OnVoiceProcessingPassStartFunc_fct_##A = 0; \
+static void my_OnVoiceProcessingPassStartFunc_##A(void* a, uint32_t b) \
+{ \
+ RunFunctionFmt(my_OnVoiceProcessingPassStartFunc_fct_##A, "pu", a, b); \
}
SUPER()
#undef GO
@@ -336,10 +336,10 @@ typedef struct my_FAudioVoiceCallback_s
} my_FAudioVoiceCallback_t;
// FAudioEngineCallEXT ...
#define GO(A) \
-static uintptr_t my_FAudioEngineCallEXT_fct_##A = 0; \
-static void my_FAudioEngineCallEXT_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_FAudioEngineCallEXT_fct_##A, 2, a, b); \
+static uintptr_t my_FAudioEngineCallEXT_fct_##A = 0; \
+static void my_FAudioEngineCallEXT_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_FAudioEngineCallEXT_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -358,10 +358,10 @@ static void* find_FAudioEngineCallEXT_Fct(void* fct)
}
// FAudioEngineProcedureEXT ...
#define GO(A) \
-static uintptr_t my_FAudioEngineProcedureEXT_fct_##A = 0; \
-static void my_FAudioEngineProcedureEXT_##A(void* a, void* b, void* c, void* d) \
-{ \
- RunFunction(my_context, my_FAudioEngineProcedureEXT_fct_##A, 4, find_FAudioEngineCallEXT_Fct(a), b, c, d); \
+static uintptr_t my_FAudioEngineProcedureEXT_fct_##A = 0; \
+static void my_FAudioEngineProcedureEXT_##A(void* a, void* b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_FAudioEngineProcedureEXT_fct_##A, "pppp", find_FAudioEngineCallEXT_Fct(a), b, c, d); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedfaudio_private.h b/src/wrapped/wrappedfaudio_private.h
index bec2d84..d3ad060 100644
--- a/src/wrapped/wrappedfaudio_private.h
+++ b/src/wrapped/wrappedfaudio_private.h
@@ -18,8 +18,8 @@ GO(F3DAudioCalculate, vFpppup)
//GO(F3DAudioCheckInitParams,
GO(F3DAudioInitialize, vFufp)
GO(F3DAudioInitialize8, uFufp)
-//GO(FACT3DApply,
-//GO(FACT3DCalculate,
+GO(FACT3DApply, uFpp)
+GO(FACT3DCalculate, uFpppp)
GO(FACT3DInitialize, uFpp)
GO(FACTAudioEngine_AddRef, uFp)
GO(FACTAudioEngine_CreateInMemoryWaveBank, uFppuuup)
@@ -92,9 +92,9 @@ GO(FACTSoundBank_Stop, uFpWu)
GO(FACTWaveBank_Destroy, uFp)
GO(FACTWaveBank_GetNumWaves, uFpp)
GO(FACTWaveBank_GetState, uFpp)
-GO(FACTWaveBank_GetWaveIndex, uFpp)
+GO(FACTWaveBank_GetWaveIndex, WFpp)
GO(FACTWaveBank_GetWaveProperties, uFpWp)
-GO(FACTWaveBank_Play, uFpWuwCp)
+GO(FACTWaveBank_Play, uFpWuuCp)
GO(FACTWaveBank_Prepare, uFpWuuCp)
GO(FACTWaveBank_Stop, uFpWu)
GO(FACTWave_Destroy, uFp)
@@ -146,13 +146,13 @@ GOM(FAPOFX_CreateFXWithCustomAllocatorEXT, uFEpppuppp)
//GO(FAPOFXReverb_Process,
GO(FAudio_AddRef, uFp)
//GO(FAudio_close,
-GO(FAudioCOMConstructEXT, uFpuC)
+GO(FAudioCOMConstructEXT, uFpC)
GOM(FAudioCOMConstructWithCustomAllocatorEXT, uFEpCppp)
GO(FAudio_CommitChanges, uFp)
GO(FAudio_CommitOperationSet, uFpu)
GO(FAudioCreate, uFpuu)
GO(FAudio_CreateMasteringVoice, uFppuuuup)
-GO(FAudio_CreateMasteringVoice8, uFppuuuppi)
+GO(FAudio_CreateMasteringVoice8, uFppuuuppu)
GO(FAudioCreateReverb, uFpu)
GO(FAudioCreateReverb9, uFpu)
GOM(FAudioCreateReverb9WithCustomAllocatorEXT, uFEpuppp)
@@ -302,7 +302,7 @@ GO(FAudioVoice_SetVolume, uFpfu)
//GO(LinkedList_PrependEntry,
//GO(LinkedList_RemoveEntry,
GO(ReverbConvertI3DL2ToNative, vFpp)
-GO(ReverbConvertI3DL2ToNative9, vFpp)
+GO(ReverbConvertI3DL2ToNative9, vFppi)
GO(XNA_EnableVisualization, vFu)
GO(XNA_GetSongEnded, uFv)
GO(XNA_GetSongVisualizationData, vFppu)
diff --git a/src/wrapped/wrappedflac.c b/src/wrapped/wrappedflac.c
index 4bff742..bc1919c 100755..100644
--- a/src/wrapped/wrappedflac.c
+++ b/src/wrapped/wrappedflac.c
@@ -51,10 +51,10 @@ GO(7)
// read_write
#define GO(A) \
-static uintptr_t my_read_write_fct_##A = 0; \
-static unsigned long my_read_write_##A(void* ptr, unsigned long size, unsigned long nmemb, void* handle) \
-{ \
- return RunFunction(my_context, my_read_write_fct_##A, 4, ptr, size, nmemb, handle);\
+static uintptr_t my_read_write_fct_##A = 0; \
+static unsigned long my_read_write_##A(void* ptr, unsigned long size, unsigned long nmemb, void* handle) \
+{ \
+ return RunFunctionFmt(my_read_write_fct_##A, "pLLp", ptr, size, nmemb, handle); \
}
SUPER()
#undef GO
@@ -73,10 +73,10 @@ static void* findread_writeFct(void* fct)
}
// seek
#define GO(A) \
-static uintptr_t my_seek_fct_##A = 0; \
-static int my_seek_##A(void* ptr, int64_t offset, int whence) \
-{ \
- return (int)RunFunction(my_context, my_seek_fct_##A, 3, ptr, offset, whence);\
+static uintptr_t my_seek_fct_##A = 0; \
+static int my_seek_##A(void* ptr, int64_t offset, int whence) \
+{ \
+ return (int)RunFunctionFmt(my_seek_fct_##A, "pIi", ptr, offset, whence); \
}
SUPER()
#undef GO
@@ -95,10 +95,10 @@ static void* findseekFct(void* fct)
}
// close_eof
#define GO(A) \
-static uintptr_t my_close_eof_fct_##A = 0; \
-static int my_close_eof_##A(void* ptr) \
-{ \
- return (int)RunFunction(my_context, my_close_eof_fct_##A, 1, ptr);\
+static uintptr_t my_close_eof_fct_##A = 0; \
+static int my_close_eof_##A(void* ptr) \
+{ \
+ return (int)RunFunctionFmt(my_close_eof_fct_##A, "p", ptr); \
}
SUPER()
#undef GO
@@ -117,10 +117,10 @@ static void* findclose_eofFct(void* fct)
}
// tell
#define GO(A) \
-static uintptr_t my_tell_fct_##A = 0; \
-static long my_tell_##A(void* ptr) \
-{ \
- return (long)RunFunction(my_context, my_tell_fct_##A, 1, ptr);\
+static uintptr_t my_tell_fct_##A = 0; \
+static long my_tell_##A(void* ptr) \
+{ \
+ return (long)RunFunctionFmt(my_tell_fct_##A, "p", ptr); \
}
SUPER()
#undef GO
@@ -138,11 +138,11 @@ static void* findtellFct(void* fct)
return NULL;
}
// Read
-#define GO(A) \
-static uintptr_t my_Read_fct_##A = 0; \
-static int my_Read_##A(void* decoder, void* buffer, size_t* bytes, void* data) \
-{ \
- return (int)RunFunction(my_context, my_Read_fct_##A, 4, decoder, buffer, bytes, data); \
+#define GO(A) \
+static uintptr_t my_Read_fct_##A = 0; \
+static int my_Read_##A(void* decoder, void* buffer, size_t* bytes, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_Read_fct_##A, "pppp", decoder, buffer, bytes, data); \
}
SUPER()
#undef GO
@@ -160,11 +160,11 @@ static void* findReadFct(void* fct)
return NULL;
}
// Seek
-#define GO(A) \
-static uintptr_t my_Seek_fct_##A = 0; \
-static int my_Seek_##A(void* decoder, uint64_t offset, void* data) \
-{ \
- return (int)RunFunction(my_context, my_Seek_fct_##A, 3, decoder, offset, data); \
+#define GO(A) \
+static uintptr_t my_Seek_fct_##A = 0; \
+static int my_Seek_##A(void* decoder, uint64_t offset, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_Seek_fct_##A, "pUp", decoder, offset, data); \
}
SUPER()
#undef GO
@@ -182,11 +182,11 @@ static void* findSeekFct(void* fct)
return NULL;
}
// Tell
-#define GO(A) \
-static uintptr_t my_Tell_fct_##A = 0; \
-static int my_Tell_##A(void* decoder, uint64_t *offset, void* data) \
-{ \
- return (int)RunFunction(my_context, my_Tell_fct_##A, 3, decoder, offset, data); \
+#define GO(A) \
+static uintptr_t my_Tell_fct_##A = 0; \
+static int my_Tell_##A(void* decoder, uint64_t *offset, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_Tell_fct_##A, "ppp", decoder, offset, data); \
}
SUPER()
#undef GO
@@ -204,11 +204,11 @@ static void* findTellFct(void* fct)
return NULL;
}
// Length
-#define GO(A) \
-static uintptr_t my_Length_fct_##A = 0; \
-static int my_Length_##A(void* decoder, uint64_t *length, void* data) \
-{ \
- return (int)RunFunction(my_context, my_Length_fct_##A, 3, decoder, length, data); \
+#define GO(A) \
+static uintptr_t my_Length_fct_##A = 0; \
+static int my_Length_##A(void* decoder, uint64_t *length, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_Length_fct_##A, "ppp", decoder, length, data); \
}
SUPER()
#undef GO
@@ -226,11 +226,11 @@ static void* findLengthFct(void* fct)
return NULL;
}
// Eof
-#define GO(A) \
-static uintptr_t my_Eof_fct_##A = 0; \
-static int my_Eof_##A(void* decoder, void* data) \
-{ \
- return (int)RunFunction(my_context, my_Eof_fct_##A, 2, decoder, data); \
+#define GO(A) \
+static uintptr_t my_Eof_fct_##A = 0; \
+static int my_Eof_##A(void* decoder, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_Eof_fct_##A, "pp", decoder, data); \
}
SUPER()
#undef GO
@@ -248,11 +248,11 @@ static void* findEofFct(void* fct)
return NULL;
}
// Write
-#define GO(A) \
-static uintptr_t my_Write_fct_##A = 0; \
-static int my_Write_##A(void* decoder, void* frame, void* buffer, void* data) \
-{ \
- return (int)RunFunction(my_context, my_Write_fct_##A, 4, decoder, frame, buffer, data); \
+#define GO(A) \
+static uintptr_t my_Write_fct_##A = 0; \
+static int my_Write_##A(void* decoder, void* frame, void* buffer, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_Write_fct_##A, "pppp", decoder, frame, buffer, data); \
}
SUPER()
#undef GO
@@ -270,11 +270,11 @@ static void* findWriteFct(void* fct)
return NULL;
}
// Metadata
-#define GO(A) \
-static uintptr_t my_Metadata_fct_##A = 0; \
-static int my_Metadata_##A(void* decoder, void* metadata, void* data) \
-{ \
- return (int)RunFunction(my_context, my_Metadata_fct_##A, 3, decoder, metadata, data); \
+#define GO(A) \
+static uintptr_t my_Metadata_fct_##A = 0; \
+static int my_Metadata_##A(void* decoder, void* metadata, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_Metadata_fct_##A, "ppp", decoder, metadata, data); \
}
SUPER()
#undef GO
@@ -292,11 +292,11 @@ static void* findMetadataFct(void* fct)
return NULL;
}
// Error
-#define GO(A) \
-static uintptr_t my_Error_fct_##A = 0; \
-static void my_Error_##A(void* decoder, int status, void* data) \
-{ \
- RunFunction(my_context, my_Error_fct_##A, 3, decoder, status, data); \
+#define GO(A) \
+static uintptr_t my_Error_fct_##A = 0; \
+static void my_Error_##A(void* decoder, int status, void* data) \
+{ \
+ RunFunctionFmt(my_Error_fct_##A, "pip", decoder, status, data); \
}
SUPER()
#undef GO
@@ -317,7 +317,7 @@ static void* findErrorFct(void* fct)
#undef SUPER
-EXPORT int my_FLAC__metadata_chain_read_with_callbacks(x64emu_t* emu, void* chain, void* handle,
+EXPORT int my_FLAC__metadata_chain_read_with_callbacks(x64emu_t* emu, void* chain, void* handle,
void* read_fnc, void* write_fnc, void* seek_fnc, void* tell_fnc, void* eof_fnc, void* close_fnc)
{
flac_callbacks cbs = {0};
@@ -332,10 +332,10 @@ EXPORT int my_FLAC__metadata_chain_read_with_callbacks(x64emu_t* emu, void* chai
}
EXPORT int my_FLAC__stream_decoder_init_stream(x64emu_t* emu, void* decoder,
- void* read_fnc, void* seek_fnc, void* tell_fnc, void* length_fnc, void* eof_fnc,
+ void* read_fnc, void* seek_fnc, void* tell_fnc, void* length_fnc, void* eof_fnc,
void* write_fnc, void* metadata_fnc, void* error_fnc, void* data)
{
- int ret = my->FLAC__stream_decoder_init_stream(decoder,
+ int ret = my->FLAC__stream_decoder_init_stream(decoder,
findReadFct(read_fnc), findSeekFct(seek_fnc), findTellFct(tell_fnc),
findLengthFct(length_fnc), findEofFct(eof_fnc), findWriteFct(write_fnc),
findMetadataFct(metadata_fnc), findErrorFct(error_fnc), data);
diff --git a/src/wrapped/wrappedflac_private.h b/src/wrapped/wrappedflac_private.h
index ba5d75c..f676c19 100755..100644
--- a/src/wrapped/wrappedflac_private.h
+++ b/src/wrapped/wrappedflac_private.h
@@ -5,39 +5,39 @@
//DATA(FLAC_API_SUPPORTS_OGG_FLAC,
//DATA(FLAC__ChannelAssignmentString,
//DATA(FLAC__EntropyCodingMethodTypeString,
-//GO(FLAC__format_blocksize_is_subset,
-//GO(FLAC__format_cuesheet_is_legal,
-//GO(FLAC__format_picture_is_legal,
-//GO(FLAC__format_sample_rate_is_subset,
+GO(FLAC__format_blocksize_is_subset, iFuu)
+GO(FLAC__format_cuesheet_is_legal, iFpip)
+GO(FLAC__format_picture_is_legal, iFpp)
+GO(FLAC__format_sample_rate_is_subset, iFu)
//GO(FLAC__format_sample_rate_is_valid,
-//GO(FLAC__format_seektable_is_legal,
-//GO(FLAC__format_seektable_sort,
-//GO(FLAC__format_vorbiscomment_entry_is_legal,
-//GO(FLAC__format_vorbiscomment_entry_name_is_legal,
+GO(FLAC__format_seektable_is_legal, iFp)
+GO(FLAC__format_seektable_sort, uFp)
+GO(FLAC__format_vorbiscomment_entry_is_legal, iFpu)
+GO(FLAC__format_vorbiscomment_entry_name_is_legal, iFp)
//GO(FLAC__format_vorbiscomment_entry_value_is_legal,
//DATA(FLAC__FrameNumberTypeString,
-//GO(FLAC__metadata_chain_check_if_tempfile_needed,
+GO(FLAC__metadata_chain_check_if_tempfile_needed, iFpi)
//GO(FLAC__metadata_chain_delete,
//GO(FLAC__metadata_chain_merge_padding,
GO(FLAC__metadata_chain_new, pFv)
//GO(FLAC__metadata_chain_read,
-//GO(FLAC__metadata_chain_read_ogg,
+GO(FLAC__metadata_chain_read_ogg, iFpp)
//GO(FLAC__metadata_chain_read_ogg_with_callbacks,
GOM(FLAC__metadata_chain_read_with_callbacks, iFEppPPPPPP) // FLAC__IOCallbacks is a struct with all callbacks
-//GO(FLAC__metadata_chain_sort_padding,
-GO(FLAC__metadata_chain_status, iFp)
+GO(FLAC__metadata_chain_sort_padding, vFp)
+GO(FLAC__metadata_chain_status, uFp)
DATA(FLAC__Metadata_ChainStatusString, sizeof(void*))
-//GO(FLAC__metadata_chain_write,
+GO(FLAC__metadata_chain_write, iFpii)
//GO(FLAC__metadata_chain_write_with_callbacks,
//GO(FLAC__metadata_chain_write_with_callbacks_and_tempfile,
-//GO(FLAC__metadata_get_cuesheet,
-//GO(FLAC__metadata_get_picture,
-//GO(FLAC__metadata_get_streaminfo,
+GO(FLAC__metadata_get_cuesheet, iFpp)
+GO(FLAC__metadata_get_picture, iFppuppuuuu)
+GO(FLAC__metadata_get_streaminfo, iFpp)
//GO(FLAC__metadata_get_tags,
GO(FLAC__metadata_iterator_delete, vFp)
GO(FLAC__metadata_iterator_delete_block, iFpi)
GO(FLAC__metadata_iterator_get_block, pFp)
-GO(FLAC__metadata_iterator_get_block_type, iFp)
+GO(FLAC__metadata_iterator_get_block_type, uFp)
GO(FLAC__metadata_iterator_init, vFpp)
GO(FLAC__metadata_iterator_insert_block_after, iFpp)
GO(FLAC__metadata_iterator_insert_block_before, iFpp)
@@ -45,69 +45,69 @@ GO(FLAC__metadata_iterator_new, pFv)
GO(FLAC__metadata_iterator_next, iFp)
GO(FLAC__metadata_iterator_prev, iFp)
GO(FLAC__metadata_iterator_set_block, iFpp)
-//GO(FLAC__metadata_object_application_set_data,
-//GO(FLAC__metadata_object_clone,
-//GO(FLAC__metadata_object_cuesheet_calculate_cddb_id,
-//GO(FLAC__metadata_object_cuesheet_delete_track,
+GO(FLAC__metadata_object_application_set_data, iFppui)
+GO(FLAC__metadata_object_clone, pFp)
+GO(FLAC__metadata_object_cuesheet_calculate_cddb_id, uFp)
+GO(FLAC__metadata_object_cuesheet_delete_track, iFpu)
//GO(FLAC__metadata_object_cuesheet_insert_blank_track,
-//GO(FLAC__metadata_object_cuesheet_insert_track,
-//GO(FLAC__metadata_object_cuesheet_is_legal,
+GO(FLAC__metadata_object_cuesheet_insert_track, iFpupi)
+GO(FLAC__metadata_object_cuesheet_is_legal, iFpip)
//GO(FLAC__metadata_object_cuesheet_resize_tracks,
//GO(FLAC__metadata_object_cuesheet_set_track,
-//GO(FLAC__metadata_object_cuesheet_track_clone,
-//GO(FLAC__metadata_object_cuesheet_track_delete,
-//GO(FLAC__metadata_object_cuesheet_track_delete_index,
+GO(FLAC__metadata_object_cuesheet_track_clone, pFp)
+GO(FLAC__metadata_object_cuesheet_track_delete, vFp)
+GO(FLAC__metadata_object_cuesheet_track_delete_index, iFpuu)
//GO(FLAC__metadata_object_cuesheet_track_insert_blank_index,
//GO(FLAC__metadata_object_cuesheet_track_insert_index,
-//GO(FLAC__metadata_object_cuesheet_track_new,
+GO(FLAC__metadata_object_cuesheet_track_new, pFv)
//GO(FLAC__metadata_object_cuesheet_track_resize_indices,
GO(FLAC__metadata_object_delete, vFp)
-//GO(FLAC__metadata_object_is_equal,
-//GO(FLAC__metadata_object_new,
-//GO(FLAC__metadata_object_picture_is_legal,
-//GO(FLAC__metadata_object_picture_set_data,
-//GO(FLAC__metadata_object_picture_set_description,
-//GO(FLAC__metadata_object_picture_set_mime_type,
+GO(FLAC__metadata_object_is_equal, iFpp)
+GO(FLAC__metadata_object_new, pFu)
+GO(FLAC__metadata_object_picture_is_legal, iFpp)
+GO(FLAC__metadata_object_picture_set_data, iFppui)
+GO(FLAC__metadata_object_picture_set_description, iFppi)
+GO(FLAC__metadata_object_picture_set_mime_type, iFppi)
//GO(FLAC__metadata_object_seektable_delete_point,
//GO(FLAC__metadata_object_seektable_insert_point,
-//GO(FLAC__metadata_object_seektable_is_legal,
+GO(FLAC__metadata_object_seektable_is_legal, iFp)
//GO(FLAC__metadata_object_seektable_resize_points,
//GO(FLAC__metadata_object_seektable_set_point,
//GO(FLAC__metadata_object_seektable_template_append_placeholders,
-//GO(FLAC__metadata_object_seektable_template_append_point,
-//GO(FLAC__metadata_object_seektable_template_append_points,
+GO(FLAC__metadata_object_seektable_template_append_point, iFpL)
+GO(FLAC__metadata_object_seektable_template_append_points, iFppu)
//GO(FLAC__metadata_object_seektable_template_append_spaced_points,
-//GO(FLAC__metadata_object_seektable_template_append_spaced_points_by_samples,
-//GO(FLAC__metadata_object_seektable_template_sort,
+GO(FLAC__metadata_object_seektable_template_append_spaced_points_by_samples, iFpuL)
+GO(FLAC__metadata_object_seektable_template_sort, iFpi)
//GO(FLAC__metadata_object_vorbiscomment_append_comment,
//GO(FLAC__metadata_object_vorbiscomment_delete_comment,
-//GO(FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair,
+GO(FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair, iFppp)
//GO(FLAC__metadata_object_vorbiscomment_entry_matches,
//GO(FLAC__metadata_object_vorbiscomment_entry_to_name_value_pair,
-//GO(FLAC__metadata_object_vorbiscomment_find_entry_from,
+GO(FLAC__metadata_object_vorbiscomment_find_entry_from, iFpup)
//GO(FLAC__metadata_object_vorbiscomment_insert_comment,
-//GO(FLAC__metadata_object_vorbiscomment_remove_entries_matching,
+GO(FLAC__metadata_object_vorbiscomment_remove_entries_matching, iFpp)
//GO(FLAC__metadata_object_vorbiscomment_remove_entry_matching,
//GO(FLAC__metadata_object_vorbiscomment_replace_comment,
//GO(FLAC__metadata_object_vorbiscomment_resize_comments,
//GO(FLAC__metadata_object_vorbiscomment_set_comment,
//GO(FLAC__metadata_object_vorbiscomment_set_vendor_string,
-//GO(FLAC__metadata_simple_iterator_delete,
-//GO(FLAC__metadata_simple_iterator_delete_block,
-//GO(FLAC__metadata_simple_iterator_get_application_id,
-//GO(FLAC__metadata_simple_iterator_get_block,
-//GO(FLAC__metadata_simple_iterator_get_block_length,
-//GO(FLAC__metadata_simple_iterator_get_block_offset,
-//GO(FLAC__metadata_simple_iterator_get_block_type,
-//GO(FLAC__metadata_simple_iterator_init,
-//GO(FLAC__metadata_simple_iterator_insert_block_after,
-//GO(FLAC__metadata_simple_iterator_is_last,
+GO(FLAC__metadata_simple_iterator_delete, vFp)
+GO(FLAC__metadata_simple_iterator_delete_block, iFpi)
+GO(FLAC__metadata_simple_iterator_get_application_id, iFpp)
+GO(FLAC__metadata_simple_iterator_get_block, pFp)
+GO(FLAC__metadata_simple_iterator_get_block_length, uFp)
+GO(FLAC__metadata_simple_iterator_get_block_offset, lFp)
+GO(FLAC__metadata_simple_iterator_get_block_type, uFp)
+GO(FLAC__metadata_simple_iterator_init, iFppii)
+GO(FLAC__metadata_simple_iterator_insert_block_after, iFppi)
+GO(FLAC__metadata_simple_iterator_is_last, iFp)
//GO(FLAC__metadata_simple_iterator_is_writable,
-//GO(FLAC__metadata_simple_iterator_new,
+GO(FLAC__metadata_simple_iterator_new, pFv)
//GO(FLAC__metadata_simple_iterator_next,
-//GO(FLAC__metadata_simple_iterator_prev,
+GO(FLAC__metadata_simple_iterator_prev, iFp)
//GO(FLAC__metadata_simple_iterator_set_block,
-//GO(FLAC__metadata_simple_iterator_status,
+GO(FLAC__metadata_simple_iterator_status, uFp)
//DATA(FLAC__Metadata_SimpleIteratorStatusString,
//DATA(FLAC__MetadataTypeString,
GO(FLAC__stream_decoder_delete, vFp)
@@ -115,22 +115,22 @@ DATA(FLAC__StreamDecoderErrorStatusString, sizeof(void*))
GO(FLAC__stream_decoder_finish, iFp)
GO(FLAC__stream_decoder_flush, iFp)
//GO(FLAC__stream_decoder_get_bits_per_sample,
-//GO(FLAC__stream_decoder_get_blocksize,
-//GO(FLAC__stream_decoder_get_channel_assignment,
+GO(FLAC__stream_decoder_get_blocksize, uFp)
+GO(FLAC__stream_decoder_get_channel_assignment, uFp)
//GO(FLAC__stream_decoder_get_channels,
GO(FLAC__stream_decoder_get_decode_position, iFpp)
-//GO(FLAC__stream_decoder_get_md5_checking,
+GO(FLAC__stream_decoder_get_md5_checking, iFp)
GO(FLAC__stream_decoder_get_resolved_state_string, pFp)
//GO(FLAC__stream_decoder_get_sample_rate,
-GO(FLAC__stream_decoder_get_state, iFp)
-//GO(FLAC__stream_decoder_get_total_samples,
+GO(FLAC__stream_decoder_get_state, uFp)
+GO(FLAC__stream_decoder_get_total_samples, LFp)
//GO(FLAC__stream_decoder_init_file,
//GO(FLAC__stream_decoder_init_FILE,
//GO(FLAC__stream_decoder_init_ogg_file,
//GO(FLAC__stream_decoder_init_ogg_FILE,
//GO(FLAC__stream_decoder_init_ogg_stream,
//DATA(FLAC__StreamDecoderInitStatusString,
-GOM(FLAC__stream_decoder_init_stream, iFEppppppppp)
+GOM(FLAC__stream_decoder_init_stream, iFEpppppppppp)
//DATA(FLAC__StreamDecoderLengthStatusString,
GO(FLAC__stream_decoder_new, pFv)
GO(FLAC__stream_decoder_process_single, iFp)
@@ -138,25 +138,25 @@ GO(FLAC__stream_decoder_process_until_end_of_metadata, iFp)
GO(FLAC__stream_decoder_process_until_end_of_stream, iFp)
//DATA(FLAC__StreamDecoderReadStatusString,
GO(FLAC__stream_decoder_reset, iFp)
-GO(FLAC__stream_decoder_seek_absolute, iFpU)
+GO(FLAC__stream_decoder_seek_absolute, iFpL)
//DATA(FLAC__StreamDecoderSeekStatusString,
-//GO(FLAC__stream_decoder_set_md5_checking,
-//GO(FLAC__stream_decoder_set_metadata_ignore,
+GO(FLAC__stream_decoder_set_md5_checking, iFpi)
+GO(FLAC__stream_decoder_set_metadata_ignore, iFpu)
GO(FLAC__stream_decoder_set_metadata_ignore_all, iFp)
-//GO(FLAC__stream_decoder_set_metadata_ignore_application,
+GO(FLAC__stream_decoder_set_metadata_ignore_application, iFpp)
//GO(FLAC__stream_decoder_set_metadata_respond,
//GO(FLAC__stream_decoder_set_metadata_respond_all,
//GO(FLAC__stream_decoder_set_metadata_respond_application,
-//GO(FLAC__stream_decoder_set_ogg_serial_number,
-//GO(FLAC__stream_decoder_skip_single_frame,
+GO(FLAC__stream_decoder_set_ogg_serial_number, iFpl)
+GO(FLAC__stream_decoder_skip_single_frame, iFp)
//DATA(FLAC__StreamDecoderStateString,
//DATA(FLAC__StreamDecoderTellStatusString,
//DATA(FLAC__StreamDecoderWriteStatusString,
-//GO(FLAC__stream_encoder_delete,
+GO(FLAC__stream_encoder_delete, vFp)
//GO(FLAC__stream_encoder_disable_constant_subframes,
//GO(FLAC__stream_encoder_disable_fixed_subframes,
//GO(FLAC__stream_encoder_disable_verbatim_subframes,
-//GO(FLAC__stream_encoder_finish,
+GO(FLAC__stream_encoder_finish, iFp)
//GO(FLAC__stream_encoder_get_bits_per_sample,
//GO(FLAC__stream_encoder_get_blocksize,
//GO(FLAC__stream_encoder_get_channels,
@@ -170,15 +170,15 @@ GO(FLAC__stream_decoder_set_metadata_ignore_all, iFp)
//GO(FLAC__stream_encoder_get_max_residual_partition_order,
//GO(FLAC__stream_encoder_get_min_residual_partition_order,
//GO(FLAC__stream_encoder_get_qlp_coeff_precision,
-//GO(FLAC__stream_encoder_get_resolved_state_string,
-//GO(FLAC__stream_encoder_get_rice_parameter_search_dist,
+GO(FLAC__stream_encoder_get_resolved_state_string, pFp)
+GO(FLAC__stream_encoder_get_rice_parameter_search_dist, uFp)
//GO(FLAC__stream_encoder_get_sample_rate,
-//GO(FLAC__stream_encoder_get_state,
+GO(FLAC__stream_encoder_get_state, uFp)
//GO(FLAC__stream_encoder_get_streamable_subset,
-//GO(FLAC__stream_encoder_get_total_samples_estimate,
+GO(FLAC__stream_encoder_get_total_samples_estimate, LFp)
//GO(FLAC__stream_encoder_get_verify,
-//GO(FLAC__stream_encoder_get_verify_decoder_error_stats,
-//GO(FLAC__stream_encoder_get_verify_decoder_state,
+GO(FLAC__stream_encoder_get_verify_decoder_error_stats, vFppppppp)
+GO(FLAC__stream_encoder_get_verify_decoder_state, uFp)
//GO(FLAC__stream_encoder_init_file,
//GO(FLAC__stream_encoder_init_FILE,
//GO(FLAC__stream_encoder_init_ogg_file,
@@ -186,12 +186,12 @@ GO(FLAC__stream_decoder_set_metadata_ignore_all, iFp)
//GO(FLAC__stream_encoder_init_ogg_stream,
//DATA(FLAC__StreamEncoderInitStatusString,
//GO(FLAC__stream_encoder_init_stream,
-//GO(FLAC__stream_encoder_new,
-//GO(FLAC__stream_encoder_process,
-//GO(FLAC__stream_encoder_process_interleaved,
+GO(FLAC__stream_encoder_new, pFv)
+GO(FLAC__stream_encoder_process, iFppu)
+GO(FLAC__stream_encoder_process_interleaved, iFppu)
//DATA(FLAC__StreamEncoderReadStatusString,
//DATA(FLAC__StreamEncoderSeekStatusString,
-//GO(FLAC__stream_encoder_set_apodization,
+GO(FLAC__stream_encoder_set_apodization, iFpp)
//GO(FLAC__stream_encoder_set_bits_per_sample,
//GO(FLAC__stream_encoder_set_blocksize,
//GO(FLAC__stream_encoder_set_channels,
@@ -204,14 +204,14 @@ GO(FLAC__stream_decoder_set_metadata_ignore_all, iFp)
//GO(FLAC__stream_encoder_set_loose_mid_side_stereo,
//GO(FLAC__stream_encoder_set_max_lpc_order,
//GO(FLAC__stream_encoder_set_max_residual_partition_order,
-//GO(FLAC__stream_encoder_set_metadata,
+GO(FLAC__stream_encoder_set_metadata, iFppu)
//GO(FLAC__stream_encoder_set_min_residual_partition_order,
-//GO(FLAC__stream_encoder_set_ogg_serial_number,
+GO(FLAC__stream_encoder_set_ogg_serial_number, iFpl)
//GO(FLAC__stream_encoder_set_qlp_coeff_precision,
-//GO(FLAC__stream_encoder_set_rice_parameter_search_dist,
+GO(FLAC__stream_encoder_set_rice_parameter_search_dist, iFpu)
//GO(FLAC__stream_encoder_set_sample_rate,
//GO(FLAC__stream_encoder_set_streamable_subset,
-//GO(FLAC__stream_encoder_set_total_samples_estimate,
+GO(FLAC__stream_encoder_set_total_samples_estimate, iFpL)
//GO(FLAC__stream_encoder_set_verify,
//DATA(FLAC__StreamEncoderStateString,
//DATA(FLAC__StreamEncoderTellStatusString,
diff --git a/src/wrapped/wrappedfontconfig.c b/src/wrapped/wrappedfontconfig.c
index b56e41c..b56e41c 100755..100644
--- a/src/wrapped/wrappedfontconfig.c
+++ b/src/wrapped/wrappedfontconfig.c
diff --git a/src/wrapped/wrappedfontconfig_private.h b/src/wrapped/wrappedfontconfig_private.h
index bd61dfb..055db1b 100755..100644
--- a/src/wrapped/wrappedfontconfig_private.h
+++ b/src/wrapped/wrappedfontconfig_private.h
@@ -7,126 +7,126 @@ GO(FcAtomicDeleteNew, vFp)
GO(FcAtomicDestroy, vFp)
GO(FcAtomicLock, iFp)
//GO(FcAtomicNewFile,
-//GO(FcAtomicOrigFile,
-//GO(FcAtomicReplaceOrig,
+GO(FcAtomicOrigFile, pFp)
+GO(FcAtomicReplaceOrig, iFp)
//GO(FcAtomicUnlock,
//GO(FcBlanksAdd,
-//GO(FcBlanksCreate,
-//GO(FcBlanksDestroy,
-//GO(FcBlanksIsMember,
+GO(FcBlanksCreate, pFv)
+GO(FcBlanksDestroy, vFp)
+GO(FcBlanksIsMember, iFpu)
GO(FcCacheCopySet, pFp)
-//GO(FcCacheDir,
-//GO(FcCacheNumFont,
+GO(FcCacheDir, pFp)
+GO(FcCacheNumFont, iFp)
GO(FcCacheNumSubdir, iFp)
GO(FcCacheSubdir, pFpi)
GO(FcCharSetAddChar, iFpu)
GO(FcCharSetCopy, pFp)
-//GO(FcCharSetCount,
-//GO(FcCharSetCoverage,
+GO(FcCharSetCount, uFp)
+GO(FcCharSetCoverage, uFpup)
GO(FcCharSetCreate, pFv)
GO(FcCharSetDestroy, vFp)
//GO(FcCharSetEqual,
GO(FcCharSetFirstPage, iFppp) // second p is a fixed sized array
-GO(FcCharSetHasChar, iFpi)
+GO(FcCharSetHasChar, iFpu)
//GO(FcCharSetIntersect,
//GO(FcCharSetIntersectCount,
-//GO(FcCharSetIsSubset,
-//GO(FcCharSetMerge,
-//GO(FcCharSetNew,
-GO(FcCharSetNextPage, iFppp) // second p is a fixed sized array
+GO(FcCharSetIsSubset, iFpp)
+GO(FcCharSetMerge, iFppp)
+GO(FcCharSetNew, pFv)
+GO(FcCharSetNextPage, uFppp)
GO(FcCharSetSubtract, pFpp)
-//GO(FcCharSetSubtractCount,
+GO(FcCharSetSubtractCount, uFpp)
GO(FcCharSetUnion, pFpp)
GO(FcConfigAppFontAddDir, iFpp)
GO(FcConfigAppFontAddFile, iFpp)
GO(FcConfigAppFontClear, vFp)
-//GO(FcConfigBuildFonts,
+GO(FcConfigBuildFonts, iFp)
//GO(FcConfigCreate,
GO(FcConfigDestroy, vFp)
-//GO(FcConfigEnableHome,
+GO(FcConfigEnableHome, iFi)
//GO(FcConfigFilename,
GO(FcConfigGetBlanks, pFp)
-//GO(FcConfigGetCache,
-//GO(FcConfigGetCacheDirs,
+GO(FcConfigGetCache, pFp)
+GO(FcConfigGetCacheDirs, pFp)
//GO(FcConfigGetConfigDirs,
//GO(FcConfigGetConfigFiles,
GO(FcConfigGetCurrent, pFv)
GO(FcConfigGetFontDirs, pFp)
-GO(FcConfigGetFonts, pFpi)
-//GO(FcConfigGetRescanInterval,
+GO(FcConfigGetFonts, pFpu)
+GO(FcConfigGetRescanInterval, iFp)
//GO(FcConfigGetRescanInverval,
GO(FcConfigGetSysRoot, pFp)
-//GO(FcConfigHome,
+GO(FcConfigHome, pFv)
//GO(FcConfigParseAndLoad,
GO(FcConfigReference, pFp)
//GO(FcConfigSetCurrent,
-//GO(FcConfigSetRescanInterval,
+GO(FcConfigSetRescanInterval, iFpi)
//GO(FcConfigSetRescanInverval,
-GO(FcConfigSubstitute, iFppi)
-GO(FcConfigSubstituteWithPat, iFpppi)
+GO(FcConfigSubstitute, iFppu)
+GO(FcConfigSubstituteWithPat, iFpppu)
//GO(FcConfigUptoDate,
GO(FcDefaultSubstitute, vFp)
-//GO(FcDirCacheLoad,
-//GO(FcDirCacheLoadFile,
+GO(FcDirCacheLoad, pFppp)
+GO(FcDirCacheLoadFile, pFpp)
GO(FcDirCacheRead, pFpip)
//GO(FcDirCacheUnlink,
GO(FcDirCacheUnload, vFp)
//GO(FcDirCacheValid,
-//GO(FcDirSave,
-//GO(FcDirScan,
-//GO(FcFileIsDir,
+GO(FcDirSave, iFppp)
+GO(FcDirScan, iFpppppi)
+GO(FcFileIsDir, iFp)
//GO(FcFileScan,
-//GO(FcFini,
+GO(FcFini, vFv)
GO(FcFontList, pFppp)
GO(FcFontMatch, pFppp)
GO(FcFontRenderPrepare, pFppp)
GO(FcFontSetAdd, iFpp)
GO(FcFontSetCreate, pFv)
GO(FcFontSetDestroy, vFp)
-//GO(FcFontSetList,
-//GO(FcFontSetMatch,
-//GO(FcFontSetPrint,
-//GO(FcFontSetSort,
-//GO(FcFontSetSortDestroy,
+GO(FcFontSetList, pFppipp)
+GO(FcFontSetMatch, pFppipp)
+GO(FcFontSetPrint, vFp)
+GO(FcFontSetSort, pFppipipp)
+GO(FcFontSetSortDestroy, vFp)
GO(FcFontSort, pFppipp)
//GO(FcFreeTypeCharIndex,
//GO(FcFreeTypeCharSet,
//GO(FcFreeTypeCharSetAndSpacing,
-GO(FcFreeTypeQuery, pFpipp)
+GO(FcFreeTypeQuery, pFpupp)
GO(FcFreeTypeQueryFace, pFppip)
//GO(FcGetLangs,
GO(FcGetVersion, iFv)
GO(FcInit, iFv)
-//GO(FcInitBringUptoDate,
+GO(FcInitBringUptoDate, iFv)
//GO(FcInitLoadConfig,
-//GO(FcInitLoadConfigAndFonts,
+GO(FcInitLoadConfigAndFonts, pFv)
GO(FcInitReinitialize, iFv)
-//GO(FcLangGetCharSet,
+GO(FcLangGetCharSet, pFp)
GO(FcLangSetAdd, iFpp)
-//GO(FcLangSetCompare,
+GO(FcLangSetCompare, uFpp)
//GO(FcLangSetContains,
-//GO(FcLangSetCopy,
+GO(FcLangSetCopy, pFp)
GO(FcLangSetCreate, pFv)
GO(FcLangSetDestroy, vFp)
-//GO(FcLangSetEqual,
-//GO(FcLangSetGetLangs,
-//GO(FcLangSetHash,
-GO(FcLangSetHasLang, iFpp)
-//GO(FcMatrixCopy,
-//GO(FcMatrixEqual,
-//GO(FcMatrixMultiply,
+GO(FcLangSetEqual, iFpp)
+GO(FcLangSetGetLangs, pFp)
+GO(FcLangSetHash, uFp)
+GO(FcLangSetHasLang, uFpp)
+GO(FcMatrixCopy, pFp)
+GO(FcMatrixEqual, iFpp)
+GO(FcMatrixMultiply, vFppp)
//GO(FcMatrixRotate,
//GO(FcMatrixScale,
-//GO(FcMatrixShear,
+GO(FcMatrixShear, vFpdd)
GO(FcNameConstant, iFpp)
-//GO(FcNameGetConstant,
-//GO(FcNameGetObjectType,
-//GO(FcNameParse,
+GO(FcNameGetConstant, pFp)
+GO(FcNameGetObjectType, pFp)
+GO(FcNameParse, pFp)
//GO(FcNameRegisterConstants,
//GO(FcNameRegisterObjectTypes,
-//GO(FcNameUnparse,
-//GO(FcNameUnregisterConstants,
-//GO(FcNameUnregisterObjectTypes,
+GO(FcNameUnparse, pFp)
+GO(FcNameUnregisterConstants, iFpi)
+GO(FcNameUnregisterObjectTypes, iFpi)
GO(FcObjectSetAdd, iFpp)
GOM(FcObjectSetBuild, pFEpV)
GO(FcObjectSetCreate, pFv)
@@ -148,21 +148,21 @@ GO(FcPatternDel, iFpp)
GO(FcPatternDestroy, vFp)
GO(FcPatternDuplicate, pFp)
GO(FcPatternEqual, iFpp)
-//GO(FcPatternEqualSubset,
-//GO(FcPatternFilter,
-//GO(FcPatternFormat,
-GO(FcPatternGet, iFppip)
-GO(FcPatternGetBool, iFppip)
-GO(FcPatternGetCharSet, iFppip)
-GO(FcPatternGetDouble, iFppip)
+GO(FcPatternEqualSubset, iFppp)
+GO(FcPatternFilter, pFpp)
+GO(FcPatternFormat, pFpp)
+GO(FcPatternGet, uFppip)
+GO(FcPatternGetBool, uFppip)
+GO(FcPatternGetCharSet, uFppip)
+GO(FcPatternGetDouble, uFppip)
GO(FcPatternGetFTFace, iFppip)
-GO(FcPatternGetInteger, iFppip)
-GO(FcPatternGetLangSet, iFppip)
-GO(FcPatternGetMatrix, iFppip)
-GO(FcPatternGetString, iFppip)
-GO(FcPatternHash, iFp)
-//GO(FcPatternPrint,
-//GO(FcPatternReference,
+GO(FcPatternGetInteger, uFppip)
+GO(FcPatternGetLangSet, uFppip)
+GO(FcPatternGetMatrix, uFppip)
+GO(FcPatternGetString, uFppip)
+GO(FcPatternHash, uFp)
+GO(FcPatternPrint, vFp)
+GO(FcPatternReference, vFp)
//GO(FcPatternRemove,
GO(FcPatternVaBuild, pFpp)
GO(FcStrBasename, pFp)
@@ -188,8 +188,8 @@ GO(FcStrSetMember, iFpp)
GO(FcStrStr, pFpp)
GO(FcStrStrIgnoreCase, pFpp)
GO(FcUcs4ToUtf8, iFup)
-GO(FcUtf16Len, iFpipp)
-GO(FcUtf16ToUcs4, iFpipi)
+GO(FcUtf16Len, iFpuipp)
+GO(FcUtf16ToUcs4, iFpupi)
GO(FcUtf8Len, iFpipp)
GO(FcUtf8ToUcs4, iFppi)
//GO(FcValueDestroy,
diff --git a/src/wrapped/wrappedfreetype.c b/src/wrapped/wrappedfreetype.c
index aacad27..4ced9be 100755..100644
--- a/src/wrapped/wrappedfreetype.c
+++ b/src/wrapped/wrappedfreetype.c
@@ -133,10 +133,10 @@ GO(4)
// FT_Generic_Finalizer
#define GO(A) \
-static uintptr_t my_FT_Generic_Finalizer_fct_##A = 0; \
-static void my_FT_Generic_Finalizer_##A(void* object) \
-{ \
- RunFunction(my_context, my_FT_Generic_Finalizer_fct_##A, 1, object); \
+static uintptr_t my_FT_Generic_Finalizer_fct_##A = 0; \
+static void my_FT_Generic_Finalizer_##A(void* object) \
+{ \
+ RunFunctionFmt(my_FT_Generic_Finalizer_fct_##A, "p", object); \
}
SUPER()
#undef GO
@@ -156,15 +156,15 @@ static void* find_FT_Generic_Finalizer_Fct(void* fct)
}
// FTC_Face_Requester
#define GO(A) \
-static uintptr_t my_FTC_Face_Requester_fct_##A = 0; \
-static int my_FTC_Face_Requester_##A(void* face_id, void* lib, void* req, void* aface) \
-{ \
- int ret = (int)RunFunction(my_context, my_FTC_Face_Requester_fct_##A, 4, face_id, lib, req, aface); \
- if(aface && *(void**)aface) { \
- FT_FaceRec_t *f = *(FT_FaceRec_t**)aface; \
- f->generic.finalizer = find_FT_Generic_Finalizer_Fct(f->generic.finalizer); \
- } \
- return ret; \
+static uintptr_t my_FTC_Face_Requester_fct_##A = 0; \
+static int my_FTC_Face_Requester_##A(void* face_id, void* lib, void* req, void* aface) \
+{ \
+ int ret = (int)RunFunctionFmt(my_FTC_Face_Requester_fct_##A, "pppp", face_id, lib, req, aface); \
+ if(aface && *(void**)aface) { \
+ FT_FaceRec_t *f = *(FT_FaceRec_t**)aface; \
+ f->generic.finalizer = find_FT_Generic_Finalizer_Fct(f->generic.finalizer); \
+ } \
+ return ret; \
}
SUPER()
#undef GO
@@ -184,10 +184,10 @@ static void* find_FTC_Face_Requester_Fct(void* fct)
}
// FT_Alloc
#define GO(A) \
-static uintptr_t my_FT_Alloc_fct_##A = 0; \
-static void* my_FT_Alloc_##A(void* memory, long size) \
-{ \
- return (void*)RunFunction(my_context, my_FT_Alloc_fct_##A, 2, memory, size);\
+static uintptr_t my_FT_Alloc_fct_##A = 0; \
+static void* my_FT_Alloc_##A(void* memory, long size) \
+{ \
+ return (void*)RunFunctionFmt(my_FT_Alloc_fct_##A, "pl", memory, size); \
}
SUPER()
#undef GO
@@ -207,10 +207,10 @@ static void* find_FT_Alloc_Fct(void* fct)
}
// FT_Free
#define GO(A) \
-static uintptr_t my_FT_Free_fct_##A = 0; \
-static void my_FT_Free_##A(void* memory, void* p) \
-{ \
- RunFunction(my_context, my_FT_Free_fct_##A, 2, memory, p); \
+static uintptr_t my_FT_Free_fct_##A = 0; \
+static void my_FT_Free_##A(void* memory, void* p) \
+{ \
+ RunFunctionFmt(my_FT_Free_fct_##A, "pp", memory, p); \
}
SUPER()
#undef GO
@@ -230,10 +230,10 @@ static void* find_FT_Free_Fct(void* fct)
}
// FT_Realloc
#define GO(A) \
-static uintptr_t my_FT_Realloc_fct_##A = 0; \
-static void* my_FT_Realloc_##A(void* memory, long cur, long size, void* p) \
-{ \
- return (void*)RunFunction(my_context, my_FT_Realloc_fct_##A, 4, memory, cur, size, p); \
+static uintptr_t my_FT_Realloc_fct_##A = 0; \
+static void* my_FT_Realloc_##A(void* memory, long cur, long size, void* p) \
+{ \
+ return (void*)RunFunctionFmt(my_FT_Realloc_fct_##A, "pllp", memory, cur, size, p); \
}
SUPER()
#undef GO
@@ -253,10 +253,10 @@ static void* find_FT_Realloc_Fct(void* fct)
}
// FT_Outline_MoveToFunc
#define GO(A) \
-static uintptr_t my_FT_Outline_MoveToFunc_fct_##A = 0; \
-static int my_FT_Outline_MoveToFunc_##A(void* to, void* user) \
-{ \
- return (int)RunFunction(my_context, my_FT_Outline_MoveToFunc_fct_##A, 2, to, user); \
+static uintptr_t my_FT_Outline_MoveToFunc_fct_##A = 0; \
+static int my_FT_Outline_MoveToFunc_##A(void* to, void* user) \
+{ \
+ return (int)RunFunctionFmt(my_FT_Outline_MoveToFunc_fct_##A, "pp", to, user); \
}
SUPER()
#undef GO
@@ -277,10 +277,10 @@ static void* find_FT_Outline_MoveToFunc_Fct(void* fct)
// FT_Outline_LineToFunc
#define GO(A) \
-static uintptr_t my_FT_Outline_LineToFunc_fct_##A = 0; \
-static int my_FT_Outline_LineToFunc_##A(void* to, void* user) \
-{ \
- return (int)RunFunction(my_context, my_FT_Outline_LineToFunc_fct_##A, 2, to, user); \
+static uintptr_t my_FT_Outline_LineToFunc_fct_##A = 0; \
+static int my_FT_Outline_LineToFunc_##A(void* to, void* user) \
+{ \
+ return (int)RunFunctionFmt(my_FT_Outline_LineToFunc_fct_##A, "pp", to, user); \
}
SUPER()
#undef GO
@@ -301,10 +301,10 @@ static void* find_FT_Outline_LineToFunc_Fct(void* fct)
// FT_Outline_ConicToFunc
#define GO(A) \
-static uintptr_t my_FT_Outline_ConicToFunc_fct_##A = 0; \
-static int my_FT_Outline_ConicToFunc_##A(void* ctl, void* to, void* user) \
-{ \
- return (int)RunFunction(my_context, my_FT_Outline_ConicToFunc_fct_##A, 3, ctl, to, user); \
+static uintptr_t my_FT_Outline_ConicToFunc_fct_##A = 0; \
+static int my_FT_Outline_ConicToFunc_##A(void* ctl, void* to, void* user) \
+{ \
+ return (int)RunFunctionFmt(my_FT_Outline_ConicToFunc_fct_##A, "ppp", ctl, to, user); \
}
SUPER()
#undef GO
@@ -325,10 +325,10 @@ static void* find_FT_Outline_ConicToFunc_Fct(void* fct)
// FT_Outline_CubicToFunc
#define GO(A) \
-static uintptr_t my_FT_Outline_CubicToFunc_fct_##A = 0; \
-static int my_FT_Outline_CubicToFunc_##A(void* ctl1, void* ctl2, void* to, void* user) \
-{ \
- return (int)RunFunction(my_context, my_FT_Outline_CubicToFunc_fct_##A, 4, ctl1, ctl2, to, user); \
+static uintptr_t my_FT_Outline_CubicToFunc_fct_##A = 0; \
+static int my_FT_Outline_CubicToFunc_##A(void* ctl1, void* ctl2, void* to, void* user) \
+{ \
+ return (int)RunFunctionFmt(my_FT_Outline_CubicToFunc_fct_##A, "pppp", ctl1, ctl2, to, user); \
}
SUPER()
#undef GO
@@ -378,13 +378,13 @@ static FT_MemoryRec_t* find_FT_MemoryRec_Struct(FT_MemoryRec_t* s)
static uintptr_t my_iofunc = 0;
static unsigned long my_FT_Stream_IoFunc(FT_StreamRec_t* stream, unsigned long offset, unsigned char* buffer, unsigned long count )
{
- return (unsigned long)RunFunction(my_context, my_iofunc, 4, stream, offset, buffer, count);
+ return (unsigned long)RunFunctionFmt(my_iofunc, "pLpL", stream, offset, buffer, count) ;
}
static uintptr_t my_closefunc = 0;
static void my_FT_Stream_CloseFunc(FT_StreamRec_t* stream)
{
- RunFunction(my_context, my_closefunc, 1, stream);
+ RunFunctionFmt(my_closefunc, "p", stream) ;
}
EXPORT int my_FT_Open_Face(x64emu_t* emu, void* library, FT_Open_Args_t* args, long face_index, void* aface)
diff --git a/src/wrapped/wrappedfreetype_private.h b/src/wrapped/wrappedfreetype_private.h
index c7c854e..4095693 100755..100644
--- a/src/wrapped/wrappedfreetype_private.h
+++ b/src/wrapped/wrappedfreetype_private.h
@@ -19,27 +19,32 @@ GO(FT_Bitmap_New, vFp)
//GO(FT_ClassicKern_Free,
//GO(FT_ClassicKern_Validate,
GO(FT_Cos, lFl)
-//GO(FT_DivFix,
+GO(FT_DivFix, lFll)
GO(FT_Done_Face, iFp)
GO(FT_Done_FreeType, iFp)
GO(FT_Done_Glyph, vFp)
GO(FT_Done_Library, iFp)
+GO(FT_Done_MM_Var, iFpp)
GO(FT_Done_Size, iFp)
//GO(FT_Face_CheckTrueTypePatents,
//GO(FT_Face_GetCharsOfVariant,
-//GO(FT_Face_GetCharVariantIndex,
+GO(FT_Face_GetCharVariantIndex, uFpuu)
//GO(FT_Face_GetCharVariantIsDefault,
//GO(FT_Face_GetVariantSelectors,
//GO(FT_Face_GetVariantsOfChar,
GO(FT_Face_Properties, iFpup)
//GO(FT_Face_SetUnpatentedHinting,
-//GO(FT_FloorFix,
+GO(FT_FloorFix, lFl)
GO(FT_Get_Advance, iFpiup)
GO(FT_Get_Advances, iFpuuip)
//GO(FT_Get_BDF_Charset_ID,
//GO(FT_Get_BDF_Property,
GO(FT_Get_Char_Index, uFpL)
GO(FT_Get_Charmap_Index, iFp)
+GO(FT_Get_Color_Glyph_Layer, iFpupp)
+GO(FT_Get_Color_Glyph_Paint, iFpuip)
+GO(FT_Get_Color_Glyph_ClipBox, iFpup)
+GO(FT_Get_Colorline_Stops, iFppp)
//GO(FT_Get_CID_From_Glyph_Index,
//GO(FT_Get_CID_Is_Internally_CID_Keyed,
//GO(FT_Get_CID_Registry_Ordering_Supplement,
@@ -54,10 +59,12 @@ GO(FT_Get_Glyph_Name, iFpupu)
GO(FT_Get_Kerning, iFpuuup)
//GO(FT_Get_MM_Blend_Coordinates,
GO(FT_Get_MM_Var, iFpp)
-//GO(FT_Get_Module,
+GO(FT_Get_Module, pFpp)
//GO(FT_Get_Multi_Master,
GO(FT_Get_Name_Index, uFpp)
GO(FT_Get_Next_Char, LFpLp)
+GO(FT_Get_Paint, iFppip) // FT_OpaquePaint is a struct with "pi"
+GO(FT_Get_Paint_Layers, iFppp)
//GO(FT_Get_PFR_Advance,
//GO(FT_Get_PFR_Kerning,
//GO(FT_Get_PFR_Metrics,
@@ -65,15 +72,16 @@ GO(FT_Get_Postscript_Name, pFp)
GO(FT_Get_PS_Font_Info, iFpp)
//GO(FT_Get_PS_Font_Private,
//GO(FT_Get_PS_Font_Value,
-//GO(FT_Get_Renderer,
+GO(FT_Get_Renderer, pFpu)
//GO(FT_Get_Sfnt_LangTag,
GO(FT_Get_Sfnt_Name, iFpip)
GO(FT_Get_Sfnt_Name_Count, uFp)
GO(FT_Get_Sfnt_Table, pFpi)
GO(FT_Get_SubGlyph_Info, iFpuppppp)
GO(FT_Get_Track_Kerning, iFplip)
-GO(FT_Get_TrueType_Engine_Type, iFp)
-//GO(FT_Get_Var_Blend_Coordinates,
+GO(FT_Get_Transform, vFppp)
+GO(FT_Get_TrueType_Engine_Type, uFp)
+GO(FT_Get_Var_Blend_Coordinates, iFpup)
//GO(FT_Get_Var_Design_Coordinates,
GO(FT_Get_WinFNT_Header, iFpp) // does FT_WinFNT_HeaderRec_ needs alignment?
GO(FT_Get_X11_Font_Format, pFp)
@@ -82,23 +90,23 @@ GO(FT_Glyph_Get_CBox, vFpup)
GO(FT_GlyphSlot_Embolden, vFp)
GO(FT_GlyphSlot_Oblique, vFp)
GO(FT_GlyphSlot_Own_Bitmap, iFp)
-GO(FT_Glyph_Stroke, iFppi)
+GO(FT_Glyph_Stroke, iFppC)
GO(FT_Glyph_StrokeBorder, iFppCC)
-GO(FT_Glyph_To_Bitmap, iFpipC)
+GO(FT_Glyph_To_Bitmap, iFpupC)
GO(FT_Glyph_Transform, iFppp)
//GO(FT_Gzip_Uncompress,
//GO(FT_Has_PS_Glyph_Names,
GO(FT_Init_FreeType, iFp)
-GO(FT_Library_SetLcdFilter, iFpi)
+GO(FT_Library_SetLcdFilter, iFpu)
GO(FT_Library_SetLcdFilterWeights, iFpp)
GO(FT_Library_Version, vFpppp)
//GO(FT_List_Add,
//GO(FT_List_Finalize,
-//GO(FT_List_Find,
+GO(FT_List_Find, pFpp)
//GO(FT_List_Insert,
//GO(FT_List_Iterate,
//GO(FT_List_Remove,
-//GO(FT_List_Up,
+GO(FT_List_Up, vFpp)
GO(FT_Load_Char, iFpLi)
GO(FT_Load_Glyph, iFpui)
GO(FT_Load_Sfnt_Table, iFpLlpp)
@@ -124,20 +132,21 @@ GO(FT_Outline_Get_BBox, iFpp)
GO(FT_Outline_Get_Bitmap, iFppp)
GO(FT_Outline_Get_CBox, vFpp)
//GO(FT_Outline_GetInsideBorder,
-//GO(FT_Outline_Get_Orientation,
-//GO(FT_Outline_GetOutsideBorder,
+GO(FT_Outline_Get_Orientation, uFp)
+GO(FT_Outline_GetOutsideBorder, uFp)
GO(FT_Outline_New, iFpuip)
//GO(FT_Outline_New_Internal,
GO(FT_Outline_Render, iFppp)
GO(FT_Outline_Reverse, vFp)
GO(FT_Outline_Transform, vFpp)
GO(FT_Outline_Translate, vFpll)
+GO(FT_Palette_Select, iFpWp)
GO(FT_Property_Get, iFpppp)
GO(FT_Property_Set, iFpppp)
GO(FT_Reference_Face, iFp)
//GO(FT_Reference_Library,
-//GO(FT_Remove_Module,
-GO(FT_Render_Glyph, iFpi)
+GO(FT_Remove_Module, iFpp)
+GO(FT_Render_Glyph, iFpu)
GO(FT_Request_Size, iFpp)
//GO(FT_RoundFix,
GO(FT_Select_Charmap, iFpi)
@@ -147,13 +156,13 @@ GO(FT_Set_Char_Size, iFplluu)
//GO(FT_Set_Debug_Hook,
//GO(FT_Set_Default_Properties,
//GO(FT_Set_MM_Blend_Coordinates,
-//GO(FT_Set_MM_Design_Coordinates,
+GO(FT_Set_MM_Design_Coordinates, iFpup)
GO(FT_Set_Pixel_Sizes, iFpuu)
-//GO(FT_Set_Renderer,
+GO(FT_Set_Renderer, iFppup)
GO(FT_Set_Transform, vFppp)
//GO(FT_Set_Var_Blend_Coordinates,
-//GO(FT_Set_Var_Design_Coordinates,
-//GO(FT_Sfnt_Table_Info,
+GO(FT_Set_Var_Design_Coordinates, iFpup)
+GO(FT_Sfnt_Table_Info, iFpupp)
GO(FT_Sin, lFl)
//GO(FT_Stream_OpenBzip2,
//GO(FT_Stream_OpenGzip,
@@ -164,14 +173,14 @@ GO(FT_Stroker_CubicTo, iFpppp)
GO(FT_Stroker_Done, vFp)
GO(FT_Stroker_EndSubPath, iFp)
GO(FT_Stroker_Export, vFpp)
-GO(FT_Stroker_ExportBorder, vFpip)
-GO(FT_Stroker_GetBorderCounts, iFpipp)
+GO(FT_Stroker_ExportBorder, vFpup)
+GO(FT_Stroker_GetBorderCounts, iFpupp)
GO(FT_Stroker_GetCounts, iFppp)
GO(FT_Stroker_LineTo, iFpp)
GO(FT_Stroker_New, iFpp)
GO(FT_Stroker_ParseOutline, iFppC)
GO(FT_Stroker_Rewind, vFp)
-GO(FT_Stroker_Set, vFpliil)
+GO(FT_Stroker_Set, vFpluul)
GO(FT_Tan, lFl)
//GO(FT_TrueTypeGX_Free,
//GO(FT_TrueTypeGX_Validate,
diff --git a/src/wrapped/wrappedgconf2.c b/src/wrapped/wrappedgconf2.c
index 59f47d9..ec651e6 100644
--- a/src/wrapped/wrappedgconf2.c
+++ b/src/wrapped/wrappedgconf2.c
@@ -22,10 +22,77 @@
const char* gconf2Name = "libgconf-2.so.4";
#define LIBNAME gconf2
+#include "generated/wrappedgconf2types.h"
+
+#include "wrappercallback.h"
+
+#define SUPER() \
+GO(0) \
+GO(1) \
+GO(2) \
+GO(3)
+
+// GFreeFct
+#define GO(A) \
+static uintptr_t my_GFreeFct_fct_##A = 0; \
+static void my_GFreeFct_##A(void* a) \
+{ \
+ RunFunctionFmt(my_GFreeFct_fct_##A, "p", a); \
+}
+SUPER()
+#undef GO
+static void* findGFreeFctFct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_GFreeFct_fct_##A == (uintptr_t)fct) return my_GFreeFct_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GFreeFct_fct_##A == 0) {my_GFreeFct_fct_##A = (uintptr_t)fct; return my_GFreeFct_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for gconf2 GFreeFct callback\n");
+ return NULL;
+}
+// GConfClientNotifyFunc
+#define GO(A) \
+static uintptr_t my_GConfClientNotifyFunc_fct_##A = 0; \
+static void my_GConfClientNotifyFunc_##A(void* a, uint32_t b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_GConfClientNotifyFunc_fct_##A, "pupp", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* findGConfClientNotifyFuncFct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_GConfClientNotifyFunc_fct_##A == (uintptr_t)fct) return my_GConfClientNotifyFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GConfClientNotifyFunc_fct_##A == 0) {my_GConfClientNotifyFunc_fct_##A = (uintptr_t)fct; return my_GConfClientNotifyFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for gconf2 GConfClientNotifyFunc callback\n");
+ return NULL;
+}
+
+#undef SUPER
+
+EXPORT uint32_t my_gconf_client_notify_add(x64emu_t* emu, void* client, void* section, void* f, void* data, void* d, void* error)
+{
+ return my->gconf_client_notify_add(client, section, findGConfClientNotifyFuncFct(f), data, findGFreeFctFct(d), error);
+}
#define PRE_INIT \
if(box64_nogtk) \
return -1;
+#define CUSTOM_INIT \
+ getMy(lib); \
+
+#define CUSTOM_FINI \
+ freeMy();
+
#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedgconf2_private.h b/src/wrapped/wrappedgconf2_private.h
index 7b2cbac..b89d684 100644
--- a/src/wrapped/wrappedgconf2_private.h
+++ b/src/wrapped/wrappedgconf2_private.h
@@ -34,7 +34,7 @@
//GO(gconf_change_set_unref,
//GO(gconf_change_set_unset,
//GO(gconf_clear_cache,
-//GO(gconf_client_add_dir,
+GO(gconf_client_add_dir, vFppip)
//GO(gconf_client_all_dirs,
//GO(gconf_client_all_entries,
//GO(gconf_client_change_set_from_current,
@@ -43,29 +43,29 @@
//GO(gconf_client_commit_change_set,
//GO(gconf_client_dir_exists,
//GO(gconf_client_error,
-//GO(gconf_client_error_handling_mode_get_type,
-//GO(gconf_client_get,
+GO(gconf_client_error_handling_mode_get_type, LFv)
+GO(gconf_client_get, pFppp)
//GO(gconf_client_get_bool,
-//GO(gconf_client_get_default,
+GO(gconf_client_get_default, pFv)
//GO(gconf_client_get_default_from_schema,
//GO(gconf_client_get_entry,
//GO(gconf_client_get_float,
//GO(gconf_client_get_for_engine,
-//GO(gconf_client_get_int,
-//GO(gconf_client_get_list,
+GO(gconf_client_get_int, iFppp)
+GO(gconf_client_get_list, pFppip)
//GO(gconf_client_get_pair,
//GO(gconf_client_get_schema,
-//GO(gconf_client_get_string,
+GO(gconf_client_get_string, pFppp)
//GO(gconf_client_get_type,
//GO(gconf_client_get_without_default,
//GO(gconf_client_key_is_writable,
//GO(gconf_client_notify,
-//GO(gconf_client_notify_add,
-//GO(gconf_client_notify_remove,
+GOM(gconf_client_notify_add, uFEpppppp)
+GO(gconf_client_notify_remove, vFpu)
//GO(gconf_client_preload,
//GO(gconf_client_preload_type_get_type,
//GO(gconf_client_recursive_unset,
-//GO(gconf_client_remove_dir,
+GO(gconf_client_remove_dir, vFppp)
//GO(gconf_client_reverse_change_set,
//GO(gconf_client_set,
//GO(gconf_client_set_bool,
@@ -82,7 +82,7 @@
//GO(gconf_client_unset,
//GO(gconf_client_value_changed,
//GO(gconf_compose_errors,
-//GO(gconf_concat_dir_and_key,
+GO(gconf_concat_dir_and_key, pFpp)
//GO(gconf_current_locale,
//GO(gconf_dbus_utils_append_entries,
//GO(gconf_dbus_utils_append_entry_values,
@@ -90,9 +90,9 @@
//GO(gconf_dbus_utils_get_entries,
//GO(gconf_dbus_utils_get_entry_values,
//GO(gconf_dbus_utils_get_value,
-//GO(gconf_debug_shutdown,
+GO(gconf_debug_shutdown, iFv)
//GO(gconf_double_to_string,
-//GO(gconf_engine_all_dirs,
+GO(gconf_engine_all_dirs, pFppp)
//GO(gconf_engine_all_entries,
//GO(gconf_engine_associate_schema,
//GO(gconf_engine_change_set_from_current,
@@ -100,80 +100,80 @@
//GO(gconf_engine_commit_change_set,
//GO(gconf_engine_dir_exists,
//GO(gconf_engine_get,
-//GO(gconf_engine_get_bool,
-//GO(gconf_engine_get_default,
-//GO(gconf_engine_get_default_from_schema,
-//GO(gconf_engine_get_entry,
-//GO(gconf_engine_get_float,
-//GO(gconf_engine_get_for_address,
-//GO(gconf_engine_get_for_addresses,
+GO(gconf_engine_get_bool, iFppp)
+GO(gconf_engine_get_default, pFv)
+GO(gconf_engine_get_default_from_schema, pFppp)
+GO(gconf_engine_get_entry, pFpppip)
+GO(gconf_engine_get_float, dFppp)
+GO(gconf_engine_get_for_address, pFpp)
+GO(gconf_engine_get_for_addresses, pFpp)
//GO(gconf_engine_get_full,
//GO(gconf_engine_get_fuller,
-//GO(gconf_engine_get_int,
-//GO(gconf_engine_get_list,
+GO(gconf_engine_get_int, iFppp)
+GO(gconf_engine_get_list, pFppup)
//GO(gconf_engine_get_local,
//GO(gconf_engine_get_local_for_addresses,
-//GO(gconf_engine_get_pair,
-//GO(gconf_engine_get_schema,
-//GO(gconf_engine_get_string,
-//GO(gconf_engine_get_user_data,
-//GO(gconf_engine_get_with_locale,
+GO(gconf_engine_get_pair, iFppuuppp)
+GO(gconf_engine_get_schema, pFppp)
+GO(gconf_engine_get_string, pFppp)
+GO(gconf_engine_get_user_data, pFp)
+GO(gconf_engine_get_with_locale, pFpppp)
//GO(gconf_engine_get_without_default,
//GO(gconf_engine_key_is_writable,
//GO(gconf_engine_notify_add,
-//GO(gconf_engine_notify_remove,
+GO(gconf_engine_notify_remove, vFpu)
//GO(gconf_engine_pop_owner_usage,
//GO(gconf_engine_push_owner_usage,
//GO(gconf_engine_recursive_unset,
-//GO(gconf_engine_ref,
-//GO(gconf_engine_remove_dir,
+GO(gconf_engine_ref, vFp)
+GO(gconf_engine_remove_dir, vFppp)
//GO(gconf_engine_reverse_change_set,
-//GO(gconf_engine_set,
-//GO(gconf_engine_set_bool,
-//GO(gconf_engine_set_float,
-//GO(gconf_engine_set_int,
-//GO(gconf_engine_set_list,
+GO(gconf_engine_set, iFpppp)
+GO(gconf_engine_set_bool, iFppip)
+GO(gconf_engine_set_float, iFppdp)
+GO(gconf_engine_set_int, iFppip)
+GO(gconf_engine_set_list, iFppupp)
//GO(gconf_engine_set_owner,
-//GO(gconf_engine_set_pair,
-//GO(gconf_engine_set_schema,
-//GO(gconf_engine_set_string,
+GO(gconf_engine_set_pair, iFppuuppp)
+GO(gconf_engine_set_schema, iFpppp)
+GO(gconf_engine_set_string, iFpppp)
//GO(gconf_engine_set_user_data,
-//GO(gconf_engine_suggest_sync,
+GO(gconf_engine_suggest_sync, vFpp)
//GO(gconf_engine_unref,
//GO(gconf_engine_unset,
-//GO(gconf_entry_copy,
-//GO(gconf_entry_equal,
+GO(gconf_entry_copy, pFp)
+GO(gconf_entry_equal, iFpp)
//GO(gconf_entry_free,
//GO(gconf_entry_get_is_default,
-//GO(gconf_entry_get_is_writable,
-//GO(gconf_entry_get_key,
-//GO(gconf_entry_get_schema_name,
+GO(gconf_entry_get_is_writable, iFp)
+GO(gconf_entry_get_key, pFp)
+GO(gconf_entry_get_schema_name, pFp)
//GO(gconf_entry_get_type,
-//GO(gconf_entry_get_value,
-//GO(gconf_entry_new,
-//GO(gconf_entry_new_nocopy,
-//GO(gconf_entry_ref,
+GO(gconf_entry_get_value, pFp)
+GO(gconf_entry_new, pFpp)
+GO(gconf_entry_new_nocopy, pFpp)
+GO(gconf_entry_ref, pFp)
//GO(gconf_entry_set_is_default,
-//GO(gconf_entry_set_is_writable,
-//GO(gconf_entry_set_schema_name,
-//GO(gconf_entry_set_value,
-//GO(gconf_entry_set_value_nocopy,
-//GO(gconf_entry_steal_value,
-//GO(gconf_entry_unref,
-//GO(gconf_enum_to_string,
+GO(gconf_entry_set_is_writable, vFpi)
+GO(gconf_entry_set_schema_name, vFpp)
+GO(gconf_entry_set_value, vFpp)
+GO(gconf_entry_set_value_nocopy, vFpp)
+GO(gconf_entry_steal_value, pFp)
+GO(gconf_entry_unref, vFp)
+GO(gconf_enum_to_string, pFpi)
//GO(gconf_error_get_type,
//GO(gconf_error_new,
-//GO(gconf_error_quark,
+GO(gconf_error_quark, uFv)
//GO(gconf_escape_key,
//GO(gconf_get_backend,
//GO(gconf_get_daemon_ior,
//GO(gconf_in_daemon_mode,
-//GO(gconf_init,
+GO(gconf_init, iFipp)
//GO(_gconf_init_i18n,
-//GO(gconf_is_initialized,
+GO(gconf_is_initialized, iFv)
//GO(gconf_key_check,
//GO(gconf_key_directory,
-//GO(gconf_key_is_below,
+GO(gconf_key_is_below, iFpp)
//GO(gconf_key_key,
//GO(gconf_listeners_add,
//GO(gconf_listeners_count,
@@ -194,13 +194,13 @@
//GO(gconf_log,
//DATAB(gconf_log_debug_messages,
//GO(gconf_marshal_VOID__STRING_POINTER,
-//GO(gconf_meta_info_free,
-//GO(gconf_meta_info_get_mod_user,
+GO(gconf_meta_info_free, vFp)
+GO(gconf_meta_info_get_mod_user, pFp)
//GO(gconf_meta_info_get_schema,
-//GO(gconf_meta_info_mod_time,
-//GO(gconf_meta_info_new,
-//GO(gconf_meta_info_set_mod_time,
-//GO(gconf_meta_info_set_mod_user,
+GO(gconf_meta_info_mod_time, iFp)
+GO(gconf_meta_info_new, pFv)
+GO(gconf_meta_info_set_mod_time, vFpi)
+GO(gconf_meta_info_set_mod_user, vFpp)
//GO(gconf_meta_info_set_schema,
//DATAB(gconf_options,
//GO(gconf_persistent_name_get_address_list,
@@ -209,28 +209,28 @@
//GO(gconf_preinit,
//GO(gconf_quote_string,
//GO(gconf_resolve_address,
-//GO(gconf_schema_copy,
-//GO(gconf_schema_free,
+GO(gconf_schema_copy, pFp)
+GO(gconf_schema_free, vFp)
//GO(gconf_schema_get_car_type,
-//GO(gconf_schema_get_cdr_type,
-//GO(gconf_schema_get_default_value,
+GO(gconf_schema_get_cdr_type, uFp)
+GO(gconf_schema_get_default_value, pFp)
//GO(gconf_schema_get_gettext_domain,
//GO(gconf_schema_get_list_type,
//GO(gconf_schema_get_locale,
//GO(gconf_schema_get_long_desc,
-//GO(gconf_schema_get_owner,
+GO(gconf_schema_get_owner, pFp)
//GO(gconf_schema_get_short_desc,
//GO(gconf_schema_get_type,
-//GO(gconf_schema_new,
+GO(gconf_schema_new, pFv)
//GO(gconf_schema_set_car_type,
-//GO(gconf_schema_set_cdr_type,
-//GO(gconf_schema_set_default_value,
-//GO(gconf_schema_set_default_value_nocopy,
+GO(gconf_schema_set_cdr_type, vFpu)
+GO(gconf_schema_set_default_value, vFpp)
+GO(gconf_schema_set_default_value_nocopy, vFpp)
//GO(gconf_schema_set_gettext_domain,
//GO(gconf_schema_set_list_type,
//GO(gconf_schema_set_locale,
//GO(gconf_schema_set_long_desc,
-//GO(gconf_schema_set_owner,
+GO(gconf_schema_set_owner, vFpp)
//GO(gconf_schema_set_short_desc,
//GO(gconf_schema_set_type,
//GO(gconf_schema_steal_default_value,
@@ -264,57 +264,57 @@
//GO(gconf_spawn_daemon,
//GO(gconf_split_locale,
//GO(gconf_string_to_double,
-//GO(gconf_string_to_enum,
+GO(gconf_string_to_enum, iFppp)
//GO(gconf_string_to_gulong,
//GO(gconf_synchronous_sync,
-//GO(gconf_unescape_key,
-//GO(gconf_unique_key,
+GO(gconf_unescape_key, pFpi)
+GO(gconf_unique_key, pFv)
//GO(gconf_unquote_string,
//GO(gconf_unquote_string_inplace,
//GO(gconf_unset_flags_get_type,
//GO(gconf_use_local_locks,
-//GO(gconf_valid_key,
-//GO(gconf_value_compare,
-//GO(gconf_value_copy,
-//GO(gconf_value_decode,
-//GO(gconf_value_encode,
-//GO(gconf_value_free,
-//GO(gconf_value_get_bool,
+GO(gconf_valid_key, iFpp)
+GO(gconf_value_compare, iFpp)
+GO(gconf_value_copy, pFp)
+GO(gconf_value_decode, pFp)
+GO(gconf_value_encode, pFp)
+GO(gconf_value_free, vFp)
+GO(gconf_value_get_bool, iFp)
//GO(gconf_value_get_car,
//GO(gconf_value_get_cdr,
-//GO(gconf_value_get_float,
-//GO(gconf_value_get_int,
-//GO(gconf_value_get_list,
-//GO(gconf_value_get_list_type,
-//GO(gconf_value_get_schema,
-//GO(gconf_value_get_string,
+GO(gconf_value_get_float, dFp)
+GO(gconf_value_get_int, iFp)
+GO(gconf_value_get_list, pFp)
+GO(gconf_value_get_list_type, uFp)
+GO(gconf_value_get_schema, pFp)
+GO(gconf_value_get_string, pFp)
//GO(gconf_value_get_type,
//GO(gconf_value_list_from_primitive_list,
//GO(gconf_value_list_to_primitive_list_destructive,
-//GO(gconf_value_new,
-//GO(gconf_value_new_from_string,
+GO(gconf_value_new, pFu)
+GO(gconf_value_new_from_string, pFupp)
//GO(gconf_value_new_list_from_string,
//GO(gconf_value_new_pair_from_string,
//GO(gconf_value_pair_from_primitive_pair,
//GO(gconf_value_pair_to_primitive_pair_destructive,
-//GO(gconf_value_set_bool,
+GO(gconf_value_set_bool, vFpi)
//GO(gconf_value_set_car,
//GO(gconf_value_set_car_nocopy,
-//GO(gconf_value_set_cdr,
-//GO(gconf_value_set_cdr_nocopy,
-//GO(gconf_value_set_float,
-//GO(gconf_value_set_int,
-//GO(gconf_value_set_list,
+GO(gconf_value_set_cdr, vFpp)
+GO(gconf_value_set_cdr_nocopy, vFpp)
+GO(gconf_value_set_float, vFpd)
+GO(gconf_value_set_int, vFpi)
+GO(gconf_value_set_list, vFpp)
//GO(gconf_value_set_list_nocopy,
-//GO(gconf_value_set_list_type,
-//GO(gconf_value_set_schema,
-//GO(gconf_value_set_schema_nocopy,
-//GO(gconf_value_set_string,
+GO(gconf_value_set_list_type, vFpu)
+GO(gconf_value_set_schema, vFpp)
+GO(gconf_value_set_schema_nocopy, vFpp)
+GO(gconf_value_set_string, vFpp)
//GO(gconf_value_set_string_nocopy,
//GO(gconf_value_steal_list,
//GO(gconf_value_steal_schema,
//GO(gconf_value_steal_string,
-//GO(gconf_value_to_string,
+GO(gconf_value_to_string, pFp)
//GO(gconf_value_type_from_string,
//GO(gconf_value_type_get_type,
//GO(gconf_value_type_to_string,
diff --git a/src/wrapped/wrappedgcrypt_private.h b/src/wrapped/wrappedgcrypt_private.h
index 07830c3..39b2e55 100644
--- a/src/wrapped/wrappedgcrypt_private.h
+++ b/src/wrapped/wrappedgcrypt_private.h
@@ -201,7 +201,7 @@ GO(gcry_sexp_find_token, pFppL)
//GO(gcry_sexp_new,
//GO(gcry_sexp_nth,
//GO(gcry_sexp_nth_buffer,
-//GO(gcry_sexp_nth_data,
+GO(gcry_sexp_nth_data, pFpip)
GO(gcry_sexp_nth_mpi, pFpii)
//GO(gcry_sexp_nth_string,
//GO(gcry_sexp_prepend,
diff --git a/src/wrapped/wrappedgdk3.c b/src/wrapped/wrappedgdk3.c
index 671301b..aea28c6 100755..100644
--- a/src/wrapped/wrappedgdk3.c
+++ b/src/wrapped/wrappedgdk3.c
@@ -37,10 +37,10 @@ GO(3)
// GdkFilterFunc
#define GO(A) \
-static uintptr_t my_filter_fct_##A = 0; \
-static int my_filter_##A(void* xevent, void* event, void* data) \
-{ \
- return (int)RunFunction(my_context, my_filter_fct_##A, 3, xevent, event, data);\
+static uintptr_t my_filter_fct_##A = 0; \
+static int my_filter_##A(void* xevent, void* event, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_filter_fct_##A, "ppp", xevent, event, data); \
}
SUPER()
#undef GO
@@ -54,14 +54,60 @@ static void* findFilterFct(void* fct)
#define GO(A) if(my_filter_fct_##A == 0) {my_filter_fct_##A = (uintptr_t)fct; return my_filter_##A; }
SUPER()
#undef GO
- printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GdkFilterFunc callback\n");
+ printf_log(LOG_NONE, "Warning, no more slot for gdk-3 GdkFilterFunc callback\n");
+ return NULL;
+}
+// GSourceFunc
+#define GO(A) \
+static uintptr_t my_GSourceFunc_fct_##A = 0; \
+static int my_GSourceFunc_##A(void* a) \
+{ \
+ return (int)RunFunctionFmt(my_GSourceFunc_fct_##A, "p", a); \
+}
+SUPER()
+#undef GO
+static void* findGSourceFunc(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_GSourceFunc_fct_##A == (uintptr_t)fct) return my_GSourceFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GSourceFunc_fct_##A == 0) {my_GSourceFunc_fct_##A = (uintptr_t)fct; return my_GSourceFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for gdk-3 GSourceFunc callback\n");
+ return NULL;
+}
+// GDestroyNotify
+#define GO(A) \
+static uintptr_t my_GDestroyNotify_fct_##A = 0; \
+static void my_GDestroyNotify_##A(void* data) \
+{ \
+ RunFunctionFmt(my_GDestroyNotify_fct_##A, "p", data); \
+}
+SUPER()
+#undef GO
+static void* findGDestroyNotifyFct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_GDestroyNotify_fct_##A == (uintptr_t)fct) return my_GDestroyNotify_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GDestroyNotify_fct_##A == 0) {my_GDestroyNotify_fct_##A = (uintptr_t)fct; return my_GDestroyNotify_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for gdk-3 GDestroyNotify callback\n");
return NULL;
}
+#undef SUPER
+
static void my3_event_handler(void* event, my_signal_t* sig)
{
- RunFunction(my_context, sig->c_handler, 2, event, sig->data);
+ RunFunctionFmt(sig->c_handler, "pp", event, sig->data) ;
}
EXPORT void my3_gdk_event_handler_set(x64emu_t* emu, void* func, void* data, void* notify)
@@ -76,7 +122,7 @@ EXPORT void my3_gdk_event_handler_set(x64emu_t* emu, void* func, void* data, voi
static void my3_input_function(my_signal_t* sig, int source, int condition)
{
- RunFunction(my_context, sig->c_handler, 3, sig->data, source, condition);
+ RunFunctionFmt(sig->c_handler, "pii", sig->data, source, condition) ;
}
EXPORT int my3_gdk_input_add(x64emu_t* emu, int source, int condition, void* f, void* data)
@@ -92,7 +138,7 @@ EXPORT int my3_gdk_input_add_full(x64emu_t* emu, int source, int condition, void
{
if(!f)
return my->gdk_input_add_full(source, condition, f, data, notify);
-
+
my_signal_t* sig = new_mysignal(f, data, notify);
return my->gdk_input_add_full(source, condition, my3_input_function, sig, my_signal_delete);
}
@@ -120,6 +166,11 @@ EXPORT void my3_gdk_window_remove_filter(x64emu_t* emu, void* window, void* f, v
my->gdk_window_remove_filter(window, findFilterFct(f), data);
}
+EXPORT uint32_t my3_gdk_threads_add_idle_full(x64emu_t* emu, int priority, void* f, void* data, void* d)
+{
+ return my->gdk_threads_add_idle_full(priority, findGSourceFunc(f), data, findGDestroyNotifyFct(d));
+}
+
#define PRE_INIT \
if(box64_nogtk) \
return -1;
diff --git a/src/wrapped/wrappedgdk3_private.h b/src/wrapped/wrappedgdk3_private.h
index 3e2abb5..97455ee 100755..100644
--- a/src/wrapped/wrappedgdk3_private.h
+++ b/src/wrapped/wrappedgdk3_private.h
@@ -3,15 +3,15 @@
#endif
//GOM(gdk_add_client_message_filter, vFpBp)
-//GO(gdk_add_option_entries_libgtk_only,
+GO(gdk_add_option_entries_libgtk_only, vFp)
//GO(gdk_app_launch_context_get_type,
-//GO(gdk_app_launch_context_new,
-//GO(gdk_app_launch_context_set_desktop,
-//GO(gdk_app_launch_context_set_display,
-//GO(gdk_app_launch_context_set_icon,
-//GO(gdk_app_launch_context_set_icon_name,
-//GO(gdk_app_launch_context_set_screen,
-//GO(gdk_app_launch_context_set_timestamp,
+GO(gdk_app_launch_context_new, pFv)
+GO(gdk_app_launch_context_set_desktop, vFpi)
+GO(gdk_app_launch_context_set_display, vFpp)
+GO(gdk_app_launch_context_set_icon, vFpp)
+GO(gdk_app_launch_context_set_icon_name, vFpp)
+GO(gdk_app_launch_context_set_screen, vFpp)
+GO(gdk_app_launch_context_set_timestamp, vFpu)
GO(gdk_atom_intern, pFpi)
GO(gdk_atom_intern_static_string, pFp)
GO(gdk_atom_name, pFp)
@@ -79,23 +79,23 @@ GO(gdk_cursor_ref, pFp)
GO(gdk_cursor_type_get_type, iFv)
GO(gdk_cursor_unref, vFp)
GO(gdk_device_free_history, vFpi)
-GO(gdk_device_get_axis, iFppip)
-GO(gdk_device_get_axis_use, iFpu)
+GO(gdk_device_get_axis, iFppup)
+GO(gdk_device_get_axis_use, uFpu)
GO(gdk_device_get_core_pointer, pFv)
GO(gdk_device_get_has_cursor, iFp)
GO(gdk_device_get_history, iFppuupp)
-GO(gdk_device_get_key, vFpupp)
-GO(gdk_device_get_mode, iFp)
+GO(gdk_device_get_key, iFpupp)
+GO(gdk_device_get_mode, uFp)
GO(gdk_device_get_name, pFp)
GO(gdk_device_get_n_axes, iFp)
GO(gdk_device_get_n_keys, iFp)
-GO(gdk_device_get_source, iFp)
+GO(gdk_device_get_source, uFp)
GO(gdk_device_get_state, vFpppp)
GO(gdk_device_get_type, iFv)
-GO(gdk_device_set_axis_use, vFpui)
+GO(gdk_device_set_axis_use, vFpuu)
GO(gdk_device_manager_get_type, lFv)
-GO(gdk_device_set_key, vFpuui)
-GO(gdk_device_set_mode, iFpi)
+GO(gdk_device_set_key, vFpuuu)
+GO(gdk_device_set_mode, iFpu)
GO(gdk_device_set_source, vFpi)
GO(gdk_devices_list, pFv)
//GOM(gdk_display_add_client_message_filter, vFEpppp)
@@ -127,7 +127,7 @@ GO(gdk_display_manager_set_default_display, vFpp)
GO(gdk_display_map_keycode, iFpuppp)
GO(gdk_display_notify_startup_complete, vFpp)
GO(gdk_display_open, pFp)
-//GO(gdk_display_open_default_libgtk_only,
+GO(gdk_display_open_default_libgtk_only, pFv)
GO(gdk_display_peek_event, pFp)
GO(gdk_display_pointer_is_grabbed, iFp)
GO(gdk_display_pointer_ungrab, vFpu)
@@ -151,8 +151,8 @@ GO(gdk_drag_action_get_type, iFv)
GO(gdk_drag_begin, pFpp)
GO(gdk_drag_context_get_actions, iFp)
GO(gdk_drag_context_get_dest_window, pFp)
-GO(gdk_drag_context_get_protocol, iFp)
-GO(gdk_drag_context_get_selected_action, iFp)
+GO(gdk_drag_context_get_protocol, uFp)
+GO(gdk_drag_context_get_selected_action, uFp)
GO(gdk_drag_context_get_source_window, pFp)
GO(gdk_drag_context_get_suggested_action, iFp)
GO(gdk_drag_context_get_type, iFv)
@@ -167,9 +167,9 @@ GO(gdk_drag_find_window_for_screen, vFpppiipp)
GO(gdk_drag_get_protocol, pFpp)
GO(gdk_drag_get_protocol_for_display, pFppp)
GO(gdk_drag_get_selection, pFp)
-GO(gdk_drag_motion, iFppiiiiiu)
+GO(gdk_drag_motion, iFppuiiuuu)
GO(gdk_drag_protocol_get_type, iFv)
-GO(gdk_drag_status, vFpiu)
+GO(gdk_drag_status, vFpuu)
GO(gdk_drawable_copy_to_image, pFppiiiiii)
GO(gdk_drawable_get_clip_region, pFp)
GO(gdk_drawable_get_colormap, pFp)
@@ -220,13 +220,14 @@ GO(gdk_error_trap_push, vFv)
GO(gdk_event_copy, pFp)
GO(gdk_event_free, vFp)
GO(gdk_event_get, pFv)
-GO(gdk_event_get_axis, iFpip)
+GO(gdk_event_get_axis, iFpup)
GO(gdk_event_get_coords, iFppp)
GO(gdk_event_get_graphics_expose, pFp)
GO(gdk_event_get_modifier_state, iFp)
GO(gdk_event_get_root_coords, iFppp)
GO(gdk_event_get_screen, pFp)
GO(gdk_event_get_state, iFpp)
+GO(gdk_event_get_source_device, pFp)
GO(gdk_event_get_surface, pFp)
GO(gdk_event_get_time, uFp)
GO(gdk_event_get_type, iFv)
@@ -304,6 +305,11 @@ GO(gdk_get_display_arg_name, pFv)
GO(gdk_get_program_class, pFv)
GO(gdk_get_show_events, iFv)
GO(gdk_get_use_xshm, iFv)
+GO(gdk_gl_context_get_type, LFv)
+GO(gdk_gl_context_clear_current, vFv)
+GO(gdk_gl_context_get_current, pFv)
+GO(gdk_gl_context_make_current, vFp)
+GO(gdk_gl_context_realize, iFpp)
GO(gdk_grab_status_get_type, iFv)
GO(gdk_gravity_get_type, iFv)
GO(gdk_image_get, pFpiiii)
@@ -339,13 +345,13 @@ GO(gdk_input_source_get_type, iFv)
GO(gdk_join_style_get_type, iFv)
GO(gdk_key_event_get_keycode, uFp)
GO(gdk_key_event_get_keyval, uFp)
-GO(gdk_keyboard_grab, iFpiu)
+GO(gdk_keyboard_grab, uFpiu)
//GO(gdk_keyboard_grab_info_libgtk_only,
GO(gdk_keyboard_ungrab, vFu)
GO(gdk_keymap_add_virtual_modifiers, vFpp)
GO(gdk_keymap_get_caps_lock_state, iFp)
GO(gdk_keymap_get_default, pFv)
-GO(gdk_keymap_get_direction, iFp)
+GO(gdk_keymap_get_direction, uFp)
GO(gdk_keymap_get_entries_for_keycode, iFpuppp)
GO(gdk_keymap_get_entries_for_keyval, iFpupp)
GO(gdk_keymap_get_for_display, pFp)
@@ -353,7 +359,7 @@ GO(gdk_keymap_get_type, iFv)
GO(gdk_keymap_have_bidi_layouts, iFp)
GO(gdk_keymap_lookup_key, uFpp)
GO(gdk_keymap_map_virtual_modifiers, iFpp)
-GO(gdk_keymap_translate_keyboard_state, iFpuiipppp)
+GO(gdk_keymap_translate_keyboard_state, iFpuuipppp)
GO(gdk_keyval_convert_case, vFupp)
GO(gdk_keyval_from_name, uFp)
GO(gdk_keyval_is_lower, iFu)
@@ -418,12 +424,12 @@ GO(gdk_pixmap_impl_x11_get_type, iFv)
GO(gdk_pixmap_lookup, pFp)
GO(gdk_pixmap_lookup_for_display, pFpp)
GO(gdk_pixmap_new, pFpiii)
-GO(gdk_pointer_grab, iFpiippu)
+GO(gdk_pointer_grab, uFpiuppu)
//GO(gdk_pointer_grab_info_libgtk_only,
GO(gdk_pointer_is_grabbed, iFv)
GO(gdk_pointer_ungrab, vFu)
//GO(gdk_pre_parse_libgtk_only,
-GO(gdk_property_change, vFpppiipi)
+GO(gdk_property_change, vFpppiupi)
GO(gdk_property_delete, vFpp)
GO(gdk_property_get, iFpppLLipppp)
GO(gdk_property_state_get_type, iFv)
@@ -543,7 +549,7 @@ GO(gdk_string_to_compound_text_for_display, iFpppppp)
//GO(gdk_subwindow_mode_get_type,
//GO(gdk_synthesize_window_state,
//GO(gdk_test_render_sync,
-//GO(gdk_test_simulate_button,
+GO(gdk_test_simulate_button, iFpiiuui)
//GO(gdk_test_simulate_key,
//GO(gdk_text_extents,
//GO(gdk_text_extents_wc,
@@ -552,14 +558,14 @@ GO(gdk_string_to_compound_text_for_display, iFpppppp)
GO(gdk_text_property_to_text_list, iFpipip)
GO(gdk_text_property_to_text_list_for_display, iFppipip)
GO(gdk_text_property_to_utf8_list, iFpipip)
-//GO(gdk_text_property_to_utf8_list_for_display,
+GO(gdk_text_property_to_utf8_list_for_display, iFppipip)
//GO(gdk_text_width,
//GO(gdk_text_width_wc,
GO(gdk_texture_download, vFppL)
GO(gdk_texture_get_width, uFp)
GO(gdk_texture_get_height, uFp)
//GOM(gdk_threads_add_idle, uFEpp)
-//GOM(gdk_threads_add_idle_full, uFEippp)
+GOM(gdk_threads_add_idle_full, uFEippp)
//GOM(gdk_threads_add_timeout, uFEupp)
//GOM(gdk_threads_add_timeout_full, uFEiuppp)
//GOM(gdk_threads_add_timeout_seconds, uFEupp)
@@ -576,21 +582,21 @@ GO(gdk_utf8_to_string_target, pFp)
GO(gdk_visibility_state_get_type, iFv)
GO(gdk_visual_get_best, pFv)
GO(gdk_visual_get_best_depth, iFv)
-GO(gdk_visual_get_best_type, iFv)
-GO(gdk_visual_get_best_with_both, pFii)
+GO(gdk_visual_get_best_type, uFv)
+GO(gdk_visual_get_best_with_both, pFiu)
GO(gdk_visual_get_best_with_depth, pFi)
-GO(gdk_visual_get_best_with_type, pFi)
+GO(gdk_visual_get_best_with_type, pFu)
GO(gdk_visual_get_bits_per_rgb, iFp)
GO(gdk_visual_get_blue_pixel_details, vFpppp)
-GO(gdk_visual_get_byte_order, iFp)
+GO(gdk_visual_get_byte_order, uFp)
GO(gdk_visual_get_colormap_size, iFp)
GO(gdk_visual_get_depth, iFp)
GO(gdk_visual_get_green_pixel_details, vFpppp)
GO(gdk_visual_get_red_pixel_details, vFpppp)
GO(gdk_visual_get_screen, pFp)
GO(gdk_visual_get_system, pFv)
-GO(gdk_visual_get_type, iFv)
-GO(gdk_visual_get_visual_type, iFp)
+GO(gdk_visual_get_type, LFv)
+GO(gdk_visual_get_visual_type, uFp)
GO(gdk_visual_type_get_type, iFv)
GO(gdk_wayland_toplevel_set_transient_for_exported, iFpp)
GO(gdk_wayland_window_set_transient_for_exported, iFpp)
@@ -611,8 +617,9 @@ GO(gdk_window_configure_finished, vFp)
GO(gdk_window_constrain_size, vFpuiipp)
GO(gdk_window_coords_from_parent, vFpddpp)
GO(gdk_window_coords_to_parent, vFpddpp)
+GO(gdk_window_create_gl_context, pFpp)
GO(gdk_window_create_similar_image_surface, pFpiiii)
-GO(gdk_window_create_similar_surface, pFpiii)
+GO(gdk_window_create_similar_surface, pFpuii)
GO(gdk_window_deiconify, vFp)
GO(gdk_window_destroy, vFp)
//GO(gdk_window_destroy_notify,
@@ -638,10 +645,10 @@ GO(gdk_window_get_deskrelative_origin, iFppp)
GO(gdk_window_get_display, pFp)
GO(gdk_window_get_effective_parent, pFp)
GO(gdk_window_get_effective_toplevel, pFp)
-GO(gdk_window_get_events, vFpi)
+GO(gdk_window_get_events, uFp)
GO(gdk_window_get_focus_on_map, iFp)
GO(gdk_window_get_frame_extents, vFpp)
-GO(gdk_window_get_geometry, vFpppppp)
+GO(gdk_window_get_geometry, vFppppp)
GO(gdk_window_get_group, pFp)
GO(gdk_window_get_height, iFp)
GO(gdk_window_get_internal_paint_info, vFpppp)
@@ -653,16 +660,16 @@ GO(gdk_window_get_position, vFppp)
GO(gdk_window_get_root_coords, vFpiipp)
GO(gdk_window_get_root_origin, vFppp)
GO(gdk_window_get_screen, pFp)
-GO(gdk_window_get_state, iFp)
+GO(gdk_window_get_state, uFp)
GO(gdk_window_get_toplevel, pFp)
GO(gdk_window_get_toplevels, pFp)
GO(gdk_window_get_type, lFv)
-GO(gdk_window_get_type_hint, iFp)
+GO(gdk_window_get_type_hint, uFp)
GO(gdk_window_get_update_area, pFp)
GO(gdk_window_get_user_data, vFpp)
GO(gdk_window_get_visual, pFp)
GO(gdk_window_get_width, iFp)
-GO(gdk_window_get_window_type, iFp)
+GO(gdk_window_get_window_type, uFp)
GO(gdk_window_has_native, iFp)
GO(gdk_window_hide, vFp)
GO(gdk_window_hints_get_type, iFv)
@@ -704,17 +711,18 @@ GO(gdk_window_restack, vFppi)
GO(gdk_window_scroll, vFpii)
GO(gdk_window_set_accept_focus, vFpi)
GO(gdk_window_set_background, vFpp)
+GO(gdk_window_set_background_rgba, vFpp)
GO(gdk_window_set_back_pixmap, vFppi)
GO(gdk_window_set_child_input_shapes, vFp)
GO(gdk_window_set_child_shapes, vFp)
GO(gdk_window_set_composited, vFpi)
GO(gdk_window_set_cursor, vFpp)
GO(gdk_window_set_debug_updates, vFi)
-GO(gdk_window_set_decorations, vFpp)
-GO(gdk_window_set_events, vFpp)
+GO(gdk_window_set_decorations, vFpu)
+GO(gdk_window_set_events, vFpu)
GO(gdk_window_set_focus_on_map, vFpi)
GO(gdk_window_set_functions, vFpu)
-GO(gdk_window_set_geometry_hints, vFppi)
+GO(gdk_window_set_geometry_hints, vFppu)
GO(gdk_window_set_group, vFpp)
GO(gdk_window_set_hints, vFpiiiiiii)
GO(gdk_window_set_icon, vFpppp)
@@ -723,7 +731,7 @@ GO(gdk_window_set_icon_name, vFpp)
GO(gdk_window_set_keep_above, vFpi)
GO(gdk_window_set_keep_below, vFpi)
GO(gdk_window_set_modal_hint, iFp)
-GO(gdk_window_set_opacity, vFpi)
+GO(gdk_window_set_opacity, vFpd)
GO(gdk_window_set_override_redirect, vFpi)
GO(gdk_window_set_role, vFpp)
GO(gdk_window_set_skip_pager_hint, vFpi)
@@ -732,7 +740,7 @@ GO(gdk_window_set_startup_id, vFpp)
GO(gdk_window_set_static_gravities, iFpi)
GO(gdk_window_set_title, vFpp)
GO(gdk_window_set_transient_for, vFpp)
-GO(gdk_window_set_type_hint, vFpi)
+GO(gdk_window_set_type_hint, vFpu)
GO(gdk_window_set_urgency_hint, vFpi)
GO(gdk_window_set_user_data, vFpp)
GO(gdk_window_shape_combine_mask, vFppii)
@@ -763,6 +771,7 @@ GO(gdk_x11_display_get_startup_notification_id, pFp)
GO(gdk_x11_display_get_type, iFv)
GO(gdk_x11_display_get_user_time, uFp)
GO(gdk_x11_display_get_xdisplay, pFp)
+GO(gdk_x11_window_get_type, LFv)
GO(gdk_x11_window_get_xid, LFp)
GO(gdk_x11_display_grab, vFp)
GO(gdk_x11_display_set_cursor_theme, vFppi)
@@ -820,4 +829,4 @@ DATA(gdk_threads_lock, 4)
DATA(gdk_threads_unlock, 4)
GO(dummy_set_child_property, vFppupp) // to get vFppupp for gtkclass.c
-GO(dummy_constructor, vFLup) // to get vFlup for gtkclass.c \ No newline at end of file
+GO(dummy_constructor, vFLup) // to get vFlup for gtkclass.c
diff --git a/src/wrapped/wrappedgdkpixbuf2.c b/src/wrapped/wrappedgdkpixbuf2.c
index 1f82399..34770c8 100755..100644
--- a/src/wrapped/wrappedgdkpixbuf2.c
+++ b/src/wrapped/wrappedgdkpixbuf2.c
@@ -32,10 +32,10 @@ GO(3)
// destroy_pixbuf
#define GO(A) \
-static uintptr_t my_destroy_pixbuf_fct_##A = 0; \
-static void my_destroy_pixbuf_##A(void* pixels, void* data) \
-{ \
- RunFunction(my_context, my_destroy_pixbuf_fct_##A, 2, pixels, data); \
+static uintptr_t my_destroy_pixbuf_fct_##A = 0; \
+static void my_destroy_pixbuf_##A(void* pixels, void* data) \
+{ \
+ RunFunctionFmt(my_destroy_pixbuf_fct_##A, "pp", pixels, data); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedgdkpixbuf2_private.h b/src/wrapped/wrappedgdkpixbuf2_private.h
index adc0f9f..adc0f9f 100755..100644
--- a/src/wrapped/wrappedgdkpixbuf2_private.h
+++ b/src/wrapped/wrappedgdkpixbuf2_private.h
diff --git a/src/wrapped/wrappedgdkx112.c b/src/wrapped/wrappedgdkx112.c
index 4f3aeba..cb62731 100755..100644
--- a/src/wrapped/wrappedgdkx112.c
+++ b/src/wrapped/wrappedgdkx112.c
@@ -37,10 +37,10 @@ GO(3)
// GdkFilterFunc
#define GO(A) \
-static uintptr_t my_filter_fct_##A = 0; \
-static int my_filter_##A(void* xevent, void* event, void* data) \
-{ \
- return (int)RunFunction(my_context, my_filter_fct_##A, 3, xevent, event, data);\
+static uintptr_t my_filter_fct_##A = 0; \
+static int my_filter_##A(void* xevent, void* event, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_filter_fct_##A, "ppp", xevent, event, data); \
}
SUPER()
#undef GO
@@ -61,7 +61,7 @@ static void* findFilterFct(void* fct)
static void my_event_handler(void* event, my_signal_t* sig)
{
- RunFunction(my_context, sig->c_handler, 2, event, sig->data);
+ RunFunctionFmt(sig->c_handler, "pp", event, sig->data);
}
EXPORT void my_gdk_event_handler_set(x64emu_t* emu, void* func, void* data, void* notify)
@@ -76,7 +76,7 @@ EXPORT void my_gdk_event_handler_set(x64emu_t* emu, void* func, void* data, void
static void my_input_function(my_signal_t* sig, int source, int condition)
{
- RunFunction(my_context, sig->c_handler, 3, sig->data, source, condition);
+ RunFunctionFmt(sig->c_handler, "pii", sig->data, source, condition);
}
EXPORT int my_gdk_input_add(x64emu_t* emu, int source, int condition, void* f, void* data)
@@ -92,7 +92,7 @@ EXPORT int my_gdk_input_add_full(x64emu_t* emu, int source, int condition, void*
{
if(!f)
return my->gdk_input_add_full(source, condition, f, data, notify);
-
+
my_signal_t* sig = new_mysignal(f, data, notify);
return my->gdk_input_add_full(source, condition, my_input_function, sig, my_signal_delete);
}
diff --git a/src/wrapped/wrappedgdkx112_private.h b/src/wrapped/wrappedgdkx112_private.h
index 1c0400a..f9c4d6b 100755..100644
--- a/src/wrapped/wrappedgdkx112_private.h
+++ b/src/wrapped/wrappedgdkx112_private.h
@@ -3,15 +3,15 @@
#endif
//GOM(gdk_add_client_message_filter, vFpBp)
-//GO(gdk_add_option_entries_libgtk_only,
+GO(gdk_add_option_entries_libgtk_only, vFp)
//GO(gdk_app_launch_context_get_type,
-//GO(gdk_app_launch_context_new,
-//GO(gdk_app_launch_context_set_desktop,
+GO(gdk_app_launch_context_new, pFv)
+GO(gdk_app_launch_context_set_desktop, vFpi)
//GO(gdk_app_launch_context_set_display,
-//GO(gdk_app_launch_context_set_icon,
-//GO(gdk_app_launch_context_set_icon_name,
-//GO(gdk_app_launch_context_set_screen,
-//GO(gdk_app_launch_context_set_timestamp,
+GO(gdk_app_launch_context_set_icon, vFpp)
+GO(gdk_app_launch_context_set_icon_name, vFpp)
+GO(gdk_app_launch_context_set_screen, vFpp)
+GO(gdk_app_launch_context_set_timestamp, vFpu)
GO(gdk_atom_intern, pFpi)
GO(gdk_atom_intern_static_string, pFp)
GO(gdk_atom_name, pFp)
@@ -28,10 +28,10 @@ GO(gdk_cairo_set_source_pixbuf, vFppdd)
GO(gdk_cairo_set_source_pixmap, vFppdd)
GO(gdk_cairo_set_source_window, vFppdd)
//GO(gdk_cap_style_get_type,
-//GO(gdk_char_height,
+GO(gdk_char_height, iFpC)
//GO(gdk_char_measure,
//GO(gdk_char_width,
-//GO(gdk_char_width_wc,
+GO(gdk_char_width_wc, iFpu)
GO(gdk_color_alloc, iFpp)
GO(gdk_color_black, iFpp)
GO(gdk_color_change, iFpp)
@@ -73,23 +73,23 @@ GO(gdk_cursor_ref, pFp)
GO(gdk_cursor_type_get_type, LFv)
GO(gdk_cursor_unref, vFp)
GO(gdk_device_free_history, vFpi)
-GO(gdk_device_get_axis, iFppip)
-GO(gdk_device_get_axis_use, iFpu)
+GO(gdk_device_get_axis, iFppup)
+GO(gdk_device_get_axis_use, uFpu)
GO(gdk_device_get_core_pointer, pFv)
GO(gdk_device_get_has_cursor, iFp)
GO(gdk_device_get_history, iFppuupp)
GO(gdk_device_get_key, vFpupp)
-GO(gdk_device_get_mode, iFp)
+GO(gdk_device_get_mode, uFp)
GO(gdk_device_get_name, pFp)
GO(gdk_device_get_n_axes, iFp)
GO(gdk_device_get_n_keys, iFp)
-GO(gdk_device_get_source, iFp)
+GO(gdk_device_get_source, uFp)
GO(gdk_device_get_state, vFpppp)
GO(gdk_device_get_type, LFv)
-GO(gdk_device_set_axis_use, vFpui)
-GO(gdk_device_set_key, vFpuui)
-GO(gdk_device_set_mode, iFpi)
-GO(gdk_device_set_source, vFpi)
+GO(gdk_device_set_axis_use, vFpuu)
+GO(gdk_device_set_key, vFpuuu)
+GO(gdk_device_set_mode, iFpu)
+GO(gdk_device_set_source, vFpu)
GO(gdk_devices_list, pFv)
//GOM(gdk_display_add_client_message_filter, vFEpppp)
GO(gdk_display_beep, vFp)
@@ -141,8 +141,8 @@ GO(gdk_drag_action_get_type, LFv)
GO(gdk_drag_begin, pFpp)
GO(gdk_drag_context_get_actions, iFp)
GO(gdk_drag_context_get_dest_window, pFp)
-GO(gdk_drag_context_get_protocol, iFp)
-GO(gdk_drag_context_get_selected_action, iFp)
+GO(gdk_drag_context_get_protocol, uFp)
+GO(gdk_drag_context_get_selected_action, uFp)
GO(gdk_drag_context_get_source_window, pFp)
GO(gdk_drag_context_get_suggested_action, iFp)
GO(gdk_drag_context_get_type, LFv)
@@ -154,12 +154,12 @@ GO(gdk_drag_drop, vFpu)
GO(gdk_drag_drop_succeeded, iFp)
GO(gdk_drag_find_window, vFppiipp)
GO(gdk_drag_find_window_for_screen, vFpppiipp)
-GO(gdk_drag_get_protocol, pFpp)
+GO(gdk_drag_get_protocol, uFup)
GO(gdk_drag_get_protocol_for_display, pFppp)
GO(gdk_drag_get_selection, pFp)
-GO(gdk_drag_motion, iFppiiiiiu)
+GO(gdk_drag_motion, iFppuiiuuu)
GO(gdk_drag_protocol_get_type, LFv)
-GO(gdk_drag_status, vFpiu)
+GO(gdk_drag_status, vFpuu)
GO(gdk_drawable_copy_to_image, pFppiiiiii)
GO(gdk_drawable_get_clip_region, pFp)
GO(gdk_drawable_get_colormap, pFp)
@@ -180,22 +180,22 @@ GO(gdk_draw_arc, vFppiiiiiii)
GO(gdk_draw_drawable, vFpppiiiiii)
GO(gdk_draw_glyphs, vFpppiip)
GO(gdk_draw_glyphs_transformed, vFppppiip)
-GO(gdk_draw_gray_image, vFppiiiiipi)
+GO(gdk_draw_gray_image, vFppiiiiupi)
GO(gdk_draw_image, vFpppiiiiii)
-GO(gdk_draw_indexed_image, vFppiiiiipip)
+GO(gdk_draw_indexed_image, vFppiiiiupip)
GO(gdk_draw_layout, vFppiip)
GO(gdk_draw_layout_line, vFppiip)
GO(gdk_draw_layout_line_with_colors, vFppiippp)
GO(gdk_draw_layout_with_colors, vFppiippp)
GO(gdk_draw_line, vFppiiii)
GO(gdk_draw_lines, vFpppi)
-GO(gdk_draw_pixbuf, vFpppiiiiiiiii)
+GO(gdk_draw_pixbuf, vFpppiiiiiiuii)
GO(gdk_draw_point, vFppii)
GO(gdk_draw_points, vFpppi)
GO(gdk_draw_polygon, vFppipi)
GO(gdk_draw_rectangle, vFppiiiii)
GO(gdk_draw_rgb_32_image, vFppiiiiipi)
-GO(gdk_draw_rgb_32_image_dithalign, vFppiiiiipiii)
+GO(gdk_draw_rgb_32_image_dithalign, vFppiiiiupiii)
GO(gdk_draw_rgb_image, vFppiiiiipi)
GO(gdk_draw_rgb_image_dithalign, vFppiiiiipiii)
GO(gdk_draw_segments, vFpppi)
@@ -210,7 +210,7 @@ GO(gdk_error_trap_push, vFv)
GO(gdk_event_copy, pFp)
GO(gdk_event_free, vFp)
GO(gdk_event_get, pFv)
-GO(gdk_event_get_axis, iFpip)
+GO(gdk_event_get_axis, iFpup)
GO(gdk_event_get_coords, iFppp)
GO(gdk_event_get_graphics_expose, pFp)
GO(gdk_event_get_root_coords, iFppp)
@@ -224,7 +224,7 @@ GO(gdk_event_new, pFi)
GO(gdk_event_peek, pFv)
GO(gdk_event_put, vFp)
GO(gdk_event_request_motions, vFp)
-GO(gdk_event_send_client_message, iFpp)
+GO(gdk_event_send_client_message, iFpu)
GO(gdk_event_send_client_message_for_display, iFppp)
GO(gdk_event_send_clientmessage_toall, vFp)
GO(gdk_event_set_screen, vFpp)
@@ -236,19 +236,19 @@ GO(gdk_exit, vFi)
//GO(gdk_fill_rule_get_type,
//GO(gdk_filter_return_get_type,
GO(gdk_flush, vFv)
-//GO(gdk_font_equal,
-//GO(gdk_font_from_description,
+GO(gdk_font_equal, iFpp)
+GO(gdk_font_from_description, pFp)
//GO(gdk_font_from_description_for_display,
//GO(gdk_font_get_display,
GO(gdk_font_get_type, LFv)
-//GO(gdk_font_id,
+GO(gdk_font_id, iFp)
//GO(gdk_font_load,
//GO(gdk_font_load_for_display,
-//GO(gdk_font_ref,
-//GO(gdk_fontset_load,
+GO(gdk_font_ref, pFp)
+GO(gdk_fontset_load, pFp)
//GO(gdk_fontset_load_for_display,
//GO(gdk_font_type_get_type,
-//GO(gdk_font_unref,
+GO(gdk_font_unref, vFp)
GO(gdk_free_compound_text, vFp)
GO(gdk_free_text_list, vFp)
GO(gdk_function_get_type, LFv)
@@ -269,15 +269,15 @@ GO(gdk_gc_set_clip_region, vFpp)
GO(gdk_gc_set_colormap, vFpp)
GO(gdk_gc_set_dashes, vFpipi)
GO(gdk_gc_set_exposures, vFpi)
-GO(gdk_gc_set_fill, vFpi)
+GO(gdk_gc_set_fill, vFpu)
GO(gdk_gc_set_font, vFpp)
GO(gdk_gc_set_foreground, vFpp)
-GO(gdk_gc_set_function,vFpi)
-GO(gdk_gc_set_line_attributes, vFpiiii)
+GO(gdk_gc_set_function, vFpu)
+GO(gdk_gc_set_line_attributes, vFpiuuu)
GO(gdk_gc_set_rgb_bg_color, vFpp)
GO(gdk_gc_set_rgb_fg_color, vFpp)
GO(gdk_gc_set_stipple, vFpp)
-GO(gdk_gc_set_subwindow, vFpi)
+GO(gdk_gc_set_subwindow, vFpu)
GO(gdk_gc_set_tile, vFpp)
GO(gdk_gc_set_ts_origin, vFpii)
GO(gdk_gc_set_values, vFppu)
@@ -293,19 +293,19 @@ GO(gdk_grab_status_get_type, LFv)
GO(gdk_gravity_get_type, LFv)
GO(gdk_image_get, pFpiiii)
GO(gdk_image_get_bits_per_pixel, WFp)
-GO(gdk_image_get_byte_order, iFp)
+GO(gdk_image_get_byte_order, uFp)
GO(gdk_image_get_bytes_per_line, WFp)
GO(gdk_image_get_bytes_per_pixel, WFp)
GO(gdk_image_get_colormap, pFp)
GO(gdk_image_get_depth, WFp)
GO(gdk_image_get_height, iFp)
-GO(gdk_image_get_image_type, iFp)
+GO(gdk_image_get_image_type, uFp)
GO(gdk_image_get_pixel, uFpii)
GO(gdk_image_get_pixels, pFp)
GO(gdk_image_get_type, LFv)
GO(gdk_image_get_visual, pFp)
GO(gdk_image_get_width, iFp)
-GO(gdk_image_new, pFipii)
+GO(gdk_image_new, pFupii)
GO(gdk_image_new_bitmap, pFppii)
GO(gdk_image_put_pixel, vFpiiu)
GO(gdk_image_ref, pFp)
@@ -319,10 +319,10 @@ GOM(gdk_input_add_full, iFEiippp)
GO(gdk_input_condition_get_type, LFv)
GO(gdk_input_mode_get_type, LFv)
GO(gdk_input_remove, vFi)
-GO(gdk_input_set_extension_events, vFpii)
+GO(gdk_input_set_extension_events, vFpiu)
GO(gdk_input_source_get_type, LFv)
GO(gdk_join_style_get_type, LFv)
-GO(gdk_keyboard_grab, iFpiu)
+GO(gdk_keyboard_grab, uFpiu)
//GO(gdk_keyboard_grab_info_libgtk_only,
GO(gdk_keyboard_ungrab, vFu)
GO(gdk_keymap_add_virtual_modifiers, vFpp)
@@ -347,7 +347,7 @@ GO(gdk_keyval_to_unicode, uFu)
GO(gdk_keyval_to_upper, uFu)
GO(gdk_line_style_get_type, LFv)
GO(gdk_list_visuals, pFv)
-//GO(gdk_mbstowcs,
+GO(gdk_mbstowcs, iFppi)
GO(gdk_modifier_type_get_type, LFv)
GO(gdk_net_wm_supports, iFp)
GO(gdk_notify_startup_complete, vFv)
@@ -372,16 +372,16 @@ GO(gdk_pango_renderer_get_type, LFv)
GO(gdk_pango_renderer_new, pFp)
GO(gdk_pango_renderer_set_drawable, vFpp)
GO(gdk_pango_renderer_set_gc, vFpp)
-GO(gdk_pango_renderer_set_override_color, vFpip)
-GO(gdk_pango_renderer_set_stipple, vFpip)
+GO(gdk_pango_renderer_set_override_color, vFpup)
+GO(gdk_pango_renderer_set_stipple, vFpup)
GO(gdk_parse_args, vFpp)
GO(gdk_pixbuf_get_from_drawable, pFpppiiiiii)
GO(gdk_pixbuf_get_from_image, pFpppiiiiii)
GO(gdk_pixbuf_render_pixmap_and_mask, vFpppi)
GO(gdk_pixbuf_render_pixmap_and_mask_for_colormap, vFppppi)
GO(gdk_pixbuf_render_threshold_alpha, vFppiiiiiii)
-GO(gdk_pixbuf_render_to_drawable, vFpppiiiiiiiii)
-GO(gdk_pixbuf_render_to_drawable_alpha, vFppiiiiiiiiiii)
+GO(gdk_pixbuf_render_to_drawable, vFpppiiiiiiuii)
+GO(gdk_pixbuf_render_to_drawable_alpha, vFppiiiiiiuiuii)
GO(gdk_pixmap_colormap_create_from_xpm, pFppppp)
GO(gdk_pixmap_colormap_create_from_xpm_d, pFppppp)
GO(gdk_pixmap_create_from_data, pFppiiipp)
@@ -389,19 +389,19 @@ GO(gdk_pixmap_create_from_xpm, pFpppp)
GO(gdk_pixmap_create_from_xpm_d, pFpppp)
GO(gdk_pixmap_foreign_new, pFp)
GO(gdk_pixmap_foreign_new_for_display, pFpp)
-GO(gdk_pixmap_foreign_new_for_screen, pFppiii)
+GO(gdk_pixmap_foreign_new_for_screen, pFpuiii)
GO(gdk_pixmap_get_size, vFppp)
GO(gdk_pixmap_get_type, LFv)
GO(gdk_pixmap_impl_x11_get_type, LFv)
-GO(gdk_pixmap_lookup, pFp)
+GO(gdk_pixmap_lookup, pFu)
GO(gdk_pixmap_lookup_for_display, pFpp)
GO(gdk_pixmap_new, pFpiii)
-GO(gdk_pointer_grab, iFpiippu)
+GO(gdk_pointer_grab, uFpiuppu)
//GO(gdk_pointer_grab_info_libgtk_only,
GO(gdk_pointer_is_grabbed, iFv)
GO(gdk_pointer_ungrab, vFu)
//GO(gdk_pre_parse_libgtk_only,
-GO(gdk_property_change, vFpppiipi)
+GO(gdk_property_change, vFpppiupi)
GO(gdk_property_delete, vFpp)
GO(gdk_property_get, iFpppLLipppp)
GO(gdk_property_state_get_type, LFv)
@@ -412,7 +412,7 @@ GO(gdk_rectangle_get_type, LFv)
GO(gdk_rectangle_intersect, iFppp)
GO(gdk_rectangle_union, vFppp)
GO(gdk_region_copy, pFp)
-GO(gdk_region_destroy, vFpp)
+GO(gdk_region_destroy, vFp)
GO(gdk_region_empty, iFp)
GO(gdk_region_equal, iFpp)
GO(gdk_region_get_clipbox, vFpp)
@@ -421,10 +421,10 @@ GO(gdk_region_intersect, vFpp)
GO(gdk_region_new, pFv)
GO(gdk_region_offset, vFpii)
GO(gdk_region_point_in, iFpii)
-GO(gdk_region_polygon, pFpii)
+GO(gdk_region_polygon, pFpiu)
GO(gdk_region_rectangle, pFp)
GO(gdk_region_rect_equal, iFpp)
-GO(gdk_region_rect_in, iFpp)
+GO(gdk_region_rect_in, uFpp)
GO(gdk_region_shrink, vFpii)
//GOM(gdk_region_spans_intersect_foreach, vFppiiBp)
GO(gdk_region_subtract, vFpp)
@@ -494,7 +494,7 @@ GO(gdk_selection_owner_get_for_display, pFpp)
GO(gdk_selection_owner_set, iFppui)
GO(gdk_selection_owner_set_for_display, iFpppui)
GO(gdk_selection_property_get, iFpppp)
-GO(gdk_selection_send_notify, vFppppu)
+GO(gdk_selection_send_notify, vFupppu)
GO(gdk_selection_send_notify_for_display, vFpppppu)
GO(gdk_set_double_click_time, vFu)
GO(gdk_set_locale, pFv)
@@ -509,27 +509,27 @@ GO(gdk_spawn_command_line_on_screen, iFppp)
//GOM(gdk_spawn_on_screen, iFEppppipppp)
//GOM(gdk_spawn_on_screen_with_pipes, iFEppppippppppp)
GO(gdk_status_get_type, LFv)
-//GO(gdk_string_extents,
-//GO(gdk_string_height,
+GO(gdk_string_extents, vFppppppp)
+GO(gdk_string_height, iFpp)
//GO(gdk_string_measure,
GO(gdk_string_to_compound_text, iFppppp)
GO(gdk_string_to_compound_text_for_display, iFpppppp)
//GO(gdk_string_width,
//GO(gdk_subwindow_mode_get_type,
//GO(gdk_synthesize_window_state,
-//GO(gdk_test_render_sync,
-//GO(gdk_test_simulate_button,
+GO(gdk_test_render_sync, vFp)
+GO(gdk_test_simulate_button, iFpiiuui)
//GO(gdk_test_simulate_key,
-//GO(gdk_text_extents,
-//GO(gdk_text_extents_wc,
-//GO(gdk_text_height,
+GO(gdk_text_extents, vFppippppp)
+GO(gdk_text_extents_wc, vFppippppp)
+GO(gdk_text_height, iFppi)
//GO(gdk_text_measure,
GO(gdk_text_property_to_text_list, iFpipip)
GO(gdk_text_property_to_text_list_for_display, iFppipip)
GO(gdk_text_property_to_utf8_list, iFpipip)
//GO(gdk_text_property_to_utf8_list_for_display,
//GO(gdk_text_width,
-//GO(gdk_text_width_wc,
+GO(gdk_text_width_wc, iFppi)
//GOM(gdk_threads_add_idle, uFEpp)
//GOM(gdk_threads_add_idle_full, uFEippp)
//GOM(gdk_threads_add_timeout, uFEupp)
@@ -547,13 +547,13 @@ GO(gdk_utf8_to_string_target, pFp)
GO(gdk_visibility_state_get_type, LFv)
GO(gdk_visual_get_best, pFv)
GO(gdk_visual_get_best_depth, iFv)
-GO(gdk_visual_get_best_type, iFv)
-GO(gdk_visual_get_best_with_both, pFii)
+GO(gdk_visual_get_best_type, uFv)
+GO(gdk_visual_get_best_with_both, pFiu)
GO(gdk_visual_get_best_with_depth, pFi)
-GO(gdk_visual_get_best_with_type, pFi)
+GO(gdk_visual_get_best_with_type, pFu)
GO(gdk_visual_get_bits_per_rgb, iFp)
GO(gdk_visual_get_blue_pixel_details, vFpppp)
-GO(gdk_visual_get_byte_order, iFp)
+GO(gdk_visual_get_byte_order, uFp)
GO(gdk_visual_get_colormap_size, iFp)
GO(gdk_visual_get_depth, iFp)
GO(gdk_visual_get_green_pixel_details, vFpppp)
@@ -561,9 +561,9 @@ GO(gdk_visual_get_red_pixel_details, vFpppp)
GO(gdk_visual_get_screen, pFp)
GO(gdk_visual_get_system, pFv)
GO(gdk_visual_get_type, LFv)
-GO(gdk_visual_get_visual_type, iFp)
+GO(gdk_visual_get_visual_type, uFp)
GO(gdk_visual_type_get_type, LFv)
-//GO(gdk_wcstombs,
+GO(gdk_wcstombs, pFp)
GOM(gdk_window_add_filter, vFEppp)
GO(gdk_window_at_pointer, pFpp)
//GO(gdk_window_attributes_type_get_type,
@@ -580,7 +580,7 @@ GO(gdk_window_configure_finished, vFp)
GO(gdk_window_constrain_size, vFpuiipp)
GO(gdk_window_coords_from_parent, vFpddpp)
GO(gdk_window_coords_to_parent, vFpddpp)
-GO(gdk_window_create_similar_surface, pFpiii)
+GO(gdk_window_create_similar_surface, pFpuii)
GO(gdk_window_deiconify, vFp)
GO(gdk_window_destroy, vFp)
//GO(gdk_window_destroy_notify,
@@ -606,7 +606,7 @@ GO(gdk_window_get_deskrelative_origin, iFppp)
GO(gdk_window_get_display, pFp)
GO(gdk_window_get_effective_parent, pFp)
GO(gdk_window_get_effective_toplevel, pFp)
-GO(gdk_window_get_events, vFpi)
+GO(gdk_window_get_events, uFp)
GO(gdk_window_get_focus_on_map, iFp)
GO(gdk_window_get_frame_extents, vFpp)
GO(gdk_window_get_geometry, vFpppppp)
@@ -621,15 +621,15 @@ GO(gdk_window_get_position, vFppp)
GO(gdk_window_get_root_coords, vFpiipp)
GO(gdk_window_get_root_origin, vFppp)
GO(gdk_window_get_screen, pFp)
-GO(gdk_window_get_state, iFp)
+GO(gdk_window_get_state, uFp)
GO(gdk_window_get_toplevel, pFp)
GO(gdk_window_get_toplevels, pFp)
-GO(gdk_window_get_type_hint, iFp)
+GO(gdk_window_get_type_hint, uFp)
GO(gdk_window_get_update_area, pFp)
GO(gdk_window_get_user_data, vFpp)
GO(gdk_window_get_visual, pFp)
GO(gdk_window_get_width, iFp)
-GO(gdk_window_get_window_type, iFp)
+GO(gdk_window_get_window_type, uFp)
GO(gdk_window_has_native, iFp)
GO(gdk_window_hide, vFp)
GO(gdk_window_hints_get_type, LFv)
@@ -646,7 +646,7 @@ GO(gdk_window_is_input_only, iFp)
GO(gdk_window_is_shaped, iFp)
GO(gdk_window_is_viewable, iFp)
GO(gdk_window_is_visible, iFp)
-GO(gdk_window_lookup, pFp)
+GO(gdk_window_lookup, pFu)
GO(gdk_window_lookup_for_display, pFpp)
GO(gdk_window_lower, vFp)
GO(gdk_window_maximize, vFp)
@@ -677,11 +677,11 @@ GO(gdk_window_set_child_shapes, vFp)
GO(gdk_window_set_composited, vFpi)
GO(gdk_window_set_cursor, vFpp)
GO(gdk_window_set_debug_updates, vFi)
-GO(gdk_window_set_decorations, vFpp)
-GO(gdk_window_set_events, vFpp)
+GO(gdk_window_set_decorations, vFpu)
+GO(gdk_window_set_events, vFpu)
GO(gdk_window_set_focus_on_map, vFpi)
GO(gdk_window_set_functions, vFpu)
-GO(gdk_window_set_geometry_hints, vFppi)
+GO(gdk_window_set_geometry_hints, vFppu)
GO(gdk_window_set_group, vFpp)
GO(gdk_window_set_hints, vFpiiiiiii)
GO(gdk_window_set_icon, vFpppp)
@@ -690,7 +690,7 @@ GO(gdk_window_set_icon_name, vFpp)
GO(gdk_window_set_keep_above, vFpi)
GO(gdk_window_set_keep_below, vFpi)
GO(gdk_window_set_modal_hint, iFp)
-GO(gdk_window_set_opacity, vFpi)
+GO(gdk_window_set_opacity, vFpd)
GO(gdk_window_set_override_redirect, vFpi)
GO(gdk_window_set_role, vFpp)
GO(gdk_window_set_skip_pager_hint, vFpi)
@@ -699,7 +699,7 @@ GO(gdk_window_set_startup_id, vFpp)
GO(gdk_window_set_static_gravities, iFpi)
GO(gdk_window_set_title, vFpp)
GO(gdk_window_set_transient_for, vFpp)
-GO(gdk_window_set_type_hint, vFpi)
+GO(gdk_window_set_type_hint, vFpu)
GO(gdk_window_set_urgency_hint, vFpi)
GO(gdk_window_set_user_data, vFpp)
GO(gdk_window_shape_combine_mask, vFppii)
@@ -789,4 +789,4 @@ GO(dummy_set_child_property, vFppupp) // to get vFppupp for gtkclass.c
GO2(gdk_pixmap_ref, pFp, g_object_ref)
GO2(gdk_pixmap_unref, vFp, g_object_unref)
GO2(gdk_bitmap_ref, pFp, g_object_ref)
-GO2(gdk_bitmap_unref, vFp, g_object_unref) \ No newline at end of file
+GO2(gdk_bitmap_unref, vFp, g_object_unref)
diff --git a/src/wrapped/wrappedgio2.c b/src/wrapped/wrappedgio2.c
index dbc67d7..e4837e7 100755..100644
--- a/src/wrapped/wrappedgio2.c
+++ b/src/wrapped/wrappedgio2.c
@@ -18,11 +18,16 @@
#include "box64context.h"
#include "emu/x64emu_private.h"
#include "myalign.h"
+#include "gtkclass.h"
const char* gio2Name = "libgio-2.0.so.0";
#define LIBNAME gio2
+typedef size_t(*LFv_t)(void);
+
#define ADDED_FUNCTIONS() \
+ GO(g_application_get_type, LFv_t) \
+ GO(g_dbus_proxy_get_type, LFv_t) \
#include "wrappedgio2types.h"
@@ -36,10 +41,10 @@ GO(3)
// GAsyncReadyCallback
#define GO(A) \
-static uintptr_t my_GAsyncReadyCallback_fct_##A = 0; \
-static void my_GAsyncReadyCallback_##A(void* source, void* res, void* data) \
-{ \
- RunFunction(my_context, my_GAsyncReadyCallback_fct_##A, 3, source, res, data);\
+static uintptr_t my_GAsyncReadyCallback_fct_##A = 0; \
+static void my_GAsyncReadyCallback_##A(void* source, void* res, void* data) \
+{ \
+ RunFunctionFmt(my_GAsyncReadyCallback_fct_##A, "ppp", source, res, data); \
}
SUPER()
#undef GO
@@ -59,10 +64,10 @@ static void* findGAsyncReadyCallbackFct(void* fct)
// GDestroyNotify
#define GO(A) \
-static uintptr_t my_GDestroyNotify_fct_##A = 0; \
-static void my_GDestroyNotify_##A(void* data) \
-{ \
- RunFunction(my_context, my_GDestroyNotify_fct_##A, 1, data);\
+static uintptr_t my_GDestroyNotify_fct_##A = 0; \
+static void my_GDestroyNotify_##A(void* data) \
+{ \
+ RunFunctionFmt(my_GDestroyNotify_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -82,10 +87,10 @@ static void* findGDestroyNotifyFct(void* fct)
// GDBusProxyTypeFunc
#define GO(A) \
-static uintptr_t my_GDBusProxyTypeFunc_fct_##A = 0; \
-static int my_GDBusProxyTypeFunc_##A(void* manager, void* path, void* name, void* data) \
-{ \
- return (int)RunFunction(my_context, my_GDBusProxyTypeFunc_fct_##A, 4, manager, path, name, data);\
+static uintptr_t my_GDBusProxyTypeFunc_fct_##A = 0; \
+static int my_GDBusProxyTypeFunc_##A(void* manager, void* path, void* name, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_GDBusProxyTypeFunc_fct_##A, "pppp", manager, path, name, data); \
}
SUPER()
#undef GO
@@ -105,10 +110,10 @@ static void* findGDBusProxyTypeFuncFct(void* fct)
// GSimpleAsyncThreadFunc
#define GO(A) \
-static uintptr_t my_GSimpleAsyncThreadFunc_fct_##A = 0; \
-static void my_GSimpleAsyncThreadFunc_##A(void* res, void* object, void* cancellable) \
-{ \
- RunFunction(my_context, my_GSimpleAsyncThreadFunc_fct_##A, 3, res, object, cancellable);\
+static uintptr_t my_GSimpleAsyncThreadFunc_fct_##A = 0; \
+static void my_GSimpleAsyncThreadFunc_##A(void* res, void* object, void* cancellable) \
+{ \
+ RunFunctionFmt(my_GSimpleAsyncThreadFunc_fct_##A, "ppp", res, object, cancellable); \
}
SUPER()
#undef GO
@@ -128,10 +133,10 @@ static void* findGSimpleAsyncThreadFuncFct(void* fct)
// GCallback
#define GO(A) \
-static uintptr_t my_GCallback_fct_##A = 0; \
-static void my_GCallback_##A(void* a, void* b, void* c, void* d) \
-{ \
- RunFunction(my_context, my_GCallback_fct_##A, 4, a, b, c, d);\
+static uintptr_t my_GCallback_fct_##A = 0; \
+static void my_GCallback_##A(void* a, void* b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_GCallback_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -151,10 +156,10 @@ static void* findGCallbackFct(void* fct)
// GDBusSignalCallback
#define GO(A) \
-static uintptr_t my_GDBusSignalCallback_fct_##A = 0; \
-static void my_GDBusSignalCallback_##A(void* connection, void* sender, void* object, void* interface, void* signal, void* param, void* data) \
-{ \
- RunFunction(my_context, my_GDBusSignalCallback_fct_##A, 7, connection, sender, object, interface, signal, param, data);\
+static uintptr_t my_GDBusSignalCallback_fct_##A = 0; \
+static void my_GDBusSignalCallback_##A(void* connection, void* sender, void* object, void* interface, void* signal, void* param, void* data) \
+{ \
+ RunFunctionFmt(my_GDBusSignalCallback_fct_##A, "ppppppp", connection, sender, object, interface, signal, param, data); \
}
SUPER()
#undef GO
@@ -174,10 +179,10 @@ static void* findGDBusSignalCallbackFct(void* fct)
// GDBusMessageFilterFunction
#define GO(A) \
-static uintptr_t my_GDBusMessageFilterFunction_fct_##A = 0; \
-static void my_GDBusMessageFilterFunction_##A(void* connection, void* message, int incoming, void* data) \
-{ \
- RunFunction(my_context, my_GDBusMessageFilterFunction_fct_##A, 4, connection, message, incoming, data);\
+static uintptr_t my_GDBusMessageFilterFunction_fct_##A = 0; \
+static void my_GDBusMessageFilterFunction_##A(void* connection, void* message, int incoming, void* data) \
+{ \
+ RunFunctionFmt(my_GDBusMessageFilterFunction_fct_##A, "ppip", connection, message, incoming, data); \
}
SUPER()
#undef GO
@@ -197,10 +202,10 @@ static void* findGDBusMessageFilterFunctionFct(void* fct)
// GBusNameAppearedCallback
#define GO(A) \
-static uintptr_t my_GBusNameAppearedCallback_fct_##A = 0; \
-static void my_GBusNameAppearedCallback_##A(void* connection, void* name, void* owner, void* data) \
-{ \
- RunFunction(my_context, my_GBusNameAppearedCallback_fct_##A, 4, connection, name, owner, data); \
+static uintptr_t my_GBusNameAppearedCallback_fct_##A = 0; \
+static void my_GBusNameAppearedCallback_##A(void* connection, void* name, void* owner, void* data) \
+{ \
+ RunFunctionFmt(my_GBusNameAppearedCallback_fct_##A, "pppp", connection, name, owner, data); \
}
SUPER()
#undef GO
@@ -220,10 +225,10 @@ static void* findGBusNameAppearedCallbackFct(void* fct)
// GBusNameVanishedCallback
#define GO(A) \
-static uintptr_t my_GBusNameVanishedCallback_fct_##A = 0; \
-static void my_GBusNameVanishedCallback_##A(void* connection, void* name, void* data) \
-{ \
- RunFunction(my_context, my_GBusNameVanishedCallback_fct_##A, 3, connection, name, data);\
+static uintptr_t my_GBusNameVanishedCallback_fct_##A = 0; \
+static void my_GBusNameVanishedCallback_##A(void* connection, void* name, void* data) \
+{ \
+ RunFunctionFmt(my_GBusNameVanishedCallback_fct_##A, "ppp", connection, name, data); \
}
SUPER()
#undef GO
@@ -243,10 +248,10 @@ static void* findGBusNameVanishedCallbackFct(void* fct)
// GBusAcquiredCallback
#define GO(A) \
-static uintptr_t my_GBusAcquiredCallback_fct_##A = 0; \
-static void my_GBusAcquiredCallback_##A(void* connection, void* name, void* data) \
-{ \
- RunFunction(my_context, my_GBusAcquiredCallback_fct_##A, 3, connection, name, data);\
+static uintptr_t my_GBusAcquiredCallback_fct_##A = 0; \
+static void my_GBusAcquiredCallback_##A(void* connection, void* name, void* data) \
+{ \
+ RunFunctionFmt(my_GBusAcquiredCallback_fct_##A, "ppp", connection, name, data); \
}
SUPER()
#undef GO
@@ -266,10 +271,10 @@ static void* findGBusAcquiredCallbackFct(void* fct)
// GBusNameAcquiredCallback
#define GO(A) \
-static uintptr_t my_GBusNameAcquiredCallback_fct_##A = 0; \
-static void my_GBusNameAcquiredCallback_##A(void* connection, void* name, void* data) \
-{ \
- RunFunction(my_context, my_GBusNameAcquiredCallback_fct_##A, 3, connection, name, data);\
+static uintptr_t my_GBusNameAcquiredCallback_fct_##A = 0; \
+static void my_GBusNameAcquiredCallback_##A(void* connection, void* name, void* data) \
+{ \
+ RunFunctionFmt(my_GBusNameAcquiredCallback_fct_##A, "ppp", connection, name, data); \
}
SUPER()
#undef GO
@@ -289,10 +294,10 @@ static void* findGBusNameAcquiredCallbackFct(void* fct)
// GBusNameLostCallback
#define GO(A) \
-static uintptr_t my_GBusNameLostCallback_fct_##A = 0; \
-static void my_GBusNameLostCallback_##A(void* connection, void* name, void* data) \
-{ \
- RunFunction(my_context, my_GBusNameLostCallback_fct_##A, 3, connection, name, data);\
+static uintptr_t my_GBusNameLostCallback_fct_##A = 0; \
+static void my_GBusNameLostCallback_##A(void* connection, void* name, void* data) \
+{ \
+ RunFunctionFmt(my_GBusNameLostCallback_fct_##A, "ppp", connection, name, data); \
}
SUPER()
#undef GO
@@ -318,24 +323,24 @@ typedef struct my_GDBusInterfaceVTable_s {
int (*set_property) (void* connection, void* sender, void* object_path, void* interface_name, void* value, void* error, void* user_data);
} my_GDBusInterfaceVTable_t;
-#define GO(A) \
+#define GO(A) \
static my_GDBusInterfaceVTable_t my_GDBusInterfaceVTable_##A = {0}; \
static my_GDBusInterfaceVTable_t *ref_GDBusInterfaceVTable_##A = NULL;
SUPER()
#undef GO
// then the static functions callback that may be used with the structure, but dispatch also have a callback...
#define GO(A) \
-static uintptr_t fct_funcs_method_call_##A = 0; \
-static void my_funcs_method_call_##A(void* connection, void* sender, void* object_path, void* interface_name, void* method_name, void* invocation, void* user_data) { \
- RunFunction(my_context, fct_funcs_method_call_##A, 8, connection, sender, object_path, interface_name, method_name, invocation, user_data); \
-} \
-static uintptr_t fct_funcs_get_property_##A = 0; \
-static void* my_funcs_get_property_##A(void* connection, void* sender, void* object_path, void* interface_name, void* error, void* user_data) { \
- return (void*)RunFunction(my_context, fct_funcs_get_property_##A, 7, connection, sender, object_path, interface_name, error, user_data); \
-} \
-static uintptr_t fct_funcs_set_property_##A = 0; \
-static int my_funcs_set_property_##A(void* connection, void* sender, void* object_path, void* interface_name, void* value, void* error, void* user_data) { \
- return (int)RunFunction(my_context, fct_funcs_set_property_##A, 8, connection, sender, object_path, interface_name, value, error, user_data); \
+static uintptr_t fct_funcs_method_call_##A = 0; \
+static void my_funcs_method_call_##A(void* connection, void* sender, void* object_path, void* interface_name, void* method_name, void* parameters, void* invocation, void* user_data) { \
+ RunFunctionFmt(fct_funcs_method_call_##A, "pppppppp", connection, sender, object_path, interface_name, method_name, parameters, invocation, user_data); \
+} \
+static uintptr_t fct_funcs_get_property_##A = 0; \
+static void* my_funcs_get_property_##A(void* connection, void* sender, void* object_path, void* interface_name, void* property_name, void* error, void* user_data) { \
+ return (void*)RunFunctionFmt(fct_funcs_get_property_##A, "ppppppp", connection, sender, object_path, interface_name, property_name, error, user_data); \
+} \
+static uintptr_t fct_funcs_set_property_##A = 0; \
+static int my_funcs_set_property_##A(void* connection, void* sender, void* object_path, void* interface_name, void* property_name, void* value, void* error, void* user_data) { \
+ return (int)RunFunctionFmt(fct_funcs_set_property_##A, "pppppppp", connection, sender, object_path, interface_name, property_name, value, error, user_data); \
}
SUPER()
@@ -364,6 +369,16 @@ static my_GDBusInterfaceVTable_t* findFreeGDBusInterfaceVTable(my_GDBusInterface
}
#undef SUPER
+EXPORT void* my_g_task_new(x64emu_t* emu, void* source_object, void* cancellable, void* cb, void* data)
+{
+ return my->g_task_new(source_object, cancellable, findGAsyncReadyCallbackFct(cb), data);
+}
+
+EXPORT void my_g_task_return_pointer(x64emu_t* emu, void* task, void* result, void* destroy)
+{
+ my->g_task_return_pointer(task, result, findGDestroyNotifyFct(destroy));
+}
+
EXPORT void my_g_dbus_proxy_new(x64emu_t* emu, void* connection, int flags, void* info, void* name, void* path, void* interface, void* cancellable, void* cb, void* data)
{
my->g_dbus_proxy_new(connection, flags, info, name, path, interface, cancellable, findGAsyncReadyCallbackFct(cb), data);
@@ -563,8 +578,22 @@ EXPORT void my_g_simple_async_result_set_error(x64emu_t* emu, void* simple, void
EXPORT void* my_g_initable_new(x64emu_t* emu, void* type, void* cancel, void* err, void* first, uintptr_t* b)
{
- myStackAlign(emu, first, b, emu->scratch, R_EAX, 4);
+ #if 0
+ // look for number of pairs
+ int n = 1;
+ emu->scratch[0] = (uint64_t)first;
+ emu->scratch[1] = getVArgs(emu, 4, b, 0);
+ while(getVArgs(emu, 4, b, n)) {
+ emu->scratch[n+1] = getVArgs(emu, 4, b, n);
+ emu->scratch[n+2] = getVArgs(emu, 4, b, n+1);
+ n+=2;
+ }
+ emu->scratch[n+1] = 0;
+ emu->scratch[n+2] = 0;
PREPARE_VALIST;
+ #else
+ CREATE_VALIST_FROM_VAARG(b, emu->scratch, 4);
+ #endif
return my->g_initable_new_valist(type, first, VARARGS, cancel, err);
}
@@ -578,13 +607,23 @@ EXPORT void* my_g_initable_new_valist(x64emu_t* emu, void* type, void* first, x6
return my->g_initable_new_valist(type, first, VARARGS, cancel, err);
}
+EXPORT void my_g_task_return_new_error(x64emu_t* emu, void* task, uint32_t domain, int code, void *fmt, va_list b)
+{
+ char* tmp;
+ int dummy = vasprintf(&tmp, fmt, b);
+ (void)dummy;
+ my->g_task_return_new_error(task, domain, code, tmp);
+ free(tmp);
+}
#define PRE_INIT \
if(box64_nogtk) \
return -1;
#define CUSTOM_INIT \
- getMy(lib); \
+ getMy(lib); \
+ SetGApplicationID(my->g_application_get_type()); \
+ SetGDBusProxyID(my->g_dbus_proxy_get_type()); \
setNeededLibs(lib, 1, "libgmodule-2.0.so.0");
#define CUSTOM_FINI \
diff --git a/src/wrapped/wrappedgio2_private.h b/src/wrapped/wrappedgio2_private.h
index dca16c2..560b251 100755..100644
--- a/src/wrapped/wrappedgio2_private.h
+++ b/src/wrapped/wrappedgio2_private.h
@@ -3,17 +3,17 @@
#endif
//GO(_fini,
-//GO(g_action_activate,
+GO(g_action_activate, vFpp)
//GO(g_action_change_state,
-//GO(g_action_get_enabled,
-//GO(g_action_get_name,
+GO(g_action_get_enabled, iFp)
+GO(g_action_get_name, pFp)
//GO(g_action_get_parameter_type,
-//GO(g_action_get_state,
+GO(g_action_get_state, pFp)
//GO(g_action_get_state_hint,
-//GO(g_action_get_state_type,
+GO(g_action_get_state_type, pFp)
//GO(g_action_get_type,
GO(g_action_group_action_added, vFpp)
-GO(g_action_group_action_enabled_changed, vFppp)
+GO(g_action_group_action_enabled_changed, vFppi)
GO(g_action_group_action_removed, vFpp)
GO(g_action_group_action_state_changed, vFppp)
GO(g_action_group_activate_action, vFppp)
@@ -27,14 +27,14 @@ GO(g_action_group_get_type, LFv)
GO(g_action_group_has_action, iFpp)
GO(g_action_group_list_actions, pFp)
GO(g_action_group_query_action, iFppppppp)
-//GO(g_action_map_add_action,
-//GO(g_action_map_add_action_entries,
+GO(g_action_map_add_action, vFpp)
+GO(g_action_map_add_action_entries, vFppip)
//GO(g_action_map_get_type,
-//GO(g_action_map_lookup_action,
-//GO(g_action_map_remove_action,
+GO(g_action_map_lookup_action, pFpp)
+GO(g_action_map_remove_action, vFpp)
//GO(g_action_name_is_valid,
-//GO(g_action_parse_detailed_name,
-//GO(g_action_print_detailed_name,
+GO(g_action_parse_detailed_name, iFpppp)
+GO(g_action_print_detailed_name, pFpp)
GO(g_app_info_add_supports_type, iFppp)
GO(g_app_info_can_delete, iFp)
GO(g_app_info_can_remove_supports_type, iFp)
@@ -46,7 +46,7 @@ GO(g_app_info_equal, iFpp)
GO(g_app_info_get_all, pFv)
GO(g_app_info_get_all_for_type, pFp)
GO(g_app_info_get_commandline, pFp)
-GO(g_app_info_get_default_for_type, pFpp)
+GO(g_app_info_get_default_for_type, pFpi)
GO(g_app_info_get_default_for_uri_scheme, pFp)
GO(g_app_info_get_description, pFp)
GO(g_app_info_get_display_name, pFp)
@@ -61,7 +61,7 @@ GO(g_app_info_get_type, LFv)
GO(g_app_info_launch, iFpppp)
GO(g_app_info_launch_default_for_uri, iFppp)
GO(g_app_info_launch_uris, iFpppp)
-//GO(g_app_info_monitor_get,
+GO(g_app_info_monitor_get, pFv)
GO(g_app_info_monitor_get_type, LFv)
GO(g_app_info_remove_supports_type, iFppp)
GO(g_app_info_reset_type_associations, vFp)
@@ -72,60 +72,60 @@ GO(g_app_info_should_show, iFp)
GO(g_app_info_supports_files, iFp)
GO(g_app_info_supports_uris, iFp)
//GO(g_app_launch_context_get_display,
-//GO(g_app_launch_context_get_environment,
-//GO(g_app_launch_context_get_startup_notify_id,
+GO(g_app_launch_context_get_environment, pFp)
+GO(g_app_launch_context_get_startup_notify_id, pFppp)
GO(g_app_launch_context_get_type, LFv)
-//GO(g_app_launch_context_launch_failed,
-//GO(g_app_launch_context_new,
-//GO(g_app_launch_context_setenv,
+GO(g_app_launch_context_launch_failed, vFpp)
+GO(g_app_launch_context_new, pFv)
+GO(g_app_launch_context_setenv, vFppp)
//GO(g_app_launch_context_unsetenv,
-//GO(g_application_activate,
-//GO(g_application_add_main_option,
-//GO(g_application_add_main_option_entries,
-//GO(g_application_add_option_group,
-//GO(g_application_command_line_create_file_for_arg,
-//GO(g_application_command_line_get_arguments,
-//GO(g_application_command_line_get_cwd,
-//GO(g_application_command_line_getenv,
-//GO(g_application_command_line_get_environ,
-//GO(g_application_command_line_get_exit_status,
-//GO(g_application_command_line_get_is_remote,
-//GO(g_application_command_line_get_options_dict,
-//GO(g_application_command_line_get_platform_data,
-//GO(g_application_command_line_get_stdin,
+GO(g_application_activate, vFp)
+GO(g_application_add_main_option, vFppCuupp)
+GO(g_application_add_main_option_entries, vFpp)
+GO(g_application_add_option_group, vFpp)
+GO(g_application_command_line_create_file_for_arg, pFpp)
+GO(g_application_command_line_get_arguments, pFpp)
+GO(g_application_command_line_get_cwd, pFp)
+GO(g_application_command_line_getenv, pFpp)
+GO(g_application_command_line_get_environ, pFp)
+GO(g_application_command_line_get_exit_status, iFp)
+GO(g_application_command_line_get_is_remote, iFp)
+GO(g_application_command_line_get_options_dict, pFp)
+GO(g_application_command_line_get_platform_data, pFp)
+GO(g_application_command_line_get_stdin, pFp)
//GO(g_application_command_line_get_type,
//GO(g_application_command_line_print,
//GO(g_application_command_line_printerr,
-//GO(g_application_command_line_set_exit_status,
+GO(g_application_command_line_set_exit_status, vFpi)
//GO(g_application_flags_get_type,
//GO(g_application_get_application_id,
-//GO(g_application_get_dbus_connection,
+GO(g_application_get_dbus_connection, pFp)
//GO(g_application_get_dbus_object_path,
-//GO(g_application_get_default,
-//GO(g_application_get_flags,
-//GO(g_application_get_inactivity_timeout,
+GO(g_application_get_default, pFv)
+GO(g_application_get_flags, uFp)
+GO(g_application_get_inactivity_timeout, uFp)
//GO(g_application_get_is_registered,
//GO(g_application_get_is_remote,
-//GO(g_application_get_resource_base_path,
-//GO(g_application_get_type,
+GO(g_application_get_resource_base_path, pFp)
+GO(g_application_get_type, LFv)
//GO(g_application_hold,
//GO(g_application_id_is_valid,
//GO(g_application_mark_busy,
-//GO(g_application_new,
-//GO(g_application_open,
-//GO(g_application_quit,
-//GO(g_application_register,
-//GO(g_application_release,
-//GO(g_application_run,
-//GO(g_application_send_notification,
-//GO(g_application_set_action_group,
+GO(g_application_new, pFpu)
+GO(g_application_open, vFppip)
+GO(g_application_quit, vFp)
+GO(g_application_register, iFppp)
+GO(g_application_release, vFp)
+GO(g_application_run, iFpip)
+GO(g_application_send_notification, vFppp)
+GO(g_application_set_action_group, vFpp)
//GO(g_application_set_application_id,
//GO(g_application_set_default,
-//GO(g_application_set_flags,
-//GO(g_application_set_inactivity_timeout,
+GO(g_application_set_flags, vFpu)
+GO(g_application_set_inactivity_timeout, vFpu)
//GO(g_application_set_resource_base_path,
//GO(g_application_unmark_busy,
-//GO(g_application_withdraw_notification,
+GO(g_application_withdraw_notification, vFpp)
//GO(g_ask_password_flags_get_type,
GO(g_async_initable_get_type, LFv)
GOM(g_async_initable_init_async, vFEpippp)
@@ -134,30 +134,30 @@ GOM(g_async_initable_new_async, vFEiippppV)
GO(g_async_initable_new_finish, pFppp)
GOM(g_async_initable_new_valist_async, vFEipAippp)
GOM(g_async_initable_newv_async, vFEiupippp)
-//GO(g_async_result_get_source_object,
-//GO(g_async_result_get_type,
-//GO(g_async_result_get_user_data,
-//GO(g_async_result_is_tagged,
+GO(g_async_result_get_source_object, pFp)
+GO(g_async_result_get_type, LFv)
+GO(g_async_result_get_user_data, pFp)
+GO(g_async_result_is_tagged, iFpp)
//GO(g_async_result_legacy_propagate_error,
-//GO(g_buffered_input_stream_fill,
+GO(g_buffered_input_stream_fill, lFplpp)
//GO(g_buffered_input_stream_fill_async,
-//GO(g_buffered_input_stream_fill_finish,
-//GO(g_buffered_input_stream_get_available,
+GO(g_buffered_input_stream_fill_finish, lFppp)
+GO(g_buffered_input_stream_get_available, LFp)
//GO(g_buffered_input_stream_get_buffer_size,
//GO(g_buffered_input_stream_get_type,
-//GO(g_buffered_input_stream_new,
-//GO(g_buffered_input_stream_new_sized,
-//GO(g_buffered_input_stream_peek,
-//GO(g_buffered_input_stream_peek_buffer,
-//GO(g_buffered_input_stream_read_byte,
-//GO(g_buffered_input_stream_set_buffer_size,
-//GO(g_buffered_output_stream_get_auto_grow,
-//GO(g_buffered_output_stream_get_buffer_size,
+GO(g_buffered_input_stream_new, pFp)
+GO(g_buffered_input_stream_new_sized, pFpL)
+GO(g_buffered_input_stream_peek, LFppLL)
+GO(g_buffered_input_stream_peek_buffer, pFpp)
+GO(g_buffered_input_stream_read_byte, iFppp)
+GO(g_buffered_input_stream_set_buffer_size, vFpL)
+GO(g_buffered_output_stream_get_auto_grow, iFp)
+GO(g_buffered_output_stream_get_buffer_size, LFp)
//GO(g_buffered_output_stream_get_type,
-//GO(g_buffered_output_stream_new,
-//GO(g_buffered_output_stream_new_sized,
-//GO(g_buffered_output_stream_set_auto_grow,
-//GO(g_buffered_output_stream_set_buffer_size,
+GO(g_buffered_output_stream_new, pFp)
+GO(g_buffered_output_stream_new_sized, pFpL)
+GO(g_buffered_output_stream_set_auto_grow, vFpi)
+GO(g_buffered_output_stream_set_buffer_size, vFpL)
GOM(g_bus_get, vFEippp)
GO(g_bus_get_finish, pFpp)
GO(g_bus_get_sync, pFipp)
@@ -174,9 +174,9 @@ GOM(g_bus_watch_name, uFEipipppp)
GOM(g_bus_watch_name_on_connection, uFEppipppp)
GO(g_bus_watch_name_on_connection_with_closures, uFppipp) // mmm closure, wrapped or unwrapped?
GO(g_bus_watch_name_with_closures, uFipipp)
-//GO(g_bytes_icon_get_bytes,
+GO(g_bytes_icon_get_bytes, pFp)
//GO(g_bytes_icon_get_type,
-//GO(g_bytes_icon_new,
+GO(g_bytes_icon_new, pFp)
GO(g_cancellable_cancel, vFp)
GOM(g_cancellable_connect, LFEpppp)
GO(g_cancellable_disconnect, vFpL)
@@ -192,11 +192,11 @@ GO(g_cancellable_release_fd, vFp)
GO(g_cancellable_reset, vFp)
GO(g_cancellable_set_error_if_cancelled, iFpp)
GO(g_cancellable_source_new, pFp)
-//GO(g_charset_converter_get_num_fallbacks,
+GO(g_charset_converter_get_num_fallbacks, uFp)
GO(g_charset_converter_get_type, LFv)
-//GO(g_charset_converter_get_use_fallback,
-//GO(g_charset_converter_new,
-//GO(g_charset_converter_set_use_fallback,
+GO(g_charset_converter_get_use_fallback, iFp)
+GO(g_charset_converter_new, pFppp)
+GO(g_charset_converter_set_use_fallback, vFpi)
GO(g_content_type_can_be_executable, iFp)
GO(g_content_type_equals, iFpp)
GO(g_content_type_from_mime_type, pFp)
@@ -210,72 +210,72 @@ GO(g_content_type_guess_for_tree, pFp)
GO(g_content_type_is_a, iFpp)
GO(g_content_type_is_unknown, iFp)
GO(g_content_types_get_registered, pFv)
-//GO(g_converter_convert,
+GO(g_converter_convert, uFppLpLuppp)
//GO(g_converter_flags_get_type,
//GO(g_converter_get_type,
-//GO(g_converter_input_stream_get_converter,
+GO(g_converter_input_stream_get_converter, pFp)
//GO(g_converter_input_stream_get_type,
-//GO(g_converter_input_stream_new,
-//GO(g_converter_output_stream_get_converter,
+GO(g_converter_input_stream_new, pFpp)
+GO(g_converter_output_stream_get_converter, pFp)
//GO(g_converter_output_stream_get_type,
-//GO(g_converter_output_stream_new,
+GO(g_converter_output_stream_new, pFpp)
//GO(g_converter_reset,
//GO(g_converter_result_get_type,
-//GO(g_credentials_get_native,
+GO(g_credentials_get_native, pFpu)
//GO(g_credentials_get_type,
-//GO(g_credentials_get_unix_pid,
-//GO(g_credentials_get_unix_user,
-//GO(g_credentials_is_same_user,
-//GO(g_credentials_new,
-//GO(g_credentials_set_native,
-//GO(g_credentials_set_unix_user,
-//GO(g_credentials_to_string,
+GO(g_credentials_get_unix_pid, iFpp)
+GO(g_credentials_get_unix_user, uFpp)
+GO(g_credentials_is_same_user, iFppp)
+GO(g_credentials_new, pFv)
+GO(g_credentials_set_native, vFpup)
+GO(g_credentials_set_unix_user, iFpup)
+GO(g_credentials_to_string, pFp)
//GO(g_credentials_type_get_type,
-//GO(g_data_input_stream_get_byte_order,
-//GO(g_data_input_stream_get_newline_type,
+GO(g_data_input_stream_get_byte_order, uFp)
+GO(g_data_input_stream_get_newline_type, uFp)
//GO(g_data_input_stream_get_type,
-//GO(g_data_input_stream_new,
-//GO(g_data_input_stream_read_byte,
-//GO(g_data_input_stream_read_int16,
-//GO(g_data_input_stream_read_int32,
-//GO(g_data_input_stream_read_int64,
+GO(g_data_input_stream_new, pFp)
+GO(g_data_input_stream_read_byte, CFppp)
+GO(g_data_input_stream_read_int16, wFppp)
+GO(g_data_input_stream_read_int32, iFppp)
+GO(g_data_input_stream_read_int64, lFppp)
//GO(g_data_input_stream_read_line,
//GO(g_data_input_stream_read_line_async,
//GO(g_data_input_stream_read_line_finish,
//GO(g_data_input_stream_read_line_finish_utf8,
-//GO(g_data_input_stream_read_line_utf8,
-//GO(g_data_input_stream_read_uint16,
-//GO(g_data_input_stream_read_uint32,
-//GO(g_data_input_stream_read_uint64,
-//GO(g_data_input_stream_read_until,
+GO(g_data_input_stream_read_line_utf8, pFpppp)
+GO(g_data_input_stream_read_uint16, WFppp)
+GO(g_data_input_stream_read_uint32, uFppp)
+GO(g_data_input_stream_read_uint64, LFppp)
+GO(g_data_input_stream_read_until, pFppppp)
//GO(g_data_input_stream_read_until_async,
//GO(g_data_input_stream_read_until_finish,
-//GO(g_data_input_stream_read_upto,
+GO(g_data_input_stream_read_upto, pFpplppp)
//GO(g_data_input_stream_read_upto_async,
-//GO(g_data_input_stream_read_upto_finish,
-//GO(g_data_input_stream_set_byte_order,
-//GO(g_data_input_stream_set_newline_type,
-//GO(g_data_output_stream_get_byte_order,
+GO(g_data_input_stream_read_upto_finish, pFpppp)
+GO(g_data_input_stream_set_byte_order, vFpu)
+GO(g_data_input_stream_set_newline_type, vFpu)
+GO(g_data_output_stream_get_byte_order, uFp)
//GO(g_data_output_stream_get_type,
-//GO(g_data_output_stream_new,
-//GO(g_data_output_stream_put_byte,
-//GO(g_data_output_stream_put_int16,
-//GO(g_data_output_stream_put_int32,
-//GO(g_data_output_stream_put_int64,
-//GO(g_data_output_stream_put_string,
-//GO(g_data_output_stream_put_uint16,
-//GO(g_data_output_stream_put_uint32,
-//GO(g_data_output_stream_put_uint64,
-//GO(g_data_output_stream_set_byte_order,
+GO(g_data_output_stream_new, pFp)
+GO(g_data_output_stream_put_byte, iFpCpp)
+GO(g_data_output_stream_put_int16, iFpwpp)
+GO(g_data_output_stream_put_int32, iFpipp)
+GO(g_data_output_stream_put_int64, iFplpp)
+GO(g_data_output_stream_put_string, iFpppp)
+GO(g_data_output_stream_put_uint16, iFpWpp)
+GO(g_data_output_stream_put_uint32, iFpupp)
+GO(g_data_output_stream_put_uint64, iFpLpp)
+GO(g_data_output_stream_set_byte_order, vFpu)
//GO(g_data_stream_byte_order_get_type,
//GO(g_data_stream_newline_type_get_type,
-//GO(g_dbus_action_group_get,
+GO(g_dbus_action_group_get, pFppp)
//GO(g_dbus_action_group_get_type,
//GO(g_dbus_address_escape_value,
-//GO(g_dbus_address_get_for_bus_sync,
+GO(g_dbus_address_get_for_bus_sync, pFipp)
//GO(g_dbus_address_get_stream,
-//GO(g_dbus_address_get_stream_finish,
-//GO(g_dbus_address_get_stream_sync,
+GO(g_dbus_address_get_stream_finish, pFppp)
+GO(g_dbus_address_get_stream_sync, pFpppp)
GO(g_dbus_annotation_info_get_type, LFv)
GO(g_dbus_annotation_info_lookup, pFpp)
GO(g_dbus_annotation_info_ref, pFp)
@@ -283,30 +283,30 @@ GO(g_dbus_annotation_info_unref, vFp)
GO(g_dbus_arg_info_get_type, LFv)
GO(g_dbus_arg_info_ref, pFp)
GO(g_dbus_arg_info_unref, vFp)
-//GO(g_dbus_auth_observer_allow_mechanism,
-//GO(g_dbus_auth_observer_authorize_authenticated_peer,
+GO(g_dbus_auth_observer_allow_mechanism, iFpp)
+GO(g_dbus_auth_observer_authorize_authenticated_peer, iFppp)
//GO(g_dbus_auth_observer_get_type,
-//GO(g_dbus_auth_observer_new,
+GO(g_dbus_auth_observer_new, pFv)
GO(g_dbus_call_flags_get_type, LFv)
GO(g_dbus_capability_flags_get_type, LFv)
GOM(g_dbus_connection_add_filter, uFEpppp)
GOM(g_dbus_connection_call, vFEpppppppiippp)
GO(g_dbus_connection_call_finish, pFppp)
-GO(g_dbus_connection_call_sync, pFpppppppiipp)
+GO(g_dbus_connection_call_sync, pFpppppppuipp)
//GO(g_dbus_connection_call_with_unix_fd_list,
-//GO(g_dbus_connection_call_with_unix_fd_list_finish,
-//GO(g_dbus_connection_call_with_unix_fd_list_sync,
+GO(g_dbus_connection_call_with_unix_fd_list_finish, pFpppp)
+GO(g_dbus_connection_call_with_unix_fd_list_sync, pFpppppppuipppp)
GOM(g_dbus_connection_close, vFEpppp)
GO(g_dbus_connection_close_finish, iFppp)
GO(g_dbus_connection_close_sync, iFppp)
GO(g_dbus_connection_emit_signal, iFppppppp)
-//GO(g_dbus_connection_export_action_group,
-//GO(g_dbus_connection_export_menu_model,
+GO(g_dbus_connection_export_action_group, uFpppp)
+GO(g_dbus_connection_export_menu_model, uFpppp)
GO(g_dbus_connection_flags_get_type, LFv)
GOM(g_dbus_connection_flush, vFEpppp)
GO(g_dbus_connection_flush_finish, iFppp)
GO(g_dbus_connection_flush_sync, iFppp)
-GO(g_dbus_connection_get_capabilities, iFp)
+GO(g_dbus_connection_get_capabilities, uFp)
GO(g_dbus_connection_get_exit_on_close, iFp)
GO(g_dbus_connection_get_guid, pFp)
GO(g_dbus_connection_get_last_serial, uFp)
@@ -319,40 +319,40 @@ GOM(g_dbus_connection_new, vFEppipppp)
GO(g_dbus_connection_new_finish, pFpp)
GOM(g_dbus_connection_new_for_address, vFEpipppp)
GO(g_dbus_connection_new_for_address_finish, pFpp)
-GO(g_dbus_connection_new_for_address_sync, pFpippp)
-GO(g_dbus_connection_new_sync, pFppippp)
+GO(g_dbus_connection_new_for_address_sync, pFpuppp)
+GO(g_dbus_connection_new_sync, pFppuppp)
GOM(g_dbus_connection_register_object, uFEppppppp)
//GOM(g_dbus_connection_register_subtree, uFEppppppp) // vtable need wrapping
GO(g_dbus_connection_remove_filter, vFpu)
-GO(g_dbus_connection_send_message, iFppipp) //TODO: there is an argument as "volatile".. does that change anything???
+GO(g_dbus_connection_send_message, iFppupp)
GOM(g_dbus_connection_send_message_with_reply, vFEppiipppp) //TODO: same volatile argument...
GO(g_dbus_connection_send_message_with_reply_finish, pFppp)
-GO(g_dbus_connection_send_message_with_reply_sync, pFppiippp) //TODO: same volatile
+GO(g_dbus_connection_send_message_with_reply_sync, pFppuippp)
GO(g_dbus_connection_set_exit_on_close, vFpi)
GOM(g_dbus_connection_signal_subscribe, uFEppppppippp)
GO(g_dbus_connection_signal_unsubscribe, vFpu)
GO(g_dbus_connection_start_message_processing, vFp)
//GO(g_dbus_connection_unexport_action_group,
-//GO(g_dbus_connection_unexport_menu_model,
+GO(g_dbus_connection_unexport_menu_model, vFpu)
GO(g_dbus_connection_unregister_object, iFpu)
GO(g_dbus_connection_unregister_subtree, iFpu)
-//GO(g_dbus_error_encode_gerror,
+GO(g_dbus_error_encode_gerror, pFp)
//GO(g_dbus_error_get_remote_error,
//GO(g_dbus_error_get_type,
-//GO(g_dbus_error_is_remote_error,
-//GO(g_dbus_error_new_for_dbus_error,
-//GO(g_dbus_error_quark,
+GO(g_dbus_error_is_remote_error, iFp)
+GO(g_dbus_error_new_for_dbus_error, pFpp)
+GO(g_dbus_error_quark, uFv)
//GO(g_dbus_error_register_error,
GO(g_dbus_error_register_error_domain, vFpppu)
//GO(g_dbus_error_set_dbus_error,
//GO(g_dbus_error_set_dbus_error_valist,
-//GO(g_dbus_error_strip_remote_error,
-//GO(g_dbus_error_unregister_error,
+GO(g_dbus_error_strip_remote_error, iFp)
+GO(g_dbus_error_unregister_error, iFuip)
GO(g_dbus_generate_guid, pFv)
GO(g_dbus_gvalue_to_gvariant, pFpp)
GO(g_dbus_gvariant_to_gvalue, vFpp)
-//GO(g_dbus_interface_dup_object,
-//GO(g_dbus_interface_get_info,
+GO(g_dbus_interface_dup_object, pFp)
+GO(g_dbus_interface_get_info, pFp)
//GO(g_dbus_interface_get_object,
//GO(g_dbus_interface_get_type,
GO(g_dbus_interface_info_cache_build, vFp)
@@ -364,22 +364,22 @@ GO(g_dbus_interface_info_lookup_property, pFpp)
GO(g_dbus_interface_info_lookup_signal, pFpp)
GO(g_dbus_interface_info_ref, pFp)
GO(g_dbus_interface_info_unref, vFp)
-//GO(g_dbus_interface_set_object,
-//GO(g_dbus_interface_skeleton_export,
+GO(g_dbus_interface_set_object, vFpp)
+GO(g_dbus_interface_skeleton_export, iFpppp)
//GO(g_dbus_interface_skeleton_flags_get_type,
//GO(g_dbus_interface_skeleton_flush,
-//GO(g_dbus_interface_skeleton_get_connection,
-//GO(g_dbus_interface_skeleton_get_connections,
-//GO(g_dbus_interface_skeleton_get_flags,
-//GO(g_dbus_interface_skeleton_get_info,
-//GO(g_dbus_interface_skeleton_get_object_path,
-//GO(g_dbus_interface_skeleton_get_properties,
+GO(g_dbus_interface_skeleton_get_connection, pFp)
+GO(g_dbus_interface_skeleton_get_connections, pFp)
+GO(g_dbus_interface_skeleton_get_flags, uFp)
+GO(g_dbus_interface_skeleton_get_info, pFp)
+GO(g_dbus_interface_skeleton_get_object_path, pFp)
+GO(g_dbus_interface_skeleton_get_properties, pFp)
//GO(g_dbus_interface_skeleton_get_type,
//GO(g_dbus_interface_skeleton_get_vtable,
-//GO(g_dbus_interface_skeleton_has_connection,
-//GO(g_dbus_interface_skeleton_set_flags,
+GO(g_dbus_interface_skeleton_has_connection, iFpp)
+GO(g_dbus_interface_skeleton_set_flags, vFpu)
//GO(g_dbus_interface_skeleton_unexport,
-//GO(g_dbus_interface_skeleton_unexport_from_connection,
+GO(g_dbus_interface_skeleton_unexport_from_connection, vFpp)
GO(g_dbus_is_address, iFp)
GO(g_dbus_is_guid, iFp)
GO(g_dbus_is_interface_name, iFp)
@@ -395,16 +395,16 @@ GO(g_dbus_message_copy, pFpp)
GO(g_dbus_message_flags_get_type, LFv)
GO(g_dbus_message_get_arg0, pFp)
GO(g_dbus_message_get_body, pFp)
-GO(g_dbus_message_get_byte_order, iFp)
+GO(g_dbus_message_get_byte_order, uFp)
GO(g_dbus_message_get_destination, pFp)
GO(g_dbus_message_get_error_name, pFp)
-GO(g_dbus_message_get_flags, iFp)
-GO(g_dbus_message_get_header, pFpi)
+GO(g_dbus_message_get_flags, uFp)
+GO(g_dbus_message_get_header, pFpu)
GO(g_dbus_message_get_header_fields, pFp)
GO(g_dbus_message_get_interface, pFp)
GO(g_dbus_message_get_locked, iFp)
GO(g_dbus_message_get_member, pFp)
-GO(g_dbus_message_get_message_type, iFp)
+GO(g_dbus_message_get_message_type, uFp)
GO(g_dbus_message_get_num_unix_fds, uFp)
GO(g_dbus_message_get_path, pFp)
GO(g_dbus_message_get_reply_serial, uFp)
@@ -416,7 +416,7 @@ GO(g_dbus_message_get_unix_fd_list, pFp)
GO(g_dbus_message_header_field_get_type, LFv)
GO(g_dbus_message_lock, vFp)
GO(g_dbus_message_new, pFv)
-GO(g_dbus_message_new_from_blob, pFpLip)
+GO(g_dbus_message_new_from_blob, pFpLup)
GO(g_dbus_message_new_method_call, pFpppp)
//GO2(g_dbus_message_new_method_error, pFpppV, g_dbus_message_new_method_error_valist)
GO(g_dbus_message_new_method_error_literal, pFppp)
@@ -425,14 +425,14 @@ GO(g_dbus_message_new_method_reply, pFp)
GO(g_dbus_message_new_signal, pFppp)
GO(g_dbus_message_print, pFpu)
GO(g_dbus_message_set_body, vFpp)
-GO(g_dbus_message_set_byte_order, iFp)
+GO(g_dbus_message_set_byte_order, vFpu)
GO(g_dbus_message_set_destination, vFpp)
GO(g_dbus_message_set_error_name, vFpp)
-GO(g_dbus_message_set_flags, vFpi)
-GO(g_dbus_message_set_header, vFpip)
+GO(g_dbus_message_set_flags, vFpu)
+GO(g_dbus_message_set_header, vFpup)
GO(g_dbus_message_set_interface, vFpp)
GO(g_dbus_message_set_member, vFpp)
-GO(g_dbus_message_set_message_type, vFpi)
+GO(g_dbus_message_set_message_type, vFpu)
GO(g_dbus_message_set_num_unix_fds, vFpu)
GO(g_dbus_message_set_path, vFpp)
GO(g_dbus_message_set_reply_serial, vFpu)
@@ -440,7 +440,7 @@ GO(g_dbus_message_set_sender, vFpp)
GO(g_dbus_message_set_serial, vFpu)
GO(g_dbus_message_set_signature, vFpp)
GO(g_dbus_message_set_unix_fd_list, vFpp)
-GO(g_dbus_message_to_blob, pFppip)
+GO(g_dbus_message_to_blob, pFppup)
GO(g_dbus_message_to_gerror, iFpp)
GO(g_dbus_message_type_get_type, LFv)
GO(g_dbus_method_info_get_type, LFv)
@@ -477,7 +477,7 @@ GO(g_dbus_object_get_object_path, pFp)
GO(g_dbus_object_get_type, LFv)
GO(g_dbus_object_manager_client_flags_get_type, LFv)
GO(g_dbus_object_manager_client_get_connection, pFp)
-GO(g_dbus_object_manager_client_get_flags, iFp)
+GO(g_dbus_object_manager_client_get_flags, uFp)
GO(g_dbus_object_manager_client_get_name, pFp)
GO(g_dbus_object_manager_client_get_name_owner, pFp)
GO(g_dbus_object_manager_client_get_type, LFv)
@@ -493,39 +493,39 @@ GO(g_dbus_object_manager_get_object_path, pFp)
GO(g_dbus_object_manager_get_objects, pFp)
//GO(g_dbus_object_manager_get_type,
//GO(g_dbus_object_manager_server_export,
-//GO(g_dbus_object_manager_server_export_uniquely,
-//GO(g_dbus_object_manager_server_get_connection,
+GO(g_dbus_object_manager_server_export_uniquely, vFpp)
+GO(g_dbus_object_manager_server_get_connection, pFp)
//GO(g_dbus_object_manager_server_get_type,
-//GO(g_dbus_object_manager_server_is_exported,
-//GO(g_dbus_object_manager_server_new,
-//GO(g_dbus_object_manager_server_set_connection,
-//GO(g_dbus_object_manager_server_unexport,
-//GO(g_dbus_object_proxy_get_connection,
+GO(g_dbus_object_manager_server_is_exported, iFpp)
+GO(g_dbus_object_manager_server_new, pFp)
+GO(g_dbus_object_manager_server_set_connection, vFpp)
+GO(g_dbus_object_manager_server_unexport, iFpp)
+GO(g_dbus_object_proxy_get_connection, pFp)
//GO(g_dbus_object_proxy_get_type,
-//GO(g_dbus_object_proxy_new,
+GO(g_dbus_object_proxy_new, pFpp)
//GO(g_dbus_object_skeleton_add_interface,
//GO(g_dbus_object_skeleton_flush,
//GO(g_dbus_object_skeleton_get_type,
-//GO(g_dbus_object_skeleton_new,
-//GO(g_dbus_object_skeleton_remove_interface,
+GO(g_dbus_object_skeleton_new, pFp)
+GO(g_dbus_object_skeleton_remove_interface, vFpp)
//GO(g_dbus_object_skeleton_remove_interface_by_name,
-//GO(g_dbus_object_skeleton_set_object_path,
+GO(g_dbus_object_skeleton_set_object_path, vFpp)
//GO(g_dbus_property_info_flags_get_type,
GO(g_dbus_property_info_get_type, LFv)
GO(g_dbus_property_info_ref, pFp)
GO(g_dbus_property_info_unref, vFp)
GOM(g_dbus_proxy_call, vFEpppiippp)
GO(g_dbus_proxy_call_finish, pFppp)
-GO(g_dbus_proxy_call_sync, pFpppiipp)
+GO(g_dbus_proxy_call_sync, pFpppuipp)
GOM(g_dbus_proxy_call_with_unix_fd_list, vFEpppiipppp)
GO(g_dbus_proxy_call_with_unix_fd_list_finish, pFpppp)
-GO(g_dbus_proxy_call_with_unix_fd_list_sync, pFpppiipppp)
+GO(g_dbus_proxy_call_with_unix_fd_list_sync, pFpppuipppp)
GO(g_dbus_proxy_flags_get_type, LFv)
GO(g_dbus_proxy_get_cached_property, pFpp)
GO(g_dbus_proxy_get_cached_property_names, pFp)
GO(g_dbus_proxy_get_connection, pFp)
GO(g_dbus_proxy_get_default_timeout, iFp)
-GO(g_dbus_proxy_get_flags, iFp)
+GO(g_dbus_proxy_get_flags, uFp)
GO(g_dbus_proxy_get_interface_info, pFp)
GO(g_dbus_proxy_get_interface_name, pFp)
GO(g_dbus_proxy_get_name, pFp)
@@ -536,19 +536,19 @@ GOM(g_dbus_proxy_new, vFEpippppppp)
GO(g_dbus_proxy_new_finish, pFpp)
GOM(g_dbus_proxy_new_for_bus, vFEiippppppp)
GO(g_dbus_proxy_new_for_bus_finish, pFpp)
-GO(g_dbus_proxy_new_for_bus_sync, pFiipppppp)
-GO(g_dbus_proxy_new_sync, pFpipppppp)
+GO(g_dbus_proxy_new_for_bus_sync, pFiupppppp)
+GO(g_dbus_proxy_new_sync, pFpupppppp)
GO(g_dbus_proxy_set_cached_property, vFppp)
GO(g_dbus_proxy_set_default_timeout, vFpi)
GO(g_dbus_proxy_set_interface_info, vFpp)
//GO(g_dbus_send_message_flags_get_type,
//GO(g_dbus_server_flags_get_type,
//GO(g_dbus_server_get_client_address,
-//GO(g_dbus_server_get_flags,
-//GO(g_dbus_server_get_guid,
+GO(g_dbus_server_get_flags, uFp)
+GO(g_dbus_server_get_guid, pFp)
//GO(g_dbus_server_get_type,
-//GO(g_dbus_server_is_active,
-//GO(g_dbus_server_new_sync,
+GO(g_dbus_server_is_active, iFp)
+GO(g_dbus_server_new_sync, pFpupppp)
//GO(g_dbus_server_start,
//GO(g_dbus_server_stop,
//GO(g_dbus_signal_flags_get_type,
@@ -567,7 +567,7 @@ GO(g_desktop_app_info_get_keywords, pFp)
GO(g_desktop_app_info_get_nodisplay, iFp)
GO(g_desktop_app_info_get_show_in, iFpp)
//GO(g_desktop_app_info_get_startup_wm_class,
-//GO(g_desktop_app_info_get_string,
+GO(g_desktop_app_info_get_string, pFpp)
GO(g_desktop_app_info_get_type, LFv)
//GO(g_desktop_app_info_has_key,
//GO(g_desktop_app_info_launch_action,
@@ -584,20 +584,20 @@ GO(g_desktop_app_info_set_desktop_env, vFp)
//GO(g_drive_can_poll_for_media,
//GO(g_drive_can_start,
//GO(g_drive_can_start_degraded,
-//GO(g_drive_can_stop,
+GO(g_drive_can_stop, iFp)
//GO(g_drive_eject,
//GO(g_drive_eject_finish,
//GO(g_drive_eject_with_operation,
-//GO(g_drive_eject_with_operation_finish,
-//GO(g_drive_enumerate_identifiers,
+GO(g_drive_eject_with_operation_finish, iFppp)
+GO(g_drive_enumerate_identifiers, pFp)
//GO(g_drive_get_icon,
-//GO(g_drive_get_identifier,
-//GO(g_drive_get_name,
-//GO(g_drive_get_sort_key,
-//GO(g_drive_get_start_stop_type,
-//GO(g_drive_get_symbolic_icon,
+GO(g_drive_get_identifier, pFpp)
+GO(g_drive_get_name, pFp)
+GO(g_drive_get_sort_key, pFp)
+GO(g_drive_get_start_stop_type, uFp)
+GO(g_drive_get_symbolic_icon, pFp)
//GO(g_drive_get_type,
-//GO(g_drive_get_volumes,
+GO(g_drive_get_volumes, pFp)
//GO(g_drive_has_media,
//GO(g_drive_has_volumes,
//GO(g_drive_is_media_check_automatic,
@@ -610,51 +610,51 @@ GO(g_desktop_app_info_set_desktop_env, vFp)
//GO(g_drive_start_stop_type_get_type,
//GO(g_drive_stop,
//GO(g_drive_stop_finish,
-//GO(g_emblemed_icon_add_emblem,
+GO(g_emblemed_icon_add_emblem, vFpp)
//GO(g_emblemed_icon_clear_emblems,
-//GO(g_emblemed_icon_get_emblems,
-//GO(g_emblemed_icon_get_icon,
+GO(g_emblemed_icon_get_emblems, pFp)
+GO(g_emblemed_icon_get_icon, pFp)
//GO(g_emblemed_icon_get_type,
-//GO(g_emblemed_icon_new,
-//GO(g_emblem_get_icon,
-//GO(g_emblem_get_origin,
+GO(g_emblemed_icon_new, pFpp)
+GO(g_emblem_get_icon, pFp)
+GO(g_emblem_get_origin, uFp)
//GO(g_emblem_get_type,
-//GO(g_emblem_new,
-//GO(g_emblem_new_with_origin,
+GO(g_emblem_new, pFp)
+GO(g_emblem_new_with_origin, pFpu)
//GO(g_emblem_origin_get_type,
GO(g_file_append_to, pFpipp)
//GOM(g_file_append_to_async, vFEpiipBp)
GO(g_file_append_to_finish, pFppp)
//GO(g_file_attribute_info_flags_get_type,
-//GO(g_file_attribute_info_list_add,
-//GO(g_file_attribute_info_list_dup,
+GO(g_file_attribute_info_list_add, vFppuu)
+GO(g_file_attribute_info_list_dup, pFp)
//GO(g_file_attribute_info_list_get_type,
-//GO(g_file_attribute_info_list_lookup,
-//GO(g_file_attribute_info_list_new,
+GO(g_file_attribute_info_list_lookup, pFpp)
+GO(g_file_attribute_info_list_new, pFv)
//GO(g_file_attribute_info_list_ref,
//GO(g_file_attribute_info_list_unref,
-//GO(g_file_attribute_matcher_enumerate_namespace,
-//GO(g_file_attribute_matcher_enumerate_next,
+GO(g_file_attribute_matcher_enumerate_namespace, iFpp)
+GO(g_file_attribute_matcher_enumerate_next, pFp)
//GO(g_file_attribute_matcher_get_type,
//GO(g_file_attribute_matcher_matches,
//GO(g_file_attribute_matcher_matches_only,
-//GO(g_file_attribute_matcher_new,
-//GO(g_file_attribute_matcher_ref,
-//GO(g_file_attribute_matcher_subtract,
-//GO(g_file_attribute_matcher_to_string,
-//GO(g_file_attribute_matcher_unref,
+GO(g_file_attribute_matcher_new, pFp)
+GO(g_file_attribute_matcher_ref, pFp)
+GO(g_file_attribute_matcher_subtract, pFpp)
+GO(g_file_attribute_matcher_to_string, pFp)
+GO(g_file_attribute_matcher_unref, vFp)
//GO(g_file_attribute_status_get_type,
//GO(g_file_attribute_type_get_type,
//GOM(g_file_copy, iFEppipBpp)
//GOM(g_file_copy_async, vFEppiipBpBp)
-GO(g_file_copy_attributes, iFppipp)
+GO(g_file_copy_attributes, iFppupp)
GO(g_file_copy_finish, iFppp)
GO(g_file_copy_flags_get_type, LFv)
-GO(g_file_create, pFpipp)
+GO(g_file_create, pFpupp)
//GOM(g_file_create_async, vFEpiipBp)
GO(g_file_create_finish, pFppp)
GO(g_file_create_flags_get_type, LFv)
-GO(g_file_create_readwrite, pFpipp)
+GO(g_file_create_readwrite, pFpupp)
//GOM(g_file_create_readwrite_async, vFEpiipBp)
GO(g_file_create_readwrite_finish, pFppp)
GO(g_file_delete, iFppp)
@@ -667,21 +667,21 @@ GO(g_file_dup, pFp)
GO(g_file_eject_mountable_finish, iFppp)
//GOM(g_file_eject_mountable_with_operation, vFpippBp)
GO(g_file_eject_mountable_with_operation_finish, iFppp)
-GO(g_file_enumerate_children, pFppipp)
+GO(g_file_enumerate_children, pFppupp)
//GOM(g_file_enumerate_children_async, vFppiipBp)
GO(g_file_enumerate_children_finish, pFppp)
-//GO(g_file_enumerator_close,
+GO(g_file_enumerator_close, iFppp)
//GO(g_file_enumerator_close_async,
-//GO(g_file_enumerator_close_finish,
-//GO(g_file_enumerator_get_child,
-//GO(g_file_enumerator_get_container,
+GO(g_file_enumerator_close_finish, iFppp)
+GO(g_file_enumerator_get_child, pFpp)
+GO(g_file_enumerator_get_container, pFp)
//GO(g_file_enumerator_get_type,
-//GO(g_file_enumerator_has_pending,
+GO(g_file_enumerator_has_pending, iFp)
//GO(g_file_enumerator_is_closed,
-//GO(g_file_enumerator_next_file,
+GO(g_file_enumerator_next_file, pFppp)
//GO(g_file_enumerator_next_files_async,
-//GO(g_file_enumerator_next_files_finish,
-//GO(g_file_enumerator_set_pending,
+GO(g_file_enumerator_next_files_finish, pFppp)
+GO(g_file_enumerator_set_pending, vFpi)
GO(g_file_equal, iFpp)
GO(g_file_find_enclosing_mount, pFppp)
//GOM(g_file_find_enclosing_mount_async, vFEpipBp)
@@ -704,78 +704,78 @@ GO(g_file_icon_get_file, pFp)
GO(g_file_icon_get_type, LFv)
GO(g_file_icon_new, pFp)
//GO(g_file_info_clear_status,
-//GO(g_file_info_copy_into,
-//GO(g_file_info_dup,
-//GO(g_file_info_get_attribute_as_string,
-//GO(g_file_info_get_attribute_boolean,
-//GO(g_file_info_get_attribute_byte_string,
-//GO(g_file_info_get_attribute_data,
-//GO(g_file_info_get_attribute_int32,
-//GO(g_file_info_get_attribute_int64,
-//GO(g_file_info_get_attribute_object,
-//GO(g_file_info_get_attribute_status,
+GO(g_file_info_copy_into, vFpp)
+GO(g_file_info_dup, pFp)
+GO(g_file_info_get_attribute_as_string, pFpp)
+GO(g_file_info_get_attribute_boolean, iFpp)
+GO(g_file_info_get_attribute_byte_string, pFpp)
+GO(g_file_info_get_attribute_data, iFppppp)
+GO(g_file_info_get_attribute_int32, iFpp)
+GO(g_file_info_get_attribute_int64, lFpp)
+GO(g_file_info_get_attribute_object, pFpp)
+GO(g_file_info_get_attribute_status, uFpp)
//GO(g_file_info_get_attribute_string,
-//GO(g_file_info_get_attribute_stringv,
-//GO(g_file_info_get_attribute_type,
-//GO(g_file_info_get_attribute_uint32,
-//GO(g_file_info_get_attribute_uint64,
+GO(g_file_info_get_attribute_stringv, pFpp)
+GO(g_file_info_get_attribute_type, uFpp)
+GO(g_file_info_get_attribute_uint32, uFpp)
+GO(g_file_info_get_attribute_uint64, LFpp)
//GO(g_file_info_get_content_type,
//GO(g_file_info_get_deletion_date,
//GO(g_file_info_get_display_name,
//GO(g_file_info_get_edit_name,
-//GO(g_file_info_get_etag,
-//GO(g_file_info_get_file_type,
+GO(g_file_info_get_etag, pFp)
+GO(g_file_info_get_file_type, uFp)
//GO(g_file_info_get_icon,
//GO(g_file_info_get_is_backup,
//GO(g_file_info_get_is_hidden,
-//GO(g_file_info_get_is_symlink,
+GO(g_file_info_get_is_symlink, iFp)
//GO(g_file_info_get_modification_time,
//GO(g_file_info_get_name,
-//GO(g_file_info_get_size,
-//GO(g_file_info_get_sort_order,
-//GO(g_file_info_get_symbolic_icon,
+GO(g_file_info_get_size, lFp)
+GO(g_file_info_get_sort_order, iFp)
+GO(g_file_info_get_symbolic_icon, pFp)
//GO(g_file_info_get_symlink_target,
//GO(g_file_info_get_type,
//GO(g_file_info_has_attribute,
//GO(g_file_info_has_namespace,
//GO(g_file_info_list_attributes,
-//GO(g_file_info_new,
+GO(g_file_info_new, pFv)
//GO(g_file_info_remove_attribute,
-//GO(g_file_info_set_attribute,
-//GO(g_file_info_set_attribute_boolean,
-//GO(g_file_info_set_attribute_byte_string,
-//GO(g_file_info_set_attribute_int32,
-//GO(g_file_info_set_attribute_int64,
-//GO(g_file_info_set_attribute_mask,
-//GO(g_file_info_set_attribute_object,
-//GO(g_file_info_set_attribute_status,
+GO(g_file_info_set_attribute, vFppup)
+GO(g_file_info_set_attribute_boolean, vFppi)
+GO(g_file_info_set_attribute_byte_string, vFppp)
+GO(g_file_info_set_attribute_int32, vFppi)
+GO(g_file_info_set_attribute_int64, vFppl)
+GO(g_file_info_set_attribute_mask, vFpp)
+GO(g_file_info_set_attribute_object, vFppp)
+GO(g_file_info_set_attribute_status, iFppu)
//GO(g_file_info_set_attribute_string,
-//GO(g_file_info_set_attribute_stringv,
-//GO(g_file_info_set_attribute_uint32,
-//GO(g_file_info_set_attribute_uint64,
+GO(g_file_info_set_attribute_stringv, vFppp)
+GO(g_file_info_set_attribute_uint32, vFppu)
+GO(g_file_info_set_attribute_uint64, vFppL)
//GO(g_file_info_set_content_type,
//GO(g_file_info_set_display_name,
//GO(g_file_info_set_edit_name,
-//GO(g_file_info_set_file_type,
+GO(g_file_info_set_file_type, vFpu)
//GO(g_file_info_set_icon,
//GO(g_file_info_set_is_hidden,
-//GO(g_file_info_set_is_symlink,
-//GO(g_file_info_set_modification_time,
+GO(g_file_info_set_is_symlink, vFpi)
+GO(g_file_info_set_modification_time, vFpp)
//GO(g_file_info_set_name,
-//GO(g_file_info_set_size,
-//GO(g_file_info_set_sort_order,
-//GO(g_file_info_set_symbolic_icon,
-//GO(g_file_info_set_symlink_target,
+GO(g_file_info_set_size, vFpl)
+GO(g_file_info_set_sort_order, vFpi)
+GO(g_file_info_set_symbolic_icon, vFpp)
+GO(g_file_info_set_symlink_target, vFpp)
//GO(g_file_info_unset_attribute_mask,
//GO(g_file_input_stream_get_type,
-//GO(g_file_input_stream_query_info,
+GO(g_file_input_stream_query_info, pFpppp)
//GO(g_file_input_stream_query_info_async,
-//GO(g_file_input_stream_query_info_finish,
-//GO(g_file_io_stream_get_etag,
+GO(g_file_input_stream_query_info_finish, pFppp)
+GO(g_file_io_stream_get_etag, pFp)
//GO(g_file_io_stream_get_type,
-//GO(g_file_io_stream_query_info,
+GO(g_file_io_stream_query_info, pFpppp)
//GO(g_file_io_stream_query_info_async,
-//GO(g_file_io_stream_query_info_finish,
+GO(g_file_io_stream_query_info_finish, pFppp)
GO(g_file_is_native, iFpp)
GO(g_file_load_bytes, pFpppp) //sice 2.56+
//GOM(g_file_load_bytes_async, vFEppBp) //since 2.56+
@@ -794,26 +794,26 @@ GO(g_file_make_symbolic_link, iFpppp)
//GOM(g_file_measure_disk_usage_async, vFEpiipBpBp)
GO(g_file_measure_disk_usage_finish, iFpppppp)
//GO(g_file_measure_flags_get_type,
-GO(g_file_monitor, pFpipp)
+GO(g_file_monitor, pFpupp)
//GO(g_file_monitor_cancel,
GO(g_file_monitor_directory, pFpipp)
-//GO(g_file_monitor_emit_event,
+GO(g_file_monitor_emit_event, vFpppu)
//GO(g_file_monitor_event_get_type,
GO(g_file_monitor_file, pFpipp)
//GO(g_file_monitor_flags_get_type,
//GO(g_file_monitor_get_type,
-//GO(g_file_monitor_is_cancelled,
-//GO(g_file_monitor_set_rate_limit,
+GO(g_file_monitor_is_cancelled, iFp)
+GO(g_file_monitor_set_rate_limit, vFpi)
//GOM(g_file_mount_enclosing_volume, vFEpippBp)
GO(g_file_mount_enclosing_volume_finish, iFppp)
//GOM(g_file_mount_mountable, vFEpippBp)
GO(g_file_mount_mountable_finish, pFppp)
//GOM(g_file_move, iFEppipBpp)
-//GO(g_filename_completer_get_completions,
-//GO(g_filename_completer_get_completion_suffix,
+GO(g_filename_completer_get_completions, pFpp)
+GO(g_filename_completer_get_completion_suffix, pFpp)
//GO(g_filename_completer_get_type,
-//GO(g_filename_completer_new,
-//GO(g_filename_completer_set_dirs_only,
+GO(g_filename_completer_new, pFv)
+GO(g_filename_completer_set_dirs_only, vFpi)
GO(g_file_new_build_filename, pFppppppppppp) // vaarg, since v2.56+
GO(g_file_new_for_commandline_arg, pFp)
GO(g_file_new_for_commandline_arg_and_cwd, pFpp)
@@ -823,11 +823,11 @@ GO(g_file_new_tmp, pFppp)
GO(g_file_open_readwrite, pFppp)
//GOM(g_file_open_readwrite_async, vFEpipBp)
GO(g_file_open_readwrite_finish, pFppp)
-//GO(g_file_output_stream_get_etag,
+GO(g_file_output_stream_get_etag, pFp)
//GO(g_file_output_stream_get_type,
-//GO(g_file_output_stream_query_info,
+GO(g_file_output_stream_query_info, pFpppp)
//GO(g_file_output_stream_query_info_async,
-//GO(g_file_output_stream_query_info_finish,
+GO(g_file_output_stream_query_info_finish, pFppp)
GO(g_file_parse_name, pFp)
GO(g_file_peek_path , pFp) // sice 2.56+
//GOM(g_file_poll_mountable, vFEppBp)
@@ -839,8 +839,8 @@ GO(g_file_query_exists, iFpp)
GO(g_file_query_filesystem_info, pFpppp)
//GOM(g_file_query_filesystem_info_async, vFEppipBp)
GO(g_file_query_filesystem_info_finish, pFppp)
-GO(g_file_query_file_type, iFpip)
-GO(g_file_query_info, pFppipp)
+GO(g_file_query_file_type, uFpup)
+GO(g_file_query_info, pFppupp)
//GOM(g_file_query_info_async, vFEppiipBp)
GO(g_file_query_info_finish, pFppp)
//GO(g_file_query_info_flags_get_type,
@@ -849,27 +849,27 @@ GO(g_file_query_writable_namespaces, pFppp)
GO(g_file_read, pFppp)
//GOM(g_file_read_async, vFEpipBp)
GO(g_file_read_finish, pFppp)
-GO(g_file_replace, pFppiipp)
+GO(g_file_replace, pFppiupp)
//GOM(g_file_replace_async, vFEppiiipBp)
-GO(g_file_replace_contents, iFppLpiippp)
+GO(g_file_replace_contents, iFppLpiuppp)
//GOM(g_file_replace_contents_async, vFEppLpuupBp)
//GOM(g_file_replace_contents_bytes_async, vFEpppiipBp)
GO(g_file_replace_contents_finish, iFpppp)
-//GO(g_file_replace_finish,
-GO(g_file_replace_readwrite, pFppiipp)
+GO(g_file_replace_finish, pFppp)
+GO(g_file_replace_readwrite, pFppiupp)
//GOM(g_file_replace_readwrite_async, vFEppiiipBp)
GO(g_file_replace_readwrite_finish, pFppp)
GO(g_file_resolve_relative_path, pFpp)
-GO(g_file_set_attribute, iFppipipp)
-GO(g_file_set_attribute_byte_string, iFpppipp)
-GO(g_file_set_attribute_int32, iFppiipp)
-GO(g_file_set_attribute_int64, iFppIipp)
+GO(g_file_set_attribute, iFppupupp)
+GO(g_file_set_attribute_byte_string, iFpppupp)
+GO(g_file_set_attribute_int32, iFppiupp)
+GO(g_file_set_attribute_int64, iFpplupp)
//GOM(g_file_set_attributes_async, vFEppiipBp)
GO(g_file_set_attributes_finish, iFpppp)
-GO(g_file_set_attributes_from_info, iFppipp)
+GO(g_file_set_attributes_from_info, iFppupp)
GO(g_file_set_attribute_string, iFpppipp)
-GO(g_file_set_attribute_uint32, iFppuipp)
-GO(g_file_set_attribute_uint64, iFppUipp)
+GO(g_file_set_attribute_uint32, iFppuupp)
+GO(g_file_set_attribute_uint64, iFppLupp)
GO(g_file_set_display_name, pFpppp)
//GOM(g_file_set_display_name_async, vFEppipBp)
GO(g_file_set_display_name_finish, pFppp)
@@ -887,14 +887,14 @@ GO(g_file_type_get_type, LFv)
GO(g_file_unmount_mountable_finish, iFppp)
//GOM(g_file_unmount_mountable_with_operation, vFEpippBp)
GO(g_file_unmount_mountable_with_operation_finish, iFppp)
-//GO(g_filter_input_stream_get_base_stream,
-//GO(g_filter_input_stream_get_close_base_stream,
+GO(g_filter_input_stream_get_base_stream, pFp)
+GO(g_filter_input_stream_get_close_base_stream, iFp)
//GO(g_filter_input_stream_get_type,
-//GO(g_filter_input_stream_set_close_base_stream,
-//GO(g_filter_output_stream_get_base_stream,
-//GO(g_filter_output_stream_get_close_base_stream,
+GO(g_filter_input_stream_set_close_base_stream, vFpi)
+GO(g_filter_output_stream_get_base_stream, pFp)
+GO(g_filter_output_stream_get_close_base_stream, iFp)
//GO(g_filter_output_stream_get_type,
-//GO(g_filter_output_stream_set_close_base_stream,
+GO(g_filter_output_stream_set_close_base_stream, vFpi)
GO(g_icon_deserialize, pFp)
GO(g_icon_equal, iFpp)
//GO(g_icon_get_type,
@@ -902,8 +902,8 @@ GO(g_icon_hash, uFp)
GO(g_icon_new_for_string, pFpp)
GO(g_icon_serialize, pFp)
GO(g_icon_to_string, pFp)
-//GO(g_inet_address_equal,
-//GO(g_inet_address_get_family,
+GO(g_inet_address_equal, iFpp)
+GO(g_inet_address_get_family, uFp)
//GO(g_inet_address_get_is_any,
//GO(g_inet_address_get_is_link_local,
//GO(g_inet_address_get_is_loopback,
@@ -911,212 +911,212 @@ GO(g_icon_to_string, pFp)
//GO(g_inet_address_get_is_mc_link_local,
//GO(g_inet_address_get_is_mc_node_local,
//GO(g_inet_address_get_is_mc_org_local,
-//GO(g_inet_address_get_is_mc_site_local,
+GO(g_inet_address_get_is_mc_site_local, iFp)
//GO(g_inet_address_get_is_multicast,
//GO(g_inet_address_get_is_site_local,
-//GO(g_inet_address_get_native_size,
+GO(g_inet_address_get_native_size, LFp)
//GO(g_inet_address_get_type,
-//GO(g_inet_address_mask_equal,
-//GO(g_inet_address_mask_get_address,
-//GO(g_inet_address_mask_get_family,
-//GO(g_inet_address_mask_get_length,
+GO(g_inet_address_mask_equal, iFpp)
+GO(g_inet_address_mask_get_address, pFp)
+GO(g_inet_address_mask_get_family, uFp)
+GO(g_inet_address_mask_get_length, uFp)
//GO(g_inet_address_mask_get_type,
-//GO(g_inet_address_mask_matches,
-//GO(g_inet_address_mask_new,
-//GO(g_inet_address_mask_new_from_string,
-//GO(g_inet_address_mask_to_string,
-//GO(g_inet_address_new_any,
-//GO(g_inet_address_new_from_bytes,
-//GO(g_inet_address_new_from_string,
+GO(g_inet_address_mask_matches, iFpp)
+GO(g_inet_address_mask_new, pFpup)
+GO(g_inet_address_mask_new_from_string, pFpp)
+GO(g_inet_address_mask_to_string, pFp)
+GO(g_inet_address_new_any, pFu)
+GO(g_inet_address_new_from_bytes, pFpu)
+GO(g_inet_address_new_from_string, pFp)
//GO(g_inet_address_new_loopback,
-//GO(g_inet_address_to_bytes,
-//GO(g_inet_address_to_string,
-//GO(g_inet_socket_address_get_address,
+GO(g_inet_address_to_bytes, pFp)
+GO(g_inet_address_to_string, pFp)
+GO(g_inet_socket_address_get_address, pFp)
//GO(g_inet_socket_address_get_flowinfo,
-//GO(g_inet_socket_address_get_port,
-//GO(g_inet_socket_address_get_scope_id,
+GO(g_inet_socket_address_get_port, WFp)
+GO(g_inet_socket_address_get_scope_id, uFp)
//GO(g_inet_socket_address_get_type,
-//GO(g_inet_socket_address_new,
-//GO(g_inet_socket_address_new_from_string,
+GO(g_inet_socket_address_new, pFpW)
+GO(g_inet_socket_address_new_from_string, pFpu)
GO(g_initable_get_type, LFv)
GO(g_initable_init, iFppp)
GOM(g_initable_new, pFEppppV)
-GO(g_initable_newv, pFpuppp)
+GO(g_initable_newv, pFLuppp)
GOM(g_initable_new_valist, pFEppApp)
//GO(g_input_stream_clear_pending,
-//GO(g_input_stream_close,
+GO(g_input_stream_close, iFppp)
//GO(g_input_stream_close_async,
-//GO(g_input_stream_close_finish,
+GO(g_input_stream_close_finish, iFppp)
//GO(g_input_stream_get_type,
-//GO(g_input_stream_has_pending,
+GO(g_input_stream_has_pending, iFp)
//GO(g_input_stream_is_closed,
-//GO(g_input_stream_read,
-//GO(g_input_stream_read_all,
+GO(g_input_stream_read, lFppLpp)
+GO(g_input_stream_read_all, iFppLppp)
//GO(g_input_stream_read_async,
-//GO(g_input_stream_read_bytes,
+GO(g_input_stream_read_bytes, pFpLpp)
//GO(g_input_stream_read_bytes_async,
-//GO(g_input_stream_read_bytes_finish,
+GO(g_input_stream_read_bytes_finish, pFppp)
//GO(g_input_stream_read_finish,
-//GO(g_input_stream_set_pending,
-//GO(g_input_stream_skip,
+GO(g_input_stream_set_pending, iFpp)
+GO(g_input_stream_skip, lFpLpp)
//GO(g_input_stream_skip_async,
-//GO(g_input_stream_skip_finish,
+GO(g_input_stream_skip_finish, lFppp)
//GO(g_io_error_enum_get_type,
-//GO(g_io_error_from_errno,
+GO(g_io_error_from_errno, uFi)
GO(g_io_error_quark, uFv)
-//GO(g_io_extension_get_name,
-//GO(g_io_extension_get_priority,
-//GO(g_io_extension_get_type,
-//GO(g_io_extension_point_get_extension_by_name,
-//GO(g_io_extension_point_get_extensions,
-//GO(g_io_extension_point_get_required_type,
-//GO(g_io_extension_point_implement,
-//GO(g_io_extension_point_lookup,
+GO(g_io_extension_get_name, pFp)
+GO(g_io_extension_get_priority, iFp)
+GO(g_io_extension_get_type, LFp)
+GO(g_io_extension_point_get_extension_by_name, pFpp)
+GO(g_io_extension_point_get_extensions, pFp)
+GO(g_io_extension_point_get_required_type, LFp)
+GO(g_io_extension_point_implement, pFpLpi)
+GO(g_io_extension_point_lookup, pFp)
//GO(g_io_extension_point_register,
-//GO(g_io_extension_point_set_required_type,
-//GO(g_io_extension_ref_class,
+GO(g_io_extension_point_set_required_type, vFpL)
+GO(g_io_extension_ref_class, pFp)
//GO(g_io_module_get_type,
-//GO(g_io_module_new,
-//GO(g_io_module_scope_block,
+GO(g_io_module_new, pFp)
+GO(g_io_module_scope_block, vFpp)
//GO(g_io_module_scope_flags_get_type,
-//GO(g_io_module_scope_free,
-//GO(g_io_module_scope_new,
-//GO(g_io_modules_load_all_in_directory,
-//GO(g_io_modules_load_all_in_directory_with_scope,
-//GO(g_io_modules_scan_all_in_directory,
-//GO(g_io_modules_scan_all_in_directory_with_scope,
+GO(g_io_module_scope_free, vFp)
+GO(g_io_module_scope_new, pFu)
+GO(g_io_modules_load_all_in_directory, pFp)
+GO(g_io_modules_load_all_in_directory_with_scope, pFpp)
+GO(g_io_modules_scan_all_in_directory, vFp)
+GO(g_io_modules_scan_all_in_directory_with_scope, vFpp)
//GO(g_io_scheduler_cancel_all_jobs,
//GO(g_io_scheduler_job_send_to_mainloop,
//GO(g_io_scheduler_job_send_to_mainloop_async,
//GO(g_io_scheduler_push_job,
//GO(g_io_stream_clear_pending,
-//GO(g_io_stream_close,
+GO(g_io_stream_close, iFppp)
//GO(g_io_stream_close_async,
-//GO(g_io_stream_close_finish,
-//GO(g_io_stream_get_input_stream,
-//GO(g_io_stream_get_output_stream,
+GO(g_io_stream_close_finish, iFppp)
+GO(g_io_stream_get_input_stream, pFp)
+GO(g_io_stream_get_output_stream, pFp)
//GO(g_io_stream_get_type,
-//GO(g_io_stream_has_pending,
+GO(g_io_stream_has_pending, iFp)
//GO(g_io_stream_is_closed,
-//GO(g_io_stream_set_pending,
+GO(g_io_stream_set_pending, iFpp)
//GO(g_io_stream_splice_async,
-//GO(g_io_stream_splice_finish,
+GO(g_io_stream_splice_finish, iFpp)
//GO(g_io_stream_splice_flags_get_type,
//GO(g_keyfile_settings_backend_new,
GO(g_list_model_get_item, pFpu)
GO(g_list_model_get_n_items, uFp)
GO(g_list_model_get_object, pFpu)
//GO(g_loadable_icon_get_type,
-//GO(g_loadable_icon_load,
+GO(g_loadable_icon_load, pFpippp)
//GO(g_loadable_icon_load_async,
-//GO(g_loadable_icon_load_finish,
+GO(g_loadable_icon_load_finish, pFpppp)
//GO(g_local_directory_monitor_get_type,
//GO(g_local_file_monitor_get_type,
-//GO(g_memory_input_stream_add_bytes,
+GO(g_memory_input_stream_add_bytes, vFpp)
//GO(g_memory_input_stream_add_data,
//GO(g_memory_input_stream_get_type,
-//GO(g_memory_input_stream_new,
-//GO(g_memory_input_stream_new_from_bytes,
+GO(g_memory_input_stream_new, pFv)
+GO(g_memory_input_stream_new_from_bytes, pFp)
//GO(g_memory_input_stream_new_from_data,
//GO(g_memory_output_stream_get_data,
-//GO(g_memory_output_stream_get_data_size,
+GO(g_memory_output_stream_get_data_size, LFp)
//GO(g_memory_output_stream_get_size,
//GO(g_memory_output_stream_get_type,
//GO(g_memory_output_stream_new,
-//GO(g_memory_output_stream_new_resizable,
-//GO(g_memory_output_stream_steal_as_bytes,
-//GO(g_memory_output_stream_steal_data,
+GO(g_memory_output_stream_new_resizable, pFv)
+GO(g_memory_output_stream_steal_as_bytes, pFp)
+GO(g_memory_output_stream_steal_data, pFp)
//GO(g_memory_settings_backend_new,
-//GO(g_menu_append,
-//GO(g_menu_append_item,
-//GO(g_menu_append_section,
-//GO(g_menu_append_submenu,
-//GO(g_menu_attribute_iter_get_name,
-//GO(g_menu_attribute_iter_get_next,
+GO(g_menu_append, vFppp)
+GO(g_menu_append_item, vFpp)
+GO(g_menu_append_section, vFppp)
+GO(g_menu_append_submenu, vFppp)
+GO(g_menu_attribute_iter_get_name, pFp)
+GO(g_menu_attribute_iter_get_next, iFppp)
//GO(g_menu_attribute_iter_get_type,
-//GO(g_menu_attribute_iter_get_value,
-//GO(g_menu_attribute_iter_next,
+GO(g_menu_attribute_iter_get_value, pFp)
+GO(g_menu_attribute_iter_next, iFp)
//GO(g_menu_freeze,
//GO(g_menu_get_type,
-//GO(g_menu_insert,
-//GO(g_menu_insert_item,
+GO(g_menu_insert, vFpipp)
+GO(g_menu_insert_item, vFpip)
//GO(g_menu_insert_section,
-//GO(g_menu_insert_submenu,
+GO(g_menu_insert_submenu, vFpipp)
//GO(g_menu_item_get_attribute,
-//GO(g_menu_item_get_attribute_value,
-//GO(g_menu_item_get_link,
+GO(g_menu_item_get_attribute_value, pFppp)
+GO(g_menu_item_get_link, pFpp)
//GO(g_menu_item_get_type,
-//GO(g_menu_item_new,
-//GO(g_menu_item_new_from_model,
-//GO(g_menu_item_new_section,
+GO(g_menu_item_new, pFpp)
+GO(g_menu_item_new_from_model, pFpi)
+GO(g_menu_item_new_section, pFpp)
//GO(g_menu_item_new_submenu,
//GO(g_menu_item_set_action_and_target,
-//GO(g_menu_item_set_action_and_target_value,
+GO(g_menu_item_set_action_and_target_value, vFppp)
//GO(g_menu_item_set_attribute,
//GO(g_menu_item_set_attribute_value,
-//GO(g_menu_item_set_detailed_action,
-//GO(g_menu_item_set_icon,
+GO(g_menu_item_set_detailed_action, vFpp)
+GO(g_menu_item_set_icon, vFpp)
//GO(g_menu_item_set_label,
-//GO(g_menu_item_set_link,
-//GO(g_menu_item_set_section,
+GO(g_menu_item_set_link, vFppp)
+GO(g_menu_item_set_section, vFpp)
//GO(g_menu_item_set_submenu,
-//GO(g_menu_link_iter_get_name,
-//GO(g_menu_link_iter_get_next,
+GO(g_menu_link_iter_get_name, pFp)
+GO(g_menu_link_iter_get_next, iFppp)
//GO(g_menu_link_iter_get_type,
-//GO(g_menu_link_iter_get_value,
-//GO(g_menu_link_iter_next,
+GO(g_menu_link_iter_get_value, pFp)
+GO(g_menu_link_iter_next, iFp)
//GO(g_menu_model_get_item_attribute,
-//GO(g_menu_model_get_item_attribute_value,
-//GO(g_menu_model_get_item_link,
-//GO(g_menu_model_get_n_items,
+GO(g_menu_model_get_item_attribute_value, pFpipp)
+GO(g_menu_model_get_item_link, pFpip)
+GO(g_menu_model_get_n_items, iFp)
//GO(g_menu_model_get_type,
-//GO(g_menu_model_is_mutable,
-//GO(g_menu_model_items_changed,
-//GO(g_menu_model_iterate_item_attributes,
-//GO(g_menu_model_iterate_item_links,
-//GO(g_menu_new,
+GO(g_menu_model_is_mutable, iFp)
+GO(g_menu_model_items_changed, vFpiii)
+GO(g_menu_model_iterate_item_attributes, pFpi)
+GO(g_menu_model_iterate_item_links, pFpi)
+GO(g_menu_new, pFv)
//GO(g_menu_prepend,
//GO(g_menu_prepend_item,
//GO(g_menu_prepend_section,
//GO(g_menu_prepend_submenu,
-//GO(g_menu_remove,
+GO(g_menu_remove, vFpi)
//GO(g_menu_remove_all,
//GO(g_mount_can_eject,
//GO(g_mount_can_unmount,
//GO(g_mount_eject,
//GO(g_mount_eject_finish,
//GO(g_mount_eject_with_operation,
-//GO(g_mount_eject_with_operation_finish,
-//GO(g_mount_get_default_location,
-//GO(g_mount_get_drive,
+GO(g_mount_eject_with_operation_finish, iFppp)
+GO(g_mount_get_default_location, pFp)
+GO(g_mount_get_drive, pFp)
//GO(g_mount_get_icon,
//GO(g_mount_get_name,
//GO(g_mount_get_root,
-//GO(g_mount_get_sort_key,
-//GO(g_mount_get_symbolic_icon,
+GO(g_mount_get_sort_key, pFp)
+GO(g_mount_get_symbolic_icon, pFp)
//GO(g_mount_get_type,
-//GO(g_mount_get_uuid,
+GO(g_mount_get_uuid, pFp)
//GO(g_mount_get_volume,
//GO(g_mount_guess_content_type,
-//GO(g_mount_guess_content_type_finish,
-//GO(g_mount_guess_content_type_sync,
-//GO(g_mount_is_shadowed,
+GO(g_mount_guess_content_type_finish, pFppp)
+GO(g_mount_guess_content_type_sync, pFpipp)
+GO(g_mount_is_shadowed, iFp)
//GO(g_mount_mount_flags_get_type,
//GO(g_mount_operation_get_anonymous,
-//GO(g_mount_operation_get_choice,
-//GO(g_mount_operation_get_domain,
+GO(g_mount_operation_get_choice, iFp)
+GO(g_mount_operation_get_domain, pFp)
//GO(g_mount_operation_get_password,
-//GO(g_mount_operation_get_password_save,
+GO(g_mount_operation_get_password_save, uFp)
//GO(g_mount_operation_get_type,
//GO(g_mount_operation_get_username,
-//GO(g_mount_operation_new,
-//GO(g_mount_operation_reply,
+GO(g_mount_operation_new, pFv)
+GO(g_mount_operation_reply, vFpu)
//GO(g_mount_operation_result_get_type,
//GO(g_mount_operation_set_anonymous,
-//GO(g_mount_operation_set_choice,
-//GO(g_mount_operation_set_domain,
+GO(g_mount_operation_set_choice, vFpi)
+GO(g_mount_operation_set_domain, vFpp)
//GO(g_mount_operation_set_password,
-//GO(g_mount_operation_set_password_save,
+GO(g_mount_operation_set_password_save, vFpu)
//GO(g_mount_operation_set_username,
//GO(g_mount_remount,
//GO(g_mount_remount_finish,
@@ -1129,67 +1129,67 @@ GO(g_list_model_get_object, pFpu)
//GO(g_mount_unshadow,
//GO(g_native_volume_monitor_get_type,
//GO(g_network_address_get_hostname,
-//GO(g_network_address_get_port,
-//GO(g_network_address_get_scheme,
+GO(g_network_address_get_port, WFp)
+GO(g_network_address_get_scheme, pFp)
//GO(g_network_address_get_type,
-//GO(g_network_address_new,
+GO(g_network_address_new, pFpW)
//GO(g_network_address_parse,
-//GO(g_network_address_parse_uri,
+GO(g_network_address_parse_uri, pFpWp)
//GO(g_networking_init,
//GO(g_network_monitor_base_add_network,
//GO(g_network_monitor_base_get_type,
//GO(g_network_monitor_base_remove_network,
//GO(g_network_monitor_base_set_networks,
-//GO(g_network_monitor_can_reach,
+GO(g_network_monitor_can_reach, iFpppp)
//GO(g_network_monitor_can_reach_async,
-//GO(g_network_monitor_can_reach_finish,
-//GO(g_network_monitor_get_default,
+GO(g_network_monitor_can_reach_finish, iFppp)
+GO(g_network_monitor_get_default, pFv)
//GO(g_network_monitor_get_network_available,
//GO(g_network_monitor_get_type,
//GO(g_network_service_get_domain,
//GO(g_network_service_get_protocol,
-//GO(g_network_service_get_scheme,
+GO(g_network_service_get_scheme, pFp)
//GO(g_network_service_get_service,
//GO(g_network_service_get_type,
-//GO(g_network_service_new,
-//GO(g_network_service_set_scheme,
-//GO(g_notification_add_button,
+GO(g_network_service_new, pFppp)
+GO(g_network_service_set_scheme, vFpp)
+GO(g_notification_add_button, vFppp)
//GO(g_notification_add_button_with_target,
-//GO(g_notification_add_button_with_target_value,
+GO(g_notification_add_button_with_target_value, vFpppp)
//GO(g_notification_get_type,
-//GO(g_notification_new,
+GO(g_notification_new, pFp)
//GO(g_notification_priority_get_type,
//GO(g_notification_set_body,
-//GO(g_notification_set_default_action,
+GO(g_notification_set_default_action, vFpp)
//GO(g_notification_set_default_action_and_target,
-//GO(g_notification_set_default_action_and_target_value,
-//GO(g_notification_set_icon,
-//GO(g_notification_set_priority,
+GO(g_notification_set_default_action_and_target_value, vFppp)
+GO(g_notification_set_icon, vFpp)
+GO(g_notification_set_priority, vFpu)
//GO(g_notification_set_title,
-//GO(g_notification_set_urgent,
+GO(g_notification_set_urgent, vFpi)
//GO(g_null_settings_backend_new,
//GO(g_output_stream_clear_pending,
-//GO(g_output_stream_close,
+GO(g_output_stream_close, iFppp)
//GO(g_output_stream_close_async,
-//GO(g_output_stream_close_finish,
+GO(g_output_stream_close_finish, iFppp)
//GO(g_output_stream_flush,
//GO(g_output_stream_flush_async,
//GO(g_output_stream_flush_finish,
//GO(g_output_stream_get_type,
-//GO(g_output_stream_has_pending,
+GO(g_output_stream_has_pending, iFp)
//GO(g_output_stream_is_closed,
//GO(g_output_stream_is_closing,
//GO(g_output_stream_printf,
-//GO(g_output_stream_set_pending,
-//GO(g_output_stream_splice,
+GO(g_output_stream_set_pending, iFpp)
+GO(g_output_stream_splice, lFppupp)
//GO(g_output_stream_splice_async,
-//GO(g_output_stream_splice_finish,
+GO(g_output_stream_splice_finish, lFppp)
//GO(g_output_stream_splice_flags_get_type,
//GO(g_output_stream_vprintf,
-//GO(g_output_stream_write,
-//GO(g_output_stream_write_all,
+GO(g_output_stream_write, lFppLpp)
+GO(g_output_stream_write_all, iFppLppp)
//GO(g_output_stream_write_async,
-//GO(g_output_stream_write_bytes,
+GO(g_output_stream_write_bytes, lFpppp)
//GO(g_output_stream_write_bytes_async,
//GO(g_output_stream_write_bytes_finish,
//GO(g_output_stream_write_finish,
@@ -1199,99 +1199,99 @@ GO(g_list_model_get_object, pFpu)
//GO(g_permission_acquire_finish,
//GO(g_permission_get_allowed,
//GO(g_permission_get_can_acquire,
-//GO(g_permission_get_can_release,
+GO(g_permission_get_can_release, iFp)
//GO(g_permission_get_type,
-//GO(g_permission_impl_update,
-//GO(g_permission_release,
+GO(g_permission_impl_update, vFpiii)
+GO(g_permission_release, iFppp)
//GO(g_permission_release_async,
-//GO(g_permission_release_finish,
+GO(g_permission_release_finish, iFppp)
//GO(g_pollable_input_stream_can_poll,
//GO(g_pollable_input_stream_create_source,
//GO(g_pollable_input_stream_get_type,
-//GO(g_pollable_input_stream_is_readable,
-//GO(g_pollable_input_stream_read_nonblocking,
+GO(g_pollable_input_stream_is_readable, iFp)
+GO(g_pollable_input_stream_read_nonblocking, lFppLpp)
//GO(g_pollable_output_stream_can_poll,
//GO(g_pollable_output_stream_create_source,
//GO(g_pollable_output_stream_get_type,
-//GO(g_pollable_output_stream_is_writable,
-//GO(g_pollable_output_stream_write_nonblocking,
+GO(g_pollable_output_stream_is_writable, iFp)
+GO(g_pollable_output_stream_write_nonblocking, lFppLpp)
//GO(g_pollable_source_new,
//GO(g_pollable_source_new_full,
-//GO(g_pollable_stream_read,
-//GO(g_pollable_stream_write,
-//GO(g_pollable_stream_write_all,
+GO(g_pollable_stream_read, lFppLipp)
+GO(g_pollable_stream_write, lFppLipp)
+GO(g_pollable_stream_write_all, iFppLippp)
//GO(g_property_action_get_type,
-//GO(g_property_action_new,
+GO(g_property_action_new, pFppp)
//GO(g_proxy_address_enumerator_get_type,
//GO(g_proxy_address_get_destination_hostname,
-//GO(g_proxy_address_get_destination_port,
+GO(g_proxy_address_get_destination_port, WFp)
//GO(g_proxy_address_get_destination_protocol,
//GO(g_proxy_address_get_password,
//GO(g_proxy_address_get_protocol,
//GO(g_proxy_address_get_type,
-//GO(g_proxy_address_get_uri,
+GO(g_proxy_address_get_uri, pFp)
//GO(g_proxy_address_get_username,
-//GO(g_proxy_address_new,
-//GO(g_proxy_connect,
+GO(g_proxy_address_new, pFpWppWpp)
+GO(g_proxy_connect, pFppppp)
//GO(g_proxy_connect_async,
-//GO(g_proxy_connect_finish,
-//GO(g_proxy_get_default_for_protocol,
+GO(g_proxy_connect_finish, pFppp)
+GO(g_proxy_get_default_for_protocol, pFp)
//GO(g_proxy_get_type,
-//GO(g_proxy_resolver_get_default,
+GO(g_proxy_resolver_get_default, pFv)
//GO(g_proxy_resolver_get_type,
-//GO(g_proxy_resolver_is_supported,
-//GO(g_proxy_resolver_lookup,
+GO(g_proxy_resolver_is_supported, iFp)
+GO(g_proxy_resolver_lookup, pFpppp)
//GO(g_proxy_resolver_lookup_async,
-//GO(g_proxy_resolver_lookup_finish,
-//GO(g_proxy_supports_hostname,
+GO(g_proxy_resolver_lookup_finish, pFppp)
+GO(g_proxy_supports_hostname, iFp)
//GO(g_remote_action_group_activate_action_full,
-//GO(g_remote_action_group_change_action_state_full,
+GO(g_remote_action_group_change_action_state_full, vFpppp)
//GO(g_remote_action_group_get_type,
//GO(g_resolver_error_get_type,
//GO(g_resolver_error_quark,
//GO(g_resolver_free_addresses,
-//GO(g_resolver_free_targets,
-//GO(g_resolver_get_default,
+GO(g_resolver_free_targets, vFp)
+GO(g_resolver_get_default, pFv)
//GO(g_resolver_get_type,
-//GO(g_resolver_lookup_by_address,
+GO(g_resolver_lookup_by_address, pFpppp)
//GO(g_resolver_lookup_by_address_async,
-//GO(g_resolver_lookup_by_address_finish,
-//GO(g_resolver_lookup_by_name,
+GO(g_resolver_lookup_by_address_finish, pFppp)
+GO(g_resolver_lookup_by_name, pFpppp)
//GO(g_resolver_lookup_by_name_async,
//GO(g_resolver_lookup_by_name_finish,
-//GO(g_resolver_lookup_records,
+GO(g_resolver_lookup_records, pFppupp)
//GO(g_resolver_lookup_records_async,
-//GO(g_resolver_lookup_records_finish,
-//GO(g_resolver_lookup_service,
+GO(g_resolver_lookup_records_finish, pFppp)
+GO(g_resolver_lookup_service, pFpppppp)
//GO(g_resolver_lookup_service_async,
//GO(g_resolver_lookup_service_finish,
//GO(g_resolver_record_type_get_type,
//GO(g_resolver_set_default,
-//GO(g_resource_enumerate_children,
+GO(g_resource_enumerate_children, pFppup)
//GO(g_resource_error_get_type,
//GO(g_resource_error_quark,
//GO(g_resource_flags_get_type,
-//GO(g_resource_get_info,
+GO(g_resource_get_info, iFppuppp)
//GO(g_resource_get_type,
-//GO(g_resource_load,
-//GO(g_resource_lookup_data,
+GO(g_resource_load, pFpp)
+GO(g_resource_lookup_data, pFppup)
//GO(g_resource_lookup_flags_get_type,
-//GO(g_resource_new_from_data,
-//GO(g_resource_open_stream,
-//GO(g_resource_ref,
-//GO(g_resources_enumerate_children,
-//GO(g_resources_get_info,
-//GO(g_resources_lookup_data,
-//GO(g_resources_open_stream,
+GO(g_resource_new_from_data, pFpp)
+GO(g_resource_open_stream, pFppup)
+GO(g_resource_ref, pFp)
+GO(g_resources_enumerate_children, pFpup)
+GO(g_resources_get_info, iFpuppp)
+GO(g_resources_lookup_data, pFpup)
+GO(g_resources_open_stream, pFpup)
//GO(g_resources_register,
//GO(g_resources_unregister,
//GO(g_resource_unref,
//GO(g_seekable_can_seek,
-//GO(g_seekable_can_truncate,
+GO(g_seekable_can_truncate, iFp)
//GO(g_seekable_get_type,
-//GO(g_seekable_seek,
-//GO(g_seekable_tell,
-//GO(g_seekable_truncate,
+GO(g_seekable_seek, iFplupp)
+GO(g_seekable_tell, lFp)
+GO(g_seekable_truncate, iFplpp)
GO(g_settings_apply, vFp)
//GO(g_settings_backend_changed,
//GO(g_settings_backend_changed_tree,
@@ -1302,87 +1302,87 @@ GO(g_settings_apply, vFp)
//GO(g_settings_backend_path_changed,
//GO(g_settings_backend_path_writable_changed,
//GO(g_settings_backend_writable_changed,
-//GO(g_settings_bind,
+GO(g_settings_bind, vFppppu)
//GO(g_settings_bind_flags_get_type,
//GO(g_settings_bind_with_mapping,
-//GO(g_settings_bind_writable,
-//GO(g_settings_create_action,
+GO(g_settings_bind_writable, vFppppi)
+GO(g_settings_create_action, pFpp)
GO(g_settings_delay, vFp)
//GO(g_settings_get,
-//GO(g_settings_get_boolean,
+GO(g_settings_get_boolean, iFpp)
GO(g_settings_get_child, pFpp)
GO(g_settings_get_default_value, pFpp)
-//GO(g_settings_get_double,
-//GO(g_settings_get_enum,
-//GO(g_settings_get_flags,
+GO(g_settings_get_double, dFpp)
+GO(g_settings_get_enum, iFpp)
+GO(g_settings_get_flags, uFpp)
GO(g_settings_get_has_unapplied, iFp)
-//GO(g_settings_get_int,
+GO(g_settings_get_int, iFpp)
//GO(g_settings_get_mapped,
//GO(g_settings_get_range,
GO(g_settings_get_string, pFpp)
-//GO(g_settings_get_strv,
-//GO(g_settings_get_type,
-//GO(g_settings_get_uint,
+GO(g_settings_get_strv, pFpp)
+GO(g_settings_get_type, pFv)
+GO(g_settings_get_uint, uFpp)
GO(g_settings_get_user_value, pFpp)
GO(g_settings_get_value, pFpp)
GO(g_settings_is_writable, iFpp)
//GO(g_settings_list_children,
GO(g_settings_list_keys, pFp)
-//GO(g_settings_list_relocatable_schemas,
+GO(g_settings_list_relocatable_schemas, pFv)
//GO(g_settings_list_schemas,
GO(g_settings_new, pFp)
-//GO(g_settings_new_full,
-//GO(g_settings_new_with_backend,
-//GO(g_settings_new_with_backend_and_path,
+GO(g_settings_new_full, pFppp)
+GO(g_settings_new_with_backend, pFpp)
+GO(g_settings_new_with_backend_and_path, pFppp)
GO(g_settings_new_with_path, pFpp)
//GO(g_settings_range_check,
GO(g_settings_reset, vFpp)
//GO(g_settings_revert,
//GO(g_settings_schema_get_id,
-//GO(g_settings_schema_get_key,
-//GO(g_settings_schema_get_path,
+GO(g_settings_schema_get_key, pFpp)
+GO(g_settings_schema_get_path, pFp)
//GO(g_settings_schema_get_type,
-//GO(g_settings_schema_has_key,
+GO(g_settings_schema_has_key, iFpp)
//GO(g_settings_schema_key_get_default_value,
-//GO(g_settings_schema_key_get_description,
-//GO(g_settings_schema_key_get_range,
+GO(g_settings_schema_key_get_description, pFp)
+GO(g_settings_schema_key_get_range, pFp)
//GO(g_settings_schema_key_get_summary,
//GO(g_settings_schema_key_get_type,
-//GO(g_settings_schema_key_get_value_type,
-//GO(g_settings_schema_key_range_check,
-//GO(g_settings_schema_key_ref,
+GO(g_settings_schema_key_get_value_type, pFp)
+GO(g_settings_schema_key_range_check, iFpp)
+GO(g_settings_schema_key_ref, pFp)
//GO(g_settings_schema_key_unref,
-//GO(g_settings_schema_ref,
+GO(g_settings_schema_ref, pFp)
GO(g_settings_schema_source_get_default, pFv)
GO(g_settings_schema_source_get_type, LFv)
-//GO(g_settings_schema_source_list_schemas,
+GO(g_settings_schema_source_list_schemas, vFpipp)
GO(g_settings_schema_source_lookup, pFppi)
-//GO(g_settings_schema_source_new_from_directory,
+GO(g_settings_schema_source_new_from_directory, pFppip)
GO(g_settings_schema_source_ref, pFp)
GO(g_settings_schema_source_unref, vFp)
-//GO(g_settings_schema_unref,
+GO(g_settings_schema_unref, vFp)
//GO(g_settings_set,
-//GO(g_settings_set_boolean,
-//GO(g_settings_set_double,
-//GO(g_settings_set_enum,
-//GO(g_settings_set_flags,
-//GO(g_settings_set_int,
-//GO(g_settings_set_string,
-//GO(g_settings_set_strv,
+GO(g_settings_set_boolean, iFppi)
+GO(g_settings_set_double, iFppd)
+GO(g_settings_set_enum, iFppi)
+GO(g_settings_set_flags, iFppu)
+GO(g_settings_set_int, iFppi)
+GO(g_settings_set_string, iFppp)
+GO(g_settings_set_strv, iFppp)
//GO(g_settings_set_uint,
GO(g_settings_set_value, iFppp)
GO(g_settings_sync, vFv)
-//GO(g_settings_unbind,
-//GO(g_simple_action_get_type,
+GO(g_settings_unbind, vFpp)
+GO(g_simple_action_get_type, LFv)
//GO(g_simple_action_group_add_entries,
//GO(g_simple_action_group_get_type,
-//GO(g_simple_action_group_insert,
-//GO(g_simple_action_group_lookup,
-//GO(g_simple_action_group_new,
-//GO(g_simple_action_group_remove,
-//GO(g_simple_action_new,
-//GO(g_simple_action_new_stateful,
-//GO(g_simple_action_set_enabled,
+GO(g_simple_action_group_insert, vFpp)
+GO(g_simple_action_group_lookup, pFpp)
+GO(g_simple_action_group_new, pFv)
+GO(g_simple_action_group_remove, vFpp)
+GO(g_simple_action_new, pFpp)
+GO(g_simple_action_new_stateful, pFppp)
+GO(g_simple_action_set_enabled, vFpi)
//GO(g_simple_action_set_state,
GOM(g_simple_async_report_error_in_idle, vFEpppuipV)
GOM(g_simple_async_report_gerror_in_idle, vFEpppp)
@@ -1411,255 +1411,255 @@ GOM(g_simple_async_result_set_op_res_gpointer, vFEppp)
GO(g_simple_async_result_set_op_res_gssize, vFpl)
GO(g_simple_async_result_take_error, vFpp)
GO(g_simple_permission_get_type, LFv)
-//GO(g_simple_permission_new,
+GO(g_simple_permission_new, pFi)
GO(g_simple_proxy_resolver_get_type, LFv)
-//GO(g_simple_proxy_resolver_new,
-//GO(g_simple_proxy_resolver_set_default_proxy,
-//GO(g_simple_proxy_resolver_set_ignore_hosts,
-//GO(g_simple_proxy_resolver_set_uri_proxy,
-//GO(g_socket_accept,
+GO(g_simple_proxy_resolver_new, pFpp)
+GO(g_simple_proxy_resolver_set_default_proxy, vFpp)
+GO(g_simple_proxy_resolver_set_ignore_hosts, vFpp)
+GO(g_simple_proxy_resolver_set_uri_proxy, vFppp)
+GO(g_socket_accept, pFppp)
//GO(g_socket_address_enumerator_get_type,
-//GO(g_socket_address_enumerator_next,
+GO(g_socket_address_enumerator_next, pFppp)
//GO(g_socket_address_enumerator_next_async,
-//GO(g_socket_address_enumerator_next_finish,
-//GO(g_socket_address_get_family,
-//GO(g_socket_address_get_native_size,
+GO(g_socket_address_enumerator_next_finish, pFppp)
+GO(g_socket_address_get_family, uFp)
+GO(g_socket_address_get_native_size, lFp)
//GO(g_socket_address_get_type,
//GO(g_socket_address_new_from_native,
-//GO(g_socket_address_to_native,
-//GO(g_socket_bind,
+GO(g_socket_address_to_native, iFppLp)
+GO(g_socket_bind, iFppip)
//GO(g_socket_check_connect_result,
-//GO(g_socket_client_add_application_proxy,
-//GO(g_socket_client_connect,
+GO(g_socket_client_add_application_proxy, vFpp)
+GO(g_socket_client_connect, pFpppp)
//GO(g_socket_client_connect_async,
//GO(g_socket_client_connect_finish,
//GO(g_socket_client_connect_to_host,
//GO(g_socket_client_connect_to_host_async,
//GO(g_socket_client_connect_to_host_finish,
-//GO(g_socket_client_connect_to_service,
+GO(g_socket_client_connect_to_service, pFppppp)
//GO(g_socket_client_connect_to_service_async,
//GO(g_socket_client_connect_to_service_finish,
-//GO(g_socket_client_connect_to_uri,
+GO(g_socket_client_connect_to_uri, pFppWpp)
//GO(g_socket_client_connect_to_uri_async,
-//GO(g_socket_client_connect_to_uri_finish,
+GO(g_socket_client_connect_to_uri_finish, pFppp)
//GO(g_socket_client_event_get_type,
//GO(g_socket_client_get_enable_proxy,
-//GO(g_socket_client_get_family,
-//GO(g_socket_client_get_local_address,
-//GO(g_socket_client_get_protocol,
-//GO(g_socket_client_get_proxy_resolver,
-//GO(g_socket_client_get_socket_type,
-//GO(g_socket_client_get_timeout,
-//GO(g_socket_client_get_tls,
-//GO(g_socket_client_get_tls_validation_flags,
+GO(g_socket_client_get_family, uFp)
+GO(g_socket_client_get_local_address, pFp)
+GO(g_socket_client_get_protocol, iFp)
+GO(g_socket_client_get_proxy_resolver, pFp)
+GO(g_socket_client_get_socket_type, uFp)
+GO(g_socket_client_get_timeout, uFp)
+GO(g_socket_client_get_tls, iFp)
+GO(g_socket_client_get_tls_validation_flags, uFp)
//GO(g_socket_client_get_type,
-//GO(g_socket_client_new,
+GO(g_socket_client_new, pFv)
//GO(g_socket_client_set_enable_proxy,
-//GO(g_socket_client_set_family,
-//GO(g_socket_client_set_local_address,
-//GO(g_socket_client_set_protocol,
-//GO(g_socket_client_set_proxy_resolver,
-//GO(g_socket_client_set_socket_type,
-//GO(g_socket_client_set_timeout,
-//GO(g_socket_client_set_tls,
-//GO(g_socket_client_set_tls_validation_flags,
-//GO(g_socket_close,
-//GO(g_socket_condition_check,
-//GO(g_socket_condition_timed_wait,
-//GO(g_socket_condition_wait,
-//GO(g_socket_connect,
+GO(g_socket_client_set_family, vFpu)
+GO(g_socket_client_set_local_address, vFpp)
+GO(g_socket_client_set_protocol, vFpi)
+GO(g_socket_client_set_proxy_resolver, vFpp)
+GO(g_socket_client_set_socket_type, vFpu)
+GO(g_socket_client_set_timeout, vFpu)
+GO(g_socket_client_set_tls, vFpi)
+GO(g_socket_client_set_tls_validation_flags, vFpu)
+GO(g_socket_close, iFpp)
+GO(g_socket_condition_check, uFpu)
+GO(g_socket_condition_timed_wait, iFpulpp)
+GO(g_socket_condition_wait, iFpupp)
+GO(g_socket_connect, iFpppp)
//GO(g_socket_connectable_enumerate,
//GO(g_socket_connectable_get_type,
-//GO(g_socket_connectable_proxy_enumerate,
-//GO(g_socket_connection_connect,
+GO(g_socket_connectable_proxy_enumerate, pFp)
+GO(g_socket_connection_connect, iFpppp)
//GO(g_socket_connection_connect_async,
-//GO(g_socket_connection_connect_finish,
-//GO(g_socket_connection_factory_create_connection,
-//GO(g_socket_connection_factory_lookup_type,
-//GO(g_socket_connection_factory_register_type,
+GO(g_socket_connection_connect_finish, iFppp)
+GO(g_socket_connection_factory_create_connection, pFp)
+GO(g_socket_connection_factory_lookup_type, LFuui)
+GO(g_socket_connection_factory_register_type, vFLuui)
//GO(g_socket_connection_get_local_address,
-//GO(g_socket_connection_get_remote_address,
-//GO(g_socket_connection_get_socket,
+GO(g_socket_connection_get_remote_address, pFpp)
+GO(g_socket_connection_get_socket, pFp)
//GO(g_socket_connection_get_type,
-//GO(g_socket_connection_is_connected,
-//GO(g_socket_control_message_deserialize,
+GO(g_socket_connection_is_connected, iFp)
+GO(g_socket_control_message_deserialize, pFiiLp)
//GO(g_socket_control_message_get_level,
-//GO(g_socket_control_message_get_msg_type,
-//GO(g_socket_control_message_get_size,
+GO(g_socket_control_message_get_msg_type, iFp)
+GO(g_socket_control_message_get_size, LFp)
//GO(g_socket_control_message_get_type,
-//GO(g_socket_control_message_serialize,
+GO(g_socket_control_message_serialize, vFpp)
//GO(g_socket_create_source,
//GO(g_socket_family_get_type,
-//GO(g_socket_get_available_bytes,
+GO(g_socket_get_available_bytes, lFp)
//GO(g_socket_get_blocking,
//GO(g_socket_get_broadcast,
-//GO(g_socket_get_credentials,
-//GO(g_socket_get_family,
-//GO(g_socket_get_fd,
+GO(g_socket_get_credentials, pFpp)
+GO(g_socket_get_family, uFp)
+GO(g_socket_get_fd, iFp)
//GO(g_socket_get_keepalive,
-//GO(g_socket_get_listen_backlog,
+GO(g_socket_get_listen_backlog, iFp)
//GO(g_socket_get_local_address,
//GO(g_socket_get_multicast_loopback,
-//GO(g_socket_get_multicast_ttl,
-//GO(g_socket_get_option,
-//GO(g_socket_get_protocol,
-//GO(g_socket_get_remote_address,
-//GO(g_socket_get_socket_type,
+GO(g_socket_get_multicast_ttl, uFp)
+GO(g_socket_get_option, iFpiipp)
+GO(g_socket_get_protocol, iFp)
+GO(g_socket_get_remote_address, pFpp)
+GO(g_socket_get_socket_type, uFp)
//GO(g_socket_get_timeout,
//GO(g_socket_get_ttl,
//GO(g_socket_get_type,
//GO(g_socket_is_closed,
//GO(g_socket_is_connected,
//GO(g_socket_join_multicast_group,
-//GO(g_socket_leave_multicast_group,
+GO(g_socket_leave_multicast_group, iFppipp)
//GO(g_socket_listen,
-//GO(g_socket_listener_accept,
+GO(g_socket_listener_accept, pFpppp)
//GO(g_socket_listener_accept_async,
-//GO(g_socket_listener_accept_finish,
-//GO(g_socket_listener_accept_socket,
+GO(g_socket_listener_accept_finish, pFpppp)
+GO(g_socket_listener_accept_socket, pFpppp)
//GO(g_socket_listener_accept_socket_async,
-//GO(g_socket_listener_accept_socket_finish,
-//GO(g_socket_listener_add_address,
-//GO(g_socket_listener_add_any_inet_port,
-//GO(g_socket_listener_add_inet_port,
-//GO(g_socket_listener_add_socket,
+GO(g_socket_listener_accept_socket_finish, pFpppp)
+GO(g_socket_listener_add_address, iFppuippp)
+GO(g_socket_listener_add_any_inet_port, WFppp)
+GO(g_socket_listener_add_inet_port, iFpWpp)
+GO(g_socket_listener_add_socket, iFpppp)
//GO(g_socket_listener_close,
//GO(g_socket_listener_get_type,
-//GO(g_socket_listener_new,
-//GO(g_socket_listener_set_backlog,
+GO(g_socket_listener_new, pFv)
+GO(g_socket_listener_set_backlog, vFpi)
//GO(g_socket_msg_flags_get_type,
-//GO(g_socket_new,
-//GO(g_socket_new_from_fd,
+GO(g_socket_new, pFuuip)
+GO(g_socket_new_from_fd, pFip)
//GO(g_socket_protocol_get_type,
-//GO(g_socket_receive,
-//GO(g_socket_receive_from,
-//GO(g_socket_receive_message,
-//GO(g_socket_receive_with_blocking,
-//GO(g_socket_send,
-//GO(g_socket_send_message,
-//GO(g_socket_send_to,
-//GO(g_socket_send_with_blocking,
+GO(g_socket_receive, lFppLpp)
+GO(g_socket_receive_from, lFpppLpp)
+GO(g_socket_receive_message, lFpppippppp)
+GO(g_socket_receive_with_blocking, lFppLipp)
+GO(g_socket_send, lFppLpp)
+GO(g_socket_send_message, lFpppipiipp)
+GO(g_socket_send_to, lFpppLpp)
+GO(g_socket_send_with_blocking, lFppLipp)
//GO(g_socket_service_get_type,
-//GO(g_socket_service_is_active,
-//GO(g_socket_service_new,
+GO(g_socket_service_is_active, iFp)
+GO(g_socket_service_new, pFv)
//GO(g_socket_service_start,
//GO(g_socket_service_stop,
//GO(g_socket_set_blocking,
//GO(g_socket_set_broadcast,
//GO(g_socket_set_keepalive,
-//GO(g_socket_set_listen_backlog,
-//GO(g_socket_set_multicast_loopback,
-//GO(g_socket_set_multicast_ttl,
-//GO(g_socket_set_option,
+GO(g_socket_set_listen_backlog, vFpi)
+GO(g_socket_set_multicast_loopback, vFpi)
+GO(g_socket_set_multicast_ttl, vFpu)
+GO(g_socket_set_option, iFpiiip)
//GO(g_socket_set_timeout,
//GO(g_socket_set_ttl,
-//GO(g_socket_shutdown,
-//GO(g_socket_speaks_ipv4,
+GO(g_socket_shutdown, iFpiip)
+GO(g_socket_speaks_ipv4, iFp)
//GO(g_socket_type_get_type,
-//GO(g_srv_target_copy,
-//GO(g_srv_target_free,
-//GO(g_srv_target_get_hostname,
+GO(g_srv_target_copy, pFp)
+GO(g_srv_target_free, vFp)
+GO(g_srv_target_get_hostname, pFp)
//GO(g_srv_target_get_port,
//GO(g_srv_target_get_priority,
//GO(g_srv_target_get_type,
-//GO(g_srv_target_get_weight,
-//GO(g_srv_target_list_sort,
-//GO(g_srv_target_new,
-//GO(g_static_resource_fini,
-//GO(g_static_resource_get_resource,
-//GO(g_static_resource_init,
-//GO(g_subprocess_communicate,
+GO(g_srv_target_get_weight, WFp)
+GO(g_srv_target_list_sort, pFp)
+GO(g_srv_target_new, pFpWWW)
+GO(g_static_resource_fini, vFp)
+GO(g_static_resource_get_resource, pFp)
+GO(g_static_resource_init, vFp)
+GO(g_subprocess_communicate, iFpppppp)
//GO(g_subprocess_communicate_async,
-//GO(g_subprocess_communicate_finish,
-//GO(g_subprocess_communicate_utf8,
+GO(g_subprocess_communicate_finish, iFppppp)
+GO(g_subprocess_communicate_utf8, iFpppppp)
//GO(g_subprocess_communicate_utf8_async,
-//GO(g_subprocess_communicate_utf8_finish,
+GO(g_subprocess_communicate_utf8_finish, iFppppp)
//GO(g_subprocess_flags_get_type,
//GO(g_subprocess_force_exit,
//GO(g_subprocess_get_exit_status,
-//GO(g_subprocess_get_identifier,
+GO(g_subprocess_get_identifier, pFp)
//GO(g_subprocess_get_if_exited,
-//GO(g_subprocess_get_if_signaled,
+GO(g_subprocess_get_if_signaled, iFp)
//GO(g_subprocess_get_status,
-//GO(g_subprocess_get_stderr_pipe,
-//GO(g_subprocess_get_stdin_pipe,
+GO(g_subprocess_get_stderr_pipe, pFp)
+GO(g_subprocess_get_stdin_pipe, pFp)
//GO(g_subprocess_get_stdout_pipe,
//GO(g_subprocess_get_successful,
-//GO(g_subprocess_get_term_sig,
+GO(g_subprocess_get_term_sig, iFp)
//GO(g_subprocess_get_type,
-//GO(g_subprocess_launcher_getenv,
+GO(g_subprocess_launcher_getenv, pFpp)
//GO(g_subprocess_launcher_get_type,
-//GO(g_subprocess_launcher_new,
+GO(g_subprocess_launcher_new, pFu)
//GO(g_subprocess_launcher_set_child_setup,
//GO(g_subprocess_launcher_set_cwd,
-//GO(g_subprocess_launcher_setenv,
-//GO(g_subprocess_launcher_set_environ,
-//GO(g_subprocess_launcher_set_flags,
-//GO(g_subprocess_launcher_set_stderr_file_path,
+GO(g_subprocess_launcher_setenv, vFpppi)
+GO(g_subprocess_launcher_set_environ, vFpp)
+GO(g_subprocess_launcher_set_flags, vFpu)
+GO(g_subprocess_launcher_set_stderr_file_path, vFpp)
//GO(g_subprocess_launcher_set_stdin_file_path,
//GO(g_subprocess_launcher_set_stdout_file_path,
//GO(g_subprocess_launcher_spawn,
-//GO(g_subprocess_launcher_spawnv,
-//GO(g_subprocess_launcher_take_fd,
-//GO(g_subprocess_launcher_take_stderr_fd,
+GO(g_subprocess_launcher_spawnv, pFppp)
+GO(g_subprocess_launcher_take_fd, vFpii)
+GO(g_subprocess_launcher_take_stderr_fd, vFpi)
//GO(g_subprocess_launcher_take_stdin_fd,
//GO(g_subprocess_launcher_take_stdout_fd,
//GO(g_subprocess_launcher_unsetenv,
//GO(g_subprocess_new,
-//GO(g_subprocess_newv,
-//GO(g_subprocess_send_signal,
+GO(g_subprocess_newv, pFpup)
+GO(g_subprocess_send_signal, vFpi)
//GO(g_subprocess_wait,
//GO(g_subprocess_wait_async,
-//GO(g_subprocess_wait_check,
+GO(g_subprocess_wait_check, iFppp)
//GO(g_subprocess_wait_check_async,
-//GO(g_subprocess_wait_check_finish,
+GO(g_subprocess_wait_check_finish, iFppp)
//GO(g_subprocess_wait_finish,
//GO(g_task_attach_source,
-//GO(g_task_get_cancellable,
+GO(g_task_get_cancellable, pFp)
//GO(g_task_get_check_cancellable,
-//GO(g_task_get_context,
-//GO(g_task_get_priority,
+GO(g_task_get_context, pFp)
+GO(g_task_get_priority, iFp)
//GO(g_task_get_return_on_cancel,
//GO(g_task_get_source_object,
-//GO(g_task_get_source_tag,
+GO(g_task_get_source_tag, pFp)
//GO(g_task_get_task_data,
-//GO(g_task_get_type,
+GO(g_task_get_type, LFv)
//GO(g_task_had_error,
-//GO(g_task_is_valid,
-//GO(g_task_new,
-//GO(g_task_propagate_boolean,
-//GO(g_task_propagate_int,
-//GO(g_task_propagate_pointer,
+GO(g_task_is_valid, iFpp)
+GOM(g_task_new, pFEpppp)
+GO(g_task_propagate_boolean, iFpp)
+GO(g_task_propagate_int, lFpp)
+GO(g_task_propagate_pointer, pFpp)
//GO(g_task_report_error,
//GO(g_task_report_new_error,
-//GO(g_task_return_boolean,
-//GO(g_task_return_error,
+GO(g_task_return_boolean, vFpi)
+GO(g_task_return_error, vFpp)
//GO(g_task_return_error_if_cancelled,
-//GO(g_task_return_int,
-//GO(g_task_return_new_error,
-//GO(g_task_return_pointer,
+GO(g_task_return_int, vFpl)
+GOM(g_task_return_new_error, vFEpuipV)
+GOM(g_task_return_pointer, vFEppp)
//GO(g_task_run_in_thread,
//GO(g_task_run_in_thread_sync,
//GO(g_task_set_check_cancellable,
-//GO(g_task_set_priority,
-//GO(g_task_set_return_on_cancel,
-//GO(g_task_set_source_tag,
+GO(g_task_set_priority, vFpi)
+GO(g_task_set_return_on_cancel, iFpi)
+GO(g_task_set_source_tag, vFpp)
//GO(g_task_set_task_data,
-//GO(g_tcp_connection_get_graceful_disconnect,
+GO(g_tcp_connection_get_graceful_disconnect, iFp)
//GO(g_tcp_connection_get_type,
-//GO(g_tcp_connection_set_graceful_disconnect,
-//GO(g_tcp_wrapper_connection_get_base_io_stream,
+GO(g_tcp_connection_set_graceful_disconnect, vFpi)
+GO(g_tcp_wrapper_connection_get_base_io_stream, pFp)
//GO(g_tcp_wrapper_connection_get_type,
-//GO(g_tcp_wrapper_connection_new,
-//GO(g_test_dbus_add_service_dir,
+GO(g_tcp_wrapper_connection_new, pFpp)
+GO(g_test_dbus_add_service_dir, vFpp)
//GO(g_test_dbus_down,
//GO(g_test_dbus_flags_get_type,
-//GO(g_test_dbus_get_bus_address,
-//GO(g_test_dbus_get_flags,
+GO(g_test_dbus_get_bus_address, pFp)
+GO(g_test_dbus_get_flags, uFp)
//GO(g_test_dbus_get_type,
-//GO(g_test_dbus_new,
+GO(g_test_dbus_new, pFu)
//GO(g_test_dbus_stop,
-//GO(g_test_dbus_unset,
+GO(g_test_dbus_unset, vFv)
//GO(g_test_dbus_up,
GO(g_themed_icon_append_name, vFpp)
GO(g_themed_icon_get_names, pFp)
@@ -1670,121 +1670,121 @@ GO(g_themed_icon_new_with_default_fallbacks, pFp)
GO(g_themed_icon_prepend_name, vFpp)
//GO(g_threaded_resolver_get_type,
//GO(g_threaded_socket_service_get_type,
-//GO(g_threaded_socket_service_new,
+GO(g_threaded_socket_service_new, pFi)
//GO(g_tls_authentication_mode_get_type,
//GO(g_tls_backend_get_certificate_type,
//GO(g_tls_backend_get_client_connection_type,
-//GO(g_tls_backend_get_default,
-//GO(g_tls_backend_get_default_database,
+GO(g_tls_backend_get_default, pFv)
+GO(g_tls_backend_get_default_database, pFp)
//GO(g_tls_backend_get_file_database_type,
//GO(g_tls_backend_get_server_connection_type,
//GO(g_tls_backend_get_type,
//GO(g_tls_backend_supports_tls,
//GO(g_tls_certificate_flags_get_type,
-//GO(g_tls_certificate_get_issuer,
+GO(g_tls_certificate_get_issuer, pFp)
//GO(g_tls_certificate_get_type,
-//GO(g_tls_certificate_is_same,
-//GO(g_tls_certificate_list_new_from_file,
-//GO(g_tls_certificate_new_from_file,
+GO(g_tls_certificate_is_same, iFpp)
+GO(g_tls_certificate_list_new_from_file, pFpp)
+GO(g_tls_certificate_new_from_file, pFpp)
//GO(g_tls_certificate_new_from_files,
-//GO(g_tls_certificate_new_from_pem,
+GO(g_tls_certificate_new_from_pem, pFplp)
//GO(g_tls_certificate_request_flags_get_type,
-//GO(g_tls_certificate_verify,
-//GO(g_tls_client_connection_get_accepted_cas,
-//GO(g_tls_client_connection_get_server_identity,
+GO(g_tls_certificate_verify, uFppp)
+GO(g_tls_client_connection_get_accepted_cas, pFp)
+GO(g_tls_client_connection_get_server_identity, pFp)
//GO(g_tls_client_connection_get_type,
-//GO(g_tls_client_connection_get_use_ssl3,
-//GO(g_tls_client_connection_get_validation_flags,
-//GO(g_tls_client_connection_new,
-//GO(g_tls_client_connection_set_server_identity,
-//GO(g_tls_client_connection_set_use_ssl3,
-//GO(g_tls_client_connection_set_validation_flags,
-//GO(g_tls_connection_emit_accept_certificate,
+GO(g_tls_client_connection_get_use_ssl3, iFp)
+GO(g_tls_client_connection_get_validation_flags, uFp)
+GO(g_tls_client_connection_new, pFppp)
+GO(g_tls_client_connection_set_server_identity, vFpp)
+GO(g_tls_client_connection_set_use_ssl3, vFpi)
+GO(g_tls_client_connection_set_validation_flags, vFpu)
+GO(g_tls_connection_emit_accept_certificate, iFppu)
//GO(g_tls_connection_get_certificate,
-//GO(g_tls_connection_get_database,
-//GO(g_tls_connection_get_interaction,
-//GO(g_tls_connection_get_peer_certificate,
-//GO(g_tls_connection_get_peer_certificate_errors,
-//GO(g_tls_connection_get_rehandshake_mode,
-//GO(g_tls_connection_get_require_close_notify,
+GO(g_tls_connection_get_database, pFp)
+GO(g_tls_connection_get_interaction, pFp)
+GO(g_tls_connection_get_peer_certificate, pFp)
+GO(g_tls_connection_get_peer_certificate_errors, uFp)
+GO(g_tls_connection_get_rehandshake_mode, uFp)
+GO(g_tls_connection_get_require_close_notify, iFp)
//GO(g_tls_connection_get_type,
//GO(g_tls_connection_get_use_system_certdb,
-//GO(g_tls_connection_handshake,
+GO(g_tls_connection_handshake, iFppp)
//GO(g_tls_connection_handshake_async,
-//GO(g_tls_connection_handshake_finish,
-//GO(g_tls_connection_set_certificate,
-//GO(g_tls_connection_set_database,
-//GO(g_tls_connection_set_interaction,
-//GO(g_tls_connection_set_rehandshake_mode,
-//GO(g_tls_connection_set_require_close_notify,
+GO(g_tls_connection_handshake_finish, iFppp)
+GO(g_tls_connection_set_certificate, vFpp)
+GO(g_tls_connection_set_database, vFpp)
+GO(g_tls_connection_set_interaction, vFpp)
+GO(g_tls_connection_set_rehandshake_mode, vFpu)
+GO(g_tls_connection_set_require_close_notify, vFpi)
//GO(g_tls_connection_set_use_system_certdb,
-//GO(g_tls_database_create_certificate_handle,
+GO(g_tls_database_create_certificate_handle, pFpp)
//GO(g_tls_database_get_type,
-//GO(g_tls_database_lookup_certificate_for_handle,
+GO(g_tls_database_lookup_certificate_for_handle, pFpppupp)
//GO(g_tls_database_lookup_certificate_for_handle_async,
//GO(g_tls_database_lookup_certificate_for_handle_finish,
-//GO(g_tls_database_lookup_certificate_issuer,
+GO(g_tls_database_lookup_certificate_issuer, pFpppupp)
//GO(g_tls_database_lookup_certificate_issuer_async,
-//GO(g_tls_database_lookup_certificate_issuer_finish,
-//GO(g_tls_database_lookup_certificates_issued_by,
+GO(g_tls_database_lookup_certificate_issuer_finish, pFppp)
+GO(g_tls_database_lookup_certificates_issued_by, pFpppupp)
//GO(g_tls_database_lookup_certificates_issued_by_async,
-//GO(g_tls_database_lookup_certificates_issued_by_finish,
+GO(g_tls_database_lookup_certificates_issued_by_finish, pFppp)
//GO(g_tls_database_lookup_flags_get_type,
-//GO(g_tls_database_verify_chain,
+GO(g_tls_database_verify_chain, uFpppppupp)
//GO(g_tls_database_verify_chain_async,
-//GO(g_tls_database_verify_chain_finish,
+GO(g_tls_database_verify_chain_finish, uFppp)
//GO(g_tls_database_verify_flags_get_type,
//GO(g_tls_error_get_type,
//GO(g_tls_error_quark,
//GO(g_tls_file_database_get_type,
-//GO(g_tls_file_database_new,
-//GO(g_tls_interaction_ask_password,
+GO(g_tls_file_database_new, pFpp)
+GO(g_tls_interaction_ask_password, uFpppp)
//GO(g_tls_interaction_ask_password_async,
//GO(g_tls_interaction_ask_password_finish,
//GO(g_tls_interaction_get_type,
//GO(g_tls_interaction_invoke_ask_password,
//GO(g_tls_interaction_invoke_request_certificate,
-//GO(g_tls_interaction_request_certificate,
+GO(g_tls_interaction_request_certificate, uFppupp)
//GO(g_tls_interaction_request_certificate_async,
-//GO(g_tls_interaction_request_certificate_finish,
+GO(g_tls_interaction_request_certificate_finish, uFppp)
//GO(g_tls_interaction_result_get_type,
//GO(g_tls_password_flags_get_type,
//GO(g_tls_password_get_description,
-//GO(g_tls_password_get_flags,
+GO(g_tls_password_get_flags, uFp)
//GO(g_tls_password_get_type,
-//GO(g_tls_password_get_value,
-//GO(g_tls_password_get_warning,
-//GO(g_tls_password_new,
+GO(g_tls_password_get_value, pFpp)
+GO(g_tls_password_get_warning, pFp)
+GO(g_tls_password_new, pFup)
//GO(g_tls_password_set_description,
-//GO(g_tls_password_set_flags,
-//GO(g_tls_password_set_value,
+GO(g_tls_password_set_flags, vFpu)
+GO(g_tls_password_set_value, vFppl)
//GO(g_tls_password_set_value_full,
-//GO(g_tls_password_set_warning,
+GO(g_tls_password_set_warning, vFpp)
//GO(g_tls_rehandshake_mode_get_type,
//GO(g_tls_server_connection_get_type,
-//GO(g_tls_server_connection_new,
+GO(g_tls_server_connection_new, pFppp)
//GO(g_unix_connection_get_type,
-//GO(g_unix_connection_receive_credentials,
+GO(g_unix_connection_receive_credentials, pFppp)
//GO(g_unix_connection_receive_credentials_async,
-//GO(g_unix_connection_receive_credentials_finish,
-//GO(g_unix_connection_receive_fd,
-//GO(g_unix_connection_send_credentials,
+GO(g_unix_connection_receive_credentials_finish, pFppp)
+GO(g_unix_connection_receive_fd, iFppp)
+GO(g_unix_connection_send_credentials, iFppp)
//GO(g_unix_connection_send_credentials_async,
-//GO(g_unix_connection_send_credentials_finish,
-//GO(g_unix_connection_send_fd,
-//GO(g_unix_credentials_message_get_credentials,
+GO(g_unix_connection_send_credentials_finish, iFppp)
+GO(g_unix_connection_send_fd, iFpipp)
+GO(g_unix_credentials_message_get_credentials, pFp)
//GO(g_unix_credentials_message_get_type,
//GO(g_unix_credentials_message_is_supported,
-//GO(g_unix_credentials_message_new,
-//GO(g_unix_credentials_message_new_with_credentials,
+GO(g_unix_credentials_message_new, pFv)
+GO(g_unix_credentials_message_new_with_credentials, pFp)
//GO(g_unix_fd_list_append,
GO(g_unix_fd_list_get, iFpip)
GO(g_unix_fd_list_get_length, iFp)
GO(g_unix_fd_list_get_type, LFv)
-//GO(g_unix_fd_list_new,
-//GO(g_unix_fd_list_new_from_array,
-//GO(g_unix_fd_list_peek_fds,
-//GO(g_unix_fd_list_steal_fds,
+GO(g_unix_fd_list_new, pFv)
+GO(g_unix_fd_list_new_from_array, pFpi)
+GO(g_unix_fd_list_peek_fds, pFpp)
+GO(g_unix_fd_list_steal_fds, pFpp)
//GO(g_unix_fd_message_append_fd,
//GO(g_unix_fd_message_get_fd_list,
//GO(g_unix_fd_message_get_type,
@@ -1835,58 +1835,58 @@ GO(g_unix_fd_list_get_type, LFv)
//GO(g_unix_output_stream_get_type,
//GO(g_unix_output_stream_new,
//GO(g_unix_output_stream_set_close_fd,
-//GO(g_unix_socket_address_abstract_names_supported,
-//GO(g_unix_socket_address_get_address_type,
-//GO(g_unix_socket_address_get_is_abstract,
-//GO(g_unix_socket_address_get_path,
-//GO(g_unix_socket_address_get_path_len,
+GO(g_unix_socket_address_abstract_names_supported, iFv)
+GO(g_unix_socket_address_get_address_type, uFp)
+GO(g_unix_socket_address_get_is_abstract, iFp)
+GO(g_unix_socket_address_get_path, pFp)
+GO(g_unix_socket_address_get_path_len, LFp)
//GO(g_unix_socket_address_get_type,
-//GO(g_unix_socket_address_new,
-//GO(g_unix_socket_address_new_abstract,
-//GO(g_unix_socket_address_new_with_type,
+GO(g_unix_socket_address_new, pFp)
+GO(g_unix_socket_address_new_abstract, pFpi)
+GO(g_unix_socket_address_new_with_type, pFpiu)
//GO(g_unix_socket_address_type_get_type,
//GO(g_vfs_get_default,
//GO(g_vfs_get_file_for_path,
//GO(g_vfs_get_file_for_uri,
-//GO(g_vfs_get_local,
-//GO(g_vfs_get_supported_uri_schemes,
+GO(g_vfs_get_local, pFv)
+GO(g_vfs_get_supported_uri_schemes, pFp)
//GO(g_vfs_get_type,
-//GO(g_vfs_is_active,
-//GO(g_vfs_parse_name,
+GO(g_vfs_is_active, iFp)
+GO(g_vfs_parse_name, pFpp)
//GO(g_volume_can_eject,
//GO(g_volume_can_mount,
//GO(g_volume_eject,
//GO(g_volume_eject_finish,
//GO(g_volume_eject_with_operation,
-//GO(g_volume_eject_with_operation_finish,
-//GO(g_volume_enumerate_identifiers,
-//GO(g_volume_get_activation_root,
-//GO(g_volume_get_drive,
+GO(g_volume_eject_with_operation_finish, iFppp)
+GO(g_volume_enumerate_identifiers, pFp)
+GO(g_volume_get_activation_root, pFp)
+GO(g_volume_get_drive, pFp)
//GO(g_volume_get_icon,
-//GO(g_volume_get_identifier,
-//GO(g_volume_get_mount,
+GO(g_volume_get_identifier, pFpp)
+GO(g_volume_get_mount, pFp)
//GO(g_volume_get_name,
-//GO(g_volume_get_sort_key,
-//GO(g_volume_get_symbolic_icon,
+GO(g_volume_get_sort_key, pFp)
+GO(g_volume_get_symbolic_icon, pFp)
//GO(g_volume_get_type,
-//GO(g_volume_get_uuid,
-//GO(g_volume_monitor_adopt_orphan_mount,
-//GO(g_volume_monitor_get,
+GO(g_volume_get_uuid, pFp)
+GO(g_volume_monitor_adopt_orphan_mount, pFp)
+GO(g_volume_monitor_get, pFv)
//GO(g_volume_monitor_get_connected_drives,
-//GO(g_volume_monitor_get_mount_for_uuid,
-//GO(g_volume_monitor_get_mounts,
+GO(g_volume_monitor_get_mount_for_uuid, pFpp)
+GO(g_volume_monitor_get_mounts, pFp)
//GO(g_volume_monitor_get_type,
-//GO(g_volume_monitor_get_volume_for_uuid,
+GO(g_volume_monitor_get_volume_for_uuid, pFpp)
//GO(g_volume_monitor_get_volumes,
//GO(g_volume_mount,
//GO(g_volume_mount_finish,
-//GO(g_volume_should_automount,
+GO(g_volume_should_automount, iFp)
//GO(g_zlib_compressor_format_get_type,
-//GO(g_zlib_compressor_get_file_info,
+GO(g_zlib_compressor_get_file_info, pFp)
//GO(g_zlib_compressor_get_type,
-//GO(g_zlib_compressor_new,
-//GO(g_zlib_compressor_set_file_info,
-//GO(g_zlib_decompressor_get_file_info,
-//GO(g_zlib_decompressor_get_type,
-//GO(g_zlib_decompressor_new,
+GO(g_zlib_compressor_new, pFui)
+GO(g_zlib_compressor_set_file_info, vFpp)
+GO(g_zlib_decompressor_get_file_info, pFp)
+GO(g_zlib_decompressor_get_type, LFv)
+GO(g_zlib_decompressor_new, pFu)
//GO(_init,
diff --git a/src/wrapped/wrappedglib2.c b/src/wrapped/wrappedglib2.c
index 1ddd6cb..5614314 100755..100644
--- a/src/wrapped/wrappedglib2.c
+++ b/src/wrapped/wrappedglib2.c
@@ -57,7 +57,7 @@ EXPORT void* my_g_build_filename(x64emu_t* emu, void* first, uintptr_t* b)
static int my_timeout_cb(my_signal_t* sig)
{
- return (int)RunFunction(my_context, sig->c_handler, 1, sig->data);
+ return (int)RunFunctionFmt(sig->c_handler, "p", sig->data);
}
EXPORT uint32_t my_g_timeout_add(x64emu_t* emu, uint32_t interval, void* func, void* data)
{
@@ -89,10 +89,10 @@ GO(9) \
// GCopyFct
#define GO(A) \
-static uintptr_t my_copy_fct_##A = 0; \
-static void* my_copy_##A(void* data) \
-{ \
- return (void*)RunFunction(my_context, my_copy_fct_##A, 1, data);\
+static uintptr_t my_copy_fct_##A = 0; \
+static void* my_copy_##A(void* data) \
+{ \
+ return (void*)RunFunctionFmt(my_copy_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -111,10 +111,10 @@ static void* findCopyFct(void* fct)
}
// GFreeFct
#define GO(A) \
-static uintptr_t my_free_fct_##A = 0; \
-static void my_free_##A(void* data) \
-{ \
- RunFunction(my_context, my_free_fct_##A, 1, data);\
+static uintptr_t my_free_fct_##A = 0; \
+static void my_free_##A(void* data) \
+{ \
+ RunFunctionFmt(my_free_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -133,10 +133,10 @@ static void* findFreeFct(void* fct)
}
// GDuplicateFct
#define GO(A) \
-static uintptr_t my_duplicate_fct_##A = 0; \
-static void* my_duplicate_##A(void* data) \
-{ \
- return (void*)RunFunction(my_context, my_duplicate_fct_##A, 1, data);\
+static uintptr_t my_duplicate_fct_##A = 0; \
+static void* my_duplicate_##A(void* data) \
+{ \
+ return (void*)RunFunctionFmt(my_duplicate_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -155,35 +155,35 @@ static void* findDuplicateFct(void* fct)
}
// GSourceFuncs....
// g_source_new callback. First the structure GSourceFuncs statics, with paired x64 source pointer
-#define GO(A) \
+#define GO(A) \
static my_GSourceFuncs_t my_gsourcefuncs_##A = {0}; \
static my_GSourceFuncs_t *ref_gsourcefuncs_##A = NULL;
SUPER()
#undef GO
// then the static functions callback that may be used with the structure, but dispatch also have a callback...
#define GO(A) \
-static uintptr_t fct_funcs_prepare_##A = 0; \
-static int my_funcs_prepare_##A(void* source, int *timeout_) { \
- return (int)RunFunction(my_context, fct_funcs_prepare_##A, 2, source, timeout_); \
-} \
-static uintptr_t fct_funcs_check_##A = 0; \
-static int my_funcs_check_##A(void* source) { \
- return (int)RunFunction(my_context, fct_funcs_check_##A, 1, source); \
-} \
-static uintptr_t fct_funcs_dispatch_cb_##A = 0; \
-static int my_funcs_dispatch_cb_##A(void* a, void* b, void* c, void* d) { \
- return (int)RunFunction(my_context, fct_funcs_dispatch_cb_##A, 4, a, b, c, d); \
-} \
-static uintptr_t fct_funcs_dispatch_##A = 0; \
-static int my_funcs_dispatch_##A(void* source, void* cb, void* data) { \
- uintptr_t old = fct_funcs_dispatch_cb_##A; \
- fct_funcs_dispatch_cb_##A = (uintptr_t)cb; \
- return (int)RunFunction(my_context, fct_funcs_dispatch_##A, 3, source, cb?my_funcs_dispatch_cb_##A:NULL, data); \
- fct_funcs_dispatch_cb_##A = old; \
-} \
-static uintptr_t fct_funcs_finalize_##A = 0; \
-static int my_funcs_finalize_##A(void* source) { \
- return (int)RunFunction(my_context, fct_funcs_finalize_##A, 1, source); \
+static uintptr_t fct_funcs_prepare_##A = 0; \
+static int my_funcs_prepare_##A(void* source, int *timeout_) { \
+ return (int)RunFunctionFmt(fct_funcs_prepare_##A, "pp", source, timeout_); \
+} \
+static uintptr_t fct_funcs_check_##A = 0; \
+static int my_funcs_check_##A(void* source) { \
+ return (int)RunFunctionFmt(fct_funcs_check_##A, "p", source); \
+} \
+static uintptr_t fct_funcs_dispatch_cb_##A = 0; \
+static int my_funcs_dispatch_cb_##A(void* a, void* b, void* c, void* d) { \
+ return (int)RunFunctionFmt(fct_funcs_dispatch_cb_##A, "pppp", a, b, c, d); \
+} \
+static uintptr_t fct_funcs_dispatch_##A = 0; \
+static int my_funcs_dispatch_##A(void* source, void* cb, void* data) { \
+ uintptr_t old = fct_funcs_dispatch_cb_##A; \
+ fct_funcs_dispatch_cb_##A = (uintptr_t)cb; \
+ return (int)RunFunctionFmt(fct_funcs_dispatch_##A, "ppp", source, cb?my_funcs_dispatch_cb_##A:NULL, data); \
+ fct_funcs_dispatch_cb_##A = old; \
+} \
+static uintptr_t fct_funcs_finalize_##A = 0; \
+static int my_funcs_finalize_##A(void* source) { \
+ return (int)RunFunctionFmt(fct_funcs_finalize_##A, "p", source); \
}
SUPER()
#undef GO
@@ -214,10 +214,10 @@ static my_GSourceFuncs_t* findFreeGSourceFuncs(my_GSourceFuncs_t* fcts)
// PollFunc ...
#define GO(A) \
-static uintptr_t my_poll_fct_##A = 0; \
-static int my_poll_##A(void* ufds, uint32_t nfsd, int32_t timeout_) \
-{ \
- return RunFunction(my_context, my_poll_fct_##A, 3, ufds, nfsd, timeout_);\
+static uintptr_t my_poll_fct_##A = 0; \
+static int my_poll_##A(void* ufds, uint32_t nfsd, int32_t timeout_) \
+{ \
+ return RunFunctionFmt(my_poll_fct_##A, "pui", ufds, nfsd, timeout_); \
}
SUPER()
#undef GO
@@ -246,10 +246,10 @@ static void* reversePollFct(void* fct)
// GHashFunc ...
#define GO(A) \
-static uintptr_t my_hashfunc_fct_##A = 0; \
-static uint32_t my_hashfunc_##A(void* key) \
-{ \
- return (uint32_t)RunFunction(my_context, my_hashfunc_fct_##A, 1, key);\
+static uintptr_t my_hashfunc_fct_##A = 0; \
+static uint32_t my_hashfunc_##A(void* key) \
+{ \
+ return (uint32_t)RunFunctionFmt(my_hashfunc_fct_##A, "p", key); \
}
SUPER()
#undef GO
@@ -268,10 +268,10 @@ static void* findHashFct(void* fct)
}
// GEqualFunc ...
#define GO(A) \
-static uintptr_t my_equalfunc_fct_##A = 0; \
-static int my_equalfunc_##A(void* a, void* b) \
-{ \
- return RunFunction(my_context, my_equalfunc_fct_##A, 2, a, b);\
+static uintptr_t my_equalfunc_fct_##A = 0; \
+static int my_equalfunc_##A(void* a, void* b) \
+{ \
+ return RunFunctionFmt(my_equalfunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -290,10 +290,10 @@ static void* findEqualFct(void* fct)
}
// GDestroyFunc ...
#define GO(A) \
-static uintptr_t my_destroyfunc_fct_##A = 0; \
-static int my_destroyfunc_##A(void* a, void* b) \
-{ \
- return RunFunction(my_context, my_destroyfunc_fct_##A, 2, a, b);\
+static uintptr_t my_destroyfunc_fct_##A = 0; \
+static int my_destroyfunc_##A(void* a, void* b) \
+{ \
+ return RunFunctionFmt(my_destroyfunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -312,10 +312,10 @@ static void* findDestroyFct(void* fct)
}
// GSpawnChildSetupFunc ...
#define GO(A) \
-static uintptr_t my_spwnchildsetup_fct_##A = 0; \
-static void my_spwnchildsetup_##A(void* data) \
-{ \
- RunFunction(my_context, my_spwnchildsetup_fct_##A, 1, data);\
+static uintptr_t my_spwnchildsetup_fct_##A = 0; \
+static void my_spwnchildsetup_##A(void* data) \
+{ \
+ RunFunctionFmt(my_spwnchildsetup_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -334,10 +334,10 @@ static void* findSpawnChildSetupFct(void* fct)
}
// GSourceFunc ...
#define GO(A) \
-static uintptr_t my_GSourceFunc_fct_##A = 0; \
-static void my_GSourceFunc_##A(void* a, void* b, void* c, void* d) \
-{ \
- RunFunction(my_context, my_GSourceFunc_fct_##A, 4, a, b, c, d);\
+static uintptr_t my_GSourceFunc_fct_##A = 0; \
+static void my_GSourceFunc_##A(void* a, void* b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_GSourceFunc_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -356,10 +356,10 @@ static void* findGSourceFuncFct(void* fct)
}
// GCompareFunc ...
#define GO(A) \
-static uintptr_t my_GCompareFunc_fct_##A = 0; \
-static int my_GCompareFunc_##A(void* a, void* b) \
-{ \
- return (int)RunFunction(my_context, my_GCompareFunc_fct_##A, 2, a, b);\
+static uintptr_t my_GCompareFunc_fct_##A = 0; \
+static int my_GCompareFunc_##A(void* a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my_GCompareFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -378,10 +378,10 @@ static void* findGCompareFuncFct(void* fct)
}
// GCompareDataFunc ...
#define GO(A) \
-static uintptr_t my_GCompareDataFunc_fct_##A = 0; \
-static int my_GCompareDataFunc_##A(void* a, void* b, void* data) \
-{ \
- return (int)RunFunction(my_context, my_GCompareDataFunc_fct_##A, 3, a, b, data);\
+static uintptr_t my_GCompareDataFunc_fct_##A = 0; \
+static int my_GCompareDataFunc_##A(void* a, void* b, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_GCompareDataFunc_fct_##A, "ppp", a, b, data); \
}
SUPER()
#undef GO
@@ -400,10 +400,10 @@ static void* findGCompareDataFuncFct(void* fct)
}
// GCompletionFunc ...
#define GO(A) \
-static uintptr_t my_GCompletionFunc_fct_##A = 0; \
-static void* my_GCompletionFunc_##A(void* a) \
-{ \
- return (void*)RunFunction(my_context, my_GCompletionFunc_fct_##A, 1, a);\
+static uintptr_t my_GCompletionFunc_fct_##A = 0; \
+static void* my_GCompletionFunc_##A(void* a) \
+{ \
+ return (void*)RunFunctionFmt(my_GCompletionFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -422,10 +422,10 @@ static void* findGCompletionFct(void* fct)
}
// GCompletionStrncmpFunc ...
#define GO(A) \
-static uintptr_t my_GCompletionStrncmpFunc_fct_##A = 0; \
-static int my_GCompletionStrncmpFunc_##A(void* a, void* b, unsigned long n) \
-{ \
- return (int)RunFunction(my_context, my_GCompletionStrncmpFunc_fct_##A, 3, a, b, n); \
+static uintptr_t my_GCompletionStrncmpFunc_fct_##A = 0; \
+static int my_GCompletionStrncmpFunc_##A(void* a, void* b, unsigned long n) \
+{ \
+ return (int)RunFunctionFmt(my_GCompletionStrncmpFunc_fct_##A, "ppL", a, b, n); \
}
SUPER()
#undef GO
@@ -444,10 +444,10 @@ static void* findGCompletionStrncmpFuncFct(void* fct)
}
// GIOFunc ...
#define GO(A) \
-static uintptr_t my_GIOFunc_fct_##A = 0; \
-static int my_GIOFunc_##A(void* a, int b, void* c) \
-{ \
- return (int)RunFunction(my_context, my_GIOFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_GIOFunc_fct_##A = 0; \
+static int my_GIOFunc_##A(void* a, int b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my_GIOFunc_fct_##A, "pip", a, b, c); \
}
SUPER()
#undef GO
@@ -466,10 +466,10 @@ static void* findGIOFuncFct(void* fct)
}
// GDestroyNotify ...
#define GO(A) \
-static uintptr_t my_GDestroyNotify_fct_##A = 0; \
-static void my_GDestroyNotify_##A(void* a) \
-{ \
- RunFunction(my_context, my_GDestroyNotify_fct_##A, 1, a); \
+static uintptr_t my_GDestroyNotify_fct_##A = 0; \
+static void my_GDestroyNotify_##A(void* a) \
+{ \
+ RunFunctionFmt(my_GDestroyNotify_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -488,10 +488,10 @@ static void* findGDestroyNotifyFct(void* fct)
}
// GFunc ...
#define GO(A) \
-static uintptr_t my_GFunc_fct_##A = 0; \
-static void my_GFunc_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_GFunc_fct_##A, 2, a, b); \
+static uintptr_t my_GFunc_fct_##A = 0; \
+static void my_GFunc_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_GFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -510,10 +510,10 @@ static void* findGFuncFct(void* fct)
}
// GHFunc ...
#define GO(A) \
-static uintptr_t my_GHFunc_fct_##A = 0; \
-static void my_GHFunc_##A(void* a, void* b, void* c) \
-{ \
- RunFunction(my_context, my_GHFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_GHFunc_fct_##A = 0; \
+static void my_GHFunc_##A(void* a, void* b, void* c) \
+{ \
+ RunFunctionFmt(my_GHFunc_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -532,10 +532,10 @@ static void* findGHFuncFct(void* fct)
}
// GHRFunc ...
#define GO(A) \
-static uintptr_t my_GHRFunc_fct_##A = 0; \
-static int my_GHRFunc_##A(void* a, void* b, void* c) \
-{ \
- return RunFunction(my_context, my_GHRFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_GHRFunc_fct_##A = 0; \
+static int my_GHRFunc_##A(void* a, void* b, void* c) \
+{ \
+ return RunFunctionFmt(my_GHRFunc_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -554,10 +554,10 @@ static void* findGHRFuncFct(void* fct)
}
// GChildWatchFunc ...
#define GO(A) \
-static uintptr_t my_GChildWatchFunc_fct_##A = 0; \
-static void my_GChildWatchFunc_##A(int a, int b, void* c) \
-{ \
- RunFunction(my_context, my_GChildWatchFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_GChildWatchFunc_fct_##A = 0; \
+static void my_GChildWatchFunc_##A(int a, int b, void* c) \
+{ \
+ RunFunctionFmt(my_GChildWatchFunc_fct_##A, "iip", a, b, c); \
}
SUPER()
#undef GO
@@ -576,10 +576,10 @@ static void* findGChildWatchFuncFct(void* fct)
}
// GLogFunc ...
#define GO(A) \
-static uintptr_t my_GLogFunc_fct_##A = 0; \
-static void my_GLogFunc_##A(void* a, int b, void* c, void* d) \
-{ \
- RunFunction(my_context, my_GLogFunc_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_GLogFunc_fct_##A = 0; \
+static void my_GLogFunc_##A(void* a, int b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_GLogFunc_fct_##A, "pipp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -606,10 +606,10 @@ static void* reverseGLogFuncFct(void* fct)
}
// GPrintFunc ...
#define GO(A) \
-static uintptr_t my_GPrintFunc_fct_##A = 0; \
-static void my_GPrintFunc_##A(void* a) \
-{ \
- RunFunction(my_context, my_GPrintFunc_fct_##A, 1, a); \
+static uintptr_t my_GPrintFunc_fct_##A = 0; \
+static void my_GPrintFunc_##A(void* a) \
+{ \
+ RunFunctionFmt(my_GPrintFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -636,10 +636,10 @@ static void* reverseGPrintFuncFct(void* fct)
}
// GOptionArg ...
#define GO(A) \
-static uintptr_t my_GOptionArg_fct_##A = 0; \
-static int my_GOptionArg_##A(void* a, void* b, void* c, void* d) \
-{ \
- return (int)RunFunction(my_context, my_GOptionArg_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_GOptionArg_fct_##A = 0; \
+static int my_GOptionArg_##A(void* a, void* b, void* c, void* d) \
+{ \
+ return (int)RunFunctionFmt(my_GOptionArg_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -666,10 +666,10 @@ static void* reverseGOptionArgFct(void* fct)
}
// GNodeTraverseFunc ...
#define GO(A) \
-static uintptr_t my_GNodeTraverseFunc_fct_##A = 0; \
-static int my_GNodeTraverseFunc_##A(void* a, void* b) \
-{ \
- return (int)RunFunction(my_context, my_GNodeTraverseFunc_fct_##A, 2, a, b); \
+static uintptr_t my_GNodeTraverseFunc_fct_##A = 0; \
+static int my_GNodeTraverseFunc_##A(void* a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my_GNodeTraverseFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -688,10 +688,10 @@ static void* findGNodeTraverseFuncFct(void* fct)
}
// GThreadFunc ...
#define GO(A) \
-static uintptr_t my_GThreadFunc_fct_##A = 0; \
-static void* my_GThreadFunc_##A(void* a) \
-{ \
- return (void*)RunFunction(my_context, my_GThreadFunc_fct_##A, 1, a);\
+static uintptr_t my_GThreadFunc_fct_##A = 0; \
+static void* my_GThreadFunc_##A(void* a) \
+{ \
+ return (void*)RunFunctionFmt(my_GThreadFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -863,7 +863,7 @@ EXPORT void* my_g_main_context_get_poll_func(x64emu_t* emu, void* context)
// needs to bridge....
return (void*)AddCheckBridge(my_lib->w.bridge, iFpui, ret, 0, NULL);
}
-
+
EXPORT void my_g_main_context_set_poll_func(x64emu_t* emu, void* context, void* func)
{
my->g_main_context_set_poll_func(context, findPollFct(func));
@@ -896,17 +896,17 @@ EXPORT void my_g_hash_table_foreach(x64emu_t* emu, void* table, void* f, void* d
EXPORT uint32_t my_g_hash_table_foreach_remove(x64emu_t* emu, void* table, void* f, void* data)
{
-
+
return my->g_hash_table_foreach_remove(table, findGHRFuncFct(f), data);
}
EXPORT uint32_t my_g_hash_table_foreach_steal(x64emu_t* emu, void* table, void* f, void* data)
{
-
+
return my->g_hash_table_foreach_steal(table, findGHRFuncFct(f), data);
}
EXPORT void* my_g_hash_table_find(x64emu_t* emu, void* table, void* f, void* data)
{
-
+
return my->g_hash_table_find(table, findGHRFuncFct(f), data);
}
@@ -1388,6 +1388,11 @@ EXPORT void my_g_slist_free_full(x64emu_t* emu, void* list, void* f)
my->g_slist_free_full(list, findDestroyFct(f));
}
+EXPORT void* my_g_list_insert_sorted_with_data(x64emu_t* emu, void* list, void* data, void* f, void* user)
+{
+ return my->g_list_insert_sorted_with_data(list, data, findGCompareDataFuncFct(f), user);
+}
+
#define PRE_INIT \
if(box64_nogtk) \
return -1;
diff --git a/src/wrapped/wrappedglib2_private.h b/src/wrapped/wrappedglib2_private.h
index 6cbff07..6ee782f 100755..100644
--- a/src/wrapped/wrappedglib2_private.h
+++ b/src/wrapped/wrappedglib2_private.h
@@ -29,26 +29,22 @@ GO(g_ascii_dtostr, pFpid)
GO(g_ascii_formatd, pFpipd)
GO(g_ascii_strcasecmp, iFpp)
GO(g_ascii_strdown, pFpi)
-GO(g_ascii_strncasecmp, iFppu)
+GO(g_ascii_strncasecmp, iFppL)
GO(g_ascii_strtod, dFpp)
-GO(g_ascii_strtoll, IFppu)
-GO(g_ascii_strtoull, UFppu)
-GO(g_ascii_strup, pFpi)
+GO(g_ascii_strtoll, lFppu)
+GO(g_ascii_strtoull, LFppu)
+GO(g_ascii_strup, pFpl)
GO(g_ascii_tolower, CFC)
GO(g_ascii_toupper, CFC)
GO(g_ascii_xdigit_value, iFC)
GO(g_assertion_message, vFppipp)
-#ifdef HAVE_LD80BITS
-GO(g_assertion_message_cmpnum, vFppippDDC)
-#else
-GO(g_assertion_message_cmpnum, vFppippKKC)
-#endif
+GO(g_assertion_message_cmpnum, vFppippDpDC)
GO(g_assertion_message_cmpstr, vFppippppp)
GO(g_assertion_message_error, vFppipppui)
GO(g_assertion_message_expr, vFppipp)
GO(g_assert_warning, vFppipp)
GO(g_async_queue_length, iFp)
-//GO(g_async_queue_length_unlocked,
+GO(g_async_queue_length_unlocked, iFp)
GO(g_async_queue_lock, vFp)
GO(g_async_queue_new, pFv)
//GO(g_async_queue_new_full,
@@ -58,14 +54,14 @@ GO(g_async_queue_push, vFpp)
//GO(g_async_queue_push_sorted,
//GO(g_async_queue_push_sorted_unlocked,
GO(g_async_queue_push_unlocked, vFpp)
-GO(g_async_queue_ref, vFp)
+GO(g_async_queue_ref, pFp)
//GO(g_async_queue_ref_unlocked,
//GO(g_async_queue_sort,
//GO(g_async_queue_sort_unlocked,
//GO(g_async_queue_timed_pop,
-//GO(g_async_queue_timed_pop_unlocked,
+GO(g_async_queue_timed_pop_unlocked, pFpp)
GO(g_async_queue_timeout_pop, pFpU)
-GO(g_async_queue_timeout_pop_unlocked, pFpU)
+GO(g_async_queue_timeout_pop_unlocked, pFpL)
GO(g_async_queue_try_pop, pFp)
GO(g_async_queue_try_pop_unlocked, pFp)
GO(g_async_queue_unlock, vFp)
@@ -74,21 +70,21 @@ GO(g_async_queue_unref_and_unlock, vFp)
GO2(g_atexit, vFEp, my_atexit)
//GO(g_atomic_int_add,
//GO(g_atomic_int_and,
-//GO(g_atomic_int_compare_and_exchange,
-//GO(g_atomic_int_dec_and_test,
+GO(g_atomic_int_compare_and_exchange, iFpii)
+GO(g_atomic_int_dec_and_test, iFp)
GO(g_atomic_int_exchange_and_add, iFpi)
-//GO(g_atomic_int_get,
-//GO(g_atomic_int_inc,
+GO(g_atomic_int_get, iFp)
+GO(g_atomic_int_inc, vFp)
//GO(g_atomic_int_or,
//GO(g_atomic_int_set,
-//GO(g_atomic_int_xor,
-//GO(g_atomic_pointer_add,
+GO(g_atomic_int_xor, uFpu)
+GO(g_atomic_pointer_add, lFpl)
//GO(g_atomic_pointer_and,
-//GO(g_atomic_pointer_compare_and_exchange,
-//GO(g_atomic_pointer_get,
+GO(g_atomic_pointer_compare_and_exchange, iFppp)
+GO(g_atomic_pointer_get, pFp)
//GO(g_atomic_pointer_or,
-//GO(g_atomic_pointer_set,
-//GO(g_atomic_pointer_xor,
+GO(g_atomic_pointer_set, vFpp)
+GO(g_atomic_pointer_xor, LFpL)
GO(g_base64_decode, pFpp)
GO(g_base64_decode_inplace, pFpp)
GO(g_base64_decode_step, LFpLppp)
@@ -98,50 +94,50 @@ GO(g_base64_encode_step, LFpLippp)
GO(g_basename, pFp)
//GO(g_bit_lock,
GO(g_bit_nth_lsf, iFii)
-GO(g_bit_nth_msf, iFii)
-GO(g_bit_storage, iFi)
-//GO(g_bit_trylock,
-//GO(g_bit_unlock,
+GO(g_bit_nth_msf, iFLi)
+GO(g_bit_storage, uFL)
+GO(g_bit_trylock, iFpi)
+GO(g_bit_unlock, vFpi)
//GO(g_blow_chunks,
//GO(g_bookmark_file_add_application,
-//GO(g_bookmark_file_add_group,
+GO(g_bookmark_file_add_group, vFppp)
//GO(g_bookmark_file_error_quark,
//GO(g_bookmark_file_free,
//GO(g_bookmark_file_get_added,
-//GO(g_bookmark_file_get_app_info,
-//GO(g_bookmark_file_get_applications,
+GO(g_bookmark_file_get_app_info, iFppppppp)
+GO(g_bookmark_file_get_applications, pFpppp)
//GO(g_bookmark_file_get_description,
//GO(g_bookmark_file_get_groups,
-//GO(g_bookmark_file_get_icon,
+GO(g_bookmark_file_get_icon, iFppppp)
//GO(g_bookmark_file_get_is_private,
-//GO(g_bookmark_file_get_mime_type,
+GO(g_bookmark_file_get_mime_type, pFppp)
//GO(g_bookmark_file_get_modified,
-//GO(g_bookmark_file_get_size,
+GO(g_bookmark_file_get_size, iFp)
//GO(g_bookmark_file_get_title,
-//GO(g_bookmark_file_get_uris,
-//GO(g_bookmark_file_get_visited,
+GO(g_bookmark_file_get_uris, pFpp)
+GO(g_bookmark_file_get_visited, lFppp)
//GO(g_bookmark_file_has_application,
//GO(g_bookmark_file_has_group,
-//GO(g_bookmark_file_has_item,
-//GO(g_bookmark_file_load_from_data,
-//GO(g_bookmark_file_load_from_data_dirs,
+GO(g_bookmark_file_has_item, iFpp)
+GO(g_bookmark_file_load_from_data, iFppLp)
+GO(g_bookmark_file_load_from_data_dirs, iFpppp)
//GO(g_bookmark_file_load_from_file,
-//GO(g_bookmark_file_move_item,
-//GO(g_bookmark_file_new,
+GO(g_bookmark_file_move_item, iFpppp)
+GO(g_bookmark_file_new, pFv)
//GO(g_bookmark_file_remove_application,
//GO(g_bookmark_file_remove_group,
-//GO(g_bookmark_file_remove_item,
+GO(g_bookmark_file_remove_item, iFppp)
//GO(g_bookmark_file_set_added,
-//GO(g_bookmark_file_set_app_info,
+GO(g_bookmark_file_set_app_info, iFppppilp)
//GO(g_bookmark_file_set_description,
-//GO(g_bookmark_file_set_groups,
-//GO(g_bookmark_file_set_icon,
-//GO(g_bookmark_file_set_is_private,
+GO(g_bookmark_file_set_groups, vFpppL)
+GO(g_bookmark_file_set_icon, vFpppp)
+GO(g_bookmark_file_set_is_private, vFppi)
//GO(g_bookmark_file_set_mime_type,
//GO(g_bookmark_file_set_modified,
//GO(g_bookmark_file_set_title,
-//GO(g_bookmark_file_set_visited,
-//GO(g_bookmark_file_to_data,
+GO(g_bookmark_file_set_visited, vFppl)
+GO(g_bookmark_file_to_data, pFppp)
//GO(g_bookmark_file_to_file,
GOM(g_build_filename, pFEpV)
GO(g_build_filenamev, pFp)
@@ -164,7 +160,7 @@ GO(g_byte_array_sized_new, pFu)
GO(g_byte_array_unref, vFp)
GO(g_bytes_compare, iFpp)
GO(g_bytes_equal, iFpp)
-GO(g_bytes_get_data, pFpL)
+GO(g_bytes_get_data, pFpp)
GO(g_bytes_get_size, LFp)
GO(g_bytes_hash, uFp)
GO(g_bytes_new, pFpL)
@@ -176,21 +172,21 @@ GO(g_bytes_ref, pFp)
GO(g_bytes_unref, vFp)
GO(g_bytes_unref_to_array, pFp)
GO(g_bytes_unref_to_data, pFpp)
-//GO(g_cache_destroy,
-//GO(g_cache_insert,
+GO(g_cache_destroy, vFp)
+GO(g_cache_insert, pFpp)
//GO(g_cache_key_foreach,
//GO(g_cache_new,
-//GO(g_cache_remove,
+GO(g_cache_remove, vFpp)
//GO(g_cache_value_foreach,
GO(g_chdir, iFp)
-//GO(g_checksum_copy,
+GO(g_checksum_copy, pFp)
//GO(g_checksum_free,
-//GO(g_checksum_get_digest,
-//GO(g_checksum_get_string,
-//GO(g_checksum_new,
+GO(g_checksum_get_digest, vFppp)
+GO(g_checksum_get_string, pFp)
+GO(g_checksum_new, pFu)
//GO(g_checksum_reset,
-//GO(g_checksum_type_get_length,
-//GO(g_checksum_update,
+GO(g_checksum_type_get_length, lFu)
+GO(g_checksum_update, vFppl)
GOM(g_child_watch_add, uFEipp)
GOM(g_child_watch_add_full, uFEiippp)
GO(g_child_watch_source_new, pFi)
@@ -206,20 +202,20 @@ GO(g_completion_free, vFp)
GOM(g_completion_new, pFEp)
GO(g_completion_remove_items, vFpp)
GOM(g_completion_set_compare, vFEpp)
-//GO(g_compute_checksum_for_bytes,
-//GO(g_compute_checksum_for_data,
-//GO(g_compute_checksum_for_string,
-//GO(g_compute_hmac_for_data,
-//GO(g_compute_hmac_for_string,
+GO(g_compute_checksum_for_bytes, pFup)
+GO(g_compute_checksum_for_data, pFupL)
+GO(g_compute_checksum_for_string, pFupl)
+GO(g_compute_hmac_for_data, pFupLpL)
+GO(g_compute_hmac_for_string, pFupLpl)
GO(g_cond_broadcast, vFp)
GO(g_cond_clear, vFp)
GO(g_cond_free, vFp)
GO(g_cond_init, vFp)
GO(g_cond_new, pFv)
GO(g_cond_signal, vFp)
-//GO(g_cond_timed_wait,
+GO(g_cond_timed_wait, iFppp)
GO(g_cond_wait, vFpp)
-//GO(g_cond_wait_until,
+GO(g_cond_wait_until, iFppl)
GO(g_convert, pFplppppp)
//GO(g_convert_error_quark,
GO(g_convert_with_fallback, pFplpppppp)
@@ -237,10 +233,10 @@ GOM(g_datalist_id_set_data_full, vFEpupp)
GO(g_datalist_init, vFp)
GO(g_datalist_set_flags, vFpu)
GO(g_datalist_unset_flags, vFpu)
-//GO(g_dataset_destroy,
+GO(g_dataset_destroy, vFp)
//GO(g_dataset_foreach,
//GO(g_dataset_id_get_data,
-//GO(g_dataset_id_remove_no_notify,
+GO(g_dataset_id_remove_no_notify, pFpu)
//GO(g_dataset_id_set_data_full,
GO(g_date_add_days, vFpu)
GO(g_date_add_months, vFpu)
@@ -252,90 +248,90 @@ GO(g_date_days_between, iFpp)
GO(g_date_free, vFp)
GO(g_date_get_day, CFp)
GO(g_date_get_day_of_year, uFp)
-GO(g_date_get_days_in_month, CFip)
+GO(g_date_get_days_in_month, CFuW)
GO(g_date_get_iso8601_week_of_year, uFp)
GO(g_date_get_julian, uFp)
GO(g_date_get_monday_week_of_year, uFp)
GO(g_date_get_monday_weeks_in_year, CFp)
-GO(g_date_get_month, iFp)
+GO(g_date_get_month, uFp)
GO(g_date_get_sunday_week_of_year, uFp)
-GO(g_date_get_sunday_weeks_in_year, CFp)
-GO(g_date_get_weekday, iFp)
+GO(g_date_get_sunday_weeks_in_year, CFW)
+GO(g_date_get_weekday, uFp)
GO(g_date_get_year, WFp)
GO(g_date_is_first_of_month, iFp)
GO(g_date_is_last_of_month, iFp)
-GO(g_date_is_leap_year, iFp)
+GO(g_date_is_leap_year, iFW)
GO(g_date_new, pFv)
-GO(g_date_new_dmy, pFCiW)
+GO(g_date_new_dmy, pFCuW)
GO(g_date_new_julian, pFu)
GO(g_date_order, vFpp)
GO(g_date_set_day, vFpC)
-GO(g_date_set_dmy, vFpCiW)
+GO(g_date_set_dmy, vFpCuW)
GO(g_date_set_julian, vFpu)
-GO(g_date_set_month, vFpi)
+GO(g_date_set_month, vFpu)
GO(g_date_set_parse, vFpp)
GO(g_date_set_time, vFpi)
-//GO(g_date_set_time_t,
+GO(g_date_set_time_t, vFpl)
GO(g_date_set_time_val, vFpp)
GO(g_date_set_year, vFpW)
GO(g_date_strftime, LFpLpp)
GO(g_date_subtract_days, vFpu)
GO(g_date_subtract_months, vFpu)
GO(g_date_subtract_years, vFpu)
-//GO(g_date_time_add,
+GO(g_date_time_add, pFpl)
//GO(g_date_time_add_days,
-//GO(g_date_time_add_full,
+GO(g_date_time_add_full, pFpiiiiid)
//GO(g_date_time_add_hours,
-//GO(g_date_time_add_minutes,
+GO(g_date_time_add_minutes, pFpi)
//GO(g_date_time_add_months,
-//GO(g_date_time_add_seconds,
+GO(g_date_time_add_seconds, pFpd)
//GO(g_date_time_add_weeks,
//GO(g_date_time_add_years,
//GO(g_date_time_compare,
-//GO(g_date_time_difference,
+GO(g_date_time_difference, lFpp)
//GO(g_date_time_equal,
-//GO(g_date_time_format,
+GO(g_date_time_format, pFpp)
//GO(g_date_time_get_day_of_month,
//GO(g_date_time_get_day_of_week,
//GO(g_date_time_get_day_of_year,
//GO(g_date_time_get_hour,
-//GO(g_date_time_get_microsecond,
+GO(g_date_time_get_microsecond, iFp)
//GO(g_date_time_get_minute,
//GO(g_date_time_get_month,
//GO(g_date_time_get_second,
-//GO(g_date_time_get_seconds,
-//GO(g_date_time_get_timezone_abbreviation,
-//GO(g_date_time_get_utc_offset,
+GO(g_date_time_get_seconds, dFp)
+GO(g_date_time_get_timezone_abbreviation, pFp)
+GO(g_date_time_get_utc_offset, lFp)
//GO(g_date_time_get_week_numbering_year,
//GO(g_date_time_get_week_of_year,
//GO(g_date_time_get_year,
-//GO(g_date_time_get_ymd,
+GO(g_date_time_get_ymd, vFpppp)
//GO(g_date_time_hash,
-//GO(g_date_time_is_daylight_savings,
-//GO(g_date_time_new,
+GO(g_date_time_is_daylight_savings, iFp)
+GO(g_date_time_new, pFpiiiiid)
//GO(g_date_time_new_from_timeval_local,
-//GO(g_date_time_new_from_timeval_utc,
+GO(g_date_time_new_from_timeval_utc, pFp)
//GO(g_date_time_new_from_unix_local,
-//GO(g_date_time_new_from_unix_utc,
+GO(g_date_time_new_from_unix_utc, pFl)
//GO(g_date_time_new_local,
-//GO(g_date_time_new_now,
+GO(g_date_time_new_now, pFp)
//GO(g_date_time_new_now_local,
-//GO(g_date_time_new_now_utc,
-//GO(g_date_time_new_utc,
+GO(g_date_time_new_now_utc, pFv)
+GO(g_date_time_new_utc, pFiiiiid)
//GO(g_date_time_ref,
//GO(g_date_time_to_local,
-//GO(g_date_time_to_timeval,
-//GO(g_date_time_to_timezone,
-//GO(g_date_time_to_unix,
-//GO(g_date_time_to_utc,
+GO(g_date_time_to_timeval, iFpp)
+GO(g_date_time_to_timezone, pFpp)
+GO(g_date_time_to_unix, lFp)
+GO(g_date_time_to_utc, pFp)
//GO(g_date_time_unref,
GO(g_date_to_struct_tm, vFpp)
GO(g_date_valid, iFp)
GO(g_date_valid_day, iFC)
-GO(g_date_valid_dmy, iFCiW)
+GO(g_date_valid_dmy, iFCuW)
GO(g_date_valid_julian, iFu)
-GO(g_date_valid_month, iFi)
-GO(g_date_valid_weekday, iFi)
+GO(g_date_valid_month, iFu)
+GO(g_date_valid_weekday, iFu)
GO(g_date_valid_year, iFW)
GO(g_dcgettext, pFppi)
GO(g_dgettext, pFpp)
@@ -343,7 +339,7 @@ GO(g_dir_close, vFp)
GO(g_direct_equal, iFpp)
GO(g_direct_hash, uFp)
GO(g_dir_make_tmp, pFpp)
-GO(g_dir_open, pFp)
+GO(g_dir_open, pFpup)
GO(g_dir_read_name, pFp)
GO(g_dir_rewind, vFp)
GO(g_dngettext, pFpppL)
@@ -356,28 +352,28 @@ GO(g_environ_setenv, pFpppi)
GO(g_environ_unsetenv, pFpp)
GO(g_error_copy, pFp)
GO(g_error_free, vFp)
-GO(g_error_matches, iFppi)
+GO(g_error_matches, iFpui)
GOM(g_error_new, pFEpipV)
-GO(g_error_new_literal, pFpip)
+GO(g_error_new_literal, pFuip)
GOM(g_error_new_valist, pFEpipA)
-GO(g_file_error_from_errno, iFi)
+GO(g_file_error_from_errno, uFi)
GO(g_file_error_quark, pFv)
GO(g_file_get_contents, iFpppp)
GO(g_filename_display_basename, pFp)
GO(g_filename_display_name, pFp)
GO(g_filename_from_uri, pFppp)
-GO(g_filename_from_utf8, pFpippp)
+GO(g_filename_from_utf8, pFplppp)
GO(g_filename_to_uri, pFppp)
GO(g_filename_to_utf8, pFpippp)
GO(g_file_open_tmp, iFppp)
GO(g_file_read_link, pFpp)
-GO(g_file_set_contents, iFppip)
-GO(g_file_test, iFpi)
+GO(g_file_set_contents, iFpplp)
+GO(g_file_test, iFpu)
GO(g_find_program_in_path, pFp) // need wrap?
GO(g_fopen, pFpp)
-GO(g_format_size, pFU)
-GO(g_format_size_for_display, pFI)
-GO(g_format_size_full, pFUi)
+GO(g_format_size, pFL)
+GO(g_format_size_for_display, pFl)
+GO(g_format_size_full, pFLu)
GOM(g_fprintf, iFEppV)
GO(g_free, vFp)
GO(g_freopen, pFppp)
@@ -397,7 +393,7 @@ GO(g_get_monotonic_time, IFv)
//GO(g_get_num_processors,
GO(g_get_prgname, pFv)
GO(g_get_real_name, pFv)
-GO(g_get_real_time, IFv)
+GO(g_get_real_time, lFv)
GO(g_get_system_config_dirs, pFv)
GO(g_get_system_data_dirs, pFv)
GO(g_get_tmp_dir, pFv)
@@ -406,7 +402,7 @@ GO(g_get_user_config_dir, pFv)
GO(g_get_user_data_dir, pFv)
GO(g_get_user_name, pFv)
GO(g_get_user_runtime_dir, pFv)
-GO(g_get_user_special_dir, pFi)
+GO(g_get_user_special_dir, pFu)
GO(g_hash_table_add, iFpp)
GO(g_hash_table_contains, iFpp)
GO(g_hash_table_destroy, vFp)
@@ -436,13 +432,13 @@ GO(g_hash_table_size, uFp)
GO(g_hash_table_steal, iFpp)
GO(g_hash_table_steal_all, vFp)
GO(g_hash_table_unref, vFp)
-//GO(g_hmac_copy,
-//GO(g_hmac_get_digest,
-//GO(g_hmac_get_string,
-//GO(g_hmac_new,
-//GO(g_hmac_ref,
+GO(g_hmac_copy, pFp)
+GO(g_hmac_get_digest, vFppp)
+GO(g_hmac_get_string, pFp)
+GO(g_hmac_new, pFupL)
+GO(g_hmac_ref, pFp)
//GO(g_hmac_unref,
-//GO(g_hmac_update,
+GO(g_hmac_update, vFppl)
//GO(g_hook_alloc,
//GO(g_hook_compare_ids,
//GO(g_hook_destroy,
@@ -487,7 +483,7 @@ GO(g_int_hash, uFp)
GOM(g_io_add_watch, uFEpipp)
GOM(g_io_add_watch_full, uFEpiippp)
GO(g_io_channel_close, vFp)
-GO(g_io_channel_error_from_errno, iFi)
+GO(g_io_channel_error_from_errno, uFi)
GO(g_io_channel_error_quark, pFv)
GO(g_io_channel_flush, iFpp)
GO(g_io_channel_get_buffer_condition, iFp)
@@ -530,7 +526,7 @@ GO(g_key_file_get_comment, pFpppp)
GO(g_key_file_get_double, dFpppp)
GO(g_key_file_get_double_list, pFppppp)
GO(g_key_file_get_groups, pFpp)
-GO(g_key_file_get_int64, IFpppp)
+GO(g_key_file_get_int64, lFpppp)
GO(g_key_file_get_integer, iFpppp)
GO(g_key_file_get_integer_list, pFppppp)
GO(g_key_file_get_keys, pFpppp)
@@ -539,14 +535,14 @@ GO(g_key_file_get_locale_string_list, pFpppppp)
GO(g_key_file_get_start_group, pFp)
GO(g_key_file_get_string, pFpppp)
GO(g_key_file_get_string_list, pFppppp)
-GO(g_key_file_get_uint64, UFpppp)
+GO(g_key_file_get_uint64, LFpppp)
GO(g_key_file_get_value, pFpppp)
GO(g_key_file_has_group, iFpp)
GO(g_key_file_has_key, iFpppp)
-GO(g_key_file_load_from_data, iFppLip)
-GO(g_key_file_load_from_data_dirs, iFpppip)
-GO(g_key_file_load_from_dirs, iFppppip)
-GO(g_key_file_load_from_file, iFppip)
+GO(g_key_file_load_from_data, iFppLup)
+GO(g_key_file_load_from_data_dirs, iFpppup)
+GO(g_key_file_load_from_dirs, iFppppup)
+GO(g_key_file_load_from_file, iFppup)
GO(g_key_file_new, pFv)
GO(g_key_file_ref, pFp)
GO(g_key_file_remove_comment, iFpppp)
@@ -558,7 +554,7 @@ GO(g_key_file_set_boolean_list, vFppppL)
GO(g_key_file_set_comment, iFppppp)
GO(g_key_file_set_double, vFpppd)
GO(g_key_file_set_double_list, vFppppL)
-GO(g_key_file_set_int64, vFpppI)
+GO(g_key_file_set_int64, vFpppl)
GO(g_key_file_set_integer, vFpppi)
GO(g_key_file_set_integer_list, vFppppL)
GO(g_key_file_set_list_separator, vFpC)
@@ -566,7 +562,7 @@ GO(g_key_file_set_locale_string, vFppppp)
GO(g_key_file_set_locale_string_list, vFpppppL)
GO(g_key_file_set_string, vFpppp)
GO(g_key_file_set_string_list, vFppppL)
-GO(g_key_file_set_uint64, vFpppU)
+GO(g_key_file_set_uint64, vFpppL)
GO(g_key_file_set_value, vFpppp)
GO(g_key_file_to_data, pFppp)
GO(g_key_file_unref, vFp)
@@ -592,7 +588,7 @@ GO(g_list_index, iFpp)
GO(g_list_insert, pFppi)
GO(g_list_insert_before, pFppp)
GOM(g_list_insert_sorted, pFEppp)
-//GO(g_list_insert_sorted_with_data, pFEppBp)
+GOM(g_list_insert_sorted_with_data, pFEpppp)
GO(g_list_last, pFp)
GO(g_list_length, uFp)
GO(g_list_nth, pFpu)
@@ -663,8 +659,8 @@ GO(g_malloc_n, pFLL)
GO(g_mapped_file_free, vFp)
GO(g_mapped_file_get_bytes, pFp)
GO(g_mapped_file_get_contents, pFp)
-GO(g_mapped_file_get_length, uFp)
-GO(g_mapped_file_new, pFppp)
+GO(g_mapped_file_get_length, LFp)
+GO(g_mapped_file_new, pFpip)
GO(g_mapped_file_new_from_fd, pFiip)
GO(g_mapped_file_ref, pFp)
GO(g_mapped_file_unref, vFp)
@@ -673,15 +669,15 @@ GO(g_mapped_file_unref, vFp)
GO(g_markup_escape_text, pFpl)
GO(g_markup_parse_context_end_parse, iFpp)
GO(g_markup_parse_context_free, vFp)
-//GO(g_markup_parse_context_get_element,
-//GO(g_markup_parse_context_get_element_stack,
-//GO(g_markup_parse_context_get_position,
-//GO(g_markup_parse_context_get_user_data,
+GO(g_markup_parse_context_get_element, pFp)
+GO(g_markup_parse_context_get_element_stack, pFp)
+GO(g_markup_parse_context_get_position, vFppp)
+GO(g_markup_parse_context_get_user_data, pFp)
GOM(g_markup_parse_context_new, pFEpipp)
GO(g_markup_parse_context_parse, iFpplp)
//GO(g_markup_parse_context_pop,
//GO(g_markup_parse_context_push,
-//GO(g_markup_parse_context_ref,
+GO(g_markup_parse_context_ref, pFp)
//GO(g_markup_parse_context_unref,
GOM(g_markup_printf_escaped, pFEpV)
GOM(g_markup_vprintf_escaped, pFEpA)
@@ -701,13 +697,13 @@ GO(g_match_info_next, iFpp)
GO(g_match_info_ref, pFp)
GO(g_match_info_unref, vFp)
//GO(g_mem_chunk_alloc,
-//GO(g_mem_chunk_alloc0,
+GO(g_mem_chunk_alloc0, pFp)
//GO(g_mem_chunk_clean,
//GO(g_mem_chunk_destroy,
-//GO(g_mem_chunk_free,
+GO(g_mem_chunk_free, vFpp)
//GO(g_mem_chunk_info,
-//GO(g_mem_chunk_new,
-//GO(g_mem_chunk_print,
+GO(g_mem_chunk_new, pFpiLi)
+GO(g_mem_chunk_print, vFp)
//GO(g_mem_chunk_reset,
GO(g_memdup, pFpu)
GO(g_mem_is_system_malloc, iFv)
@@ -726,39 +722,39 @@ GO(g_mutex_lock, vFp)
GO(g_mutex_new, pFv)
GO(g_mutex_trylock, iFp)
GO(g_mutex_unlock, vFp)
-//GO(g_node_child_index,
-//GO(g_node_child_position,
+GO(g_node_child_index, iFpp)
+GO(g_node_child_position, iFpp)
//GO(g_node_children_foreach,
//GO(g_node_copy,
GOM(g_node_copy_deep, pFEppp)
//GO(g_node_depth,
GO(g_node_destroy, vFp)
-//GO(g_node_find,
-//GO(g_node_find_child,
+GO(g_node_find, pFpuup)
+GO(g_node_find_child, pFpup)
//GO(g_node_first_sibling,
GO(g_node_get_root, pFp)
-//GO(g_node_insert,
-//GO(g_node_insert_after,
+GO(g_node_insert, pFpip)
+GO(g_node_insert_after, pFppp)
GO(g_node_insert_before, pFppp)
-//GO(g_node_is_ancestor,
+GO(g_node_is_ancestor, iFpp)
//GO(g_node_last_child,
-//GO(g_node_last_sibling,
+GO(g_node_last_sibling, pFp)
//GO(g_node_max_height,
-//GO(g_node_n_children,
+GO(g_node_n_children, uFp)
GO(g_node_new, pFp)
-//GO(g_node_n_nodes,
-//GO(g_node_nth_child,
+GO(g_node_n_nodes, uFpu)
+GO(g_node_nth_child, pFpu)
//GO(g_node_pop_allocator,
-//GO(g_node_prepend,
-//GO(g_node_push_allocator,
+GO(g_node_prepend, pFpp)
+GO(g_node_push_allocator, vFp)
//GO(g_node_reverse_children,
GOM(g_node_traverse, vFEpiiipp)
//GO(g_node_unlink,
GO(g_nullify_pointer, vFp)
//GO(g_once_impl,
GO(g_once_init_enter, iFp)
-//GO(g_once_init_enter_impl,
-GO(g_once_init_leave, vFpL)
+GO(g_once_init_enter_impl, iFp)
+GO(g_once_init_leave, vFpi)
GO(g_on_error_query, vFp)
GO(g_on_error_stack_trace, vFp)
GO(g_open, iFpii)
@@ -783,7 +779,7 @@ GO(g_option_context_set_strict_posix, vFpi) // 2.44+
GO(g_option_context_set_summary, vFpp)
//GOM(g_option_context_set_translate_func, vFEpBpB)
GO(g_option_context_set_translation_domain, vFpp)
-//GO(g_option_error_quark,
+GO(g_option_error_quark, pFv)
GO(g_option_group_add_entries, vFpp)
GO(g_option_group_free, vFp)
GOM(g_option_group_new, pFEppppp)
@@ -793,7 +789,7 @@ GO(g_option_group_ref, pFp) // 2.44+
//GOM(g_option_group_set_translate_func, vFEpBpB)
GO(g_option_group_set_translation_domain, vFpp)
GO(g_option_group_unref, vFp) // 2.44+
-GO(g_parse_debug_string, uFppi)
+GO(g_parse_debug_string, uFppu)
GO(g_path_get_basename, pFp)
GO(g_path_get_dirname, pFp)
GO(g_path_is_absolute, iFp)
@@ -805,8 +801,8 @@ GO(g_pattern_spec_equal, iFpp)
GO(g_pattern_spec_free, vFp)
GO(g_pattern_spec_new, pFp)
//GO(g_pointer_bit_lock,
-//GO(g_pointer_bit_trylock,
-//GO(g_pointer_bit_unlock,
+GO(g_pointer_bit_trylock, iFpi)
+GO(g_pointer_bit_unlock, vFpi)
GO(g_poll, iFpui)
//GO(g_prefix_error, vFpppppppppp) //vaarg, should align?
GOM(g_print, vFEpV)
@@ -882,22 +878,22 @@ GO(g_queue_push_nth_link, vFpip)
GO(g_queue_push_tail, vFpp)
GO(g_queue_push_tail_link, vFpp)
GO(g_queue_remove, iFpp)
-GO(g_queue_remove_all, iFpp)
+GO(g_queue_remove_all, uFpp)
GO(g_queue_reverse, pFp)
//GOM(g_queue_sort, vFEpBp)
GO(g_queue_unlink, vFpp)
GO(g_rand_copy, pFp)
-GO(g_rand_double, dFv)
-GO(g_rand_double_range, dFdd)
+GO(g_rand_double, dFp)
+GO(g_rand_double_range, dFpdd)
GO(g_rand_free, vFp)
GO(g_rand_int, uFp)
-GO(g_rand_int_range, uFpuu)
+GO(g_rand_int_range, iFpii)
GO(g_rand_new, pFv)
GO(g_rand_new_with_seed, pFu)
GO(g_rand_new_with_seed_array, pFpu)
-GO(g_random_double, dFp)
-GO(g_random_double_range, dFpdd)
-GO(g_random_int, iFii)
+GO(g_random_double, dFv)
+GO(g_random_double_range, dFdd)
+GO(g_random_int, uFv)
GO(g_random_int_range, iFii)
GO(g_random_set_seed, vFu)
GO(g_rand_set_seed, vFpu)
@@ -914,36 +910,36 @@ GO(g_regex_check_replacement, iFppp)
GO(g_regex_escape_nul, pFpi)
GO(g_regex_escape_string, pFpi)
GO(g_regex_get_capture_count, iFp)
-GO(g_regex_get_compile_flags, iFp)
+GO(g_regex_get_compile_flags, uFp)
GO(g_regex_get_has_cr_or_lf, iFp)
-GO(g_regex_get_match_flags, iFp)
+GO(g_regex_get_match_flags, uFp)
GO(g_regex_get_max_backref, iFp)
GO(g_regex_get_max_lookbehind, iFp)
GO(g_regex_get_pattern, pFp)
GO(g_regex_get_string_number, iFpp)
GO(g_regex_match, iFppip)
-GO(g_regex_match_all, iFppip)
-GO(g_regex_match_all_full, iFppLiipp)
+GO(g_regex_match_all, iFppup)
+GO(g_regex_match_all_full, iFppliupp)
GO(g_regex_match_full, iFppLiipp)
-GO(g_regex_match_simple, iFppii)
-GO(g_regex_new, pFpiip)
+GO(g_regex_match_simple, iFppuu)
+GO(g_regex_new, pFpuup)
GO(g_regex_ref, pFp)
GO(g_regex_replace, pFppLipip)
//GOM(g_regex_replace_eval, pFEppLiiBpp)
-GO(g_regex_replace_literal, pFppLipip)
-GO(g_regex_split, pFppi)
-GO(g_regex_split_full, pFppLiiip)
-GO(g_regex_split_simple, pFppii)
+GO(g_regex_replace_literal, pFpplipup)
+GO(g_regex_split, pFppu)
+GO(g_regex_split_full, pFppliuip)
+GO(g_regex_split_simple, pFppuu)
GO(g_regex_unref, vFp)
-//GO(g_relation_count,
+GO(g_relation_count, iFppi)
//GO(g_relation_delete,
//GO(g_relation_destroy,
//GO(g_relation_exists,
//GO(g_relation_index,
//GO(g_relation_insert,
-//GO(g_relation_new,
-//GO(g_relation_print,
-//GO(g_relation_select,
+GO(g_relation_new, pFi)
+GO(g_relation_print, vFp)
+GO(g_relation_select, pFppi)
//GO(g_reload_user_special_dirs_cache,
GO(g_remove, iFp)
GO(g_rename, iFpp)
@@ -952,8 +948,8 @@ GO(g_rmdir, iFp)
//GO(g_rw_lock_clear,
//GO(g_rw_lock_init,
//GO(g_rw_lock_reader_lock,
-//GO(g_rw_lock_reader_trylock,
-//GO(g_rw_lock_reader_unlock,
+GO(g_rw_lock_reader_trylock, iFp)
+GO(g_rw_lock_reader_unlock, vFp)
//GO(g_rw_lock_writer_lock,
//GO(g_rw_lock_writer_trylock,
//GO(g_rw_lock_writer_unlock,
@@ -982,34 +978,34 @@ GO(g_rmdir, iFp)
//GO(g_sequence_foreach,
//GO(g_sequence_foreach_range,
//GO(g_sequence_free,
-//GO(g_sequence_get,
+GO(g_sequence_get, pFp)
//GO(g_sequence_get_begin_iter,
-//GO(g_sequence_get_end_iter,
-//GO(g_sequence_get_iter_at_pos,
-//GO(g_sequence_get_length,
-//GO(g_sequence_insert_before,
+GO(g_sequence_get_end_iter, pFp)
+GO(g_sequence_get_iter_at_pos, pFpi)
+GO(g_sequence_get_length, iFp)
+GO(g_sequence_insert_before, pFpp)
//GO(g_sequence_insert_sorted,
//GO(g_sequence_insert_sorted_iter,
-//GO(g_sequence_iter_compare,
-//GO(g_sequence_iter_get_position,
-//GO(g_sequence_iter_get_sequence,
+GO(g_sequence_iter_compare, iFpp)
+GO(g_sequence_iter_get_position, iFp)
+GO(g_sequence_iter_get_sequence, pFp)
//GO(g_sequence_iter_is_begin,
-//GO(g_sequence_iter_is_end,
-//GO(g_sequence_iter_move,
+GO(g_sequence_iter_is_end, iFp)
+GO(g_sequence_iter_move, pFpi)
//GO(g_sequence_iter_next,
-//GO(g_sequence_iter_prev,
+GO(g_sequence_iter_prev, pFp)
//GO(g_sequence_lookup,
//GO(g_sequence_lookup_iter,
//GO(g_sequence_move,
-//GO(g_sequence_move_range,
+GO(g_sequence_move_range, vFppp)
//GO(g_sequence_new,
-//GO(g_sequence_prepend,
-//GO(g_sequence_range_get_midpoint,
-//GO(g_sequence_remove,
-//GO(g_sequence_remove_range,
+GO(g_sequence_prepend, pFpp)
+GO(g_sequence_range_get_midpoint, pFpp)
+GO(g_sequence_remove, vFp)
+GO(g_sequence_remove_range, vFpp)
//GO(g_sequence_search,
//GO(g_sequence_search_iter,
-//GO(g_sequence_set,
+GO(g_sequence_set, vFpp)
//GO(g_sequence_sort,
//GO(g_sequence_sort_changed,
//GO(g_sequence_sort_changed_iter,
@@ -1018,7 +1014,7 @@ GO(g_rmdir, iFp)
GO(g_set_application_name, vFp)
GO(g_setenv, iFppi)
GOM(g_set_error, vFEppipV)
-GO(g_set_error_literal, vFppip)
+GO(g_set_error_literal, vFpuip)
GO(g_set_prgname, vFp)
GOM(g_set_printerr_handler, pFEp)
GOM(g_set_print_handler, pFEp)
@@ -1031,9 +1027,9 @@ GO(g_slice_alloc0, pFL)
GO(g_slice_copy, pFLp)
GO(g_slice_free1, vFLp)
GO(g_slice_free_chain_with_offset, vFLpL)
-GO(g_slice_get_config, IFi)
-GO(g_slice_get_config_state, pFiIp)
-GO(g_slice_set_config, vFiI)
+GO(g_slice_get_config, lFu)
+GO(g_slice_get_config_state, pFulp)
+GO(g_slice_set_config, vFul)
GO(g_slist_alloc, pFv)
GO(g_slist_append, pFpp)
GO(g_slist_concat, pFpp)
@@ -1103,7 +1099,7 @@ GO(g_spaced_primes_closest, uFu)
GOM(g_spawn_async, iFEpppipppp)
GOM(g_spawn_async_with_pipes, iFEpppippppppp)
GO(g_spawn_check_exit_status, iFip)
-GO(g_spawn_close_pid, vFp)
+GO(g_spawn_close_pid, vFi)
GO(g_spawn_command_line_async, iFpp)
GO(g_spawn_command_line_sync, iFppppp)
GO(g_spawn_error_quark, pFv)
@@ -1182,8 +1178,8 @@ GO(g_string_insert_len, pFplpl)
GO(g_string_insert_unichar, pFplu)
GO(g_string_new, pFp)
GO(g_string_new_len, pFpl)
-GO(g_string_overwrite, pFplp)
-GO(g_string_overwrite_len, pFplpl)
+GO(g_string_overwrite, pFpLp)
+GO(g_string_overwrite_len, pFpLpl)
GO(g_string_prepend, pFpp)
GO(g_string_prepend_c, pFpC)
GO(g_string_prepend_len, pFppl)
@@ -1198,15 +1194,15 @@ GO(g_strip_context, pFpp)
GO(g_str_is_ascii, iFp)
GOM(g_strjoin, pFEpV)
GOM(g_strjoinv, pFEpp)
-GO(g_strlcat, uFppu)
+GO(g_strlcat, LFppL)
GO(g_strlcpy, uFppu)
GO(g_str_match_string, iFppi)
GO(g_strncasecmp, iFppu)
-GO(g_strndup, pFpu)
-GO(g_strnfill, pFuC)
+GO(g_strndup, pFpL)
+GO(g_strnfill, pFLC)
GO(g_strreverse, pFp)
GO(g_strrstr, pFpp)
-GO(g_strrstr_len, pFpip)
+GO(g_strrstr_len, pFplp)
GO(g_strsignal, pFi)
GO(g_strsplit, pFppi)
GO(g_strsplit_set, pFppi)
@@ -1220,71 +1216,71 @@ GO(g_strv_length, uFp)
//GO(g_test_add_data_func_full,
//GO(g_test_add_func,
//GO(g_test_add_vtable,
-//GO(g_test_assert_expected_messages_internal,
+GO(g_test_assert_expected_messages_internal, vFppip)
//GO(g_test_bug,
//GO(g_test_bug_base,
//GO(g_test_build_filename,
//GO(g_test_create_case,
-//GO(g_test_create_suite,
-//GO(g_test_expect_message,
+GO(g_test_create_suite, pFp)
+GO(g_test_expect_message, vFpip)
//GO(g_test_fail,
//GO(g_test_failed,
-//GO(g_test_get_dir,
+GO(g_test_get_dir, pFu)
//GO(g_test_get_filename,
-//GO(g_test_get_root,
+GO(g_test_get_root, pFv)
//GO(g_test_incomplete,
//GO(g_test_init,
-//GO(g_test_log_buffer_free,
-//GO(g_test_log_buffer_new,
-//GO(g_test_log_buffer_pop,
-//GO(g_test_log_buffer_push,
-//GO(g_test_log_msg_free,
+GO(g_test_log_buffer_free, vFp)
+GO(g_test_log_buffer_new, pFv)
+GO(g_test_log_buffer_pop, pFp)
+GO(g_test_log_buffer_push, vFpup)
+GO(g_test_log_msg_free, vFp)
//GO(g_test_log_set_fatal_handler,
-//GO(g_test_log_type_name,
+GO(g_test_log_type_name, pFu)
//GO(g_test_maximized_result,
//GO(g_test_message,
//GO(g_test_minimized_result,
//GO(g_test_queue_destroy,
//GO(g_test_queue_free,
-//GO(g_test_rand_double,
-//GO(g_test_rand_double_range,
-//GO(g_test_rand_int,
-//GO(g_test_rand_int_range,
+GO(g_test_rand_double, dFv)
+GO(g_test_rand_double_range, dFdd)
+GO(g_test_rand_int, iFv)
+GO(g_test_rand_int_range, iFii)
//GO(g_test_run,
-//GO(g_test_run_suite,
+GO(g_test_run_suite, iFp)
//GO(g_test_set_nonfatal_assertions,
-//GO(g_test_skip,
+GO(g_test_skip, vFp)
//GO(g_test_subprocess,
-//GO(g_test_suite_add,
-//GO(g_test_suite_add_suite,
+GO(g_test_suite_add, vFpp)
+GO(g_test_suite_add_suite, vFpp)
//GO(g_test_timer_elapsed,
//GO(g_test_timer_last,
//GO(g_test_timer_start,
-//GO(g_test_trap_assertions,
-//GO(g_test_trap_fork,
+GO(g_test_trap_assertions, vFppipLp)
+GO(g_test_trap_fork, iFLu)
//GO(g_test_trap_has_passed,
//GO(g_test_trap_reached_timeout,
-//GO(g_test_trap_subprocess,
+GO(g_test_trap_subprocess, vFpLu)
GOM(g_thread_create, pFEppip)
GOM(g_thread_create_full, pFEppLiiip)
-//GO(g_thread_error_quark,
+GO(g_thread_error_quark, pFv)
GO(g_thread_exit, vFp)
GOM(g_thread_foreach, vFEpp)
-//GO(g_thread_get_initialized,
+GO(g_thread_get_initialized, iFv)
//GO(g_thread_init_glib,
GO(g_thread_join, pFp)
//GO(g_thread_new,
//GO(g_thread_pool_free,
-//GO(g_thread_pool_get_max_idle_time,
+GO(g_thread_pool_get_max_idle_time, uFv)
//GO(g_thread_pool_get_max_threads,
-//GO(g_thread_pool_get_max_unused_threads,
+GO(g_thread_pool_get_max_unused_threads, iFv)
//GO(g_thread_pool_get_num_threads,
//GO(g_thread_pool_get_num_unused_threads,
//GO(g_thread_pool_new,
//GO(g_thread_pool_push,
-//GO(g_thread_pool_set_max_idle_time,
+GO(g_thread_pool_set_max_idle_time, vFu)
//GO(g_thread_pool_set_max_threads,
-//GO(g_thread_pool_set_max_unused_threads,
+GO(g_thread_pool_set_max_unused_threads, vFi)
//GO(g_thread_pool_set_sort_function,
//GO(g_thread_pool_stop_unused_threads,
//GO(g_thread_pool_unprocessed,
@@ -1302,23 +1298,23 @@ GO(g_timeout_source_new, pFu)
GO(g_timeout_source_new_seconds, pFu)
//GO(g_timer_continue,
//GO(g_timer_destroy,
-//GO(g_timer_elapsed,
-//GO(g_timer_new,
+GO(g_timer_elapsed, dFpp)
+GO(g_timer_new, pFv)
//GO(g_timer_reset,
//GO(g_timer_start,
//GO(g_timer_stop,
GO(g_time_val_add, vFpl)
GO(g_time_val_from_iso8601, iFpp)
GO(g_time_val_to_iso8601, pFp)
-//GO(g_time_zone_adjust_time,
-//GO(g_time_zone_find_interval,
-//GO(g_time_zone_get_abbreviation,
-//GO(g_time_zone_get_offset,
-//GO(g_time_zone_is_dst,
+GO(g_time_zone_adjust_time, iFpup)
+GO(g_time_zone_find_interval, iFpul)
+GO(g_time_zone_get_abbreviation, pFpi)
+GO(g_time_zone_get_offset, iFpi)
+GO(g_time_zone_is_dst, iFpi)
//GO(g_time_zone_new,
-//GO(g_time_zone_new_local,
+GO(g_time_zone_new_local, pFv)
//GO(g_time_zone_new_utc,
-//GO(g_time_zone_ref,
+GO(g_time_zone_ref, pFp)
//GO(g_time_zone_unref,
GO(g_trash_stack_height, uFp)
GO(g_trash_stack_peek, pFp)
@@ -1328,17 +1324,17 @@ GO(g_trash_stack_push, vFpp)
//GO(g_tree_foreach,
//GO(g_tree_height,
//GO(g_tree_insert,
-//GO(g_tree_lookup,
-//GO(g_tree_lookup_extended,
+GO(g_tree_lookup, pFpp)
+GO(g_tree_lookup_extended, iFpppp)
//GO(g_tree_new,
//GO(g_tree_new_full,
//GO(g_tree_new_with_data,
-//GO(g_tree_nnodes,
-//GO(g_tree_ref,
+GO(g_tree_nnodes, iFp)
+GO(g_tree_ref, pFp)
//GO(g_tree_remove,
-//GO(g_tree_replace,
+GO(g_tree_replace, vFppp)
//GO(g_tree_search,
-//GO(g_tree_steal,
+GO(g_tree_steal, iFpp)
//GO(g_tree_traverse,
//GO(g_tree_unref,
GO(g_try_malloc, pFL)
@@ -1347,16 +1343,16 @@ GO(g_try_malloc0_n, pFLL)
GO(g_try_malloc_n, pFLL)
GO(g_try_realloc, pFpL)
GO(g_try_realloc_n, pFpLL)
-//GO(g_tuples_destroy,
-//GO(g_tuples_index,
+GO(g_tuples_destroy, vFp)
+GO(g_tuples_index, pFpii)
GO(g_ucs4_to_utf16, pFplppp)
GO(g_ucs4_to_utf8, pFplppp)
-GO(g_unichar_break_type, iFu)
+GO(g_unichar_break_type, uFu)
GO(g_unichar_combining_class, iFu)
GO(g_unichar_compose, iFuup)
GO(g_unichar_decompose, iFupp)
GO(g_unichar_digit_value, iFu)
-GO(g_unichar_fully_decompose, iFuipu)
+GO(g_unichar_fully_decompose, LFuipL)
GO(g_unichar_get_mirror_char, iFup)
GO(g_unichar_get_script, iFu)
GO(g_unichar_isalnum, iFu)
@@ -1380,11 +1376,11 @@ GO(g_unichar_tolower, uFu)
GO(g_unichar_totitle, uFu)
GO(g_unichar_toupper, uFu)
GO(g_unichar_to_utf8, iFup)
-GO(g_unichar_type, iFu)
+GO(g_unichar_type, uFu)
GO(g_unichar_validate, iFu)
GO(g_unichar_xdigit_value, iFu)
GO(g_unicode_canonical_decomposition, pFup)
-GO(g_unicode_canonical_ordering, vFpu)
+GO(g_unicode_canonical_ordering, vFpL)
GO(g_unicode_script_from_iso15924, iFu)
GO(g_unicode_script_to_iso15924, uFi)
//GO(g_unix_error_quark,
@@ -1413,16 +1409,16 @@ GO(g_utf8_collate_key_for_filename, pFpi)
GO(g_utf8_find_next_char, pFpp)
GO(g_utf8_find_prev_char, pFpp)
GO(g_utf8_get_char, uFp)
-GO(g_utf8_get_char_validated, uFpi)
-GO(g_utf8_normalize, pFpii)
+GO(g_utf8_get_char_validated, uFpl)
+GO(g_utf8_normalize, pFplu)
GO(g_utf8_offset_to_pointer, pFpl)
GO(g_utf8_pointer_to_offset, lFpp)
GO(g_utf8_prev_char, pFp)
GO(g_utf8_strchr, pFpiu)
GO(g_utf8_strdown, pFpi)
-GO(g_utf8_strlen, lFpi)
-GO(g_utf8_strncpy, pFppu)
-GO(g_utf8_strrchr, pFpiu)
+GO(g_utf8_strlen, lFpl)
+GO(g_utf8_strncpy, pFppL)
+GO(g_utf8_strrchr, pFplu)
GO(g_utf8_strreverse, pFpi)
GO(g_utf8_strup, pFpi)
GO(g_utf8_substring, pFpll)
@@ -1444,7 +1440,7 @@ GO(g_variant_builder_ref, pFp)
GO(g_variant_builder_unref, vFp)
GO(g_variant_byteswap, pFp)
GO(g_variant_check_format_string, iFppi)
-GO(g_variant_classify, iFp)
+GO(g_variant_classify, uFp)
GO(g_variant_compare, iFpp)
GO(g_variant_dict_clear, vFp)
GO(g_variant_dict_contains, iFpp)
@@ -1471,27 +1467,27 @@ GO(g_variant_get_boolean, iFp)
GO(g_variant_get_byte, CFp)
GO(g_variant_get_bytestring, pFp)
GO(g_variant_get_bytestring_array, pFpp)
-//GO(g_variant_get_child, vFpuppppppppppp) //vaarg here
-GO(g_variant_get_child_value, pFpu)
+GO(g_variant_get_child, vFpuppppppppppp) //vaarg here, only pointers so should be ok
+GO(g_variant_get_child_value, pFpL)
GO(g_variant_get_data, pFp)
GO(g_variant_get_data_as_bytes, pFp)
GO(g_variant_get_double, dFp)
-GO(g_variant_get_fixed_array, pFppu)
+GO(g_variant_get_fixed_array, pFppL)
GO(g_variant_get_handle, iFp)
GO(g_variant_get_int16, wFp)
GO(g_variant_get_int32, iFp)
-GO(g_variant_get_int64, IFp)
+GO(g_variant_get_int64, lFp)
GO(g_variant_get_maybe, pFp)
GO(g_variant_get_normal_form, pFp)
GO(g_variant_get_objv, pFpp)
-GO(g_variant_get_size, uFp)
+GO(g_variant_get_size, LFp)
GO(g_variant_get_string, pFpp)
GO(g_variant_get_strv, pFpp)
GO(g_variant_get_type, pFp)
GO(g_variant_get_type_string, pFp)
GO(g_variant_get_uint16, WFp)
GO(g_variant_get_uint32, uFp)
-GO(g_variant_get_uint64, UFp)
+GO(g_variant_get_uint64, LFp)
GO(g_variant_get_va, vFpppp) // no need to GOM, it's a "scanf" type of function, so using only pointer in va_list
GO(g_variant_get_variant, pFp)
GO(g_variant_hash, uFp)
@@ -1503,30 +1499,30 @@ GO(g_variant_is_of_type, iFpp)
GO(g_variant_is_signature, iFp)
GO(g_variant_iter_copy, pFp)
GO(g_variant_iter_free, vFp)
-GO(g_variant_iter_init, uFpp)
+GO(g_variant_iter_init, LFpp)
GO(g_variant_iter_loop, iFpppppppppppp) // vaarg
-GO(g_variant_iter_n_children, uFp)
+GO(g_variant_iter_n_children, LFp)
GO(g_variant_iter_new, pFp)
-//GO(g_variant_iter_next, iFpppppppppppp) // vaarg here
+GO(g_variant_iter_next, iFpppppppppppp) // vaarg here, only pointers so should be ok
GO(g_variant_iter_next_value, pFp)
GO(g_variant_lookup, iFpppppppppppp) // vaarg
GO(g_variant_lookup_value, pFppp)
GO(g_variant_n_children, uFp)
GOM(g_variant_new, pFEpV)
-GO(g_variant_new_array, pFppu)
+GO(g_variant_new_array, pFppL)
GO(g_variant_new_boolean, pFi)
GO(g_variant_new_byte, pFC)
GO(g_variant_new_bytestring, pFp)
-GO(g_variant_new_bytestring_array, pFpi)
+GO(g_variant_new_bytestring_array, pFpl)
GO(g_variant_new_dict_entry, pFpp)
GO(g_variant_new_double, pFd)
-GO(g_variant_new_fixed_array, pFppuu)
+GO(g_variant_new_fixed_array, pFppLL)
GO(g_variant_new_from_bytes, pFppi)
GOM(g_variant_new_from_data, pFEppuipp)
GO(g_variant_new_handle, pFi)
GO(g_variant_new_int16, pFw)
GO(g_variant_new_int32, pFi)
-GO(g_variant_new_int64, pFI)
+GO(g_variant_new_int64, pFl)
GO(g_variant_new_maybe, pFpp)
GO(g_variant_new_object_path, pFp)
GO(g_variant_new_objv, pFpi)
@@ -1537,10 +1533,10 @@ GO(g_variant_new_signature, pFp)
GO(g_variant_new_string, pFp)
GO(g_variant_new_strv, pFpi)
GO(g_variant_new_take_string, pFp)
-GO(g_variant_new_tuple, pFpu)
+GO(g_variant_new_tuple, pFpL)
GO(g_variant_new_uint16, pFW)
GO(g_variant_new_uint32, pFu)
-GO(g_variant_new_uint64, pFU)
+GO(g_variant_new_uint64, pFL)
GOM(g_variant_new_va, pFEppp)
GO(g_variant_new_variant, pFp)
GO(g_variant_parse, pFppppp)
@@ -1560,7 +1556,7 @@ GO(g_variant_ref_sink, pFp)
//GO(g_variant_serialiser_is_string,
//GO(g_variant_serialiser_needed_size,
//GO(g_variant_serialiser_serialise,
-GO(g_variant_store, vFp)
+GO(g_variant_store, vFpp)
GO(g_variant_take_ref, pFp)
GO(g_variant_type_checked_, pFp)
GO(g_variant_type_copy, pFp)
@@ -1597,7 +1593,7 @@ GO(g_variant_type_new_dict_entry, pFpp)
GO(g_variant_type_new_maybe, pFp)
GO(g_variant_type_new_tuple, pFpi)
GO(g_variant_type_next, pFp)
-GO(g_variant_type_n_items, iFp)
+GO(g_variant_type_n_items, LFp)
GO(g_variant_type_peek_string, pFp)
GO(g_variant_type_string_is_valid, iFp)
GO(g_variant_type_string_scan, iFppp)
diff --git a/src/wrapped/wrappedgmodule2.c b/src/wrapped/wrappedgmodule2.c
index b5681d4..b5681d4 100755..100644
--- a/src/wrapped/wrappedgmodule2.c
+++ b/src/wrapped/wrappedgmodule2.c
diff --git a/src/wrapped/wrappedgmodule2_private.h b/src/wrapped/wrappedgmodule2_private.h
index 45beba4..9aed451 100755..100644
--- a/src/wrapped/wrappedgmodule2_private.h
+++ b/src/wrapped/wrappedgmodule2_private.h
@@ -8,7 +8,7 @@ GO(g_module_close, iFp)
GO(g_module_error, pFv)
GO(g_module_make_resident, vFp)
GO(g_module_name, pFp)
-GO(g_module_open, pFpi)
+GO(g_module_open, pFpu)
GO(g_module_supported, iFv)
GO(g_module_symbol, iFppp)
//GO(_init,
diff --git a/src/wrapped/wrappedgmp.c b/src/wrapped/wrappedgmp.c
index e29da8e..731d2d8 100644
--- a/src/wrapped/wrappedgmp.c
+++ b/src/wrapped/wrappedgmp.c
@@ -11,8 +11,146 @@
#include "bridge.h"
#include "librarian/library_private.h"
#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
const char* gmpName = "libgmp.so.10";
#define LIBNAME gmp
+#include "generated/wrappedgmptypes.h"
+
+#include "wrappercallback.h"
+
+// utility functions
+#define SUPER() \
+GO(0) \
+GO(1) \
+GO(2) \
+GO(3) \
+GO(4)
+
+// alloc_func
+#define GO(A) \
+static uintptr_t my_alloc_func_fct_##A = 0; \
+static void* my_alloc_func_##A(size_t a) \
+{ \
+ return (void*)RunFunctionFmt(my_alloc_func_fct_##A, "L", a); \
+}
+SUPER()
+#undef GO
+static void* find_alloc_func_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_alloc_func_fct_##A == (uintptr_t)fct) return my_alloc_func_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_alloc_func_fct_##A == 0) {my_alloc_func_fct_##A = (uintptr_t)fct; return my_alloc_func_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libgmp.so.10 alloc_func callback\n");
+ return NULL;
+}
+static void* reverse_alloc_func_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my_alloc_func_##A == fct) return (void*)my_alloc_func_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, pFL, fct, 0, NULL);
+}
+// realloc_func
+#define GO(A) \
+static uintptr_t my_realloc_func_fct_##A = 0; \
+static void* my_realloc_func_##A(void* a, size_t b) \
+{ \
+ return (void*)RunFunctionFmt(my_realloc_func_fct_##A, "pL", a, b); \
+}
+SUPER()
+#undef GO
+static void* find_realloc_func_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_realloc_func_fct_##A == (uintptr_t)fct) return my_realloc_func_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_realloc_func_fct_##A == 0) {my_realloc_func_fct_##A = (uintptr_t)fct; return my_realloc_func_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libgmp.so.10 realloc_func callback\n");
+ return NULL;
+}
+static void* reverse_realloc_func_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my_realloc_func_##A == fct) return (void*)my_realloc_func_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, pFpL, fct, 0, NULL);
+}
+// free_func
+#define GO(A) \
+static uintptr_t my_free_func_fct_##A = 0; \
+static void my_free_func_##A(void* a) \
+{ \
+ RunFunctionFmt(my_free_func_fct_##A, "p", a); \
+}
+SUPER()
+#undef GO
+static void* find_free_func_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_free_func_fct_##A == (uintptr_t)fct) return my_free_func_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_free_func_fct_##A == 0) {my_free_func_fct_##A = (uintptr_t)fct; return my_free_func_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libgmp.so.10 free_func callback\n");
+ return NULL;
+}
+static void* reverse_free_func_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my_free_func_##A == fct) return (void*)my_free_func_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, vFp, fct, 0, NULL);
+}
+
+#undef SUPER
+
+EXPORT void my___gmp_get_memory_functions(x64emu_t* emu, void** f_alloc, void** f_realloc, void** f_free)
+{
+ my->__gmp_get_memory_functions(f_alloc, f_realloc, f_free);
+ *f_alloc = reverse_alloc_func_Fct(*f_alloc);
+ *f_realloc = reverse_realloc_func_Fct(*f_realloc);
+ *f_free = reverse_free_func_Fct(*f_free);
+}
+EXPORT void my___gmp_set_memory_functions(x64emu_t* emu, void* f_alloc, void* f_realloc, void* f_free)
+{
+ my->__gmp_set_memory_functions(find_alloc_func_Fct(f_alloc), find_realloc_func_Fct(f_realloc), find_free_func_Fct(f_free));
+}
+
+#define CUSTOM_INIT \
+ getMy(lib);
+
+#define CUSTOM_FINI \
+ freeMy();
+
#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedgmp_private.h b/src/wrapped/wrappedgmp_private.h
index 1a28497..3aa119b 100644
--- a/src/wrapped/wrappedgmp_private.h
+++ b/src/wrapped/wrappedgmp_private.h
@@ -2,6 +2,8 @@
#error meh!
#endif
+// mp_bitcnt_t unsigned long int
+
//DATA(__gmp_allocate_func,
//GO(__gmp_asprintf,
//GO(__gmp_asprintf_final,
@@ -95,7 +97,7 @@
//GO(__gmpf_ui_div,
//GO(__gmpf_ui_sub,
//GO(__gmpf_urandomb,
-//GO(__gmp_get_memory_functions,
+GOM(__gmp_get_memory_functions, vFEppp)
//GO(__gmp_init_primesieve,
//GO(__gmp_invalid_operation,
//DATAB(__gmp_junk,
@@ -107,8 +109,8 @@
//GO(__gmpn_add_err3_n,
//GO(__gmpn_addlsh1_n,
//GO(__gmpn_addlsh2_n,
-//GO(__gmpn_addmul_1,
-//GO(__gmpn_add_n,
+GO(__gmpn_addmul_1, LFppLL)
+GO(__gmpn_add_n, LFpppL)
//GO(__gmpn_add_nc,
//GO(__gmpn_add_n_sub_n,
//GO(__gmpn_and_n,
@@ -129,13 +131,13 @@
//GO(__gmpn_bsqrt,
//GO(__gmpn_bsqrtinv,
//GO(__gmpn_cmp,
-//GO(__gmpn_cnd_add_n,
-//GO(__gmpn_cnd_sub_n,
+GO(__gmpn_cnd_add_n, LFLpppL)
+GO(__gmpn_cnd_sub_n, LFLpppL)
//GO(__gmpn_cnd_swap,
//GO(__gmpn_com,
//GO(__gmpn_compute_powtab,
-//GO(__gmpn_copyd,
-//GO(__gmpn_copyi,
+GO(__gmpn_copyd, vFppL)
+GO(__gmpn_copyi, vFppL)
//GO(__gmpn_dcpi1_bdiv_q,
//GO(__gmpn_dcpi1_bdiv_qr,
//GO(__gmpn_dcpi1_bdiv_qr_n,
@@ -229,7 +231,7 @@
//GO(__gmpn_mu_div_qr,
//GO(__gmpn_mu_div_qr_itch,
//GO(__gmpn_mul,
-//GO(__gmpn_mul_1,
+GO(__gmpn_mul_1, LFppLL)
//GO(__gmpn_mul_1c,
//GO(__gmpn_mul_basecase,
//GO(__gmpn_mul_fft,
@@ -240,14 +242,14 @@
//GO(__gmpn_mulmid_n,
//GO(__gmpn_mulmod_bnm1,
//GO(__gmpn_mulmod_bnm1_next_size,
-//GO(__gmpn_mul_n,
+GO(__gmpn_mul_n, vFpppL)
//GO(__gmpn_nand_n,
//GO(__gmpn_neg,
//GO(__gmpn_ni_invertappr,
//GO(__gmpn_nior_n,
//GO(__gmpn_nussbaumer_mul,
//GO(__gmpn_perfect_power_p,
-//GO(__gmpn_perfect_square_p,
+GO(__gmpn_perfect_square_p, iFpL)
//GO(__gmpn_pi1_bdiv_q_1,
//GO(__gmpn_popcount,
//GO(__gmpn_pow_1,
@@ -268,7 +270,7 @@
//GO(__gmpn_rsblsh2_n,
//GO(__gmpn_rsh1add_n,
//GO(__gmpn_rsh1sub_n,
-//GO(__gmpn_rshift,
+GO(__gmpn_rshift, LFppLu)
//GO(__gmpn_sbpi1_bdiv_q,
//GO(__gmpn_sbpi1_bdiv_qr,
//GO(__gmpn_sbpi1_bdiv_r,
@@ -298,7 +300,7 @@
//GO(__gmpn_sec_tabselect,
//GO(__gmpn_set_str,
//GO(__gmpn_sizeinbase,
-//GO(__gmpn_sqr,
+GO(__gmpn_sqr, vFppL)
//GO(__gmpn_sqr_basecase,
//GO(__gmpn_sqr_diag_addlsh1,
//GO(__gmpn_sqrlo,
@@ -314,8 +316,8 @@
//GO(__gmpn_sub_err3_n,
//GO(__gmpn_sublsh1_n,
//GO(__gmpn_sublsh2_n,
-//GO(__gmpn_submul_1,
-//GO(__gmpn_sub_n,
+GO(__gmpn_submul_1, LFppLL)
+GO(__gmpn_sub_n, LFpppL)
//GO(__gmpn_sub_nc,
//GO(__gmpn_tdiv_qr,
//GO(__gmpn_toom22_mul,
@@ -353,7 +355,7 @@
//GO(__gmpn_trialdiv,
//GO(__gmpn_xnor_n,
//GO(__gmpn_xor_n,
-//GO(__gmpn_zero,
+GO(__gmpn_zero, vFpL)
//GO(__gmpn_zero_p,
//GO(__gmp_obstack_printf,
//DATA(__gmp_obstack_printf_funs,
@@ -412,7 +414,7 @@
//DATAB(__gmp_rands_initialized,
//DATA(__gmp_reallocate_func,
//GO(__gmp_scanf,
-//GO(__gmp_set_memory_functions,
+GOM(__gmp_set_memory_functions, vFEppp)
//GO(__gmp_snprintf,
//DATA(__gmp_snprintf_funs,
//GO(__gmp_sprintf,
@@ -435,16 +437,16 @@
//GO(__gmp_vsscanf,
//GO(__gmpz_2fac_ui,
//GO(__gmpz_abs,
-//GO(__gmpz_add,
+GO(__gmpz_add, vFppp)
//GO(__gmpz_addmul,
//GO(__gmpz_addmul_ui,
-//GO(__gmpz_add_ui,
+GO(__gmpz_add_ui, vFppL)
//GO(__gmpz_and,
//GO(__gmpz_aorsmul_1,
//GO(__gmpz_array_init,
//GO(__gmpz_bin_ui,
//GO(__gmpz_bin_uiui,
-//GO(__gmpz_cdiv_q,
+GO(__gmpz_cdiv_q, vFppp)
//GO(__gmpz_cdiv_q_2exp,
//GO(__gmpz_cdiv_qr,
//GO(__gmpz_cdiv_qr_ui,
@@ -463,10 +465,10 @@ GO(__gmpz_cmp, iFpp)
//GO(__gmpz_cmp_d,
//GO(__gmpz_cmp_si,
GO(__gmpz_cmp_ui, iFpu)
-//GO(__gmpz_com,
+GO(__gmpz_com, vFpp)
//GO(__gmpz_combit,
//GO(__gmpz_congruent_2exp_p,
-//GO(__gmpz_congruent_p,
+GO(__gmpz_congruent_p, iFppp)
//GO(__gmpz_congruent_ui_p,
//GO(__gmpz_divexact,
//GO(__gmpz_divexact_gcd,
@@ -477,13 +479,13 @@ GO(__gmpz_cmp_ui, iFpu)
//GO(__gmpz_dump,
GO(__gmpz_export, vFppiLiLp)
//GO(__gmpz_fac_ui,
-//GO(__gmpz_fdiv_q,
-//GO(__gmpz_fdiv_q_2exp,
+GO(__gmpz_fdiv_q, vFppp)
+GO(__gmpz_fdiv_q_2exp, vFppL)
//GO(__gmpz_fdiv_qr,
//GO(__gmpz_fdiv_qr_ui,
//GO(__gmpz_fdiv_q_ui,
-//GO(__gmpz_fdiv_r,
-//GO(__gmpz_fdiv_r_2exp,
+GO(__gmpz_fdiv_r, vFppp)
+GO(__gmpz_fdiv_r_2exp, vFppL)
//GO(__gmpz_fdiv_r_ui,
//GO(__gmpz_fdiv_ui,
//GO(__gmpz_fib2_ui,
@@ -494,7 +496,7 @@ GO(__gmpz_export, vFppiLiLp)
//GO(__gmpz_fits_uint_p,
//GO(__gmpz_fits_ulong_p,
//GO(__gmpz_fits_ushort_p,
-//GO(__gmpz_gcd,
+GO(__gmpz_gcd, vFppp)
//GO(__gmpz_gcdext,
//GO(__gmpz_gcd_ui,
//GO(__gmpz_get_d,
@@ -508,15 +510,15 @@ GO(__gmpz_import, vFpLiLiLp)
GO(__gmpz_init, vFp)
//GO(__gmpz_init2,
//GO(__gmpz_inits,
-//GO(__gmpz_init_set,
+GO(__gmpz_init_set, vFpp)
//GO(__gmpz_init_set_d,
//GO(__gmpz_init_set_si,
//GO(__gmpz_init_set_str,
-//GO(__gmpz_init_set_ui,
+GO(__gmpz_init_set_ui, vFpL)
//GO(__gmpz_inp_raw,
//GO(__gmpz_inp_str,
//GO(__gmpz_inp_str_nowhite,
-//GO(__gmpz_invert,
+GO(__gmpz_invert, iFppp)
//GO(__gmpz_ior,
//GO(__gmpz_jacobi,
//GO(__gmpz_kronecker_si,
@@ -524,20 +526,20 @@ GO(__gmpz_init, vFp)
//GO(__gmpz_lcm,
//GO(__gmpz_lcm_ui,
//GO(__gmpz_legendre,
-//GO(__gmpz_limbs_finish,
-//GO(__gmpz_limbs_modify,
-//GO(__gmpz_limbs_read,
-//GO(__gmpz_limbs_write,
+GO(__gmpz_limbs_finish, vFpL)
+GO(__gmpz_limbs_modify, pFpL)
+GO(__gmpz_limbs_read, pFp)
+GO(__gmpz_limbs_write, pFpL)
//GO(__gmpz_lucas_mod,
//GO(__gmpz_lucnum2_ui,
//GO(__gmpz_lucnum_ui,
//GO(__gmpz_mfac_uiui,
//GO(__gmpz_millerrabin,
GO(__gmpz_mod, vFppp)
-//GO(__gmpz_mul,
-//GO(__gmpz_mul_2exp,
+GO(__gmpz_mul, vFppp)
+GO(__gmpz_mul_2exp, vFppL)
//GO(__gmpz_mul_si,
-//GO(__gmpz_mul_ui,
+GO(__gmpz_mul_ui, vFppL)
//GO(__gmpz_neg,
//GO(__gmpz_nextprime,
//GO(__gmpz_n_pow_ui,
@@ -548,52 +550,52 @@ GO(__gmpz_mod, vFppp)
//GO(__gmpz_perfect_square_p,
//GO(__gmpz_popcount,
GO(__gmpz_powm, vFpppp)
-//GO(__gmpz_powm_sec,
-//GO(__gmpz_powm_ui,
+GO(__gmpz_powm_sec, vFpppp)
+GO(__gmpz_powm_ui, vFppLp)
//GO(__gmpz_pow_ui,
//GO(__gmpz_primorial_ui,
-//GO(__gmpz_probab_prime_p,
+GO(__gmpz_probab_prime_p, iFpi)
//GO(__gmpz_prodlimbs,
//GO(__gmpz_random,
//GO(__gmpz_random2,
//GO(__gmpz_realloc,
//GO(__gmpz_realloc2,
//GO(__gmpz_remove,
-//GO(__gmpz_roinit_n,
+GO(__gmpz_roinit_n, pFppL)
//GO(__gmpz_root,
//GO(__gmpz_rootrem,
//GO(__gmpz_rrandomb,
//GO(__gmpz_scan0,
-//GO(__gmpz_scan1,
-//GO(__gmpz_set,
-//GO(__gmpz_setbit,
+GO(__gmpz_scan1, LFpL)
+GO(__gmpz_set, vFpp)
+GO(__gmpz_setbit, vFpL)
//GO(__gmpz_set_d,
//GO(__gmpz_set_f,
//GO(__gmpz_set_q,
//GO(__gmpz_set_si,
//GO(__gmpz_set_str,
-//GO(__gmpz_set_ui,
+GO(__gmpz_set_ui, vFpL)
//GO(__gmpz_si_kronecker,
//GO(__gmpz_size,
GO(__gmpz_sizeinbase, LFpi)
//GO(__gmpz_sqrt,
//GO(__gmpz_sqrtrem,
//GO(__gmpz_stronglucas,
-//GO(__gmpz_sub,
+GO(__gmpz_sub, vFppp)
//GO(__gmpz_submul,
-//GO(__gmpz_submul_ui,
+GO(__gmpz_submul_ui, vFppL)
GO(__gmpz_sub_ui, vFppu)
//GO(__gmpz_swap,
//GO(__gmpz_tdiv_q,
-//GO(__gmpz_tdiv_q_2exp,
-//GO(__gmpz_tdiv_qr,
+GO(__gmpz_tdiv_q_2exp, vFppL)
+GO(__gmpz_tdiv_qr, vFpppp)
//GO(__gmpz_tdiv_qr_ui,
//GO(__gmpz_tdiv_q_ui,
//GO(__gmpz_tdiv_r,
//GO(__gmpz_tdiv_r_2exp,
//GO(__gmpz_tdiv_r_ui,
//GO(__gmpz_tdiv_ui,
-//GO(__gmpz_tstbit,
+GO(__gmpz_tstbit, iFpL)
//GO(__gmpz_ui_kronecker,
//GO(__gmpz_ui_pow_ui,
//GO(__gmpz_ui_sub,
diff --git a/src/wrapped/wrappedgnutls.c b/src/wrapped/wrappedgnutls.c
index cc89e69..dd4cde2 100755..100644
--- a/src/wrapped/wrappedgnutls.c
+++ b/src/wrapped/wrappedgnutls.c
@@ -35,10 +35,10 @@ GO(4)
// gnutls_log
#define GO(A) \
-static uintptr_t my_gnutls_log_fct_##A = 0; \
-static void my_gnutls_log_##A(int level, const char* p) \
-{ \
- RunFunction(my_context, my_gnutls_log_fct_##A, 2, level, p); \
+static uintptr_t my_gnutls_log_fct_##A = 0; \
+static void my_gnutls_log_##A(int level, const char* p) \
+{ \
+ RunFunctionFmt(my_gnutls_log_fct_##A, "ip", level, p); \
}
SUPER()
#undef GO
@@ -59,10 +59,10 @@ static void* find_gnutls_log_Fct(void* fct)
// pullpush
#define GO(A) \
-static uintptr_t my_pullpush_fct_##A = 0; \
-static long my_pullpush_##A(void* p, void* d, size_t l) \
-{ \
- return (long)RunFunction(my_context, my_pullpush_fct_##A, 3, p, d, l); \
+static uintptr_t my_pullpush_fct_##A = 0; \
+static long my_pullpush_##A(void* p, void* d, size_t l) \
+{ \
+ return (long)RunFunctionFmt(my_pullpush_fct_##A, "ppL", p, d, l); \
}
SUPER()
#undef GO
@@ -83,10 +83,10 @@ static void* find_pullpush_Fct(void* fct)
// timeout
#define GO(A) \
-static uintptr_t my_timeout_fct_##A = 0; \
-static int my_timeout_##A(void* p, uint32_t t) \
-{ \
- return (int)RunFunction(my_context, my_timeout_fct_##A, 2, p, t); \
+static uintptr_t my_timeout_fct_##A = 0; \
+static int my_timeout_##A(void* p, uint32_t t) \
+{ \
+ return (int)RunFunctionFmt(my_timeout_fct_##A, "pu", p, t); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedgnutls_private.h b/src/wrapped/wrappedgnutls_private.h
index 3697259..13363b0 100755..100644
--- a/src/wrapped/wrappedgnutls_private.h
+++ b/src/wrapped/wrappedgnutls_private.h
@@ -189,6 +189,8 @@ GO(gnutls_dtls_set_timeouts, vFpuu)
//GO(gnutls_ecc_curve_get_pk,
//GO(gnutls_ecc_curve_get_size,
//GO(gnutls_ecc_curve_list,
+GO(_gnutls_ecdh_compute_key, iFppp)
+GO(gnutls_ecdh_compute_key, iFppp)
//GO(gnutls_encode_ber_digest_info,
//GO(_gnutls_encode_ber_rs_raw,
//GO(gnutls_error_is_fatal,
@@ -560,6 +562,7 @@ GO(gnutls_privkey_import_rsa_raw, iFppppppppp)
GO(gnutls_privkey_init, iFp)
//GO(gnutls_privkey_set_flags,
//GO(gnutls_privkey_set_pin_function,
+GO(gnutls_privkey_set_spki, iFppu)
//GO(gnutls_privkey_sign_data,
GO(gnutls_privkey_sign_hash, iFppupp)
//GO(gnutls_privkey_status,
@@ -616,6 +619,7 @@ GO(gnutls_pubkey_init, iFp)
//GO(gnutls_pubkey_print,
//GO(gnutls_pubkey_set_key_usage,
//GO(gnutls_pubkey_set_pin_function,
+GO(gnutls_pubkey_set_spki, iFppu)
//GO(gnutls_pubkey_verify_data2,
GO(gnutls_pubkey_verify_hash2, iFppupp)
//GO(gnutls_pubkey_verify_params,
@@ -1092,6 +1096,9 @@ GO(gnutls_x509_privkey_get_pk_algorithm2, iFpp)
//GO(gnutls_x509_rdn_get2,
//GO(gnutls_x509_rdn_get_by_oid,
//GO(gnutls_x509_rdn_get_oid,
+GO(gnutls_x509_spki_deinit, vFp)
+GO(gnutls_x509_spki_init, vFp)
+GO(gnutls_x509_spki_set_rsa_pss_params, vFppu)
//GO(gnutls_x509_tlsfeatures_add,
//GO(gnutls_x509_tlsfeatures_check_crt,
//GO(gnutls_x509_tlsfeatures_deinit,
diff --git a/src/wrapped/wrappedgobject2.c b/src/wrapped/wrappedgobject2.c
index f9fc35b..d51a736 100755..100644
--- a/src/wrapped/wrappedgobject2.c
+++ b/src/wrapped/wrappedgobject2.c
@@ -67,11 +67,11 @@ static int signal_cb(void* a, void* b, void* c, void* d, void* e)
}
printf_log(LOG_DEBUG, "gobject2 Signal called, sig=%p, handler=%p, NArgs=%d\n", sig, sig?(void*)sig->c_handler:NULL, i);
switch(i) {
- case 1: return (int)RunFunction(my_context, sig->c_handler, 1, sig->data);
- case 2: return (int)RunFunction(my_context, sig->c_handler, 2, a, sig->data);
- case 3: return (int)RunFunction(my_context, sig->c_handler, 3, a, b, sig->data);
- case 4: return (int)RunFunction(my_context, sig->c_handler, 4, a, b, c, sig->data);
- case 5: return (int)RunFunction(my_context, sig->c_handler, 5, a, b, c, d, sig->data);
+ case 1: return (int)RunFunctionFmt(sig->c_handler, "p", sig->data);
+ case 2: return (int)RunFunctionFmt(sig->c_handler, "pp", a, sig->data);
+ case 3: return (int)RunFunctionFmt(sig->c_handler, "ppp", a, b, sig->data);
+ case 4: return (int)RunFunctionFmt(sig->c_handler, "pppp", a, b, c, sig->data);
+ case 5: return (int)RunFunctionFmt(sig->c_handler, "ppppp", a, b, c, d, sig->data);
}
printf_log(LOG_NONE, "Warning, GObject2 signal callback but no data found!\n");
return 0;
@@ -80,47 +80,47 @@ static int signal_cb_swapped(my_signal_t* sig, void* b, void* c, void* d)
{
// data is in front here...
printf_log(LOG_DEBUG, "gobject2 swaped4 Signal called, sig=%p\n", sig);
- return (int)RunFunction(my_context, sig->c_handler, 4, sig->data, b, c, d);
+ return (int)RunFunctionFmt(sig->c_handler, "pppp", sig->data, b, c, d);
}
static int signal_cb_5(void* a, void* b, void* c, void* d, my_signal_t* sig)
{
printf_log(LOG_DEBUG, "gobject2 5 Signal called, sig=%p\n", sig);
- return (int)RunFunction(my_context, sig->c_handler, 5, a, b, c, d, sig->data);
+ return (int)RunFunctionFmt(sig->c_handler, "ppppp", a, b, c, d, sig->data);
}
static int signal_cb_swapped_5(my_signal_t* sig, void* b, void* c, void* d, void* e)
{
// data is in front here...
printf_log(LOG_DEBUG, "gobject2 swaped5 Signal called, sig=%p\n", sig);
- return (int)RunFunction(my_context, sig->c_handler, 5, sig->data, b, c, d, e);
+ return (int)RunFunctionFmt(sig->c_handler, "ppppp", sig->data, b, c, d, e);
}
static int signal_cb_6(void* a, void* b, void* c, void* d, void* e, my_signal_t* sig)
{
printf_log(LOG_DEBUG, "gobject2 6 Signal called, sig=%p\n", sig);
- return (int)RunFunction(my_context, sig->c_handler, 6, a, b, c, d, e, sig->data);
+ return (int)RunFunctionFmt(sig->c_handler, "pppppp", a, b, c, d, e, sig->data);
}
static int signal_cb_swapped_6(my_signal_t* sig, void* b, void* c, void* d, void* e, void* f)
{
// data is in front here...
printf_log(LOG_DEBUG, "gobject2 swaped6 Signal called, sig=%p\n", sig);
- return (int)RunFunction(my_context, sig->c_handler, 6, sig->data, b, c, d, e, f);
+ return (int)RunFunctionFmt(sig->c_handler, "pppppp", sig->data, b, c, d, e, f);
}
static int signal_cb_8(void* a, void* b, void* c, void* d, void* e, void* f, void* g, my_signal_t* sig)
{
printf_log(LOG_DEBUG, "gobject2 8 Signal called, sig=%p\n", sig);
- return (int)RunFunction(my_context, sig->c_handler, 8, a, b, c, d, e, f, g, sig->data);
+ return (int)RunFunctionFmt(sig->c_handler, "pppppppp", a, b, c, d, e, f, g, sig->data);
}
static int signal_cb_swapped_8(my_signal_t* sig, void* b, void* c, void* d, void* e, void* f, void* g, void* h)
{
// data is in front here...
printf_log(LOG_DEBUG, "gobject2 swaped8 Signal called, sig=%p\n", sig);
- return (int)RunFunction(my_context, sig->c_handler, 8, sig->data, b, c, d, e, f, g, h);
+ return (int)RunFunctionFmt(sig->c_handler, "pppppppp", sig->data, b, c, d, e, f, g, h);
}
static void signal_delete(my_signal_t* sig, void* b)
{
uintptr_t d = sig->destroy;
if(d) {
- RunFunction(my_context, d, 2, sig->data, b);
+ RunFunctionFmt(d, "pp", sig->data, b);
}
printf_log(LOG_DEBUG, "gobject2 Signal deleted, sig=%p, destroy=%p\n", sig, (void*)d);
free(sig);
@@ -128,7 +128,7 @@ static void signal_delete(my_signal_t* sig, void* b)
static void addGObject2Alternate(library_t* lib)
{
- #define GO(A, W) AddAutomaticBridge(thread_get_emu(), lib->w.bridge, W, dlsym(lib->w.lib, #A), 0)
+ #define GO(A, W) AddAutomaticBridge(thread_get_emu(), lib->w.bridge, W, dlsym(lib->w.lib, #A), 0, #A)
GO(g_cclosure_marshal_VOID__VOID, vFppuppp);
GO(g_cclosure_marshal_VOID__BOOLEAN, vFppuppp);
GO(g_cclosure_marshal_VOID__UCHAR, vFppuppp);
@@ -174,7 +174,7 @@ static void addGObject2Alternate(library_t* lib)
GO(g_cclosure_marshal_BOOLEAN__FLAGSv, vFpppppip);
GO(g_cclosure_marshal_BOOLEAN__BOXED_BOXEDv, vFpppppip);
#undef GO
- #define GO(A, W) AddAutomaticBridge(thread_get_emu(), lib->w.bridge, W, A, 0)
+ #define GO(A, W) AddAutomaticBridge(thread_get_emu(), lib->w.bridge, W, A, 0, #A)
GO(signal_cb, iFpppp);
GO(signal_cb_swapped, iFpppp);
GO(signal_cb_5, iFppppp);
@@ -267,10 +267,10 @@ GO(11) \
GO(12) \
#define GO(A) \
-static uintptr_t my_copy_fct_##A = 0; \
-static void* my_copy_##A(void* data) \
-{ \
- return (void*)RunFunction(my_context, my_copy_fct_##A, 1, data);\
+static uintptr_t my_copy_fct_##A = 0; \
+static void* my_copy_##A(void* data) \
+{ \
+ return (void*)RunFunctionFmt(my_copy_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -288,10 +288,10 @@ static void* findCopyFct(void* fct)
}
#define GO(A) \
-static uintptr_t my_free_fct_##A = 0; \
-static void my_free_##A(void* data) \
-{ \
- RunFunction(my_context, my_free_fct_##A, 1, data);\
+static uintptr_t my_free_fct_##A = 0; \
+static void my_free_##A(void* data) \
+{ \
+ RunFunctionFmt(my_free_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -309,10 +309,10 @@ static void* findFreeFct(void* fct)
}
// GSignalAccumulator
#define GO(A) \
-static uintptr_t my_accumulator_fct_##A = 0; \
-static int my_accumulator_##A(void* ihint, void* return_accu, void* handler_return, void* data) \
-{ \
- return RunFunction(my_context, my_accumulator_fct_##A, 4, ihint, return_accu, handler_return, data);\
+static uintptr_t my_accumulator_fct_##A = 0; \
+static int my_accumulator_##A(void* ihint, void* return_accu, void* handler_return, void* data) \
+{ \
+ return RunFunctionFmt(my_accumulator_fct_##A, "pppp", ihint, return_accu, handler_return, data); \
}
SUPER()
#undef GO
@@ -332,10 +332,10 @@ static void* findAccumulatorFct(void* fct)
// GClosureMarshal
#define GO(A) \
-static uintptr_t my_marshal_fct_##A = 0; \
+static uintptr_t my_marshal_fct_##A = 0; \
static void my_marshal_##A(void* closure, void* return_value, uint32_t n, void* values, void* hint, void* data) \
{ \
- RunFunction(my_context, my_marshal_fct_##A, 6, closure, return_value, n, values, hint, data); \
+ RunFunctionFmt(my_marshal_fct_##A, "ppuppp", closure, return_value, n, values, hint, data); \
}
SUPER()
#undef GO
@@ -346,7 +346,7 @@ static void* findMarshalFct(void* fct)
#define GO(A) if(my_marshal_fct_##A == (uintptr_t)fct) return my_marshal_##A;
SUPER()
#undef GO
- #define GO(A) if(my_marshal_fct_##A == 0) {AddAutomaticBridge(thread_get_emu(), my_lib->w.bridge, vFppuppp, my_marshal_##A, 0); my_marshal_fct_##A = (uintptr_t)fct; return my_marshal_##A; }
+ #define GO(A) if(my_marshal_fct_##A == 0) {AddAutomaticBridge(thread_get_emu(), my_lib->w.bridge, vFppuppp, my_marshal_##A, 0, #A); my_marshal_fct_##A = (uintptr_t)fct; return my_marshal_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gobject Closure Marshal callback\n");
@@ -355,10 +355,10 @@ static void* findMarshalFct(void* fct)
// GClosureNotify
#define GO(A) \
-static uintptr_t my_GClosureNotify_fct_##A = 0; \
-static int my_GClosureNotify_func_##A(void* a, void* b) \
-{ \
- return RunFunction(my_context, my_GClosureNotify_fct_##A, 2, a, b);\
+static uintptr_t my_GClosureNotify_fct_##A = 0; \
+static int my_GClosureNotify_func_##A(void* a, void* b) \
+{ \
+ return RunFunctionFmt(my_GClosureNotify_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -378,10 +378,10 @@ static void* findGClosureNotify_Fct(void* fct)
// GValueTransform
#define GO(A) \
-static uintptr_t my_valuetransform_fct_##A = 0; \
-static void my_valuetransform_##A(void* src, void* dst) \
-{ \
- RunFunction(my_context, my_valuetransform_fct_##A, 2, src, dst);\
+static uintptr_t my_valuetransform_fct_##A = 0; \
+static void my_valuetransform_##A(void* src, void* dst) \
+{ \
+ RunFunctionFmt(my_valuetransform_fct_##A, "pp", src, dst); \
}
SUPER()
#undef GO
@@ -401,10 +401,10 @@ static void* findValueTransformFct(void* fct)
// GDestroyFunc ...
#define GO(A) \
-static uintptr_t my_destroyfunc_fct_##A = 0; \
-static int my_destroyfunc_##A(void* a, void* b) \
-{ \
- return RunFunction(my_context, my_destroyfunc_fct_##A, 2, a, b);\
+static uintptr_t my_destroyfunc_fct_##A = 0; \
+static int my_destroyfunc_##A(void* a, void* b) \
+{ \
+ return RunFunctionFmt(my_destroyfunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -424,10 +424,10 @@ static void* findDestroyFct(void* fct)
// GWeakNotify
#define GO(A) \
-static uintptr_t my_weaknotifyfunc_fct_##A = 0; \
-static int my_weaknotifyfunc_##A(void* a, void* b) \
-{ \
- return RunFunction(my_context, my_weaknotifyfunc_fct_##A, 2, a, b);\
+static uintptr_t my_weaknotifyfunc_fct_##A = 0; \
+static int my_weaknotifyfunc_##A(void* a, void* b) \
+{ \
+ return RunFunctionFmt(my_weaknotifyfunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -447,10 +447,10 @@ static void* findWeakNotifyFct(void* fct)
// GCallback (generic function with 6 arguments, hopefully it's enough)
#define GO(A) \
-static uintptr_t my_GCallback_fct_##A = 0; \
-static void* my_GCallback_##A(void* a, void* b, void* c, void* d, void* e, void* f) \
-{ \
- return (void*)RunFunction(my_context, my_GCallback_fct_##A, 6, a, b, c, d, e, f); \
+static uintptr_t my_GCallback_fct_##A = 0; \
+static void* my_GCallback_##A(void* a, void* b, void* c, void* d, void* e, void* f) \
+{ \
+ return (void*)RunFunctionFmt(my_GCallback_fct_##A, "pppppp", a, b, c, d, e, f); \
}
SUPER()
#undef GO
@@ -481,32 +481,32 @@ typedef struct my_GParamSpecTypeInfo_s {
int (*values_cmp) (void* pspec, void* value1, void* value2);
} my_GParamSpecTypeInfo_t;
-#define GO(A) \
+#define GO(A) \
static my_GParamSpecTypeInfo_t my_GParamSpecTypeInfo_##A = {0}; \
static my_GParamSpecTypeInfo_t *ref_GParamSpecTypeInfo_##A = NULL;
SUPER()
#undef GO
// then the static functions callback that may be used with the structure, but dispatch also have a callback...
#define GO(A) \
-static uintptr_t fct_funcs_instance_init_##A = 0; \
-static void my_funcs_instance_init_##A(void* pspec) { \
- RunFunction(my_context, fct_funcs_instance_init_##A, 1, pspec); \
+static uintptr_t fct_funcs_instance_init_##A = 0; \
+static void my_funcs_instance_init_##A(void* pspec) { \
+ RunFunctionFmt(fct_funcs_instance_init_##A, "p", pspec); \
} \
-static uintptr_t fct_funcs_finalize_##A = 0; \
-static void my_funcs_finalize_##A(void* pspec) { \
- RunFunction(my_context, fct_funcs_finalize_##A, 1, pspec); \
+static uintptr_t fct_funcs_finalize_##A = 0; \
+static void my_funcs_finalize_##A(void* pspec) { \
+ RunFunctionFmt(fct_funcs_finalize_##A, "p", pspec); \
} \
-static uintptr_t fct_funcs_value_set_default_##A = 0; \
-static void my_funcs_value_set_default_##A(void* pspec, void* value) { \
- RunFunction(my_context, fct_funcs_value_set_default_##A, 2, pspec, value); \
+static uintptr_t fct_funcs_value_set_default_##A = 0; \
+static void my_funcs_value_set_default_##A(void* pspec, void* value) { \
+ RunFunctionFmt(fct_funcs_value_set_default_##A, "pp", pspec, value); \
} \
-static uintptr_t fct_funcs_value_validate_##A = 0; \
-static int my_funcs_value_validate_##A(void* pspec, void* value) { \
- return (int)RunFunction(my_context, fct_funcs_value_validate_##A, 2, pspec, value); \
+static uintptr_t fct_funcs_value_validate_##A = 0; \
+static int my_funcs_value_validate_##A(void* pspec, void* value) { \
+ return (int)RunFunctionFmt(fct_funcs_value_validate_##A, "pp", pspec, value); \
} \
-static uintptr_t fct_funcs_values_cmp_##A = 0; \
+static uintptr_t fct_funcs_values_cmp_##A = 0; \
static int my_funcs_values_cmp_##A(void* pspec, void* value1, void* value2) { \
- return (int)RunFunction(my_context, fct_funcs_values_cmp_##A, 3, pspec, value1, value2); \
+ return (int)RunFunctionFmt(fct_funcs_values_cmp_##A, "ppp", pspec, value1, value2); \
}
SUPER()
@@ -540,10 +540,10 @@ static my_GParamSpecTypeInfo_t* findFreeGParamSpecTypeInfo(my_GParamSpecTypeInfo
// GInterfaceInitFunc
#define GO(A) \
-static uintptr_t my_GInterfaceInitFunc_fct_##A = 0; \
-static void my_GInterfaceInitFunc_##A(void* src, void* dst) \
-{ \
- RunFunction(my_context, my_GInterfaceInitFunc_fct_##A, 2, src, dst);\
+static uintptr_t my_GInterfaceInitFunc_fct_##A = 0; \
+static void my_GInterfaceInitFunc_##A(void* src, void* dst) \
+{ \
+ RunFunctionFmt(my_GInterfaceInitFunc_fct_##A, "pp", src, dst); \
}
SUPER()
#undef GO
@@ -562,10 +562,10 @@ static void* findGInterfaceInitFuncFct(void* fct)
}
// GInterfaceFinalizeFunc
#define GO(A) \
-static uintptr_t my_GInterfaceFinalizeFunc_fct_##A = 0; \
-static void my_GInterfaceFinalizeFunc_##A(void* src, void* dst) \
-{ \
- RunFunction(my_context, my_GInterfaceFinalizeFunc_fct_##A, 2, src, dst);\
+static uintptr_t my_GInterfaceFinalizeFunc_fct_##A = 0; \
+static void my_GInterfaceFinalizeFunc_##A(void* src, void* dst) \
+{ \
+ RunFunctionFmt(my_GInterfaceFinalizeFunc_fct_##A, "pp", src, dst); \
}
SUPER()
#undef GO
@@ -584,10 +584,10 @@ static void* findGInterfaceFinalizeFuncFct(void* fct)
}
// compare
#define GO(A) \
-static uintptr_t my_compare_fct_##A = 0; \
-static int my_compare_##A(void* a, void* b, void* data) \
-{ \
- return RunFunction(my_context, my_compare_fct_##A, 3, a, b, data); \
+static uintptr_t my_compare_fct_##A = 0; \
+static int my_compare_##A(void* a, void* b, void* data) \
+{ \
+ return RunFunctionFmt(my_compare_fct_##A, "ppp", a, b, data); \
}
SUPER()
#undef GO
@@ -623,7 +623,7 @@ EXPORT int my_g_boxed_type_register_static(x64emu_t* emu, void* name, void* boxe
EXPORT uint32_t my_g_signal_new(x64emu_t* emu, void* name, size_t itype, int flags, uint32_t offset, void* acc, void* accu_data, void* marsh, size_t rtype, uint32_t n, void** b)
{
printf_log(LOG_DEBUG, "g_signal_new for \"%s\", with offset=%d and %d args\n", (const char*)name, offset, n);
-
+
void* cb_acc = findAccumulatorFct(acc);
void* cb_marsh = findMarshalFct(marsh);
my_add_signal_offset(itype, offset, n); // register the signal for later use
@@ -644,7 +644,7 @@ EXPORT uint32_t my_g_signal_new(x64emu_t* emu, void* name, size_t itype, int fla
EXPORT uint32_t my_g_signal_newv(x64emu_t* emu, void* name, size_t itype, int flags, void* closure, void* acc, void* accu_data, void* marsh, size_t rtype, uint32_t n, void* types)
{
printf_log(LOG_DEBUG, "g_signal_newv for \"%s\", with %d args\n", (const char*)name, n);
-
+
return my->g_signal_newv(name, itype, flags, closure, findAccumulatorFct(acc), accu_data, findMarshalFct(marsh), rtype, n, types);
}
@@ -732,7 +732,7 @@ EXPORT void my_g_value_register_transform_func(x64emu_t* emu, size_t src, size_t
static int my_signal_emission_hook(void* ihint, uint32_t n, void* values, my_signal_t* sig)
{
printf_log(LOG_DEBUG, "gobject2 Signal Emission Hook called, sig=%p\n", sig);
- return (int)RunFunction(my_context, sig->c_handler, 4, ihint, n, values, sig->data);
+ return (int)RunFunctionFmt(sig->c_handler, "pupp", ihint, n, values, sig->data);
}
EXPORT unsigned long my_g_signal_add_emission_hook(x64emu_t* emu, uint32_t signal, void* detail, void* f, void* data, void* notify)
{
@@ -745,7 +745,7 @@ EXPORT unsigned long my_g_signal_add_emission_hook(x64emu_t* emu, uint32_t signa
return my->g_signal_add_emission_hook(signal, detail, my_signal_emission_hook, sig, my_signal_delete);
}
-EXPORT size_t my_g_type_register_static_simple(x64emu_t* emu, size_t parent, void* name, size_t class_size, void* class_init, size_t instance_size, void* instance_init, int flags)
+EXPORT size_t my_g_type_register_static_simple(x64emu_t* emu, size_t parent, void* name, uint32_t class_size, void* class_init, uint32_t instance_size, void* instance_init, uint32_t flags)
{
//gobject2_my_t *my = (gobject2_my_t*)my_lib->w.p2;
@@ -821,7 +821,7 @@ EXPORT void my_g_signal_emit_valist(x64emu_t* emu, void* inst, uint32_t id, void
my->g_signal_emit_valist(inst, id, quark, VARARGS);
}
-EXPORT void my_g_signal_emit(x64emu_t* emu, void* inst, uint32_t id, void* quark, x64_va_list_t b)
+EXPORT void my_g_signal_emit(x64emu_t* emu, void* inst, uint32_t id, void* quark, uintptr_t* b)
{
CREATE_VALIST_FROM_VAARG(b, emu->scratch, 3);
my->g_signal_emit_valist(inst, id, quark, VARARGS);
diff --git a/src/wrapped/wrappedgobject2_private.h b/src/wrapped/wrappedgobject2_private.h
index 4d74c45..b81d036 100755..100644
--- a/src/wrapped/wrappedgobject2_private.h
+++ b/src/wrapped/wrappedgobject2_private.h
@@ -8,15 +8,15 @@
//GO(_fini,
GO(g_array_get_type, LFv)
GO(g_binding_flags_get_type, LFv)
-//GO(g_binding_get_flags,
+GO(g_binding_get_flags, uFp)
//GO(g_binding_get_source,
//GO(g_binding_get_source_property,
//GO(g_binding_get_target,
-//GO(g_binding_get_target_property,
+GO(g_binding_get_target_property, pFp)
GO(g_binding_get_type, LFv)
-//GO(g_binding_unbind,
-GO(g_boxed_copy, pFip)
-GO(g_boxed_free, vFip)
+GO(g_binding_unbind, vFp)
+GO(g_boxed_copy, pFLp)
+GO(g_boxed_free, vFLp)
GOM(g_boxed_type_register_static, LFEppp)
GO(g_byte_array_get_type, LFv)
GO(g_bytes_get_type, LFv)
@@ -96,10 +96,10 @@ GO(g_enum_get_value_by_nick, pFpp)
GO(g_enum_register_static, LFpp)
GO(g_error_get_type, LFv)
GO(g_flags_complete_type_info, vFipp)
-GO(g_flags_get_first_value, pFpi)
+GO(g_flags_get_first_value, pFpu)
GO(g_flags_get_value_by_name, pFpp)
GO(g_flags_get_value_by_nick, pFpp)
-GO(g_flags_register_static, iFpp)
+GO(g_flags_register_static, LFpp)
GO(g_gstring_get_type, LFv)
GO(g_gtype_get_type, LFv)
GO(g_hash_table_get_type, LFv)
@@ -114,7 +114,7 @@ GO(g_markup_parse_context_get_type, LFv)
GO(g_match_info_get_type, LFv)
//GOM(g_object_add_toggle_ref, vFEpBp)
GO(g_object_add_weak_pointer, vFpp)
-//GO(g_object_bind_property,
+GO(g_object_bind_property, pFppppu)
//GO(g_object_bind_property_full,
//GO(g_object_bind_property_with_closures,
GO(g_object_class_find_property, pFpp)
@@ -122,7 +122,7 @@ GOM(g_object_class_install_properties, vFEpup)
GO(g_object_class_install_property, vFpup)
GO(g_object_class_list_properties, pFpp)
GO(g_object_class_override_property, vFpup)
-//GO(g_object_compat_control,
+GO(g_object_compat_control, LFLp)
GOM(g_object_connect, pFEppV)
GO(g_object_disconnect, vFpppppppppppppppp) // caarg
//GOM(g_object_dup_data, pFEppBp)
@@ -155,11 +155,11 @@ GOM(g_object_set, vFEppV)
GO(g_object_set_data, vFppp)
GOM(g_object_set_data_full, vFEpppp)
GO(g_object_set_property, vFppp)
-GO(g_object_set_qdata, vFppp)
+GO(g_object_set_qdata, vFpup)
GOM(g_object_set_qdata_full, vFEpppp)
GOM(g_object_set_valist, vFEppA)
GO(g_object_steal_data, pFpp)
-GO(g_object_steal_qdata, pFpp)
+GO(g_object_steal_qdata, pFpu)
GO(g_object_thaw_notify, vFp)
GO(g_object_unref, vFp)
GO(g_object_watch_closure, vFpp)
@@ -169,8 +169,8 @@ GO(g_param_spec_boolean, pFpppii)
GO(g_param_spec_boxed, pFpppLi)
GO(g_param_spec_char, pFpppccci)
GO(g_param_spec_double, pFpppdddi)
-GO(g_param_spec_enum, pFpppiii)
-GO(g_param_spec_flags, pFpppiui)
+GO(g_param_spec_enum, pFpppLii)
+GO(g_param_spec_flags, pFpppLui)
GO(g_param_spec_float, pFpppfffi)
GO(g_param_spec_get_blurb, pFp)
GO(g_param_spec_get_default_value, pFp)
@@ -178,19 +178,19 @@ GO(g_param_spec_get_name, pFp)
GO(g_param_spec_get_nick, pFp)
GO(g_param_spec_get_qdata, pFpu)
GO(g_param_spec_get_redirect_target, pFp)
-GO(g_param_spec_gtype, pFpppii)
+GO(g_param_spec_gtype, pFpppLi)
GO(g_param_spec_int, pFpppiiii)
-GO(g_param_spec_int64, pFpppIIIi)
-GO(g_param_spec_internal, pFipppu)
+GO(g_param_spec_int64, pFpppllli)
+GO(g_param_spec_internal, pFLpppi)
GO(g_param_spec_long, pFpppllli)
GO(g_param_spec_object, pFpppii)
GO(g_param_spec_override, pFpp)
GO(g_param_spec_param, pFpppii)
GO(g_param_spec_pointer, pFpppi)
-GO(g_param_spec_pool_insert, vFppi)
-GO(g_param_spec_pool_list, pFpip)
-GO(g_param_spec_pool_list_owned, pFpi)
-GO(g_param_spec_pool_lookup, pFppii)
+GO(g_param_spec_pool_insert, vFppL)
+GO(g_param_spec_pool_list, pFpLp)
+GO(g_param_spec_pool_list_owned, pFpL)
+GO(g_param_spec_pool_lookup, pFppLi)
GO(g_param_spec_pool_new, pFi)
GO(g_param_spec_pool_remove, vFpp)
GO(g_param_spec_ref, pFp)
@@ -203,7 +203,7 @@ GO(g_param_spec_string, pFppppi)
DATA(g_param_spec_types, sizeof(void*))
GO(g_param_spec_uchar, pFpppCCCi)
GO(g_param_spec_uint, pFpppuuui)
-GO(g_param_spec_uint64, pFpppUUUi)
+GO(g_param_spec_uint64, pFpppLLLi)
GO(g_param_spec_ulong, pFpppLLLi)
GO(g_param_spec_unichar, pFpppui)
GO(g_param_spec_unref, vFp)
@@ -215,7 +215,7 @@ GO(g_param_value_defaults, iFpp)
GO(g_param_values_cmp, iFppp)
GO(g_param_value_set_default, vFpp)
GO(g_param_value_validate, iFpp)
-//GO(g_pointer_type_register_static,
+GO(g_pointer_type_register_static, LFp)
//GO(g_pollfd_get_type,
//GO(g_ptr_array_get_type,
//GO(g_regex_get_type,
@@ -242,9 +242,9 @@ GOM(g_signal_handlers_block_matched, uFEpiupppp)
GOM(g_signal_handlers_disconnect_matched, uFEpiupppp)
GOM(g_signal_handlers_unblock_matched, uFEpiupppp)
GO(g_signal_handler_unblock, vFpL)
-GO(g_signal_has_handler_pending, iFpupi)
-GO(g_signal_list_ids, pFip)
-GO(g_signal_lookup, uFpi)
+GO(g_signal_has_handler_pending, iFpuui)
+GO(g_signal_list_ids, pFLp)
+GO(g_signal_lookup, uFpL)
GO(g_signal_name, pFu)
GOM(g_signal_new, uFEpLiupppLuV)
//GOM(g_signal_new_class_handler, uFEpLupppppnV)
@@ -254,9 +254,9 @@ GO(g_signal_override_class_closure, vFuLp)
GOM(g_signal_override_class_handler, vFEppp)
GO(g_signal_parse_name, iFpLppi)
GO(g_signal_query, vFup)
-GO(g_signal_remove_emission_hook, vFpL)
+GO(g_signal_remove_emission_hook, vFuL)
//GOM(g_signal_set_va_marshaller, vFEuiB)
-GO(g_signal_stop_emission, vFpup)
+GO(g_signal_stop_emission, vFpuu)
GO(g_signal_stop_emission_by_name, vFpp)
GO(g_signal_type_cclosure_new, pFLu) //should wrap?
GO(g_source_get_type, LFv)
@@ -267,46 +267,46 @@ GO(g_strv_get_type, LFv)
GO(g_thread_get_type, LFv)
GO(g_time_zone_get_type, LFv)
//GOM(g_type_add_class_cache_func, vFEpB)
-GO(g_type_add_class_private, vFpLu)
-//GO(g_type_add_instance_private,
+GO(g_type_add_class_private, vFLL)
+GO(g_type_add_instance_private, iFLL)
//GOM(g_type_add_interface_check, vFEpB)
//GOM(g_type_add_interface_dynamic, vFEiip)
GOM(g_type_add_interface_static, vFELLp)
GO(g_type_check_class_cast, pFpL)
-GO(g_type_check_class_is_a, LFpL)
-GO(g_type_check_instance, LFp)
+GO(g_type_check_class_is_a, iFpL)
+GO(g_type_check_instance, iFp)
GO(g_type_check_instance_cast, pFpL)
GO(g_type_check_instance_is_a, LFpL)
-GO(g_type_check_instance_is_fundamentally_a, LFpL)
-GO(g_type_check_is_value_type, LFp)
+GO(g_type_check_instance_is_fundamentally_a, iFpL)
+GO(g_type_check_is_value_type, iFL)
GO(g_type_check_value, LFp)
-GO(g_type_check_value_holds, LFpL)
+GO(g_type_check_value_holds, iFpL)
GO(g_type_children, pFip)
-GO(g_type_class_add_private, vFpu)
+GO(g_type_class_add_private, vFpL)
GO(g_type_class_adjust_private_offset, vFpp)
GO(g_type_class_get_instance_private_offset, iFp)
-GO(g_type_class_get_private, pFpi)
+GO(g_type_class_get_private, pFpL)
GO(g_type_class_peek, pFi)
GOM(g_type_class_peek_parent, pFEp)
GO(g_type_class_peek_static, pFi)
GO(g_type_class_ref, pFp)
GO(g_type_class_unref, vFp)
GO(g_type_class_unref_uncached, vFp)
-GO(g_type_create_instance, pFi)
-GO(g_type_default_interface_peek, pFi)
+GO(g_type_create_instance, pFL)
+GO(g_type_default_interface_peek, pFL)
GO(g_type_default_interface_ref, pFi)
GO(g_type_default_interface_unref, vFp)
-GO(g_type_depth, uFi)
+GO(g_type_depth, uFL)
GO(g_type_ensure, vFi)
GO(g_type_free_instance, vFp)
GO(g_type_from_name, iFp)
-GO(g_type_fundamental, iFi)
+GO(g_type_fundamental, LFL)
GO(g_type_fundamental_next, iFv)
//GOM(g_type_get_plugin, pFEi) // GTypePugin is a stuct with callback
-GO(g_type_get_qdata, pFip)
+GO(g_type_get_qdata, pFLu)
GO(g_type_get_type_registration_serial, uFv)
GO(g_type_init, vFv)
-GO(g_type_init_with_debug_flags, vFi)
+GO(g_type_init_with_debug_flags, vFu)
GO(g_type_instance_get_private, pFpL)
GO(g_type_interface_add_prerequisite, vFLL)
//GOM(g_type_interface_get_plugin, pFEii) // return GTypePlugin*
@@ -317,31 +317,31 @@ GO(g_type_interfaces, pFLp)
GO(g_type_is_a, iFLL)
//GO(g_type_module_add_interface,
//GO(g_type_module_get_type,
-//GO(g_type_module_register_enum,
-//GO(g_type_module_register_flags,
+GO(g_type_module_register_enum, LFppp)
+GO(g_type_module_register_flags, LFppp)
//GO(g_type_module_register_type,
-//GO(g_type_module_set_name,
-//GO(g_type_module_unuse,
-//GO(g_type_module_use,
+GO(g_type_module_set_name, vFpp)
+GO(g_type_module_unuse, vFp)
+GO(g_type_module_use, iFp)
GO(g_type_name, pFL)
-//GO(g_type_name_from_class,
-//GO(g_type_name_from_instance,
+GO(g_type_name_from_class, pFp)
+GO(g_type_name_from_instance, pFp)
GO(g_type_next_base, LFLL)
GO(g_type_parent, LFL)
//GO(g_type_plugin_complete_interface_info,
//GO(g_type_plugin_complete_type_info,
//GO(g_type_plugin_get_type,
-//GO(g_type_plugin_unuse,
+GO(g_type_plugin_unuse, vFp)
//GO(g_type_plugin_use,
-GO(g_type_qname, pFL)
+GO(g_type_qname, uFL)
GO(g_type_query, vFLp)
//GOM(type_register_dynamic, iFEpippi)
GOM(g_type_register_fundamental, LFELpppi)
GOM(g_type_register_static, LFELppi)
-GOM(g_type_register_static_simple, LFELpLpLpi)
+GOM(g_type_register_static_simple, LFELpupupu)
//GOM(g_type_remove_class_cache_func, vFEpB)
//GOM(g_type_remove_interface_check, vFEpB)
-GO(g_type_set_qdata, vFLpp)
+GO(g_type_set_qdata, vFLup)
GO(g_type_test_flags, iFLu)
GOM(g_type_value_table_peek, pFEL) //need to bridge GTypeValueTable
GO(g_value_array_append, pFpp) //TODO: does GValueArray needs alignement?
@@ -369,9 +369,9 @@ GO(g_value_get_double, dFp)
GO(g_value_get_enum, iFp)
GO(g_value_get_flags, uFp)
GO(g_value_get_float, fFp)
-GO(g_value_get_gtype, iFp)
+GO(g_value_get_gtype, LFp)
GO(g_value_get_int, iFp)
-GO(g_value_get_int64, IFp)
+GO(g_value_get_int64, lFp)
GO(g_value_get_long, lFp)
GO(g_value_get_object, pFp)
GO(g_value_get_param, pFp)
@@ -381,10 +381,10 @@ GO(g_value_get_string, pFp)
GO(g_value_get_type, LFv)
GO(g_value_get_uchar, CFp)
GO(g_value_get_uint, uFp)
-GO(g_value_get_uint64, UFp)
+GO(g_value_get_uint64, LFp)
GO(g_value_get_ulong, LFp)
GO(g_value_get_variant, pFp)
-GO(g_value_init, pFpi)
+GO(g_value_init, pFpL)
GO(g_value_init_from_instance, vFpp)
GO(g_value_peek_pointer, pFp)
GOM(g_value_register_transform_func, vFEiip)
@@ -397,10 +397,10 @@ GO(g_value_set_double, vFpd)
GO(g_value_set_enum, vFpi)
GO(g_value_set_flags, vFpu)
GO(g_value_set_float, vFpf)
-GO(g_value_set_gtype, vFpi)
+GO(g_value_set_gtype, vFpL)
GO(g_value_set_instance, vFpp)
GO(g_value_set_int, vFpi)
-GO(g_value_set_int64, vFpI)
+GO(g_value_set_int64, vFpl)
GO(g_value_set_long, vFpl)
GO(g_value_set_object, vFpp)
GO(g_value_set_object_take_ownership, vFpp)
@@ -414,7 +414,7 @@ GO(g_value_set_string, vFpp)
GO(g_value_set_string_take_ownership, vFpp)
GO(g_value_set_uchar, vFpC)
GO(g_value_set_uint, vFpu)
-GO(g_value_set_uint64, vFpU)
+GO(g_value_set_uint64, vFpL)
GO(g_value_set_ulong, vFpL)
GO(g_value_set_variant, vFpp)
GO(g_value_take_boxed, vFpp)
@@ -424,7 +424,7 @@ GO(g_value_take_string, vFpp)
GO(g_value_take_variant, vFpp)
GO(g_value_transform, iFpp)
GO(g_value_type_compatible, iFii)
-GO(g_value_type_transformable, iFii)
+GO(g_value_type_transformable, iFLL)
GO(g_value_unset, vFp)
//GO(g_variant_builder_get_type,
//GO(g_variant_dict_get_type,
diff --git a/src/wrapped/wrappedgomp.c b/src/wrapped/wrappedgomp.c
new file mode 100644
index 0000000..650da53
--- /dev/null
+++ b/src/wrapped/wrappedgomp.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+
+const char* gompName = "libgomp.so.1";
+#define LIBNAME gomp
+
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedgomp_private.h b/src/wrapped/wrappedgomp_private.h
new file mode 100644
index 0000000..33b1970
--- /dev/null
+++ b/src/wrapped/wrappedgomp_private.h
@@ -0,0 +1,477 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error meh!
+#endif
+//GO(acc_async_test,
+//GO(acc_async_test_all,
+//GO(acc_async_test_all_h_,
+//GO(acc_async_test_h_,
+//GO(acc_async_wait,
+//GO(acc_async_wait_all,
+//GO(acc_attach,
+//GO(acc_attach_async,
+//GO(acc_copyin,
+//GO(acc_copyin_32_h_,
+//GO(acc_copyin_64_h_,
+//GO(acc_copyin_array_h_,
+//GO(acc_copyin_async,
+//GO(acc_copyin_async_32_h_,
+//GO(acc_copyin_async_64_h_,
+//GO(acc_copyin_async_array_h_,
+//GO(acc_copyout,
+//GO(acc_copyout_32_h_,
+//GO(acc_copyout_64_h_,
+//GO(acc_copyout_array_h_,
+//GO(acc_copyout_async,
+//GO(acc_copyout_async_32_h_,
+//GO(acc_copyout_async_64_h_,
+//GO(acc_copyout_async_array_h_,
+//GO(acc_copyout_finalize,
+//GO(acc_copyout_finalize_32_h_,
+//GO(acc_copyout_finalize_64_h_,
+//GO(acc_copyout_finalize_array_h_,
+//GO(acc_copyout_finalize_async,
+//GO(acc_create,
+//GO(acc_create_32_h_,
+//GO(acc_create_64_h_,
+//GO(acc_create_array_h_,
+//GO(acc_create_async,
+//GO(acc_create_async_32_h_,
+//GO(acc_create_async_64_h_,
+//GO(acc_create_async_array_h_,
+//GO(acc_delete,
+//GO(acc_delete_32_h_,
+//GO(acc_delete_64_h_,
+//GO(acc_delete_array_h_,
+//GO(acc_delete_async,
+//GO(acc_delete_async_32_h_,
+//GO(acc_delete_async_64_h_,
+//GO(acc_delete_async_array_h_,
+//GO(acc_delete_finalize,
+//GO(acc_delete_finalize_32_h_,
+//GO(acc_delete_finalize_64_h_,
+//GO(acc_delete_finalize_array_h_,
+//GO(acc_delete_finalize_async,
+//GO(acc_detach,
+//GO(acc_detach_async,
+//GO(acc_detach_finalize,
+//GO(acc_detach_finalize_async,
+//GO(acc_deviceptr,
+//GO(acc_free,
+//GO(acc_get_cuda_stream,
+//GO(acc_get_current_cuda_context,
+//GO(acc_get_current_cuda_device,
+//GO(acc_get_device_num,
+//GO(acc_get_device_num_h_,
+//GO(acc_get_device_type,
+//GO(acc_get_device_type_h_,
+//GO(acc_get_num_devices,
+//GO(acc_get_num_devices_h_,
+//GO(acc_get_property,
+//GO(acc_get_property_h_,
+//GO(acc_get_property_string,
+//GO(acc_get_property_string_h_,
+//GO(acc_hostptr,
+//GO(acc_init,
+//GO(acc_init_h_,
+//GO(acc_is_present,
+//GO(acc_is_present_32_h_,
+//GO(acc_is_present_64_h_,
+//GO(acc_is_present_array_h_,
+//GO(acc_malloc,
+//GO(acc_map_data,
+//GO(acc_memcpy_from_device,
+//GO(acc_memcpy_from_device_async,
+//GO(acc_memcpy_to_device,
+//GO(acc_memcpy_to_device_async,
+//GO(acc_on_device,
+//GO(acc_on_device_h_,
+//GO(acc_pcopyin,
+//GO(acc_pcreate,
+//GO(acc_present_or_copyin,
+//GO(acc_present_or_copyin_32_h_,
+//GO(acc_present_or_copyin_64_h_,
+//GO(acc_present_or_copyin_array_h_,
+//GO(acc_present_or_create,
+//GO(acc_present_or_create_32_h_,
+//GO(acc_present_or_create_64_h_,
+//GO(acc_present_or_create_array_h_,
+//GO(acc_prof_lookup,
+//GO(acc_prof_register,
+//GO(acc_prof_unregister,
+//GO(acc_register_library,
+//GO(acc_set_cuda_stream,
+//GO(acc_set_device_num,
+//GO(acc_set_device_num_h_,
+//GO(acc_set_device_type,
+//GO(acc_set_device_type_h_,
+//GO(acc_shutdown,
+//GO(acc_shutdown_h_,
+//GO(acc_unmap_data,
+//GO(acc_update_device,
+//GO(acc_update_device_32_h_,
+//GO(acc_update_device_64_h_,
+//GO(acc_update_device_array_h_,
+//GO(acc_update_device_async,
+//GO(acc_update_device_async_32_h_,
+//GO(acc_update_device_async_64_h_,
+//GO(acc_update_device_async_array_h_,
+//GO(acc_update_self,
+//GO(acc_update_self_32_h_,
+//GO(acc_update_self_64_h_,
+//GO(acc_update_self_array_h_,
+//GO(acc_update_self_async,
+//GO(acc_update_self_async_32_h_,
+//GO(acc_update_self_async_64_h_,
+//GO(acc_update_self_async_array_h_,
+//GO(acc_wait,
+//GO(acc_wait_all,
+//GO(acc_wait_all_async,
+//GO(acc_wait_all_async_h_,
+//GO(acc_wait_all_h_,
+//GO(acc_wait_async,
+//GO(acc_wait_async_h_,
+//GO(acc_wait_h_,
+
+//GO(GOMP_alloc,
+//GO(GOMP_atomic_end,
+//GO(GOMP_atomic_start,
+//GO(GOMP_barrier,
+//GO(GOMP_barrier_cancel,
+//GO(GOMP_cancel,
+//GO(GOMP_cancellation_point,
+//GO(GOMP_critical_end,
+//GO(GOMP_critical_name_end,
+//GO(GOMP_critical_name_start,
+//GO(GOMP_critical_start,
+//GO(GOMP_doacross_post,
+//GO(GOMP_doacross_ull_post,
+//GO(GOMP_doacross_ull_wait,
+//GO(GOMP_doacross_wait,
+//GO(GOMP_error,
+//GO(GOMP_free,
+//GO(GOMP_loop_doacross_dynamic_start,
+//GO(GOMP_loop_doacross_guided_start,
+//GO(GOMP_loop_doacross_runtime_start,
+//GO(GOMP_loop_doacross_start,
+//GO(GOMP_loop_doacross_static_start,
+//GO(GOMP_loop_dynamic_next,
+//GO(GOMP_loop_dynamic_start,
+//GO(GOMP_loop_end,
+//GO(GOMP_loop_end_cancel,
+//GO(GOMP_loop_end_nowait,
+//GO(GOMP_loop_guided_next,
+//GO(GOMP_loop_guided_start,
+//GO(GOMP_loop_maybe_nonmonotonic_runtime_next,
+//GO(GOMP_loop_maybe_nonmonotonic_runtime_start,
+//GO(GOMP_loop_nonmonotonic_dynamic_next,
+//GO(GOMP_loop_nonmonotonic_dynamic_start,
+//GO(GOMP_loop_nonmonotonic_guided_next,
+//GO(GOMP_loop_nonmonotonic_guided_start,
+//GO(GOMP_loop_nonmonotonic_runtime_next,
+//GO(GOMP_loop_nonmonotonic_runtime_start,
+//GO(GOMP_loop_ordered_dynamic_next,
+//GO(GOMP_loop_ordered_dynamic_start,
+//GO(GOMP_loop_ordered_guided_next,
+//GO(GOMP_loop_ordered_guided_start,
+//GO(GOMP_loop_ordered_runtime_next,
+//GO(GOMP_loop_ordered_runtime_start,
+//GO(GOMP_loop_ordered_start,
+//GO(GOMP_loop_ordered_static_next,
+//GO(GOMP_loop_ordered_static_start,
+//GO(GOMP_loop_runtime_next,
+//GO(GOMP_loop_runtime_start,
+//GO(GOMP_loop_start,
+//GO(GOMP_loop_static_next,
+//GO(GOMP_loop_static_start,
+//GO(GOMP_loop_ull_doacross_dynamic_start,
+//GO(GOMP_loop_ull_doacross_guided_start,
+//GO(GOMP_loop_ull_doacross_runtime_start,
+//GO(GOMP_loop_ull_doacross_start,
+//GO(GOMP_loop_ull_doacross_static_start,
+//GO(GOMP_loop_ull_dynamic_next,
+//GO(GOMP_loop_ull_dynamic_start,
+//GO(GOMP_loop_ull_guided_next,
+//GO(GOMP_loop_ull_guided_start,
+//GO(GOMP_loop_ull_maybe_nonmonotonic_runtime_next,
+//GO(GOMP_loop_ull_maybe_nonmonotonic_runtime_start,
+//GO(GOMP_loop_ull_nonmonotonic_dynamic_next,
+//GO(GOMP_loop_ull_nonmonotonic_dynamic_start,
+//GO(GOMP_loop_ull_nonmonotonic_guided_next,
+//GO(GOMP_loop_ull_nonmonotonic_guided_start,
+//GO(GOMP_loop_ull_nonmonotonic_runtime_next,
+//GO(GOMP_loop_ull_nonmonotonic_runtime_start,
+//GO(GOMP_loop_ull_ordered_dynamic_next,
+//GO(GOMP_loop_ull_ordered_dynamic_start,
+//GO(GOMP_loop_ull_ordered_guided_next,
+//GO(GOMP_loop_ull_ordered_guided_start,
+//GO(GOMP_loop_ull_ordered_runtime_next,
+//GO(GOMP_loop_ull_ordered_runtime_start,
+//GO(GOMP_loop_ull_ordered_start,
+//GO(GOMP_loop_ull_ordered_static_next,
+//GO(GOMP_loop_ull_ordered_static_start,
+//GO(GOMP_loop_ull_runtime_next,
+//GO(GOMP_loop_ull_runtime_start,
+//GO(GOMP_loop_ull_start,
+//GO(GOMP_loop_ull_static_next,
+//GO(GOMP_loop_ull_static_start,
+//GO(GOMP_offload_register,
+//GO(GOMP_offload_register_ver,
+//GO(GOMP_offload_unregister,
+//GO(GOMP_offload_unregister_ver,
+//GO(GOMP_ordered_end,
+//GO(GOMP_ordered_start,
+//GO(GOMP_parallel,
+//GO(GOMP_parallel_end,
+//GO(GOMP_parallel_loop_dynamic,
+//GO(GOMP_parallel_loop_dynamic_start,
+//GO(GOMP_parallel_loop_guided,
+//GO(GOMP_parallel_loop_guided_start,
+//GO(GOMP_parallel_loop_maybe_nonmonotonic_runtime,
+//GO(GOMP_parallel_loop_nonmonotonic_dynamic,
+//GO(GOMP_parallel_loop_nonmonotonic_guided,
+//GO(GOMP_parallel_loop_nonmonotonic_runtime,
+//GO(GOMP_parallel_loop_runtime,
+//GO(GOMP_parallel_loop_runtime_start,
+//GO(GOMP_parallel_loop_static,
+//GO(GOMP_parallel_loop_static_start,
+//GO(GOMP_parallel_reductions,
+//GO(GOMP_parallel_sections,
+//GO(GOMP_parallel_sections_start,
+//GO(GOMP_parallel_start,
+//GO(GOMP_PLUGIN_acc_default_dim,
+//GO(GOMP_PLUGIN_acc_thread,
+//GO(GOMP_PLUGIN_async_unmap_vars,
+//GO(GOMP_PLUGIN_debug,
+//GO(GOMP_PLUGIN_error,
+//GO(GOMP_PLUGIN_fatal,
+//GO(GOMP_PLUGIN_goacc_profiling_dispatch,
+//GO(GOMP_PLUGIN_goacc_thread,
+//GO(GOMP_PLUGIN_malloc,
+//GO(GOMP_PLUGIN_malloc_cleared,
+//GO(GOMP_PLUGIN_realloc,
+//GO(GOMP_PLUGIN_target_rev,
+//GO(GOMP_PLUGIN_target_task_completion,
+//GO(GOMP_scope_start,
+//GO(GOMP_sections2_start,
+//GO(GOMP_sections_end,
+//GO(GOMP_sections_end_cancel,
+//GO(GOMP_sections_end_nowait,
+//GO(GOMP_sections_next,
+//GO(GOMP_sections_start,
+//GO(GOMP_single_copy_end,
+//GO(GOMP_single_copy_start,
+//GO(GOMP_single_start,
+//GO(GOMP_target,
+//GO(GOMP_target_data,
+//GO(GOMP_target_data_ext,
+//GO(GOMP_target_end_data,
+//GO(GOMP_target_enter_exit_data,
+//GO(GOMP_target_ext,
+//GO(GOMP_target_update,
+//GO(GOMP_target_update_ext,
+//GO(GOMP_task,
+//GO(GOMP_taskgroup_end,
+//GO(GOMP_taskgroup_reduction_register,
+//GO(GOMP_taskgroup_reduction_unregister,
+//GO(GOMP_taskgroup_start,
+//GO(GOMP_taskloop,
+//GO(GOMP_taskloop_ull,
+//GO(GOMP_task_reduction_remap,
+//GO(GOMP_taskwait,
+//GO(GOMP_taskwait_depend,
+//GO(GOMP_taskwait_depend_nowait,
+//GO(GOMP_taskyield,
+//GO(GOMP_teams,
+//GO(GOMP_teams4,
+//GO(GOMP_teams_reg,
+//GO(GOMP_warning,
+//GO(GOMP_workshare_task_reduction_unregister,
+
+//GO(omp_aligned_alloc,
+//GO(omp_aligned_calloc,
+//GO(omp_alloc,
+//GO(omp_calloc,
+//GO(omp_capture_affinity,
+//GO(omp_capture_affinity_,
+//GO(omp_destroy_allocator,
+//GO(omp_destroy_allocator_,
+//GO(omp_destroy_lock@OMP_1.0
+//GO(omp_destroy_lock,
+//GO(omp_destroy_lock_,
+//GO(omp_destroy_lock_@OMP_1.0
+//GO(omp_destroy_nest_lock@OMP_1.0
+//GO(omp_destroy_nest_lock,
+//GO(omp_destroy_nest_lock_,
+//GO(omp_destroy_nest_lock_@OMP_1.0
+//GO(omp_display_affinity,
+//GO(omp_display_affinity_,
+//GO(omp_display_env,
+//GO(omp_display_env_,
+//GO(omp_display_env_8_,
+//GO(omp_free,
+//GO(omp_fulfill_event,
+//GO(omp_fulfill_event_,
+//GO(omp_get_active_level,
+//GO(omp_get_active_level_,
+//GO(omp_get_affinity_format,
+//GO(omp_get_affinity_format_,
+//GO(omp_get_ancestor_thread_num,
+//GO(omp_get_ancestor_thread_num_,
+//GO(omp_get_ancestor_thread_num_8_,
+//GO(omp_get_cancellation,
+//GO(omp_get_cancellation_,
+//GO(omp_get_default_allocator,
+//GO(omp_get_default_allocator_,
+//GO(omp_get_default_device,
+//GO(omp_get_default_device_,
+//GO(omp_get_device_num,
+//GO(omp_get_device_num_,
+//GO(omp_get_dynamic,
+//GO(omp_get_dynamic_,
+//GO(omp_get_initial_device,
+//GO(omp_get_initial_device_,
+//GO(omp_get_level,
+//GO(omp_get_level_,
+//GO(omp_get_mapped_ptr,
+//GO(omp_get_max_active_levels,
+//GO(omp_get_max_active_levels_,
+//GO(omp_get_max_task_priority,
+//GO(omp_get_max_task_priority_,
+//GO(omp_get_max_teams,
+//GO(omp_get_max_teams_,
+//GO(omp_get_max_threads,
+//GO(omp_get_max_threads_,
+//GO(omp_get_nested,
+//GO(omp_get_nested_,
+//GO(omp_get_num_devices,
+//GO(omp_get_num_devices_,
+//GO(omp_get_num_places,
+//GO(omp_get_num_places_,
+//GO(omp_get_num_procs,
+//GO(omp_get_num_procs_,
+//GO(omp_get_num_teams,
+//GO(omp_get_num_teams_,
+//GO(omp_get_num_threads,
+//GO(omp_get_num_threads_,
+//GO(omp_get_partition_num_places,
+//GO(omp_get_partition_num_places_,
+//GO(omp_get_partition_place_nums,
+//GO(omp_get_partition_place_nums_,
+//GO(omp_get_partition_place_nums_8_,
+//GO(omp_get_place_num,
+//GO(omp_get_place_num_,
+//GO(omp_get_place_num_procs,
+//GO(omp_get_place_num_procs_,
+//GO(omp_get_place_num_procs_8_,
+//GO(omp_get_place_proc_ids,
+//GO(omp_get_place_proc_ids_,
+//GO(omp_get_place_proc_ids_8_,
+//GO(omp_get_proc_bind,
+//GO(omp_get_proc_bind_,
+//GO(omp_get_schedule,
+//GO(omp_get_schedule_,
+//GO(omp_get_schedule_8_,
+//GO(omp_get_supported_active_levels,
+//GO(omp_get_supported_active_levels_,
+//GO(omp_get_team_num,
+//GO(omp_get_team_num_,
+//GO(omp_get_team_size,
+//GO(omp_get_team_size_,
+//GO(omp_get_team_size_8_,
+//GO(omp_get_teams_thread_limit,
+//GO(omp_get_teams_thread_limit_,
+//GO(omp_get_thread_limit,
+//GO(omp_get_thread_limit_,
+//GO(omp_get_thread_num,
+//GO(omp_get_thread_num_,
+//GO(omp_get_wtick,
+//GO(omp_get_wtick_,
+//GO(omp_get_wtime,
+//GO(omp_get_wtime_,
+//GO(omp_in_explicit_task,
+//GO(omp_in_explicit_task_,
+//GO(omp_in_final,
+//GO(omp_in_final_,
+//GO(omp_init_allocator,
+//GO(omp_init_allocator_,
+//GO(omp_init_allocator_8_,
+//GO(omp_init_lock,
+//GO(omp_init_lock@OMP_1.0
+//GO(omp_init_lock_,
+//GO(omp_init_lock_@OMP_1.0
+//GO(omp_init_nest_lock,
+//GO(omp_init_nest_lock@OMP_1.0
+//GO(omp_init_nest_lock_,
+//GO(omp_init_nest_lock_@OMP_1.0
+//GO(omp_in_parallel,
+//GO(omp_in_parallel_,
+//GO(omp_is_initial_device,
+//GO(omp_is_initial_device_,
+//GO(omp_pause_resource,
+//GO(omp_pause_resource_,
+//GO(omp_pause_resource_all,
+//GO(omp_pause_resource_all_,
+//GO(omp_realloc,
+//GO(omp_set_affinity_format,
+//GO(omp_set_affinity_format_,
+//GO(omp_set_default_allocator,
+//GO(omp_set_default_allocator_,
+//GO(omp_set_default_device,
+//GO(omp_set_default_device_,
+//GO(omp_set_default_device_8_,
+//GO(omp_set_dynamic,
+//GO(omp_set_dynamic_,
+//GO(omp_set_dynamic_8_,
+//GO(omp_set_lock,
+//GO(omp_set_lock@OMP_1.0
+//GO(omp_set_lock_,
+//GO(omp_set_lock_@OMP_1.0
+//GO(omp_set_max_active_levels,
+//GO(omp_set_max_active_levels_,
+//GO(omp_set_max_active_levels_8_,
+//GO(omp_set_nested,
+//GO(omp_set_nested_,
+//GO(omp_set_nested_8_,
+//GO(omp_set_nest_lock@OMP_1.0
+//GO(omp_set_nest_lock,
+//GO(omp_set_nest_lock_,
+//GO(omp_set_nest_lock_@OMP_1.0
+//GO(omp_set_num_teams,
+//GO(omp_set_num_teams_,
+//GO(omp_set_num_teams_8_,
+//GO(omp_set_num_threads,
+//GO(omp_set_num_threads_,
+//GO(omp_set_num_threads_8_,
+//GO(omp_set_schedule,
+//GO(omp_set_schedule_,
+//GO(omp_set_schedule_8_,
+//GO(omp_set_teams_thread_limit,
+//GO(omp_set_teams_thread_limit_,
+//GO(omp_set_teams_thread_limit_8_,
+//GO(omp_target_alloc,
+//GO(omp_target_associate_ptr,
+//GO(omp_target_disassociate_ptr,
+//GO(omp_target_free,
+//GO(omp_target_is_accessible,
+//GO(omp_target_is_present,
+//GO(omp_target_memcpy,
+//GO(omp_target_memcpy_async,
+//GO(omp_target_memcpy_rect,
+//GO(omp_target_memcpy_rect_async,
+//GO(omp_test_lock@OMP_1.0
+//GO(omp_test_lock,
+//GO(omp_test_lock_,
+//GO(omp_test_lock_@OMP_1.0
+//GO(omp_test_nest_lock@OMP_1.0
+//GO(omp_test_nest_lock,
+//GO(omp_test_nest_lock_@OMP_1.0
+//GO(omp_test_nest_lock_,
+//GO(omp_unset_lock,
+//GO(omp_unset_lock@OMP_1.0
+//GO(omp_unset_lock_@OMP_1.0
+//GO(omp_unset_lock_,
+//GO(omp_unset_nest_lock,
+//GO(omp_unset_nest_lock@OMP_1.0
+//GO(omp_unset_nest_lock_,
+//GO(omp_unset_nest_lock_@OMP_1.0
+
diff --git a/src/wrapped/wrappedgssapi.c b/src/wrapped/wrappedgssapi.c
index 959d49c..959d49c 100755..100644
--- a/src/wrapped/wrappedgssapi.c
+++ b/src/wrapped/wrappedgssapi.c
diff --git a/src/wrapped/wrappedgssapi_private.h b/src/wrapped/wrappedgssapi_private.h
index bf393f7..bf393f7 100755..100644
--- a/src/wrapped/wrappedgssapi_private.h
+++ b/src/wrapped/wrappedgssapi_private.h
diff --git a/src/wrapped/wrappedgssapikrb5.c b/src/wrapped/wrappedgssapikrb5.c
index b3befc3..b3befc3 100755..100644
--- a/src/wrapped/wrappedgssapikrb5.c
+++ b/src/wrapped/wrappedgssapikrb5.c
diff --git a/src/wrapped/wrappedgssapikrb5_private.h b/src/wrapped/wrappedgssapikrb5_private.h
index fa57c6a..fa57c6a 100755..100644
--- a/src/wrapped/wrappedgssapikrb5_private.h
+++ b/src/wrapped/wrappedgssapikrb5_private.h
diff --git a/src/wrapped/wrappedgstapp_private.h b/src/wrapped/wrappedgstapp_private.h
index 7cda393..2b3bd09 100644
--- a/src/wrapped/wrappedgstapp_private.h
+++ b/src/wrapped/wrappedgstapp_private.h
@@ -7,7 +7,7 @@
//GO(gst_app_sink_get_drop,
//GO(gst_app_sink_get_emit_signals,
//GO(gst_app_sink_get_max_buffers,
-//GO(gst_app_sink_get_type,
+GO(gst_app_sink_get_type, LFv)
//GO(gst_app_sink_get_wait_on_eos,
//GO(gst_app_sink_is_eos,
//GO(gst_app_sink_pull_preroll,
diff --git a/src/wrapped/wrappedgstaudio_private.h b/src/wrapped/wrappedgstaudio_private.h
index 4573f24..ef7996c 100644
--- a/src/wrapped/wrappedgstaudio_private.h
+++ b/src/wrapped/wrappedgstaudio_private.h
@@ -29,27 +29,27 @@
//GO(gst_audio_base_src_set_provide_clock,
//GO(gst_audio_base_src_set_slave_method,
//GO(gst_audio_base_src_slave_method_get_type,
-//GO(gst_audio_buffer_clip,
+GO(gst_audio_buffer_clip, pFppii)
//GO(gst_audio_buffer_map,
-//GO(gst_audio_buffer_reorder_channels,
-//GO(gst_audio_buffer_truncate,
+GO(gst_audio_buffer_reorder_channels, iFpuipp)
+GO(gst_audio_buffer_truncate, pFpiLL)
//GO(gst_audio_buffer_unmap,
//GO(gst_audio_cd_src_add_track,
//GO(gst_audio_cd_src_get_type,
//GO(gst_audio_cd_src_mode_get_type,
-//GO(gst_audio_channel_get_fallback_mask,
+GO(gst_audio_channel_get_fallback_mask, LFi)
//GO(gst_audio_channel_mixer_flags_get_type,
-//GO(gst_audio_channel_mixer_free,
-//GO(gst_audio_channel_mixer_is_passthrough,
-//GO(gst_audio_channel_mixer_new,
-//GO(gst_audio_channel_mixer_new_with_matrix,
-//GO(gst_audio_channel_mixer_samples,
+GO(gst_audio_channel_mixer_free, vFp)
+GO(gst_audio_channel_mixer_is_passthrough, iFp)
+GO(gst_audio_channel_mixer_new, pFuuipip)
+GO(gst_audio_channel_mixer_new_with_matrix, pFuuiip)
+GO(gst_audio_channel_mixer_samples, vFpppi)
//GO(gst_audio_channel_position_get_type,
-//GO(gst_audio_channel_positions_from_mask,
-//GO(gst_audio_channel_positions_to_mask,
-//GO(gst_audio_channel_positions_to_string,
-//GO(gst_audio_channel_positions_to_valid_order,
-//GO(gst_audio_check_valid_channel_positions,
+GO(gst_audio_channel_positions_from_mask, iFiLp)
+GO(gst_audio_channel_positions_to_mask, iFpiip)
+GO(gst_audio_channel_positions_to_string, pFpi)
+GO(gst_audio_channel_positions_to_valid_order, iFpi)
+GO(gst_audio_check_valid_channel_positions, iFpii)
//GO(gst_audio_clipping_meta_api_get_type,
//GO(gst_audio_clipping_meta_get_info,
//GO(gst_audio_clock_adjust,
@@ -58,20 +58,20 @@
//GO(gst_audio_clock_invalidate,
//GO(gst_audio_clock_new,
//GO(gst_audio_clock_reset,
-//GO(gst_audio_converter_convert,
+GO(gst_audio_converter_convert, iFpupLpp)
//GO(gst_audio_converter_flags_get_type,
//GO(gst_audio_converter_free,
-//GO(gst_audio_converter_get_config,
-//GO(gst_audio_converter_get_in_frames,
-//GO(gst_audio_converter_get_max_latency,
+GO(gst_audio_converter_get_config, pFppp)
+GO(gst_audio_converter_get_in_frames, LFpL)
+GO(gst_audio_converter_get_max_latency, LFp)
//GO(gst_audio_converter_get_out_frames,
//GO(gst_audio_converter_get_type,
-//GO(gst_audio_converter_is_passthrough,
+GO(gst_audio_converter_is_passthrough, iFp)
//GO(gst_audio_converter_new,
-//GO(gst_audio_converter_reset,
-//GO(gst_audio_converter_samples,
+GO(gst_audio_converter_reset, vFp)
+GO(gst_audio_converter_samples, iFpupLpL)
//GO(gst_audio_converter_supports_inplace,
-//GO(gst_audio_converter_update_config,
+GO(gst_audio_converter_update_config, iFpiip)
//GO(gst_audio_decoder_allocate_output_buffer,
//GO(_gst_audio_decoder_error,
//GO(gst_audio_decoder_finish_frame,
@@ -145,16 +145,16 @@
//GO(gst_audio_filter_class_add_pad_templates,
//GO(gst_audio_filter_get_type,
//GO(gst_audio_flags_get_type,
-GO(gst_audio_format_build_integer, iFiiii)
+GO(gst_audio_format_build_integer, uFiiii)
//GO(gst_audio_format_fill_silence,
//GO(gst_audio_format_flags_get_type,
-//GO(gst_audio_format_from_string,
+GO(gst_audio_format_from_string, uFp)
//GO(gst_audio_format_get_info,
//GO(gst_audio_format_get_type,
//GO(gst_audio_format_info_get_type,
-//GO(gst_audio_formats_raw,
-//GO(gst_audio_format_to_string,
-//GO(gst_audio_get_channel_reorder_map,
+GO(gst_audio_formats_raw, pFp)
+GO(gst_audio_format_to_string, pFu)
+GO(gst_audio_get_channel_reorder_map, iFippp)
//GO(gst_audio_iec61937_frame_size,
//GO(gst_audio_iec61937_payload,
GO(gst_audio_info_convert, iFpiIip)
@@ -175,23 +175,23 @@ GO(gst_audio_layout_get_type, pFv)
//GO(gst_audio_pack_flags_get_type,
//GO(gst_audio_quantize_flags_get_type,
//GO(gst_audio_quantize_free,
-//GO(gst_audio_quantize_new,
-//GO(gst_audio_quantize_reset,
-//GO(gst_audio_quantize_samples,
-//GO(gst_audio_reorder_channels,
+GO(gst_audio_quantize_new, pFuuuuuu)
+GO(gst_audio_quantize_reset, vFp)
+GO(gst_audio_quantize_samples, vFpppu)
+GO(gst_audio_reorder_channels, iFpLuipp)
//GO(gst_audio_resampler_filter_interpolation_get_type,
//GO(gst_audio_resampler_filter_mode_get_type,
//GO(gst_audio_resampler_flags_get_type,
//GO(gst_audio_resampler_free,
-//GO(gst_audio_resampler_get_in_frames,
-//GO(gst_audio_resampler_get_max_latency,
+GO(gst_audio_resampler_get_in_frames, LFpL)
+GO(gst_audio_resampler_get_max_latency, LFp)
//GO(gst_audio_resampler_get_out_frames,
//GO(gst_audio_resampler_method_get_type,
-//GO(gst_audio_resampler_new,
-//GO(gst_audio_resampler_options_set_quality,
-//GO(gst_audio_resampler_resample,
-//GO(gst_audio_resampler_reset,
-//GO(gst_audio_resampler_update,
+GO(gst_audio_resampler_new, pFuuuiiip)
+GO(gst_audio_resampler_options_set_quality, vFuuiip)
+GO(gst_audio_resampler_resample, vFppLpL)
+GO(gst_audio_resampler_reset, vFp)
+GO(gst_audio_resampler_update, iFpiip)
//GO(gst_audio_ring_buffer_acquire,
//GO(gst_audio_ring_buffer_activate,
//GO(gst_audio_ring_buffer_advance,
@@ -228,27 +228,27 @@ GO(gst_audio_layout_get_type, pFv)
//GO(gst_audio_ring_buffer_stop,
//GO(gst_audio_sink_get_type,
//GO(gst_audio_src_get_type,
-//GO(gst_audio_stream_align_copy,
+GO(gst_audio_stream_align_copy, pFp)
//GO(gst_audio_stream_align_free,
//GO(gst_audio_stream_align_get_alignment_threshold,
//GO(gst_audio_stream_align_get_discont_wait,
-//GO(gst_audio_stream_align_get_rate,
-//GO(gst_audio_stream_align_get_samples_since_discont,
-//GO(gst_audio_stream_align_get_timestamp_at_discont,
+GO(gst_audio_stream_align_get_rate, iFp)
+GO(gst_audio_stream_align_get_samples_since_discont, LFp)
+GO(gst_audio_stream_align_get_timestamp_at_discont, LFp)
//GO(gst_audio_stream_align_get_type,
-//GO(gst_audio_stream_align_mark_discont,
-//GO(gst_audio_stream_align_new,
-//GO(gst_audio_stream_align_process,
+GO(gst_audio_stream_align_mark_discont, vFp)
+GO(gst_audio_stream_align_new, pFiLL)
+GO(gst_audio_stream_align_process, iFpiLuppp)
//GO(gst_audio_stream_align_set_alignment_threshold,
-//GO(gst_audio_stream_align_set_discont_wait,
-//GO(gst_audio_stream_align_set_rate,
-//GO(gst_buffer_add_audio_clipping_meta,
-//GO(gst_buffer_add_audio_downmix_meta,
+GO(gst_audio_stream_align_set_discont_wait, vFpL)
+GO(gst_audio_stream_align_set_rate, vFpi)
+GO(gst_buffer_add_audio_clipping_meta, pFpuLL)
+GO(gst_buffer_add_audio_downmix_meta, pFppipip)
//GO(gst_buffer_add_audio_meta,
-//GO(gst_buffer_get_audio_downmix_meta_for_channels,
-//GO(gst_stream_volume_convert_volume,
-//GO(gst_stream_volume_get_mute,
-//GO(gst_stream_volume_get_type,
-//GO(gst_stream_volume_get_volume,
-//GO(gst_stream_volume_set_mute,
-//GO(gst_stream_volume_set_volume,
+GO(gst_buffer_get_audio_downmix_meta_for_channels, pFppi)
+GO(gst_stream_volume_convert_volume, dFuud)
+GO(gst_stream_volume_get_mute, iFp)
+GO(gst_stream_volume_get_type, LFv)
+GO(gst_stream_volume_get_volume, dFpu)
+GO(gst_stream_volume_set_mute, vFpi)
+GO(gst_stream_volume_set_volume, vFpud)
diff --git a/src/wrapped/wrappedgstbase_private.h b/src/wrapped/wrappedgstbase_private.h
index 5e38d93..f203a1b 100644
--- a/src/wrapped/wrappedgstbase_private.h
+++ b/src/wrapped/wrappedgstbase_private.h
@@ -3,31 +3,31 @@
#endif
//GO(gst_adapter_available,
-//GO(gst_adapter_available_fast,
+GO(gst_adapter_available_fast, LFp)
//GO(gst_adapter_clear,
-//GO(gst_adapter_copy,
-//GO(gst_adapter_copy_bytes,
-//GO(gst_adapter_distance_from_discont,
-//GO(gst_adapter_dts_at_discont,
-//GO(gst_adapter_flush,
+GO(gst_adapter_copy, vFppLL)
+GO(gst_adapter_copy_bytes, pFpLL)
+GO(gst_adapter_distance_from_discont, LFp)
+GO(gst_adapter_dts_at_discont, LFp)
+GO(gst_adapter_flush, vFpL)
//GO(gst_adapter_get_buffer,
-//GO(gst_adapter_get_buffer_fast,
-//GO(gst_adapter_get_buffer_list,
-//GO(gst_adapter_get_list,
+GO(gst_adapter_get_buffer_fast, pFpL)
+GO(gst_adapter_get_buffer_list, pFpL)
+GO(gst_adapter_get_list, pFpL)
//GO(gst_adapter_get_type,
-//GO(gst_adapter_map,
-//GO(gst_adapter_masked_scan_uint32,
-//GO(gst_adapter_masked_scan_uint32_peek,
-//GO(gst_adapter_new,
+GO(gst_adapter_map, pFpL)
+GO(gst_adapter_masked_scan_uint32, lFpuuLL)
+GO(gst_adapter_masked_scan_uint32_peek, lFpuuLLp)
+GO(gst_adapter_new, pFv)
//GO(gst_adapter_offset_at_discont,
-//GO(gst_adapter_prev_dts,
-//GO(gst_adapter_prev_dts_at_offset,
-//GO(gst_adapter_prev_offset,
+GO(gst_adapter_prev_dts, LFpp)
+GO(gst_adapter_prev_dts_at_offset, LFpLp)
+GO(gst_adapter_prev_offset, LFpp)
//GO(gst_adapter_prev_pts,
//GO(gst_adapter_prev_pts_at_offset,
//GO(gst_adapter_pts_at_discont,
-//GO(gst_adapter_push,
-//GO(gst_adapter_take,
+GO(gst_adapter_push, vFpp)
+GO(gst_adapter_take, pFpL)
//GO(gst_adapter_take_buffer,
//GO(gst_adapter_take_buffer_fast,
//GO(gst_adapter_take_buffer_list,
@@ -156,8 +156,8 @@
//GO(gst_bit_reader_get_pos,
//GO(gst_bit_reader_get_remaining,
//GO(gst_bit_reader_get_size,
-//GO(gst_bit_reader_init,
-//GO(gst_bit_reader_new,
+GO(gst_bit_reader_init, vFppu)
+GO(gst_bit_reader_new, pFpu)
//GO(gst_bit_reader_peek_bits_uint16,
//GO(gst_bit_reader_peek_bits_uint32,
//GO(gst_bit_reader_peek_bits_uint64,
@@ -172,25 +172,25 @@
//GO(gst_bit_writer_get_data,
//GO(gst_bit_writer_get_size,
//GO(gst_bit_writer_init,
-//GO(gst_bit_writer_init_with_data,
-//GO(gst_bit_writer_init_with_size,
-//GO(gst_bit_writer_new,
-//GO(gst_bit_writer_new_with_data,
-//GO(gst_bit_writer_new_with_size,
+GO(gst_bit_writer_init_with_data, vFppui)
+GO(gst_bit_writer_init_with_size, vFpui)
+GO(gst_bit_writer_new, pFv)
+GO(gst_bit_writer_new_with_data, pFpui)
+GO(gst_bit_writer_new_with_size, pFui)
//GO(gst_bit_writer_put_bits_uint16,
//GO(gst_bit_writer_put_bits_uint32,
//GO(gst_bit_writer_put_bits_uint64,
//GO(gst_bit_writer_put_bits_uint8,
//GO(gst_bit_writer_put_bytes,
-//GO(gst_bit_writer_reset,
-//GO(gst_bit_writer_reset_and_get_buffer,
-//GO(gst_bit_writer_reset_and_get_data,
+GO(gst_bit_writer_reset, vFp)
+GO(gst_bit_writer_reset_and_get_buffer, pFp)
+GO(gst_bit_writer_reset_and_get_data, pFp)
//GO(gst_bit_writer_set_pos,
//GO(gst_byte_reader_dup_data,
-//GO(gst_byte_reader_dup_string_utf16,
-//GO(gst_byte_reader_dup_string_utf32,
-//GO(gst_byte_reader_dup_string_utf8,
-//GO(gst_byte_reader_free,
+GO(gst_byte_reader_dup_string_utf16, iFpp)
+GO(gst_byte_reader_dup_string_utf32, iFpp)
+GO(gst_byte_reader_dup_string_utf8, iFpp)
+GO(gst_byte_reader_free, vFp)
//GO(gst_byte_reader_get_data,
//GO(gst_byte_reader_get_float32_be,
//GO(gst_byte_reader_get_float32_le,
@@ -208,7 +208,7 @@
//GO(gst_byte_reader_get_pos,
//GO(gst_byte_reader_get_remaining,
//GO(gst_byte_reader_get_size,
-//GO(gst_byte_reader_get_string_utf8,
+GO(gst_byte_reader_get_string_utf8, iFpp)
//GO(gst_byte_reader_get_sub_reader,
//GO(gst_byte_reader_get_uint16_be,
//GO(gst_byte_reader_get_uint16_le,
@@ -220,9 +220,9 @@
//GO(gst_byte_reader_get_uint64_le,
//GO(gst_byte_reader_get_uint8,
//GO(gst_byte_reader_init,
-//GO(gst_byte_reader_masked_scan_uint32,
-//GO(gst_byte_reader_masked_scan_uint32_peek,
-//GO(gst_byte_reader_new,
+GO(gst_byte_reader_masked_scan_uint32, uFpuuuu)
+GO(gst_byte_reader_masked_scan_uint32_peek, uFpuuuup)
+GO(gst_byte_reader_new, pFpu)
//GO(gst_byte_reader_peek_data,
//GO(gst_byte_reader_peek_float32_be,
//GO(gst_byte_reader_peek_float32_le,
@@ -237,7 +237,7 @@
//GO(gst_byte_reader_peek_int64_be,
//GO(gst_byte_reader_peek_int64_le,
//GO(gst_byte_reader_peek_int8,
-//GO(gst_byte_reader_peek_string_utf8,
+GO(gst_byte_reader_peek_string_utf8, iFpp)
//GO(gst_byte_reader_peek_sub_reader,
//GO(gst_byte_reader_peek_uint16_be,
//GO(gst_byte_reader_peek_uint16_le,
@@ -251,20 +251,20 @@
//GO(gst_byte_reader_set_pos,
//GO(gst_byte_reader_skip,
//GO(gst_byte_reader_skip_string_utf16,
-//GO(gst_byte_reader_skip_string_utf32,
+GO(gst_byte_reader_skip_string_utf32, iFp)
//GO(gst_byte_reader_skip_string_utf8,
//GO(gst_byte_writer_ensure_free_space,
//GO(gst_byte_writer_fill,
//GO(gst_byte_writer_free,
//GO(gst_byte_writer_free_and_get_buffer,
//GO(gst_byte_writer_free_and_get_data,
-//GO(gst_byte_writer_get_remaining,
+GO(gst_byte_writer_get_remaining, uFp)
//GO(gst_byte_writer_init,
-//GO(gst_byte_writer_init_with_data,
-//GO(gst_byte_writer_init_with_size,
-//GO(gst_byte_writer_new,
-//GO(gst_byte_writer_new_with_data,
-//GO(gst_byte_writer_new_with_size,
+GO(gst_byte_writer_init_with_data, vFppui)
+GO(gst_byte_writer_init_with_size, vFpui)
+GO(gst_byte_writer_new, pFv)
+GO(gst_byte_writer_new_with_data, pFpui)
+GO(gst_byte_writer_new_with_size, pFui)
//GO(gst_byte_writer_put_data,
//GO(gst_byte_writer_put_float32_be,
//GO(gst_byte_writer_put_float32_le,
@@ -279,9 +279,9 @@
//GO(gst_byte_writer_put_int64_be,
//GO(gst_byte_writer_put_int64_le,
//GO(gst_byte_writer_put_int8,
-//GO(gst_byte_writer_put_string_utf16,
-//GO(gst_byte_writer_put_string_utf32,
-//GO(gst_byte_writer_put_string_utf8,
+GO(gst_byte_writer_put_string_utf16, iFpp)
+GO(gst_byte_writer_put_string_utf32, iFpp)
+GO(gst_byte_writer_put_string_utf8, iFpp)
//GO(gst_byte_writer_put_uint16_be,
//GO(gst_byte_writer_put_uint16_le,
//GO(gst_byte_writer_put_uint24_be,
@@ -291,16 +291,16 @@
//GO(gst_byte_writer_put_uint64_be,
//GO(gst_byte_writer_put_uint64_le,
//GO(gst_byte_writer_put_uint8,
-//GO(gst_byte_writer_reset,
-//GO(gst_byte_writer_reset_and_get_buffer,
-//GO(gst_byte_writer_reset_and_get_data,
+GO(gst_byte_writer_reset, vFp)
+GO(gst_byte_writer_reset_and_get_buffer, pFp)
+GO(gst_byte_writer_reset_and_get_data, pFp)
//GO(gst_collect_pads_add_pad,
-//GO(gst_collect_pads_available,
+GO(gst_collect_pads_available, uFp)
//GO(gst_collect_pads_clip_running_time,
//GO(gst_collect_pads_event_default,
//GO(gst_collect_pads_flush,
//GO(gst_collect_pads_get_type,
-//GO(gst_collect_pads_new,
+GO(gst_collect_pads_new, pFv)
//GO(gst_collect_pads_peek,
//GO(gst_collect_pads_pop,
//GO(gst_collect_pads_query_default,
@@ -311,7 +311,7 @@
//GO(gst_collect_pads_set_compare_function,
//GO(gst_collect_pads_set_event_function,
//GO(gst_collect_pads_set_flush_function,
-//GO(gst_collect_pads_set_flushing,
+GO(gst_collect_pads_set_flushing, vFpi)
//GO(gst_collect_pads_set_function,
//GO(gst_collect_pads_set_query_function,
//GO(gst_collect_pads_set_waiting,
@@ -319,58 +319,58 @@
//GO(gst_collect_pads_start,
//GO(gst_collect_pads_stop,
//GO(gst_collect_pads_take_buffer,
-//GO(gst_data_queue_drop_head,
+GO(gst_data_queue_drop_head, iFpL)
//GO(gst_data_queue_flush,
-//GO(gst_data_queue_get_level,
+GO(gst_data_queue_get_level, vFpp)
//GO(gst_data_queue_get_type,
-//GO(gst_data_queue_is_empty,
+GO(gst_data_queue_is_empty, iFp)
//GO(gst_data_queue_is_full,
//GO(gst_data_queue_limits_changed,
//GO(gst_data_queue_new,
-//GO(gst_data_queue_peek,
+GO(gst_data_queue_peek, iFpp)
//GO(gst_data_queue_pop,
//GO(gst_data_queue_push,
//GO(gst_data_queue_push_force,
-//GO(gst_data_queue_set_flushing,
+GO(gst_data_queue_set_flushing, vFpi)
//GO(gst_flow_combiner_add_pad,
//GO(gst_flow_combiner_clear,
//GO(gst_flow_combiner_free,
//GO(gst_flow_combiner_get_type,
-//GO(gst_flow_combiner_new,
-//GO(gst_flow_combiner_ref,
+GO(gst_flow_combiner_new, pFv)
+GO(gst_flow_combiner_ref, pFp)
//GO(gst_flow_combiner_remove_pad,
//GO(gst_flow_combiner_reset,
//GO(gst_flow_combiner_unref,
-//GO(gst_flow_combiner_update_flow,
+GO(gst_flow_combiner_update_flow, iFpi)
//GO(gst_flow_combiner_update_pad_flow,
-//GO(gst_push_src_get_type,
-//GO(gst_queue_array_clear,
+GO(gst_push_src_get_type, LFv)
+GO(gst_queue_array_clear, vFp)
//GO(gst_queue_array_drop_element,
-//GO(gst_queue_array_drop_struct,
+GO(gst_queue_array_drop_struct, iFpup)
//GO(gst_queue_array_find,
//GO(gst_queue_array_free,
-//GO(gst_queue_array_get_length,
-//GO(gst_queue_array_is_empty,
-//GO(gst_queue_array_new,
-//GO(gst_queue_array_new_for_struct,
+GO(gst_queue_array_get_length, uFp)
+GO(gst_queue_array_is_empty, iFp)
+GO(gst_queue_array_new, pFu)
+GO(gst_queue_array_new_for_struct, pFLu)
//GO(gst_queue_array_peek_head,
//GO(gst_queue_array_peek_head_struct,
//GO(gst_queue_array_peek_nth,
-//GO(gst_queue_array_peek_nth_struct,
+GO(gst_queue_array_peek_nth_struct, pFpu)
//GO(gst_queue_array_peek_tail,
-//GO(gst_queue_array_peek_tail_struct,
+GO(gst_queue_array_peek_tail_struct, pFp)
//GO(gst_queue_array_pop_head,
//GO(gst_queue_array_pop_head_struct,
//GO(gst_queue_array_pop_tail,
//GO(gst_queue_array_pop_tail_struct,
//GO(gst_queue_array_push_tail,
-//GO(gst_queue_array_push_tail_struct,
+GO(gst_queue_array_push_tail_struct, vFpp)
//GO(gst_queue_array_set_clear_func,
//GO(gst_type_find_helper,
//GO(gst_type_find_helper_for_buffer,
//GO(gst_type_find_helper_for_buffer_with_extension,
//GO(gst_type_find_helper_for_data,
-//GO(gst_type_find_helper_for_data_with_extension,
+GO(gst_type_find_helper_for_data_with_extension, pFppLpp)
//GO(gst_type_find_helper_for_extension,
//GO(gst_type_find_helper_get_range,
//GO(gst_type_find_helper_get_range_full,
diff --git a/src/wrapped/wrappedgstgl_private.h b/src/wrapped/wrappedgstgl_private.h
index 436fa1d..6ca18cc 100644
--- a/src/wrapped/wrappedgstgl_private.h
+++ b/src/wrapped/wrappedgstgl_private.h
@@ -6,7 +6,7 @@
//GO(gst_buffer_add_gl_sync_meta_full,
//GO(gst_buffer_pool_config_get_gl_allocation_params,
//GO(gst_buffer_pool_config_set_gl_allocation_params,
-//GO(gst_context_get_gl_display,
+GO(gst_context_get_gl_display, iFpp)
GO(gst_context_set_gl_display, vFpp)
//GO(gst_egl_get_error_string,
//GO(gst_egl_image_export_dmabuf,
@@ -23,9 +23,9 @@ GO(gst_context_set_gl_display, vFpp)
//GO(gst_gl_allocation_params_free_data,
//GO(gst_gl_allocation_params_get_type,
//GO(gst_gl_allocation_params_init,
-//GO(gst_gl_api_from_string,
+GO(gst_gl_api_from_string, uFp)
//GO(gst_gl_api_get_type,
-//GO(gst_gl_api_to_string,
+GO(gst_gl_api_to_string, pFu)
//GO(gst_gl_async_debug_free,
//GO(gst_gl_async_debug_freeze,
//GO(gst_gl_async_debug_init,
@@ -42,7 +42,7 @@ GO(gst_context_set_gl_display, vFpp)
//GO(gst_gl_base_memory_allocator_get_type,
//GO(gst_gl_base_memory_alloc_data,
//GO(gst_gl_base_memory_error_get_type,
-//GO(gst_gl_base_memory_error_quark,
+GO(gst_gl_base_memory_error_quark, uFv)
//GO(gst_gl_base_memory_get_type,
//GO(gst_gl_base_memory_init,
//GO(gst_gl_base_memory_init_once,
@@ -57,7 +57,7 @@ GO(gst_context_set_gl_display, vFpp)
//GO(gst_gl_buffer_pool_get_gl_allocation_params,
//GO(gst_gl_buffer_pool_get_type,
//GO(gst_gl_buffer_pool_new,
-//GO(gst_gl_check_extension,
+GO(gst_gl_check_extension, iFpp)
//GO(gst_gl_color_convert_decide_allocation,
//GO(gst_gl_color_convert_fixate_caps,
//GO(gst_gl_color_convert_get_type,
@@ -89,9 +89,9 @@ GO(gst_context_set_gl_display, vFpp)
//DATA(GST_GL_CONFIG_ATTRIB_STENCIL_SIZE_NAME,
//DATA(GST_GL_CONFIG_ATTRIB_SURFACE_TYPE_NAME,
//GO(gst_gl_config_caveat_get_type,
-//GO(gst_gl_config_caveat_to_string,
+GO(gst_gl_config_caveat_to_string, pFu)
//GO(gst_gl_config_surface_type_get_type,
-//GO(gst_gl_config_surface_type_to_string,
+GO(gst_gl_config_surface_type_to_string, pFu)
//GO(gst_gl_context_activate,
//GO(gst_gl_context_can_share,
//GO(gst_gl_context_check_feature,
@@ -100,15 +100,15 @@ GO(gst_context_set_gl_display, vFpp)
//GO(gst_gl_context_clear_framebuffer,
//GO(gst_gl_context_clear_shader,
//GO(gst_gl_context_create,
-//GO(gst_gl_context_default_get_proc_address,
+GO(gst_gl_context_default_get_proc_address, pFup)
//GO(gst_gl_context_destroy,
//GO(gst_gl_context_error_get_type,
//GO(gst_gl_context_error_quark,
//GO(gst_gl_context_fill_info,
//GO(gst_gl_context_get_config,
//GO(gst_gl_context_get_current,
-//GO(gst_gl_context_get_current_gl_api,
-//GO(gst_gl_context_get_current_gl_context,
+GO(gst_gl_context_get_current_gl_api, uFupp)
+GO(gst_gl_context_get_current_gl_context, LFu)
//GO(gst_gl_context_get_display,
//GO(gst_gl_context_get_gl_api,
//GO(gst_gl_context_get_gl_context,
@@ -116,7 +116,7 @@ GO(gst_context_set_gl_display, vFpp)
//GO(gst_gl_context_get_gl_platform_version,
//GO(gst_gl_context_get_gl_version,
//GO(gst_gl_context_get_proc_address,
-//GO(gst_gl_context_get_proc_address_with_platform,
+GO(gst_gl_context_get_proc_address_with_platform, pFuup)
//GO(gst_gl_context_get_thread,
//GO(gst_gl_context_get_type,
//GO(gst_gl_context_get_window,
@@ -163,7 +163,7 @@ GO(gst_gl_display_new_with_type, pFi)
//GO(gst_gl_display_x11_new,
//GO(gst_gl_display_x11_new_with_display,
//GO(gst_gl_element_propagate_display_context,
-//GO(gst_gl_ensure_element_data,
+GO(gst_gl_ensure_element_data, iFppp)
//GO(gst_gl_filter_add_rgba_pad_templates,
//GO(gst_gl_filter_draw_fullscreen_quad,
//GO(gst_gl_filter_filter_texture,
@@ -173,13 +173,13 @@ GO(gst_gl_display_new_with_type, pFi)
//GO(gst_gl_format_from_video_info,
//GO(gst_gl_format_get_type,
//GO(gst_gl_format_is_supported,
-//GO(gst_gl_format_type_from_sized_gl_format,
-//GO(gst_gl_format_type_n_bytes,
+GO(gst_gl_format_type_from_sized_gl_format, vFupp)
+GO(gst_gl_format_type_n_bytes, uFuu)
//GO(gst_gl_framebuffer_attach,
//GO(gst_gl_framebuffer_bind,
//GO(gst_gl_framebuffer_draw_to_texture,
-//GO(gst_gl_framebuffer_get_effective_dimensions,
-//GO(gst_gl_framebuffer_get_id,
+GO(gst_gl_framebuffer_get_effective_dimensions, vFppp)
+GO(gst_gl_framebuffer_get_id, uFp)
//GO(gst_gl_framebuffer_get_type,
//GO(gst_gl_framebuffer_new,
//GO(gst_gl_framebuffer_new_with_default_depth,
@@ -187,7 +187,7 @@ GO(gst_gl_display_new_with_type, pFi)
//GO(gst_gl_get_plane_data_size,
//GO(gst_gl_get_plane_start,
//GO(gst_gl_handle_context_query,
-//GO(gst_gl_handle_set_context,
+GO(gst_gl_handle_set_context, iFpppp)
//GO(gst_gl_insert_debug_marker,
//GO(gst_gl_memory_allocator_get_default,
//GO(gst_gl_memory_allocator_get_type,
@@ -215,21 +215,21 @@ GO(gst_gl_display_new_with_type, pFi)
//GO(gst_gl_memory_read_pixels,
//GO(gst_gl_memory_setup_buffer,
//GO(gst_gl_memory_texsubimage,
-//GO(gst_gl_multiply_matrix4,
+GO(gst_gl_multiply_matrix4, vFppp)
//GO(gst_gl_overlay_compositor_add_caps,
//GO(gst_gl_overlay_compositor_draw_overlays,
//GO(gst_gl_overlay_compositor_free_overlays,
-//GO(gst_gl_overlay_compositor_get_type,
+GO(gst_gl_overlay_compositor_get_type, LFv)
//GO(gst_gl_overlay_compositor_new,
//GO(gst_gl_overlay_compositor_upload_overlays,
-//GO(gst_gl_platform_from_string,
+GO(gst_gl_platform_from_string, uFp)
//GO(gst_gl_platform_get_type,
-//GO(gst_gl_platform_to_string,
+GO(gst_gl_platform_to_string, pFu)
//GO(gst_gl_query_counter,
//GO(gst_gl_query_end,
//GO(gst_gl_query_free,
//GO(gst_gl_query_init,
-//GO(gst_gl_query_local_gl_context,
+GO(gst_gl_query_local_gl_context, iFpup)
//GO(gst_gl_query_new,
//GO(gst_gl_query_result,
//GO(gst_gl_query_start,
@@ -244,42 +244,42 @@ GO(gst_gl_display_new_with_type, pFi)
//GO(gst_gl_renderbuffer_get_id,
//GO(gst_gl_renderbuffer_get_type,
//GO(gst_gl_renderbuffer_get_width,
-//GO(gst_gl_renderbuffer_init_once,
+GO(gst_gl_renderbuffer_init_once, vFv)
//GO(gst_gl_set_affine_transformation_meta_from_ndc,
//GO(gst_gl_shader_attach,
//GO(gst_gl_shader_attach_unlocked,
//GO(gst_gl_shader_bind_attribute_location,
-//GO(gst_gl_shader_bind_frag_data_location,
+GO(gst_gl_shader_bind_frag_data_location, vFpup)
//GO(gst_gl_shader_compile_attach_stage,
//GO(gst_gl_shader_detach,
//GO(gst_gl_shader_detach_unlocked,
-//GO(gst_gl_shader_get_attribute_location,
-//GO(gst_gl_shader_get_program_handle,
+GO(gst_gl_shader_get_attribute_location, iFpp)
+GO(gst_gl_shader_get_program_handle, iFp)
//GO(gst_gl_shader_get_type,
-//GO(gst_gl_shader_is_linked,
-//GO(gst_gl_shader_link,
+GO(gst_gl_shader_is_linked, iFp)
+GO(gst_gl_shader_link, iFpp)
//GO(gst_gl_shader_new,
//GO(gst_gl_shader_new_default,
//GO(gst_gl_shader_new_link_with_stages,
//GO(gst_gl_shader_new_with_stages,
//GO(gst_gl_shader_release,
//GO(gst_gl_shader_release_unlocked,
-//GO(gst_gl_shader_set_uniform_1f,
+GO(gst_gl_shader_set_uniform_1f, vFppf)
//GO(gst_gl_shader_set_uniform_1fv,
-//GO(gst_gl_shader_set_uniform_1i,
+GO(gst_gl_shader_set_uniform_1i, vFppi)
//GO(gst_gl_shader_set_uniform_1iv,
-//GO(gst_gl_shader_set_uniform_2f,
+GO(gst_gl_shader_set_uniform_2f, vFppff)
//GO(gst_gl_shader_set_uniform_2fv,
-//GO(gst_gl_shader_set_uniform_2i,
+GO(gst_gl_shader_set_uniform_2i, vFppii)
//GO(gst_gl_shader_set_uniform_2iv,
-//GO(gst_gl_shader_set_uniform_3f,
+GO(gst_gl_shader_set_uniform_3f, vFppfff)
//GO(gst_gl_shader_set_uniform_3fv,
-//GO(gst_gl_shader_set_uniform_3i,
+GO(gst_gl_shader_set_uniform_3i, vFppiii)
//GO(gst_gl_shader_set_uniform_3iv,
-//GO(gst_gl_shader_set_uniform_4f,
-//GO(gst_gl_shader_set_uniform_4fv,
-//GO(gst_gl_shader_set_uniform_4i,
-//GO(gst_gl_shader_set_uniform_4iv,
+GO(gst_gl_shader_set_uniform_4f, vFppffff)
+GO(gst_gl_shader_set_uniform_4fv, vFppup)
+GO(gst_gl_shader_set_uniform_4i, vFppiiii)
+GO(gst_gl_shader_set_uniform_4iv, vFppup)
//GO(gst_gl_shader_set_uniform_matrix_2fv,
//GO(gst_gl_shader_set_uniform_matrix_2x3fv,
//GO(gst_gl_shader_set_uniform_matrix_2x4fv,
@@ -288,7 +288,7 @@ GO(gst_gl_display_new_with_type, pFi)
//GO(gst_gl_shader_set_uniform_matrix_3x4fv,
//GO(gst_gl_shader_set_uniform_matrix_4fv,
//GO(gst_gl_shader_set_uniform_matrix_4x2fv,
-//GO(gst_gl_shader_set_uniform_matrix_4x3fv,
+GO(gst_gl_shader_set_uniform_matrix_4x3fv, vFppiip)
//DATA(gst_gl_shader_string_fragment_default,
//DATA(gst_gl_shader_string_fragment_external_oes_default,
//GO(gst_gl_shader_string_fragment_external_oes_get_default,
@@ -299,13 +299,13 @@ GO(gst_gl_display_new_with_type, pFi)
//DATA(gst_gl_shader_string_vertex_default,
//DATA(gst_gl_shader_string_vertex_mat4_texture_transform,
//DATA(gst_gl_shader_string_vertex_mat4_vertex_transform,
-//GO(gst_gl_shader_use,
+GO(gst_gl_shader_use, vFp)
//GO(gst_gl_sized_gl_format_from_gl_format_type,
//GO(gst_glsl_error_get_type,
//GO(gst_glsl_error_quark,
-//GO(gst_glsl_profile_from_string,
+GO(gst_glsl_profile_from_string, iFp)
//GO(gst_glsl_profile_get_type,
-//GO(gst_glsl_profile_to_string,
+GO(gst_glsl_profile_to_string, pFi)
//GO(gst_glsl_stage_compile,
//GO(gst_glsl_stage_get_handle,
//GO(gst_glsl_stage_get_profile,
@@ -318,12 +318,12 @@ GO(gst_gl_display_new_with_type, pFi)
//GO(gst_glsl_stage_new_with_string,
//GO(gst_glsl_stage_new_with_strings,
//GO(gst_glsl_stage_set_strings,
-//GO(gst_glsl_string_get_version_profile,
-//GO(gst_glsl_version_from_string,
+GO(gst_glsl_string_get_version_profile, iFppp)
+GO(gst_glsl_version_from_string, uFp)
//GO(gst_glsl_version_get_type,
//GO(gst_glsl_version_profile_from_string,
-//GO(gst_glsl_version_profile_to_string,
-//GO(gst_glsl_version_to_string,
+GO(gst_glsl_version_profile_to_string, pFui)
+GO(gst_glsl_version_to_string, pFu)
//GO(gst_gl_stereo_downmix_get_type,
//GO(gst_gl_stereo_downmix_mode_get_type,
//GO(gst_gl_sync_meta_api_get_type,
@@ -331,11 +331,11 @@ GO(gst_gl_display_new_with_type, pFi)
//GO(gst_gl_sync_meta_set_sync_point,
//GO(gst_gl_sync_meta_wait,
//GO(gst_gl_sync_meta_wait_cpu,
-//GO(gst_gl_texture_target_from_gl,
-//GO(gst_gl_texture_target_from_string,
+GO(gst_gl_texture_target_from_gl, uFu)
+GO(gst_gl_texture_target_from_string, uFp)
//GO(gst_gl_texture_target_get_type,
-//GO(gst_gl_texture_target_to_buffer_pool_option,
-//GO(gst_gl_texture_target_to_gl,
+GO(gst_gl_texture_target_to_buffer_pool_option, pFu)
+GO(gst_gl_texture_target_to_gl, uFu)
//GO(gst_gl_texture_target_to_string,
//GO(gst_gl_upload_get_caps,
//GO(gst_gl_upload_get_input_template_caps,
@@ -347,10 +347,10 @@ GO(gst_gl_display_new_with_type, pFi)
//GO(gst_gl_upload_set_caps,
//GO(gst_gl_upload_set_context,
//GO(gst_gl_upload_transform_caps,
-//GO(gst_gl_value_get_texture_target_mask,
-//GO(gst_gl_value_set_texture_target,
+GO(gst_gl_value_get_texture_target_mask, uFp)
+GO(gst_gl_value_set_texture_target, iFpu)
//GO(gst_gl_value_set_texture_target_from_mask,
-//GO(gst_gl_version_to_glsl_version,
+GO(gst_gl_version_to_glsl_version, uFuii)
//GO(gst_gl_video_allocation_params_copy_data,
//GO(gst_gl_video_allocation_params_free_data,
//GO(gst_gl_video_allocation_params_get_type,
diff --git a/src/wrapped/wrappedgstreamer.c b/src/wrapped/wrappedgstreamer.c
index 35f5610..8a27986 100644
--- a/src/wrapped/wrappedgstreamer.c
+++ b/src/wrapped/wrappedgstreamer.c
@@ -23,14 +23,21 @@ const char* gstreamerName = "libgstreamer-1.0.so.0";
#define LIBNAME gstreamer
typedef void* (*pFppA_t)(void*, void*, va_list);
+typedef void* (*pFv_t)();
typedef size_t (*LFv_t)();
typedef void* (*pFp_t)(void*);
+typedef void (*vFpp_t)(void*, void*);
+typedef int (*iFpp_t)(void*, void*);
#define ADDED_FUNCTIONS() \
GO(gst_object_get_type, LFv_t) \
GO(gst_allocator_get_type, LFv_t) \
+ GO(gst_task_pool_get_type, LFv_t) \
GO(gst_structure_new_valist, pFppA_t) \
- GO(gst_structure_new_empty, pFp_t)
+ GO(gst_structure_new_empty, pFp_t) \
+ GO(gst_caps_new_empty, pFv_t) \
+ GO(gst_caps_replace, iFpp_t) \
+ GO(gst_caps_append_structure, vFpp_t) \
#include "generated/wrappedgstreamertypes.h"
@@ -44,10 +51,10 @@ GO(3) \
// GDestroyFunc ...
#define GO(A) \
-static uintptr_t my_destroyfunc_fct_##A = 0; \
-static int my_destroyfunc_##A(void* a, void* b) \
-{ \
- return RunFunction(my_context, my_destroyfunc_fct_##A, 2, a, b);\
+static uintptr_t my_destroyfunc_fct_##A = 0; \
+static int my_destroyfunc_##A(void* a, void* b) \
+{ \
+ return RunFunctionFmt(my_destroyfunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -68,10 +75,10 @@ static void* findDestroyFct(void* fct)
}
//GstPadActivateModeFunction
#define GO(A) \
-static uintptr_t my_GstPadActivateModeFunction_fct_##A = 0; \
-static int my_GstPadActivateModeFunction_##A(void* a, void* b, int c, int d) \
-{ \
- return (int)RunFunction(my_context, my_GstPadActivateModeFunction_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_GstPadActivateModeFunction_fct_##A = 0; \
+static int my_GstPadActivateModeFunction_##A(void* a, void* b, int c, int d) \
+{ \
+ return (int)RunFunctionFmt(my_GstPadActivateModeFunction_fct_##A, "ppii", a, b, c, d); \
}
SUPER()
#undef GO
@@ -91,10 +98,10 @@ static void* findGstPadActivateModeFunctionFct(void* fct)
}
//GstPadQueryFunction
#define GO(A) \
-static uintptr_t my_GstPadQueryFunction_fct_##A = 0; \
-static int my_GstPadQueryFunction_##A(void* a, void* b, void* c) \
-{ \
- return (int)RunFunction(my_context, my_GstPadQueryFunction_fct_##A, 3, a, b, c); \
+static uintptr_t my_GstPadQueryFunction_fct_##A = 0; \
+static int my_GstPadQueryFunction_##A(void* a, void* b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my_GstPadQueryFunction_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -114,10 +121,10 @@ static void* findGstPadQueryFunctionFct(void* fct)
}
//GstPadGetRangeFunction
#define GO(A) \
-static uintptr_t my_GstPadGetRangeFunction_fct_##A = 0; \
-static int my_GstPadGetRangeFunction_##A(void* a, void* b, uint64_t c, uint32_t d, void* e) \
-{ \
- return (int)RunFunction(my_context, my_GstPadGetRangeFunction_fct_##A, 5, a, b, c, d, e); \
+static uintptr_t my_GstPadGetRangeFunction_fct_##A = 0; \
+static int my_GstPadGetRangeFunction_##A(void* a, void* b, uint64_t c, uint32_t d, void* e) \
+{ \
+ return (int)RunFunctionFmt(my_GstPadGetRangeFunction_fct_##A, "ppUup", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -137,10 +144,10 @@ static void* findGstPadGetRangeFunctionFct(void* fct)
}
//GstPadChainFunction
#define GO(A) \
-static uintptr_t my_GstPadChainFunction_fct_##A = 0; \
-static int my_GstPadChainFunction_##A(void* a, void* b, void* c) \
-{ \
- return (int)RunFunction(my_context, my_GstPadChainFunction_fct_##A, 3, a, b, c); \
+static uintptr_t my_GstPadChainFunction_fct_##A = 0; \
+static int my_GstPadChainFunction_##A(void* a, void* b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my_GstPadChainFunction_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -160,10 +167,10 @@ static void* findGstPadChainFunctionFct(void* fct)
}
//GstPadEventFunction
#define GO(A) \
-static uintptr_t my_GstPadEventFunction_fct_##A = 0; \
-static int my_GstPadEventFunction_##A(void* a, void* b, void* c) \
-{ \
- return (int)RunFunction(my_context, my_GstPadEventFunction_fct_##A, 3, a, b, c); \
+static uintptr_t my_GstPadEventFunction_fct_##A = 0; \
+static int my_GstPadEventFunction_##A(void* a, void* b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my_GstPadEventFunction_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -181,10 +188,10 @@ static void* findGstPadEventFunctionFct(void* fct)
}
//GstBusSyncHandler
#define GO(A) \
-static uintptr_t my_GstBusSyncHandler_fct_##A = 0; \
-static int my_GstBusSyncHandler_##A(void* a, void* b, void* c) \
-{ \
- return (int)RunFunction(my_context, my_GstBusSyncHandler_fct_##A, 3, a, b, c); \
+static uintptr_t my_GstBusSyncHandler_fct_##A = 0; \
+static int my_GstBusSyncHandler_##A(void* a, void* b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my_GstBusSyncHandler_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -200,6 +207,51 @@ static void* findGstBusSyncHandlerFct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstBusSyncHandler callback\n");
return NULL;
}
+
+//GstPluginFeatureFilter
+#define GO(A) \
+static uintptr_t my_GstPluginFeatureFilter_fct_##A = 0; \
+static int my_GstPluginFeatureFilter_##A(void* a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my_GstPluginFeatureFilter_fct_##A, "pp", a, b); \
+}
+SUPER()
+#undef GO
+static void* findGstPluginFeatureFilterFct(void* fct)
+{
+ if(!fct) return fct;
+ #define GO(A) if(my_GstPluginFeatureFilter_fct_##A == (uintptr_t)fct) return my_GstPluginFeatureFilter_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GstPluginFeatureFilter_fct_##A == 0) {my_GstPluginFeatureFilter_fct_##A = (uintptr_t)fct; return my_GstPluginFeatureFilter_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstPluginFeatureFilter callback\n");
+ return NULL;
+}
+
+//GstCapsFilterMapFunc
+#define GO(A) \
+static uintptr_t my_GstCapsFilterMapFunc_fct_##A = 0; \
+static int my_GstCapsFilterMapFunc_##A(void* a, void* b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my_GstCapsFilterMapFunc_fct_##A, "ppp", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* findGstCapsFilterMapFuncFct(void* fct)
+{
+ if(!fct) return fct;
+ #define GO(A) if(my_GstCapsFilterMapFunc_fct_##A == (uintptr_t)fct) return my_GstCapsFilterMapFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GstCapsFilterMapFunc_fct_##A == 0) {my_GstCapsFilterMapFunc_fct_##A = (uintptr_t)fct; return my_GstCapsFilterMapFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstCapsFilterMapFunc callback\n");
+ return NULL;
+}
+
#undef SUPER
EXPORT void my_gst_caps_set_simple(x64emu_t* emu, void* caps, void* field, void* b) {
@@ -303,12 +355,41 @@ EXPORT void* my_gst_buffer_new_wrapped_full(x64emu_t* emu, uint32_t f, void* dat
EXPORT void* my_gst_structure_new(x64emu_t* emu, void* name, void* first, uint64_t* b)
{
- if(!first)
+ if(!first)
return my->gst_structure_new_empty(name);
CREATE_VALIST_FROM_VAARG(b, emu->scratch, 2);
return my->gst_structure_new_valist(name, first, VARARGS);
}
+EXPORT void my_gst_mini_object_set_qdata(x64emu_t* emu, void* object, void* quark, void* data, void* d)
+{
+ my->gst_mini_object_set_qdata(object, quark, data, findDestroyFct(d));
+}
+
+EXPORT void* my_gst_caps_new_simple(x64emu_t* emu, void* type, void* name, void* b)
+{
+ // need to unroll the function here, there is no direct VA equivalent
+ CREATE_VALIST_FROM_VAARG(b, emu->scratch, 2);
+ void* caps = my->gst_caps_new_empty();
+ void* structure = my->gst_structure_new_valist(type, name, VARARGS);
+ if (structure)
+ my->gst_caps_append_structure(caps, structure);
+ else
+ my->gst_caps_replace(&caps, NULL);
+
+ return caps;
+}
+
+EXPORT void* my_gst_registry_feature_filter(x64emu_t* emu, void* reg, void* filter, int first, void* data)
+{
+ return my->gst_registry_feature_filter(reg, findGstPluginFeatureFilterFct(filter), first, data);
+}
+
+EXPORT int my_gst_caps_foreach(x64emu_t* emu, void* caps, void* f, void* data)
+{
+ return my->gst_caps_foreach(caps, findGstCapsFilterMapFuncFct(f), data);
+}
+
#define PRE_INIT \
if(box64_nogtk) \
return -1;
@@ -317,6 +398,7 @@ EXPORT void* my_gst_structure_new(x64emu_t* emu, void* name, void* first, uint64
getMy(lib); \
SetGstObjectID(my->gst_object_get_type()); \
SetGstAllocatorID(my->gst_allocator_get_type()); \
+ SetGstTaskPoolID(my->gst_task_pool_get_type()); \
setNeededLibs(lib, 1, "libgtk-3.so.0");
#define CUSTOM_FINI \
diff --git a/src/wrapped/wrappedgstreamer_private.h b/src/wrapped/wrappedgstreamer_private.h
index 3e48153..696de89 100644
--- a/src/wrapped/wrappedgstreamer_private.h
+++ b/src/wrapped/wrappedgstreamer_private.h
@@ -2,7 +2,7 @@
#error meh!
#endif
-//GO(gst_allocation_params_copy,
+GO(gst_allocation_params_copy, pFp)
//GO(gst_allocation_params_free,
//GO(gst_allocation_params_get_type,
//GO(gst_allocation_params_init,
@@ -25,10 +25,10 @@ GO(gst_bin_add, iFpp)
//GOM(gst_bin_add_many, vFppV)
GO(gst_bin_find_unlinked_pad, pFpi)
GO(gst_bin_flags_get_type, pFv)
-GO(gst_bin_get_by_interface, pFpp)
+GO(gst_bin_get_by_interface, pFpL)
GO(gst_bin_get_by_name, pFpp)
GO(gst_bin_get_by_name_recurse_up, pFpp)
-GO(gst_bin_get_suppressed_flags, iFp)
+GO(gst_bin_get_suppressed_flags, uFp)
GO(gst_bin_get_type, pFv)
GO(gst_bin_iterate_all_by_element_factory_name, pFpp)
GO(gst_bin_iterate_all_by_interface, pFpp)
@@ -41,7 +41,7 @@ GO(gst_bin_new, pFp)
GO(gst_bin_recalculate_latency, iFp)
GO(gst_bin_remove, iFpp)
//GOM(gst_bin_remove_many, iFEppV)
-GO(gst_bin_set_suppressed_flags, vFpi)
+GO(gst_bin_set_suppressed_flags, vFpu)
GO(gst_bin_sync_children_states, iFp)
GO(gst_bitmask_get_type, pFv)
DATAB(_gst_bitmask_type, sizeof(void*))
@@ -82,21 +82,21 @@ GO(gst_buffer_is_all_memory_writable, iFp)
GO(gst_buffer_is_memory_range_writable, iFpui)
GO(gst_buffer_iterate_meta, pFpp)
GO(gst_buffer_iterate_meta_filtered, pFppp)
-//GO(gst_buffer_list_calculate_size,
+GO(gst_buffer_list_calculate_size, LFp)
//GO(gst_buffer_list_copy,
-//GO(gst_buffer_list_copy_deep,
+GO(gst_buffer_list_copy_deep, pFp)
//GO(gst_buffer_list_foreach,
//GO(gst_buffer_list_get,
//GO(gst_buffer_list_get_type,
//GO(gst_buffer_list_get_writable,
//GO(gst_buffer_list_insert,
-//GO(gst_buffer_list_length,
-//GO(gst_buffer_list_new,
-//GO(gst_buffer_list_new_sized,
-//GO(gst_buffer_list_ref,
-//GO(gst_buffer_list_remove,
+GO(gst_buffer_list_length, uFp)
+GO(gst_buffer_list_new, pFv)
+GO(gst_buffer_list_new_sized, pFu)
+GO(gst_buffer_list_ref, pFp)
+GO(gst_buffer_list_remove, vFpuu)
//GO(gst_buffer_list_replace,
-//GO(gst_buffer_list_take,
+GO(gst_buffer_list_take, iFpp)
//DATAB(_gst_buffer_list_type,
//GO(gst_buffer_list_unref,
GO(gst_buffer_map, iFppi)
@@ -110,27 +110,27 @@ GO(gst_buffer_new_wrapped_bytes, pFp)
GOM(gst_buffer_new_wrapped_full, pFEiplllpp)
GO(gst_buffer_n_memory, uFp)
GO(gst_buffer_peek_memory, pFpu)
-//GO(gst_buffer_pool_acquire_buffer,
+GO(gst_buffer_pool_acquire_buffer, iFppp)
//GO(gst_buffer_pool_acquire_flags_get_type,
GO(gst_buffer_pool_config_add_option, vFpp)
-//GO(gst_buffer_pool_config_get_allocator,
-//GO(gst_buffer_pool_config_get_option,
-//GO(gst_buffer_pool_config_get_params,
-//GO(gst_buffer_pool_config_has_option,
-//GO(gst_buffer_pool_config_n_options,
+GO(gst_buffer_pool_config_get_allocator, iFppp)
+GO(gst_buffer_pool_config_get_option, pFpu)
+GO(gst_buffer_pool_config_get_params, iFppppp)
+GO(gst_buffer_pool_config_has_option, iFpp)
+GO(gst_buffer_pool_config_n_options, uFp)
GO(gst_buffer_pool_config_set_allocator, vFppp)
GO(gst_buffer_pool_config_set_params, vFppuuu)
//GO(gst_buffer_pool_config_validate_params,
GO(gst_buffer_pool_get_config, pFp)
-//GO(gst_buffer_pool_get_options,
+GO(gst_buffer_pool_get_options, pFp)
//GO(gst_buffer_pool_get_type,
-//GO(gst_buffer_pool_has_option,
-//GO(gst_buffer_pool_is_active,
-//GO(gst_buffer_pool_new,
+GO(gst_buffer_pool_has_option, iFpp)
+GO(gst_buffer_pool_is_active, iFp)
+GO(gst_buffer_pool_new, pFv)
//GO(gst_buffer_pool_release_buffer,
GO(gst_buffer_pool_set_active, iFpi)
GO(gst_buffer_pool_set_config, iFpp)
-//GO(gst_buffer_pool_set_flushing,
+GO(gst_buffer_pool_set_flushing, vFpi)
GO(gst_buffer_prepend_memory, vFpp)
GO(gst_buffer_ref, pFp)
GO(gst_buffer_remove_all_memory, vFp)
@@ -175,7 +175,7 @@ GO(gst_bus_sync_reply_get_type, pFv)
GO(gst_bus_sync_signal_handler, iFppp)
GO(gst_bus_timed_pop, pFpU)
GO(gst_bus_timed_pop_filtered, pFpUi)
-//GO(gst_calculate_linear_regression,
+GO(gst_calculate_linear_regression, iFppuppppp)
//DATAB(_gst_caps_any,
GO(gst_caps_append, vFpp)
GO(gst_caps_append_structure, vFpp)
@@ -186,33 +186,33 @@ GO(gst_caps_copy_nth, pFpu)
//GOM(gst_caps_features_add, vFEpBp)
//GO(gst_caps_features_add_id,
//DATAB(_gst_caps_features_any,
-//GO(gst_caps_features_contains,
-//GO(gst_caps_features_contains_id,
-//GO(gst_caps_features_copy,
+GO(gst_caps_features_contains, iFpp)
+GO(gst_caps_features_contains_id, iFpu)
+GO(gst_caps_features_copy, pFp)
//GO(gst_caps_features_free,
-//GO(gst_caps_features_from_string,
-//GO(gst_caps_features_get_nth,
-//GO(gst_caps_features_get_nth_id,
-//GO(gst_caps_features_get_size,
+GO(gst_caps_features_from_string, pFp)
+GO(gst_caps_features_get_nth, pFpu)
+GO(gst_caps_features_get_nth_id, uFpu)
+GO(gst_caps_features_get_size, uFp)
//GO(gst_caps_features_get_type,
-//GO(gst_caps_features_is_any,
-//GO(gst_caps_features_is_equal,
+GO(gst_caps_features_is_any, iFp)
+GO(gst_caps_features_is_equal, iFpp)
//DATAB(_gst_caps_features_memory_system_memory,
//GO(gst_caps_features_new,
-//GO(gst_caps_features_new_any,
+GO(gst_caps_features_new_any, pFv)
//GO(gst_caps_features_new_empty,
//GO(gst_caps_features_new_id,
-//GO(gst_caps_features_new_id_valist,
-//GO(gst_caps_features_new_valist,
-//GO(gst_caps_features_remove,
-//GO(gst_caps_features_remove_id,
-//GO(gst_caps_features_set_parent_refcount,
-//GO(gst_caps_features_to_string,
+GO(gst_caps_features_new_id_valist, pFup)
+GO(gst_caps_features_new_valist, pFpp)
+GO(gst_caps_features_remove, vFpp)
+GO(gst_caps_features_remove_id, vFpu)
+GO(gst_caps_features_set_parent_refcount, iFpp)
+GO(gst_caps_features_to_string, pFp)
//DATAB(_gst_caps_features_type,
//GO(gst_caps_filter_and_map_in_place,
GO(gst_caps_fixate, pFp)
GO(gst_caps_flags_get_type, pFv)
-//GOM(gst_caps_foreach, iFEpBp)
+GOM(gst_caps_foreach, iFEppp)
GO(gst_caps_from_string, pFp)
GO(gst_caps_get_features, pFpu)
GO(gst_caps_get_size, uFp)
@@ -240,7 +240,7 @@ GO(gst_caps_new_empty, pFv)
GO(gst_caps_new_empty_simple, pFp)
//GOM(gst_caps_new_full, pFEpV)
//GOM(gst_caps_new_full_valist, pFEpA)
-//GOM(gst_caps_new_simple, pFppV)
+GOM(gst_caps_new_simple, pFEppV)
//DATAB(_gst_caps_none,
GO(gst_caps_normalize, pFp)
GO(gst_caps_ref, pFp)
@@ -257,7 +257,7 @@ GO(gst_caps_subtract, pFpp)
GO(gst_caps_take, iFpp)
GO(gst_caps_to_string, pFp)
GO(gst_caps_truncate, pFp)
-//DATAB(_gst_caps_type,
+DATAB(_gst_caps_type, sizeof(void*))
GO(gst_caps_unref, vFp)
//DATAB(GST_CAT_BUFFER,
//DATAB(GST_CAT_BUFFER_LIST,
@@ -266,7 +266,7 @@ GO(gst_caps_unref, vFp)
//DATAB(GST_CAT_CAPS,
//DATAB(GST_CAT_CLOCK,
//DATAB(GST_CAT_CONTEXT,
-//DATAB(GST_CAT_DEFAULT,
+DATAB(GST_CAT_DEFAULT, sizeof(void*))
//DATAB(GST_CAT_ELEMENT_PADS,
//DATAB(GST_CAT_ERROR_SYSTEM,
//DATAB(GST_CAT_EVENT,
@@ -292,85 +292,85 @@ GO(gst_caps_unref, vFp)
//DATAB(GST_CAT_SIGNAL,
//DATAB(GST_CAT_STATES,
//GO(gst_child_proxy_child_added,
-//GO(gst_child_proxy_child_removed,
+GO(gst_child_proxy_child_removed, vFppp)
//GO(gst_child_proxy_get,
-//GO(gst_child_proxy_get_child_by_index,
+GO(gst_child_proxy_get_child_by_index, pFpu)
//GO(gst_child_proxy_get_child_by_name,
-//GO(gst_child_proxy_get_children_count,
-//GO(gst_child_proxy_get_property,
+GO(gst_child_proxy_get_children_count, uFp)
+GO(gst_child_proxy_get_property, vFppp)
//GO(gst_child_proxy_get_type,
//GO(gst_child_proxy_get_valist,
-//GO(gst_child_proxy_lookup,
+GO(gst_child_proxy_lookup, iFpppp)
//GO(gst_child_proxy_set,
-//GO(gst_child_proxy_set_property,
+GO(gst_child_proxy_set_property, vFppp)
//GO(gst_child_proxy_set_valist,
//GO(gst_clear_buffer,
//GO(gst_clear_buffer_list,
GO(gst_clear_caps, vFp)
GO(gst_clear_event, vFp)
GO(gst_clear_message, vFp)
-//GO(gst_clear_mini_object,
+GO(gst_clear_mini_object, vFp)
//GO(gst_clear_object,
GO(gst_clear_query, vFp)
GO(gst_clear_structure, vFp)
//GO(gst_clear_tag_list,
//GO(gst_clear_uri,
-//GO(gst_clock_add_observation,
-//GO(gst_clock_add_observation_unapplied,
+GO(gst_clock_add_observation, iFpLLp)
+GO(gst_clock_add_observation_unapplied, iFpLLppppp)
//GO(gst_clock_adjust_unlocked,
//GO(gst_clock_adjust_with_calibration,
//GO(gst_clock_entry_type_get_type,
//GO(gst_clock_flags_get_type,
-//GO(gst_clock_get_calibration,
-//GO(gst_clock_get_internal_time,
-//GO(gst_clock_get_master,
+GO(gst_clock_get_calibration, vFppppp)
+GO(gst_clock_get_internal_time, LFp)
+GO(gst_clock_get_master, pFp)
//GO(gst_clock_get_resolution,
//GO(gst_clock_get_time,
//GO(gst_clock_get_timeout,
//GO(gst_clock_get_type,
//GO(gst_clock_id_compare_func,
-//GO(gst_clock_id_get_clock,
-//GO(gst_clock_id_get_time,
-//GO(gst_clock_id_ref,
+GO(gst_clock_id_get_clock, pFp)
+GO(gst_clock_id_get_time, LFp)
+GO(gst_clock_id_ref, pFp)
//GO(gst_clock_id_unref,
-//GO(gst_clock_id_unschedule,
-//GO(gst_clock_id_uses_clock,
-//GO(gst_clock_id_wait,
+GO(gst_clock_id_unschedule, vFp)
+GO(gst_clock_id_uses_clock, iFpp)
+GO(gst_clock_id_wait, uFpp)
//GO(gst_clock_id_wait_async,
-//GO(gst_clock_is_synced,
-//GO(gst_clock_new_periodic_id,
-//GO(gst_clock_new_single_shot_id,
-//GO(gst_clock_periodic_id_reinit,
+GO(gst_clock_is_synced, iFp)
+GO(gst_clock_new_periodic_id, pFpLL)
+GO(gst_clock_new_single_shot_id, pFpL)
+GO(gst_clock_periodic_id_reinit, iFppLL)
//GO(gst_clock_return_get_type,
-//GO(gst_clock_set_calibration,
-//GO(gst_clock_set_master,
+GO(gst_clock_set_calibration, vFpLLLL)
+GO(gst_clock_set_master, iFpp)
//GO(gst_clock_set_resolution,
-//GO(gst_clock_set_synced,
-//GO(gst_clock_set_timeout,
-//GO(gst_clock_single_shot_id_reinit,
+GO(gst_clock_set_synced, vFpi)
+GO(gst_clock_set_timeout, vFpL)
+GO(gst_clock_single_shot_id_reinit, iFppL)
//GO(gst_clock_type_get_type,
-//GO(gst_clock_unadjust_unlocked,
-//GO(gst_clock_unadjust_with_calibration,
-//GO(gst_clock_wait_for_sync,
-//GO(gst_context_copy,
-//GO(gst_context_get_context_type,
-//GO(gst_context_get_structure,
+GO(gst_clock_unadjust_unlocked, LFpL)
+GO(gst_clock_unadjust_with_calibration, LFpLLLLL)
+GO(gst_clock_wait_for_sync, iFpL)
+GO(gst_context_copy, pFp)
+GO(gst_context_get_context_type, pFp)
+GO(gst_context_get_structure, pFp)
//GO(gst_context_get_type,
-//GO(gst_context_has_context_type,
-//GO(gst_context_is_persistent,
+GO(gst_context_has_context_type, iFpp)
+GO(gst_context_is_persistent, iFp)
GO(gst_context_new, pFpi)
-//GO(gst_context_ref,
-//GO(gst_context_replace,
+GO(gst_context_ref, pFp)
+GO(gst_context_replace, iFpp)
//DATAB(_gst_context_type,
//GO(gst_context_unref,
-//GO(gst_context_writable_structure,
-//GO(gst_control_binding_get_g_value_array,
+GO(gst_context_writable_structure, pFp)
+GO(gst_control_binding_get_g_value_array, iFpLLup)
//GO(gst_control_binding_get_type,
-//GO(gst_control_binding_get_value,
-//GO(gst_control_binding_get_value_array,
-//GO(gst_control_binding_is_disabled,
-//GO(gst_control_binding_set_disabled,
-//GO(gst_control_binding_sync_values,
+GO(gst_control_binding_get_value, pFpL)
+GO(gst_control_binding_get_value_array, iFpLLup)
+GO(gst_control_binding_is_disabled, iFp)
+GO(gst_control_binding_set_disabled, vFpi)
+GO(gst_control_binding_sync_values, iFppLL)
//GO(gst_control_source_get_type,
//GO(gst_control_source_get_value,
//GO(gst_control_source_get_value_array,
@@ -378,68 +378,68 @@ GO(gst_context_new, pFpi)
//GO(gst_core_error_quark,
//GO(gst_date_time_get_day,
//GO(gst_date_time_get_hour,
-//GO(gst_date_time_get_microsecond,
+GO(gst_date_time_get_microsecond, iFp)
//GO(gst_date_time_get_minute,
//GO(gst_date_time_get_month,
//GO(gst_date_time_get_second,
-//GO(gst_date_time_get_time_zone_offset,
+GO(gst_date_time_get_time_zone_offset, fFp)
//GO(gst_date_time_get_type,
//GO(gst_date_time_get_year,
//GO(gst_date_time_has_day,
//GO(gst_date_time_has_month,
-//GO(gst_date_time_has_second,
+GO(gst_date_time_has_second, iFp)
//GO(gst_date_time_has_time,
//GO(gst_date_time_has_year,
-//GO(gst_date_time_new,
-//GO(gst_date_time_new_from_g_date_time,
-//GO(gst_date_time_new_from_iso8601_string,
+GO(gst_date_time_new, pFfiiiiid)
+GO(gst_date_time_new_from_g_date_time, pFp)
+GO(gst_date_time_new_from_iso8601_string, pFp)
//GO(gst_date_time_new_from_unix_epoch_local_time,
//GO(gst_date_time_new_from_unix_epoch_local_time_usecs,
//GO(gst_date_time_new_from_unix_epoch_utc,
-//GO(gst_date_time_new_from_unix_epoch_utc_usecs,
-//GO(gst_date_time_new_local_time,
+GO(gst_date_time_new_from_unix_epoch_utc_usecs, pFl)
+GO(gst_date_time_new_local_time, pFiiiiid)
//GO(gst_date_time_new_now_local_time,
-//GO(gst_date_time_new_now_utc,
-//GO(gst_date_time_new_y,
-//GO(gst_date_time_new_ym,
-//GO(gst_date_time_new_ymd,
-//GO(gst_date_time_ref,
-//GO(gst_date_time_to_g_date_time,
-//GO(gst_date_time_to_iso8601_string,
-//DATAB(_gst_date_time_type,
+GO(gst_date_time_new_now_utc, pFv)
+GO(gst_date_time_new_y, pFi)
+GO(gst_date_time_new_ym, pFii)
+GO(gst_date_time_new_ymd, pFiii)
+GO(gst_date_time_ref, pFp)
+GO(gst_date_time_to_g_date_time, pFp)
+GO(gst_date_time_to_iso8601_string, pFp)
+DATAB(_gst_date_time_type, sizeof(void*))
//GO(gst_date_time_unref,
//GO(gst_debug_add_log_function,
-//GO(gst_debug_add_ring_buffer_logger,
-//GO(gst_debug_bin_to_dot_data,
+GO(gst_debug_add_ring_buffer_logger, vFuu)
+GO(gst_debug_bin_to_dot_data, pFpi)
//GO(gst_debug_bin_to_dot_file,
-//GO(gst_debug_bin_to_dot_file_with_ts,
+GO(gst_debug_bin_to_dot_file_with_ts, vFpip)
//GO(gst_debug_category_free,
-//GO(gst_debug_category_get_color,
-//GO(gst_debug_category_get_description,
+GO(gst_debug_category_get_color, uFp)
+GO(gst_debug_category_get_description, pFp)
//GO(gst_debug_category_get_name,
-GO(gst_debug_category_get_threshold, iFp)
-GO(_gst_debug_category_new, pFppp)
-//GO(gst_debug_category_reset_threshold,
-//GO(gst_debug_category_set_threshold,
+GO(gst_debug_category_get_threshold, uFp)
+GO(_gst_debug_category_new, pFpup)
+GO(gst_debug_category_reset_threshold, vFp)
+GO(gst_debug_category_set_threshold, vFpu)
//GO(gst_debug_color_flags_get_type,
//GO(gst_debug_color_mode_get_type,
-//GO(gst_debug_construct_term_color,
-//GO(gst_debug_construct_win_color,
-//GO(_gst_debug_dump_mem,
+GO(gst_debug_construct_term_color, pFu)
+GO(gst_debug_construct_win_color, iFu)
+GO(_gst_debug_dump_mem, vFpppipppu)
//DATAB(_gst_debug_enabled,
-//GO(gst_debug_get_all_categories,
-//GO(_gst_debug_get_category,
-//GO(gst_debug_get_color_mode,
-//GO(gst_debug_get_default_threshold,
-//GO(gst_debug_get_stack_trace,
+GO(gst_debug_get_all_categories, pFv)
+GO(_gst_debug_get_category, pFp)
+GO(gst_debug_get_color_mode, uFv)
+GO(gst_debug_get_default_threshold, uFv)
+GO(gst_debug_get_stack_trace, pFu)
//GO(gst_debug_graph_details_get_type,
//GO(gst_debug_is_active,
//GO(gst_debug_is_colored,
-//GO(gst_debug_level_get_name,
+GO(gst_debug_level_get_name, pFu)
//GO(gst_debug_level_get_type,
GOM(gst_debug_log, vFEpippippV)
-//GO(gst_debug_log_default,
-//GO(gst_debug_log_get_line,
+GO(gst_debug_log_default, vFpuppippp)
+GO(gst_debug_log_get_line, pFpuppipp)
GOM(gst_debug_log_valist, vFEpippippA)
//GO(gst_debug_message_get,
DATAB(_gst_debug_min, sizeof(int))
@@ -447,35 +447,35 @@ DATAB(_gst_debug_min, sizeof(int))
//GO(gst_debug_print_stack_trace,
//GO(_gst_debug_register_funcptr,
//GO(gst_debug_remove_log_function,
-//GO(gst_debug_remove_log_function_by_data,
+GO(gst_debug_remove_log_function_by_data, uFp)
//GO(gst_debug_remove_ring_buffer_logger,
-//GO(gst_debug_ring_buffer_logger_get_logs,
+GO(gst_debug_ring_buffer_logger_get_logs, pFv)
//GO(gst_debug_set_active,
//GO(gst_debug_set_colored,
-//GO(gst_debug_set_color_mode,
+GO(gst_debug_set_color_mode, vFu)
//GO(gst_debug_set_color_mode_from_string,
-//GO(gst_debug_set_default_threshold,
-//GO(gst_debug_set_threshold_for_name,
-//GO(gst_debug_set_threshold_from_string,
-//GO(gst_debug_unset_threshold_for_name,
+GO(gst_debug_set_default_threshold, vFu)
+GO(gst_debug_set_threshold_for_name, vFpu)
+GO(gst_debug_set_threshold_from_string, vFpi)
+GO(gst_debug_unset_threshold_for_name, vFp)
GO(gst_deinit, vFv)
-//GO(gst_device_create_element,
+GO(gst_device_create_element, pFpp)
//GO(gst_device_get_caps,
-//GO(gst_device_get_device_class,
+GO(gst_device_get_device_class, pFp)
//GO(gst_device_get_display_name,
-//GO(gst_device_get_properties,
+GO(gst_device_get_properties, pFp)
//GO(gst_device_get_type,
-//GO(gst_device_has_classes,
-//GO(gst_device_has_classesv,
+GO(gst_device_has_classes, iFpp)
+GO(gst_device_has_classesv, iFpp)
//GO(gst_device_monitor_add_filter,
-//GO(gst_device_monitor_get_bus,
-//GO(gst_device_monitor_get_devices,
-//GO(gst_device_monitor_get_providers,
-//GO(gst_device_monitor_get_show_all_devices,
+GO(gst_device_monitor_get_bus, pFp)
+GO(gst_device_monitor_get_devices, pFp)
+GO(gst_device_monitor_get_providers, pFp)
+GO(gst_device_monitor_get_show_all_devices, iFp)
//GO(gst_device_monitor_get_type,
-//GO(gst_device_monitor_new,
-//GO(gst_device_monitor_remove_filter,
-//GO(gst_device_monitor_set_show_all_devices,
+GO(gst_device_monitor_new, pFv)
+GO(gst_device_monitor_remove_filter, iFpu)
+GO(gst_device_monitor_set_show_all_devices, vFpi)
//GO(gst_device_monitor_start,
//GO(gst_device_monitor_stop,
//GO(gst_device_provider_can_monitor,
@@ -485,42 +485,42 @@ GO(gst_deinit, vFv)
//GO(gst_device_provider_class_set_metadata,
//GO(gst_device_provider_class_set_static_metadata,
//GO(gst_device_provider_device_add,
-//GO(gst_device_provider_device_changed,
-//GO(gst_device_provider_device_remove,
-//GO(gst_device_provider_factory_find,
-//GO(gst_device_provider_factory_get,
-//GO(gst_device_provider_factory_get_by_name,
-//GO(gst_device_provider_factory_get_device_provider_type,
-//GO(gst_device_provider_factory_get_metadata,
-//GO(gst_device_provider_factory_get_metadata_keys,
+GO(gst_device_provider_device_changed, vFppp)
+GO(gst_device_provider_device_remove, vFpp)
+GO(gst_device_provider_factory_find, pFp)
+GO(gst_device_provider_factory_get, pFp)
+GO(gst_device_provider_factory_get_by_name, pFp)
+GO(gst_device_provider_factory_get_device_provider_type, LFp)
+GO(gst_device_provider_factory_get_metadata, pFpp)
+GO(gst_device_provider_factory_get_metadata_keys, pFp)
//GO(gst_device_provider_factory_get_type,
-//GO(gst_device_provider_factory_has_classes,
-//GO(gst_device_provider_factory_has_classesv,
-//GO(gst_device_provider_factory_list_get_device_providers,
-//GO(gst_device_provider_get_bus,
-//GO(gst_device_provider_get_devices,
-//GO(gst_device_provider_get_factory,
-//GO(gst_device_provider_get_hidden_providers,
-//GO(gst_device_provider_get_metadata,
+GO(gst_device_provider_factory_has_classes, iFpp)
+GO(gst_device_provider_factory_has_classesv, iFpp)
+GO(gst_device_provider_factory_list_get_device_providers, pFu)
+GO(gst_device_provider_get_bus, pFp)
+GO(gst_device_provider_get_devices, pFp)
+GO(gst_device_provider_get_factory, pFp)
+GO(gst_device_provider_get_hidden_providers, pFp)
+GO(gst_device_provider_get_metadata, pFpp)
//GO(gst_device_provider_get_type,
//GO(gst_device_provider_hide_provider,
-//GO(gst_device_provider_register,
+GO(gst_device_provider_register, iFppuL)
//GO(gst_device_provider_start,
//GO(gst_device_provider_stop,
-//GO(gst_device_provider_unhide_provider,
-//GO(gst_device_reconfigure_element,
+GO(gst_device_provider_unhide_provider, vFpp)
+GO(gst_device_reconfigure_element, iFpp)
//DATAB(_gst_disable_registry_cache,
//GO(gst_double_range_get_type,
//DATAB(_gst_double_range_type,
//GO(gst_dynamic_type_factory_get_type,
-//GO(gst_dynamic_type_factory_load,
-//GO(gst_dynamic_type_register,
+GO(gst_dynamic_type_factory_load, LFp)
+GO(gst_dynamic_type_register, iFpL)
GO(gst_element_abort_state, vFp)
GO(gst_element_add_pad, iFpp)
GO(gst_element_add_property_deep_notify_watch, LFppi)
GO(gst_element_add_property_notify_watch, LFppi)
//GOM(gst_element_call_async, vFEpBpB)
-GO(gst_element_change_state, iFpi)
+GO(gst_element_change_state, uFpu)
GO(gst_element_class_add_metadata, vFppp)
GO(gst_element_class_add_pad_template, vFpp)
GO(gst_element_class_add_static_metadata, vFppp)
@@ -531,7 +531,7 @@ GO(gst_element_class_get_pad_template, pFpp)
GO(gst_element_class_get_pad_template_list, pFp)
GO(gst_element_class_set_metadata, vFppppp)
GO(gst_element_class_set_static_metadata, vFppppp)
-GO(gst_element_continue_state, iFpi)
+GO(gst_element_continue_state, uFpu)
//GOM(gst_element_create_all_pads, iFEpBp)
//GO(_gst_element_error_printf,
GO(gst_element_factory_can_sink_all_caps, iFpp)
@@ -540,18 +540,18 @@ GO(gst_element_factory_can_src_all_caps, iFpp)
GO(gst_element_factory_can_src_any_caps, iFpp)
GO(gst_element_factory_create, pFpp)
GO(gst_element_factory_find, pFp)
-GO(gst_element_factory_get_element_type, pFp)
+GO(gst_element_factory_get_element_type, LFp)
GO(gst_element_factory_get_metadata, pFpp)
GO(gst_element_factory_get_metadata_keys, pFp)
GO(gst_element_factory_get_num_pad_templates, uFp)
GO(gst_element_factory_get_static_pad_templates, pFp)
GO(gst_element_factory_get_type, pFv)
GO(gst_element_factory_get_uri_protocols, pFp)
-GO(gst_element_factory_get_uri_type, iFp)
+GO(gst_element_factory_get_uri_type, uFp)
GO(gst_element_factory_has_interface, iFpp)
GO(gst_element_factory_list_filter, pFppii)
-GO(gst_element_factory_list_get_elements, pFpi)
-GO(gst_element_factory_list_is_type, iFpi)
+GO(gst_element_factory_list_get_elements, pFLu)
+GO(gst_element_factory_list_is_type, iFpL)
GO(gst_element_factory_make, pFpp)
GO(gst_element_flags_get_type, pFv)
//GOM(gst_element_foreach_pad, iFEpBp)
@@ -565,7 +565,7 @@ GO(gst_element_get_compatible_pad_template, pFpp)
GO(gst_element_get_context, pFpp)
GO(gst_element_get_contexts, pFp)
GO(gst_element_get_context_unlocked, pFpp)
-GO(gst_element_get_current_clock_time, UFp)
+GO(gst_element_get_current_clock_time, LFp)
GO(gst_element_get_current_running_time, UFp)
GO(gst_element_get_factory, pFp)
GO(gst_element_get_metadata, pFpp)
@@ -573,7 +573,7 @@ GO(gst_element_get_pad_template, pFpp)
GO(gst_element_get_pad_template_list, pFp)
//GO(gst_element_get_request_pad,
GO(gst_element_get_start_time, UFp)
-GO(gst_element_get_state, iFpppU)
+GO(gst_element_get_state, uFpppL)
GO(gst_element_get_static_pad, pFpp)
GO(gst_element_get_type, pFv)
GO(gst_element_is_locked_state, iFp)
@@ -585,40 +585,40 @@ GO(gst_element_link_filtered, iFppp)
//GOM(gst_element_link_many, iFEppV)
GO(gst_element_link_pads, iFpppp)
GO(gst_element_link_pads_filtered, iFppppp)
-GO(gst_element_link_pads_full, iFppppi)
+GO(gst_element_link_pads_full, iFppppu)
GO(gst_element_lost_state, vFp)
-GO(gst_element_make_from_uri, pFpppp)
-GO(gst_element_message_full, vFpipippppi)
-GO(gst_element_message_full_with_details, vFpipippppip)
+GO(gst_element_make_from_uri, pFuppp)
+GO(gst_element_message_full, vFpiuippppi)
+GO(gst_element_message_full_with_details, vFpiuippppip)
GO(gst_element_no_more_pads, vFp)
GO(gst_element_post_message, iFpp)
GO(gst_element_provide_clock, pFp)
GO(gst_element_query, iFpp)
-GO(gst_element_query_convert, iFpiIip)
-GO(gst_element_query_duration, iFpip)
+GO(gst_element_query_convert, iFpulup)
+GO(gst_element_query_duration, iFpup)
GO(gst_element_query_position, iFpip)
GO(gst_element_register, iFppup)
GO(gst_element_release_request_pad, vFpp)
GO(gst_element_remove_pad, iFpp)
GO(gst_element_remove_property_notify_watch, vFpL)
GO(gst_element_request_pad, pFpppp)
-GO(gst_element_seek, iFpdiiiIiI)
-GO(gst_element_seek_simple, iFpiiI)
+GO(gst_element_seek, iFpduuulul)
+GO(gst_element_seek_simple, iFpuul)
GO(gst_element_send_event, iFpp)
GO(gst_element_set_base_time, vFpU)
GO(gst_element_set_bus, vFpp)
GO(gst_element_set_clock, iFpp)
GO(gst_element_set_context, vFpp)
GO(gst_element_set_locked_state, iFpi)
-GO(gst_element_set_start_time, vFpU)
-GO(gst_element_set_state, iFpi)
-GO(gst_element_state_change_return_get_name, pFi)
-GO(gst_element_state_get_name, pFi)
+GO(gst_element_set_start_time, vFpL)
+GO(gst_element_set_state, uFpu)
+GO(gst_element_state_change_return_get_name, pFu)
+GO(gst_element_state_get_name, pFu)
GO(gst_element_sync_state_with_parent, iFp)
GO(gst_element_unlink, vFpp)
//GOM(gst_element_unlink_many, vFEppV)
GO(gst_element_unlink_pads, vFpppp)
-//GO(gst_error_get_message,
+GO(gst_error_get_message, pFui)
GO(gst_event_copy, pFp)
GO(gst_event_copy_segment, vFpp)
GO(gst_event_get_running_time_offset, IFp)
@@ -688,33 +688,33 @@ GO(gst_event_set_stream, vFpp)
GO(gst_event_set_stream_flags, vFpi)
GO(gst_event_steal, pFp)
GO(gst_event_take, iFpp)
-//DATAB(_gst_event_type,
+DATAB(_gst_event_type, sizeof(void*))
GO(gst_event_type_flags_get_type, pFv)
-GO(gst_event_type_get_flags, iFp)
-GO(gst_event_type_get_name, pFi)
+GO(gst_event_type_get_flags, uFu)
+GO(gst_event_type_get_name, pFu)
GO(gst_event_type_get_type, pFv)
-GO(gst_event_type_to_quark, pFi)
+GO(gst_event_type_to_quark, uFu)
GO(gst_event_unref, vFp)
GO(gst_event_writable_structure, pFp)
//DATAB(_gst_executable_path,
-//GO(gst_filename_to_uri,
+GO(gst_filename_to_uri, pFpp)
//GO(gst_flagset_get_type,
-//GO(gst_flagset_register,
+GO(gst_flagset_register, LFL)
//DATAB(_gst_flagset_type,
GO(gst_flow_get_name, pFi)
GO(gst_flow_return_get_type, pFv)
-GO(gst_flow_to_quark, pFi)
-GO(gst_format_get_by_nick, iFp)
-GO(gst_format_get_details, pFi)
-GO(gst_format_get_name, pFi)
+GO(gst_flow_to_quark, uFi)
+GO(gst_format_get_by_nick, uFp)
+GO(gst_format_get_details, pFu)
+GO(gst_format_get_name, pFu)
GO(gst_format_get_type, pFv)
GO(gst_format_iterate_definitions, pFv)
-GO(gst_format_register, iFpp)
-GO(gst_formats_contains, iFpi)
-GO(gst_format_to_quark, pFi)
+GO(gst_format_register, uFpp)
+GO(gst_formats_contains, iFpu)
+GO(gst_format_to_quark, uFu)
GO(gst_fraction_get_type, pFv)
GO(gst_fraction_range_get_type, pFv)
-//DATAB(_gst_fraction_range_type,
+DATAB(_gst_fraction_range_type, sizeof(void*))
DATAB(_gst_fraction_type, sizeof(void*))
GO(gst_get_main_executable_path, pFv)
//GO(gst_ghost_pad_activate_mode_default,
@@ -737,24 +737,24 @@ GO(gst_init_get_option_group, pFv)
//GO(gst_int64_range_get_type,
//DATAB(_gst_int64_range_type,
//GO(gst_int_range_get_type,
-//DATAB(_gst_int_range_type,
-//GO(gst_is_caps_features,
+DATAB(_gst_int_range_type, sizeof(void*))
+GO(gst_is_caps_features, iFp)
GO(gst_is_initialized, iFv)
//GO(gst_iterator_copy,
//GO(gst_iterator_filter,
//GO(gst_iterator_find_custom,
//GO(gst_iterator_fold,
//GO(gst_iterator_foreach,
-//GO(gst_iterator_free,
+GO(gst_iterator_free, vFp)
//GO(gst_iterator_get_type,
//GO(gst_iterator_item_get_type,
//GO(gst_iterator_new,
//GO(gst_iterator_new_list,
//GO(gst_iterator_new_single,
-//GO(gst_iterator_next,
+GO(gst_iterator_next, iFpp)
//GO(gst_iterator_push,
//GO(gst_iterator_result_get_type,
-//GO(gst_iterator_resync,
+GO(gst_iterator_resync, vFp)
//GO(gst_library_error_get_type,
//GO(gst_library_error_quark,
//GO(gst_lock_flags_get_type,
@@ -878,15 +878,15 @@ GO(gst_message_streams_selected_add, vFpp)
GO(gst_message_streams_selected_get_size, uFp)
GO(gst_message_streams_selected_get_stream, pFpu)
GO(gst_message_take, iFpp)
-//DATAB(_gst_message_type,
+DATAB(_gst_message_type, sizeof(void*))
GO(gst_message_type_get_name, pFi)
GO(gst_message_type_get_type, pFv)
-GO(gst_message_type_to_quark, pFi)
+GO(gst_message_type_to_quark, uFi)
GO(gst_message_unref, vFp)
GO(gst_message_writable_structure, pFp)
-//GO(gst_meta_api_type_get_tags,
-//GO(gst_meta_api_type_has_tag,
-//GO(gst_meta_api_type_register,
+GO(gst_meta_api_type_get_tags, pFL)
+GO(gst_meta_api_type_has_tag, iFLu)
+GO(gst_meta_api_type_register, LFpp)
//GO(gst_meta_compare_seqnum,
//GO(gst_meta_flags_get_type,
//GO(gst_meta_get_info,
@@ -895,9 +895,9 @@ GO(gst_message_writable_structure, pFp)
//DATAB(_gst_meta_tag_memory,
//DATAB(_gst_meta_transform_copy,
//GO(gst_mini_object_add_parent,
-//GO(gst_mini_object_copy,
+GO(gst_mini_object_copy, pFp)
//GO(gst_mini_object_flags_get_type,
-//GO(gst_mini_object_get_qdata,
+GO(gst_mini_object_get_qdata, pFpp)
//GO(gst_mini_object_init,
GO(gst_mini_object_is_writable, iFp)
//GO(gst_mini_object_lock,
@@ -905,7 +905,7 @@ GO(gst_mini_object_make_writable, pFp)
GO(gst_mini_object_ref, pFp)
//GO(gst_mini_object_remove_parent,
//GO(gst_mini_object_replace,
-//GO(gst_mini_object_set_qdata,
+GOM(gst_mini_object_set_qdata, vFEpppp)
//GO(gst_mini_object_steal,
//GO(gst_mini_object_steal_qdata,
//GO(gst_mini_object_take,
@@ -919,14 +919,14 @@ GO(gst_object_default_deep_notify, vFpppp)
GO(gst_object_default_error, vFppp)
GO(gst_object_flags_get_type, pFv)
GO(gst_object_get_control_binding, pFpp)
-GO(gst_object_get_control_rate, UFp)
-GO(gst_object_get_g_value_array, iFppUUup)
+GO(gst_object_get_control_rate, LFp)
+GO(gst_object_get_g_value_array, iFppLLup)
GO(gst_object_get_name, pFp)
GO(gst_object_get_parent, pFp)
GO(gst_object_get_path_string, pFp)
GO(gst_object_get_type, pFv)
-GO(gst_object_get_value, pFppU)
-GO(gst_object_get_value_array, iFppUUup)
+GO(gst_object_get_value, pFppL)
+GO(gst_object_get_value_array, iFppLLup)
GO(gst_object_has_active_control_bindings, iFp)
GO(gst_object_has_ancestor, iFpp)
GO(gst_object_has_as_ancestor, iFpp)
@@ -936,12 +936,12 @@ GO(gst_object_ref_sink, pFp)
GO(gst_object_remove_control_binding, iFpp)
GO(gst_object_replace, iFpp)
GO(gst_object_set_control_binding_disabled, vFppi)
-GO(gst_object_set_control_bindings_disabled, vFpp)
-GO(gst_object_set_control_rate, vFpU)
+GO(gst_object_set_control_bindings_disabled, vFpi)
+GO(gst_object_set_control_rate, vFpL)
GO(gst_object_set_name, iFpp)
GO(gst_object_set_parent, iFpp)
GO(gst_object_suggest_next_sync, UFp)
-GO(gst_object_sync_values, iFpU)
+GO(gst_object_sync_values, iFpL)
GO(gst_object_unparent, vFp)
GO(gst_object_unref, vFp)
GO(gst_pad_activate_mode, iFpii)
@@ -984,12 +984,12 @@ GO(gst_pad_iterate_internal_links_default, pFpp)
GO(gst_pad_link, iFpp)
GO(gst_pad_link_check_get_type, pFv)
GO(gst_pad_link_full, iFppi)
-GO(gst_pad_link_get_name, pFp)
+GO(gst_pad_link_get_name, pFi)
GO(gst_pad_link_maybe_ghosting, iFpp)
GO(gst_pad_link_maybe_ghosting_full, iFppi)
GO(gst_pad_link_return_get_type, pFv)
GO(gst_pad_mark_reconfigure, vFp)
-GO(gst_pad_mode_get_name, pFi)
+GO(gst_pad_mode_get_name, pFu)
GO(gst_pad_mode_get_type, pFv)
GO(gst_pad_needs_reconfigure, iFp)
GO(gst_pad_new, pFpi)
@@ -1004,7 +1004,7 @@ GO(gst_pad_peer_query_duration, iFpip)
GO(gst_pad_peer_query_position, iFpip)
GO(gst_pad_presence_get_type, pFv)
//GO(gst_pad_probe_info_get_buffer,
-//GO(gst_pad_probe_info_get_buffer_list,
+GO(gst_pad_probe_info_get_buffer_list, pFp)
//GO(gst_pad_probe_info_get_event,
//GO(gst_pad_probe_info_get_query,
//GO(gst_pad_probe_return_get_type,
@@ -1053,113 +1053,113 @@ GO(gst_pad_template_new, pFpiip)
//GO(gst_pad_template_set_documentation_caps,
GO(gst_pad_unlink, iFpp)
GO(gst_pad_use_fixed_caps, vFp)
-//GO(gst_param_spec_array,
+GO(gst_param_spec_array, pFppppi)
//GO(gst_param_spec_array_get_type,
-//GO(gst_param_spec_fraction,
+GO(gst_param_spec_fraction, pFpppiiiiiii)
//GO(gst_param_spec_fraction_get_type,
//GO(gst_parent_buffer_meta_api_get_type,
//GO(gst_parent_buffer_meta_get_info,
-//GO(gst_parse_bin_from_description,
-//GO(gst_parse_bin_from_description_full,
-//GO(gst_parse_context_copy,
+GO(gst_parse_bin_from_description, pFpip)
+GO(gst_parse_bin_from_description_full, pFpipup)
+GO(gst_parse_context_copy, pFp)
//GO(gst_parse_context_free,
-//GO(gst_parse_context_get_missing_elements,
-//GO(gst_parse_context_get_type,
-//GO(gst_parse_context_new,
+GO(gst_parse_context_get_missing_elements, pFp)
+GO(gst_parse_context_get_type, LFv)
+GO(gst_parse_context_new, pFv)
//GO(gst_parse_error_get_type,
-//GO(gst_parse_error_quark,
+GO(gst_parse_error_quark, uFv)
//GO(gst_parse_flags_get_type,
-//GO(gst_parse_launch,
-//GO(gst_parse_launch_full,
-//GO(gst_parse_launchv,
-//GO(gst_parse_launchv_full,
+GO(gst_parse_launch, pFpp)
+GO(gst_parse_launch_full, pFppup)
+GO(gst_parse_launchv, pFpp)
+GO(gst_parse_launchv_full, pFppup)
//GO(gst_pipeline_auto_clock,
//GO(gst_pipeline_flags_get_type,
-//GO(gst_pipeline_get_auto_flush_bus,
-//GO(gst_pipeline_get_bus,
+GO(gst_pipeline_get_auto_flush_bus, iFp)
+GO(gst_pipeline_get_bus, pFp)
//GO(gst_pipeline_get_clock,
//GO(gst_pipeline_get_delay,
-//GO(gst_pipeline_get_latency,
-//GO(gst_pipeline_get_pipeline_clock,
+GO(gst_pipeline_get_latency, LFp)
+GO(gst_pipeline_get_pipeline_clock, pFp)
//GO(gst_pipeline_get_type,
-//GO(gst_pipeline_new,
-//GO(gst_pipeline_set_auto_flush_bus,
-//GO(gst_pipeline_set_clock,
+GO(gst_pipeline_new, pFp)
+GO(gst_pipeline_set_auto_flush_bus, vFpi)
+GO(gst_pipeline_set_clock, iFpp)
//GO(gst_pipeline_set_delay,
-//GO(gst_pipeline_set_latency,
-//GO(gst_pipeline_use_clock,
-//GO(gst_plugin_add_dependency,
-//GO(gst_plugin_add_dependency_simple,
+GO(gst_pipeline_set_latency, vFpL)
+GO(gst_pipeline_use_clock, vFpp)
+GO(gst_plugin_add_dependency, vFppppu)
+GO(gst_plugin_add_dependency_simple, vFppppu)
//GO(gst_plugin_api_flags_get_type,
//GO(gst_plugin_dependency_flags_get_type,
//GO(gst_plugin_error_get_type,
//GO(gst_plugin_error_quark,
-//GO(gst_plugin_feature_check_version,
-//GO(gst_plugin_feature_get_plugin,
-//GO(gst_plugin_feature_get_plugin_name,
-//GO(gst_plugin_feature_get_rank,
+GO(gst_plugin_feature_check_version, iFpuuu)
+GO(gst_plugin_feature_get_plugin, pFp)
+GO(gst_plugin_feature_get_plugin_name, pFp)
+GO(gst_plugin_feature_get_rank, uFp)
GO(gst_plugin_feature_get_type, LFv)
-//GO(gst_plugin_feature_list_copy,
-//GO(gst_plugin_feature_list_debug,
+GO(gst_plugin_feature_list_copy, pFp)
+GO(gst_plugin_feature_list_debug, vFp)
GO(gst_plugin_feature_list_free, vFp)
-//GO(gst_plugin_feature_load,
+GO(gst_plugin_feature_load, pFp)
GO(gst_plugin_feature_rank_compare_func, iFpp)
-//GO(gst_plugin_feature_set_rank,
+GO(gst_plugin_feature_set_rank, vFpu)
//GO(gst_plugin_flags_get_type,
-//GO(gst_plugin_get_cache_data,
+GO(gst_plugin_get_cache_data, pFp)
//GO(gst_plugin_get_description,
//GO(gst_plugin_get_filename,
//GO(gst_plugin_get_license,
//GO(gst_plugin_get_name,
//GO(gst_plugin_get_origin,
//GO(gst_plugin_get_package,
-//GO(gst_plugin_get_release_date_string,
+GO(gst_plugin_get_release_date_string, pFp)
//GO(gst_plugin_get_source,
//GO(gst_plugin_get_type,
//GO(gst_plugin_get_version,
-//GO(gst_plugin_is_loaded,
+GO(gst_plugin_is_loaded, iFp)
//GO(gst_plugin_list_free,
-//GO(gst_plugin_load,
-//GO(gst_plugin_load_by_name,
+GO(gst_plugin_load, pFp)
+GO(gst_plugin_load_by_name, pFp)
//GO(_gst_plugin_loader_client_run,
-//GO(gst_plugin_load_file,
+GO(gst_plugin_load_file, pFpp)
//GO(gst_plugin_register_static,
//GO(gst_plugin_register_static_full,
-//GO(gst_plugin_set_cache_data,
+GO(gst_plugin_set_cache_data, vFpp)
//GO(gst_poll_add_fd,
//GO(gst_poll_fd_can_read,
//GO(gst_poll_fd_can_write,
-//GO(gst_poll_fd_ctl_pri,
+GO(gst_poll_fd_ctl_pri, iFppi)
//GO(gst_poll_fd_ctl_read,
//GO(gst_poll_fd_ctl_write,
//GO(gst_poll_fd_has_closed,
//GO(gst_poll_fd_has_error,
-//GO(gst_poll_fd_has_pri,
-//GO(gst_poll_fd_ignored,
-//GO(gst_poll_fd_init,
+GO(gst_poll_fd_has_pri, iFpp)
+GO(gst_poll_fd_ignored, vFpp)
+GO(gst_poll_fd_init, vFp)
//GO(gst_poll_free,
-//GO(gst_poll_get_read_gpollfd,
-//GO(gst_poll_new,
-//GO(gst_poll_new_timer,
-//GO(gst_poll_read_control,
-//GO(gst_poll_remove_fd,
-//GO(gst_poll_restart,
-//GO(gst_poll_set_controllable,
-//GO(gst_poll_set_flushing,
-//GO(gst_poll_wait,
+GO(gst_poll_get_read_gpollfd, vFpp)
+GO(gst_poll_new, pFi)
+GO(gst_poll_new_timer, pFv)
+GO(gst_poll_read_control, iFp)
+GO(gst_poll_remove_fd, iFpp)
+GO(gst_poll_restart, vFp)
+GO(gst_poll_set_controllable, iFpi)
+GO(gst_poll_set_flushing, vFpi)
+GO(gst_poll_wait, iFpL)
//GO(gst_poll_write_control,
-//GO(gst_preset_delete_preset,
+GO(gst_preset_delete_preset, iFpp)
//GO(gst_preset_get_app_dir,
-//GO(gst_preset_get_meta,
+GO(gst_preset_get_meta, iFpppp)
//GO(gst_preset_get_preset_names,
-//GO(gst_preset_get_property_names,
+GO(gst_preset_get_property_names, pFp)
//GO(gst_preset_get_type,
-//GO(gst_preset_is_editable,
+GO(gst_preset_is_editable, iFp)
//GO(gst_preset_load_preset,
-//GO(gst_preset_rename_preset,
+GO(gst_preset_rename_preset, iFppp)
//GO(gst_preset_save_preset,
-//GO(gst_preset_set_app_dir,
-//GO(gst_preset_set_meta,
+GO(gst_preset_set_app_dir, iFp)
+GO(gst_preset_set_meta, iFpppp)
//GO(gst_print,
//GO(gst_printerr,
//GO(gst_printerrln,
@@ -1176,10 +1176,10 @@ GO(gst_plugin_feature_rank_compare_func, iFpp)
//GO(gst_promise_result_get_type,
//GO(gst_promise_unref,
//GO(gst_promise_wait,
-//GO(gst_protection_filter_systems_by_available_decryptors,
+GO(gst_protection_filter_systems_by_available_decryptors, pFp)
//GO(gst_protection_meta_api_get_type,
//GO(gst_protection_meta_get_info,
-//GO(gst_protection_select_system,
+GO(gst_protection_select_system, pFp)
//GO(gst_proxy_pad_chain_default,
//GO(gst_proxy_pad_chain_list_default,
//GO(gst_proxy_pad_get_internal,
@@ -1277,35 +1277,35 @@ GO(gst_query_set_uri_redirection_permanent, vFpi)
GO(gst_query_take, iFpp)
//DATAB(_gst_query_type,
GO(gst_query_type_flags_get_type, pFv)
-GO(gst_query_type_get_flags, iFi)
-GO(gst_query_type_get_name, pFi)
+GO(gst_query_type_get_flags, uFu)
+GO(gst_query_type_get_name, pFu)
GO(gst_query_type_get_type, pFv)
-GO(gst_query_type_to_quark, pFi)
+GO(gst_query_type_to_quark, uFu)
GO(gst_query_unref, vFp)
GO(gst_query_writable_structure, pFp)
//GO(gst_rank_get_type,
//GO(gst_reference_timestamp_meta_api_get_type,
//GO(gst_reference_timestamp_meta_get_info,
-//GO(gst_registry_add_feature,
-//GO(gst_registry_add_plugin,
-//GO(gst_registry_check_feature_version,
-//GO(gst_registry_feature_filter,
-//GO(gst_registry_find_feature,
-//GO(gst_registry_find_plugin,
+GO(gst_registry_add_feature, iFpp)
+GO(gst_registry_add_plugin, iFpp)
+GO(gst_registry_check_feature_version, iFppuuu)
+GOM(gst_registry_feature_filter, pFEppip)
+GO(gst_registry_find_feature, pFppL)
+GO(gst_registry_find_plugin, pFpp)
//GO(gst_registry_fork_is_enabled,
-//GO(gst_registry_fork_set_enabled,
-//GO(gst_registry_get,
-//GO(gst_registry_get_feature_list,
-//GO(gst_registry_get_feature_list_by_plugin,
-//GO(gst_registry_get_feature_list_cookie,
-//GO(gst_registry_get_plugin_list,
+GO(gst_registry_fork_set_enabled, vFi)
+GO(gst_registry_get, pFv)
+GO(gst_registry_get_feature_list, pFpL)
+GO(gst_registry_get_feature_list_by_plugin, pFpp)
+GO(gst_registry_get_feature_list_cookie, uFp)
+GO(gst_registry_get_plugin_list, pFp)
//GO(gst_registry_get_type,
-//GO(gst_registry_lookup,
-//GO(gst_registry_lookup_feature,
+GO(gst_registry_lookup, pFpp)
+GO(gst_registry_lookup_feature, pFpp)
//GO(gst_registry_plugin_filter,
-//GO(gst_registry_remove_feature,
-//GO(gst_registry_remove_plugin,
-//GO(gst_registry_scan_path,
+GO(gst_registry_remove_feature, vFpp)
+GO(gst_registry_remove_plugin, vFpp)
+GO(gst_registry_scan_path, iFpp)
//GO(gst_resource_error_get_type,
//GO(gst_resource_error_quark,
GO(gst_sample_copy, pFp)
@@ -1318,32 +1318,32 @@ GO(gst_sample_get_type, pFv)
GO(gst_sample_new, pFpppp)
GO(gst_sample_ref, pFp)
//GO(gst_sample_set_buffer,
-//GO(gst_sample_set_buffer_list,
+GO(gst_sample_set_buffer_list, vFpp)
//GO(gst_sample_set_caps,
-//GO(gst_sample_set_info,
-//GO(gst_sample_set_segment,
+GO(gst_sample_set_info, iFpp)
+GO(gst_sample_set_segment, vFpp)
DATAB(_gst_sample_type, sizeof(long))
//GO(gst_sample_unref,
GO(gst_scheduling_flags_get_type, pFv)
GO(gst_search_mode_get_type, pFv)
GO(gst_seek_flags_get_type, pFv)
GO(gst_seek_type_get_type, pFv)
-GO(gst_segment_clip, iFpiUUpp)
+GO(gst_segment_clip, iFpuLLpp)
GO(gst_segment_copy, pFp)
GO(gst_segment_copy_into, vFpp)
-GO(gst_segment_do_seek, iFpdiiiUiUp)
+GO(gst_segment_do_seek, iFpduuuLuLp)
GO(gst_segment_flags_get_type, pFv)
GO(gst_segment_free, vFp)
GO(gst_segment_get_type, pFv)
-GO(gst_segment_init, vFpi)
+GO(gst_segment_init, vFpu)
GO(gst_segment_is_equal, iFpp)
GO(gst_segment_new, pFv)
-GO(gst_segment_offset_running_time, iFpiI)
-GO(gst_segment_position_from_running_time, UFpiU)
-GO(gst_segment_position_from_running_time_full, iFpiUp)
+GO(gst_segment_offset_running_time, iFpul)
+GO(gst_segment_position_from_running_time, LFpuL)
+GO(gst_segment_position_from_running_time_full, iFpuLp)
GO(gst_segment_position_from_stream_time, UFpiU)
GO(gst_segment_position_from_stream_time_full, iFpiUp)
-GO(gst_segment_set_running_time, iFpiU)
+GO(gst_segment_set_running_time, iFpuL)
//GO(gst_segment_to_position,
GO(gst_segment_to_running_time, UFpiU)
GO(gst_segment_to_running_time_full, iFpiUp)
@@ -1352,7 +1352,7 @@ GO(gst_segment_to_stream_time_full, iFpiUp)
GO(gst_segtrap_is_enabled, iFv)
GO(gst_segtrap_set_enabled, vFi)
GO(gst_stack_trace_flags_get_type, pFv)
-//GO(gst_state_change_get_name,
+GO(gst_state_change_get_name, pFu)
GO(gst_state_change_get_type, pFv)
GO(gst_state_change_return_get_type, pFv)
GO(gst_state_get_type, pFv)
@@ -1362,28 +1362,28 @@ GO(gst_static_caps_get_type, pFv)
//GO(gst_static_pad_template_get,
//GO(gst_static_pad_template_get_caps,
//GO(gst_static_pad_template_get_type,
-//GO(gst_stream_collection_add_stream,
-//GO(gst_stream_collection_get_size,
-//GO(gst_stream_collection_get_stream,
+GO(gst_stream_collection_add_stream, iFpp)
+GO(gst_stream_collection_get_size, uFp)
+GO(gst_stream_collection_get_stream, pFpu)
//GO(gst_stream_collection_get_type,
-//GO(gst_stream_collection_get_upstream_id,
-//GO(gst_stream_collection_new,
+GO(gst_stream_collection_get_upstream_id, pFp)
+GO(gst_stream_collection_new, pFp)
//GO(gst_stream_error_get_type,
//GO(gst_stream_error_quark,
//GO(gst_stream_flags_get_type,
-//GO(gst_stream_get_caps,
-//GO(gst_stream_get_stream_flags,
-//GO(gst_stream_get_stream_id,
-//GO(gst_stream_get_stream_type,
-//GO(gst_stream_get_tags,
+GO(gst_stream_get_caps, pFp)
+GO(gst_stream_get_stream_flags, uFp)
+GO(gst_stream_get_stream_id, pFp)
+GO(gst_stream_get_stream_type, uFp)
+GO(gst_stream_get_tags, pFp)
//GO(gst_stream_get_type,
-//GO(gst_stream_new,
-//GO(gst_stream_set_caps,
-//GO(gst_stream_set_stream_flags,
-//GO(gst_stream_set_stream_type,
-//GO(gst_stream_set_tags,
+GO(gst_stream_new, pFppuu)
+GO(gst_stream_set_caps, vFpp)
+GO(gst_stream_set_stream_flags, vFpu)
+GO(gst_stream_set_stream_type, vFpu)
+GO(gst_stream_set_tags, vFpp)
//GO(gst_stream_status_type_get_type,
-//GO(gst_stream_type_get_name,
+GO(gst_stream_type_get_name, pFu)
//GO(gst_stream_type_get_type,
GO(gst_structure_can_intersect, iFpp)
//GO(gst_structure_change_type_get_type,
@@ -1406,15 +1406,15 @@ GO(gst_structure_get_clock_time, iFppp)
GO(gst_structure_get_date, iFppp)
GO(gst_structure_get_date_time, iFppp)
GO(gst_structure_get_double, iFppp)
-GO(gst_structure_get_enum, iFpppp)
-GO(gst_structure_get_field_type, pFpp)
+GO(gst_structure_get_enum, iFppLp)
+GO(gst_structure_get_field_type, LFpp)
GO(gst_structure_get_flagset, iFpppp)
GO(gst_structure_get_fraction, iFpppp)
GO(gst_structure_get_int, iFppp)
GO(gst_structure_get_int64, iFppp)
GO(gst_structure_get_list, iFppp)
GO(gst_structure_get_name, pFp)
-GO(gst_structure_get_name_id, pFp)
+GO(gst_structure_get_name_id, uFp)
GO(gst_structure_get_string, pFpp)
GO(gst_structure_get_type, pFv)
GO(gst_structure_get_uint, iFppp)
@@ -1422,17 +1422,17 @@ GO(gst_structure_get_uint64, iFppp)
GOM(gst_structure_get_valist, iFEppA)
GO(gst_structure_get_value, pFpp)
GO(gst_structure_has_field, iFpp)
-GO(gst_structure_has_field_typed, iFppp)
+GO(gst_structure_has_field_typed, iFppL)
GO(gst_structure_has_name, iFpp)
//GOM(gst_structure_id_get, iFEppV)
//GOM(gst_structure_id_get_valist, iFEppA)
-GO(gst_structure_id_get_value, pFpp)
-GO(gst_structure_id_has_field, iFpp)
-GO(gst_structure_id_has_field_typed, iFppp)
+GO(gst_structure_id_get_value, pFpu)
+GO(gst_structure_id_has_field, iFpu)
+GO(gst_structure_id_has_field_typed, iFpuL)
//GOM(gst_structure_id_set, iFEppV)
//GOM(gst_structure_id_set_valist, iFEppA)
-GO(gst_structure_id_set_value, vFppp)
-GO(gst_structure_id_take_value, pFppp)
+GO(gst_structure_id_set_value, vFpup)
+GO(gst_structure_id_take_value, vFpup)
GO(gst_structure_intersect, pFpp)
GO(gst_structure_is_equal, iFpp)
GO(gst_structure_is_subset, iFpp)
@@ -1441,7 +1441,7 @@ GOM(gst_structure_new, pFEppV)
GO(gst_structure_new_empty, pFp)
GO(gst_structure_new_from_string, pFp)
//GOM(gst_structure_new_id, pFEppV)
-GO(gst_structure_new_id_empty, pFp)
+GO(gst_structure_new_id_empty, pFu)
//GOM(gst_structure_new_valist, pFppA)
GO(gst_structure_n_fields, iFp)
GO(gst_structure_nth_field_name, pFpu)
@@ -1459,14 +1459,14 @@ GO(gst_structure_set_value, vFppp)
GO(gst_structure_take, iFpp)
GO(gst_structure_take_value, vFppp)
GO(gst_structure_to_string, pFp)
-//DATAB(_gst_structure_type,
+DATAB(_gst_structure_type, sizeof(void*))
//GO(gst_system_clock_get_type,
-//GO(gst_system_clock_obtain,
-//GO(gst_system_clock_set_default,
+GO(gst_system_clock_obtain, pFv)
+GO(gst_system_clock_set_default, vFp)
//GO(gst_tag_exists,
//GO(gst_tag_flag_get_type,
-//GO(gst_tag_get_description,
-//GO(gst_tag_get_flag,
+GO(gst_tag_get_description, pFp)
+GO(gst_tag_get_flag, uFp)
//GO(gst_tag_get_nick,
//GO(gst_tag_get_type,
//GO(gst_tag_is_fixed,
@@ -1523,7 +1523,7 @@ GO(gst_tag_list_replace, iFpp)
GO(gst_tag_list_set_scope, vFpi)
GO(gst_tag_list_take, iFpp)
GO(gst_tag_list_to_string, pFp)
-//DATAB(_gst_tag_list_type,
+DATAB(_gst_tag_list_type, sizeof(void*))
GO(gst_tag_list_unref, vFp)
GO(gst_tag_merge_mode_get_type, pFv)
//GO(gst_tag_merge_strings_with_comma,
@@ -1534,91 +1534,91 @@ GO(gst_tag_merge_mode_get_type, pFv)
//GO(gst_tag_setter_add_tags,
//GO(gst_tag_setter_add_tag_valist,
//GO(gst_tag_setter_add_tag_valist_values,
-//GO(gst_tag_setter_add_tag_value,
+GO(gst_tag_setter_add_tag_value, vFpupp)
//GO(gst_tag_setter_add_tag_values,
//GO(gst_tag_setter_get_tag_list,
-//GO(gst_tag_setter_get_tag_merge_mode,
+GO(gst_tag_setter_get_tag_merge_mode, uFp)
//GO(gst_tag_setter_get_type,
//GO(gst_tag_setter_merge_tags,
-//GO(gst_tag_setter_reset_tags,
-//GO(gst_tag_setter_set_tag_merge_mode,
+GO(gst_tag_setter_reset_tags, vFp)
+GO(gst_tag_setter_set_tag_merge_mode, vFpu)
//GO(gst_task_cleanup_all,
//GO(gst_task_get_pool,
//GO(gst_task_get_state,
-//GO(gst_task_get_type,
+GO(gst_task_get_type, pFv)
//GO(gst_task_join,
//GO(gst_task_new,
//GO(gst_task_pause,
-//GO(gst_task_pool_cleanup,
-//GO(gst_task_pool_get_type,
+GO(gst_task_pool_cleanup, vFp)
+GO(gst_task_pool_get_type, pFv)
//GO(gst_task_pool_join,
//GO(gst_task_pool_new,
-//GO(gst_task_pool_prepare,
+GO(gst_task_pool_prepare, vFp)
//GO(gst_task_pool_push,
//GO(gst_task_resume,
//GO(gst_task_set_enter_callback,
//GO(gst_task_set_leave_callback,
//GO(gst_task_set_lock,
-//GO(gst_task_set_pool,
+GO(gst_task_set_pool, vFpp)
//GO(gst_task_set_state,
//GO(gst_task_start,
//GO(gst_task_state_get_type,
//GO(gst_task_stop,
-//GO(gst_toc_append_entry,
+GO(gst_toc_append_entry, vFpp)
//GO(gst_toc_dump,
-//GO(gst_toc_entry_append_sub_entry,
-//GO(gst_toc_entry_get_entry_type,
-//GO(gst_toc_entry_get_loop,
-//GO(gst_toc_entry_get_parent,
-//GO(gst_toc_entry_get_start_stop_times,
-//GO(gst_toc_entry_get_sub_entries,
+GO(gst_toc_entry_append_sub_entry, vFpp)
+GO(gst_toc_entry_get_entry_type, iFp)
+GO(gst_toc_entry_get_loop, iFppp)
+GO(gst_toc_entry_get_parent, pFp)
+GO(gst_toc_entry_get_start_stop_times, iFppp)
+GO(gst_toc_entry_get_sub_entries, pFp)
//GO(gst_toc_entry_get_tags,
-//GO(gst_toc_entry_get_toc,
+GO(gst_toc_entry_get_toc, pFp)
//GO(gst_toc_entry_get_type,
-//GO(gst_toc_entry_get_uid,
+GO(gst_toc_entry_get_uid, pFp)
//GO(gst_toc_entry_is_alternative,
-//GO(gst_toc_entry_is_sequence,
+GO(gst_toc_entry_is_sequence, iFp)
//GO(gst_toc_entry_merge_tags,
-//GO(gst_toc_entry_new,
-//GO(gst_toc_entry_set_loop,
-//GO(gst_toc_entry_set_start_stop_times,
+GO(gst_toc_entry_new, pFip)
+GO(gst_toc_entry_set_loop, vFpui)
+GO(gst_toc_entry_set_start_stop_times, vFpll)
//GO(gst_toc_entry_set_tags,
//DATAB(_gst_toc_entry_type,
-//GO(gst_toc_entry_type_get_nick,
+GO(gst_toc_entry_type_get_nick, pFi)
//GO(gst_toc_entry_type_get_type,
-//GO(gst_toc_find_entry,
-//GO(gst_toc_get_entries,
-//GO(gst_toc_get_scope,
+GO(gst_toc_find_entry, pFpp)
+GO(gst_toc_get_entries, pFp)
+GO(gst_toc_get_scope, uFp)
//GO(gst_toc_get_tags,
//GO(gst_toc_get_type,
//GO(gst_toc_loop_type_get_type,
//GO(gst_toc_merge_tags,
-//GO(gst_toc_new,
+GO(gst_toc_new, pFu)
//GO(gst_toc_scope_get_type,
//GO(gst_toc_set_tags,
-//GO(gst_toc_setter_get_toc,
+GO(gst_toc_setter_get_toc, pFp)
//GO(gst_toc_setter_get_type,
-//GO(gst_toc_setter_reset,
-//GO(gst_toc_setter_set_toc,
-//DATAB(_gst_toc_type,
+GO(gst_toc_setter_reset, vFp)
+GO(gst_toc_setter_set_toc, vFpp)
+DATAB(_gst_toc_type, sizeof(void*))
//GO(gst_tracer_factory_get_list,
-//GO(gst_tracer_factory_get_tracer_type,
+GO(gst_tracer_factory_get_tracer_type, LFp)
//GO(gst_tracer_factory_get_type,
//GO(gst_tracer_get_type,
//GO(gst_tracer_record_get_type,
//GO(gst_tracer_record_log,
//GO(gst_tracer_record_new,
-//GO(gst_tracer_register,
+GO(gst_tracer_register, iFppL)
//GO(gst_tracer_value_flags_get_type,
//GO(gst_tracer_value_scope_get_type,
//GO(gst_tracing_get_active_tracers,
//GO(gst_tracing_register_hook,
//GO(gst_type_find_factory_call_function,
//GO(gst_type_find_factory_get_caps,
-//GO(gst_type_find_factory_get_extensions,
-//GO(gst_type_find_factory_get_list,
+GO(gst_type_find_factory_get_extensions, pFp)
+GO(gst_type_find_factory_get_list, pFv)
//GO(gst_type_find_factory_get_type,
-//GO(gst_type_find_factory_has_function,
+GO(gst_type_find_factory_has_function, iFp)
//GO(gst_type_find_get_length,
//GO(gst_type_find_get_type,
//GO(gst_type_find_peek,
@@ -1626,133 +1626,133 @@ GO(gst_tag_merge_mode_get_type, pFv)
//GO(gst_type_find_register,
//GO(gst_type_find_suggest,
//GO(gst_type_find_suggest_simple,
-//GO(gst_type_is_plugin_api,
-//GO(gst_type_mark_as_plugin_api,
-//GO(gst_update_registry,
+GO(gst_type_is_plugin_api, iFLp)
+GO(gst_type_mark_as_plugin_api, vFLu)
+GO(gst_update_registry, iFv)
//GO(gst_uri_append_path,
//GO(gst_uri_append_path_segment,
//GO(gst_uri_construct,
-//GO(gst_uri_copy,
-//GO(gst_uri_equal,
+GO(gst_uri_copy, pFp)
+GO(gst_uri_equal, iFpp)
//GO(gst_uri_error_get_type,
//GO(gst_uri_error_quark,
//GO(gst_uri_from_string,
-//GO(gst_uri_from_string_escaped,
-//GO(gst_uri_from_string_with_base,
-//GO(gst_uri_get_fragment,
+GO(gst_uri_from_string_escaped, pFp)
+GO(gst_uri_from_string_with_base, pFpp)
+GO(gst_uri_get_fragment, pFp)
//GO(gst_uri_get_host,
-//GO(gst_uri_get_location,
-//GO(gst_uri_get_media_fragment_table,
+GO(gst_uri_get_location, pFp)
+GO(gst_uri_get_media_fragment_table, pFp)
//GO(gst_uri_get_path,
//GO(gst_uri_get_path_segments,
//GO(gst_uri_get_path_string,
-//GO(gst_uri_get_port,
+GO(gst_uri_get_port, uFp)
//GO(gst_uri_get_protocol,
-//GO(gst_uri_get_query_keys,
-//GO(gst_uri_get_query_string,
+GO(gst_uri_get_query_keys, pFp)
+GO(gst_uri_get_query_string, pFp)
//GO(gst_uri_get_query_table,
-//GO(gst_uri_get_query_value,
+GO(gst_uri_get_query_value, pFpp)
//GO(gst_uri_get_scheme,
//GO(gst_uri_get_type,
//GO(gst_uri_get_userinfo,
-//GO(gst_uri_handler_get_protocols,
+GO(gst_uri_handler_get_protocols, pFp)
//GO(gst_uri_handler_get_type,
-//GO(gst_uri_handler_get_uri,
-//GO(gst_uri_handler_get_uri_type,
-//GO(gst_uri_handler_set_uri,
-//GO(gst_uri_has_protocol,
-//GO(gst_uri_is_normalized,
+GO(gst_uri_handler_get_uri, pFp)
+GO(gst_uri_handler_get_uri_type, uFp)
+GO(gst_uri_handler_set_uri, iFppp)
+GO(gst_uri_has_protocol, iFpp)
+GO(gst_uri_is_normalized, iFp)
//GO(gst_uri_is_valid,
//GO(gst_uri_is_writable,
-//GO(gst_uri_join,
-//GO(gst_uri_join_strings,
+GO(gst_uri_join, pFpp)
+GO(gst_uri_join_strings, pFpp)
//GO(gst_uri_make_writable,
-//GO(gst_uri_new,
-//GO(gst_uri_new_with_base,
-//GO(gst_uri_normalize,
-//GO(gst_uri_protocol_is_supported,
+GO(gst_uri_new, pFpppuppp)
+GO(gst_uri_new_with_base, pFppppuppp)
+GO(gst_uri_normalize, iFp)
+GO(gst_uri_protocol_is_supported, iFup)
//GO(gst_uri_protocol_is_valid,
-//GO(gst_uri_query_has_key,
-//GO(gst_uri_ref,
+GO(gst_uri_query_has_key, iFpp)
+GO(gst_uri_ref, pFp)
//GO(gst_uri_remove_query_key,
-//GO(gst_uri_set_fragment,
+GO(gst_uri_set_fragment, iFpp)
//GO(gst_uri_set_host,
//GO(gst_uri_set_path,
-//GO(gst_uri_set_path_segments,
+GO(gst_uri_set_path_segments, iFpp)
//GO(gst_uri_set_path_string,
-//GO(gst_uri_set_port,
+GO(gst_uri_set_port, iFpu)
//GO(gst_uri_set_query_string,
-//GO(gst_uri_set_query_table,
-//GO(gst_uri_set_query_value,
+GO(gst_uri_set_query_table, iFpp)
+GO(gst_uri_set_query_value, iFppp)
//GO(gst_uri_set_scheme,
//GO(gst_uri_set_userinfo,
//GO(gst_uri_to_string,
//GO(gst_uri_type_get_type,
//GO(gst_uri_unref,
//GO(gst_util_array_binary_search,
-//GO(gst_util_double_to_fraction,
+GO(gst_util_double_to_fraction, vFdpp)
//GO(gst_util_dump_buffer,
-//GO(gst_util_dump_mem,
-//GO(gst_util_fraction_add,
-//GO(gst_util_fraction_compare,
+GO(gst_util_dump_mem, vFpu)
+GO(gst_util_fraction_add, iFiiiipp)
+GO(gst_util_fraction_compare, iFiiii)
//GO(gst_util_fraction_multiply,
-//GO(gst_util_fraction_to_double,
-//GO(gst_util_gdouble_to_guint64,
-//GO(gst_util_get_object_array,
-//GO(gst_util_get_timestamp,
-//GO(gst_util_greatest_common_divisor,
-//GO(gst_util_greatest_common_divisor_int64,
-//GO(gst_util_group_id_next,
-//GO(gst_util_guint64_to_gdouble,
-//GO(gst_util_seqnum_compare,
-//GO(gst_util_seqnum_next,
+GO(gst_util_fraction_to_double, vFiip)
+GO(gst_util_gdouble_to_guint64, LFd)
+GO(gst_util_get_object_array, iFppp)
+GO(gst_util_get_timestamp, LFv)
+GO(gst_util_greatest_common_divisor, iFii)
+GO(gst_util_greatest_common_divisor_int64, lFll)
+GO(gst_util_group_id_next, uFv)
+GO(gst_util_guint64_to_gdouble, dFL)
+GO(gst_util_seqnum_compare, iFuu)
+GO(gst_util_seqnum_next, uFv)
GO(gst_util_set_object_arg, vFppp)
-//GO(gst_util_set_object_array,
-//GO(gst_util_set_value_from_string,
+GO(gst_util_set_object_array, iFppp)
+GO(gst_util_set_value_from_string, vFpp)
GO(gst_util_uint64_scale, UFUUU)
-//GO(gst_util_uint64_scale_ceil,
+GO(gst_util_uint64_scale_ceil, LFLLL)
//GO(gst_util_uint64_scale_int,
-//GO(gst_util_uint64_scale_int_ceil,
+GO(gst_util_uint64_scale_int_ceil, LFLii)
//GO(gst_util_uint64_scale_int_round,
//GO(gst_util_uint64_scale_round,
-//GO(gst_value_array_append_and_take_value,
+GO(gst_value_array_append_and_take_value, vFpp)
//GO(gst_value_array_append_value,
//GO(gst_value_array_get_size,
//GO(gst_value_array_get_type,
-//GO(gst_value_array_get_value,
-//GO(gst_value_array_init,
-//GO(gst_value_array_prepend_value,
-//DATAB(_gst_value_array_type,
+GO(gst_value_array_get_value, pFpu)
+GO(gst_value_array_init, pFpu)
+GO(gst_value_array_prepend_value, vFpp)
+DATAB(_gst_value_array_type, sizeof(void*))
//GO(gst_value_can_compare,
//GO(gst_value_can_intersect,
-//GO(gst_value_can_subtract,
+GO(gst_value_can_subtract, iFpp)
//GO(gst_value_can_union,
-//GO(gst_value_compare,
-//GO(gst_value_deserialize,
-//GO(gst_value_fixate,
+GO(gst_value_compare, iFpp)
+GO(gst_value_deserialize, iFpp)
+GO(gst_value_fixate, iFpp)
//GO(gst_value_fraction_multiply,
//GO(gst_value_fraction_subtract,
-//GO(gst_value_get_bitmask,
+GO(gst_value_get_bitmask, LFp)
//GO(gst_value_get_caps,
-//GO(gst_value_get_caps_features,
-//GO(gst_value_get_double_range_max,
+GO(gst_value_get_caps_features, pFp)
+GO(gst_value_get_double_range_max, dFp)
//GO(gst_value_get_double_range_min,
//GO(gst_value_get_flagset_flags,
-//GO(gst_value_get_flagset_mask,
-//GO(gst_value_get_fraction_denominator,
+GO(gst_value_get_flagset_mask, uFp)
+GO(gst_value_get_fraction_denominator, iFp)
//GO(gst_value_get_fraction_numerator,
-//GO(gst_value_get_fraction_range_max,
+GO(gst_value_get_fraction_range_max, pFp)
//GO(gst_value_get_fraction_range_min,
//GO(gst_value_get_int64_range_max,
//GO(gst_value_get_int64_range_min,
-//GO(gst_value_get_int64_range_step,
+GO(gst_value_get_int64_range_step, lFp)
//GO(gst_value_get_int_range_max,
//GO(gst_value_get_int_range_min,
//GO(gst_value_get_int_range_step,
-//GO(gst_value_get_structure,
+GO(gst_value_get_structure, pFp)
//GO(gst_value_init_and_copy,
//GO(gst_value_intersect,
-//GO(gst_value_is_fixed,
+GO(gst_value_is_fixed, iFp)
//GO(gst_value_is_subset,
//GO(gst_value_list_append_and_take_value,
//GO(gst_value_list_append_value,
@@ -1763,23 +1763,23 @@ GO(gst_util_uint64_scale, UFUUU)
//GO(gst_value_list_init,
//GO(gst_value_list_merge,
//GO(gst_value_list_prepend_value,
-//DATAB(_gst_value_list_type,
+DATAB(_gst_value_list_type, sizeof(void*))
//GO(gst_value_register,
-//GO(gst_value_serialize,
-//GO(gst_value_set_bitmask,
+GO(gst_value_serialize, pFp)
+GO(gst_value_set_bitmask, vFpL)
//GO(gst_value_set_caps,
-//GO(gst_value_set_caps_features,
-//GO(gst_value_set_double_range,
-//GO(gst_value_set_flagset,
-//GO(gst_value_set_fraction,
-//GO(gst_value_set_fraction_range,
-//GO(gst_value_set_fraction_range_full,
-//GO(gst_value_set_int64_range,
-//GO(gst_value_set_int64_range_step,
+GO(gst_value_set_caps_features, vFpp)
+GO(gst_value_set_double_range, vFpdd)
+GO(gst_value_set_flagset, vFpuu)
+GO(gst_value_set_fraction, vFpii)
+GO(gst_value_set_fraction_range, vFppp)
+GO(gst_value_set_fraction_range_full, vFpiiii)
+GO(gst_value_set_int64_range, vFpll)
+GO(gst_value_set_int64_range_step, vFplll)
//GO(gst_value_set_int_range,
-//GO(gst_value_set_int_range_step,
-//GO(gst_value_set_structure,
-//GO(gst_value_subtract,
+GO(gst_value_set_int_range_step, vFpiii)
+GO(gst_value_set_structure, vFpp)
+GO(gst_value_subtract, iFppp)
//GO(gst_value_union,
GO(gst_version, vFpppp)
GO(gst_version_string, pFv)
diff --git a/src/wrapped/wrappedgstvideo_private.h b/src/wrapped/wrappedgstvideo_private.h
index 1027f9b..27eb4ae 100644
--- a/src/wrapped/wrappedgstvideo_private.h
+++ b/src/wrapped/wrappedgstvideo_private.h
@@ -17,16 +17,16 @@
//GO(gst_buffer_get_video_meta,
//GO(gst_buffer_get_video_meta_id,
//GO(gst_buffer_get_video_region_of_interest_meta_id,
-//GO(gst_buffer_pool_config_get_video_alignment,
+GO(gst_buffer_pool_config_get_video_alignment, iFpp)
GO(gst_buffer_pool_config_set_video_alignment, vFpp)
//GO(gst_color_balance_channel_get_type,
-//GO(gst_color_balance_get_balance_type,
+GO(gst_color_balance_get_balance_type, uFp)
//GO(gst_color_balance_get_type,
-//GO(gst_color_balance_get_value,
-//GO(gst_color_balance_list_channels,
+GO(gst_color_balance_get_value, iFpp)
+GO(gst_color_balance_list_channels, pFp)
//GO(gst_color_balance_set_value,
//GO(gst_color_balance_type_get_type,
-//GO(gst_color_balance_value_changed,
+GO(gst_color_balance_value_changed, vFppi)
//GO(gst_is_video_overlay_prepare_window_handle_message,
//GO(gst_navigation_command_get_type,
//GO(gst_navigation_event_get_type,
@@ -56,11 +56,11 @@ GO(gst_buffer_pool_config_set_video_alignment, vFpp)
//GO(gst_navigation_query_set_commands,
//GO(gst_navigation_query_set_commandsv,
//GO(gst_navigation_query_type_get_type,
-//GO(gst_navigation_send_command,
-//GO(gst_navigation_send_event,
-//GO(gst_navigation_send_key_event,
-//GO(gst_navigation_send_mouse_event,
-//GO(gst_navigation_send_mouse_scroll_event,
+GO(gst_navigation_send_command, vFpu)
+GO(gst_navigation_send_event, vFpp)
+GO(gst_navigation_send_key_event, vFppp)
+GO(gst_navigation_send_mouse_event, vFppidd)
+GO(gst_navigation_send_mouse_scroll_event, vFpdddd)
//GO(gst_video_afd_meta_api_get_type,
//GO(gst_video_afd_meta_get_info,
//GO(gst_video_afd_spec_get_type,
@@ -87,7 +87,7 @@ GO(gst_video_alignment_reset, vFp)
//GO(gst_video_buffer_flags_get_type,
//GO(gst_video_buffer_pool_get_type,
GO(gst_video_buffer_pool_new, pFv)
-//GO(gst_video_calculate_display_ratio,
+GO(gst_video_calculate_display_ratio, iFppuuuuuu)
//GO(gst_video_caption_meta_api_get_type,
//GO(gst_video_caption_meta_get_info,
//GO(gst_video_caption_type_from_caps,
@@ -97,12 +97,12 @@ GO(gst_video_buffer_pool_new, pFv)
//GO(gst_video_chroma_from_string,
//GO(gst_video_chroma_method_get_type,
//GO(gst_video_chroma_mode_get_type,
-//GO(gst_video_chroma_resample,
-//GO(gst_video_chroma_resample_free,
-//GO(gst_video_chroma_resample_get_info,
-//GO(gst_video_chroma_resample_new,
+GO(gst_video_chroma_resample, vFppi)
+GO(gst_video_chroma_resample_free, vFp)
+GO(gst_video_chroma_resample_get_info, vFppp)
+GO(gst_video_chroma_resample_new, pFuuuuii)
//GO(gst_video_chroma_site_get_type,
-//GO(gst_video_chroma_to_string,
+GO(gst_video_chroma_to_string, pFu)
//GO(gst_video_codec_frame_get_type,
//GO(gst_video_codec_frame_get_user_data,
//GO(gst_video_codec_frame_ref,
@@ -111,32 +111,32 @@ GO(gst_video_buffer_pool_new, pFv)
//GO(gst_video_codec_state_get_type,
//GO(gst_video_codec_state_ref,
//GO(gst_video_codec_state_unref,
-//GO(gst_video_colorimetry_from_string,
-//GO(gst_video_colorimetry_is_equal,
-//GO(gst_video_colorimetry_matches,
-//GO(gst_video_colorimetry_to_string,
-//GO(gst_video_color_matrix_from_iso,
-//GO(gst_video_color_matrix_get_Kr_Kb,
+GO(gst_video_colorimetry_from_string, iFpp)
+GO(gst_video_colorimetry_is_equal, iFpp)
+GO(gst_video_colorimetry_matches, iFpp)
+GO(gst_video_colorimetry_to_string, pFp)
+GO(gst_video_color_matrix_from_iso, uFu)
+GO(gst_video_color_matrix_get_Kr_Kb, iFupp)
//GO(gst_video_color_matrix_get_type,
-//GO(gst_video_color_matrix_to_iso,
-//GO(gst_video_color_primaries_from_iso,
-//GO(gst_video_color_primaries_get_info,
+GO(gst_video_color_matrix_to_iso, uFu)
+GO(gst_video_color_primaries_from_iso, uFu)
+GO(gst_video_color_primaries_get_info, pFu)
//GO(gst_video_color_primaries_get_type,
-//GO(gst_video_color_primaries_to_iso,
+GO(gst_video_color_primaries_to_iso, uFu)
//GO(gst_video_color_range_get_type,
//GO(gst_video_color_range_offsets,
//GO(gst_video_color_transfer_decode,
//GO(gst_video_color_transfer_encode,
//GO(gst_video_content_light_level_add_to_caps,
//GO(gst_video_content_light_level_from_caps,
-//GO(gst_video_content_light_level_from_string,
-//GO(gst_video_content_light_level_init,
-//GO(gst_video_content_light_level_to_string,
+GO(gst_video_content_light_level_from_string, iFpp)
+GO(gst_video_content_light_level_init, vFp)
+GO(gst_video_content_light_level_to_string, pFp)
//GO(gst_video_converter_frame,
//GO(gst_video_converter_free,
-//GO(gst_video_converter_get_config,
+GO(gst_video_converter_get_config, pFp)
//GO(gst_video_converter_new,
-//GO(gst_video_converter_set_config,
+GO(gst_video_converter_set_config, iFpp)
//GO(gst_video_convert_sample,
//GO(gst_video_convert_sample_async,
//GO(gst_video_crop_meta_api_get_type,
@@ -178,10 +178,10 @@ GO(gst_video_buffer_pool_new, pFv)
//GO(gst_video_decoder_set_use_default_pad_acceptcaps,
//GO(gst_video_direction_get_type,
//GO(gst_video_dither_flags_get_type,
-//GO(gst_video_dither_free,
-//GO(gst_video_dither_line,
+GO(gst_video_dither_free, vFp)
+GO(gst_video_dither_line, vFppuuu)
//GO(gst_video_dither_method_get_type,
-//GO(gst_video_dither_new,
+GO(gst_video_dither_new, pFuuupu)
//GO(gst_video_encoder_allocate_output_buffer,
//GO(gst_video_encoder_allocate_output_frame,
//GO(gst_video_encoder_finish_frame,
@@ -212,22 +212,22 @@ GO(gst_video_buffer_pool_new, pFv)
//GO(gst_video_event_parse_downstream_force_key_unit,
//GO(gst_video_event_parse_still_frame,
//GO(gst_video_event_parse_upstream_force_key_unit,
-GO(gst_video_field_order_from_string, iFp)
+GO(gst_video_field_order_from_string, uFp)
GO(gst_video_field_order_get_type, pFv)
-GO(gst_video_field_order_to_string, pFi)
+GO(gst_video_field_order_to_string, pFu)
GO(gst_video_filter_get_type, pFv)
GO(gst_video_flags_get_type, pFv)
GO(gst_video_format_flags_get_type, pFv)
-GO(gst_video_format_from_fourcc, iFu)
-//GO(gst_video_format_from_masks,
-//GO(gst_video_format_from_string,
+GO(gst_video_format_from_fourcc, uFu)
+GO(gst_video_format_from_masks, uFiiiuuuu)
+GO(gst_video_format_from_string, uFp)
//GO(gst_video_format_get_info,
-//GO(gst_video_format_get_palette,
+GO(gst_video_format_get_palette, pFup)
//GO(gst_video_format_get_type,
//GO(gst_video_format_info_component,
-//GO(gst_video_formats_raw,
-GO(gst_video_format_to_fourcc, uFi)
-GO(gst_video_format_to_string, pFi)
+GO(gst_video_formats_raw, pFp)
+GO(gst_video_format_to_fourcc, uFu)
+GO(gst_video_format_to_string, pFu)
GO(gst_video_frame_copy, iFpp)
//GO(gst_video_frame_copy_plane,
//GO(gst_video_frame_flags_get_type,
@@ -239,7 +239,7 @@ GO(gst_video_frame_unmap, vFp)
//GO(gst_video_gl_texture_upload_meta_api_get_type,
//GO(gst_video_gl_texture_upload_meta_get_info,
//GO(gst_video_gl_texture_upload_meta_upload,
-//GO(gst_video_guess_framerate,
+GO(gst_video_guess_framerate, iFLpp)
GO(gst_video_info_align, iFpp)
GO(gst_video_info_align_full, iFppp)
GO(gst_video_info_convert, iFpiIip)
@@ -253,17 +253,17 @@ GO(gst_video_info_new, pFv)
GO(gst_video_info_set_format, iFpiuu)
GO(gst_video_info_set_interlaced_format, iFpiiuu)
GO(gst_video_info_to_caps, pFp)
-GO(gst_video_interlace_mode_from_string, iFp)
+GO(gst_video_interlace_mode_from_string, uFp)
GO(gst_video_interlace_mode_get_type, pFv)
-GO(gst_video_interlace_mode_to_string, pFi)
+GO(gst_video_interlace_mode_to_string, pFu)
//GO(gst_video_make_raw_caps,
//GO(gst_video_make_raw_caps_with_features,
//GO(gst_video_mastering_display_info_add_to_caps,
//GO(gst_video_mastering_display_info_from_caps,
-//GO(gst_video_mastering_display_info_from_string,
-//GO(gst_video_mastering_display_info_init,
-//GO(gst_video_mastering_display_info_is_equal,
-//GO(gst_video_mastering_display_info_to_string,
+GO(gst_video_mastering_display_info_from_string, iFpp)
+GO(gst_video_mastering_display_info_init, vFp)
+GO(gst_video_mastering_display_info_is_equal, iFpp)
+GO(gst_video_mastering_display_info_to_string, pFp)
//GO(gst_video_matrix_mode_get_type,
GO(gst_video_meta_api_get_type, pFv)
//GO(gst_video_meta_get_info,
@@ -271,66 +271,66 @@ GO(gst_video_meta_api_get_type, pFv)
//GO(gst_video_meta_get_plane_size,
//GO(gst_video_meta_map,
//GO(gst_video_meta_set_alignment,
-//GO(gst_video_meta_transform_scale_get_quark,
+GO(gst_video_meta_transform_scale_get_quark, uFv)
//GO(gst_video_meta_unmap,
//GO(gst_video_multiview_flagset_get_type,
//GO(gst_video_multiview_flags_get_type,
//GO(gst_video_multiview_frame_packing_get_type,
//GO(gst_video_multiview_get_doubled_height_modes,
-//GO(gst_video_multiview_get_doubled_size_modes,
+GO(gst_video_multiview_get_doubled_size_modes, pFv)
//GO(gst_video_multiview_get_doubled_width_modes,
//GO(gst_video_multiview_get_mono_modes,
//GO(gst_video_multiview_get_unpacked_modes,
-//GO(gst_video_multiview_guess_half_aspect,
-//GO(gst_video_multiview_mode_from_caps_string,
+GO(gst_video_multiview_guess_half_aspect, iFiuuuu)
+GO(gst_video_multiview_mode_from_caps_string, iFp)
//GO(gst_video_multiview_mode_get_type,
-//GO(gst_video_multiview_mode_to_caps_string,
+GO(gst_video_multiview_mode_to_caps_string, pFi)
//GO(gst_video_multiview_video_info_change_mode,
//GO(gst_video_orientation_get_hcenter,
//GO(gst_video_orientation_get_hflip,
//GO(gst_video_orientation_get_type,
-//GO(gst_video_orientation_get_vcenter,
-//GO(gst_video_orientation_get_vflip,
+GO(gst_video_orientation_get_vcenter, iFpp)
+GO(gst_video_orientation_get_vflip, iFpp)
//GO(gst_video_orientation_method_get_type,
//GO(gst_video_orientation_set_hcenter,
//GO(gst_video_orientation_set_hflip,
-//GO(gst_video_orientation_set_vcenter,
-//GO(gst_video_orientation_set_vflip,
-//GO(gst_video_overlay_composition_add_rectangle,
+GO(gst_video_orientation_set_vcenter, iFpi)
+GO(gst_video_orientation_set_vflip, iFpi)
+GO(gst_video_overlay_composition_add_rectangle, vFpp)
//GO(gst_video_overlay_composition_blend,
//GO(gst_video_overlay_composition_copy,
-//GO(gst_video_overlay_composition_get_rectangle,
-//GO(gst_video_overlay_composition_get_seqnum,
+GO(gst_video_overlay_composition_get_rectangle, pFpu)
+GO(gst_video_overlay_composition_get_seqnum, uFp)
//GO(gst_video_overlay_composition_get_type,
-//GO(gst_video_overlay_composition_make_writable,
+GO(gst_video_overlay_composition_make_writable, pFp)
//GO(gst_video_overlay_composition_meta_api_get_type,
//GO(gst_video_overlay_composition_meta_get_info,
-//GO(gst_video_overlay_composition_new,
+GO(gst_video_overlay_composition_new, pFp)
//GO(gst_video_overlay_composition_n_rectangles,
//GO(gst_video_overlay_expose,
//GO(gst_video_overlay_format_flags_get_type,
//GO(gst_video_overlay_get_type,
-//GO(gst_video_overlay_got_window_handle,
-//GO(gst_video_overlay_handle_events,
+GO(gst_video_overlay_got_window_handle, vFpL)
+GO(gst_video_overlay_handle_events, vFpi)
//GO(gst_video_overlay_install_properties,
-//GO(gst_video_overlay_prepare_window_handle,
-//GO(gst_video_overlay_rectangle_copy,
-//GO(gst_video_overlay_rectangle_get_flags,
-//GO(gst_video_overlay_rectangle_get_global_alpha,
+GO(gst_video_overlay_prepare_window_handle, vFp)
+GO(gst_video_overlay_rectangle_copy, pFp)
+GO(gst_video_overlay_rectangle_get_flags, uFp)
+GO(gst_video_overlay_rectangle_get_global_alpha, fFp)
//GO(gst_video_overlay_rectangle_get_pixels_argb,
//GO(gst_video_overlay_rectangle_get_pixels_ayuv,
//GO(gst_video_overlay_rectangle_get_pixels_raw,
//GO(gst_video_overlay_rectangle_get_pixels_unscaled_argb,
//GO(gst_video_overlay_rectangle_get_pixels_unscaled_ayuv,
//GO(gst_video_overlay_rectangle_get_pixels_unscaled_raw,
-//GO(gst_video_overlay_rectangle_get_render_rectangle,
-//GO(gst_video_overlay_rectangle_get_seqnum,
+GO(gst_video_overlay_rectangle_get_render_rectangle, iFppppp)
+GO(gst_video_overlay_rectangle_get_seqnum, uFp)
//GO(gst_video_overlay_rectangle_get_type,
//GO(gst_video_overlay_rectangle_new_raw,
-//GO(gst_video_overlay_rectangle_set_global_alpha,
-//GO(gst_video_overlay_rectangle_set_render_rectangle,
-//GO(gst_video_overlay_set_property,
-//GO(gst_video_overlay_set_render_rectangle,
+GO(gst_video_overlay_rectangle_set_global_alpha, vFpf)
+GO(gst_video_overlay_rectangle_set_render_rectangle, vFpiiuu)
+GO(gst_video_overlay_set_property, iFpiup)
+GO(gst_video_overlay_set_render_rectangle, iFpiiii)
//GO(gst_video_overlay_set_window_handle,
//GO(gst_video_pack_flags_get_type,
//GO(gst_video_primaries_mode_get_type,
@@ -338,69 +338,69 @@ GO(gst_video_meta_api_get_type, pFv)
//GO(gst_video_region_of_interest_meta_api_get_type,
//GO(gst_video_region_of_interest_meta_get_info,
//GO(gst_video_region_of_interest_meta_get_param,
-//GO(gst_video_resampler_clear,
+GO(gst_video_resampler_clear, vFp)
//GO(gst_video_resampler_flags_get_type,
-//GO(gst_video_resampler_init,
+GO(gst_video_resampler_init, iFpuuuuduup)
//GO(gst_video_resampler_method_get_type,
-//GO(gst_video_scaler_2d,
-//GO(gst_video_scaler_combine_packed_YUV,
+GO(gst_video_scaler_2d, vFppupipiuuuu)
+GO(gst_video_scaler_combine_packed_YUV, pFppuu)
//GO(gst_video_scaler_flags_get_type,
-//GO(gst_video_scaler_free,
-//GO(gst_video_scaler_get_coeff,
-//GO(gst_video_scaler_get_max_taps,
-//GO(gst_video_scaler_horizontal,
-//GO(gst_video_scaler_new,
-//GO(gst_video_scaler_vertical,
+GO(gst_video_scaler_free, vFp)
+GO(gst_video_scaler_get_coeff, pFpupp)
+GO(gst_video_scaler_get_max_taps, uFp)
+GO(gst_video_scaler_horizontal, vFpuppuu)
+GO(gst_video_scaler_new, pFuuuuup)
+GO(gst_video_scaler_vertical, vFpuppuu)
//GO(gst_video_sink_center_rect,
//GO(gst_video_sink_get_type,
-//GO(gst_video_tile_get_index,
+GO(gst_video_tile_get_index, uFuiiii)
//GO(gst_video_tile_mode_get_type,
//GO(gst_video_tile_type_get_type,
-//GO(gst_video_time_code_add_frames,
-//GO(gst_video_time_code_add_interval,
+GO(gst_video_time_code_add_frames, vFpl)
+GO(gst_video_time_code_add_interval, pFpp)
//GO(gst_video_time_code_clear,
-//GO(gst_video_time_code_compare,
-//GO(gst_video_time_code_copy,
+GO(gst_video_time_code_compare, iFpp)
+GO(gst_video_time_code_copy, pFp)
//GO(gst_video_time_code_flags_get_type,
-//GO(gst_video_time_code_frames_since_daily_jam,
+GO(gst_video_time_code_frames_since_daily_jam, LFp)
//GO(gst_video_time_code_free,
//GO(gst_video_time_code_get_type,
-//GO(gst_video_time_code_increment_frame,
-//GO(gst_video_time_code_init,
-//GO(gst_video_time_code_init_from_date_time,
-//GO(gst_video_time_code_init_from_date_time_full,
-//GO(gst_video_time_code_interval_clear,
-//GO(gst_video_time_code_interval_copy,
+GO(gst_video_time_code_increment_frame, vFp)
+GO(gst_video_time_code_init, vFpuupuuuuuu)
+GO(gst_video_time_code_init_from_date_time, vFpuupuu)
+GO(gst_video_time_code_init_from_date_time_full, iFpuupuu)
+GO(gst_video_time_code_interval_clear, vFp)
+GO(gst_video_time_code_interval_copy, pFp)
//GO(gst_video_time_code_interval_free,
//GO(gst_video_time_code_interval_get_type,
-//GO(gst_video_time_code_interval_init,
-//GO(gst_video_time_code_interval_new,
-//GO(gst_video_time_code_interval_new_from_string,
-//GO(gst_video_time_code_is_valid,
+GO(gst_video_time_code_interval_init, vFpuuuu)
+GO(gst_video_time_code_interval_new, pFuuuu)
+GO(gst_video_time_code_interval_new_from_string, pFp)
+GO(gst_video_time_code_is_valid, iFp)
//GO(gst_video_time_code_meta_api_get_type,
//GO(gst_video_time_code_meta_get_info,
-//GO(gst_video_time_code_new,
-//GO(gst_video_time_code_new_empty,
+GO(gst_video_time_code_new, pFuupuuuuuu)
+GO(gst_video_time_code_new_empty, pFv)
//GO(gst_video_time_code_new_from_date_time,
-//GO(gst_video_time_code_new_from_date_time_full,
-//GO(gst_video_time_code_new_from_string,
+GO(gst_video_time_code_new_from_date_time_full, pFuupuu)
+GO(gst_video_time_code_new_from_string, pFp)
//GO(gst_video_time_code_nsec_since_daily_jam,
-//GO(gst_video_time_code_to_date_time,
-//GO(gst_video_time_code_to_string,
-//GO(gst_video_transfer_function_from_iso,
+GO(gst_video_time_code_to_date_time, pFp)
+GO(gst_video_time_code_to_string, pFp)
+GO(gst_video_transfer_function_from_iso, uFu)
//GO(gst_video_transfer_function_get_type,
-//GO(gst_video_transfer_function_is_equivalent,
-//GO(gst_video_transfer_function_to_iso,
-//GO(gst_video_vbi_encoder_add_ancillary,
-//GO(gst_video_vbi_encoder_copy,
-//GO(gst_video_vbi_encoder_free,
+GO(gst_video_transfer_function_is_equivalent, iFuuuu)
+GO(gst_video_transfer_function_to_iso, uFu)
+GO(gst_video_vbi_encoder_add_ancillary, iFpiCCpu)
+GO(gst_video_vbi_encoder_copy, pFp)
+GO(gst_video_vbi_encoder_free, vFp)
//GO(gst_video_vbi_encoder_get_type,
-//GO(gst_video_vbi_encoder_new,
-//GO(gst_video_vbi_encoder_write_line,
-//GO(gst_video_vbi_parser_add_line,
-//GO(gst_video_vbi_parser_copy,
-//GO(gst_video_vbi_parser_free,
-//GO(gst_video_vbi_parser_get_ancillary,
+GO(gst_video_vbi_encoder_new, pFuu)
+GO(gst_video_vbi_encoder_write_line, vFpp)
+GO(gst_video_vbi_parser_add_line, vFpp)
+GO(gst_video_vbi_parser_copy, pFp)
+GO(gst_video_vbi_parser_free, vFp)
+GO(gst_video_vbi_parser_get_ancillary, uFpp)
//GO(gst_video_vbi_parser_get_type,
-//GO(gst_video_vbi_parser_new,
+GO(gst_video_vbi_parser_new, pFuu)
//GO(gst_video_vbi_parser_result_get_type,
diff --git a/src/wrapped/wrappedgthread2.c b/src/wrapped/wrappedgthread2.c
index 6e66c72..6e66c72 100755..100644
--- a/src/wrapped/wrappedgthread2.c
+++ b/src/wrapped/wrappedgthread2.c
diff --git a/src/wrapped/wrappedgthread2_private.h b/src/wrapped/wrappedgthread2_private.h
index fd8c61c..fd8c61c 100755..100644
--- a/src/wrapped/wrappedgthread2_private.h
+++ b/src/wrapped/wrappedgthread2_private.h
diff --git a/src/wrapped/wrappedgtk3.c b/src/wrapped/wrappedgtk3.c
index 46adf78..87a7bd7 100755..100644
--- a/src/wrapped/wrappedgtk3.c
+++ b/src/wrapped/wrappedgtk3.c
@@ -38,12 +38,15 @@ typedef void (*vFpipV_t)(void*, int, void*, ...);
#define ADDED_FUNCTIONS() \
GO(g_type_class_ref, pFL_t) \
GO(g_type_class_unref, vFp_t) \
+GO(gtk_application_window_get_type, LFv_t) \
GO(gtk_bin_get_type, LFv_t) \
GO(gtk_widget_get_type, LFv_t) \
GO(gtk_button_get_type, LFv_t) \
GO(gtk_container_get_type, LFv_t) \
GO(gtk_misc_get_type, LFv_t) \
GO(gtk_label_get_type, LFv_t) \
+GO(gtk_list_box_get_type, LFv_t) \
+GO(gtk_list_box_row_get_type, LFv_t) \
GO(gtk_tree_view_get_type, LFv_t) \
GO(gtk_window_get_type, LFv_t) \
GO(gtk_table_get_type, LFv_t) \
@@ -60,6 +63,12 @@ GO(gtk_progress_bar_get_type, LFv_t) \
GO(gtk_menu_shell_get_type, LFv_t) \
GO(gtk_menu_bar_get_type, LFv_t) \
GO(gtk_action_get_type, LFv_t) \
+GO(gtk_application_get_type, LFv_t) \
+GO(gtk_grid_get_type, LFv_t) \
+GO(gtk_event_controller_get_type, LFv_t) \
+GO(gtk_gesture_get_type, LFv_t) \
+GO(gtk_gesture_single_get_type, LFv_t) \
+GO(gtk_gesture_long_press_get_type, LFv_t) \
GO(gtk_dialog_add_button, pFppi_t) \
GO(gtk_spin_button_get_value, dFp_t) \
GO(gtk_builder_lookup_callback_symbol, pFpp_t) \
@@ -90,10 +99,10 @@ GO(3)
// GtkMenuDetachFunc
#define GO(A) \
-static uintptr_t my_menudetach_fct_##A = 0; \
-static void my_menudetach_##A(void* widget, void* menu) \
-{ \
- RunFunction(my_context, my_menudetach_fct_##A, 2, widget, menu);\
+static uintptr_t my_menudetach_fct_##A = 0; \
+static void my_menudetach_##A(void* widget, void* menu) \
+{ \
+ RunFunctionFmt(my_menudetach_fct_##A, "pp", widget, menu); \
}
SUPER()
#undef GO
@@ -113,10 +122,10 @@ static void* findMenuDetachFct(void* fct)
// GtkMenuPositionFunc
#define GO(A) \
-static uintptr_t my_menuposition_fct_##A = 0; \
-static void my_menuposition_##A(void* menu, void* x, void* y, void* push_in, void* data) \
-{ \
- RunFunction(my_context, my_menuposition_fct_##A, 5, menu, x, y, push_in, data);\
+static uintptr_t my_menuposition_fct_##A = 0; \
+static void my_menuposition_##A(void* menu, void* x, void* y, void* push_in, void* data) \
+{ \
+ RunFunctionFmt(my_menuposition_fct_##A, "ppppp", menu, x, y, push_in, data); \
}
SUPER()
#undef GO
@@ -136,10 +145,10 @@ static void* findMenuPositionFct(void* fct)
// GtkFunction
#define GO(A) \
-static uintptr_t my3_gtkfunction_fct_##A = 0; \
-static int my3_gtkfunction_##A(void* data) \
-{ \
- return RunFunction(my_context, my3_gtkfunction_fct_##A, 1, data);\
+static uintptr_t my3_gtkfunction_fct_##A = 0; \
+static int my3_gtkfunction_##A(void* data) \
+{ \
+ return RunFunctionFmt(my3_gtkfunction_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -159,10 +168,10 @@ static void* findGtkFunctionFct(void* fct)
// GtkClipboardGetFunc
#define GO(A) \
-static uintptr_t my_clipboardget_fct_##A = 0; \
-static void my_clipboardget_##A(void* clipboard, void* selection, uint32_t info, void* data) \
-{ \
- RunFunction(my_context, my_clipboardget_fct_##A, 4, clipboard, selection, info, data);\
+static uintptr_t my_clipboardget_fct_##A = 0; \
+static void my_clipboardget_##A(void* clipboard, void* selection, uint32_t info, void* data) \
+{ \
+ RunFunctionFmt(my_clipboardget_fct_##A, "ppup", clipboard, selection, info, data); \
}
SUPER()
#undef GO
@@ -182,10 +191,10 @@ static void* findClipboadGetFct(void* fct)
// GtkClipboardClearFunc
#define GO(A) \
-static uintptr_t my_clipboardclear_fct_##A = 0; \
-static void my_clipboardclear_##A(void* clipboard, void* data) \
-{ \
- RunFunction(my_context, my_clipboardclear_fct_##A, 2, clipboard, data);\
+static uintptr_t my_clipboardclear_fct_##A = 0; \
+static void my_clipboardclear_##A(void* clipboard, void* data) \
+{ \
+ RunFunctionFmt(my_clipboardclear_fct_##A, "pp", clipboard, data); \
}
SUPER()
#undef GO
@@ -204,11 +213,11 @@ static void* findClipboadClearFct(void* fct)
}
// GtkCallback
-#define GO(A) \
-static uintptr_t my3_gtkcallback_fct_##A = 0; \
-static void my3_gtkcallback_##A(void* widget, void* data) \
-{ \
- RunFunction(my_context, my3_gtkcallback_fct_##A, 2, widget, data);\
+#define GO(A) \
+static uintptr_t my3_gtkcallback_fct_##A = 0; \
+static void my3_gtkcallback_##A(void* widget, void* data) \
+{ \
+ RunFunctionFmt(my3_gtkcallback_fct_##A, "pp", widget, data); \
}
SUPER()
#undef GO
@@ -228,10 +237,10 @@ static void* findGtkCallbackFct(void* fct)
// GtkTextCharPredicate
#define GO(A) \
-static uintptr_t my_textcharpredicate_fct_##A = 0; \
-static int my_textcharpredicate_##A(uint32_t ch, void* data) \
-{ \
- return (int)RunFunction(my_context, my_textcharpredicate_fct_##A, 2, ch, data);\
+static uintptr_t my_textcharpredicate_fct_##A = 0; \
+static int my_textcharpredicate_##A(uint32_t ch, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_textcharpredicate_fct_##A, "up", ch, data); \
}
SUPER()
#undef GO
@@ -251,10 +260,10 @@ static void* findGtkTextCharPredicateFct(void* fct)
// Toolbar
#define GO(A) \
-static uintptr_t my_toolbar_fct_##A = 0; \
-static void my_toolbar_##A(void* widget, void* data) \
-{ \
- RunFunction(my_context, my_toolbar_fct_##A, 2, widget, data);\
+static uintptr_t my_toolbar_fct_##A = 0; \
+static void my_toolbar_##A(void* widget, void* data) \
+{ \
+ RunFunctionFmt(my_toolbar_fct_##A, "pp", widget, data); \
}
SUPER()
#undef GO
@@ -274,10 +283,10 @@ static void* findToolbarFct(void* fct)
// Builder
#define GO(A) \
-static uintptr_t my_builderconnect_fct_##A = 0; \
-static void my_builderconnect_##A(void* builder, void* object, void* signal, void* handler, void* connect, int flags, void* data) \
-{ \
- RunFunction(my_context, my_builderconnect_fct_##A, 7, builder, object, signal, handler, connect, flags, data);\
+static uintptr_t my_builderconnect_fct_##A = 0; \
+static void my_builderconnect_##A(void* builder, void* object, void* signal, void* handler, void* connect, int flags, void* data) \
+{ \
+ RunFunctionFmt(my_builderconnect_fct_##A, "pppppip", builder, object, signal, handler, connect, flags, data); \
}
SUPER()
#undef GO
@@ -297,10 +306,10 @@ static void* findBuilderConnectFct(void* fct)
// GtkTreeViewSearchEqualFunc
#define GO(A) \
-static uintptr_t my_GtkTreeViewSearchEqualFunc_fct_##A = 0; \
-static int my_GtkTreeViewSearchEqualFunc_##A(void* model, int column, void* key, void* iter, void* data) \
-{ \
- return RunFunction(my_context, my_GtkTreeViewSearchEqualFunc_fct_##A, 5, model, column, key, iter, data); \
+static uintptr_t my_GtkTreeViewSearchEqualFunc_fct_##A = 0; \
+static int my_GtkTreeViewSearchEqualFunc_##A(void* model, int column, void* key, void* iter, void* data) \
+{ \
+ return RunFunctionFmt(my_GtkTreeViewSearchEqualFunc_fct_##A, "pippp", model, column, key, iter, data); \
}
SUPER()
#undef GO
@@ -319,10 +328,10 @@ static void* findGtkTreeViewSearchEqualFuncFct(void* fct)
}
// GtkTreeCellDataFunc
#define GO(A) \
-static uintptr_t my_GtkTreeCellDataFunc_fct_##A = 0; \
-static void my_GtkTreeCellDataFunc_##A(void* tree, void* cell, void* model, void* iter, void* data) \
-{ \
- RunFunction(my_context, my_GtkTreeCellDataFunc_fct_##A, 5, tree, cell, model, iter, data); \
+static uintptr_t my_GtkTreeCellDataFunc_fct_##A = 0; \
+static void my_GtkTreeCellDataFunc_##A(void* tree, void* cell, void* model, void* iter, void* data) \
+{ \
+ RunFunctionFmt(my_GtkTreeCellDataFunc_fct_##A, "ppppp", tree, cell, model, iter, data); \
}
SUPER()
#undef GO
@@ -342,10 +351,10 @@ static void* findGtkTreeCellDataFuncFct(void* fct)
// GDestroyNotify
#define GO(A) \
-static uintptr_t my_GDestroyNotify_fct_##A = 0; \
-static void my_GDestroyNotify_##A(void* data) \
-{ \
- RunFunction(my_context, my_GDestroyNotify_fct_##A, 1, data); \
+static uintptr_t my_GDestroyNotify_fct_##A = 0; \
+static void my_GDestroyNotify_##A(void* data) \
+{ \
+ RunFunctionFmt(my_GDestroyNotify_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -365,10 +374,10 @@ static void* findGDestroyNotifyFct(void* fct)
// GtkTreeIterCompareFunc
#define GO(A) \
-static uintptr_t my_GtkTreeIterCompareFunc_fct_##A = 0; \
-static int my_GtkTreeIterCompareFunc_##A(void* model, void* a, void* b, void* data) \
-{ \
- return RunFunction(my_context, my_GtkTreeIterCompareFunc_fct_##A, 4, model, a, b, data); \
+static uintptr_t my_GtkTreeIterCompareFunc_fct_##A = 0; \
+static int my_GtkTreeIterCompareFunc_##A(void* model, void* a, void* b, void* data) \
+{ \
+ return RunFunctionFmt(my_GtkTreeIterCompareFunc_fct_##A, "pppp", model, a, b, data); \
}
SUPER()
#undef GO
@@ -388,10 +397,10 @@ static void* findGtkTreeIterCompareFuncFct(void* fct)
// GtkPrinterFunc
#define GO(A) \
-static uintptr_t my_GtkPrinterFunc_fct_##A = 0; \
-static int my_GtkPrinterFunc_##A(void* printer, void* data) \
-{ \
- return RunFunction(my_context, my_GtkPrinterFunc_fct_##A, 2, printer, data); \
+static uintptr_t my_GtkPrinterFunc_fct_##A = 0; \
+static int my_GtkPrinterFunc_##A(void* printer, void* data) \
+{ \
+ return RunFunctionFmt(my_GtkPrinterFunc_fct_##A, "pp", printer, data); \
}
SUPER()
#undef GO
@@ -411,10 +420,10 @@ static void* findGtkPrinterFuncFct(void* fct)
// GtkPrintJobCompleteHunc
#define GO(A) \
-static uintptr_t my_GtkPrintJobCompleteHunc_fct_##A = 0; \
-static void my_GtkPrintJobCompleteHunc_##A(void* job, void* data, void* error) \
-{ \
- RunFunction(my_context, my_GtkPrintJobCompleteHunc_fct_##A, 3, job, data, error); \
+static uintptr_t my_GtkPrintJobCompleteHunc_fct_##A = 0; \
+static void my_GtkPrintJobCompleteHunc_##A(void* job, void* data, void* error) \
+{ \
+ RunFunctionFmt(my_GtkPrintJobCompleteHunc_fct_##A, "ppp", job, data, error); \
}
SUPER()
#undef GO
@@ -432,6 +441,30 @@ static void* findGtkPrintJobCompleteHuncFct(void* fct)
return NULL;
}
+
+// GtkClipboardTextReceivedFunc
+#define GO(A) \
+static uintptr_t my_GtkClipboardTextReceivedFunc_fct_##A = 0; \
+static void my_GtkClipboardTextReceivedFunc_##A(void* clipboard, void* text, void* data) \
+{ \
+ RunFunctionFmt(my_GtkClipboardTextReceivedFunc_fct_##A, "ppp", clipboard, text, data); \
+}
+SUPER()
+#undef GO
+static void* findGtkClipboardTextReceivedFuncFct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_GtkClipboardTextReceivedFunc_fct_##A == (uintptr_t)fct) return my_GtkClipboardTextReceivedFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GtkClipboardTextReceivedFunc_fct_##A == 0) {my_GtkClipboardTextReceivedFunc_fct_##A = (uintptr_t)fct; return my_GtkClipboardTextReceivedFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GtkClipboardTextReceivedFunc callback\n");
+ return NULL;
+}
+
#undef SUPER
/*
EXPORT void my3_gtk_dialog_add_buttons(x64emu_t* emu, void* dialog, void* first, uintptr_t* b)
@@ -524,7 +557,7 @@ EXPORT int my3_gtk_clipboard_set_with_owner(x64emu_t* emu, void* clipboard, void
static void* my_translate_func(void* path, my_signal_t* sig)
{
- return (void*)RunFunction(my_context, sig->c_handler, 2, path, sig->data);
+ return (void*)RunFunctionFmt(sig->c_handler, "pp", path, sig->data) ;
}
EXPORT void my3_gtk_stock_set_translate_func(x64emu_t* emu, void* domain, void* f, void* data, void* notify)
@@ -630,7 +663,7 @@ typedef struct my_connectargs_s {
//defined in gobject2...
uintptr_t my_g_signal_connect_object(x64emu_t* emu, void* instance, void* detailed, void* c_handler, void* object, uint32_t flags);
uintptr_t my_g_signal_connect_data(x64emu_t* emu, void* instance, void* detailed, void* c_handler, void* data, void* closure, uint32_t flags);
-static void my3_gtk_builder_connect_signals_default(void* builder, void* object,
+static void my3_gtk_builder_connect_signals_default(void* builder, void* object,
char* signal_name, char* handler_name,
void* connect_object, uint32_t flags, my_connectargs_t* args)
{
@@ -714,6 +747,11 @@ EXPORT void my3_gtk_container_foreach(x64emu_t* emu, void* container, void* cb,
my->gtk_container_foreach(container, findGtkCallbackFct(cb), data);
}
+EXPORT void my3_gtk_clipboard_request_text(x64emu_t* emu, void* clipboard, void* f, void* data)
+{
+ my->gtk_clipboard_request_text(clipboard, findGtkClipboardTextReceivedFuncFct(f), data);
+}
+
#define PRE_INIT \
if(box64_nogtk) \
return -1;
@@ -722,11 +760,25 @@ EXPORT void my3_gtk_container_foreach(x64emu_t* emu, void* container, void* cb,
libname = lib->name; \
getMy(lib); \
SETALT(my3_); \
+ SetGtkApplicationID(my->gtk_application_get_type()); \
SetGtkWidget3ID(my->gtk_widget_get_type()); \
SetGtkContainer3ID(my->gtk_container_get_type()); \
+ SetGtkBin3ID(my->gtk_bin_get_type()); \
+ SetGtkButton3ID(my->gtk_button_get_type()); \
+ SetGtkWindow3ID(my->gtk_window_get_type()); \
+ SetGtkApplicationWindowID(my->gtk_application_window_get_type());\
+ SetGtkListBoxID(my->gtk_list_box_get_type()); \
+ SetGtkListBoxRowID(my->gtk_list_box_row_get_type()); \
SetGtkTextView3ID(my->gtk_text_view_get_type()); \
+ SetGtkGrid3ID(my->gtk_grid_get_type()); \
+ SetGtkMisc3ID(my->gtk_misc_get_type()); \
+ SetGtkLabel3ID(my->gtk_label_get_type()); \
+ SetGtkEventControllerID(my->gtk_event_controller_get_type());\
+ SetGtkGestureID(my->gtk_gesture_get_type()); \
+ SetGtkGestureSingleID(my->gtk_gesture_single_get_type()); \
+ SetGtkGestureLongPressID(my->gtk_gesture_long_press_get_type());\
SetGtkActionID(my->gtk_action_get_type()); \
- setNeededLibs(lib, 2, "libgdk-3.so.0", "libpangocairo-1.0.so.0");
+ setNeededLibs(lib, 3, "libgdk-3.so.0", "libpangocairo-1.0.so.0", "libgio-2.0.so.0");
#define CUSTOM_FINI \
freeMy();
diff --git a/src/wrapped/wrappedgtk3_private.h b/src/wrapped/wrappedgtk3_private.h
index e5213a8..a6e4e3e 100755..100644
--- a/src/wrapped/wrappedgtk3_private.h
+++ b/src/wrapped/wrappedgtk3_private.h
@@ -9,7 +9,7 @@ GO(gtk_about_dialog_get_comments, pFp)
GO(gtk_about_dialog_get_copyright, pFp)
GO(gtk_about_dialog_get_documenters, pFp)
GO(gtk_about_dialog_get_license, pFp)
-GO(gtk_about_dialog_get_license_type, iFp)
+GO(gtk_about_dialog_get_license_type, uFp)
GO(gtk_about_dialog_get_logo, pFp)
GO(gtk_about_dialog_get_logo_icon_name, pFp)
GO(gtk_about_dialog_get_name, pFp)
@@ -28,7 +28,7 @@ GO(gtk_about_dialog_set_copyright, vFpp)
GO(gtk_about_dialog_set_documenters, vFpp)
//GO(gtk_about_dialog_set_email_hook,
GO(gtk_about_dialog_set_license, vFpp)
-GO(gtk_about_dialog_set_license_type, vFpi)
+GO(gtk_about_dialog_set_license_type, vFpu)
GO(gtk_about_dialog_set_logo, vFpp)
GO(gtk_about_dialog_set_logo_icon_name, vFpp)
GO(gtk_about_dialog_set_name, vFpp)
@@ -40,54 +40,54 @@ GO(gtk_about_dialog_set_website, vFpp)
GO(gtk_about_dialog_set_website_label, vFpp)
GO(gtk_about_dialog_set_wrap_license, vFpi)
GO(gtk_accelerator_get_default_mod_mask, uFv)
-GO(gtk_accelerator_get_label, pFui)
+GO(gtk_accelerator_get_label, pFuu)
GO(gtk_accelerator_name, pFui)
GO(gtk_accelerator_parse, vFppp)
GO(gtk_accelerator_set_default_mod_mask, vFu)
-GO(gtk_accelerator_valid, iFui)
+GO(gtk_accelerator_valid, iFuu)
GO(gtk_accel_flags_get_type, pFv)
-GO(gtk_accel_group_activate, iFpppui)
+GO(gtk_accel_group_activate, iFpupuu)
GO(gtk_accel_group_connect, vFpuiip) // Closure probably needs wrapping when not null
GO(gtk_accel_group_connect_by_path, vFppp)
GO(gtk_accel_group_disconnect, iFpp)
-GO(gtk_accel_group_disconnect_key, iFpui)
+GO(gtk_accel_group_disconnect_key, iFpuu)
//GOM(gtk_accel_group_find, pFEppp)
GO(gtk_accel_group_from_accel_closure, pFp)
GO(gtk_accel_group_get_is_locked, iFp)
-GO(gtk_accel_group_get_modifier_mask, iFp)
+GO(gtk_accel_group_get_modifier_mask, uFp)
GO(gtk_accel_group_get_type, pFv)
GO(gtk_accel_group_lock, vFp)
GO(gtk_accel_group_new, pFv)
-GO(gtk_accel_group_query, pFpuip)
+GO(gtk_accel_group_query, pFpuup)
GO(gtk_accel_groups_activate, iFpui)
GO(gtk_accel_groups_from_object, pFp)
GO(gtk_accel_group_unlock, vFp)
-//GO(gtk_accel_label_get_accel_widget,
-//GO(gtk_accel_label_get_accel_width,
+GO(gtk_accel_label_get_accel_widget, pFp)
+GO(gtk_accel_label_get_accel_width, uFp)
GO(gtk_accel_label_get_type, pFv)
//GO(gtk_accel_label_new,
-//GO(gtk_accel_label_refetch,
+GO(gtk_accel_label_refetch, iFp)
//GO(gtk_accel_label_set_accel_closure,
-//GO(gtk_accel_label_set_accel_widget,
-//GO(gtk_accel_map_add_entry,
+GO(gtk_accel_label_set_accel_widget, vFpp)
+GO(gtk_accel_map_add_entry, vFpuu)
//GO(gtk_accel_map_add_filter,
-//GO(gtk_accel_map_change_entry,
+GO(gtk_accel_map_change_entry, iFpuui)
//GO(gtk_accel_map_foreach,
//GO(gtk_accel_map_foreach_unfiltered,
-//GO(gtk_accel_map_get,
+GO(gtk_accel_map_get, pFv)
GO(gtk_accel_map_get_type, pFv)
//GO(gtk_accel_map_load,
//GO(gtk_accel_map_load_fd,
//GO(gtk_accel_map_load_scanner,
//GO(gtk_accel_map_lock_path,
-//GO(gtk_accel_map_lookup_entry,
+GO(gtk_accel_map_lookup_entry, iFpp)
//GO(gtk_accel_map_save,
-//GO(gtk_accel_map_save_fd,
+GO(gtk_accel_map_save_fd, vFi)
//GO(gtk_accel_map_unlock_path,
//GO(gtk_accessible_connect_widget_destroyed,
GO(gtk_accessible_get_type, pFv)
-//GO(gtk_accessible_get_widget,
-//GO(gtk_accessible_set_widget,
+GO(gtk_accessible_get_widget, pFp)
+GO(gtk_accessible_set_widget, vFpp)
GO(gtk_actionable_get_type, pFv)
//GO(gtk_action_activate,
GO(gtk_action_bar_get_type, pFv)
@@ -95,21 +95,21 @@ GO(gtk_action_bar_get_type, pFv)
//GO(gtk_action_block_activate_from,
//GO(gtk_action_connect_accelerator,
//GO(gtk_action_connect_proxy,
-//GO(gtk_action_create_icon,
-//GO(gtk_action_create_menu,
+GO(gtk_action_create_icon, pFpu)
+GO(gtk_action_create_menu, pFp)
//GO(gtk_action_create_menu_item,
//GO(gtk_action_create_tool_item,
//GO(gtk_action_disconnect_accelerator,
//GO(gtk_action_disconnect_proxy,
//GO(gtk_action_get_accel_closure,
//GO(gtk_action_get_accel_path,
-//GO(gtk_action_get_always_show_image,
-//GO(gtk_action_get_gicon,
-//GO(gtk_action_get_icon_name,
+GO(gtk_action_get_always_show_image, iFp)
+GO(gtk_action_get_gicon, pFp)
+GO(gtk_action_get_icon_name, pFp)
//GO(gtk_action_get_is_important,
//GO(gtk_action_get_label,
//GO(gtk_action_get_name,
-//GO(gtk_action_get_proxies,
+GO(gtk_action_get_proxies, pFp)
//GO(gtk_action_get_sensitive,
//GO(gtk_action_get_short_label,
//GO(gtk_action_get_stock_id,
@@ -121,32 +121,32 @@ GO(gtk_action_get_type, pFv)
//GO(gtk_action_group_add_action,
//GO(gtk_action_group_add_actions,
//GO(gtk_action_group_add_actions_full,
-//GO(gtk_action_group_add_action_with_accel,
+GO(gtk_action_group_add_action_with_accel, vFppp)
//GO(gtk_action_group_add_radio_actions,
//GO(gtk_action_group_add_radio_actions_full,
//GO(gtk_action_group_add_toggle_actions,
//GO(gtk_action_group_add_toggle_actions_full,
-//GO(gtk_action_group_get_action,
-//GO(gtk_action_group_get_name,
+GO(gtk_action_group_get_action, pFpp)
+GO(gtk_action_group_get_name, pFp)
//GO(gtk_action_group_get_sensitive,
GO(gtk_action_group_get_type, pFv)
-//GO(gtk_action_group_get_visible,
-//GO(gtk_action_group_list_actions,
-//GO(gtk_action_group_new,
+GO(gtk_action_group_get_visible, iFp)
+GO(gtk_action_group_list_actions, pFp)
+GO(gtk_action_group_new, pFp)
//GO(gtk_action_group_remove_action,
//GO(gtk_action_group_set_sensitive,
//GO(gtk_action_group_set_translate_func,
-//GO(gtk_action_group_set_translation_domain,
-//GO(gtk_action_group_set_visible,
-//GO(gtk_action_group_translate_string,
+GO(gtk_action_group_set_translation_domain, vFpp)
+GO(gtk_action_group_set_visible, vFpi)
+GO(gtk_action_group_translate_string, pFpp)
//GO(gtk_action_is_sensitive,
//GO(gtk_action_is_visible,
//GO(gtk_action_new,
-//GO(gtk_action_set_accel_group,
+GO(gtk_action_set_accel_group, vFpp)
//GO(gtk_action_set_accel_path,
-//GO(gtk_action_set_always_show_image,
-//GO(gtk_action_set_gicon,
-//GO(gtk_action_set_icon_name,
+GO(gtk_action_set_always_show_image, vFpi)
+GO(gtk_action_set_gicon, vFpp)
+GO(gtk_action_set_icon_name, vFpp)
//GO(gtk_action_set_is_important,
//GO(gtk_action_set_label,
//GO(gtk_action_set_sensitive,
@@ -158,12 +158,12 @@ GO(gtk_action_group_get_type, pFv)
//GO(gtk_action_set_visible_vertical,
//GO(gtk_action_unblock_activate,
//GO(gtk_action_unblock_activate_from,
-//GO(gtk_activatable_do_set_related_action,
-//GO(gtk_activatable_get_related_action,
+GO(gtk_activatable_do_set_related_action, vFpp)
+GO(gtk_activatable_get_related_action, pFp)
GO(gtk_activatable_get_type, pFv)
-//GO(gtk_activatable_get_use_action_appearance,
+GO(gtk_activatable_get_use_action_appearance, iFp)
//GO(gtk_activatable_set_related_action,
-//GO(gtk_activatable_set_use_action_appearance,
+GO(gtk_activatable_set_use_action_appearance, vFpi)
//GO(gtk_activatable_sync_action_properties,
GO(gtk_adjustment_changed, vFp)
GO(gtk_adjustment_clamp_page, vFpdd)
@@ -191,7 +191,12 @@ GO(gtk_alignment_set_padding, vFpuuuu)
GO(gtk_align_get_type, pFv)
GO(gtk_alternative_dialog_button_order, iFp)
GO(gtk_anchor_type_get_type, pFv)
-GO(gtk_application_get_type, pFv)
+GO(gtk_application_add_window, vFpp)
+GO(gtk_application_get_new, pFpi)
+GO(gtk_application_get_type, LFv)
+GO(gtk_application_new, pFpu)
+GO(gtk_application_set_accels_for_action, vFppp)
+GO(gtk_application_window_new, pFp)
GO(gtk_application_window_get_type, pFv)
GO(gtk_app_chooser_button_get_type, pFv)
GO(gtk_app_chooser_dialog_get_type, pFv)
@@ -199,51 +204,51 @@ GO(gtk_app_chooser_get_type, pFv)
GO(gtk_app_chooser_widget_get_type, pFv)
GO(gtk_arg_flags_get_type, pFv)
GO(gtk_arrow_get_type, pFv)
-GO(gtk_arrow_new, pFii)
+GO(gtk_arrow_new, pFuu)
GO(gtk_arrow_placement_get_type, pFv)
-GO(gtk_arrow_set, vFpii)
+GO(gtk_arrow_set, vFpuu)
GO(gtk_arrow_type_get_type, pFv)
GO(gtk_aspect_frame_get_type, pFv)
-//GO(gtk_aspect_frame_new,
-//GO(gtk_aspect_frame_set,
+GO(gtk_aspect_frame_new, pFpfffi)
+GO(gtk_aspect_frame_set, vFpfffi)
//GO(gtk_assistant_add_action_widget,
-//GO(gtk_assistant_append_page,
+GO(gtk_assistant_append_page, iFpp)
//GO(gtk_assistant_commit,
//GO(gtk_assistant_get_current_page,
-//GO(gtk_assistant_get_n_pages,
-//GO(gtk_assistant_get_nth_page,
+GO(gtk_assistant_get_n_pages, iFp)
+GO(gtk_assistant_get_nth_page, pFpi)
//GO(gtk_assistant_get_page_complete,
//GO(gtk_assistant_get_page_header_image,
-//GO(gtk_assistant_get_page_side_image,
-//GO(gtk_assistant_get_page_title,
-//GO(gtk_assistant_get_page_type,
+GO(gtk_assistant_get_page_side_image, pFpp)
+GO(gtk_assistant_get_page_title, pFpp)
+GO(gtk_assistant_get_page_type, uFpp)
GO(gtk_assistant_get_type, pFv)
-//GO(gtk_assistant_insert_page,
+GO(gtk_assistant_insert_page, iFppi)
//GO(gtk_assistant_new,
GO(gtk_assistant_page_type_get_type, pFv)
//GO(gtk_assistant_prepend_page,
-//GO(gtk_assistant_remove_action_widget,
+GO(gtk_assistant_remove_action_widget, vFpp)
//GO(gtk_assistant_set_current_page,
//GO(gtk_assistant_set_forward_page_func,
//GO(gtk_assistant_set_page_complete,
//GO(gtk_assistant_set_page_header_image,
-//GO(gtk_assistant_set_page_side_image,
-//GO(gtk_assistant_set_page_title,
-//GO(gtk_assistant_set_page_type,
+GO(gtk_assistant_set_page_side_image, vFppp)
+GO(gtk_assistant_set_page_title, vFppp)
+GO(gtk_assistant_set_page_type, vFppu)
//GO(gtk_assistant_update_buttons_state,
GO(gtk_attach_options_get_type, pFv)
//GO(gtk_binding_entry_add_signal,
-//GO(gtk_binding_entry_add_signall,
+GO(gtk_binding_entry_add_signall, vFpuupp)
//GO(gtk_binding_entry_clear,
-//GO(gtk_binding_entry_remove,
+GO(gtk_binding_entry_remove, vFpuu)
//GO(gtk_binding_entry_skip,
//GO(gtk_binding_parse_binding,
-//GO(gtk_bindings_activate,
+GO(gtk_bindings_activate, iFpuu)
GO(gtk_bindings_activate_event, iFpp)
-//GO(gtk_binding_set_activate,
-//GO(gtk_binding_set_add_path,
-//GO(gtk_binding_set_by_class,
-//GO(gtk_binding_set_find,
+GO(gtk_binding_set_activate, iFpuup)
+GO(gtk_binding_set_add_path, vFpupu)
+GO(gtk_binding_set_by_class, pFp)
+GO(gtk_binding_set_find, pFp)
//GO(gtk_binding_set_new,
GO(gtk_bin_get_child, pFp)
GO(gtk_bin_get_type, pFv)
@@ -254,14 +259,14 @@ GO(gtk_border_new, pFv)
GO(gtk_box_get_homogeneous, iFp)
GO(gtk_box_get_spacing, iFp)
GO(gtk_box_get_type, pFv)
-GO(gtk_box_new, pFii)
+GO(gtk_box_new, pFui)
GO(gtk_box_pack_end, vFppiiu)
GO(gtk_box_pack_end_defaults, vFpp)
GO(gtk_box_pack_start, vFppiiu)
GO(gtk_box_pack_start_defaults, vFpp)
GO(gtk_box_query_child_packing, vFpppppp)
GO(gtk_box_reorder_child, vFppi)
-GO(gtk_box_set_child_packing, vFppiiui)
+GO(gtk_box_set_child_packing, vFppiiuu)
GO(gtk_box_set_homogeneous, vFpi)
GO(gtk_box_set_spacing, vFpi)
GO(gtk_buildable_add_child, vFpppp)
@@ -277,7 +282,7 @@ GO(gtk_buildable_set_buildable_property, vFpppp)
GO(gtk_buildable_set_name, vFpp)
GO(gtk_builder_add_from_file, uFppp)
GO(gtk_builder_add_from_resource, uFppp)
-GO(gtk_builder_add_from_string, iFppLp)
+GO(gtk_builder_add_from_string, uFppLp)
GO(gtk_builder_add_objects_from_file, uFpppp)
GO(gtk_builder_add_objects_from_string, uFppLpp)
GOM(gtk_builder_connect_signals, vFEpp)
@@ -288,22 +293,22 @@ GO(gtk_builder_get_object, pFpp)
GO(gtk_builder_get_objects, pFp)
GO(gtk_builder_get_translation_domain, pFp)
GO(gtk_builder_get_type, pFv)
-GO(gtk_builder_get_type_from_name, iFpp)
+GO(gtk_builder_get_type_from_name, LFpp)
GO(gtk_builder_new, pFv)
GO(gtk_builder_set_translation_domain, vFpp)
GO(gtk_builder_value_from_string, iFppppp)
-GO(gtk_builder_value_from_string_type, iFpippp)
+GO(gtk_builder_value_from_string_type, iFpLppp)
GO(gtk_button_action_get_type, pFv)
GO(gtk_button_box_get_child_ipadding, vFppp)
GO(gtk_button_box_get_child_secondary, iFpp)
GO(gtk_button_box_get_child_size, vFppp)
-GO(gtk_button_box_get_layout, iFp)
+GO(gtk_button_box_get_layout, uFp)
GO(gtk_button_box_get_type, pFv)
GO(gtk_button_box_new, pFi)
GO(gtk_button_box_set_child_ipadding, vFpii)
GO(gtk_button_box_set_child_secondary, vFppi)
GO(gtk_button_box_set_child_size, vFpii)
-GO(gtk_button_box_set_layout, vFpi)
+GO(gtk_button_box_set_layout, vFpu)
GO(gtk_button_box_style_get_type, pFv)
//GO(gtk_button_clicked,
//GO(gtk_button_enter,
@@ -311,9 +316,9 @@ GO(gtk_button_get_alignment, vFppp)
GO(gtk_button_get_event_window, pFp)
GO(gtk_button_get_focus_on_click, iFp)
GO(gtk_button_get_image, pFp)
-GO(gtk_button_get_image_position, iFp)
+GO(gtk_button_get_image_position, uFp)
GO(gtk_button_get_label, pFp)
-GO(gtk_button_get_relief, iFp)
+GO(gtk_button_get_relief, uFp)
GO(gtk_button_get_type, pFv)
GO(gtk_button_get_use_stock, iFp)
GO(gtk_button_get_use_underline, iFp)
@@ -327,9 +332,9 @@ GO(gtk_button_released, vFp)
GO(gtk_button_set_alignment, vFpff)
GO(gtk_button_set_focus_on_click, vFpi)
GO(gtk_button_set_image, vFpp)
-GO(gtk_button_set_image_position, vFpi)
+GO(gtk_button_set_image_position, vFpu)
GO(gtk_button_set_label, vFpp)
-GO(gtk_button_set_relief, vFpi)
+GO(gtk_button_set_relief, vFpu)
GO(gtk_button_set_use_stock, vFpi)
GO(gtk_button_set_use_underline, vFpi)
GO(gtk_buttons_type_get_type, pFv)
@@ -337,25 +342,25 @@ GO(gtk_buttons_type_get_type, pFv)
//GO(gtk_calendar_display_options,
GO(gtk_calendar_display_options_get_type, pFv)
//GO(gtk_calendar_freeze,
-//GO(gtk_calendar_get_date,
-//GO(gtk_calendar_get_detail_height_rows,
+GO(gtk_calendar_get_date, vFpppp)
+GO(gtk_calendar_get_detail_height_rows, iFp)
//GO(gtk_calendar_get_detail_width_chars,
-//GO(gtk_calendar_get_display_options,
+GO(gtk_calendar_get_display_options, uFp)
GO(gtk_calendar_get_type, pFv)
//GO(gtk_calendar_mark_day,
//GO(gtk_calendar_new,
//GO(gtk_calendar_select_day,
-//GO(gtk_calendar_select_month,
+GO(gtk_calendar_select_month, vFpuu)
//GO(gtk_calendar_set_detail_func,
-//GO(gtk_calendar_set_detail_height_rows,
+GO(gtk_calendar_set_detail_height_rows, vFpi)
//GO(gtk_calendar_set_detail_width_chars,
-//GO(gtk_calendar_set_display_options,
+GO(gtk_calendar_set_display_options, vFpu)
//GO(gtk_calendar_thaw,
-//GO(gtk_calendar_unmark_day,
+GO(gtk_calendar_unmark_day, vFpu)
//GO(gtk_cell_editable_editing_done,
GO(gtk_cell_editable_get_type, pFv)
//GO(gtk_cell_editable_remove_widget,
-//GO(gtk_cell_editable_start_editing,
+GO(gtk_cell_editable_start_editing, vFpp)
GO(gtk_cell_layout_add_attribute, vFpppi)
GO(gtk_cell_layout_clear, vFp)
GO(gtk_cell_layout_clear_attributes, vFpp)
@@ -369,15 +374,15 @@ GO(gtk_cell_layout_set_attributes, vFpppppppppp) // vaarg
GO(gtk_cell_renderer_accel_get_type, pFv)
GO(gtk_cell_renderer_accel_mode_get_type, pFv)
//GO(gtk_cell_renderer_accel_new,
-//GO(gtk_cell_renderer_activate,
+GO(gtk_cell_renderer_activate, iFppppppu)
GO(gtk_cell_renderer_combo_get_type, pFv)
//GO(gtk_cell_renderer_combo_new,
//GO(gtk_cell_renderer_editing_canceled,
-//GO(gtk_cell_renderer_get_alignment,
+GO(gtk_cell_renderer_get_alignment, vFppp)
//GO(gtk_cell_renderer_get_fixed_size,
-//GO(gtk_cell_renderer_get_padding,
+GO(gtk_cell_renderer_get_padding, vFppp)
//GO(gtk_cell_renderer_get_sensitive,
-//GO(gtk_cell_renderer_get_size,
+GO(gtk_cell_renderer_get_size, vFppppppp)
GO(gtk_cell_renderer_get_type, pFv)
//GO(gtk_cell_renderer_get_visible,
GO(gtk_cell_renderer_mode_get_type, pFv)
@@ -385,19 +390,19 @@ GO(gtk_cell_renderer_pixbuf_get_type, pFv)
GO(gtk_cell_renderer_pixbuf_new, pFv)
GO(gtk_cell_renderer_progress_get_type, pFv)
//GO(gtk_cell_renderer_progress_new,
-//GO(gtk_cell_renderer_render,
-//GO(gtk_cell_renderer_set_alignment,
+GO(gtk_cell_renderer_render, vFpppppu)
+GO(gtk_cell_renderer_set_alignment, vFpff)
//GO(gtk_cell_renderer_set_fixed_size,
-//GO(gtk_cell_renderer_set_padding,
+GO(gtk_cell_renderer_set_padding, vFpii)
//GO(gtk_cell_renderer_set_sensitive,
//GO(gtk_cell_renderer_set_visible,
GO(gtk_cell_renderer_spin_get_type, pFv)
GO(gtk_cell_renderer_spinner_get_type, pFv)
//GO(gtk_cell_renderer_spinner_new,
//GO(gtk_cell_renderer_spin_new,
-//GO(gtk_cell_renderer_start_editing,
+GO(gtk_cell_renderer_start_editing, pFppppppu)
GO(gtk_cell_renderer_state_get_type, pFv)
-//GO(gtk_cell_renderer_stop_editing,
+GO(gtk_cell_renderer_stop_editing, vFpi)
GO(gtk_cell_renderer_text_get_type, pFv)
GO(gtk_cell_renderer_text_new, pFv)
GO(gtk_cell_renderer_text_set_fixed_height_from_font, vFpi)
@@ -411,17 +416,17 @@ GO(gtk_cell_renderer_toggle_set_active, vFpi)
GO(gtk_cell_renderer_toggle_set_radio, vFpi)
GO(gtk_cell_type_get_type, pFv)
//GO(gtk_cell_view_get_cell_renderers,
-//GO(gtk_cell_view_get_displayed_row,
-//GO(gtk_cell_view_get_model,
-//GO(gtk_cell_view_get_size_of_row,
+GO(gtk_cell_view_get_displayed_row, pFp)
+GO(gtk_cell_view_get_model, pFp)
+GO(gtk_cell_view_get_size_of_row, iFppp)
GO(gtk_cell_view_get_type, pFv)
//GO(gtk_cell_view_new,
//GO(gtk_cell_view_new_with_markup,
-//GO(gtk_cell_view_new_with_pixbuf,
+GO(gtk_cell_view_new_with_pixbuf, pFp)
//GO(gtk_cell_view_new_with_text,
-//GO(gtk_cell_view_set_background_color,
-//GO(gtk_cell_view_set_displayed_row,
-//GO(gtk_cell_view_set_model,
+GO(gtk_cell_view_set_background_color, vFpp)
+GO(gtk_cell_view_set_displayed_row, vFpp)
+GO(gtk_cell_view_set_model, vFpp)
GO(gtk_check_button_get_type, pFv)
GO(gtk_check_button_new, pFv)
GO(gtk_check_button_new_with_label, pFp)
@@ -441,6 +446,7 @@ GO(gtk_check_menu_item_toggled, vFp)
GO(gtk_check_version, pFuuu)
GO(gtk_clipboard_clear, vFp)
GO(gtk_clipboard_get, pFp)
+GO(gtk_clipboard_get_default, pFp)
GO(gtk_clipboard_get_display, pFp)
GO(gtk_clipboard_get_for_display, pFpp)
GO(gtk_clipboard_get_owner, pFp)
@@ -449,9 +455,9 @@ GO(gtk_clipboard_get_type, pFv)
//GOM(gtk_clipboard_request_image, vFEppp)
//GOM(gtk_clipboard_request_rich_text, vFEpppp)
//GOM(gtk_clipboard_request_targets, vFEppp)
-//GOM(gtk_clipboard_request_text, vFEppp)
+GOM(gtk_clipboard_request_text, vFEppp)
//GOM(gtk_clipboard_request_uris, vFEppp)
-GO(gtk_clipboard_set_can_store, vFppp)
+GO(gtk_clipboard_set_can_store, vFppi)
GO(gtk_clipboard_set_image, vFpp)
GO(gtk_clipboard_set_text, vFppi)
GOM(gtk_clipboard_set_with_data, iFEppuppp)
@@ -592,7 +598,7 @@ GO(gtk_combo_box_get_active, iFp)
GO(gtk_combo_box_get_active_iter, iFpp)
GO(gtk_combo_box_get_active_text, pFp)
GO(gtk_combo_box_get_add_tearoffs, iFp)
-GO(gtk_combo_box_get_button_sensitivity, iFp)
+GO(gtk_combo_box_get_button_sensitivity, uFp)
GO(gtk_combo_box_get_column_span_column, iFp)
GO(gtk_combo_box_get_entry_text_column, iFp)
GO(gtk_combo_box_get_focus_on_click, iFp)
@@ -617,7 +623,7 @@ GO(gtk_combo_box_remove_text, vFpi)
GO(gtk_combo_box_set_active, vFpi)
GO(gtk_combo_box_set_active_iter, vFpp)
GO(gtk_combo_box_set_add_tearoffs, vFpi)
-GO(gtk_combo_box_set_button_sensitivity, vFpi)
+GO(gtk_combo_box_set_button_sensitivity, vFpu)
GO(gtk_combo_box_set_column_span_column, vFpi)
GO(gtk_combo_box_set_entry_text_column, vFpi)
GO(gtk_combo_box_set_focus_on_click, vFpi)
@@ -645,6 +651,7 @@ GO(gtk_combo_set_popdown_strings, vFpp)
GO(gtk_combo_set_use_arrows, vFpi)
GO(gtk_combo_set_use_arrows_always, vFpi)
GO(gtk_combo_set_value_in_list, vFpii)
+GO(gtk_container_accessible_get_type, LFv)
GO(gtk_container_add, vFpp)
GO(gtk_container_add_with_properties, vFpppppppppppp) //vaarg
GO(gtk_container_check_resize, vFp)
@@ -654,7 +661,7 @@ GO(gtk_container_child_get_property, vFpppp)
//GO2(gtk_container_child_set, vFpppV, gtk_container_child_set_valist)
GO(gtk_container_child_set_property, vFpppp)
//GO(gtk_container_child_set_valist, vFpppp)
-GO(gtk_container_child_type, iFp)
+GO(gtk_container_child_type, LFp)
GO(gtk_container_class_find_child_property, pFpp)
GO(gtk_container_class_install_child_property, vFpup)
GO(gtk_container_class_list_child_properties, pFpp)
@@ -667,7 +674,7 @@ GO(gtk_container_get_focus_chain, iFpp)
GO(gtk_container_get_focus_child, pFp)
GO(gtk_container_get_focus_hadjustment, pFp)
GO(gtk_container_get_focus_vadjustment, pFp)
-GO(gtk_container_get_resize_mode, iFp)
+GO(gtk_container_get_resize_mode, uFp)
GO(gtk_container_get_type, pFv)
GO(gtk_container_propagate_expose, vFppp)
GO(gtk_container_remove, vFpp)
@@ -677,8 +684,8 @@ GO(gtk_container_set_focus_chain, vFpp)
GO(gtk_container_set_focus_child, vFpp)
GO(gtk_container_set_focus_hadjustment, vFpp)
GO(gtk_container_set_focus_vadjustment, vFpp)
-GO(gtk_container_set_reallocate_redraws, vFpp)
-GO(gtk_container_set_resize_mode, vFpi)
+GO(gtk_container_set_reallocate_redraws, vFpi)
+GO(gtk_container_set_resize_mode, vFpu)
GO(gtk_container_unset_focus_chain, vFp)
GO(gtk_corner_type_get_type, pFv)
GO(gtk_css_provider_get_default, pFv)
@@ -693,7 +700,7 @@ GO(gtk_css_section_get_end_line, uFp)
GO(gtk_css_section_get_end_position, uFp)
GO(gtk_css_section_get_file, pFp)
GO(gtk_css_section_get_parent, pFp)
-GO(gtk_css_section_get_section_type, iFp)
+GO(gtk_css_section_get_section_type, uFp)
GO(gtk_css_section_get_start_line, uFp)
GO(gtk_css_section_get_start_position, uFp)
GO(gtk_css_section_ref, pFp)
@@ -808,8 +815,8 @@ GO(gtk_dialog_set_has_separator, vFpi)
GO(gtk_dialog_set_response_sensitive, vFpii)
GO(gtk_direction_type_get_type, pFv)
GO(gtk_disable_setlocale, vFv)
-GO(gtk_distribute_natural_allocation, iFpup)
-GO(gtk_drag_begin, pFppiip)
+GO(gtk_distribute_natural_allocation, iFiup)
+GO(gtk_drag_begin, pFppuip)
GO(gtk_drag_check_threshold, iFpiiii)
GO(gtk_drag_dest_add_image_targets, vFp)
GO(gtk_drag_dest_add_text_targets, vFp)
@@ -817,8 +824,8 @@ GO(gtk_drag_dest_add_uri_targets, vFp)
GO(gtk_drag_dest_find_target, pFppp)
GO(gtk_drag_dest_get_target_list, pFp)
GO(gtk_drag_dest_get_track_motion, iFp)
-GO(gtk_drag_dest_set, vFpipii)
-GO(gtk_drag_dest_set_proxy, vFppii)
+GO(gtk_drag_dest_set, vFpupiu)
+GO(gtk_drag_dest_set_proxy, vFppui)
GO(gtk_drag_dest_set_target_list, vFpp)
GO(gtk_drag_dest_set_track_motion, vFpi)
GO(gtk_drag_dest_unset, vFp)
@@ -838,7 +845,7 @@ GO(gtk_drag_source_add_image_targets, vFp)
GO(gtk_drag_source_add_text_targets, vFp)
GO(gtk_drag_source_add_uri_targets, vFp)
GO(gtk_drag_source_get_target_list, pFp)
-GO(gtk_drag_source_set, vFpipii)
+GO(gtk_drag_source_set, vFpupiu)
GO(gtk_drag_source_set_icon, vFpppp)
GO(gtk_drag_source_set_icon_name, vFpp)
GO(gtk_drag_source_set_icon_pixbuf, vFpp)
@@ -860,7 +867,7 @@ GO(gtk_draw_hline, vFppiiii)
GO(gtk_drawing_area_get_type, pFv)
GO(gtk_drawing_area_new, pFv)
GO(gtk_drawing_area_size, vFpii)
-GO(gtk_draw_insertion_cursor, vFppppiii)
+GO(gtk_draw_insertion_cursor, vFpppiui)
GO(gtk_draw_layout, vFppiiiip)
GO(gtk_draw_option, vFppiiiiii)
GO(gtk_draw_polygon, vFppiipii)
@@ -886,70 +893,70 @@ GO(gtk_editable_select_region, vFpii)
GO(gtk_editable_set_editable, vFpi)
GO(gtk_editable_set_position, vFpi)
GO(gtk_entry_append_text, vFpp)
-//GO(gtk_entry_buffer_delete_text,
-//GO(gtk_entry_buffer_emit_deleted_text,
-//GO(gtk_entry_buffer_emit_inserted_text,
-//GO(gtk_entry_buffer_get_bytes,
-//GO(gtk_entry_buffer_get_length,
-//GO(gtk_entry_buffer_get_max_length,
-//GO(gtk_entry_buffer_get_text,
+GO(gtk_entry_buffer_delete_text, uFpui)
+GO(gtk_entry_buffer_emit_deleted_text, vFpuu)
+GO(gtk_entry_buffer_emit_inserted_text, vFpupu)
+GO(gtk_entry_buffer_get_bytes, LFp)
+GO(gtk_entry_buffer_get_length, uFp)
+GO(gtk_entry_buffer_get_max_length, iFp)
+GO(gtk_entry_buffer_get_text, pFp)
GO(gtk_entry_buffer_get_type, pFv)
-//GO(gtk_entry_buffer_insert_text,
-//GO(gtk_entry_buffer_new,
-//GO(gtk_entry_buffer_set_max_length,
-//GO(gtk_entry_buffer_set_text,
+GO(gtk_entry_buffer_insert_text, uFpupi)
+GO(gtk_entry_buffer_new, pFpi)
+GO(gtk_entry_buffer_set_max_length, vFpi)
+GO(gtk_entry_buffer_set_text, vFppi)
//GO(gtk_entry_completion_complete,
//GO(gtk_entry_completion_delete_action,
-//GO(gtk_entry_completion_get_completion_prefix,
-//GO(gtk_entry_completion_get_entry,
+GO(gtk_entry_completion_get_completion_prefix, pFp)
+GO(gtk_entry_completion_get_entry, pFp)
//GO(gtk_entry_completion_get_inline_completion,
//GO(gtk_entry_completion_get_inline_selection,
//GO(gtk_entry_completion_get_minimum_key_length,
-//GO(gtk_entry_completion_get_model,
+GO(gtk_entry_completion_get_model, pFp)
//GO(gtk_entry_completion_get_popup_completion,
//GO(gtk_entry_completion_get_popup_set_width,
-//GO(gtk_entry_completion_get_popup_single_match,
-//GO(gtk_entry_completion_get_text_column,
+GO(gtk_entry_completion_get_popup_single_match, iFp)
+GO(gtk_entry_completion_get_text_column, iFp)
GO(gtk_entry_completion_get_type, pFv)
-//GO(gtk_entry_completion_insert_action_markup,
+GO(gtk_entry_completion_insert_action_markup, vFpip)
//GO(gtk_entry_completion_insert_action_text,
//GO(gtk_entry_completion_insert_prefix,
-//GO(gtk_entry_completion_new,
+GO(gtk_entry_completion_new, pFv)
//GO(gtk_entry_completion_set_inline_completion,
//GO(gtk_entry_completion_set_inline_selection,
//GO(gtk_entry_completion_set_match_func,
//GO(gtk_entry_completion_set_minimum_key_length,
-//GO(gtk_entry_completion_set_model,
+GO(gtk_entry_completion_set_model, vFpp)
//GO(gtk_entry_completion_set_popup_completion,
//GO(gtk_entry_completion_set_popup_set_width,
-//GO(gtk_entry_completion_set_popup_single_match,
-//GO(gtk_entry_completion_set_text_column,
+GO(gtk_entry_completion_set_popup_single_match, vFpi)
+GO(gtk_entry_completion_set_text_column, vFpi)
GO(gtk_entry_get_activates_default, iFp)
GO(gtk_entry_get_alignment, fFp)
-//GO(gtk_entry_get_buffer,
-//GO(gtk_entry_get_completion,
-//GO(gtk_entry_get_current_icon_drag_source,
-//GO(gtk_entry_get_cursor_hadjustment,
+GO(gtk_entry_get_buffer, pFp)
+GO(gtk_entry_get_completion, pFp)
+GO(gtk_entry_get_current_icon_drag_source, iFp)
+GO(gtk_entry_get_cursor_hadjustment, pFp)
GO(gtk_entry_get_has_frame, iFp)
//GO(gtk_entry_get_icon_activatable,
-//GO(gtk_entry_get_icon_at_pos,
-//GO(gtk_entry_get_icon_gicon,
-//GO(gtk_entry_get_icon_name,
-//GO(gtk_entry_get_icon_pixbuf,
-//GO(gtk_entry_get_icon_sensitive,
+GO(gtk_entry_get_icon_at_pos, iFpii)
+GO(gtk_entry_get_icon_gicon, pFpu)
+GO(gtk_entry_get_icon_name, pFpu)
+GO(gtk_entry_get_icon_pixbuf, pFpu)
+GO(gtk_entry_get_icon_sensitive, iFpu)
//GO(gtk_entry_get_icon_stock,
-//GO(gtk_entry_get_icon_storage_type,
-//GO(gtk_entry_get_icon_tooltip_markup,
+GO(gtk_entry_get_icon_storage_type, uFpu)
+GO(gtk_entry_get_icon_tooltip_markup, pFpu)
//GO(gtk_entry_get_icon_tooltip_text,
//GO(gtk_entry_get_icon_window,
GO(gtk_entry_get_inner_border, pFp)
-//GO(gtk_entry_get_invisible_char,
+GO(gtk_entry_get_invisible_char, uFp)
GO(gtk_entry_get_layout, pFp)
GO(gtk_entry_get_layout_offsets, vFppp)
//GO(gtk_entry_get_max_length,
GO(gtk_entry_get_overwrite_mode, iFp)
//GO(gtk_entry_get_progress_fraction,
-//GO(gtk_entry_get_progress_pulse_step,
+GO(gtk_entry_get_progress_pulse_step, dFp)
GO(gtk_entry_get_text, pFp)
GO(gtk_entry_get_text_length, WFp)
//GO(gtk_entry_get_text_window,
@@ -957,7 +964,7 @@ GO(gtk_entry_get_type, pFv)
//GO(gtk_entry_get_visibility,
GO(gtk_entry_get_width_chars, iFp)
GO(gtk_entry_icon_position_get_type, pFv)
-//GO(gtk_entry_im_context_filter_keypress,
+GO(gtk_entry_im_context_filter_keypress, iFpp)
//GO(gtk_entry_layout_index_to_text_index,
GO(gtk_entry_new, pFv)
GO(gtk_entry_new_with_buffer, pFp)
@@ -969,30 +976,30 @@ GO(gtk_entry_select_region, vFpii)
GO(gtk_entry_set_activates_default, vFpi)
GO(gtk_entry_set_alignment, vFpf)
GO(gtk_entry_set_buffer, vFpp)
-//GO(gtk_entry_set_completion,
-//GO(gtk_entry_set_cursor_hadjustment,
+GO(gtk_entry_set_completion, vFpp)
+GO(gtk_entry_set_cursor_hadjustment, vFpp)
GO(gtk_entry_set_editable, vFpi)
GO(gtk_entry_set_has_frame, vFpi)
//GO(gtk_entry_set_icon_activatable,
-//GO(gtk_entry_set_icon_drag_source,
-//GO(gtk_entry_set_icon_from_gicon,
+GO(gtk_entry_set_icon_drag_source, vFpupu)
+GO(gtk_entry_set_icon_from_gicon, vFpup)
//GO(gtk_entry_set_icon_from_icon_name,
-//GO(gtk_entry_set_icon_from_pixbuf,
+GO(gtk_entry_set_icon_from_pixbuf, vFpup)
//GO(gtk_entry_set_icon_from_stock,
-//GO(gtk_entry_set_icon_sensitive,
-//GO(gtk_entry_set_icon_tooltip_markup,
+GO(gtk_entry_set_icon_sensitive, vFpui)
+GO(gtk_entry_set_icon_tooltip_markup, vFpup)
//GO(gtk_entry_set_icon_tooltip_text,
GO(gtk_entry_set_inner_border, vFpp)
-GO(gtk_entry_set_invisible_char, vFp)
+GO(gtk_entry_set_invisible_char, vFpu)
GO(gtk_entry_set_max_length, vFpi)
GO(gtk_entry_set_overwrite_mode, vFpi)
GO(gtk_entry_set_position, vFpi)
//GO(gtk_entry_set_progress_fraction,
-//GO(gtk_entry_set_progress_pulse_step,
+GO(gtk_entry_set_progress_pulse_step, vFpd)
GO(gtk_entry_set_text, vFpp)
GO(gtk_entry_set_visibility, vFpi)
GO(gtk_entry_set_width_chars, uFp)
-//GO(gtk_entry_text_index_to_layout_index,
+GO(gtk_entry_text_index_to_layout_index, iFpi)
//GO(gtk_entry_unset_invisible_char,
GOM(gtk_enumerate_printers, vFEpppi)
GO(gtk_event_box_get_above_child, iFp)
@@ -1030,7 +1037,7 @@ GO(gtk_file_chooser_button_get_focus_on_click, iFp)
GO(gtk_file_chooser_button_get_title, pFp)
GO(gtk_file_chooser_button_get_type, pFv)
GO(gtk_file_chooser_button_get_width_chars, iFp)
-GO(gtk_file_chooser_button_new, pFpi)
+GO(gtk_file_chooser_button_new, pFpu)
GO(gtk_file_chooser_button_new_with_backend, pFpip)
GO(gtk_file_chooser_button_new_with_dialog, pFp)
GO(gtk_file_chooser_button_set_focus_on_click, vFpi)
@@ -1042,7 +1049,7 @@ GO(gtk_file_chooser_dialog_new, pFppipipipipipipip) // vaargs (so pFppipV) with
GO(gtk_file_chooser_dialog_new_with_backend, pFppippipipipipipip) // same but pFppippV
GO(gtk_file_chooser_error_get_type, pFv)
GO(gtk_file_chooser_error_quark, pFv)
-GO(gtk_file_chooser_get_action, iFp)
+GO(gtk_file_chooser_get_action, uFp)
GO(gtk_file_chooser_get_create_folders, iFp)
GO(gtk_file_chooser_get_current_folder, pFp)
GO(gtk_file_chooser_get_current_folder_file, pFp)
@@ -1077,7 +1084,7 @@ GO(gtk_file_chooser_select_all, vFp)
GO(gtk_file_chooser_select_file, iFppp)
GO(gtk_file_chooser_select_filename, iFpp)
GO(gtk_file_chooser_select_uri, iFpp)
-GO(gtk_file_chooser_set_action, vFpi)
+GO(gtk_file_chooser_set_action, vFpu)
GO(gtk_file_chooser_set_create_folders, vFpi)
GO(gtk_file_chooser_set_current_folder, iFpp)
GO(gtk_file_chooser_set_current_folder_file, iFppp)
@@ -1100,7 +1107,7 @@ GO(gtk_file_chooser_unselect_file, vFpp)
GO(gtk_file_chooser_unselect_filename, vFpp)
GO(gtk_file_chooser_unselect_uri, vFpp)
GO(gtk_file_chooser_widget_get_type, pFv)
-GO(gtk_file_chooser_widget_new, pFi)
+GO(gtk_file_chooser_widget_new, pFu)
GO(gtk_file_chooser_widget_new_with_backend, pFip)
//GOM(gtk_file_filter_add_custom, vFEppppp)
GO(gtk_file_filter_add_mime_type, vFpp)
@@ -1109,7 +1116,7 @@ GO(gtk_file_filter_add_pixbuf_formats, vFp)
GO(gtk_file_filter_filter, iFpp)
GO(gtk_file_filter_flags_get_type, pFv)
GO(gtk_file_filter_get_name, pFp)
-GO(gtk_file_filter_get_needed, iFp)
+GO(gtk_file_filter_get_needed, uFp)
GO(gtk_file_filter_get_type, pFv)
GO(gtk_file_filter_new, pFv)
GO(gtk_file_filter_set_name, vFpp)
@@ -1156,7 +1163,7 @@ GO(gtk_font_selection_dialog_get_ok_button, pFp)
GO(gtk_font_selection_dialog_get_preview_text, pFp)
GO(gtk_font_selection_dialog_get_type, pFv)
GO(gtk_font_selection_dialog_new, pFp)
-GO(gtk_font_selection_dialog_set_font_name, vFpp)
+GO(gtk_font_selection_dialog_set_font_name, iFpp)
GO(gtk_font_selection_dialog_set_preview_text, vFpp)
GO(gtk_font_selection_get_face, pFp)
GO(gtk_font_selection_get_face_list, pFp)
@@ -1176,17 +1183,18 @@ GO(gtk_font_selection_set_preview_text, vFpp)
GO(gtk_frame_get_label, pFp)
GO(gtk_frame_get_label_align, vFppp)
GO(gtk_frame_get_label_widget, pFp)
-GO(gtk_frame_get_shadow_type, iFp)
+GO(gtk_frame_get_shadow_type, uFp)
GO(gtk_frame_get_type, pFv)
GO(gtk_frame_new, pFp)
GO(gtk_frame_set_label, vFpp)
GO(gtk_frame_set_label_align, vFpff)
GO(gtk_frame_set_label_widget, vFpp)
-GO(gtk_frame_set_shadow_type, vFpi)
+GO(gtk_frame_set_shadow_type, vFpu)
GO(gtk_gamma_curve_get_type, pFv)
GO(gtk_gamma_curve_new, pFv)
GO(gtk_gc_get, pFippu)
GO(gtk_gc_release, vFp)
+GO(gtk_gesture_long_press_new, pFv)
GO(gtk_get_current_event, pFv)
GO(gtk_get_current_event_state, iFp)
GO(gtk_get_current_event_time, uFv)
@@ -1201,16 +1209,21 @@ GO(gtk_get_option_group, pFi)
GO(gtk_grab_add, vFp)
GO(gtk_grab_get_current, pFv)
GO(gtk_grab_remove, vFp)
+GO(gtk_grid_attach, vFppiiii)
GO(gtk_grid_get_type, pFv)
+GO(gtk_grid_set_column_homogeneous, vFpi)
+GO(gtk_grid_set_column_spacing, vFpu)
+GO(gtk_grid_set_row_homogeneous, vFpi)
+GO(gtk_grid_set_row_spacing, vFpu)
GO(gtk_handle_box_get_child_detached, iFp)
GO(gtk_handle_box_get_handle_position, iFp)
-GO(gtk_handle_box_get_shadow_type, iFp)
-GO(gtk_handle_box_get_snap_edge, iFp)
+GO(gtk_handle_box_get_shadow_type, uFp)
+GO(gtk_handle_box_get_snap_edge, uFp)
GO(gtk_handle_box_get_type, pFv)
GO(gtk_handle_box_new, pFv)
GO(gtk_handle_box_set_handle_position, vFpi)
-GO(gtk_handle_box_set_shadow_type, vFpi)
-GO(gtk_handle_box_set_snap_edge, vFpi)
+GO(gtk_handle_box_set_shadow_type, vFpu)
+GO(gtk_handle_box_set_snap_edge, vFpu)
GO(gtk_hbox_get_type, pFv)
GO(gtk_hbox_new, pFii)
GO(gtk_hbutton_box_get_layout_default, iFv)
@@ -1219,7 +1232,11 @@ GO(gtk_hbutton_box_get_type, pFv)
GO(gtk_hbutton_box_new, pFv)
GO(gtk_hbutton_box_set_layout_default, vFi)
GO(gtk_hbutton_box_set_spacing_default, vFi)
+GO(gtk_header_bar_new, pFv)
GO(gtk_header_bar_get_type, lFv)
+GO(gtk_header_bar_pack_end, vFpp)
+GO(gtk_header_bar_set_show_close_button, vFpi)
+GO(gtk_header_bar_set_title, vFpp)
GO(gtk_hpaned_get_type, pFv)
//GO(gtk_hpaned_new,
GO(gtk_hruler_get_type, pFv)
@@ -1231,13 +1248,13 @@ GO(gtk_hscrollbar_get_type, pFv)
GO(gtk_hscrollbar_new, pFp)
GO(gtk_hseparator_get_type, pFv)
GO(gtk_hseparator_new, pFv)
-//GO(gtk_hsv_get_color,
-//GO(gtk_hsv_get_metrics,
+GO(gtk_hsv_get_color, vFpppp)
+GO(gtk_hsv_get_metrics, vFppp)
GO(gtk_hsv_get_type, pFv)
-//GO(gtk_hsv_is_adjusting,
+GO(gtk_hsv_is_adjusting, iFp)
//GO(gtk_hsv_new,
-//GO(gtk_hsv_set_color,
-//GO(gtk_hsv_set_metrics,
+GO(gtk_hsv_set_color, vFpddd)
+GO(gtk_hsv_set_metrics, vFpii)
//GO(gtk_hsv_to_rgb,
GO(gtk_icon_factory_add, vFppp)
GO(gtk_icon_factory_add_default, vFp)
@@ -1259,7 +1276,7 @@ GO(gtk_icon_info_load_icon, pFpp)
GO(gtk_icon_info_load_surface, pFppp)
GO(gtk_icon_info_load_symbolic_for_context, pFpppp)
GO(gtk_icon_info_new_for_pixbuf, pFpp)
-GO(gtk_icon_info_set_raw_coordinates, vFpp)
+GO(gtk_icon_info_set_raw_coordinates, vFpi)
GO(gtk_icon_lookup_flags_get_type, pFv)
GO(gtk_icon_set_add_source, vFpp)
GO(gtk_icon_set_copy, pFp)
@@ -1268,36 +1285,36 @@ GO(gtk_icon_set_get_type, pFv)
GO(gtk_icon_set_new, pFv)
GO(gtk_icon_set_new_from_pixbuf, pFp)
GO(gtk_icon_set_ref, pFp)
-GO(gtk_icon_set_render_icon, pFppipipp)
+GO(gtk_icon_set_render_icon, pFppuuupp)
GO(gtk_icon_set_unref, vFp)
-GO(gtk_icon_size_from_name, iFp)
-GO(gtk_icon_size_get_name, pFi)
+GO(gtk_icon_size_from_name, uFp)
+GO(gtk_icon_size_get_name, pFu)
GO(gtk_icon_size_get_type, pFv)
-GO(gtk_icon_size_lookup, iFipp)
-GO(gtk_icon_size_lookup_for_settings, iFpipp)
-GO(gtk_icon_size_register, iFpii)
-GO(gtk_icon_size_register_alias, vFpi)
+GO(gtk_icon_size_lookup, iFupp)
+GO(gtk_icon_size_lookup_for_settings, iFpupp)
+GO(gtk_icon_size_register, uFpii)
+GO(gtk_icon_size_register_alias, vFpu)
GO(gtk_icon_source_copy, pFp)
GO(gtk_icon_source_free, vFp)
-GO(gtk_icon_source_get_direction, iFp)
+GO(gtk_icon_source_get_direction, uFp)
GO(gtk_icon_source_get_direction_wildcarded, iFp)
GO(gtk_icon_source_get_filename, pFp)
GO(gtk_icon_source_get_icon_name, pFp)
GO(gtk_icon_source_get_pixbuf, pFp)
-GO(gtk_icon_source_get_size, iFp)
+GO(gtk_icon_source_get_size, uFp)
GO(gtk_icon_source_get_size_wildcarded, iFp)
-GO(gtk_icon_source_get_state, iFp)
+GO(gtk_icon_source_get_state, uFp)
GO(gtk_icon_source_get_state_wildcarded, iFp)
GO(gtk_icon_source_get_type, pFv)
GO(gtk_icon_source_new, pFv)
-GO(gtk_icon_source_set_direction, vFpi)
+GO(gtk_icon_source_set_direction, vFpu)
GO(gtk_icon_source_set_direction_wildcarded, vFpi)
GO(gtk_icon_source_set_filename, vFpp)
GO(gtk_icon_source_set_icon_name, vFpp)
GO(gtk_icon_source_set_pixbuf, vFpp)
-GO(gtk_icon_source_set_size, vFpi)
+GO(gtk_icon_source_set_size, vFpu)
GO(gtk_icon_source_set_size_wildcarded, vFpi)
-GO(gtk_icon_source_set_state, vFpi)
+GO(gtk_icon_source_set_state, vFpu)
GO(gtk_icon_source_set_state_wildcarded, vFpi)
GO(gtk_icon_theme_add_builtin_icon, vFpip)
GO(gtk_icon_theme_append_search_path, vFpp)
@@ -1317,7 +1334,7 @@ GO(gtk_icon_theme_list_icons, pFpp)
GO(gtk_icon_theme_load_icon, pFppiup)
GO(gtk_icon_theme_lookup_by_gicon, pFppiu)
GO(gtk_icon_theme_lookup_icon, pFppiu)
-GO(gtk_icon_theme_lookup_icon_for_scale, pFppiii)
+GO(gtk_icon_theme_lookup_icon_for_scale, pFppiiu)
GO(gtk_icon_theme_new, pFv)
//GO(gtk_icon_theme_prepend_search_path,
GO(gtk_icon_theme_rescan_if_needed, iFp)
@@ -1327,8 +1344,8 @@ GO(gtk_icon_theme_set_search_path, vFppi)
GO(gtk_icon_view_convert_widget_to_bin_window_coords, vFpiipp)
GO(gtk_icon_view_create_drag_icon, pFpp)
GO(gtk_icon_view_drop_position_get_type, pFv)
-GO(gtk_icon_view_enable_model_drag_dest, vFppii)
-GO(gtk_icon_view_enable_model_drag_source, vFpipii)
+GO(gtk_icon_view_enable_model_drag_dest, vFppiu)
+GO(gtk_icon_view_enable_model_drag_source, vFpupiu)
GO(gtk_icon_view_get_columns, iFp)
GO(gtk_icon_view_get_column_spacing, iFp)
GO(gtk_icon_view_get_cursor, iFppp)
@@ -1336,7 +1353,7 @@ GO(gtk_icon_view_get_dest_item_at_pos, iFpiipp)
GO(gtk_icon_view_get_drag_dest_item, vFppp)
GO(gtk_icon_view_get_item_at_pos, iFpiipp)
GO(gtk_icon_view_get_item_column, iFpp)
-GO(gtk_icon_view_get_item_orientation, iFp)
+GO(gtk_icon_view_get_item_orientation, uFp)
GO(gtk_icon_view_get_item_padding, iFp)
GO(gtk_icon_view_get_item_row, iFpp)
GO(gtk_icon_view_get_item_width, iFp)
@@ -1349,7 +1366,7 @@ GO(gtk_icon_view_get_pixbuf_column, iFp)
GO(gtk_icon_view_get_reorderable, iFp)
GO(gtk_icon_view_get_row_spacing, iFp)
GO(gtk_icon_view_get_selected_items, pFp)
-GO(gtk_icon_view_get_selection_mode, iFp)
+GO(gtk_icon_view_get_selection_mode, uFp)
GO(gtk_icon_view_get_spacing, iFp)
GO(gtk_icon_view_get_text_column, iFp)
GO(gtk_icon_view_get_tooltip_column, iFp)
@@ -1367,8 +1384,8 @@ GO(gtk_icon_view_select_path, vFpp)
GO(gtk_icon_view_set_columns, vFpi)
GO(gtk_icon_view_set_column_spacing, vFpi)
GO(gtk_icon_view_set_cursor, vFpppi)
-GO(gtk_icon_view_set_drag_dest_item, vFppi)
-GO(gtk_icon_view_set_item_orientation, vFpi)
+GO(gtk_icon_view_set_drag_dest_item, vFppu)
+GO(gtk_icon_view_set_item_orientation, vFpu)
GO(gtk_icon_view_set_item_padding, vFpi)
GO(gtk_icon_view_set_item_width, vFpi)
GO(gtk_icon_view_set_margin, vFpi)
@@ -1378,7 +1395,7 @@ GO(gtk_icon_view_set_orientation, vFpi)
GO(gtk_icon_view_set_pixbuf_column, vFpi)
GO(gtk_icon_view_set_reorderable, vFpi)
GO(gtk_icon_view_set_row_spacing, vFpi)
-GO(gtk_icon_view_set_selection_mode, vFpi)
+GO(gtk_icon_view_set_selection_mode, vFpu)
GO(gtk_icon_view_set_spacing, vFpi)
GO(gtk_icon_view_set_text_column, vFpi)
GO(gtk_icon_view_set_tooltip_cell, vFpppp)
@@ -1405,7 +1422,7 @@ GO(gtk_image_get_pixbuf, pFp)
GO(gtk_image_get_pixel_size, iFp)
GO(gtk_image_get_pixmap, vFppp)
GO(gtk_image_get_stock, vFppp)
-GO(gtk_image_get_storage_type, iFp)
+GO(gtk_image_get_storage_type, uFp)
GO(gtk_image_get_type, pFv)
GO(gtk_image_menu_item_get_always_show_image, iFp)
GO(gtk_image_menu_item_get_image, pFp)
@@ -1422,9 +1439,9 @@ GO(gtk_image_menu_item_set_use_stock, vFpi)
GO(gtk_image_new, pFv)
GO(gtk_image_new_from_animation, pFp)
GO(gtk_image_new_from_file, pFp)
-GO(gtk_image_new_from_gicon, pFpi)
+GO(gtk_image_new_from_gicon, pFpu)
GO(gtk_image_new_from_icon_name, pFpi)
-GO(gtk_image_new_from_icon_set, pFpi)
+GO(gtk_image_new_from_icon_set, pFpu)
GO(gtk_image_new_from_image, pFpp)
GO(gtk_image_new_from_pixbuf, pFp)
GO(gtk_image_new_from_pixmap, pFpp)
@@ -1432,9 +1449,9 @@ GO(gtk_image_new_from_stock, pFpi)
GO(gtk_image_set, vFppp)
GO(gtk_image_set_from_animation, vFpp)
GO(gtk_image_set_from_file, vFppp)
-GO(gtk_image_set_from_gicon, vFppi)
-GO(gtk_image_set_from_icon_name, vFppi)
-GO(gtk_image_set_from_icon_set, vFppi)
+GO(gtk_image_set_from_gicon, vFppu)
+GO(gtk_image_set_from_icon_name, vFppu)
+GO(gtk_image_set_from_icon_set, vFppu)
GO(gtk_image_set_from_image, vFppp)
GO(gtk_image_set_from_pixbuf, vFpp)
GO(gtk_image_set_from_pixmap, vFppp)
@@ -1465,19 +1482,19 @@ GO(gtk_im_multicontext_new, pFv)
GO(gtk_im_multicontext_set_context_id, vFpp)
GO(gtk_im_preedit_style_get_type, pFv)
GO(gtk_im_status_style_get_type, pFv)
-//GO(gtk_info_bar_add_action_widget,
-//GO(gtk_info_bar_add_button,
+GO(gtk_info_bar_add_action_widget, vFppi)
+GO(gtk_info_bar_add_button, pFppi)
//GO(gtk_info_bar_add_buttons,
//GO(gtk_info_bar_get_action_area,
-//GO(gtk_info_bar_get_content_area,
-//GO(gtk_info_bar_get_message_type,
+GO(gtk_info_bar_get_content_area, pFp)
+GO(gtk_info_bar_get_message_type, uFp)
GO(gtk_info_bar_get_type, pFv)
//GO(gtk_info_bar_new,
//GO(gtk_info_bar_new_with_buttons,
-//GO(gtk_info_bar_response,
+GO(gtk_info_bar_response, vFpi)
//GO(gtk_info_bar_set_default_response,
-//GO(gtk_info_bar_set_message_type,
-//GO(gtk_info_bar_set_response_sensitive,
+GO(gtk_info_bar_set_message_type, vFpu)
+GO(gtk_info_bar_set_response_sensitive, vFpii)
GOM(gtk_init, vFEpp)
//GO(gtk_init_add,
GOM(gtk_init_check, iFEpp)
@@ -1488,11 +1505,11 @@ GO(gtk_input_dialog_new, pFv)
GO(gtk_input_hints_get_type, pFv)
GO(gtk_input_purpose_get_type, pFv)
GO(gtk_input_remove, vFu)
-//GO(gtk_invisible_get_screen,
+GO(gtk_invisible_get_screen, pFp)
GO(gtk_invisible_get_type, pFv)
//GO(gtk_invisible_new,
-//GO(gtk_invisible_new_for_screen,
-//GO(gtk_invisible_set_screen,
+GO(gtk_invisible_new_for_screen, pFp)
+GO(gtk_invisible_set_screen, vFpp)
//GO(gtk_item_deselect,
//GO(gtk_item_factories_path_delete,
//GO(gtk_item_factory_add_foreign,
@@ -1528,13 +1545,13 @@ GO(gtk_label_get, vFpp)
GO(gtk_label_get_angle, dFp)
GO(gtk_label_get_attributes, pFp)
GO(gtk_label_get_current_uri, pFp)
-GO(gtk_label_get_ellipsize, iFp)
-GO(gtk_label_get_justify, iFp)
+GO(gtk_label_get_ellipsize, uFp)
+GO(gtk_label_get_justify, uFp)
GO(gtk_label_get_label, pFp)
GO(gtk_label_get_layout, pFp)
GO(gtk_label_get_layout_offsets, vFppp)
GO(gtk_label_get_line_wrap, iFp)
-GO(gtk_label_get_line_wrap_mode, iFp)
+GO(gtk_label_get_line_wrap_mode, uFp)
GO(gtk_label_get_max_width_chars, iFp)
GO(gtk_label_get_mnemonic_keyval, uFp)
GO(gtk_label_get_mnemonic_widget, pFp)
@@ -1553,11 +1570,11 @@ GO(gtk_label_parse_uline, uFpp)
GO(gtk_label_select_region, vFpii)
GO(gtk_label_set_angle, vFpd)
GO(gtk_label_set_attributes, vFpp)
-GO(gtk_label_set_ellipsize, vFpi)
-GO(gtk_label_set_justify, vFpi)
+GO(gtk_label_set_ellipsize, vFpu)
+GO(gtk_label_set_justify, vFpu)
GO(gtk_label_set_label, vFpp)
GO(gtk_label_set_line_wrap, vFpi)
-GO(gtk_label_set_line_wrap_mode, vFpi)
+GO(gtk_label_set_line_wrap_mode, vFpu)
GO(gtk_label_set_markup, vFpp)
GO(gtk_label_set_markup_with_mnemonic, vFpp)
GO(gtk_label_set_max_width_chars, vFpi)
@@ -1572,32 +1589,33 @@ GO(gtk_label_set_use_markup, vFpi)
GO(gtk_label_set_use_underline, vFpi)
GO(gtk_label_set_width_chars, vFpi)
//GO(gtk_layout_freeze,
-//GO(gtk_layout_get_bin_window,
+GO(gtk_layout_get_bin_window, pFp)
//GO(gtk_layout_get_hadjustment,
-//GO(gtk_layout_get_size,
+GO(gtk_layout_get_size, vFppp)
GO(gtk_layout_get_type, pFv)
-//GO(gtk_layout_get_vadjustment,
-//GO(gtk_layout_move,
+GO(gtk_layout_get_vadjustment, pFp)
+GO(gtk_layout_move, vFppii)
GO(gtk_layout_new, pFpp)
//GO(gtk_layout_put,
//GO(gtk_layout_set_hadjustment,
-//GO(gtk_layout_set_size,
-//GO(gtk_layout_set_vadjustment,
+GO(gtk_layout_set_size, vFpuu)
+GO(gtk_layout_set_vadjustment, vFpp)
//GO(gtk_layout_thaw,
GO(gtk_level_bar_mode_get_type, pFv)
GO(gtk_level_bar_get_type, pFv)
GO(gtk_license_get_type, pFv)
GO(gtk_link_button_get_type, pFv)
-//GO(gtk_link_button_get_uri,
-//GO(gtk_link_button_get_visited,
+GO(gtk_link_button_get_uri, pFp)
+GO(gtk_link_button_get_visited, iFp)
//GO(gtk_link_button_new,
//GO(gtk_link_button_new_with_label,
-//GO(gtk_link_button_set_uri,
+GO(gtk_link_button_set_uri, vFpp)
//GO(gtk_link_button_set_uri_hook,
-//GO(gtk_link_button_set_visited,
+GO(gtk_link_button_set_visited, vFpi)
GO(gtk_list_append_items, vFpp)
GO(gtk_list_box_get_type, pFv)
GO(gtk_list_box_row_get_type, pFv)
+GO(gtk_list_box_set_header_func, vFppp)
GO(gtk_list_child_position, iFpp)
GO(gtk_list_clear_items, vFpii)
GO(gtk_list_end_drag_selection, vFp)
@@ -1685,12 +1703,14 @@ GO(gtk_main_quit, vFv)
GO(gtk_match_type_get_type, pFv)
GO(gtk_menu_attach, vFppuuuu)
GOM(gtk_menu_attach_to_widget, vFEppp)
-GO(gtk_menu_bar_get_child_pack_direction, iFp)
+GO(gtk_menu_bar_get_child_pack_direction, uFp)
GO(gtk_menu_bar_get_pack_direction, iFp)
GO(gtk_menu_bar_get_type, pFv)
GO(gtk_menu_bar_new, pFv)
-GO(gtk_menu_bar_set_child_pack_direction, vFpi)
+GO(gtk_menu_bar_set_child_pack_direction, vFpu)
GO(gtk_menu_bar_set_pack_direction, vFpi)
+GO(gtk_menu_button_new, pFv)
+GO(gtk_menu_button_set_menu_model, vFpp)
GO(gtk_menu_button_get_type, pFv)
GO(gtk_menu_detach, vFp)
GO(gtk_menu_direction_type_get_type, pFv)
@@ -1737,26 +1757,26 @@ GO(gtk_menu_set_reserve_toggle_size, vFpi)
GO(gtk_menu_set_screen, vFpp)
GO(gtk_menu_set_tearoff_state, vFpi)
GO(gtk_menu_set_title, vFpp)
-//GO(gtk_menu_shell_activate_item,
+GO(gtk_menu_shell_activate_item, vFppi)
GO(gtk_menu_shell_append, vFpp)
//GO(gtk_menu_shell_cancel,
//GO(gtk_menu_shell_deactivate,
//GO(gtk_menu_shell_deselect,
-//GO(gtk_menu_shell_get_take_focus,
+GO(gtk_menu_shell_get_take_focus, iFp)
GO(gtk_menu_shell_get_type, pFv)
GO(gtk_menu_shell_insert, vFppi)
GO(gtk_menu_shell_prepend, vFpp)
GO(gtk_menu_shell_select_first, vFpi)
GO(gtk_menu_shell_select_item, vFpp)
-//GO(gtk_menu_shell_set_take_focus,
-//GO(gtk_menu_tool_button_get_menu,
+GO(gtk_menu_shell_set_take_focus, vFpi)
+GO(gtk_menu_tool_button_get_menu, pFp)
GO(gtk_menu_tool_button_get_type, pFv)
-//GO(gtk_menu_tool_button_new,
+GO(gtk_menu_tool_button_new, pFpp)
//GO(gtk_menu_tool_button_new_from_stock,
//GO(gtk_menu_tool_button_set_arrow_tooltip,
-//GO(gtk_menu_tool_button_set_arrow_tooltip_markup,
+GO(gtk_menu_tool_button_set_arrow_tooltip_markup, vFpp)
//GO(gtk_menu_tool_button_set_arrow_tooltip_text,
-//GO(gtk_menu_tool_button_set_menu,
+GO(gtk_menu_tool_button_set_menu, vFpp)
GOM(gtk_message_dialog_format_secondary_markup, vFEppV)
GOM(gtk_message_dialog_format_secondary_text, vFEppV)
GO(gtk_message_dialog_get_image, pFp)
@@ -1784,7 +1804,7 @@ GO(gtk_movement_step_get_type, pFv)
GO(gtk_native_get_surface, pFp)
GO(gtk_notebook_append_page, iFppp)
GO(gtk_notebook_append_page_menu, iFpppp)
-GO(gtk_notebook_get_action_widget, pFpi)
+GO(gtk_notebook_get_action_widget, pFpu)
GO(gtk_notebook_get_current_page, iFp)
GO(gtk_notebook_get_group, pFp)
GO(gtk_notebook_get_group_id, iFp)
@@ -1800,7 +1820,7 @@ GO(gtk_notebook_get_tab_detachable, iFpp)
GO(gtk_notebook_get_tab_hborder, WFp)
GO(gtk_notebook_get_tab_label, pFpp)
GO(gtk_notebook_get_tab_label_text, pFpp)
-GO(gtk_notebook_get_tab_pos, iFp)
+GO(gtk_notebook_get_tab_pos, uFp)
GO(gtk_notebook_get_tab_reorderable, iFpp)
GO(gtk_notebook_get_tab_vborder, WFp)
GO(gtk_notebook_get_type, pFv)
@@ -1817,7 +1837,7 @@ GO(gtk_notebook_prev_page, vFp)
GO(gtk_notebook_query_tab_label_packing, vFppppp)
GO(gtk_notebook_remove_page, vFpi)
GO(gtk_notebook_reorder_child, vFppi)
-GO(gtk_notebook_set_action_widget, vFppi)
+GO(gtk_notebook_set_action_widget, vFppu)
GO(gtk_notebook_set_current_page, vFpi)
GO(gtk_notebook_set_group, vFpp)
GO(gtk_notebook_set_group_id, vFpi)
@@ -1834,7 +1854,7 @@ GO(gtk_notebook_set_tab_hborder, vFpu)
GO(gtk_notebook_set_tab_label, vFppp)
GO(gtk_notebook_set_tab_label_packing, vFppiii)
GO(gtk_notebook_set_tab_label_text, vFppp)
-GO(gtk_notebook_set_tab_pos, vFpi)
+GO(gtk_notebook_set_tab_pos, vFpu)
GO(gtk_notebook_set_tab_reorderable, vFppi)
GO(gtk_notebook_set_tab_vborder, vFpu)
//GOM(gtk_notebook_set_window_creation_hook, pFEppp)
@@ -1878,20 +1898,21 @@ GO(gtk_option_menu_new, pFv)
GO(gtk_option_menu_remove_menu, vFp)
GO(gtk_option_menu_set_history, vFpu)
GO(gtk_option_menu_set_menu, vFpp)
-GO(gtk_orientable_get_orientation, iFp)
+GO(gtk_orientable_get_orientation, uFp)
GO(gtk_orientable_get_type, pFv)
-GO(gtk_orientable_set_orientation, vFpi)
+GO(gtk_orientable_set_orientation, vFpu)
GO(gtk_orientation_get_type, pFv)
+GO(gtk_overlay_add_overlay, vFpp)
GO(gtk_overlay_get_type, pFv)
GO(gtk_pack_direction_get_type, pFv)
GO(gtk_pack_type_get_type, pFv)
GO(gtk_page_orientation_get_type, pFv)
GO(gtk_page_set_get_type, pFv)
-//GO(gtk_page_setup_copy,
+GO(gtk_page_setup_copy, pFp)
//GO(gtk_page_setup_get_bottom_margin,
GO(gtk_page_setup_get_left_margin, dFpi)
-//GO(gtk_page_setup_get_orientation,
-GO(gtk_page_setup_get_page_height, dFpi)
+GO(gtk_page_setup_get_orientation, uFp)
+GO(gtk_page_setup_get_page_height, dFpu)
GO(gtk_page_setup_get_page_width, dFpi)
GO(gtk_page_setup_get_paper_height, dFpi)
GO(gtk_page_setup_get_paper_size, pFp)
@@ -1900,54 +1921,54 @@ GO(gtk_page_setup_get_right_margin, dFpi)
GO(gtk_page_setup_get_top_margin, dFpi)
GO(gtk_page_setup_get_type, pFv)
//GO(gtk_page_setup_load_file,
-//GO(gtk_page_setup_load_key_file,
+GO(gtk_page_setup_load_key_file, iFpppp)
GO(gtk_page_setup_new, pFv)
-//GO(gtk_page_setup_new_from_file,
-//GO(gtk_page_setup_new_from_key_file,
+GO(gtk_page_setup_new_from_file, pFpp)
+GO(gtk_page_setup_new_from_key_file, pFppp)
//GO(gtk_page_setup_set_bottom_margin,
//GO(gtk_page_setup_set_left_margin,
-//GO(gtk_page_setup_set_orientation,
+GO(gtk_page_setup_set_orientation, vFpu)
GO(gtk_page_setup_set_paper_size, vFpp)
-//GO(gtk_page_setup_set_paper_size_and_default_margins,
-//GO(gtk_page_setup_set_right_margin,
+GO(gtk_page_setup_set_paper_size_and_default_margins, vFpp)
+GO(gtk_page_setup_set_right_margin, vFpdu)
//GO(gtk_page_setup_set_top_margin,
-//GO(gtk_page_setup_to_file,
-//GO(gtk_page_setup_to_key_file,
+GO(gtk_page_setup_to_file, iFppp)
+GO(gtk_page_setup_to_key_file, vFppp)
//GO(gtk_page_setup_unix_dialog_get_page_setup,
//GO(gtk_page_setup_unix_dialog_get_print_settings,
GO(gtk_page_setup_unix_dialog_get_type, pFv)
//GO(gtk_page_setup_unix_dialog_new,
//GO(gtk_page_setup_unix_dialog_set_page_setup,
//GO(gtk_page_setup_unix_dialog_set_print_settings,
-GO(gtk_paint_arrow, vFppiipppiiiiii)
+GO(gtk_paint_arrow, vFppuuppuiiiii)
GO(gtk_paint_box, vFppiipppiiii)
-GO(gtk_paint_box_gap, vFppiipppiiiiiii)
+GO(gtk_paint_box_gap, vFppuuppiiiiuii)
GO(gtk_paint_check, vFppiipppiiii)
GO(gtk_paint_diamond, vFppiipppiiii)
-GO(gtk_paint_expander, vFppipppiii)
-GO(gtk_paint_extension, vFppiipppiiiii)
+GO(gtk_paint_expander, vFppuppiiu)
+GO(gtk_paint_extension, vFppuuppiiiiu)
GO(gtk_paint_flat_box, vFppiipppiiii)
-GO(gtk_paint_focus, vFppipppiiii)
-GO(gtk_paint_handle, vFppiipppiiiii)
+GO(gtk_paint_focus, vFppuppiiii)
+GO(gtk_paint_handle, vFppuuppiiiiu)
GO(gtk_paint_hline, vFppipppiii)
-GO(gtk_paint_layout, vFppiipppiip)
+GO(gtk_paint_layout, vFppuippiip)
GO(gtk_paint_option, vFppiipppiiii)
GO(gtk_paint_polygon, vFppiippppii)
-GO(gtk_paint_resize_grip, vFppipppiiiii)
+GO(gtk_paint_resize_grip, vFppuppuiiii)
GO(gtk_paint_shadow, vFppiipppiiii)
GO(gtk_paint_shadow_gap, vFppiipppiiiiiii)
GO(gtk_paint_slider, vFppiipppiiiii)
-GO(gtk_paint_spinner, vFppipppuiiii)
+GO(gtk_paint_spinner, vFppuppuiiii)
GO(gtk_paint_string, vFppipppiip)
-GO(gtk_paint_tab, vFppiipppiiii)
-GO(gtk_paint_vline, vFppipppiii)
+GO(gtk_paint_tab, vFppuuppiiii)
+GO(gtk_paint_vline, vFppuppiii)
GO(gtk_paned_add1, vFpp)
GO(gtk_paned_add2, vFpp)
GO(gtk_paned_compute_position, vFpiii)
GO(gtk_paned_get_child1, pFp)
GO(gtk_paned_get_child2, pFp)
GO(gtk_paned_get_handle_window, pFp)
-GO(gtk_paned_get_position, pFp)
+GO(gtk_paned_get_position, iFp)
GO(gtk_paned_get_type, pFv)
GO(gtk_paned_pack1, vFppii)
GO(gtk_paned_pack2, vFppii)
@@ -1957,7 +1978,7 @@ GO(gtk_paper_size_free, vFp)
GO(gtk_paper_size_get_default, pFv)
GO(gtk_paper_size_get_default_bottom_margin, dFpi)
GO(gtk_paper_size_get_default_left_margin, dFpi)
-GO(gtk_paper_size_get_default_right_margin, dFpi)
+GO(gtk_paper_size_get_default_right_margin, dFpu)
GO(gtk_paper_size_get_default_top_margin, dFpi)
GO(gtk_paper_size_get_display_name, pFp)
GO(gtk_paper_size_get_height, dFpi)
@@ -1969,10 +1990,10 @@ GO(gtk_paper_size_get_width, dFpi)
GO(gtk_paper_size_is_custom, iFp)
GO(gtk_paper_size_is_equal, iFpp)
GO(gtk_paper_size_new, pFp)
-GO(gtk_paper_size_new_custom, pFppddi)
+GO(gtk_paper_size_new_custom, pFppddu)
GO(gtk_paper_size_new_from_key_file, pFppp)
GO(gtk_paper_size_new_from_ppd, pFppdd)
-GO(gtk_paper_size_set_size, vFpddi)
+GO(gtk_paper_size_set_size, vFpddu)
GO(gtk_paper_size_to_key_file, vFppp)
GO(gtk_parse_args, iFpp)
GO(gtk_path_bar_get_type, pFv)
@@ -2024,18 +2045,18 @@ GO(gtk_print_backend_get_type, pFv)
//GO(gtk_print_backend_set_list_done,
//GO(gtk_print_backend_set_password,
GO(gtk_print_capabilities_get_type, pFv)
-//GO(gtk_print_context_create_pango_context,
-//GO(gtk_print_context_create_pango_layout,
-//GO(gtk_print_context_get_cairo_context,
+GO(gtk_print_context_create_pango_context, pFp)
+GO(gtk_print_context_create_pango_layout, pFp)
+GO(gtk_print_context_get_cairo_context, pFp)
//GO(gtk_print_context_get_dpi_x,
-//GO(gtk_print_context_get_dpi_y,
-//GO(gtk_print_context_get_hard_margins,
+GO(gtk_print_context_get_dpi_y, dFp)
+GO(gtk_print_context_get_hard_margins, iFppppp)
//GO(gtk_print_context_get_height,
-//GO(gtk_print_context_get_page_setup,
-//GO(gtk_print_context_get_pango_fontmap,
+GO(gtk_print_context_get_page_setup, pFp)
+GO(gtk_print_context_get_pango_fontmap, pFp)
GO(gtk_print_context_get_type, pFv)
//GO(gtk_print_context_get_width,
-//GO(gtk_print_context_set_cairo_context,
+GO(gtk_print_context_set_cairo_context, vFppdd)
GO(gtk_print_duplex_get_type, pFv)
//GO(gtk_printer_accepts_pdf,
//GO(gtk_printer_accepts_ps,
@@ -2117,118 +2138,118 @@ GO(gtk_print_job_set_source_file, iFppp)
GO(gtk_print_operation_action_get_type, pFv)
//GO(gtk_print_operation_cancel,
//GO(gtk_print_operation_draw_page_finish,
-//GO(gtk_print_operation_get_default_page_setup,
-//GO(gtk_print_operation_get_embed_page_setup,
-//GO(gtk_print_operation_get_error,
+GO(gtk_print_operation_get_default_page_setup, pFp)
+GO(gtk_print_operation_get_embed_page_setup, iFp)
+GO(gtk_print_operation_get_error, vFpp)
//GO(gtk_print_operation_get_has_selection,
-//GO(gtk_print_operation_get_n_pages_to_print,
-//GO(gtk_print_operation_get_print_settings,
-//GO(gtk_print_operation_get_status,
-//GO(gtk_print_operation_get_status_string,
+GO(gtk_print_operation_get_n_pages_to_print, iFp)
+GO(gtk_print_operation_get_print_settings, pFp)
+GO(gtk_print_operation_get_status, uFp)
+GO(gtk_print_operation_get_status_string, pFp)
//GO(gtk_print_operation_get_support_selection,
GO(gtk_print_operation_get_type, pFv)
//GO(gtk_print_operation_is_finished,
-//GO(gtk_print_operation_new,
+GO(gtk_print_operation_new, pFv)
//GO(gtk_print_operation_preview_end_preview,
GO(gtk_print_operation_preview_get_type, pFv)
-//GO(gtk_print_operation_preview_is_selected,
-//GO(gtk_print_operation_preview_render_page,
+GO(gtk_print_operation_preview_is_selected, iFpi)
+GO(gtk_print_operation_preview_render_page, vFpi)
GO(gtk_print_operation_result_get_type, pFv)
-//GO(gtk_print_operation_run,
+GO(gtk_print_operation_run, uFpupp)
//GO(gtk_print_operation_set_allow_async,
-//GO(gtk_print_operation_set_current_page,
-//GO(gtk_print_operation_set_custom_tab_label,
-//GO(gtk_print_operation_set_default_page_setup,
+GO(gtk_print_operation_set_current_page, vFpi)
+GO(gtk_print_operation_set_custom_tab_label, vFpp)
+GO(gtk_print_operation_set_default_page_setup, vFpp)
//GO(gtk_print_operation_set_defer_drawing,
-//GO(gtk_print_operation_set_embed_page_setup,
+GO(gtk_print_operation_set_embed_page_setup, vFpi)
//GO(gtk_print_operation_set_export_filename,
//GO(gtk_print_operation_set_has_selection,
//GO(gtk_print_operation_set_job_name,
//GO(gtk_print_operation_set_n_pages,
-//GO(gtk_print_operation_set_print_settings,
+GO(gtk_print_operation_set_print_settings, vFpp)
//GO(gtk_print_operation_set_show_progress,
//GO(gtk_print_operation_set_support_selection,
//GO(gtk_print_operation_set_track_print_status,
-//GO(gtk_print_operation_set_unit,
+GO(gtk_print_operation_set_unit, vFpu)
//GO(gtk_print_operation_set_use_full_page,
GO(gtk_print_pages_get_type, pFv)
GO(gtk_print_quality_get_type, pFv)
-//GO(gtk_print_run_page_setup_dialog,
+GO(gtk_print_run_page_setup_dialog, pFppp)
//GO(gtk_print_run_page_setup_dialog_async,
GO(gtk_print_settings_copy, pFp)
//GO(gtk_print_settings_foreach,
-//GO(gtk_print_settings_get,
-//GO(gtk_print_settings_get_bool,
+GO(gtk_print_settings_get, pFpp)
+GO(gtk_print_settings_get_bool, iFpp)
//GO(gtk_print_settings_get_collate,
//GO(gtk_print_settings_get_default_source,
//GO(gtk_print_settings_get_dither,
-//GO(gtk_print_settings_get_double,
-//GO(gtk_print_settings_get_double_with_default,
-//GO(gtk_print_settings_get_duplex,
+GO(gtk_print_settings_get_double, dFpp)
+GO(gtk_print_settings_get_double_with_default, dFppd)
+GO(gtk_print_settings_get_duplex, uFp)
//GO(gtk_print_settings_get_finishings,
-//GO(gtk_print_settings_get_int,
-//GO(gtk_print_settings_get_int_with_default,
-//GO(gtk_print_settings_get_length,
+GO(gtk_print_settings_get_int, iFpp)
+GO(gtk_print_settings_get_int_with_default, iFppi)
+GO(gtk_print_settings_get_length, dFppu)
//GO(gtk_print_settings_get_media_type,
//GO(gtk_print_settings_get_n_copies,
//GO(gtk_print_settings_get_number_up,
-//GO(gtk_print_settings_get_number_up_layout,
-GO(gtk_print_settings_get_orientation, iFp)
-//GO(gtk_print_settings_get_output_bin,
+GO(gtk_print_settings_get_number_up_layout, uFp)
+GO(gtk_print_settings_get_orientation, uFp)
+GO(gtk_print_settings_get_output_bin, pFp)
GO(gtk_print_settings_get_page_ranges, pFpp)
-//GO(gtk_print_settings_get_page_set,
-//GO(gtk_print_settings_get_paper_height,
-//GO(gtk_print_settings_get_paper_size,
+GO(gtk_print_settings_get_page_set, uFp)
+GO(gtk_print_settings_get_paper_height, dFpu)
+GO(gtk_print_settings_get_paper_size, pFp)
//GO(gtk_print_settings_get_paper_width,
GO(gtk_print_settings_get_printer, pFp)
//GO(gtk_print_settings_get_printer_lpi,
-GO(gtk_print_settings_get_print_pages, iFp)
-//GO(gtk_print_settings_get_quality,
+GO(gtk_print_settings_get_print_pages, uFp)
+GO(gtk_print_settings_get_quality, uFp)
GO(gtk_print_settings_get_resolution, iFp)
//GO(gtk_print_settings_get_resolution_x,
-//GO(gtk_print_settings_get_resolution_y,
-//GO(gtk_print_settings_get_reverse,
-//GO(gtk_print_settings_get_scale,
+GO(gtk_print_settings_get_resolution_y, iFp)
+GO(gtk_print_settings_get_reverse, iFp)
+GO(gtk_print_settings_get_scale, dFp)
GO(gtk_print_settings_get_type, pFv)
//GO(gtk_print_settings_get_use_color,
//GO(gtk_print_settings_has_key,
//GO(gtk_print_settings_load_file,
-//GO(gtk_print_settings_load_key_file,
+GO(gtk_print_settings_load_key_file, iFpppp)
GO(gtk_print_settings_new, pFv)
-//GO(gtk_print_settings_new_from_file,
-//GO(gtk_print_settings_new_from_key_file,
+GO(gtk_print_settings_new_from_file, pFpp)
+GO(gtk_print_settings_new_from_key_file, pFppp)
GO(gtk_print_settings_set, vFppp)
-//GO(gtk_print_settings_set_bool,
+GO(gtk_print_settings_set_bool, vFppi)
GO(gtk_print_settings_set_collate, vFpi)
//GO(gtk_print_settings_set_default_source,
//GO(gtk_print_settings_set_dither,
-//GO(gtk_print_settings_set_double,
-//GO(gtk_print_settings_set_duplex,
+GO(gtk_print_settings_set_double, vFppd)
+GO(gtk_print_settings_set_duplex, vFpu)
//GO(gtk_print_settings_set_finishings,
-//GO(gtk_print_settings_set_int,
-//GO(gtk_print_settings_set_length,
+GO(gtk_print_settings_set_int, vFppi)
+GO(gtk_print_settings_set_length, vFppdu)
//GO(gtk_print_settings_set_media_type,
GO(gtk_print_settings_set_n_copies, vFpi)
//GO(gtk_print_settings_set_number_up,
-//GO(gtk_print_settings_set_number_up_layout,
-GO(gtk_print_settings_set_orientation, vFpi)
-//GO(gtk_print_settings_set_output_bin,
-//GO(gtk_print_settings_set_page_ranges,
-//GO(gtk_print_settings_set_page_set,
-//GO(gtk_print_settings_set_paper_height,
-//GO(gtk_print_settings_set_paper_size,
+GO(gtk_print_settings_set_number_up_layout, vFpu)
+GO(gtk_print_settings_set_orientation, vFpu)
+GO(gtk_print_settings_set_output_bin, vFpp)
+GO(gtk_print_settings_set_page_ranges, vFppi)
+GO(gtk_print_settings_set_page_set, vFpu)
+GO(gtk_print_settings_set_paper_height, vFpdu)
+GO(gtk_print_settings_set_paper_size, vFpp)
//GO(gtk_print_settings_set_paper_width,
GO(gtk_print_settings_set_printer, vFpp)
GO(gtk_print_settings_set_printer_lpi, vFpd)
-GO(gtk_print_settings_set_print_pages, vFpi)
-//GO(gtk_print_settings_set_quality,
-//GO(gtk_print_settings_set_resolution,
+GO(gtk_print_settings_set_print_pages, vFpu)
+GO(gtk_print_settings_set_quality, vFpu)
+GO(gtk_print_settings_set_resolution, vFpi)
GO(gtk_print_settings_set_resolution_xy, vFpii)
-//GO(gtk_print_settings_set_reverse,
-//GO(gtk_print_settings_set_scale,
+GO(gtk_print_settings_set_reverse, vFpi)
+GO(gtk_print_settings_set_scale, vFpd)
//GO(gtk_print_settings_set_use_color,
-//GO(gtk_print_settings_to_file,
-//GO(gtk_print_settings_to_key_file,
+GO(gtk_print_settings_to_file, iFppp)
+GO(gtk_print_settings_to_key_file, vFppp)
//GO(gtk_print_settings_unset,
GO(gtk_print_status_get_type, pFv)
//GO(gtk_print_unix_dialog_add_custom_tab,
@@ -2251,10 +2272,10 @@ GO(gtk_print_unix_dialog_set_manual_capabilities, vFpi)
GO(gtk_print_unix_dialog_set_settings, vFpp)
GO(gtk_print_unix_dialog_set_support_selection, vFpi)
GO(gtk_private_flags_get_type, pFv)
-GO(gtk_progress_bar_get_ellipsize, iFp)
+GO(gtk_progress_bar_get_ellipsize, uFp)
GO(gtk_progress_bar_get_fraction, dFp)
GO(gtk_progress_bar_get_orientation, iFp)
-GO(gtk_progress_bar_get_pulse_step, fFp)
+GO(gtk_progress_bar_get_pulse_step, dFp)
GO(gtk_progress_bar_get_text, pFp)
GO(gtk_progress_bar_get_type, pFv)
GO(gtk_progress_bar_new, pFv)
@@ -2265,7 +2286,7 @@ GO(gtk_progress_bar_set_activity_blocks, vFpu)
GO(gtk_progress_bar_set_activity_step, vFpu)
GO(gtk_progress_bar_set_bar_style, vFpi)
GO(gtk_progress_bar_set_discrete_blocks, vFpu)
-GO(gtk_progress_bar_set_ellipsize, vFpi)
+GO(gtk_progress_bar_set_ellipsize, vFpu)
GO(gtk_progress_bar_set_fraction, vFpd)
GO(gtk_progress_bar_set_orientation, vFpi)
GO(gtk_progress_bar_set_pulse_step, vFpd)
@@ -2337,7 +2358,7 @@ GO(gtk_range_get_slider_range, vFppp)
GO(gtk_range_get_slider_size_fixed, iFp)
GO(gtk_range_get_type, pFv)
GO(gtk_range_get_update_policy, iFp)
-GO(gtk_range_get_upper_stepper_sensitivity, iFp)
+GO(gtk_range_get_upper_stepper_sensitivity, uFp)
GO(gtk_range_get_value, dFp)
GO(gtk_range_set_adjustment, vFpp)
GO(gtk_range_set_fill_level, vFpd)
@@ -2352,7 +2373,7 @@ GO(gtk_range_set_round_digits, vFpi)
GO(gtk_range_set_show_fill_level, vFpi)
GO(gtk_range_set_slider_size_fixed, vFpi)
GO(gtk_range_set_update_policy, vFpi)
-GO(gtk_range_set_upper_stepper_sensitivity, vFpi)
+GO(gtk_range_set_upper_stepper_sensitivity, vFpu)
GO(gtk_range_set_value, vFpd)
GO(gtk_rc_add_class_style, vFpp)
GO(gtk_rc_add_default_file, vFp)
@@ -2366,7 +2387,7 @@ GO(gtk_rc_get_im_module_file, pFv)
GO(gtk_rc_get_im_module_path, pFv)
GO(gtk_rc_get_module_dir, pFv)
GO(gtk_rc_get_style, pFp)
-GO(gtk_rc_get_style_by_paths, pFpppi)
+GO(gtk_rc_get_style_by_paths, pFpppL)
GO(gtk_rc_get_theme_dir, pFv)
GO(gtk_rc_parse, vFp)
GO(gtk_rc_parse_color, uFpp)
@@ -2392,111 +2413,111 @@ GO(gtk_rc_style_unref, vFp)
GO(gtk_rc_token_type_get_type, pFv)
GO(gtk_revealer_get_type, pFv)
GO(gtk_revealer_transition_type_get_type, pFv)
-//GO(gtk_recent_action_get_show_numbers,
+GO(gtk_recent_action_get_show_numbers, iFp)
GO(gtk_recent_action_get_type, pFv)
-//GO(gtk_recent_action_new,
-//GO(gtk_recent_action_new_for_manager,
-//GO(gtk_recent_action_set_show_numbers,
+GO(gtk_recent_action_new, pFpppp)
+GO(gtk_recent_action_new_for_manager, pFppppp)
+GO(gtk_recent_action_set_show_numbers, vFpi)
//GO(gtk_recent_chooser_add_filter,
GO(gtk_recent_chooser_dialog_get_type, pFv)
//GO(gtk_recent_chooser_dialog_new,
//GO(gtk_recent_chooser_dialog_new_for_manager,
GO(gtk_recent_chooser_error_get_type, pFv)
-//GO(gtk_recent_chooser_error_quark,
-//GO(gtk_recent_chooser_get_current_item,
-//GO(gtk_recent_chooser_get_current_uri,
-//GO(gtk_recent_chooser_get_filter,
-//GO(gtk_recent_chooser_get_items,
-//GO(gtk_recent_chooser_get_limit,
+GO(gtk_recent_chooser_error_quark, uFv)
+GO(gtk_recent_chooser_get_current_item, pFp)
+GO(gtk_recent_chooser_get_current_uri, pFp)
+GO(gtk_recent_chooser_get_filter, pFp)
+GO(gtk_recent_chooser_get_items, pFp)
+GO(gtk_recent_chooser_get_limit, iFp)
//GO(gtk_recent_chooser_get_local_only,
//GO(gtk_recent_chooser_get_select_multiple,
-//GO(gtk_recent_chooser_get_show_icons,
+GO(gtk_recent_chooser_get_show_icons, iFp)
//GO(gtk_recent_chooser_get_show_not_found,
//GO(gtk_recent_chooser_get_show_numbers,
//GO(gtk_recent_chooser_get_show_private,
//GO(gtk_recent_chooser_get_show_tips,
-//GO(gtk_recent_chooser_get_sort_type,
+GO(gtk_recent_chooser_get_sort_type, uFp)
GO(gtk_recent_chooser_get_type, pFv)
-//GO(gtk_recent_chooser_get_uris,
-//GO(gtk_recent_chooser_list_filters,
-//GO(gtk_recent_chooser_menu_get_show_numbers,
+GO(gtk_recent_chooser_get_uris, pFpp)
+GO(gtk_recent_chooser_list_filters, pFp)
+GO(gtk_recent_chooser_menu_get_show_numbers, iFp)
GO(gtk_recent_chooser_menu_get_type, pFv)
//GO(gtk_recent_chooser_menu_new,
//GO(gtk_recent_chooser_menu_new_for_manager,
-//GO(gtk_recent_chooser_menu_set_show_numbers,
+GO(gtk_recent_chooser_menu_set_show_numbers, vFpi)
//GO(gtk_recent_chooser_remove_filter,
//GO(gtk_recent_chooser_select_all,
-//GO(gtk_recent_chooser_select_uri,
+GO(gtk_recent_chooser_select_uri, iFppp)
//GO(gtk_recent_chooser_set_current_uri,
-//GO(gtk_recent_chooser_set_filter,
-//GO(gtk_recent_chooser_set_limit,
+GO(gtk_recent_chooser_set_filter, vFpp)
+GO(gtk_recent_chooser_set_limit, vFpi)
//GO(gtk_recent_chooser_set_local_only,
//GO(gtk_recent_chooser_set_select_multiple,
-//GO(gtk_recent_chooser_set_show_icons,
+GO(gtk_recent_chooser_set_show_icons, vFpi)
//GO(gtk_recent_chooser_set_show_not_found,
//GO(gtk_recent_chooser_set_show_numbers,
//GO(gtk_recent_chooser_set_show_private,
//GO(gtk_recent_chooser_set_show_tips,
//GO(gtk_recent_chooser_set_sort_func,
-//GO(gtk_recent_chooser_set_sort_type,
+GO(gtk_recent_chooser_set_sort_type, vFpu)
//GO(gtk_recent_chooser_unselect_all,
-//GO(gtk_recent_chooser_unselect_uri,
+GO(gtk_recent_chooser_unselect_uri, vFpp)
GO(gtk_recent_chooser_widget_get_type, pFv)
//GO(gtk_recent_chooser_widget_new,
-//GO(gtk_recent_chooser_widget_new_for_manager,
-//GO(gtk_recent_filter_add_age,
+GO(gtk_recent_chooser_widget_new_for_manager, pFp)
+GO(gtk_recent_filter_add_age, vFpi)
//GO(gtk_recent_filter_add_application,
//GO(gtk_recent_filter_add_custom,
-//GO(gtk_recent_filter_add_group,
+GO(gtk_recent_filter_add_group, vFpp)
//GO(gtk_recent_filter_add_mime_type,
//GO(gtk_recent_filter_add_pattern,
//GO(gtk_recent_filter_add_pixbuf_formats,
-//GO(gtk_recent_filter_filter,
+GO(gtk_recent_filter_filter, iFpp)
GO(gtk_recent_filter_flags_get_type, pFv)
-//GO(gtk_recent_filter_get_name,
-//GO(gtk_recent_filter_get_needed,
+GO(gtk_recent_filter_get_name, pFp)
+GO(gtk_recent_filter_get_needed, uFp)
GO(gtk_recent_filter_get_type, pFv)
-//GO(gtk_recent_filter_new,
+GO(gtk_recent_filter_new, pFv)
//GO(gtk_recent_filter_set_name,
-//GO(gtk_recent_info_exists,
+GO(gtk_recent_info_exists, iFp)
//GO(gtk_recent_info_get_added,
-//GO(gtk_recent_info_get_age,
-//GO(gtk_recent_info_get_application_info,
+GO(gtk_recent_info_get_age, iFp)
+GO(gtk_recent_info_get_application_info, iFppppp)
//GO(gtk_recent_info_get_applications,
//GO(gtk_recent_info_get_description,
//GO(gtk_recent_info_get_display_name,
-//GO(gtk_recent_info_get_groups,
-//GO(gtk_recent_info_get_icon,
-//GO(gtk_recent_info_get_mime_type,
+GO(gtk_recent_info_get_groups, pFpp)
+GO(gtk_recent_info_get_icon, pFpi)
+GO(gtk_recent_info_get_mime_type, pFp)
//GO(gtk_recent_info_get_modified,
//GO(gtk_recent_info_get_private_hint,
//GO(gtk_recent_info_get_short_name,
GO(gtk_recent_info_get_type, pFv)
//GO(gtk_recent_info_get_uri,
-//GO(gtk_recent_info_get_uri_display,
-//GO(gtk_recent_info_get_visited,
+GO(gtk_recent_info_get_uri_display, pFp)
+GO(gtk_recent_info_get_visited, lFp)
//GO(gtk_recent_info_has_application,
-//GO(gtk_recent_info_has_group,
+GO(gtk_recent_info_has_group, iFpp)
//GO(gtk_recent_info_is_local,
//GO(gtk_recent_info_last_application,
-//GO(gtk_recent_info_match,
-//GO(gtk_recent_info_ref,
-//GO(gtk_recent_info_unref,
-//GO(gtk_recent_manager_add_full,
+GO(gtk_recent_info_match, iFpp)
+GO(gtk_recent_info_ref, pFp)
+GO(gtk_recent_info_unref, vFp)
+GO(gtk_recent_manager_add_full, iFppp)
//GO(gtk_recent_manager_add_item,
GO(gtk_recent_manager_error_get_type, pFv)
//GO(gtk_recent_manager_error_quark,
-//GO(gtk_recent_manager_get_default,
+GO(gtk_recent_manager_get_default, pFv)
//GO(gtk_recent_manager_get_for_screen,
-//GO(gtk_recent_manager_get_items,
+GO(gtk_recent_manager_get_items, pFp)
//GO(gtk_recent_manager_get_limit,
GO(gtk_recent_manager_get_type, pFv)
-//GO(gtk_recent_manager_has_item,
-//GO(gtk_recent_manager_lookup_item,
-//GO(gtk_recent_manager_move_item,
+GO(gtk_recent_manager_has_item, iFpp)
+GO(gtk_recent_manager_lookup_item, pFppp)
+GO(gtk_recent_manager_move_item, iFpppp)
//GO(gtk_recent_manager_new,
-//GO(gtk_recent_manager_purge_items,
-//GO(gtk_recent_manager_remove_item,
+GO(gtk_recent_manager_purge_items, iFpp)
+GO(gtk_recent_manager_remove_item, iFppp)
//GO(gtk_recent_manager_set_limit,
//GO(gtk_recent_manager_set_screen,
GO(gtk_recent_sort_type_get_type, pFv)
@@ -2507,25 +2528,25 @@ GO(gtk_render_background, vFppdddd)
GO(gtk_render_background_get_clip, vFpddddp)
GO(gtk_render_check, vFppdddd)
GO(gtk_render_expander, vFppdddd)
-GO(gtk_render_extension, vFppddddi)
+GO(gtk_render_extension, vFppddddu)
GO(gtk_render_focus, vFppdddd)
GO(gtk_render_frame, vFppdddd)
-GO(gtk_render_frame_gap, vFppddddidd)
+GO(gtk_render_frame_gap, vFppddddudd)
GO(gtk_render_handle, vFppdddd)
GO(gtk_render_icon, vFpppdd)
-GO(gtk_render_icon_pixbuf, pFppi)
+GO(gtk_render_icon_pixbuf, pFppu)
GO(gtk_render_icon_surface, vFpppdd)
-GO(gtk_render_insertion_cursor, vFppddpii)
+GO(gtk_render_insertion_cursor, vFppddpiu)
GO(gtk_render_layout, vFppddp)
GO(gtk_render_line, vFppdddd)
GO(gtk_render_option, vFppdddd)
-GO(gtk_render_slider, vFppddddi)
+GO(gtk_render_slider, vFppddddu)
GO(gtk_requisition_copy, pFp)
GO(gtk_requisition_free, vFp)
GO(gtk_requisition_get_type, pFv)
GO(gtk_resize_mode_get_type, pFv)
GO(gtk_response_type_get_type, pFv)
-//GO(gtk_rgb_to_hsv,
+GO(gtk_rgb_to_hsv, vFdddppp)
//GO(gtk_ruler_draw_pos,
//GO(gtk_ruler_draw_ticks,
//GO(gtk_ruler_get_metric,
@@ -2533,44 +2554,44 @@ GO(gtk_response_type_get_type, pFv)
GO(gtk_ruler_get_type, pFv)
//GO(gtk_ruler_set_metric,
//GO(gtk_ruler_set_range,
-//GO(gtk_scale_add_mark,
-//GO(gtk_scale_button_get_adjustment,
+GO(gtk_scale_add_mark, vFpdup)
+GO(gtk_scale_button_get_adjustment, pFp)
//GO(gtk_scale_button_get_minus_button,
//GO(gtk_scale_button_get_orientation,
//GO(gtk_scale_button_get_plus_button,
-//GO(gtk_scale_button_get_popup,
+GO(gtk_scale_button_get_popup, pFp)
GO(gtk_scale_button_get_type, pFv)
-//GO(gtk_scale_button_get_value,
-//GO(gtk_scale_button_new,
-//GO(gtk_scale_button_set_adjustment,
-//GO(gtk_scale_button_set_icons,
+GO(gtk_scale_button_get_value, dFp)
+GO(gtk_scale_button_new, pFudddp)
+GO(gtk_scale_button_set_adjustment, vFpp)
+GO(gtk_scale_button_set_icons, vFpp)
//GO(gtk_scale_button_set_orientation,
-//GO(gtk_scale_button_set_value,
+GO(gtk_scale_button_set_value, vFpd)
//GO(gtk_scale_clear_marks,
-//GO(gtk_scale_get_digits,
+GO(gtk_scale_get_digits, iFp)
//GO(gtk_scale_get_draw_value,
-//GO(gtk_scale_get_layout,
-//GO(gtk_scale_get_layout_offsets,
+GO(gtk_scale_get_layout, pFp)
+GO(gtk_scale_get_layout_offsets, vFppp)
GO(gtk_scale_get_type, pFv)
-//GO(gtk_scale_get_value_pos,
-//GO(gtk_scale_set_digits,
+GO(gtk_scale_get_value_pos, uFp)
+GO(gtk_scale_set_digits, vFpi)
//GO(gtk_scale_set_draw_value,
-//GO(gtk_scale_set_value_pos,
+GO(gtk_scale_set_value_pos, vFpu)
GO(gtk_scrollbar_get_type, pFv)
-//GO(gtk_scrolled_window_add_with_viewport,
+GO(gtk_scrolled_window_add_with_viewport, vFpp)
GO(gtk_scrolled_window_get_hadjustment, pFp)
GO(gtk_scrolled_window_get_hscrollbar, pFp)
-GO(gtk_scrolled_window_get_placement, iFp)
+GO(gtk_scrolled_window_get_placement, uFp)
GO(gtk_scrolled_window_get_policy, vFppp)
-GO(gtk_scrolled_window_get_shadow_type, iFp)
+GO(gtk_scrolled_window_get_shadow_type, uFp)
GO(gtk_scrolled_window_get_type, pFv)
GO(gtk_scrolled_window_get_vadjustment, pFp)
GO(gtk_scrolled_window_get_vscrollbar, pFp)
GO(gtk_scrolled_window_new, pFpp)
GO(gtk_scrolled_window_set_hadjustment, vFpp)
-GO(gtk_scrolled_window_set_placement, vFpi)
-GO(gtk_scrolled_window_set_policy, vFpii)
-GO(gtk_scrolled_window_set_shadow_type, vFpi)
+GO(gtk_scrolled_window_set_placement, vFpu)
+GO(gtk_scrolled_window_set_policy, vFpuu)
+GO(gtk_scrolled_window_set_shadow_type, vFpu)
GO(gtk_scrolled_window_set_vadjustment, vFpp)
GO(gtk_scrolled_window_unset_placement, vFp)
GO(gtk_scroll_step_get_type, pFv)
@@ -2585,7 +2606,7 @@ GO(gtk_selection_convert, iFpppu)
GO(gtk_selection_data_copy, pFp)
GO(gtk_selection_data_free, vFp)
GO(gtk_selection_data_get_data, pFp)
-GO(gtk_selection_data_get_data_type, iFp)
+GO(gtk_selection_data_get_data_type, pFp)
GO(gtk_selection_data_get_display, pFp)
GO(gtk_selection_data_get_format, iFp)
GO(gtk_selection_data_get_length, iFp)
@@ -2612,7 +2633,7 @@ GO(gtk_sensitivity_type_get_type, pFv)
GO(gtk_separator_get_type, pFv)
GO(gtk_separator_menu_item_get_type, pFv)
GO(gtk_separator_menu_item_new, pFv)
-GO(gtk_separator_new, pFi)
+GO(gtk_separator_new, pFu)
GO(gtk_separator_tool_item_get_draw, iFp)
GO(gtk_separator_tool_item_get_type, pFv)
GO(gtk_separator_tool_item_new, pFv)
@@ -2630,6 +2651,7 @@ GO(gtk_settings_set_string_property, vFpppp)
GO(gtk_shadow_type_get_type, pFv)
GO(gtk_show_about_dialog, vFpppppppppppppppppppppppp) //vaarg
GO(gtk_show_uri, iFppup)
+GO(gtk_show_uri_on_window, iFppup)
GO(gtk_side_type_get_type, pFv)
//GO(gtk_signal_compat_matched,
GOM(gtk_signal_connect_full, LFEppppppii)
@@ -2644,15 +2666,15 @@ GOM(gtk_signal_connect_full, LFEppppppii)
//GO(gtk_signal_newv,
GO(gtk_signal_run_type_get_type, pFv)
//GO(gtk_size_group_add_widget,
-//GO(gtk_size_group_get_ignore_hidden,
-//GO(gtk_size_group_get_mode,
+GO(gtk_size_group_get_ignore_hidden, iFp)
+GO(gtk_size_group_get_mode, uFp)
GO(gtk_size_group_get_type, pFv)
-//GO(gtk_size_group_get_widgets,
+GO(gtk_size_group_get_widgets, pFp)
GO(gtk_size_group_mode_get_type, pFv)
-//GO(gtk_size_group_new,
-//GO(gtk_size_group_remove_widget,
-//GO(gtk_size_group_set_ignore_hidden,
-//GO(gtk_size_group_set_mode,
+GO(gtk_size_group_new, pFu)
+GO(gtk_size_group_remove_widget, vFpp)
+GO(gtk_size_group_set_ignore_hidden, vFpi)
+GO(gtk_size_group_set_mode, vFpu)
GO(gtk_snapshot_new, pFv)
GO(gtk_snapshot_free_to_node, pFp)
GO(gtk_snapshot_render_background, vFppdddd)
@@ -2671,7 +2693,7 @@ GO(gtk_spin_button_get_numeric, iFp)
GO(gtk_spin_button_get_range, vFppp)
GO(gtk_spin_button_get_snap_to_ticks, iFp)
GO(gtk_spin_button_get_type, pFv)
-GO(gtk_spin_button_get_update_policy, iFp)
+GO(gtk_spin_button_get_update_policy, uFp)
GO(gtk_spin_button_get_value, dFp)
GO(gtk_spin_button_get_value_as_int, iFp)
GO(gtk_spin_button_get_wrap, iFp)
@@ -2683,10 +2705,10 @@ GO(gtk_spin_button_set_increments, vFpdd)
GO(gtk_spin_button_set_numeric, vFpi)
GO(gtk_spin_button_set_range, vFpdd)
GO(gtk_spin_button_set_snap_to_ticks, vFpi)
-GO(gtk_spin_button_set_update_policy, vFpi)
+GO(gtk_spin_button_set_update_policy, vFpu)
GO(gtk_spin_button_set_value, vFpd)
GO(gtk_spin_button_set_wrap, vFpi)
-GO(gtk_spin_button_spin, vFpid)
+GO(gtk_spin_button_spin, vFpud)
GO(gtk_spin_button_update, vFp)
GO(gtk_spin_button_update_policy_get_type, pFv)
GO(gtk_spinner_get_type, pFv)
@@ -2718,7 +2740,7 @@ GO(gtk_status_icon_get_pixbuf, pFp)
GO(gtk_status_icon_get_screen, pFp)
GO(gtk_status_icon_get_size, iFp)
GO(gtk_status_icon_get_stock, pFp)
-GO(gtk_status_icon_get_storage_type, iFp)
+GO(gtk_status_icon_get_storage_type, uFp)
GO(gtk_status_icon_get_title, pFp)
GO(gtk_status_icon_get_tooltip_markup, pFp)
GO(gtk_status_icon_get_tooltip_text, pFp)
@@ -2754,32 +2776,32 @@ GO(gtk_stock_item_free, vFp)
GO(gtk_stock_list_ids, pFv)
GO(gtk_stock_lookup, iFpp)
GOM(gtk_stock_set_translate_func, vFEpppp)
-GO(gtk_style_apply_default_background, vFppiipiiii)
+GO(gtk_style_apply_default_background, vFpppuiiii)
GO(gtk_style_attach, pFpp)
GO(gtk_style_context_add_class, vFpp)
GO(gtk_style_context_add_provider, vFppu)
GO(gtk_style_context_add_provider_for_display, vFppu)
GO(gtk_style_context_add_provider_for_screen, vFppu)
-GO(gtk_style_context_add_region, vFppi)
+GO(gtk_style_context_add_region, vFppu)
GO(gtk_style_context_cancel_animations, vFpp)
//GO2(gtk_style_context_get, vFppV, gtk_style_context_get_valist)
GO(gtk_style_context_get_border, vFpip)
GO(gtk_style_context_get_background_color, vFpip)
-GO(gtk_style_context_get_border_color, vFpip)
+GO(gtk_style_context_get_border_color, vFpup)
GO(gtk_style_context_get_color, vFpip)
-GO(gtk_style_context_get_direction, iFp)
-GO(gtk_style_context_get_font, pFpi)
-GO(gtk_style_context_get_junction_sides, iFp)
-GO(gtk_style_context_get_margin, vFpip)
+GO(gtk_style_context_get_direction, uFp)
+GO(gtk_style_context_get_font, pFpu)
+GO(gtk_style_context_get_junction_sides, uFp)
+GO(gtk_style_context_get_margin, vFpup)
GO(gtk_style_context_get_padding, vFpip)
GO(gtk_style_context_get_parent, pFp)
GO(gtk_style_context_get_path, pFp)
-GO(gtk_style_context_get_property, vFppip)
+GO(gtk_style_context_get_property, vFppup)
GO(gtk_style_context_get_frame_clock, pFp)
GO(gtk_style_context_get_scale, iFp)
GO(gtk_style_context_get_screen, pFp)
GO(gtk_style_context_get_section, pFpp)
-GO(gtk_style_context_get_state, iFp)
+GO(gtk_style_context_get_state, uFp)
//GO2(gtk_style_context_get_style, vFpV, gtk_style_context_get_style_valist)
GO(gtk_style_context_get_style_property, vFppp)
GOM(gtk_style_context_get_style_valist, vFEpA)
@@ -2792,7 +2814,7 @@ GO(gtk_style_context_list_regions, pFp)
GO(gtk_style_context_lookup_color, iFppp)
GO(gtk_style_context_lookup_icon_set, pFpp)
GO(gtk_style_context_new, pFv)
-GO(gtk_style_context_notify_state_change, vFpppip)
+GO(gtk_style_context_notify_state_change, vFpppui)
GO(gtk_style_context_pop_animatable_region, vFp)
GO(gtk_style_context_push_animatable_region, vFpp)
GO(gtk_style_context_restore, vFp)
@@ -2805,36 +2827,36 @@ GO(gtk_style_context_reset_widgets, vFp)
GO(gtk_style_context_save, vFp)
GO(gtk_style_context_scroll_animations, vFppii)
GO(gtk_style_context_set_background, vFpp)
-GO(gtk_style_context_set_direction, vFpi)
+GO(gtk_style_context_set_direction, vFpu)
GO(gtk_style_context_set_frame_clock, vFpp)
-GO(gtk_style_context_set_junction_sides, vFpi)
+GO(gtk_style_context_set_junction_sides, vFpu)
GO(gtk_style_context_set_parent, vFpp)
GO(gtk_style_context_set_path, vFpp)
GO(gtk_style_context_set_scale, vFpi)
GO(gtk_style_context_set_screen, vFpp)
-GO(gtk_style_context_set_state, vFpi)
-GO(gtk_style_context_state_is_running, iFpip)
-GO(gtk_style_context_to_string, pFpi)
+GO(gtk_style_context_set_state, vFpu)
+GO(gtk_style_context_state_is_running, iFpup)
+GO(gtk_style_context_to_string, pFpu)
GO(gtk_style_copy, pFp)
GO(gtk_style_detach, vFp)
GO(gtk_style_get, vFpippppppppppp) //vaarg, wrap with gtk_style_get_valist?
GO(gtk_style_get_font, pFp)
-GO(gtk_style_get_style_property, vFpipp)
+GO(gtk_style_get_style_property, vFpLpp)
GO(gtk_style_get_type, pFv)
//GO(gtk_style_get_valist, vFpipA)
GO(gtk_style_lookup_color, iFppp)
GO(gtk_style_lookup_icon_set, pFpp)
GO(gtk_style_new, pFv)
GO(gtk_style_ref, pFp)
-GO(gtk_style_render_icon, pFppiiipp)
-GO(gtk_style_set_background, vFppi)
+GO(gtk_style_render_icon, pFppuuupp)
+GO(gtk_style_set_background, vFppu)
GO(gtk_style_set_font, vFpp)
GO(gtk_style_provider_get_type, pFv)
GO(gtk_style_unref, vFp)
GO(gtk_submenu_direction_get_type, pFv)
GO(gtk_submenu_placement_get_type, pFv)
GO(gtk_switch_get_type, pFv)
-GO(gtk_table_attach, vFppuuuuiiuu)
+GO(gtk_table_attach, vFppuuuuuuuu)
GO(gtk_table_attach_defaults, vFppuuuu)
GO(gtk_table_get_col_spacing, uFpu)
GO(gtk_table_get_default_col_spacing, uFp)
@@ -2862,7 +2884,7 @@ GO(gtk_target_list_find, iFppp)
GO(gtk_target_list_get_type, pFv)
GO(gtk_target_list_new, pFpu)
GO(gtk_target_list_ref, pFp)
-GO(gtk_target_list_remove, iFppp)
+GO(gtk_target_list_remove, vFpp)
GO(gtk_target_list_unref, vFp)
GO(gtk_targets_include_image, iFpii)
GO(gtk_targets_include_rich_text, iFpip)
@@ -2872,22 +2894,22 @@ GO(gtk_target_table_free, vFpi)
GO(gtk_target_table_new_from_list, pFpp)
GO(gtk_tearoff_menu_item_get_type, pFv)
GO(gtk_tearoff_menu_item_new, pFv)
-//GO(gtk_test_create_simple_window,
+GO(gtk_test_create_simple_window, pFpp)
//GO(gtk_test_create_widget,
//GO(gtk_test_display_button_window,
-//GO(gtk_test_find_label,
-//GO(gtk_test_find_sibling,
-//GO(gtk_test_find_widget,
+GO(gtk_test_find_label, pFpp)
+GO(gtk_test_find_sibling, pFpL)
+GO(gtk_test_find_widget, pFppL)
//GO(gtk_test_init,
-//GO(gtk_test_list_all_types,
-//GO(gtk_test_register_all_types,
-//GO(gtk_test_slider_get_value,
-//GO(gtk_test_slider_set_perc,
-//GO(gtk_test_spin_button_click,
-//GO(gtk_test_text_get,
-//GO(gtk_test_text_set,
+GO(gtk_test_list_all_types, pFp)
+GO(gtk_test_register_all_types, vFv)
+GO(gtk_test_slider_get_value, dFp)
+GO(gtk_test_slider_set_perc, vFpd)
+GO(gtk_test_spin_button_click, iFpui)
+GO(gtk_test_text_get, pFp)
+GO(gtk_test_text_set, vFpp)
//GO(gtk_test_widget_click,
-//GO(gtk_test_widget_send_key,
+GO(gtk_test_widget_send_key, iFpuu)
GO(gtk_text_anchored_child_set_layout, vFpp)
GO(gtk_text_attributes_copy, pFp)
GO(gtk_text_attributes_copy_values, vFpp)
@@ -2912,7 +2934,7 @@ GO(gtk_text_buffer_delete_interactive, iFpppi)
GO(gtk_text_buffer_delete_mark, vFpp)
GO(gtk_text_buffer_delete_mark_by_name, vFpp)
GO(gtk_text_buffer_delete_selection, iFpii)
-GO(gtk_text_buffer_deserialize, iFpppppup)
+GO(gtk_text_buffer_deserialize, iFpppppLp)
GO(gtk_text_buffer_deserialize_get_can_create_tags, iFpp)
GO(gtk_text_buffer_deserialize_set_can_create_tags, vFppi)
GO(gtk_text_buffer_end_user_action, vFp)
@@ -3143,7 +3165,7 @@ GO(gtk_text_tag_get_priority, iFp)
GO(gtk_text_tag_get_type, pFv)
GO(gtk_text_tag_new, pFp)
GO(gtk_text_tag_set_priority, vFpi)
-GO(gtk_text_tag_table_add, vFpp)
+GO(gtk_text_tag_table_add, iFpp)
//GOM(gtk_text_tag_table_foreach, vFEpBp)
GO(gtk_text_tag_table_get_size, iFp)
GO(gtk_text_tag_table_get_type, pFv)
@@ -3152,24 +3174,24 @@ GO(gtk_text_tag_table_new, pFv)
GO(gtk_text_tag_table_remove, vFpp)
GO(gtk_text_thaw, vFp)
GO(gtk_text_view_add_child_at_anchor, vFppp)
-GO(gtk_text_view_add_child_in_window, vFppiii)
+GO(gtk_text_view_add_child_in_window, vFppuii)
GO(gtk_text_view_backward_display_line, iFpp)
GO(gtk_text_view_backward_display_line_start, iFpp)
GO(gtk_text_view_buffer_to_window_coords, vFpiiipp)
GO(gtk_text_view_forward_display_line, iFpp)
GO(gtk_text_view_forward_display_line_end, iFpp)
GO(gtk_text_view_get_accepts_tab, iFp)
-GO(gtk_text_view_get_border_window_size, iFpi)
+GO(gtk_text_view_get_border_window_size, iFpu)
GO(gtk_text_view_get_buffer, pFp)
GO(gtk_text_view_get_cursor_visible, iFp)
GO(gtk_text_view_get_default_attributes, pFp)
GO(gtk_text_view_get_editable, iFp)
GO(gtk_text_view_get_hadjustment, pFp)
GO(gtk_text_view_get_indent, iFp)
-GO(gtk_text_view_get_iter_at_location, vFppii)
-GO(gtk_text_view_get_iter_at_position, vFpppii)
+GO(gtk_text_view_get_iter_at_location, iFppii)
+GO(gtk_text_view_get_iter_at_position, iFpppii)
GO(gtk_text_view_get_iter_location, vFppp)
-GO(gtk_text_view_get_justification, iFp)
+GO(gtk_text_view_get_justification, uFp)
GO(gtk_text_view_get_left_margin, iFp)
GO(gtk_text_view_get_line_at_y, vFppip)
GO(gtk_text_view_get_line_yrange, vFpppp)
@@ -3182,9 +3204,9 @@ GO(gtk_text_view_get_tabs, pFp)
GO(gtk_text_view_get_type, pFv)
GO(gtk_text_view_get_vadjustment, pFp)
GO(gtk_text_view_get_visible_rect, vFpp)
-GO(gtk_text_view_get_window, pFpi)
-GO(gtk_text_view_get_window_type, iFpp)
-GO(gtk_text_view_get_wrap_mode, iFp)
+GO(gtk_text_view_get_window, pFpu)
+GO(gtk_text_view_get_window_type, uFpp)
+GO(gtk_text_view_get_wrap_mode, uFp)
GO(gtk_text_view_im_context_filter_keypress, iFpp)
GO(gtk_text_view_move_child, vFppii)
GO(gtk_text_view_move_mark_onscreen, iFpp)
@@ -3197,12 +3219,12 @@ GO(gtk_text_view_scroll_mark_onscreen, vFpp)
GO(gtk_text_view_scroll_to_iter, iFppdidd)
GO(gtk_text_view_scroll_to_mark, vFppdidd)
GO(gtk_text_view_set_accepts_tab, vFpi)
-GO(gtk_text_view_set_border_window_size, vFpii)
+GO(gtk_text_view_set_border_window_size, vFpui)
GO(gtk_text_view_set_buffer, vFpp)
GO(gtk_text_view_set_cursor_visible, vFpi)
GO(gtk_text_view_set_editable, vFpi)
GO(gtk_text_view_set_indent, vFpi)
-GO(gtk_text_view_set_justification, vFpi)
+GO(gtk_text_view_set_justification, vFpu)
GO(gtk_text_view_set_left_margin, vFpi)
GO(gtk_text_view_set_overwrite, vFpi)
GO(gtk_text_view_set_pixels_above_lines, vFpi)
@@ -3210,9 +3232,9 @@ GO(gtk_text_view_set_pixels_below_lines, vFpi)
GO(gtk_text_view_set_pixels_inside_wrap, vFpi)
GO(gtk_text_view_set_right_margin, vFpi)
GO(gtk_text_view_set_tabs, vFpp)
-GO(gtk_text_view_set_wrap_mode, vFpi)
+GO(gtk_text_view_set_wrap_mode, vFpu)
GO(gtk_text_view_starts_display_line, iFpp)
-GO(gtk_text_view_window_to_buffer_coords, vFpiiipp)
+GO(gtk_text_view_window_to_buffer_coords, vFpuiipp)
GO(gtk_text_window_type_get_type, pFv)
//GO(gtk_theme_engine_create_rc_style,
//GO(gtk_theme_engine_get,
@@ -3227,12 +3249,12 @@ GO(gtk_tips_query_get_type, pFv)
//GO(gtk_tips_query_start_query,
//GO(gtk_tips_query_stop_query,
//GO(gtk_toggle_action_get_active,
-//GO(gtk_toggle_action_get_draw_as_radio,
+GO(gtk_toggle_action_get_draw_as_radio, iFp)
GO(gtk_toggle_action_get_type, pFv)
-//GO(gtk_toggle_action_new,
+GO(gtk_toggle_action_new, pFpppp)
//GO(gtk_toggle_action_set_active,
//GO(gtk_toggle_action_set_draw_as_radio,
-//GO(gtk_toggle_action_toggled,
+GO(gtk_toggle_action_toggled, vFp)
GO(gtk_toggle_button_get_active, iFp)
GO(gtk_toggle_button_get_inconsistent, iFp)
GO(gtk_toggle_button_get_mode, iFp)
@@ -3255,14 +3277,14 @@ GO(gtk_toolbar_append_space, vFp)
GO(gtk_toolbar_append_widget, vFpppp)
GO(gtk_toolbar_child_type_get_type, pFv)
GO(gtk_toolbar_get_drop_index, iFpii)
-GO(gtk_toolbar_get_icon_size, iFp)
+GO(gtk_toolbar_get_icon_size, uFp)
GO(gtk_toolbar_get_item_index, iFpp)
GO(gtk_toolbar_get_n_items, iFp)
GO(gtk_toolbar_get_nth_item, pFpi)
GO(gtk_toolbar_get_orientation, iFp)
-GO(gtk_toolbar_get_relief_style, iFp)
+GO(gtk_toolbar_get_relief_style, uFp)
GO(gtk_toolbar_get_show_arrow, iFp)
-GO(gtk_toolbar_get_style, iFp)
+GO(gtk_toolbar_get_style, uFp)
GO(gtk_toolbar_get_tooltips, iFp)
GO(gtk_toolbar_get_type, pFv)
GO(gtk_toolbar_insert, vFppi)
@@ -3278,10 +3300,10 @@ GO(gtk_toolbar_prepend_space, vFp)
GO(gtk_toolbar_prepend_widget, vFpppp)
GO(gtk_toolbar_remove_space, vFpi)
GO(gtk_toolbar_set_drop_highlight_item, vFppi)
-GO(gtk_toolbar_set_icon_size, vFpi)
+GO(gtk_toolbar_set_icon_size, vFpu)
GO(gtk_toolbar_set_orientation, vFpi)
GO(gtk_toolbar_set_show_arrow, vFpi)
-GO(gtk_toolbar_set_style, vFpi)
+GO(gtk_toolbar_set_style, vFpu)
GO(gtk_toolbar_set_tooltips, vFpi)
GO(gtk_toolbar_space_style_get_type, pFv)
GO(gtk_toolbar_style_get_type, pFv)
@@ -3302,119 +3324,119 @@ GO(gtk_tool_button_set_label, vFpp)
GO(gtk_tool_button_set_label_widget, vFpp)
GO(gtk_tool_button_set_stock_id, vFpp)
GO(gtk_tool_button_set_use_underline, vFpi)
-//GO(gtk_tool_item_get_ellipsize_mode,
+GO(gtk_tool_item_get_ellipsize_mode, uFp)
//GO(gtk_tool_item_get_expand,
//GO(gtk_tool_item_get_homogeneous,
-//GO(gtk_tool_item_get_icon_size,
+GO(gtk_tool_item_get_icon_size, uFp)
//GO(gtk_tool_item_get_is_important,
//GO(gtk_tool_item_get_orientation,
-//GO(gtk_tool_item_get_proxy_menu_item,
-//GO(gtk_tool_item_get_relief_style,
-//GO(gtk_tool_item_get_text_alignment,
-//GO(gtk_tool_item_get_text_orientation,
-//GO(gtk_tool_item_get_text_size_group,
-//GO(gtk_tool_item_get_toolbar_style,
+GO(gtk_tool_item_get_proxy_menu_item, pFpp)
+GO(gtk_tool_item_get_relief_style, uFp)
+GO(gtk_tool_item_get_text_alignment, fFp)
+GO(gtk_tool_item_get_text_orientation, uFp)
+GO(gtk_tool_item_get_text_size_group, pFp)
+GO(gtk_tool_item_get_toolbar_style, uFp)
GO(gtk_tool_item_get_type, pFv)
//GO(gtk_tool_item_get_use_drag_window,
//GO(gtk_tool_item_get_visible_horizontal,
//GO(gtk_tool_item_get_visible_vertical,
-//GO(gtk_tool_item_group_get_collapsed,
-//GO(gtk_tool_item_group_get_drop_item,
-//GO(gtk_tool_item_group_get_ellipsize,
-//GO(gtk_tool_item_group_get_header_relief,
-//GO(gtk_tool_item_group_get_item_position,
-//GO(gtk_tool_item_group_get_label,
-//GO(gtk_tool_item_group_get_label_widget,
-//GO(gtk_tool_item_group_get_n_items,
-//GO(gtk_tool_item_group_get_nth_item,
+GO(gtk_tool_item_group_get_collapsed, iFp)
+GO(gtk_tool_item_group_get_drop_item, pFpii)
+GO(gtk_tool_item_group_get_ellipsize, uFp)
+GO(gtk_tool_item_group_get_header_relief, uFp)
+GO(gtk_tool_item_group_get_item_position, iFpp)
+GO(gtk_tool_item_group_get_label, pFp)
+GO(gtk_tool_item_group_get_label_widget, pFp)
+GO(gtk_tool_item_group_get_n_items, uFp)
+GO(gtk_tool_item_group_get_nth_item, pFpu)
GO(gtk_tool_item_group_get_type, pFv)
//GO(gtk_tool_item_group_insert,
//GO(gtk_tool_item_group_new,
-//GO(gtk_tool_item_group_set_collapsed,
-//GO(gtk_tool_item_group_set_ellipsize,
-//GO(gtk_tool_item_group_set_header_relief,
-//GO(gtk_tool_item_group_set_item_position,
-//GO(gtk_tool_item_group_set_label,
-//GO(gtk_tool_item_group_set_label_widget,
+GO(gtk_tool_item_group_set_collapsed, vFpi)
+GO(gtk_tool_item_group_set_ellipsize, vFpu)
+GO(gtk_tool_item_group_set_header_relief, vFpu)
+GO(gtk_tool_item_group_set_item_position, vFppi)
+GO(gtk_tool_item_group_set_label, vFpp)
+GO(gtk_tool_item_group_set_label_widget, vFpp)
//GO(gtk_tool_item_new,
//GO(gtk_tool_item_rebuild_menu,
-//GO(gtk_tool_item_retrieve_proxy_menu_item,
+GO(gtk_tool_item_retrieve_proxy_menu_item, pFp)
//GO(gtk_tool_item_set_expand,
//GO(gtk_tool_item_set_homogeneous,
-//GO(gtk_tool_item_set_is_important,
-//GO(gtk_tool_item_set_proxy_menu_item,
+GO(gtk_tool_item_set_is_important, vFpi)
+GO(gtk_tool_item_set_proxy_menu_item, vFppp)
//GO(gtk_tool_item_set_tooltip,
-//GO(gtk_tool_item_set_tooltip_markup,
+GO(gtk_tool_item_set_tooltip_markup, vFpp)
//GO(gtk_tool_item_set_tooltip_text,
//GO(gtk_tool_item_set_use_drag_window,
//GO(gtk_tool_item_set_visible_horizontal,
//GO(gtk_tool_item_set_visible_vertical,
//GO(gtk_tool_item_toolbar_reconfigured,
-//GO(gtk_tool_palette_add_drag_dest,
+GO(gtk_tool_palette_add_drag_dest, vFppuuu)
GO(gtk_tool_palette_drag_targets_get_type, pFv)
-//GO(gtk_tool_palette_get_drag_item,
-//GO(gtk_tool_palette_get_drag_target_group,
+GO(gtk_tool_palette_get_drag_item, pFpp)
+GO(gtk_tool_palette_get_drag_target_group, pFv)
//GO(gtk_tool_palette_get_drag_target_item,
-//GO(gtk_tool_palette_get_drop_group,
-//GO(gtk_tool_palette_get_drop_item,
+GO(gtk_tool_palette_get_drop_group, pFpii)
+GO(gtk_tool_palette_get_drop_item, pFpii)
//GO(gtk_tool_palette_get_exclusive,
-//GO(gtk_tool_palette_get_expand,
-//GO(gtk_tool_palette_get_group_position,
+GO(gtk_tool_palette_get_expand, iFpp)
+GO(gtk_tool_palette_get_group_position, iFpp)
//GO(gtk_tool_palette_get_hadjustment,
-//GO(gtk_tool_palette_get_icon_size,
-//GO(gtk_tool_palette_get_style,
+GO(gtk_tool_palette_get_icon_size, uFp)
+GO(gtk_tool_palette_get_style, uFp)
GO(gtk_tool_palette_get_type, pFv)
-//GO(gtk_tool_palette_get_vadjustment,
+GO(gtk_tool_palette_get_vadjustment, pFp)
//GO(gtk_tool_palette_new,
-//GO(gtk_tool_palette_set_drag_source,
+GO(gtk_tool_palette_set_drag_source, vFpu)
//GO(gtk_tool_palette_set_exclusive,
-//GO(gtk_tool_palette_set_expand,
-//GO(gtk_tool_palette_set_group_position,
-//GO(gtk_tool_palette_set_icon_size,
-//GO(gtk_tool_palette_set_style,
+GO(gtk_tool_palette_set_expand, vFppi)
+GO(gtk_tool_palette_set_group_position, vFppi)
+GO(gtk_tool_palette_set_icon_size, vFpu)
+GO(gtk_tool_palette_set_style, vFpu)
//GO(gtk_tool_palette_unset_icon_size,
//GO(gtk_tool_palette_unset_style,
-//GO(gtk_tool_shell_get_ellipsize_mode,
-//GO(gtk_tool_shell_get_icon_size,
+GO(gtk_tool_shell_get_ellipsize_mode, uFp)
+GO(gtk_tool_shell_get_icon_size, uFp)
//GO(gtk_tool_shell_get_orientation,
-//GO(gtk_tool_shell_get_relief_style,
-//GO(gtk_tool_shell_get_style,
-//GO(gtk_tool_shell_get_text_alignment,
-//GO(gtk_tool_shell_get_text_orientation,
-//GO(gtk_tool_shell_get_text_size_group,
+GO(gtk_tool_shell_get_relief_style, uFp)
+GO(gtk_tool_shell_get_style, uFp)
+GO(gtk_tool_shell_get_text_alignment, fFp)
+GO(gtk_tool_shell_get_text_orientation, uFp)
+GO(gtk_tool_shell_get_text_size_group, pFp)
GO(gtk_tool_shell_get_type, pFv)
//GO(gtk_tool_shell_rebuild_menu,
GO(gtk_tooltip_get_type, pFv)
GO(gtk_tooltips_data_get, pFp)
GO(gtk_tooltips_disable, vFp)
GO(gtk_tooltips_enable, vFp)
-//GO(gtk_tooltip_set_custom,
-//GO(gtk_tooltip_set_icon,
-//GO(gtk_tooltip_set_icon_from_gicon,
-//GO(gtk_tooltip_set_icon_from_icon_name,
+GO(gtk_tooltip_set_custom, vFpp)
+GO(gtk_tooltip_set_icon, vFpp)
+GO(gtk_tooltip_set_icon_from_gicon, vFppu)
+GO(gtk_tooltip_set_icon_from_icon_name, vFppu)
//GO(gtk_tooltip_set_icon_from_stock,
//GO(gtk_tooltip_set_markup,
-//GO(gtk_tooltip_set_text,
-//GO(gtk_tooltip_set_tip_area,
+GO(gtk_tooltip_set_text, vFpp)
+GO(gtk_tooltip_set_tip_area, vFpp)
GO(gtk_tooltips_force_window, vFp)
GO(gtk_tooltips_get_info_from_tip_window, iFppp)
GO(gtk_tooltips_get_type, pFv)
GO(gtk_tooltips_new, pFv)
GO(gtk_tooltips_set_delay, vFpu)
GO(gtk_tooltips_set_tip, vFpppp)
-//GO(gtk_tooltip_trigger_tooltip_query,
+GO(gtk_tooltip_trigger_tooltip_query, vFp)
GO(gtk_tray_icon_get_type, pFv)
//GO(gtk_tree_append,
//GO(gtk_tree_child_position,
//GO(gtk_tree_clear_items,
//GO(gtk_tree_drag_dest_drag_data_received,
GO(gtk_tree_drag_dest_get_type, pFv)
-//GO(gtk_tree_drag_dest_row_drop_possible,
-//GO(gtk_tree_drag_source_drag_data_delete,
-//GO(gtk_tree_drag_source_drag_data_get,
+GO(gtk_tree_drag_dest_row_drop_possible, iFppp)
+GO(gtk_tree_drag_source_drag_data_delete, iFpp)
+GO(gtk_tree_drag_source_drag_data_get, iFppp)
GO(gtk_tree_drag_source_get_type, pFv)
//GO(gtk_tree_drag_source_row_draggable,
-//GO(gtk_tree_get_row_drag_data,
+GO(gtk_tree_get_row_drag_data, iFppp)
GO(gtk_tree_get_type, pFv)
//GO(gtk_tree_insert,
//GO(gtk_tree_item_collapse,
@@ -3430,22 +3452,22 @@ GO(gtk_tree_iter_copy, pFp)
GO(gtk_tree_iter_free, vFp)
GO(gtk_tree_iter_get_type, pFv)
//GO(gtk_tree_model_filter_clear_cache,
-//GO(gtk_tree_model_filter_convert_child_iter_to_iter,
+GO(gtk_tree_model_filter_convert_child_iter_to_iter, iFppp)
//GO(gtk_tree_model_filter_convert_child_path_to_path,
-//GO(gtk_tree_model_filter_convert_iter_to_child_iter,
-//GO(gtk_tree_model_filter_convert_path_to_child_path,
-//GO(gtk_tree_model_filter_get_model,
+GO(gtk_tree_model_filter_convert_iter_to_child_iter, vFppp)
+GO(gtk_tree_model_filter_convert_path_to_child_path, pFpp)
+GO(gtk_tree_model_filter_get_model, pFp)
GO(gtk_tree_model_filter_get_type, pFv)
-//GO(gtk_tree_model_filter_new,
+GO(gtk_tree_model_filter_new, pFpp)
//GO(gtk_tree_model_filter_refilter,
//GO(gtk_tree_model_filter_set_modify_func,
-//GO(gtk_tree_model_filter_set_visible_column,
+GO(gtk_tree_model_filter_set_visible_column, vFpi)
//GO(gtk_tree_model_filter_set_visible_func,
GO(gtk_tree_model_flags_get_type, pFv)
//GOM(gtk_tree_model_foreach, vFEpBp)
//GO2(gtk_tree_model_get, vFppV, gtk_tree_model_get_valist)
-GO(gtk_tree_model_get_column_type, iFpi)
-GO(gtk_tree_model_get_flags, iFp)
+GO(gtk_tree_model_get_column_type, LFpi)
+GO(gtk_tree_model_get_flags, uFp)
GO(gtk_tree_model_get_iter, iFppp)
GO(gtk_tree_model_get_iter_first, iFpp)
GO(gtk_tree_model_get_iter_from_string, iFppp)
@@ -3468,14 +3490,14 @@ GO(gtk_tree_model_row_has_child_toggled, vFppp)
GO(gtk_tree_model_row_inserted, vFppp)
GO(gtk_tree_model_rows_reordered, vFpppp)
//GO(gtk_tree_model_sort_clear_cache,
-//GO(gtk_tree_model_sort_convert_child_iter_to_iter,
+GO(gtk_tree_model_sort_convert_child_iter_to_iter, iFppp)
//GO(gtk_tree_model_sort_convert_child_path_to_path,
-//GO(gtk_tree_model_sort_convert_iter_to_child_iter,
-//GO(gtk_tree_model_sort_convert_path_to_child_path,
-//GO(gtk_tree_model_sort_get_model,
+GO(gtk_tree_model_sort_convert_iter_to_child_iter, vFppp)
+GO(gtk_tree_model_sort_convert_path_to_child_path, pFpp)
+GO(gtk_tree_model_sort_get_model, pFp)
GO(gtk_tree_model_sort_get_type, pFv)
-//GO(gtk_tree_model_sort_iter_is_valid,
-//GO(gtk_tree_model_sort_new_with_model,
+GO(gtk_tree_model_sort_iter_is_valid, iFpp)
+GO(gtk_tree_model_sort_new_with_model, pFp)
//GO(gtk_tree_model_sort_reset_default_sort_func,
GO(gtk_tree_model_unref_node, vFpp)
//GO(gtk_tree_new,
@@ -3515,7 +3537,7 @@ GO(gtk_tree_row_reference_reordered, vFpppp)
GO(gtk_tree_row_reference_valid, iFp)
//GO(gtk_tree_select_child,
GO(gtk_tree_selection_count_selected_rows, iFp)
-GO(gtk_tree_selection_get_mode, iFp)
+GO(gtk_tree_selection_get_mode, uFp)
GO(gtk_tree_selection_get_selected, iFppp)
GO(gtk_tree_selection_get_selected_rows, pFpp)
//GOM(gtk_tree_selection_get_select_function, BFEp)
@@ -3529,14 +3551,14 @@ GO(gtk_tree_selection_select_all, vFp)
GO(gtk_tree_selection_select_iter, vFpp)
GO(gtk_tree_selection_select_path, vFpp)
GO(gtk_tree_selection_select_range, vFppp)
-GO(gtk_tree_selection_set_mode, vFpi)
+GO(gtk_tree_selection_set_mode, vFpu)
//GOM(gtk_tree_selection_set_select_function, vFEpBpB)
GO(gtk_tree_selection_unselect_all, vFp)
GO(gtk_tree_selection_unselect_iter, vFpp)
GO(gtk_tree_selection_unselect_path, vFpp)
GO(gtk_tree_selection_unselect_range, vFppp)
//GO(gtk_tree_select_item,
-//GO(gtk_tree_set_row_drag_data,
+GO(gtk_tree_set_row_drag_data, iFppp)
//GO(gtk_tree_set_selection_mode,
//GO(gtk_tree_set_view_lines,
//GO(gtk_tree_set_view_mode,
@@ -3544,32 +3566,32 @@ GO(gtk_tree_sortable_get_sort_column_id, iFppp)
GO(gtk_tree_sortable_get_type, pFv)
GO(gtk_tree_sortable_has_default_sort_func, iFp)
GOM(gtk_tree_sortable_set_default_sort_func, vFEpppp)
-GO(gtk_tree_sortable_set_sort_column_id, vFpii)
+GO(gtk_tree_sortable_set_sort_column_id, vFpiu)
GOM(gtk_tree_sortable_set_sort_func, vFEpippp)
GO(gtk_tree_sortable_sort_column_changed, vFp)
GO(gtk_tree_store_append, vFppp)
GO(gtk_tree_store_clear, vFp)
GO(gtk_tree_store_get_type, pFv)
-//GO(gtk_tree_store_insert,
-//GO(gtk_tree_store_insert_after,
+GO(gtk_tree_store_insert, vFpppi)
+GO(gtk_tree_store_insert_after, vFpppp)
//GO(gtk_tree_store_insert_before,
//GO(gtk_tree_store_insert_with_values,
-//GO(gtk_tree_store_insert_with_valuesv,
+GO(gtk_tree_store_insert_with_valuesv, vFpppippi)
GO(gtk_tree_store_is_ancestor, iFppp)
GO(gtk_tree_store_iter_depth, iFpp)
GO(gtk_tree_store_iter_is_valid, iFpp)
-//GO(gtk_tree_store_move_after,
+GO(gtk_tree_store_move_after, vFppp)
//GO(gtk_tree_store_move_before,
GOM(gtk_tree_store_new, pFEuV)
-GO(gtk_tree_store_newv, pFup)
+GO(gtk_tree_store_newv, pFip)
GO(gtk_tree_store_prepend, vFppp)
//GO(gtk_tree_store_remove,
GO(gtk_tree_store_reorder, vFppp)
//GO2(gtk_tree_store_set, vFppV, gtk_tree_store_set_valist)
-//GO(gtk_tree_store_set_column_types,
+GO(gtk_tree_store_set_column_types, vFpip)
//GO(gtk_tree_store_set_valist, vFppp)
-//GO(gtk_tree_store_set_value,
-//GO(gtk_tree_store_set_valuesv,
+GO(gtk_tree_store_set_value, vFppip)
+GO(gtk_tree_store_set_valuesv, vFppppi)
//GO(gtk_tree_store_swap,
//GO(gtk_tree_unselect_child,
//GO(gtk_tree_unselect_item,
@@ -3594,10 +3616,10 @@ GO(gtk_tree_view_column_get_max_width, iFp)
GO(gtk_tree_view_column_get_min_width, iFp)
GO(gtk_tree_view_column_get_reorderable, iFp)
GO(gtk_tree_view_column_get_resizable, iFp)
-GO(gtk_tree_view_column_get_sizing, iFp)
+GO(gtk_tree_view_column_get_sizing, uFp)
GO(gtk_tree_view_column_get_sort_column_id, iFp)
GO(gtk_tree_view_column_get_sort_indicator, iFp)
-GO(gtk_tree_view_column_get_sort_order, iFp)
+GO(gtk_tree_view_column_get_sort_order, uFp)
GO(gtk_tree_view_column_get_spacing, iFp)
GO(gtk_tree_view_column_get_title, pFp)
GO(gtk_tree_view_column_get_tree_view, pFp)
@@ -3621,10 +3643,10 @@ GO(gtk_tree_view_column_set_max_width, vFpi)
GO(gtk_tree_view_column_set_min_width, vFpi)
GO(gtk_tree_view_column_set_reorderable, vFpi)
GO(gtk_tree_view_column_set_resizable, vFpi)
-GO(gtk_tree_view_column_set_sizing, vFpi)
-GO(gtk_tree_view_column_set_sort_column_id, iFp)
+GO(gtk_tree_view_column_set_sizing, vFpu)
+GO(gtk_tree_view_column_set_sort_column_id, vFpi)
GO(gtk_tree_view_column_set_sort_indicator, vFpi)
-GO(gtk_tree_view_column_set_sort_order, vFpi)
+GO(gtk_tree_view_column_set_sort_order, vFpu)
GO(gtk_tree_view_column_set_spacing, vFpi)
GO(gtk_tree_view_column_set_title, vFpp)
GO(gtk_tree_view_column_set_visible, vFpi)
@@ -3639,7 +3661,7 @@ GO(gtk_tree_view_convert_widget_to_tree_coords, vFpiipp)
GO(gtk_tree_view_create_row_drag_icon, pFpp)
GO(gtk_tree_view_drop_position_get_type, pFv)
GO(gtk_tree_view_enable_model_drag_dest, vFppiu)
-GO(gtk_tree_view_enable_model_drag_source, vFpipiu)
+GO(gtk_tree_view_enable_model_drag_source, vFpupiu)
GO(gtk_tree_view_expand_all, vFp)
GO(gtk_tree_view_expand_row, iFppi)
GO(gtk_tree_view_expand_to_path, vFpp)
@@ -3655,7 +3677,7 @@ GO(gtk_tree_view_get_enable_search, iFp)
GO(gtk_tree_view_get_enable_tree_lines, iFp)
GO(gtk_tree_view_get_expander_column, pFp)
GO(gtk_tree_view_get_fixed_height_mode, iFp)
-GO(gtk_tree_view_get_grid_lines, iFp)
+GO(gtk_tree_view_get_grid_lines, uFp)
GO(gtk_tree_view_get_hadjustment, pFp)
GO(gtk_tree_view_get_headers_clickable, iFp)
GO(gtk_tree_view_get_headers_visible, iFp)
@@ -3691,7 +3713,7 @@ GO(gtk_tree_view_move_column_after, vFppp)
GO(gtk_tree_view_new, pFv)
GO(gtk_tree_view_new_with_model, pFp)
GO(gtk_tree_view_remove_column, iFpp)
-GO(gtk_tree_view_row_activated, vFp)
+GO(gtk_tree_view_row_activated, vFppp)
GO(gtk_tree_view_row_expanded, iFpp)
GO(gtk_tree_view_scroll_to_cell, vFpppiff)
GO(gtk_tree_view_scroll_to_point, vFpii)
@@ -3699,12 +3721,12 @@ GO(gtk_tree_view_scroll_to_point, vFpii)
GO(gtk_tree_view_set_cursor, vFpppi)
GO(gtk_tree_view_set_cursor_on_cell, vFppppi)
//GOM(gtk_tree_view_set_destroy_count_func, vFEpBpB)
-GO(gtk_tree_view_set_drag_dest_row, vFppi)
+GO(gtk_tree_view_set_drag_dest_row, vFppu)
GO(gtk_tree_view_set_enable_search, vFpi)
GO(gtk_tree_view_set_enable_tree_lines, vFpi)
GO(gtk_tree_view_set_expander_column, vFpp)
GO(gtk_tree_view_set_fixed_height_mode, vFpi)
-GO(gtk_tree_view_set_grid_lines, vFpi)
+GO(gtk_tree_view_set_grid_lines, vFpu)
GO(gtk_tree_view_set_hadjustment, vFpp)
GO(gtk_tree_view_set_headers_clickable, vFpi)
GO(gtk_tree_view_set_headers_visible, vFpi)
@@ -3738,25 +3760,25 @@ GO(gtk_type_flags_get_values, pFi)
GO(gtk_type_init, vFi)
GO(gtk_type_new, pFi)
GOM(gtk_type_unique, iFELp)
-//GO(gtk_ui_manager_add_ui,
+GO(gtk_ui_manager_add_ui, vFpupppui)
//GO(gtk_ui_manager_add_ui_from_file,
-//GO(gtk_ui_manager_add_ui_from_string,
-//GO(gtk_ui_manager_ensure_update,
-//GO(gtk_ui_manager_get_accel_group,
-//GO(gtk_ui_manager_get_action,
-//GO(gtk_ui_manager_get_action_groups,
-//GO(gtk_ui_manager_get_add_tearoffs,
-//GO(gtk_ui_manager_get_toplevels,
+GO(gtk_ui_manager_add_ui_from_string, uFpplp)
+GO(gtk_ui_manager_ensure_update, vFp)
+GO(gtk_ui_manager_get_accel_group, pFp)
+GO(gtk_ui_manager_get_action, pFpp)
+GO(gtk_ui_manager_get_action_groups, pFp)
+GO(gtk_ui_manager_get_add_tearoffs, iFp)
+GO(gtk_ui_manager_get_toplevels, pFpu)
GO(gtk_ui_manager_get_type, pFv)
-//GO(gtk_ui_manager_get_ui,
-//GO(gtk_ui_manager_get_widget,
-//GO(gtk_ui_manager_insert_action_group,
+GO(gtk_ui_manager_get_ui, pFp)
+GO(gtk_ui_manager_get_widget, pFpp)
+GO(gtk_ui_manager_insert_action_group, vFppi)
GO(gtk_ui_manager_item_type_get_type, pFv)
-//GO(gtk_ui_manager_new,
-//GO(gtk_ui_manager_new_merge_id,
-//GO(gtk_ui_manager_remove_action_group,
-//GO(gtk_ui_manager_remove_ui,
-//GO(gtk_ui_manager_set_add_tearoffs,
+GO(gtk_ui_manager_new, pFv)
+GO(gtk_ui_manager_new_merge_id, uFp)
+GO(gtk_ui_manager_remove_action_group, vFpp)
+GO(gtk_ui_manager_remove_ui, vFpu)
+GO(gtk_ui_manager_set_add_tearoffs, vFpi)
GO(gtk_unit_get_type, pFv)
GO(gtk_update_type_get_type, pFv)
GO(gtk_vbox_get_type, pFv)
@@ -3769,14 +3791,14 @@ GO(gtk_vbutton_box_get_type, pFv)
//GO(gtk_vbutton_box_set_spacing_default,
//GO(gtk_viewport_get_bin_window,
//GO(gtk_viewport_get_hadjustment,
-//GO(gtk_viewport_get_shadow_type,
+GO(gtk_viewport_get_shadow_type, uFp)
GO(gtk_viewport_get_type, pFv)
-//GO(gtk_viewport_get_vadjustment,
-//GO(gtk_viewport_get_view_window,
-//GO(gtk_viewport_new,
+GO(gtk_viewport_get_vadjustment, pFp)
+GO(gtk_viewport_get_view_window, pFp)
+GO(gtk_viewport_new, pFpp)
//GO(gtk_viewport_set_hadjustment,
-//GO(gtk_viewport_set_shadow_type,
-//GO(gtk_viewport_set_vadjustment,
+GO(gtk_viewport_set_shadow_type, vFpu)
+GO(gtk_viewport_set_vadjustment, vFpp)
GO(gtk_visibility_get_type, pFv)
GO(gtk_volume_button_get_type, pFv)
GO(gtk_volume_button_new, pFv)
@@ -3789,10 +3811,10 @@ GO(gtk_vscale_new, pFp)
GO(gtk_vscale_new_with_range, pFddd)
GO(gtk_vscrollbar_get_type, pFv)
GO(gtk_vscrollbar_new, pFp)
-GO(gtk_vseparator_get_type, pFv)
+GO(gtk_vseparator_get_type, LFv)
GO(gtk_vseparator_new, pFv)
GO(gtk_widget_activate, iFp)
-GO(gtk_widget_add_accelerator, vFpppuii)
+GO(gtk_widget_add_accelerator, vFpppuuu)
GO(gtk_widget_add_events, vFpi)
GO(gtk_widget_add_mnemonic_label, vFpp)
GO(gtk_widget_can_activate_accel, iFpu)
@@ -3805,8 +3827,10 @@ GO(gtk_widget_class_install_style_property, vFpp)
//GOM(gtk_widget_class_install_style_property_parser, vFEppB)
GO(gtk_widget_class_list_style_properties, pFpp)
GO(gtk_widget_class_path, vFpppp)
+GO(gtk_widget_class_set_accessible_role, vFpu)
+GO(gtk_widget_class_set_accessible_type, vFpL)
//GOM(gtk_widget_class_set_connect_func, vFEpBpB)
-GO(gtk_widget_compute_expand, iFpi)
+GO(gtk_widget_compute_expand, iFpu)
GO(gtk_widget_create_pango_context, pFp)
GO(gtk_widget_create_pango_layout, pFpp)
GO(gtk_widget_destroy, vFp)
@@ -3836,7 +3860,7 @@ GO(gtk_widget_get_default_colormap, pFv)
GO(gtk_widget_get_default_direction, iFv)
GO(gtk_widget_get_default_style, pFv)
GO(gtk_widget_get_default_visual, pFv)
-GO(gtk_widget_get_direction, iFp)
+GO(gtk_widget_get_direction, uFp)
GO(gtk_widget_get_display, pFp)
GO(gtk_widget_get_double_buffered, iFp)
GO(gtk_widget_get_events, iFp)
@@ -3870,7 +3894,7 @@ GO(gtk_widget_get_preferred_width, vFppp)
GO(gtk_widget_get_preferred_width_for_height, vFpipp)
GO(gtk_widget_get_realized, iFp)
GO(gtk_widget_get_receives_default, iFp)
-GO(gtk_widget_get_request_mode, iFp)
+GO(gtk_widget_get_request_mode, uFp)
GO(gtk_widget_get_requisition, vFpp)
GO(gtk_widget_get_root_window, pFp)
GO(gtk_widget_get_scale_factor, iFp)
@@ -3879,17 +3903,17 @@ GO(gtk_widget_get_sensitive, iFp)
GO(gtk_widget_get_settings, pFp)
GO(gtk_widget_get_size_request, vFppp)
GO(gtk_widget_get_snapshot, pFpp)
-GO(gtk_widget_get_state, iFp)
+GO(gtk_widget_get_state, uFp)
GO(gtk_widget_get_style, pFp)
GO(gtk_widget_get_style_context, pFp)
-GO(gtk_widget_get_template_child, pFpip)
+GO(gtk_widget_get_template_child, pFpLp)
GO(gtk_widget_get_tooltip_markup, pFp)
GO(gtk_widget_get_tooltip_text, pFp)
GO(gtk_widget_get_tooltip_window, pFp)
GO(gtk_widget_get_toplevel, pFp)
GO(gtk_widget_get_type, pFv)
GO(gtk_widget_get_valign, iFp)
-GO(gtk_widget_get_valign_with_baseline, iFp)
+GO(gtk_widget_get_valign_with_baseline, uFp)
GO(gtk_widget_get_vexpand, iFp)
GO(gtk_widget_get_vexpand_set, iFp)
GO(gtk_widget_get_visible, iFp)
@@ -3915,13 +3939,13 @@ GO(gtk_widget_is_drawable, iFp)
GO(gtk_widget_is_focus, iFp)
GO(gtk_widget_is_sensitive, iFp)
GO(gtk_widget_is_toplevel, iFp)
-GO(gtk_widget_keynav_failed, iFpi)
+GO(gtk_widget_keynav_failed, iFpu)
GO(gtk_widget_list_accel_closures, pFp)
GO(gtk_widget_list_mnemonic_labels, pFp)
GO(gtk_widget_map, vFp)
GO(gtk_widget_measure, vFpiipppp)
GO(gtk_widget_mnemonic_activate, iFpi)
-GO(gtk_widget_modify_base, vFpip)
+GO(gtk_widget_modify_base, vFpup)
GO(gtk_widget_modify_bg, vFpip)
GO(gtk_widget_modify_cursor, vFppp)
GO(gtk_widget_modify_fg, vFpip)
@@ -3930,29 +3954,29 @@ GO(gtk_widget_modify_style, vFpp)
GO(gtk_widget_modify_text, vFpip)
GO(gtk_widget_new, pFppppppppppppp) //vaarg
GO(gtk_widget_path, vFpppp)
-GO(gtk_widget_path_append_type, iFpp)
+GO(gtk_widget_path_append_type, iFpL)
GO(gtk_widget_path_append_with_siblings, iFppu)
GO(gtk_widget_path_append_for_widget, iFpp)
GO(gtk_widget_path_copy, pFp)
GO(gtk_widget_path_free, vFp)
-GO(gtk_widget_path_get_object_type, pFp)
-GO(gtk_widget_path_has_parent, iFpp)
+GO(gtk_widget_path_get_object_type, LFp)
+GO(gtk_widget_path_has_parent, iFpL)
GO(gtk_widget_path_is_type, iFpp)
GO(gtk_widget_path_iter_add_class, vFpip)
-GO(gtk_widget_path_iter_add_region, vFpipi)
+GO(gtk_widget_path_iter_add_region, vFpipu)
GO(gtk_widget_path_iter_clear_classes, vFpi)
GO(gtk_widget_path_iter_clear_regions, vFpi)
GO(gtk_widget_path_iter_get_name, pFpi)
GO(gtk_widget_path_iter_get_object_name, pFpi)
-GO(gtk_widget_path_iter_get_object_type, pFpi)
+GO(gtk_widget_path_iter_get_object_type, LFpi)
GO(gtk_widget_path_iter_get_siblings, pFpi)
GO(gtk_widget_path_iter_get_sibling_index, uFpi)
-GO(gtk_widget_path_iter_get_state, iFpi)
+GO(gtk_widget_path_iter_get_state, uFpi)
GO(gtk_widget_path_iter_has_class, iFpip)
GO(gtk_widget_path_iter_has_name, iFpip)
-GO(gtk_widget_path_iter_has_qclass, iFpip)
+GO(gtk_widget_path_iter_has_qclass, iFpiu)
GO(gtk_widget_path_iter_has_qname, iFpip)
-GO(gtk_widget_path_iter_has_qregion, iFpipp)
+GO(gtk_widget_path_iter_has_qregion, iFpiup)
GO(gtk_widget_path_iter_has_region, iFpipp)
GO(gtk_widget_path_iter_list_classes, pFpi)
GO(gtk_widget_path_iter_list_regions, pFpi)
@@ -3960,11 +3984,11 @@ GO(gtk_widget_path_iter_remove_class, vFpip)
GO(gtk_widget_path_iter_remove_region, vFpip)
GO(gtk_widget_path_iter_set_name, vFpip)
GO(gtk_widget_path_iter_set_object_name, vFpip)
-GO(gtk_widget_path_iter_set_object_type, vFpip)
-GO(gtk_widget_path_iter_set_state, vFpii)
+GO(gtk_widget_path_iter_set_object_type, vFpiL)
+GO(gtk_widget_path_iter_set_state, vFpiu)
GO(gtk_widget_path_length, iFp)
GO(gtk_widget_path_new, pFv)
-GO(gtk_widget_path_prepend_type, vFpp)
+GO(gtk_widget_path_prepend_type, vFpL)
GO(gtk_widget_path_to_string, pFp)
GO(gtk_widget_path_ref, pFp)
GO(gtk_widget_path_unref, vFp)
@@ -3981,9 +4005,10 @@ GO(gtk_widget_queue_resize_no_redraw, vFp)
GO(gtk_widget_realize, vFp)
GO(gtk_widget_ref, pFp)
GO(gtk_widget_region_intersect, pFpp)
-GO(gtk_widget_remove_accelerator, iFppui)
+GO(gtk_widget_register_window, vFpp)
+GO(gtk_widget_remove_accelerator, iFppuu)
GO(gtk_widget_remove_mnemonic_label, vFpp)
-GO(gtk_widget_render_icon, pFppip)
+GO(gtk_widget_render_icon, pFppup)
GO(gtk_widget_reparent, vFpp)
GO(gtk_widget_reset_rc_styles, vFp)
GO(gtk_widget_reset_shapes, vFp)
@@ -4000,8 +4025,8 @@ GO(gtk_widget_set_colormap, vFpp)
GO(gtk_widget_set_composite_name, vFpp)
GO(gtk_widget_set_css_classes, vFpp)
GO(gtk_widget_set_default_colormap, vFp)
-GO(gtk_widget_set_default_direction, vFi)
-GO(gtk_widget_set_direction, vFpi)
+GO(gtk_widget_set_default_direction, vFu)
+GO(gtk_widget_set_direction, vFpu)
GO(gtk_widget_set_double_buffered, vFpi)
GO(gtk_widget_set_events, vFpi)
GO(gtk_widget_set_extension_events, vFpi)
@@ -4028,8 +4053,8 @@ GO(gtk_widget_set_redraw_on_allocate, vFpi)
GO(gtk_widget_set_scroll_adjustments, iFppp)
GO(gtk_widget_set_sensitive, vFpi)
GO(gtk_widget_set_size_request, vFpii)
-GO(gtk_widget_set_state, vFpi)
-GO(gtk_widget_set_state_flags, vFpii)
+GO(gtk_widget_set_state, vFpu)
+GO(gtk_widget_set_state_flags, vFpui)
GO(gtk_widget_set_style, vFpp)
GO(gtk_widget_class_set_template, vFpp)
GO(gtk_widget_class_set_template_from_resource, vFpp)
@@ -4038,7 +4063,7 @@ GO(gtk_widget_set_tooltip_text, vFpp)
GO(gtk_widget_set_tooltip_window, vFpp)
GO(gtk_widget_set_uposition, vFpii)
GO(gtk_widget_set_usize, vFpii)
-GO(gtk_widget_set_valign, vFpi)
+GO(gtk_widget_set_valign, vFpu)
GO(gtk_widget_set_vexpand, vFpi)
GO(gtk_widget_set_vexpand_set, vFpi)
GO(gtk_widget_set_visible, vFpi)
@@ -4068,6 +4093,7 @@ GO(gtk_window_add_embedded_xid, vFpu)
GO(gtk_window_add_mnemonic, vFpup)
GO(gtk_window_begin_move_drag, vFpiiiu)
GO(gtk_window_begin_resize_drag, vFpuiiiu)
+GO(gtk_window_close, vFp)
GO(gtk_window_deiconify, vFp)
GO(gtk_window_destroy, vFp)
GO(gtk_window_fullscreen, vFp)
@@ -4082,13 +4108,13 @@ GO(gtk_window_get_destroy_with_parent, iFp)
GO(gtk_window_get_focus, pFp)
GO(gtk_window_get_focus_on_map, iFp)
GO(gtk_window_get_frame_dimensions, vFppppp)
-GO(gtk_window_get_gravity, iFp)
+GO(gtk_window_get_gravity, uFp)
GO(gtk_window_get_group, pFp)
GO(gtk_window_get_has_frame, iFp)
GO(gtk_window_get_icon, pFp)
GO(gtk_window_get_icon_list, pFp)
GO(gtk_window_get_icon_name, pFp)
-GO(gtk_window_get_mnemonic_modifier, iFp)
+GO(gtk_window_get_mnemonic_modifier, uFp)
GO(gtk_window_get_mnemonics_visible, iFp)
GO(gtk_window_get_modal, iFp)
GO(gtk_window_get_opacity, dFp)
@@ -4102,7 +4128,7 @@ GO(gtk_window_get_skip_taskbar_hint, iFp)
GO(gtk_window_get_title, pFp)
GO(gtk_window_get_transient_for, pFp)
GO(gtk_window_get_type, pFv)
-GO(gtk_window_get_type_hint, iFp)
+GO(gtk_window_get_type_hint, uFp)
GO(gtk_window_get_urgency_hint, iFp)
GO(gtk_window_get_window_type, uFp)
GO(gtk_window_group_add_window, vFpp)
@@ -4117,9 +4143,9 @@ GO(gtk_window_iconify, vFp)
GO(gtk_window_is_active, iFp)
GO(gtk_window_list_toplevels, pFv)
GO(gtk_window_maximize, vFp)
-GO(gtk_window_mnemonic_activate, iFpui)
+GO(gtk_window_mnemonic_activate, iFpuu)
GO(gtk_window_move, vFpii)
-GO(gtk_window_new, pFi)
+GO(gtk_window_new, pFu)
GO(gtk_window_parse_geometry, iFpp)
GO(gtk_window_position_get_type, pFv)
GO(gtk_window_present, vFp)
@@ -4144,8 +4170,8 @@ GO(gtk_window_set_destroy_with_parent, vFpi)
GO(gtk_window_set_focus, vFpp)
GO(gtk_window_set_focus_on_map, vFpi)
GO(gtk_window_set_frame_dimensions, vFpiiii)
-GO(gtk_window_set_geometry_hints, vFpppi)
-GO(gtk_window_set_gravity, vFpi)
+GO(gtk_window_set_geometry_hints, vFpppu)
+GO(gtk_window_set_gravity, vFpu)
GO(gtk_window_set_has_frame, vFpi)
GO(gtk_window_set_hide_on_close, vFpi)
GO(gtk_window_set_icon, vFpp)
@@ -4154,12 +4180,12 @@ GO(gtk_window_set_icon_list, vFpp)
GO(gtk_window_set_icon_name, vFpp)
GO(gtk_window_set_keep_above, vFpi)
GO(gtk_window_set_keep_below, vFpi)
-GO(gtk_window_set_mnemonic_modifier, vFpi)
+GO(gtk_window_set_mnemonic_modifier, vFpu)
GO(gtk_window_set_mnemonics_visible, vFpi)
GO(gtk_window_set_modal, vFpi)
GO(gtk_window_set_opacity, vFpd)
GO(gtk_window_set_policy, vFpiii)
-GO(gtk_window_set_position, vFpi)
+GO(gtk_window_set_position, vFpu)
GO(gtk_window_set_resizable, vFpi)
GO(gtk_window_set_role, vFpp)
GO(gtk_window_set_screen, vFpp)
@@ -4168,7 +4194,8 @@ GO(gtk_window_set_skip_taskbar_hint, vFpi)
GO(gtk_window_set_startup_id, vFpp)
GO(gtk_window_set_title, vFpp)
GO(gtk_window_set_transient_for, vFpp)
-GO(gtk_window_set_type_hint, vFpi)
+GO(gtk_window_set_type_hint, vFpu)
+GO(gtk_window_set_titlebar, vFpp)
GO(gtk_window_set_urgency_hint, vFpi)
GO(gtk_widget_set_visual, vFpp)
GO(gtk_window_set_wmclass, vFppp)
@@ -4178,3 +4205,13 @@ GO(gtk_window_unfullscreen, vFp)
GO(gtk_window_unmaximize, vFp)
GO(gtk_window_unstick, vFp)
GO(gtk_wrap_mode_get_type, pFv)
+GO(gtk_gesture_long_press_get_type, LFv)
+GO(gtk_gesture_single_get_type, LFv)
+GO(gtk_gesture_get_type, LFv)
+GO(gtk_gesture_rotate_new, pFp)
+GO(gtk_gesture_zoom_new, pFp)
+GO(gtk_event_controller_get_type, LFv)
+GO(gtk_stack_set_visible_child_name, vFpp)
+GO(gtk_stack_get_visible_child_name, pFp)
+
+GO(dummy_iFppdd, iFppdd) // for GtkEventController wrapping
diff --git a/src/wrapped/wrappedgtkx112.c b/src/wrapped/wrappedgtkx112.c
index 4955385..462f924 100755..100644
--- a/src/wrapped/wrappedgtkx112.c
+++ b/src/wrapped/wrappedgtkx112.c
@@ -150,10 +150,10 @@ GO(39) \
// GtkMenuDetachFunc
#define GO(A) \
-static uintptr_t my_menudetach_fct_##A = 0; \
-static void my_menudetach_##A(void* widget, void* menu) \
-{ \
- RunFunction(my_context, my_menudetach_fct_##A, 2, widget, menu);\
+static uintptr_t my_menudetach_fct_##A = 0; \
+static void my_menudetach_##A(void* widget, void* menu) \
+{ \
+ RunFunctionFmt(my_menudetach_fct_##A, "pp", widget, menu); \
}
SUPER()
#undef GO
@@ -173,10 +173,10 @@ static void* findMenuDetachFct(void* fct)
// GtkMenuPositionFunc
#define GO(A) \
-static uintptr_t my_menuposition_fct_##A = 0; \
-static void my_menuposition_##A(void* menu, void* x, void* y, void* push_in, void* data) \
-{ \
- RunFunction(my_context, my_menuposition_fct_##A, 5, menu, x, y, push_in, data);\
+static uintptr_t my_menuposition_fct_##A = 0; \
+static void my_menuposition_##A(void* menu, void* x, void* y, void* push_in, void* data) \
+{ \
+ RunFunctionFmt(my_menuposition_fct_##A, "ppppp", menu, x, y, push_in, data); \
}
SUPER()
#undef GO
@@ -196,10 +196,10 @@ static void* findMenuPositionFct(void* fct)
// GtkFunction
#define GO(A) \
-static uintptr_t my_gtkfunction_fct_##A = 0; \
-static int my_gtkfunction_##A(void* data) \
-{ \
- return RunFunction(my_context, my_gtkfunction_fct_##A, 1, data);\
+static uintptr_t my_gtkfunction_fct_##A = 0; \
+static int my_gtkfunction_##A(void* data) \
+{ \
+ return RunFunctionFmt(my_gtkfunction_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -219,10 +219,10 @@ static void* findGtkFunctionFct(void* fct)
// GtkClipboardGetFunc
#define GO(A) \
-static uintptr_t my_clipboardget_fct_##A = 0; \
-static void my_clipboardget_##A(void* clipboard, void* selection, uint32_t info, void* data) \
-{ \
- RunFunction(my_context, my_clipboardget_fct_##A, 4, clipboard, selection, info, data);\
+static uintptr_t my_clipboardget_fct_##A = 0; \
+static void my_clipboardget_##A(void* clipboard, void* selection, uint32_t info, void* data) \
+{ \
+ RunFunctionFmt(my_clipboardget_fct_##A, "ppup", clipboard, selection, info, data); \
}
SUPER()
#undef GO
@@ -242,10 +242,10 @@ static void* findClipboadGetFct(void* fct)
// GtkClipboardClearFunc
#define GO(A) \
-static uintptr_t my_clipboardclear_fct_##A = 0; \
-static void my_clipboardclear_##A(void* clipboard, void* data) \
-{ \
- RunFunction(my_context, my_clipboardclear_fct_##A, 2, clipboard, data);\
+static uintptr_t my_clipboardclear_fct_##A = 0; \
+static void my_clipboardclear_##A(void* clipboard, void* data) \
+{ \
+ RunFunctionFmt(my_clipboardclear_fct_##A, "pp", clipboard, data); \
}
SUPER()
#undef GO
@@ -265,10 +265,10 @@ static void* findClipboadClearFct(void* fct)
// GtkCallback
#define GO(A) \
-static uintptr_t my_gtkcallback_fct_##A = 0; \
-static void my_gtkcallback_##A(void* widget, void* data) \
-{ \
- RunFunction(my_context, my_gtkcallback_fct_##A, 2, widget, data);\
+static uintptr_t my_gtkcallback_fct_##A = 0; \
+static void my_gtkcallback_##A(void* widget, void* data) \
+{ \
+ RunFunctionFmt(my_gtkcallback_fct_##A, "pp", widget, data); \
}
SUPER()
#undef GO
@@ -288,10 +288,10 @@ static void* findGtkCallbackFct(void* fct)
// GtkTextCharPredicate
#define GO(A) \
-static uintptr_t my_textcharpredicate_fct_##A = 0; \
-static int my_textcharpredicate_##A(uint32_t ch, void* data) \
-{ \
- return (int)RunFunction(my_context, my_textcharpredicate_fct_##A, 2, ch, data);\
+static uintptr_t my_textcharpredicate_fct_##A = 0; \
+static int my_textcharpredicate_##A(uint32_t ch, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_textcharpredicate_fct_##A, "up", ch, data); \
}
SUPER()
#undef GO
@@ -311,10 +311,10 @@ static void* findGtkTextCharPredicateFct(void* fct)
// Toolbar
#define GO(A) \
-static uintptr_t my_toolbar_fct_##A = 0; \
-static void my_toolbar_##A(void* widget, void* data) \
-{ \
- RunFunction(my_context, my_toolbar_fct_##A, 2, widget, data);\
+static uintptr_t my_toolbar_fct_##A = 0; \
+static void my_toolbar_##A(void* widget, void* data) \
+{ \
+ RunFunctionFmt(my_toolbar_fct_##A, "pp", widget, data); \
}
SUPER()
#undef GO
@@ -334,10 +334,10 @@ static void* findToolbarFct(void* fct)
// Builder
#define GO(A) \
-static uintptr_t my_builderconnect_fct_##A = 0; \
-static void my_builderconnect_##A(void* builder, void* object, void* signal, void* handler, void* connect, int flags, void* data) \
-{ \
- RunFunction(my_context, my_builderconnect_fct_##A, 7, builder, object, signal, handler, connect, flags, data);\
+static uintptr_t my_builderconnect_fct_##A = 0; \
+static void my_builderconnect_##A(void* builder, void* object, void* signal, void* handler, void* connect, int flags, void* data) \
+{ \
+ RunFunctionFmt(my_builderconnect_fct_##A, "pppppip", builder, object, signal, handler, connect, flags, data); \
}
SUPER()
#undef GO
@@ -357,10 +357,10 @@ static void* findBuilderConnectFct(void* fct)
// GtkCellLayoutDataFunc
#define GO(A) \
-static uintptr_t my_GtkCellLayoutDataFunc_fct_##A = 0; \
-static void my_GtkCellLayoutDataFunc_##A(void* layout, void* cell, void* tree, void* iter, void* data) \
-{ \
- RunFunction(my_context, my_GtkCellLayoutDataFunc_fct_##A, 5, layout, cell, tree, iter, data);\
+static uintptr_t my_GtkCellLayoutDataFunc_fct_##A = 0; \
+static void my_GtkCellLayoutDataFunc_##A(void* layout, void* cell, void* tree, void* iter, void* data) \
+{ \
+ RunFunctionFmt(my_GtkCellLayoutDataFunc_fct_##A, "ppppp", layout, cell, tree, iter, data); \
}
SUPER()
#undef GO
@@ -380,10 +380,10 @@ static void* findGtkCellLayoutDataFuncFct(void* fct)
// GtkTreeCellDataFunc
#define GO(A) \
-static uintptr_t my_GtkTreeCellDataFunc_fct_##A = 0; \
-static void my_GtkTreeCellDataFunc_##A(void* column, void* cell, void* tree, void* iter, void* data) \
-{ \
- RunFunction(my_context, my_GtkTreeCellDataFunc_fct_##A, 5, column, cell, tree, iter, data);\
+static uintptr_t my_GtkTreeCellDataFunc_fct_##A = 0; \
+static void my_GtkTreeCellDataFunc_##A(void* column, void* cell, void* tree, void* iter, void* data) \
+{ \
+ RunFunctionFmt(my_GtkTreeCellDataFunc_fct_##A, "ppppp", column, cell, tree, iter, data); \
}
SUPER()
#undef GO
@@ -404,10 +404,10 @@ static void* findGtkTreeCellDataFuncFct(void* fct)
// GDestroyNotify
#define GO(A) \
-static uintptr_t my_GDestroyNotify_fct_##A = 0; \
-static void my_GDestroyNotify_##A(void* data) \
-{ \
- RunFunction(my_context, my_GDestroyNotify_fct_##A, 1, data); \
+static uintptr_t my_GDestroyNotify_fct_##A = 0; \
+static void my_GDestroyNotify_##A(void* data) \
+{ \
+ RunFunctionFmt(my_GDestroyNotify_fct_##A, "p", data); \
}
SUPER()
#undef GO
@@ -427,10 +427,10 @@ static void* findGDestroyNotifyFct(void* fct)
// GtkTreeModelForeachFunc
#define GO(A) \
-static uintptr_t my_GtkTreeModelForeachFunc_fct_##A = 0; \
-static int my_GtkTreeModelForeachFunc_##A(void* model, void* path, void* iter, void* data) \
-{ \
- return (int)RunFunction(my_context, my_GtkTreeModelForeachFunc_fct_##A, 4, model, path, iter, data); \
+static uintptr_t my_GtkTreeModelForeachFunc_fct_##A = 0; \
+static int my_GtkTreeModelForeachFunc_##A(void* model, void* path, void* iter, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_GtkTreeModelForeachFunc_fct_##A, "pppp", model, path, iter, data); \
}
SUPER()
#undef GO
@@ -450,10 +450,10 @@ static void* findGtkTreeModelForeachFuncFct(void* fct)
// GtkTreeSelectionSelectedForeachFunc
#define GO(A) \
-static uintptr_t my_GtkTreeSelectionSelectedForeachFunc_fct_##A = 0; \
-static int my_GtkTreeSelectionSelectedForeachFunc_##A(void* selection, void* path, void* iter, void* data) \
-{ \
- return (int)RunFunction(my_context, my_GtkTreeSelectionSelectedForeachFunc_fct_##A, 4, selection, path, iter, data); \
+static uintptr_t my_GtkTreeSelectionSelectedForeachFunc_fct_##A = 0; \
+static int my_GtkTreeSelectionSelectedForeachFunc_##A(void* selection, void* path, void* iter, void* data) \
+{ \
+ return (int)RunFunctionFmt(my_GtkTreeSelectionSelectedForeachFunc_fct_##A, "pppp", selection, path, iter, data); \
}
SUPER()
#undef GO
@@ -473,10 +473,10 @@ static void* findGtkTreeSelectionSelectedForeachFuncFct(void* fct)
// GtkClipboardReceivedFunc
#define GO(A) \
-static uintptr_t my_GtkClipboardReceivedFunc_fct_##A = 0; \
-static void my_GtkClipboardReceivedFunc_##A(void* clipboard, void* sel, void* data) \
-{ \
- RunFunction(my_context, my_GtkClipboardReceivedFunc_fct_##A, 3, clipboard, sel, data); \
+static uintptr_t my_GtkClipboardReceivedFunc_fct_##A = 0; \
+static void my_GtkClipboardReceivedFunc_##A(void* clipboard, void* sel, void* data) \
+{ \
+ RunFunctionFmt(my_GtkClipboardReceivedFunc_fct_##A, "ppp", clipboard, sel, data); \
}
SUPER()
#undef GO
@@ -496,10 +496,10 @@ static void* findGtkClipboardReceivedFuncFct(void* fct)
// GtkClipboardTextReceivedFunc
#define GO(A) \
-static uintptr_t my_GtkClipboardTextReceivedFunc_fct_##A = 0; \
-static void my_GtkClipboardTextReceivedFunc_##A(void* clipboard, void* text, void* data) \
-{ \
- RunFunction(my_context, my_GtkClipboardTextReceivedFunc_fct_##A, 3, clipboard, text, data); \
+static uintptr_t my_GtkClipboardTextReceivedFunc_fct_##A = 0; \
+static void my_GtkClipboardTextReceivedFunc_##A(void* clipboard, void* text, void* data) \
+{ \
+ RunFunctionFmt(my_GtkClipboardTextReceivedFunc_fct_##A, "ppp", clipboard, text, data); \
}
SUPER()
#undef GO
@@ -519,10 +519,10 @@ static void* findGtkClipboardTextReceivedFuncFct(void* fct)
// GtkTreeViewSearchEqualFunc
#define GO(A) \
-static uintptr_t my_GtkTreeViewSearchEqualFunc_fct_##A = 0; \
-static int my_GtkTreeViewSearchEqualFunc_##A(void* model, int column, void* key, void* iter, void* data) \
-{ \
- return RunFunction(my_context, my_GtkTreeViewSearchEqualFunc_fct_##A, 5, model, column, key, iter, data); \
+static uintptr_t my_GtkTreeViewSearchEqualFunc_fct_##A = 0; \
+static int my_GtkTreeViewSearchEqualFunc_##A(void* model, int column, void* key, void* iter, void* data) \
+{ \
+ return RunFunctionFmt(my_GtkTreeViewSearchEqualFunc_fct_##A, "pippp", model, column, key, iter, data); \
}
SUPER()
#undef GO
@@ -542,10 +542,10 @@ static void* findGtkTreeViewSearchEqualFuncFct(void* fct)
// GtkTreeIterCompareFunc
#define GO(A) \
-static uintptr_t my_GtkTreeIterCompareFunc_fct_##A = 0; \
-static int my_GtkTreeIterCompareFunc_##A(void* model, void* a, void* b, void* data) \
-{ \
- return RunFunction(my_context, my_GtkTreeIterCompareFunc_fct_##A, 4, model, a, b, data); \
+static uintptr_t my_GtkTreeIterCompareFunc_fct_##A = 0; \
+static int my_GtkTreeIterCompareFunc_##A(void* model, void* a, void* b, void* data) \
+{ \
+ return RunFunctionFmt(my_GtkTreeIterCompareFunc_fct_##A, "pppp", model, a, b, data); \
}
SUPER()
#undef GO
@@ -565,10 +565,10 @@ static void* findGtkTreeIterCompareFuncFct(void* fct)
// GdkInputFunction
#define GO(A) \
-static uintptr_t my_GdkInputFunction_fct_##A = 0; \
-static void my_GdkInputFunction_##A(void* data, int source, int cond) \
-{ \
- RunFunction(my_context, my_GdkInputFunction_fct_##A, 3, data, source, cond); \
+static uintptr_t my_GdkInputFunction_fct_##A = 0; \
+static void my_GdkInputFunction_##A(void* data, int source, int cond) \
+{ \
+ RunFunctionFmt(my_GdkInputFunction_fct_##A, "pii", data, source, cond); \
}
SUPER()
#undef GO
@@ -588,10 +588,10 @@ static void* findGdkInputFunctionFct(void* fct)
// GtkCallbackMarshal
#define GO(A) \
-static uintptr_t my_GtkCallbackMarshal_fct_##A = 0; \
-static void my_GtkCallbackMarshal_##A(void* obj, void* data, uint32_t n, void* args)\
-{ \
- RunFunction(my_context, my_GtkCallbackMarshal_fct_##A, 4, obj, data, n, args); \
+static uintptr_t my_GtkCallbackMarshal_fct_##A = 0; \
+static void my_GtkCallbackMarshal_##A(void* obj, void* data, uint32_t n, void* args) \
+{ \
+ RunFunctionFmt(my_GtkCallbackMarshal_fct_##A, "ppup", obj, data, n, args); \
}
SUPER()
#undef GO
@@ -608,13 +608,79 @@ static void* findGtkCallbackMarshalFct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkCallbackMarshal callback\n");
return NULL;
}
+// GtkPrinterFunc ...
+#define GO(A) \
+static uintptr_t my_GtkPrinterFunc_fct_##A = 0; \
+static int my_GtkPrinterFunc_##A(void* a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my_GtkPrinterFunc_fct_##A, "pp", a, b); \
+}
+SUPER()
+#undef GO
+static void* find_GtkPrinterFunc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_GtkPrinterFunc_fct_##A == (uintptr_t)fct) return my_GtkPrinterFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GtkPrinterFunc_fct_##A == 0) {my_GtkPrinterFunc_fct_##A = (uintptr_t)fct; return my_GtkPrinterFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkPrinterFunc callback\n");
+ return NULL;
+}
+// GtkFileFilterFunc ...
+#define GO(A) \
+static uintptr_t my_GtkFileFilterFunc_fct_##A = 0; \
+static int my_GtkFileFilterFunc_##A(void* a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my_GtkFileFilterFunc_fct_##A, "pp", a, b); \
+}
+SUPER()
+#undef GO
+static void* find_GtkFileFilterFunc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_GtkFileFilterFunc_fct_##A == (uintptr_t)fct) return my_GtkFileFilterFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GtkFileFilterFunc_fct_##A == 0) {my_GtkFileFilterFunc_fct_##A = (uintptr_t)fct; return my_GtkFileFilterFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkFileFilterFunc callback\n");
+ return NULL;
+}
+// GtkPrintJobCompleteFunc ...
+#define GO(A) \
+static uintptr_t my_GtkPrintJobCompleteFunc_fct_##A = 0; \
+static void my_GtkPrintJobCompleteFunc_##A(void* a, void* b, void* c) \
+{ \
+ RunFunctionFmt(my_GtkPrintJobCompleteFunc_fct_##A, "ppp", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_GtkPrintJobCompleteFunc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_GtkPrintJobCompleteFunc_fct_##A == (uintptr_t)fct) return my_GtkPrintJobCompleteFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_GtkPrintJobCompleteFunc_fct_##A == 0) {my_GtkPrintJobCompleteFunc_fct_##A = (uintptr_t)fct; return my_GtkPrintJobCompleteFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkPrintJobCompleteFunc callback\n");
+ return NULL;
+}
// GtkLinkButtonUri ...
#define GO(A) \
-static uintptr_t my_GtkLinkButtonUri_fct_##A = 0; \
-static void my_GtkLinkButtonUri_##A(void* a, void* b, void* c) \
-{ \
- RunFunction(my_context, my_GtkLinkButtonUri_fct_##A, 3, a, b, c); \
+static uintptr_t my_GtkLinkButtonUri_fct_##A = 0; \
+static void my_GtkLinkButtonUri_##A(void* a, void* b, void* c) \
+{ \
+ RunFunctionFmt(my_GtkLinkButtonUri_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -767,7 +833,7 @@ EXPORT int my_gtk_clipboard_set_with_owner(x64emu_t* emu, void* clipboard, void*
static void* my_translate_func(void* path, my_signal_t* sig)
{
- return (void*)RunFunction(my_context, sig->c_handler, 2, path, sig->data);
+ return (void*)RunFunctionFmt(sig->c_handler, "pp", path, sig->data) ;
}
EXPORT void my_gtk_stock_set_translate_func(x64emu_t* emu, void* domain, void* f, void* data, void* notify)
@@ -964,7 +1030,7 @@ static void my_gtk_builder_connect_signals_custom(void* builder,
uintptr_t offs = 0;
uintptr_t end = 0;
- GetGlobalSymbolStartEnd(my_context->maplib, handler_name, &offs, &end, NULL, -1, NULL);
+ GetGlobalSymbolStartEnd(my_context->maplib, handler_name, &offs, &end, NULL, -1, NULL, NULL, NULL);
if(!offs) {
if (args->module == NULL)
args->my->g_log("Gtk", 1<<2 ,"gtk_builder_connect_signals() requires working GModule");
@@ -1100,6 +1166,24 @@ EXPORT void* my_gtk_link_button_set_uri_hook(x64emu_t* emu, void* f, void* data,
return reverse_GtkLinkButtonUri_Fct(ret);
}
+EXPORT void my_gtk_enumerate_printers(x64emu_t* emu, void* f, void* data, void* d, int wait)
+{
+ (void)emu;
+ my->gtk_enumerate_printers(find_GtkPrinterFunc_Fct(f), data, findGDestroyNotifyFct(d), wait);
+}
+
+EXPORT void my_gtk_file_filter_add_custom(x64emu_t* emu, void* filter, uint32_t needed, void* f, void* data, void* d)
+{
+ (void)emu;
+ my->gtk_file_filter_add_custom(filter, needed, find_GtkFileFilterFunc_Fct(f), data, findGDestroyNotifyFct(d));
+}
+
+EXPORT void my_gtk_print_job_send(x64emu_t* emu, void* job, void* f, void* data, void* d)
+{
+ (void)emu;
+ my->gtk_print_job_send(job, find_GtkPrintJobCompleteFunc_Fct(f), data, findGDestroyNotifyFct(d));
+}
+
#define PRE_INIT \
if(box64_nogtk) \
return -1;
diff --git a/src/wrapped/wrappedgtkx112_private.h b/src/wrapped/wrappedgtkx112_private.h
index ac0bf44..ea9c9df 100755..100644
--- a/src/wrapped/wrappedgtkx112_private.h
+++ b/src/wrapped/wrappedgtkx112_private.h
@@ -2,14 +2,14 @@
#error meh!
#endif
-//GO(gtk_about_dialog_get_artists,
+GO(gtk_about_dialog_get_artists, pFp)
//GO(gtk_about_dialog_get_authors,
//GO(gtk_about_dialog_get_comments,
//GO(gtk_about_dialog_get_copyright,
//GO(gtk_about_dialog_get_documenters,
//GO(gtk_about_dialog_get_license,
-//GO(gtk_about_dialog_get_logo,
-//GO(gtk_about_dialog_get_logo_icon_name,
+GO(gtk_about_dialog_get_logo, pFp)
+GO(gtk_about_dialog_get_logo_icon_name, pFp)
//GO(gtk_about_dialog_get_name,
//GO(gtk_about_dialog_get_program_name,
//GO(gtk_about_dialog_get_translator_credits,
@@ -17,17 +17,17 @@ GO(gtk_about_dialog_get_type, LFv)
//GO(gtk_about_dialog_get_version,
//GO(gtk_about_dialog_get_website,
//GO(gtk_about_dialog_get_website_label,
-//GO(gtk_about_dialog_get_wrap_license,
-//GO(gtk_about_dialog_new,
-//GO(gtk_about_dialog_set_artists,
+GO(gtk_about_dialog_get_wrap_license, iFp)
+GO(gtk_about_dialog_new, pFv)
+GO(gtk_about_dialog_set_artists, vFpp)
//GO(gtk_about_dialog_set_authors,
//GO(gtk_about_dialog_set_comments,
//GO(gtk_about_dialog_set_copyright,
//GO(gtk_about_dialog_set_documenters,
//GO(gtk_about_dialog_set_email_hook,
//GO(gtk_about_dialog_set_license,
-//GO(gtk_about_dialog_set_logo,
-//GO(gtk_about_dialog_set_logo_icon_name,
+GO(gtk_about_dialog_set_logo, vFpp)
+GO(gtk_about_dialog_set_logo_icon_name, vFpp)
//GO(gtk_about_dialog_set_name,
//GO(gtk_about_dialog_set_program_name,
//GO(gtk_about_dialog_set_translator_credits,
@@ -35,13 +35,13 @@ GO(gtk_about_dialog_get_type, LFv)
//GO(gtk_about_dialog_set_version,
//GO(gtk_about_dialog_set_website,
//GO(gtk_about_dialog_set_website_label,
-//GO(gtk_about_dialog_set_wrap_license,
+GO(gtk_about_dialog_set_wrap_license, vFpi)
GO(gtk_accelerator_get_default_mod_mask, uFv)
-GO(gtk_accelerator_get_label, pFui)
+GO(gtk_accelerator_get_label, pFuu)
GO(gtk_accelerator_name, pFui)
GO(gtk_accelerator_parse, vFppp)
GO(gtk_accelerator_set_default_mod_mask, vFu)
-GO(gtk_accelerator_valid, iFui)
+GO(gtk_accelerator_valid, iFuu)
GO(gtk_accel_flags_get_type, LFv)
GO(gtk_accel_group_activate, iFpppui)
GO(gtk_accel_group_connect, vFpuiip) // Closure probably needs wrapping when not null
@@ -56,7 +56,7 @@ GO(gtk_accel_group_get_type, LFv)
GO(gtk_accel_group_lock, vFp)
GO(gtk_accel_group_new, pFv)
GO(gtk_accel_group_query, pFpuip)
-GO(gtk_accel_groups_activate, iFpui)
+GO(gtk_accel_groups_activate, iFpuu)
GO(gtk_accel_groups_from_object, pFp)
GO(gtk_accel_group_unlock, vFp)
//GO(gtk_accel_label_get_accel_widget,
@@ -66,31 +66,31 @@ GO(gtk_accel_label_get_type, LFv)
//GO(gtk_accel_label_refetch,
//GO(gtk_accel_label_set_accel_closure,
//GO(gtk_accel_label_set_accel_widget,
-//GO(gtk_accel_map_add_entry,
-//GO(gtk_accel_map_add_filter,
-//GO(gtk_accel_map_change_entry,
+GO(gtk_accel_map_add_entry, vFpuu)
+GO(gtk_accel_map_add_filter, vFp)
+GO(gtk_accel_map_change_entry, iFpuui)
//GO(gtk_accel_map_foreach,
//GO(gtk_accel_map_foreach_unfiltered,
-//GO(gtk_accel_map_get,
+GO(gtk_accel_map_get, pFv)
GO(gtk_accel_map_get_type, LFv)
//GO(gtk_accel_map_load,
//GO(gtk_accel_map_load_fd,
//GO(gtk_accel_map_load_scanner,
//GO(gtk_accel_map_lock_path,
-//GO(gtk_accel_map_lookup_entry,
+GO(gtk_accel_map_lookup_entry, iFpp)
//GO(gtk_accel_map_save,
//GO(gtk_accel_map_save_fd,
//GO(gtk_accel_map_unlock_path,
-//GO(gtk_accessible_connect_widget_destroyed,
+GO(gtk_accessible_connect_widget_destroyed, vFp)
GO(gtk_accessible_get_type, LFv)
-//GO(gtk_accessible_get_widget,
-//GO(gtk_accessible_set_widget,
+GO(gtk_accessible_get_widget, pFp)
+GO(gtk_accessible_set_widget, vFpp)
GO(gtk_action_activate, vFp)
GO(gtk_action_block_activate, vFp)
GO(gtk_action_block_activate_from, vFpp)
GO(gtk_action_connect_accelerator, vFp)
GO(gtk_action_connect_proxy, vFpp)
-GO(gtk_action_create_icon, pFpi)
+GO(gtk_action_create_icon, pFpu)
GO(gtk_action_create_menu, pFp)
GO(gtk_action_create_menu_item, pFp)
GO(gtk_action_create_tool_item, pFp)
@@ -153,12 +153,12 @@ GO(gtk_action_set_visible_horizontal, vFpi)
GO(gtk_action_set_visible_vertical, vFpi)
GO(gtk_action_unblock_activate, vFp)
GO(gtk_action_unblock_activate_from, vFpp)
-//GO(gtk_activatable_do_set_related_action,
-//GO(gtk_activatable_get_related_action,
+GO(gtk_activatable_do_set_related_action, vFpp)
+GO(gtk_activatable_get_related_action, pFp)
GO(gtk_activatable_get_type, LFv)
-//GO(gtk_activatable_get_use_action_appearance,
+GO(gtk_activatable_get_use_action_appearance, iFp)
//GO(gtk_activatable_set_related_action,
-//GO(gtk_activatable_set_use_action_appearance,
+GO(gtk_activatable_set_use_action_appearance, vFpi)
//GO(gtk_activatable_sync_action_properties,
GO(gtk_adjustment_changed, vFp)
GO(gtk_adjustment_clamp_page, vFpdd)
@@ -187,49 +187,49 @@ GO(gtk_alternative_dialog_button_order, iFp)
GO(gtk_anchor_type_get_type, LFv)
GO(gtk_arg_flags_get_type, LFv)
GO(gtk_arrow_get_type, LFv)
-GO(gtk_arrow_new, pFii)
+GO(gtk_arrow_new, pFuu)
GO(gtk_arrow_placement_get_type, LFv)
-GO(gtk_arrow_set, vFpii)
+GO(gtk_arrow_set, vFpuu)
GO(gtk_arrow_type_get_type, LFv)
GO(gtk_aspect_frame_get_type, LFv)
-//GO(gtk_aspect_frame_new,
-//GO(gtk_aspect_frame_set,
+GO(gtk_aspect_frame_new, pFpfffi)
+GO(gtk_aspect_frame_set, vFpfffi)
//GO(gtk_assistant_add_action_widget,
-//GO(gtk_assistant_append_page,
-//GO(gtk_assistant_commit,
+GO(gtk_assistant_append_page, iFpp)
+GO(gtk_assistant_commit, vFp)
//GO(gtk_assistant_get_current_page,
-//GO(gtk_assistant_get_n_pages,
-//GO(gtk_assistant_get_nth_page,
-//GO(gtk_assistant_get_page_complete,
+GO(gtk_assistant_get_n_pages, iFp)
+GO(gtk_assistant_get_nth_page, pFpi)
+GO(gtk_assistant_get_page_complete, iFpp)
//GO(gtk_assistant_get_page_header_image,
-//GO(gtk_assistant_get_page_side_image,
-//GO(gtk_assistant_get_page_title,
-//GO(gtk_assistant_get_page_type,
+GO(gtk_assistant_get_page_side_image, pFpp)
+GO(gtk_assistant_get_page_title, pFpp)
+GO(gtk_assistant_get_page_type, uFpp)
GO(gtk_assistant_get_type, LFv)
-//GO(gtk_assistant_insert_page,
+GO(gtk_assistant_insert_page, iFppi)
//GO(gtk_assistant_new,
GO(gtk_assistant_page_type_get_type, LFv)
//GO(gtk_assistant_prepend_page,
-//GO(gtk_assistant_remove_action_widget,
-//GO(gtk_assistant_set_current_page,
+GO(gtk_assistant_remove_action_widget, vFpp)
+GO(gtk_assistant_set_current_page, vFpi)
//GO(gtk_assistant_set_forward_page_func,
-//GO(gtk_assistant_set_page_complete,
+GO(gtk_assistant_set_page_complete, vFppi)
//GO(gtk_assistant_set_page_header_image,
-//GO(gtk_assistant_set_page_side_image,
-//GO(gtk_assistant_set_page_title,
-//GO(gtk_assistant_set_page_type,
+GO(gtk_assistant_set_page_side_image, vFppp)
+GO(gtk_assistant_set_page_title, vFppp)
+GO(gtk_assistant_set_page_type, vFppu)
//GO(gtk_assistant_update_buttons_state,
GO(gtk_attach_options_get_type, LFv)
GOM(gtk_binding_entry_add_signal, vFEpuipuV) //vaarg
GO(gtk_binding_entry_add_signall, vFpuipp)
GO(gtk_binding_entry_clear, vFpui)
-GO(gtk_binding_entry_remove, vFpui)
+GO(gtk_binding_entry_remove, vFpuu)
GO(gtk_binding_entry_skip, vFpui)
GO(gtk_binding_parse_binding, uFp)
-GO(gtk_bindings_activate, iFpui)
+GO(gtk_bindings_activate, iFpuu)
GO(gtk_bindings_activate_event, iFpp)
-GO(gtk_binding_set_activate, iFpuip)
-GO(gtk_binding_set_add_path, vFpipi)
+GO(gtk_binding_set_activate, iFpuup)
+GO(gtk_binding_set_add_path, vFpupu)
GO(gtk_binding_set_by_class, pFp)
GO(gtk_binding_set_find, pFp)
GO(gtk_binding_set_new, pFp)
@@ -248,7 +248,7 @@ GO(gtk_box_pack_start, vFppiiu)
GO(gtk_box_pack_start_defaults, vFpp)
GO(gtk_box_query_child_packing, vFpppppp)
GO(gtk_box_reorder_child, vFppi)
-GO(gtk_box_set_child_packing, vFppiiui)
+GO(gtk_box_set_child_packing, vFppiiuu)
GO(gtk_box_set_homogeneous, vFpi)
GO(gtk_box_set_spacing, vFpi)
GO(gtk_buildable_add_child, vFpppp)
@@ -263,7 +263,7 @@ GO(gtk_buildable_parser_finished, vFpp)
GO(gtk_buildable_set_buildable_property, vFpppp)
GO(gtk_buildable_set_name, vFpp)
GO(gtk_builder_add_from_file, uFppp)
-GO(gtk_builder_add_from_string, iFppLp)
+GO(gtk_builder_add_from_string, uFppLp)
GO(gtk_builder_add_objects_from_file, uFpppp)
GO(gtk_builder_add_objects_from_string, uFppLpp)
GOM(gtk_builder_connect_signals, vFEpp)
@@ -274,21 +274,21 @@ GO(gtk_builder_get_object, pFpp)
GO(gtk_builder_get_objects, pFp)
GO(gtk_builder_get_translation_domain, pFp)
GO(gtk_builder_get_type, LFv)
-GO(gtk_builder_get_type_from_name, iFpp)
+GO(gtk_builder_get_type_from_name, LFpp)
GO(gtk_builder_new, pFv)
GO(gtk_builder_set_translation_domain, vFpp)
GO(gtk_builder_value_from_string, iFppppp)
-GO(gtk_builder_value_from_string_type, iFpippp)
+GO(gtk_builder_value_from_string_type, iFpLppp)
GO(gtk_button_action_get_type, LFv)
GO(gtk_button_box_get_child_ipadding, vFppp)
GO(gtk_button_box_get_child_secondary, iFpp)
GO(gtk_button_box_get_child_size, vFppp)
-GO(gtk_button_box_get_layout, iFp)
+GO(gtk_button_box_get_layout, uFp)
GO(gtk_button_box_get_type, LFv)
GO(gtk_button_box_set_child_ipadding, vFpii)
GO(gtk_button_box_set_child_secondary, vFppi)
GO(gtk_button_box_set_child_size, vFpii)
-GO(gtk_button_box_set_layout, vFpi)
+GO(gtk_button_box_set_layout, vFpu)
GO(gtk_button_box_style_get_type, LFv)
GO(gtk_button_clicked, vFp)
GO(gtk_button_enter, vFp)
@@ -296,9 +296,9 @@ GO(gtk_button_get_alignment, vFppp)
GO(gtk_button_get_event_window, pFp)
GO(gtk_button_get_focus_on_click, iFp)
GO(gtk_button_get_image, pFp)
-GO(gtk_button_get_image_position, iFp)
+GO(gtk_button_get_image_position, uFp)
GO(gtk_button_get_label, pFp)
-GO(gtk_button_get_relief, iFp)
+GO(gtk_button_get_relief, uFp)
GO(gtk_button_get_type, LFv)
GO(gtk_button_get_use_stock, iFp)
GO(gtk_button_get_use_underline, iFp)
@@ -312,9 +312,9 @@ GO(gtk_button_released, vFp)
GO(gtk_button_set_alignment, vFpff)
GO(gtk_button_set_focus_on_click, vFpi)
GO(gtk_button_set_image, vFpp)
-GO(gtk_button_set_image_position, vFpi)
+GO(gtk_button_set_image_position, vFpu)
GO(gtk_button_set_label, vFpp)
-GO(gtk_button_set_relief, vFpi)
+GO(gtk_button_set_relief, vFpu)
GO(gtk_button_set_use_stock, vFpi)
GO(gtk_button_set_use_underline, vFpi)
GO(gtk_buttons_type_get_type, LFv)
@@ -339,8 +339,8 @@ GO(gtk_calendar_get_type, LFv)
//GO(gtk_calendar_unmark_day,
//GO(gtk_cell_editable_editing_done,
GO(gtk_cell_editable_get_type, LFv)
-//GO(gtk_cell_editable_remove_widget,
-//GO(gtk_cell_editable_start_editing,
+GO(gtk_cell_editable_remove_widget, vFp)
+GO(gtk_cell_editable_start_editing, vFpp)
GO(gtk_cell_layout_add_attribute, vFpppi)
GO(gtk_cell_layout_clear, vFp)
GO(gtk_cell_layout_clear_attributes, vFpp)
@@ -354,7 +354,7 @@ GOM(gtk_cell_layout_set_cell_data_func, vFEppppp)
GO(gtk_cell_renderer_accel_get_type, LFv)
GO(gtk_cell_renderer_accel_mode_get_type, LFv)
GO(gtk_cell_renderer_accel_new, pFv)
-GO(gtk_cell_renderer_activate, iFppppppi)
+GO(gtk_cell_renderer_activate, iFppppppu)
GO(gtk_cell_renderer_combo_get_type, LFv)
GO(gtk_cell_renderer_combo_new, pFv)
GO(gtk_cell_renderer_editing_canceled, vFp)
@@ -370,7 +370,7 @@ GO(gtk_cell_renderer_pixbuf_get_type, LFv)
GO(gtk_cell_renderer_pixbuf_new, pFv)
GO(gtk_cell_renderer_progress_get_type, LFv)
GO(gtk_cell_renderer_progress_new, pFv)
-GO(gtk_cell_renderer_render, vFppppppi)
+GO(gtk_cell_renderer_render, vFppppppu)
GO(gtk_cell_renderer_set_alignment, vFpff)
GO(gtk_cell_renderer_set_fixed_size, vFpii)
GO(gtk_cell_renderer_set_padding, vFpii)
@@ -380,7 +380,7 @@ GO(gtk_cell_renderer_spin_get_type, LFv)
GO(gtk_cell_renderer_spinner_get_type, LFv)
GO(gtk_cell_renderer_spinner_new, pFv)
GO(gtk_cell_renderer_spin_new, pFv)
-GO(gtk_cell_renderer_start_editing, pFppppppi)
+GO(gtk_cell_renderer_start_editing, pFppppppu)
GO(gtk_cell_renderer_state_get_type, LFv)
GO(gtk_cell_renderer_stop_editing, vFpi)
GO(gtk_cell_renderer_text_get_type, LFv)
@@ -395,18 +395,18 @@ GO(gtk_cell_renderer_toggle_set_activatable, vFpi)
GO(gtk_cell_renderer_toggle_set_active, vFpi)
GO(gtk_cell_renderer_toggle_set_radio, vFpi)
GO(gtk_cell_type_get_type, LFv)
-//GO(gtk_cell_view_get_cell_renderers,
-//GO(gtk_cell_view_get_displayed_row,
-//GO(gtk_cell_view_get_model,
-//GO(gtk_cell_view_get_size_of_row,
+GO(gtk_cell_view_get_cell_renderers, pFp)
+GO(gtk_cell_view_get_displayed_row, pFp)
+GO(gtk_cell_view_get_model, pFp)
+GO(gtk_cell_view_get_size_of_row, iFppp)
GO(gtk_cell_view_get_type, LFv)
//GO(gtk_cell_view_new,
//GO(gtk_cell_view_new_with_markup,
-//GO(gtk_cell_view_new_with_pixbuf,
+GO(gtk_cell_view_new_with_pixbuf, pFp)
//GO(gtk_cell_view_new_with_text,
-//GO(gtk_cell_view_set_background_color,
-//GO(gtk_cell_view_set_displayed_row,
-//GO(gtk_cell_view_set_model,
+GO(gtk_cell_view_set_background_color, vFpp)
+GO(gtk_cell_view_set_displayed_row, vFpp)
+GO(gtk_cell_view_set_model, vFpp)
GO(gtk_check_button_get_type, LFv)
GO(gtk_check_button_new, pFv)
GO(gtk_check_button_new_with_label, pFp)
@@ -436,7 +436,7 @@ GOM(gtk_clipboard_request_contents, vFEpppp)
//GOM(gtk_clipboard_request_targets, vFEppp)
GOM(gtk_clipboard_request_text, vFEppp)
//GOM(gtk_clipboard_request_uris, vFEppp)
-GO(gtk_clipboard_set_can_store, vFppp)
+GO(gtk_clipboard_set_can_store, vFppi)
GO(gtk_clipboard_set_image, vFpp)
GO(gtk_clipboard_set_text, vFppi)
GOM(gtk_clipboard_set_with_data, iFEppuppp)
@@ -563,7 +563,7 @@ GO(gtk_color_selection_set_has_opacity_control, vFpi)
GO(gtk_color_selection_set_has_palette, vFpi)
GO(gtk_color_selection_set_previous_alpha, vFpW)
GO(gtk_color_selection_set_previous_color, vFpp)
-GO(gtk_color_selection_set_update_policy, vFpi)
+GO(gtk_color_selection_set_update_policy, vFpu)
GO(gtk_combo_box_append_text, vFpp)
GO(gtk_combo_box_entry_get_text_column, iFp)
GO(gtk_combo_box_entry_get_type, LFv)
@@ -575,7 +575,7 @@ GO(gtk_combo_box_get_active, iFp)
GO(gtk_combo_box_get_active_iter, iFpp)
GO(gtk_combo_box_get_active_text, pFp)
GO(gtk_combo_box_get_add_tearoffs, iFp)
-GO(gtk_combo_box_get_button_sensitivity, iFp)
+GO(gtk_combo_box_get_button_sensitivity, uFp)
GO(gtk_combo_box_get_column_span_column, iFp)
GO(gtk_combo_box_get_entry_text_column, iFp)
GO(gtk_combo_box_get_focus_on_click, iFp)
@@ -600,7 +600,7 @@ GO(gtk_combo_box_remove_text, vFpi)
GO(gtk_combo_box_set_active, vFpi)
GO(gtk_combo_box_set_active_iter, vFpp)
GO(gtk_combo_box_set_add_tearoffs, vFpi)
-GO(gtk_combo_box_set_button_sensitivity, vFpi)
+GO(gtk_combo_box_set_button_sensitivity, vFpu)
GO(gtk_combo_box_set_column_span_column, vFpi)
GO(gtk_combo_box_set_entry_text_column, vFpi)
GO(gtk_combo_box_set_focus_on_click, vFpi)
@@ -610,13 +610,13 @@ GO(gtk_combo_box_set_row_span_column, vFpi)
GO(gtk_combo_box_set_title, vFpp)
GO(gtk_combo_box_set_wrap_width, vFpi)
//GO(gtk_combo_box_text_append_text,
-//GO(gtk_combo_box_text_get_active_text,
+GO(gtk_combo_box_text_get_active_text, pFp)
GO(gtk_combo_box_text_get_type, LFv)
-//GO(gtk_combo_box_text_insert_text,
+GO(gtk_combo_box_text_insert_text, vFpip)
//GO(gtk_combo_box_text_new,
//GO(gtk_combo_box_text_new_with_entry,
-//GO(gtk_combo_box_text_prepend_text,
-//GO(gtk_combo_box_text_remove,
+GO(gtk_combo_box_text_prepend_text, vFpp)
+GO(gtk_combo_box_text_remove, vFpi)
GO(gtk_combo_disable_activate, vFp)
GO(gtk_combo_get_type, LFv)
GO(gtk_combo_new, pFv)
@@ -635,7 +635,7 @@ GO(gtk_container_child_get_property, vFpppp)
//GO2(gtk_container_child_set, vFpppV, gtk_container_child_set_valist)
GO(gtk_container_child_set_property, vFpppp)
//GO(gtk_container_child_set_valist, vFpppA)
-GO(gtk_container_child_type, iFp)
+GO(gtk_container_child_type, LFp)
GO(gtk_container_class_find_child_property, pFpp)
GO(gtk_container_class_install_child_property, vFpup)
GO(gtk_container_class_list_child_properties, pFpp)
@@ -648,7 +648,7 @@ GO(gtk_container_get_focus_chain, iFpp)
GO(gtk_container_get_focus_child, pFp)
GO(gtk_container_get_focus_hadjustment, pFp)
GO(gtk_container_get_focus_vadjustment, pFp)
-GO(gtk_container_get_resize_mode, iFp)
+GO(gtk_container_get_resize_mode, uFp)
GO(gtk_container_get_type, LFv)
GO(gtk_container_propagate_expose, vFppp)
GO(gtk_container_remove, vFpp)
@@ -658,8 +658,8 @@ GO(gtk_container_set_focus_chain, vFpp)
GO(gtk_container_set_focus_child, vFpp)
GO(gtk_container_set_focus_hadjustment, vFpp)
GO(gtk_container_set_focus_vadjustment, vFpp)
-GO(gtk_container_set_reallocate_redraws, vFpp)
-GO(gtk_container_set_resize_mode, vFpi)
+GO(gtk_container_set_reallocate_redraws, vFpi)
+GO(gtk_container_set_resize_mode, vFpu)
GO(gtk_container_unset_focus_chain, vFp)
GO(gtk_corner_type_get_type, LFv)
//GO(gtk_ctree_collapse,
@@ -687,8 +687,8 @@ GO(gtk_ctree_get_type, LFv)
//GO(gtk_ctree_last,
GO(gtk_ctree_line_style_get_type, LFv)
//GO(gtk_ctree_move,
-//GO(gtk_ctree_new,
-//GO(gtk_ctree_new_with_titles,
+GO(gtk_ctree_new, pFii)
+GO(gtk_ctree_new_with_titles, pFiip)
//GO(gtk_ctree_node_get_cell_style,
//GO(gtk_ctree_node_get_cell_type,
//GO(gtk_ctree_node_get_pixmap,
@@ -738,7 +738,7 @@ GO(gtk_curve_get_type, LFv)
GO(gtk_curve_get_vector, vFpip)
GO(gtk_curve_new, pFv)
GO(gtk_curve_reset, vFp)
-GO(gtk_curve_set_curve_type, vFpi)
+GO(gtk_curve_set_curve_type, vFpu)
GO(gtk_curve_set_gamma, vFpf)
GO(gtk_curve_set_range, vFpffff)
GO(gtk_curve_set_vector, vFpip)
@@ -772,7 +772,7 @@ GO(gtk_dialog_set_has_separator, vFpi)
GO(gtk_dialog_set_response_sensitive, vFpii)
GO(gtk_direction_type_get_type, LFv)
GO(gtk_disable_setlocale, vFv)
-GO(gtk_drag_begin, pFppiip)
+GO(gtk_drag_begin, pFppuip)
GO(gtk_drag_check_threshold, iFpiiii)
GO(gtk_drag_dest_add_image_targets, vFp)
GO(gtk_drag_dest_add_text_targets, vFp)
@@ -780,8 +780,8 @@ GO(gtk_drag_dest_add_uri_targets, vFp)
GO(gtk_drag_dest_find_target, pFppp)
GO(gtk_drag_dest_get_target_list, pFp)
GO(gtk_drag_dest_get_track_motion, iFp)
-GO(gtk_drag_dest_set, vFpipii)
-GO(gtk_drag_dest_set_proxy, vFppii)
+GO(gtk_drag_dest_set, vFpupiu)
+GO(gtk_drag_dest_set_proxy, vFppui)
GO(gtk_drag_dest_set_target_list, vFpp)
GO(gtk_drag_dest_set_track_motion, vFpi)
GO(gtk_drag_dest_unset, vFp)
@@ -801,7 +801,7 @@ GO(gtk_drag_source_add_image_targets, vFp)
GO(gtk_drag_source_add_text_targets, vFp)
GO(gtk_drag_source_add_uri_targets, vFp)
GO(gtk_drag_source_get_target_list, pFp)
-GO(gtk_drag_source_set, vFpipii)
+GO(gtk_drag_source_set, vFpupiu)
GO(gtk_drag_source_set_icon, vFpppp)
GO(gtk_drag_source_set_icon_name, vFpp)
GO(gtk_drag_source_set_icon_pixbuf, vFpp)
@@ -809,31 +809,31 @@ GO(gtk_drag_source_set_icon_stock, vFpp)
GO(gtk_drag_source_set_target_list, vFpp)
GO(gtk_drag_source_unset, vFp)
GO(gtk_drag_unhighlight, vFp)
-GO(gtk_draw_arrow, vFppiiiiiiii)
+GO(gtk_draw_arrow, vFppuuuiiiii)
GO(gtk_draw_box, vFppiiiiii)
-GO(gtk_draw_box_gap, vFppiiiiiiiii)
+GO(gtk_draw_box_gap, vFppuuiiiiuii)
GO(gtk_draw_check, vFppiiiiii)
GO(gtk_draw_diamond, vFppiiiiii)
-GO(gtk_draw_expander, vFppiiii)
-GO(gtk_draw_extension, vFppiiiiiii)
+GO(gtk_draw_expander, vFppuiiu)
+GO(gtk_draw_extension, vFppuuiiiiu)
GO(gtk_draw_flat_box, vFppiiiiii)
GO(gtk_draw_focus, vFppiiii)
-GO(gtk_draw_handle, vFppiiiiiii)
+GO(gtk_draw_handle, vFppuuiiiiu)
GO(gtk_draw_hline, vFppiiii)
GO(gtk_drawing_area_get_type, LFv)
GO(gtk_drawing_area_new, pFv)
GO(gtk_drawing_area_size, vFpii)
-GO(gtk_draw_insertion_cursor, vFppppiii)
-GO(gtk_draw_layout, vFppiiiip)
+GO(gtk_draw_insertion_cursor, vFppppiui)
+GO(gtk_draw_layout, vFppuiiip)
GO(gtk_draw_option, vFppiiiiii)
-GO(gtk_draw_polygon, vFppiipii)
-GO(gtk_draw_resize_grip, vFppiiiiii)
+GO(gtk_draw_polygon, vFppuupii)
+GO(gtk_draw_resize_grip, vFppuuiiii)
GO(gtk_draw_shadow, vFppiiiiii)
GO(gtk_draw_shadow_gap, vFppiiiiiiiii)
GO(gtk_draw_slider, vFppiiiiiii)
-GO(gtk_draw_string, vFppiiip)
-GO(gtk_draw_tab, vFppiiiiii)
-GO(gtk_draw_vline, vFppiiii)
+GO(gtk_draw_string, vFppuiip)
+GO(gtk_draw_tab, vFppuuiiii)
+GO(gtk_draw_vline, vFppuiii)
GO(gtk_editable_copy_clipboard, vFp)
GO(gtk_editable_cut_clipboard, vFp)
GO(gtk_editable_delete_selection, vFp)
@@ -849,115 +849,115 @@ GO(gtk_editable_select_region, vFpii)
GO(gtk_editable_set_editable, vFpi)
GO(gtk_editable_set_position, vFpi)
GO(gtk_entry_append_text, vFpp)
-//GO(gtk_entry_buffer_delete_text,
-//GO(gtk_entry_buffer_emit_deleted_text,
-//GO(gtk_entry_buffer_emit_inserted_text,
-//GO(gtk_entry_buffer_get_bytes,
-//GO(gtk_entry_buffer_get_length,
-//GO(gtk_entry_buffer_get_max_length,
-//GO(gtk_entry_buffer_get_text,
+GO(gtk_entry_buffer_delete_text, uFpui)
+GO(gtk_entry_buffer_emit_deleted_text, vFpuu)
+GO(gtk_entry_buffer_emit_inserted_text, vFpupu)
+GO(gtk_entry_buffer_get_bytes, LFp)
+GO(gtk_entry_buffer_get_length, uFp)
+GO(gtk_entry_buffer_get_max_length, iFp)
+GO(gtk_entry_buffer_get_text, pFp)
GO(gtk_entry_buffer_get_type, LFv)
-//GO(gtk_entry_buffer_insert_text,
-//GO(gtk_entry_buffer_new,
-//GO(gtk_entry_buffer_set_max_length,
-//GO(gtk_entry_buffer_set_text,
+GO(gtk_entry_buffer_insert_text, uFpupi)
+GO(gtk_entry_buffer_new, pFpi)
+GO(gtk_entry_buffer_set_max_length, vFpi)
+GO(gtk_entry_buffer_set_text, vFppi)
//GO(gtk_entry_completion_complete,
//GO(gtk_entry_completion_delete_action,
-//GO(gtk_entry_completion_get_completion_prefix,
-//GO(gtk_entry_completion_get_entry,
+GO(gtk_entry_completion_get_completion_prefix, pFp)
+GO(gtk_entry_completion_get_entry, pFp)
//GO(gtk_entry_completion_get_inline_completion,
//GO(gtk_entry_completion_get_inline_selection,
//GO(gtk_entry_completion_get_minimum_key_length,
-//GO(gtk_entry_completion_get_model,
+GO(gtk_entry_completion_get_model, pFp)
//GO(gtk_entry_completion_get_popup_completion,
//GO(gtk_entry_completion_get_popup_set_width,
-//GO(gtk_entry_completion_get_popup_single_match,
-//GO(gtk_entry_completion_get_text_column,
+GO(gtk_entry_completion_get_popup_single_match, iFp)
+GO(gtk_entry_completion_get_text_column, iFp)
GO(gtk_entry_completion_get_type, LFv)
-//GO(gtk_entry_completion_insert_action_markup,
+GO(gtk_entry_completion_insert_action_markup, vFpip)
//GO(gtk_entry_completion_insert_action_text,
-//GO(gtk_entry_completion_insert_prefix,
-//GO(gtk_entry_completion_new,
+GO(gtk_entry_completion_insert_prefix, vFp)
+GO(gtk_entry_completion_new, pFv)
//GO(gtk_entry_completion_set_inline_completion,
//GO(gtk_entry_completion_set_inline_selection,
//GO(gtk_entry_completion_set_match_func,
//GO(gtk_entry_completion_set_minimum_key_length,
-//GO(gtk_entry_completion_set_model,
+GO(gtk_entry_completion_set_model, vFpp)
//GO(gtk_entry_completion_set_popup_completion,
//GO(gtk_entry_completion_set_popup_set_width,
-//GO(gtk_entry_completion_set_popup_single_match,
-//GO(gtk_entry_completion_set_text_column,
+GO(gtk_entry_completion_set_popup_single_match, vFpi)
+GO(gtk_entry_completion_set_text_column, vFpi)
GO(gtk_entry_get_activates_default, iFp)
GO(gtk_entry_get_alignment, fFp)
-//GO(gtk_entry_get_buffer,
-//GO(gtk_entry_get_completion,
-//GO(gtk_entry_get_current_icon_drag_source,
-//GO(gtk_entry_get_cursor_hadjustment,
+GO(gtk_entry_get_buffer, pFp)
+GO(gtk_entry_get_completion, pFp)
+GO(gtk_entry_get_current_icon_drag_source, iFp)
+GO(gtk_entry_get_cursor_hadjustment, pFp)
GO(gtk_entry_get_has_frame, iFp)
//GO(gtk_entry_get_icon_activatable,
-//GO(gtk_entry_get_icon_at_pos,
-//GO(gtk_entry_get_icon_gicon,
-//GO(gtk_entry_get_icon_name,
-//GO(gtk_entry_get_icon_pixbuf,
-//GO(gtk_entry_get_icon_sensitive,
+GO(gtk_entry_get_icon_at_pos, iFpii)
+GO(gtk_entry_get_icon_gicon, pFpu)
+GO(gtk_entry_get_icon_name, pFpu)
+GO(gtk_entry_get_icon_pixbuf, pFpu)
+GO(gtk_entry_get_icon_sensitive, iFpu)
//GO(gtk_entry_get_icon_stock,
-//GO(gtk_entry_get_icon_storage_type,
-//GO(gtk_entry_get_icon_tooltip_markup,
+GO(gtk_entry_get_icon_storage_type, uFpu)
+GO(gtk_entry_get_icon_tooltip_markup, pFpu)
//GO(gtk_entry_get_icon_tooltip_text,
-//GO(gtk_entry_get_icon_window,
+GO(gtk_entry_get_icon_window, pFpu)
GO(gtk_entry_get_inner_border, pFp)
-//GO(gtk_entry_get_invisible_char,
+GO(gtk_entry_get_invisible_char, uFp)
GO(gtk_entry_get_layout, pFp)
GO(gtk_entry_get_layout_offsets, vFppp)
//GO(gtk_entry_get_max_length,
GO(gtk_entry_get_overwrite_mode, iFp)
//GO(gtk_entry_get_progress_fraction,
-//GO(gtk_entry_get_progress_pulse_step,
+GO(gtk_entry_get_progress_pulse_step, dFp)
GO(gtk_entry_get_text, pFp)
GO(gtk_entry_get_text_length, WFp)
-//GO(gtk_entry_get_text_window,
+GO(gtk_entry_get_text_window, pFp)
GO(gtk_entry_get_type, LFv)
//GO(gtk_entry_get_visibility,
GO(gtk_entry_get_width_chars, iFp)
GO(gtk_entry_icon_position_get_type, LFv)
-//GO(gtk_entry_im_context_filter_keypress,
+GO(gtk_entry_im_context_filter_keypress, iFpp)
//GO(gtk_entry_layout_index_to_text_index,
GO(gtk_entry_new, pFv)
GO(gtk_entry_new_with_buffer, pFp)
GO(gtk_entry_new_with_max_length, pFi)
GO(gtk_entry_prepend_text, vFpp)
//GO(gtk_entry_progress_pulse,
-//GO(gtk_entry_reset_im_context,
+GO(gtk_entry_reset_im_context, vFp)
GO(gtk_entry_select_region, vFpii)
GO(gtk_entry_set_activates_default, vFpi)
GO(gtk_entry_set_alignment, vFpf)
GO(gtk_entry_set_buffer, vFpp)
-//GO(gtk_entry_set_completion,
-//GO(gtk_entry_set_cursor_hadjustment,
+GO(gtk_entry_set_completion, vFpp)
+GO(gtk_entry_set_cursor_hadjustment, vFpp)
GO(gtk_entry_set_editable, vFpi)
GO(gtk_entry_set_has_frame, vFpi)
//GO(gtk_entry_set_icon_activatable,
-//GO(gtk_entry_set_icon_drag_source,
-//GO(gtk_entry_set_icon_from_gicon,
+GO(gtk_entry_set_icon_drag_source, vFpupu)
+GO(gtk_entry_set_icon_from_gicon, vFpup)
//GO(gtk_entry_set_icon_from_icon_name,
-//GO(gtk_entry_set_icon_from_pixbuf,
+GO(gtk_entry_set_icon_from_pixbuf, vFpup)
//GO(gtk_entry_set_icon_from_stock,
-//GO(gtk_entry_set_icon_sensitive,
-//GO(gtk_entry_set_icon_tooltip_markup,
+GO(gtk_entry_set_icon_sensitive, vFpui)
+GO(gtk_entry_set_icon_tooltip_markup, vFpup)
//GO(gtk_entry_set_icon_tooltip_text,
GO(gtk_entry_set_inner_border, vFpp)
-GO(gtk_entry_set_invisible_char, vFp)
+GO(gtk_entry_set_invisible_char, vFpu)
GO(gtk_entry_set_max_length, vFpi)
GO(gtk_entry_set_overwrite_mode, vFpi)
GO(gtk_entry_set_position, vFpi)
//GO(gtk_entry_set_progress_fraction,
-//GO(gtk_entry_set_progress_pulse_step,
+GO(gtk_entry_set_progress_pulse_step, vFpd)
GO(gtk_entry_set_text, vFpp)
GO(gtk_entry_set_visibility, vFpi)
GO(gtk_entry_set_width_chars, uFp)
-//GO(gtk_entry_text_index_to_layout_index,
+GO(gtk_entry_text_index_to_layout_index, iFpi)
//GO(gtk_entry_unset_invisible_char,
-//GO(gtk_enumerate_printers,
+GOM(gtk_enumerate_printers, vFEpppi)
GO(gtk_event_box_get_above_child, iFp)
GO(gtk_event_box_get_type, LFv)
GO(gtk_event_box_get_visible_window, iFp)
@@ -993,8 +993,8 @@ GO(gtk_file_chooser_button_get_focus_on_click, iFp)
GO(gtk_file_chooser_button_get_title, pFp)
GO(gtk_file_chooser_button_get_type, LFv)
GO(gtk_file_chooser_button_get_width_chars, iFp)
-GO(gtk_file_chooser_button_new, pFpi)
-GO(gtk_file_chooser_button_new_with_backend, pFpip)
+GO(gtk_file_chooser_button_new, pFpu)
+GO(gtk_file_chooser_button_new_with_backend, pFpup)
GO(gtk_file_chooser_button_new_with_dialog, pFp)
GO(gtk_file_chooser_button_set_focus_on_click, vFpi)
GO(gtk_file_chooser_button_set_title, vFpp)
@@ -1005,7 +1005,7 @@ GO(gtk_file_chooser_dialog_new, pFppipipipipipipip) // vaargs (so pFppipV) with
GO(gtk_file_chooser_dialog_new_with_backend, pFppippipipipipipip) // same but pFppippV
GO(gtk_file_chooser_error_get_type, LFv)
GO(gtk_file_chooser_error_quark, pFv)
-GO(gtk_file_chooser_get_action, iFp)
+GO(gtk_file_chooser_get_action, uFp)
GO(gtk_file_chooser_get_create_folders, iFp)
GO(gtk_file_chooser_get_current_folder, pFp)
GO(gtk_file_chooser_get_current_folder_file, pFp)
@@ -1039,7 +1039,7 @@ GO(gtk_file_chooser_select_all, vFp)
GO(gtk_file_chooser_select_file, iFppp)
GO(gtk_file_chooser_select_filename, iFpp)
GO(gtk_file_chooser_select_uri, iFpp)
-GO(gtk_file_chooser_set_action, vFpi)
+GO(gtk_file_chooser_set_action, vFpu)
GO(gtk_file_chooser_set_create_folders, vFpi)
GO(gtk_file_chooser_set_current_folder, iFpp)
GO(gtk_file_chooser_set_current_folder_file, iFppp)
@@ -1062,16 +1062,16 @@ GO(gtk_file_chooser_unselect_file, vFpp)
GO(gtk_file_chooser_unselect_filename, vFpp)
GO(gtk_file_chooser_unselect_uri, vFpp)
GO(gtk_file_chooser_widget_get_type, LFv)
-GO(gtk_file_chooser_widget_new, pFi)
-GO(gtk_file_chooser_widget_new_with_backend, pFip)
-//GOM(gtk_file_filter_add_custom, vFEppppp)
+GO(gtk_file_chooser_widget_new, pFu)
+GO(gtk_file_chooser_widget_new_with_backend, pFup)
+GOM(gtk_file_filter_add_custom, vFEpuppp)
//GO(gtk_file_filter_add_mime_type, vFpp)
GO(gtk_file_filter_add_pattern, vFpp)
GO(gtk_file_filter_add_pixbuf_formats, vFp)
GO(gtk_file_filter_filter, iFpp)
GO(gtk_file_filter_flags_get_type, LFv)
GO(gtk_file_filter_get_name, pFp)
-GO(gtk_file_filter_get_needed, iFp)
+GO(gtk_file_filter_get_needed, uFp)
GO(gtk_file_filter_get_type, LFv)
GO(gtk_file_filter_new, pFv)
GO(gtk_file_filter_set_name, vFpp)
@@ -1115,7 +1115,7 @@ GO(gtk_font_selection_dialog_get_ok_button, pFp)
GO(gtk_font_selection_dialog_get_preview_text, pFp)
GO(gtk_font_selection_dialog_get_type, LFv)
GO(gtk_font_selection_dialog_new, pFp)
-GO(gtk_font_selection_dialog_set_font_name, vFpp)
+GO(gtk_font_selection_dialog_set_font_name, iFpp)
GO(gtk_font_selection_dialog_set_preview_text, vFpp)
GO(gtk_font_selection_get_face, pFp)
GO(gtk_font_selection_get_face_list, pFp)
@@ -1135,13 +1135,13 @@ GO(gtk_font_selection_set_preview_text, vFpp)
GO(gtk_frame_get_label, pFp)
GO(gtk_frame_get_label_align, vFppp)
GO(gtk_frame_get_label_widget, pFp)
-GO(gtk_frame_get_shadow_type, iFp)
+GO(gtk_frame_get_shadow_type, uFp)
GO(gtk_frame_get_type, LFv)
GO(gtk_frame_new, pFp)
GO(gtk_frame_set_label, vFpp)
GO(gtk_frame_set_label_align, vFpff)
GO(gtk_frame_set_label_widget, vFpp)
-GO(gtk_frame_set_shadow_type, vFpi)
+GO(gtk_frame_set_shadow_type, vFpu)
GO(gtk_gamma_curve_get_type, LFv)
GO(gtk_gamma_curve_new, pFv)
GO(gtk_gc_get, pFippu)
@@ -1157,13 +1157,13 @@ GO(gtk_grab_get_current, pFv)
GO(gtk_grab_remove, vFp)
GO(gtk_handle_box_get_child_detached, iFp)
GO(gtk_handle_box_get_handle_position, iFp)
-GO(gtk_handle_box_get_shadow_type, iFp)
-GO(gtk_handle_box_get_snap_edge, iFp)
+GO(gtk_handle_box_get_shadow_type, uFp)
+GO(gtk_handle_box_get_snap_edge, uFp)
GO(gtk_handle_box_get_type, LFv)
GO(gtk_handle_box_new, pFv)
GO(gtk_handle_box_set_handle_position, vFpi)
-GO(gtk_handle_box_set_shadow_type, vFpi)
-GO(gtk_handle_box_set_snap_edge, vFpi)
+GO(gtk_handle_box_set_shadow_type, vFpu)
+GO(gtk_handle_box_set_snap_edge, vFpu)
GO(gtk_hbox_get_type, LFv)
GO(gtk_hbox_new, pFii)
GO(gtk_hbutton_box_get_layout_default, iFv)
@@ -1183,13 +1183,13 @@ GO(gtk_hscrollbar_get_type, LFv)
GO(gtk_hscrollbar_new, pFp)
GO(gtk_hseparator_get_type, LFv)
GO(gtk_hseparator_new, pFv)
-//GO(gtk_hsv_get_color,
-//GO(gtk_hsv_get_metrics,
+GO(gtk_hsv_get_color, vFpppp)
+GO(gtk_hsv_get_metrics, vFppp)
GO(gtk_hsv_get_type, LFv)
-//GO(gtk_hsv_is_adjusting,
+GO(gtk_hsv_is_adjusting, iFp)
//GO(gtk_hsv_new,
-//GO(gtk_hsv_set_color,
-//GO(gtk_hsv_set_metrics,
+GO(gtk_hsv_set_color, vFpddd)
+GO(gtk_hsv_set_metrics, vFpii)
//GO(gtk_hsv_to_rgb,
GO(gtk_icon_factory_add, vFppp)
GO(gtk_icon_factory_add_default, vFp)
@@ -1209,7 +1209,7 @@ GO(gtk_icon_info_get_filename, pFp)
GO(gtk_icon_info_get_type, LFv)
GO(gtk_icon_info_load_icon, pFpp)
GO(gtk_icon_info_new_for_pixbuf, pFpp)
-GO(gtk_icon_info_set_raw_coordinates, vFpp)
+GO(gtk_icon_info_set_raw_coordinates, vFpi)
GO(gtk_icon_lookup_flags_get_type, LFv)
GO(gtk_icon_set_add_source, vFpp)
GO(gtk_icon_set_copy, pFp)
@@ -1218,36 +1218,36 @@ GO(gtk_icon_set_get_type, LFv)
GO(gtk_icon_set_new, pFv)
GO(gtk_icon_set_new_from_pixbuf, pFp)
GO(gtk_icon_set_ref, pFp)
-GO(gtk_icon_set_render_icon, pFppipipp)
+GO(gtk_icon_set_render_icon, pFppuuupp)
GO(gtk_icon_set_unref, vFp)
-GO(gtk_icon_size_from_name, iFp)
-GO(gtk_icon_size_get_name, pFi)
+GO(gtk_icon_size_from_name, uFp)
+GO(gtk_icon_size_get_name, pFu)
GO(gtk_icon_size_get_type, LFv)
-GO(gtk_icon_size_lookup, iFipp)
-GO(gtk_icon_size_lookup_for_settings, iFpipp)
-GO(gtk_icon_size_register, iFpii)
-GO(gtk_icon_size_register_alias, vFpi)
+GO(gtk_icon_size_lookup, iFupp)
+GO(gtk_icon_size_lookup_for_settings, iFpupp)
+GO(gtk_icon_size_register, uFpii)
+GO(gtk_icon_size_register_alias, vFpu)
GO(gtk_icon_source_copy, pFp)
GO(gtk_icon_source_free, vFp)
-GO(gtk_icon_source_get_direction, iFp)
+GO(gtk_icon_source_get_direction, uFp)
GO(gtk_icon_source_get_direction_wildcarded, iFp)
GO(gtk_icon_source_get_filename, pFp)
GO(gtk_icon_source_get_icon_name, pFp)
GO(gtk_icon_source_get_pixbuf, pFp)
-GO(gtk_icon_source_get_size, iFp)
+GO(gtk_icon_source_get_size, uFp)
GO(gtk_icon_source_get_size_wildcarded, iFp)
-GO(gtk_icon_source_get_state, iFp)
+GO(gtk_icon_source_get_state, uFp)
GO(gtk_icon_source_get_state_wildcarded, iFp)
GO(gtk_icon_source_get_type, LFv)
GO(gtk_icon_source_new, pFv)
-GO(gtk_icon_source_set_direction, vFpi)
+GO(gtk_icon_source_set_direction, vFpu)
GO(gtk_icon_source_set_direction_wildcarded, vFpi)
GO(gtk_icon_source_set_filename, vFpp)
GO(gtk_icon_source_set_icon_name, vFpp)
GO(gtk_icon_source_set_pixbuf, vFpp)
-GO(gtk_icon_source_set_size, vFpi)
+GO(gtk_icon_source_set_size, vFpu)
GO(gtk_icon_source_set_size_wildcarded, vFpi)
-GO(gtk_icon_source_set_state, vFpi)
+GO(gtk_icon_source_set_state, vFpu)
GO(gtk_icon_source_set_state_wildcarded, vFpi)
GO(gtk_icon_theme_add_builtin_icon, vFpip)
GO(gtk_icon_theme_append_search_path, vFpp)
@@ -1275,8 +1275,8 @@ GO(gtk_icon_theme_set_search_path, vFppi)
GO(gtk_icon_view_convert_widget_to_bin_window_coords, vFpiipp)
GO(gtk_icon_view_create_drag_icon, pFpp)
GO(gtk_icon_view_drop_position_get_type, LFv)
-GO(gtk_icon_view_enable_model_drag_dest, vFppii)
-GO(gtk_icon_view_enable_model_drag_source, vFpipii)
+GO(gtk_icon_view_enable_model_drag_dest, vFppiu)
+GO(gtk_icon_view_enable_model_drag_source, vFpupiu)
GO(gtk_icon_view_get_columns, iFp)
GO(gtk_icon_view_get_column_spacing, iFp)
GO(gtk_icon_view_get_cursor, iFppp)
@@ -1284,7 +1284,7 @@ GO(gtk_icon_view_get_dest_item_at_pos, iFpiipp)
GO(gtk_icon_view_get_drag_dest_item, vFppp)
GO(gtk_icon_view_get_item_at_pos, iFpiipp)
GO(gtk_icon_view_get_item_column, iFpp)
-GO(gtk_icon_view_get_item_orientation, iFp)
+GO(gtk_icon_view_get_item_orientation, uFp)
GO(gtk_icon_view_get_item_padding, iFp)
GO(gtk_icon_view_get_item_row, iFpp)
GO(gtk_icon_view_get_item_width, iFp)
@@ -1297,7 +1297,7 @@ GO(gtk_icon_view_get_pixbuf_column, iFp)
GO(gtk_icon_view_get_reorderable, iFp)
GO(gtk_icon_view_get_row_spacing, iFp)
GO(gtk_icon_view_get_selected_items, pFp)
-GO(gtk_icon_view_get_selection_mode, iFp)
+GO(gtk_icon_view_get_selection_mode, uFp)
GO(gtk_icon_view_get_spacing, iFp)
GO(gtk_icon_view_get_text_column, iFp)
GO(gtk_icon_view_get_tooltip_column, iFp)
@@ -1315,8 +1315,8 @@ GO(gtk_icon_view_select_path, vFpp)
GO(gtk_icon_view_set_columns, vFpi)
GO(gtk_icon_view_set_column_spacing, vFpi)
GO(gtk_icon_view_set_cursor, vFpppi)
-GO(gtk_icon_view_set_drag_dest_item, vFppi)
-GO(gtk_icon_view_set_item_orientation, vFpi)
+GO(gtk_icon_view_set_drag_dest_item, vFppu)
+GO(gtk_icon_view_set_item_orientation, vFpu)
GO(gtk_icon_view_set_item_padding, vFpi)
GO(gtk_icon_view_set_item_width, vFpi)
GO(gtk_icon_view_set_margin, vFpi)
@@ -1326,7 +1326,7 @@ GO(gtk_icon_view_set_orientation, vFpi)
GO(gtk_icon_view_set_pixbuf_column, vFpi)
GO(gtk_icon_view_set_reorderable, vFpi)
GO(gtk_icon_view_set_row_spacing, vFpi)
-GO(gtk_icon_view_set_selection_mode, vFpi)
+GO(gtk_icon_view_set_selection_mode, vFpu)
GO(gtk_icon_view_set_spacing, vFpi)
GO(gtk_icon_view_set_text_column, vFpi)
GO(gtk_icon_view_set_tooltip_cell, vFpppp)
@@ -1353,7 +1353,7 @@ GO(gtk_image_get_pixbuf, pFp)
GO(gtk_image_get_pixel_size, iFp)
GO(gtk_image_get_pixmap, vFppp)
GO(gtk_image_get_stock, vFppp)
-GO(gtk_image_get_storage_type, iFp)
+GO(gtk_image_get_storage_type, uFp)
GO(gtk_image_get_type, LFv)
GO(gtk_image_menu_item_get_always_show_image, iFp)
GO(gtk_image_menu_item_get_image, pFp)
@@ -1370,19 +1370,19 @@ GO(gtk_image_menu_item_set_use_stock, vFpi)
GO(gtk_image_new, pFv)
GO(gtk_image_new_from_animation, pFp)
GO(gtk_image_new_from_file, pFp)
-GO(gtk_image_new_from_gicon, pFpi)
-GO(gtk_image_new_from_icon_name, pFpi)
-GO(gtk_image_new_from_icon_set, pFpi)
+GO(gtk_image_new_from_gicon, pFpu)
+GO(gtk_image_new_from_icon_name, pFpu)
+GO(gtk_image_new_from_icon_set, pFpu)
GO(gtk_image_new_from_image, pFpp)
GO(gtk_image_new_from_pixbuf, pFp)
GO(gtk_image_new_from_pixmap, pFpp)
GO(gtk_image_new_from_stock, pFpi)
GO(gtk_image_set, vFppp)
GO(gtk_image_set_from_animation, vFpp)
-GO(gtk_image_set_from_file, vFppp)
-GO(gtk_image_set_from_gicon, vFppi)
-GO(gtk_image_set_from_icon_name, vFppi)
-GO(gtk_image_set_from_icon_set, vFppi)
+GO(gtk_image_set_from_file, vFpp)
+GO(gtk_image_set_from_gicon, vFppu)
+GO(gtk_image_set_from_icon_name, vFppu)
+GO(gtk_image_set_from_icon_set, vFppu)
GO(gtk_image_set_from_image, vFppp)
GO(gtk_image_set_from_pixbuf, vFpp)
GO(gtk_image_set_from_pixmap, vFppp)
@@ -1411,19 +1411,19 @@ GO(gtk_im_multicontext_new, pFv)
GO(gtk_im_multicontext_set_context_id, vFpp)
GO(gtk_im_preedit_style_get_type, LFv)
GO(gtk_im_status_style_get_type, LFv)
-//GO(gtk_info_bar_add_action_widget,
-//GO(gtk_info_bar_add_button,
+GO(gtk_info_bar_add_action_widget, vFppi)
+GO(gtk_info_bar_add_button, pFppi)
//GO(gtk_info_bar_add_buttons,
//GO(gtk_info_bar_get_action_area,
-//GO(gtk_info_bar_get_content_area,
-//GO(gtk_info_bar_get_message_type,
+GO(gtk_info_bar_get_content_area, pFp)
+GO(gtk_info_bar_get_message_type, uFp)
GO(gtk_info_bar_get_type, LFv)
//GO(gtk_info_bar_new,
//GO(gtk_info_bar_new_with_buttons,
-//GO(gtk_info_bar_response,
+GO(gtk_info_bar_response, vFpi)
//GO(gtk_info_bar_set_default_response,
-//GO(gtk_info_bar_set_message_type,
-//GO(gtk_info_bar_set_response_sensitive,
+GO(gtk_info_bar_set_message_type, vFpu)
+GO(gtk_info_bar_set_response_sensitive, vFpii)
GOM(gtk_init, vFEpp)
//GO(gtk_init_add,
GOM(gtk_init_check, iFEpp)
@@ -1432,13 +1432,13 @@ GOM(gtk_input_add_full, uFEiipppp)
GO(gtk_input_dialog_get_type, LFv)
GO(gtk_input_dialog_new, pFv)
GO(gtk_input_remove, vFu)
-//GO(gtk_invisible_get_screen,
+GO(gtk_invisible_get_screen, pFp)
GO(gtk_invisible_get_type, LFv)
//GO(gtk_invisible_new,
-//GO(gtk_invisible_new_for_screen,
-//GO(gtk_invisible_set_screen,
+GO(gtk_invisible_new_for_screen, pFp)
+GO(gtk_invisible_set_screen, vFpp)
//GO(gtk_item_deselect,
-//GO(gtk_item_factories_path_delete,
+GO(gtk_item_factories_path_delete, vFpp)
//GO(gtk_item_factory_add_foreign,
//GO(gtk_item_factory_construct,
//GO(gtk_item_factory_create_item,
@@ -1456,15 +1456,15 @@ GO(gtk_item_factory_get_type, LFv)
//GO(gtk_item_factory_get_widget,
//GO(gtk_item_factory_get_widget_by_action,
//GO(gtk_item_factory_new,
-//GO(gtk_item_factory_path_from_widget,
+GO(gtk_item_factory_path_from_widget, pFp)
//GO(gtk_item_factory_popup,
//GO(gtk_item_factory_popup_data,
-//GO(gtk_item_factory_popup_data_from_widget,
+GO(gtk_item_factory_popup_data_from_widget, pFp)
//GO(gtk_item_factory_popup_with_data,
//GO(gtk_item_factory_set_translate_func,
GO(gtk_item_get_type, LFv)
//GO(gtk_item_select,
-//GO(gtk_item_toggle,
+GO(gtk_item_toggle, vFp)
GO(gtk_justification_get_type, LFv)
//GOM(gtk_key_snooper_install, uFEBp)
GO(gtk_key_snooper_remove, vFu)
@@ -1472,13 +1472,13 @@ GO(gtk_label_get, vFpp)
GO(gtk_label_get_angle, dFp)
GO(gtk_label_get_attributes, pFp)
GO(gtk_label_get_current_uri, pFp)
-GO(gtk_label_get_ellipsize, iFp)
-GO(gtk_label_get_justify, iFp)
+GO(gtk_label_get_ellipsize, uFp)
+GO(gtk_label_get_justify, uFp)
GO(gtk_label_get_label, pFp)
GO(gtk_label_get_layout, pFp)
GO(gtk_label_get_layout_offsets, vFppp)
GO(gtk_label_get_line_wrap, iFp)
-GO(gtk_label_get_line_wrap_mode, iFp)
+GO(gtk_label_get_line_wrap_mode, uFp)
GO(gtk_label_get_max_width_chars, iFp)
GO(gtk_label_get_mnemonic_keyval, uFp)
GO(gtk_label_get_mnemonic_widget, pFp)
@@ -1497,11 +1497,11 @@ GO(gtk_label_parse_uline, uFpp)
GO(gtk_label_select_region, vFpii)
GO(gtk_label_set_angle, vFpd)
GO(gtk_label_set_attributes, vFpp)
-GO(gtk_label_set_ellipsize, vFpi)
-GO(gtk_label_set_justify, vFpi)
+GO(gtk_label_set_ellipsize, vFpu)
+GO(gtk_label_set_justify, vFpu)
GO(gtk_label_set_label, vFpp)
GO(gtk_label_set_line_wrap, vFpi)
-GO(gtk_label_set_line_wrap_mode, vFpi)
+GO(gtk_label_set_line_wrap_mode, vFpu)
GO(gtk_label_set_markup, vFpp)
GO(gtk_label_set_markup_with_mnemonic, vFpp)
GO(gtk_label_set_max_width_chars, vFpi)
@@ -1525,7 +1525,7 @@ GO(gtk_layout_move, vFppii)
GO(gtk_layout_new, pFpp)
GO(gtk_layout_put, vFppii)
GO(gtk_layout_set_hadjustment, vFpp)
-GO(gtk_layout_set_size, vFpii)
+GO(gtk_layout_set_size, vFpuu)
GO(gtk_layout_set_vadjustment, vFpp)
GO(gtk_layout_thaw, vFp)
GO(gtk_link_button_get_type, LFv)
@@ -1541,7 +1541,7 @@ GO(gtk_list_child_position, iFpp)
GO(gtk_list_clear_items, vFpii)
GO(gtk_list_end_drag_selection, vFp)
GO(gtk_list_end_selection, vFp)
-GO(gtk_list_extend_selection, vFpifi)
+GO(gtk_list_extend_selection, vFpufi)
GO(gtk_list_get_type, LFv)
GO(gtk_list_insert_items, vFppi)
GO(gtk_list_item_deselect, vFp)
@@ -1554,11 +1554,11 @@ GO(gtk_list_prepend_items, vFpp)
GO(gtk_list_remove_items, vFpp)
GO(gtk_list_remove_items_no_unref, vFpp)
GO(gtk_list_scroll_horizontal, vFpif)
-GO(gtk_list_scroll_vertical, vFpif)
+GO(gtk_list_scroll_vertical, vFpuf)
GO(gtk_list_select_all, vFp)
GO(gtk_list_select_child, vFpp)
GO(gtk_list_select_item, vFpi)
-GO(gtk_list_set_selection_mode, vFpi)
+GO(gtk_list_set_selection_mode, vFpu)
GO(gtk_list_start_selection, vFp)
GO(gtk_list_store_append, vFpp)
GO(gtk_list_store_clear, vFp)
@@ -1624,11 +1624,11 @@ GO(gtk_main_quit, vFv)
GO(gtk_match_type_get_type, LFv)
GO(gtk_menu_attach, vFppuuuu)
GOM(gtk_menu_attach_to_widget, vFEppp)
-GO(gtk_menu_bar_get_child_pack_direction, iFp)
+GO(gtk_menu_bar_get_child_pack_direction, uFp)
GO(gtk_menu_bar_get_pack_direction, iFp)
GO(gtk_menu_bar_get_type, LFv)
GO(gtk_menu_bar_new, pFv)
-GO(gtk_menu_bar_set_child_pack_direction, vFpi)
+GO(gtk_menu_bar_set_child_pack_direction, vFpu)
GO(gtk_menu_bar_set_pack_direction, vFpi)
GO(gtk_menu_detach, vFp)
GO(gtk_menu_direction_type_get_type, LFv)
@@ -1649,11 +1649,11 @@ GO(gtk_menu_item_get_label, pFp)
GO(gtk_menu_item_get_right_justified, iFp)
GO(gtk_menu_item_get_submenu, pFp)
GO(gtk_menu_item_get_type, LFv)
-GO(gtk_menu_item_get_use_underline, vFpi)
+GO(gtk_menu_item_get_use_underline, iFp)
GO(gtk_menu_item_new, pFv)
GO(gtk_menu_item_new_with_label, pFp)
GO(gtk_menu_item_new_with_mnemonic, pFp)
-GO(gtk_menu_item_remove_submenu, pFp)
+GO(gtk_menu_item_remove_submenu, vFp)
GO(gtk_menu_item_select, vFp)
GO(gtk_menu_item_set_accel_path, vFpp)
GO(gtk_menu_item_set_label, vFpp)
@@ -1675,7 +1675,7 @@ GO(gtk_menu_set_reserve_toggle_size, vFpi)
GO(gtk_menu_set_screen, vFpp)
GO(gtk_menu_set_tearoff_state, vFpi)
GO(gtk_menu_set_title, vFpp)
-//GO(gtk_menu_shell_activate_item,
+GO(gtk_menu_shell_activate_item, vFppi)
GO(gtk_menu_shell_append, vFpp)
//GO(gtk_menu_shell_cancel,
//GO(gtk_menu_shell_deactivate,
@@ -1721,7 +1721,7 @@ GO(gtk_mount_operation_set_screen, vFpp)
GO(gtk_movement_step_get_type, LFv)
GO(gtk_notebook_append_page, iFppp)
GO(gtk_notebook_append_page_menu, iFpppp)
-GO(gtk_notebook_get_action_widget, pFpi)
+GO(gtk_notebook_get_action_widget, pFpu)
GO(gtk_notebook_get_current_page, iFp)
GO(gtk_notebook_get_group, pFp)
GO(gtk_notebook_get_group_id, iFp)
@@ -1737,7 +1737,7 @@ GO(gtk_notebook_get_tab_detachable, iFpp)
GO(gtk_notebook_get_tab_hborder, WFp)
GO(gtk_notebook_get_tab_label, pFpp)
GO(gtk_notebook_get_tab_label_text, pFpp)
-GO(gtk_notebook_get_tab_pos, iFp)
+GO(gtk_notebook_get_tab_pos, uFp)
GO(gtk_notebook_get_tab_reorderable, iFpp)
GO(gtk_notebook_get_tab_vborder, WFp)
GO(gtk_notebook_get_type, LFv)
@@ -1754,7 +1754,7 @@ GO(gtk_notebook_prev_page, vFp)
GO(gtk_notebook_query_tab_label_packing, vFppppp)
GO(gtk_notebook_remove_page, vFpi)
GO(gtk_notebook_reorder_child, vFppi)
-GO(gtk_notebook_set_action_widget, vFppi)
+GO(gtk_notebook_set_action_widget, vFppu)
GO(gtk_notebook_set_current_page, vFpi)
GO(gtk_notebook_set_group, vFpp)
GO(gtk_notebook_set_group_id, vFpi)
@@ -1769,20 +1769,20 @@ GO(gtk_notebook_set_tab_border, vFpu)
GO(gtk_notebook_set_tab_detachable, vFppi)
GO(gtk_notebook_set_tab_hborder, vFpu)
GO(gtk_notebook_set_tab_label, vFppp)
-GO(gtk_notebook_set_tab_label_packing, vFppiii)
+GO(gtk_notebook_set_tab_label_packing, vFppiiu)
GO(gtk_notebook_set_tab_label_text, vFppp)
-GO(gtk_notebook_set_tab_pos, vFpi)
+GO(gtk_notebook_set_tab_pos, vFpu)
GO(gtk_notebook_set_tab_reorderable, vFppi)
GO(gtk_notebook_set_tab_vborder, vFpu)
//GOM(gtk_notebook_set_window_creation_hook, pFEppp)
GO(gtk_notebook_tab_get_type, LFv)
GO(gtk_number_up_layout_get_type, LFv)
-GO(gtk_object_add_arg_type, vFpiuu)
+GO(gtk_object_add_arg_type, vFpLuu)
GO(gtk_object_destroy, vFp)
GO(gtk_object_flags_get_type, LFv)
GO(gtk_object_get, vFppppppppppp) // vaarg
GO(gtk_object_get_data, pFpp)
-GO(gtk_object_get_data_by_id, pFpp)
+GO(gtk_object_get_data_by_id, pFpu)
GO(gtk_object_get_type, LFv)
GO(gtk_object_get_user_data, pFp)
GO(gtk_object_new, pFppppppppppp) //vaarg
@@ -1790,10 +1790,10 @@ GO(gtk_object_ref, pFp)
GO(gtk_object_remove_data, vFpp)
GO(gtk_object_remove_data_by_id, vFpp)
GO(gtk_object_remove_no_notify, vFpp)
-GO(gtk_object_remove_no_notify_by_id, vFpp)
+GO(gtk_object_remove_no_notify_by_id, vFpu)
GO(gtk_object_set, vFppppppppppp) //vaarg
GO(gtk_object_set_data, vFppp)
-GO(gtk_object_set_data_by_id, vFppp)
+GO(gtk_object_set_data_by_id, vFpup)
//GOM(gtk_object_set_data_by_id_full, vFEpppp)
GOM(gtk_object_set_data_full, vFEpppp)
GO(gtk_object_set_user_data, vFpp)
@@ -1815,75 +1815,75 @@ GO(gtk_option_menu_new, pFv)
GO(gtk_option_menu_remove_menu, vFp)
GO(gtk_option_menu_set_history, vFpu)
GO(gtk_option_menu_set_menu, vFpp)
-GO(gtk_orientable_get_orientation, iFp)
+GO(gtk_orientable_get_orientation, uFp)
GO(gtk_orientable_get_type, LFv)
-GO(gtk_orientable_set_orientation, vFpi)
+GO(gtk_orientable_set_orientation, vFpu)
GO(gtk_orientation_get_type, LFv)
GO(gtk_pack_direction_get_type, LFv)
GO(gtk_pack_type_get_type, LFv)
GO(gtk_page_orientation_get_type, LFv)
GO(gtk_page_set_get_type, LFv)
-//GO(gtk_page_setup_copy,
-//GO(gtk_page_setup_get_bottom_margin,
-//GO(gtk_page_setup_get_left_margin,
-//GO(gtk_page_setup_get_orientation,
-//GO(gtk_page_setup_get_page_height,
-//GO(gtk_page_setup_get_page_width,
-//GO(gtk_page_setup_get_paper_height,
-//GO(gtk_page_setup_get_paper_size,
-//GO(gtk_page_setup_get_paper_width,
-//GO(gtk_page_setup_get_right_margin,
-//GO(gtk_page_setup_get_top_margin,
+GO(gtk_page_setup_copy, pFp)
+GO(gtk_page_setup_get_bottom_margin, dFpi)
+GO(gtk_page_setup_get_left_margin, dFpi)
+GO(gtk_page_setup_get_orientation, uFp)
+GO(gtk_page_setup_get_page_height, dFpu)
+GO(gtk_page_setup_get_page_width, dFpi)
+GO(gtk_page_setup_get_paper_height, dFpi)
+GO(gtk_page_setup_get_paper_size, pFp)
+GO(gtk_page_setup_get_paper_width, dFpi)
+GO(gtk_page_setup_get_right_margin, dFpi)
+GO(gtk_page_setup_get_top_margin, dFpi)
GO(gtk_page_setup_get_type, LFv)
//GO(gtk_page_setup_load_file,
-//GO(gtk_page_setup_load_key_file,
-//GO(gtk_page_setup_new,
-//GO(gtk_page_setup_new_from_file,
-//GO(gtk_page_setup_new_from_key_file,
+GO(gtk_page_setup_load_key_file, iFpppp)
+GO(gtk_page_setup_new, pFv)
+GO(gtk_page_setup_new_from_file, pFpp)
+GO(gtk_page_setup_new_from_key_file, pFppp)
//GO(gtk_page_setup_set_bottom_margin,
//GO(gtk_page_setup_set_left_margin,
-//GO(gtk_page_setup_set_orientation,
-//GO(gtk_page_setup_set_paper_size,
-//GO(gtk_page_setup_set_paper_size_and_default_margins,
-//GO(gtk_page_setup_set_right_margin,
+GO(gtk_page_setup_set_orientation, vFpu)
+GO(gtk_page_setup_set_paper_size, vFpp)
+GO(gtk_page_setup_set_paper_size_and_default_margins, vFpp)
+GO(gtk_page_setup_set_right_margin, vFpdu)
//GO(gtk_page_setup_set_top_margin,
-//GO(gtk_page_setup_to_file,
-//GO(gtk_page_setup_to_key_file,
+GO(gtk_page_setup_to_file, iFppp)
+GO(gtk_page_setup_to_key_file, vFppp)
//GO(gtk_page_setup_unix_dialog_get_page_setup,
//GO(gtk_page_setup_unix_dialog_get_print_settings,
GO(gtk_page_setup_unix_dialog_get_type, LFv)
//GO(gtk_page_setup_unix_dialog_new,
//GO(gtk_page_setup_unix_dialog_set_page_setup,
//GO(gtk_page_setup_unix_dialog_set_print_settings,
-GO(gtk_paint_arrow, vFppiipppiiiiii)
+GO(gtk_paint_arrow, vFppuupppuiiiii)
GO(gtk_paint_box, vFppiipppiiii)
-GO(gtk_paint_box_gap, vFppiipppiiiiiii)
+GO(gtk_paint_box_gap, vFppuupppiiiiuii)
GO(gtk_paint_check, vFppiipppiiii)
GO(gtk_paint_diamond, vFppiipppiiii)
-GO(gtk_paint_expander, vFppipppiii)
-GO(gtk_paint_extension, vFppiipppiiiii)
+GO(gtk_paint_expander, vFppupppiiu)
+GO(gtk_paint_extension, vFppuupppiiiiu)
GO(gtk_paint_flat_box, vFppiipppiiii)
-GO(gtk_paint_focus, vFppipppiiii)
-GO(gtk_paint_handle, vFppiipppiiiii)
+GO(gtk_paint_focus, vFppupppiiii)
+GO(gtk_paint_handle, vFppuupppiiiiu)
GO(gtk_paint_hline, vFppipppiii)
-GO(gtk_paint_layout, vFppiipppiip)
+GO(gtk_paint_layout, vFppuipppiip)
GO(gtk_paint_option, vFppiipppiiii)
-GO(gtk_paint_polygon, vFppiippppii)
-GO(gtk_paint_resize_grip, vFppipppiiiii)
+GO(gtk_paint_polygon, vFppuuppppii)
+GO(gtk_paint_resize_grip, vFppupppuiiii)
GO(gtk_paint_shadow, vFppiipppiiii)
GO(gtk_paint_shadow_gap, vFppiipppiiiiiii)
GO(gtk_paint_slider, vFppiipppiiiii)
-GO(gtk_paint_spinner, vFppipppuiiii)
-GO(gtk_paint_string, vFppipppiip)
-GO(gtk_paint_tab, vFppiipppiiii)
-GO(gtk_paint_vline, vFppipppiii)
+GO(gtk_paint_spinner, vFppupppuiiii)
+GO(gtk_paint_string, vFppupppiip)
+GO(gtk_paint_tab, vFppuupppiiii)
+GO(gtk_paint_vline, vFppupppiii)
GO(gtk_paned_add1, vFpp)
GO(gtk_paned_add2, vFpp)
GO(gtk_paned_compute_position, vFpiii)
GO(gtk_paned_get_child1, pFp)
GO(gtk_paned_get_child2, pFp)
GO(gtk_paned_get_handle_window, pFp)
-GO(gtk_paned_get_position, pFp)
+GO(gtk_paned_get_position, iFp)
GO(gtk_paned_get_type, LFv)
GO(gtk_paned_pack1, vFppii)
GO(gtk_paned_pack2, vFppii)
@@ -1893,7 +1893,7 @@ GO(gtk_paper_size_free, vFp)
GO(gtk_paper_size_get_default, pFv)
GO(gtk_paper_size_get_default_bottom_margin, dFpi)
GO(gtk_paper_size_get_default_left_margin, dFpi)
-GO(gtk_paper_size_get_default_right_margin, dFpi)
+GO(gtk_paper_size_get_default_right_margin, dFpu)
GO(gtk_paper_size_get_default_top_margin, dFpi)
GO(gtk_paper_size_get_display_name, pFp)
GO(gtk_paper_size_get_height, dFpi)
@@ -1905,10 +1905,10 @@ GO(gtk_paper_size_get_width, dFpi)
GO(gtk_paper_size_is_custom, iFp)
GO(gtk_paper_size_is_equal, iFpp)
GO(gtk_paper_size_new, pFp)
-GO(gtk_paper_size_new_custom, pFppddi)
+GO(gtk_paper_size_new_custom, pFppddu)
GO(gtk_paper_size_new_from_key_file, pFppp)
GO(gtk_paper_size_new_from_ppd, pFppdd)
-GO(gtk_paper_size_set_size, vFpddi)
+GO(gtk_paper_size_set_size, vFpddu)
GO(gtk_paper_size_to_key_file, vFppp)
GO(gtk_parse_args, iFpp)
GO(gtk_path_bar_get_type, LFv)
@@ -1919,31 +1919,31 @@ GO(gtk_pixmap_get_type, LFv)
GO(gtk_pixmap_new, pFpp)
GO(gtk_pixmap_set, vFppp)
GO(gtk_pixmap_set_build_insensitive, vFpi)
-GO(gtk_plug_construct, vFpp)
+GO(gtk_plug_construct, vFpu)
GO(gtk_plug_construct_for_display, vFppp)
GO(gtk_plug_get_embedded, iFp)
-GO(gtk_plug_get_id, pFp)
+GO(gtk_plug_get_id, uFp)
GO(gtk_plug_get_socket_window, pFp)
GO(gtk_plug_get_type, LFv)
-GO(gtk_plug_new, pFp)
+GO(gtk_plug_new, pFu)
GO(gtk_plug_new_for_display, pFpp)
GO(gtk_policy_type_get_type, LFv)
GO(gtk_position_type_get_type, LFv)
-//GO(gtk_preview_draw_row,
-//GO(gtk_preview_get_cmap,
-//GO(gtk_preview_get_info,
+GO(gtk_preview_draw_row, vFppiii)
+GO(gtk_preview_get_cmap, pFv)
+GO(gtk_preview_get_info, pFv)
GO(gtk_preview_get_type, LFv)
-//GO(gtk_preview_get_visual,
-//GO(gtk_preview_new,
-//GO(gtk_preview_put,
-//GO(gtk_preview_reset,
-//GO(gtk_preview_set_color_cube,
-//GO(gtk_preview_set_dither,
-//GO(gtk_preview_set_expand,
-//GO(gtk_preview_set_gamma,
+GO(gtk_preview_get_visual, pFv)
+GO(gtk_preview_new, pFu)
+GO(gtk_preview_put, vFpppiiiiii)
+GO(gtk_preview_reset, vFv)
+GO(gtk_preview_set_color_cube, vFuuuu)
+GO(gtk_preview_set_dither, vFpu)
+GO(gtk_preview_set_expand, vFpi)
+GO(gtk_preview_set_gamma, vFd)
//GO(gtk_preview_set_install_cmap,
-//GO(gtk_preview_set_reserved,
-//GO(gtk_preview_size,
+GO(gtk_preview_set_reserved, vFi)
+GO(gtk_preview_size, vFpii)
GO(gtk_preview_type_get_type, LFv)
//GO(gtk_preview_uninit,
//GO(gtk_print_backend_add_printer,
@@ -1959,37 +1959,37 @@ GO(gtk_print_backend_get_type, LFv)
//GO(gtk_print_backend_set_list_done,
//GO(gtk_print_backend_set_password,
GO(gtk_print_capabilities_get_type, LFv)
-//GO(gtk_print_context_create_pango_context,
-//GO(gtk_print_context_create_pango_layout,
-//GO(gtk_print_context_get_cairo_context,
+GO(gtk_print_context_create_pango_context, pFp)
+GO(gtk_print_context_create_pango_layout, pFp)
+GO(gtk_print_context_get_cairo_context, pFp)
//GO(gtk_print_context_get_dpi_x,
-//GO(gtk_print_context_get_dpi_y,
-//GO(gtk_print_context_get_hard_margins,
+GO(gtk_print_context_get_dpi_y, dFp)
+GO(gtk_print_context_get_hard_margins, iFppppp)
//GO(gtk_print_context_get_height,
-//GO(gtk_print_context_get_page_setup,
-//GO(gtk_print_context_get_pango_fontmap,
+GO(gtk_print_context_get_page_setup, pFp)
+GO(gtk_print_context_get_pango_fontmap, pFp)
GO(gtk_print_context_get_type, LFv)
//GO(gtk_print_context_get_width,
-//GO(gtk_print_context_set_cairo_context,
+GO(gtk_print_context_set_cairo_context, vFppdd)
GO(gtk_print_duplex_get_type, LFv)
//GO(gtk_printer_accepts_pdf,
//GO(gtk_printer_accepts_ps,
//GO(gtk_printer_compare,
//GO(gtk_printer_get_backend,
//GO(gtk_printer_get_capabilities,
-//GO(gtk_printer_get_default_page_size,
+GO(gtk_printer_get_default_page_size, pFp)
//GO(gtk_printer_get_description,
//GO(gtk_printer_get_hard_margins,
//GO(gtk_printer_get_icon_name,
//GO(gtk_printer_get_job_count,
//GO(gtk_printer_get_location,
-//GO(gtk_printer_get_name,
+GO(gtk_printer_get_name, pFp)
//GO(gtk_printer_get_state_message,
GO(gtk_printer_get_type, LFv)
//GO(gtk_printer_has_details,
//GO(gtk_printer_is_accepting_jobs,
//GO(gtk_printer_is_active,
-//GO(gtk_printer_is_default,
+GO(gtk_printer_is_default, iFp)
//GO(gtk_printer_is_new,
//GO(gtk_printer_is_paused,
//GO(gtk_printer_is_virtual,
@@ -2044,126 +2044,126 @@ GO(gtk_print_error_get_type, LFv)
//GO(gtk_print_job_get_title,
//GO(gtk_print_job_get_track_print_status,
GO(gtk_print_job_get_type, LFv)
-//GO(gtk_print_job_new,
-//GO(gtk_print_job_send,
-//GO(gtk_print_job_set_source_file,
+GO(gtk_print_job_new, pFpppp)
+GOM(gtk_print_job_send, vFEpppp)
+GO(gtk_print_job_set_source_file, vFppp)
//GO(gtk_print_job_set_status,
//GO(gtk_print_job_set_track_print_status,
GO(gtk_print_operation_action_get_type, LFv)
//GO(gtk_print_operation_cancel,
//GO(gtk_print_operation_draw_page_finish,
-//GO(gtk_print_operation_get_default_page_setup,
-//GO(gtk_print_operation_get_embed_page_setup,
-//GO(gtk_print_operation_get_error,
+GO(gtk_print_operation_get_default_page_setup, pFp)
+GO(gtk_print_operation_get_embed_page_setup, iFp)
+GO(gtk_print_operation_get_error, vFpp)
//GO(gtk_print_operation_get_has_selection,
-//GO(gtk_print_operation_get_n_pages_to_print,
-//GO(gtk_print_operation_get_print_settings,
-//GO(gtk_print_operation_get_status,
-//GO(gtk_print_operation_get_status_string,
+GO(gtk_print_operation_get_n_pages_to_print, iFp)
+GO(gtk_print_operation_get_print_settings, pFp)
+GO(gtk_print_operation_get_status, uFp)
+GO(gtk_print_operation_get_status_string, pFp)
//GO(gtk_print_operation_get_support_selection,
GO(gtk_print_operation_get_type, LFv)
//GO(gtk_print_operation_is_finished,
-//GO(gtk_print_operation_new,
-//GO(gtk_print_operation_preview_end_preview,
+GO(gtk_print_operation_new, pFv)
+GO(gtk_print_operation_preview_end_preview, vFp)
GO(gtk_print_operation_preview_get_type, LFv)
-//GO(gtk_print_operation_preview_is_selected,
-//GO(gtk_print_operation_preview_render_page,
+GO(gtk_print_operation_preview_is_selected, iFpi)
+GO(gtk_print_operation_preview_render_page, vFpi)
GO(gtk_print_operation_result_get_type, LFv)
-//GO(gtk_print_operation_run,
+GO(gtk_print_operation_run, uFpupp)
//GO(gtk_print_operation_set_allow_async,
-//GO(gtk_print_operation_set_current_page,
-//GO(gtk_print_operation_set_custom_tab_label,
-//GO(gtk_print_operation_set_default_page_setup,
-//GO(gtk_print_operation_set_defer_drawing,
-//GO(gtk_print_operation_set_embed_page_setup,
+GO(gtk_print_operation_set_current_page, vFpi)
+GO(gtk_print_operation_set_custom_tab_label, vFpp)
+GO(gtk_print_operation_set_default_page_setup, vFpp)
+GO(gtk_print_operation_set_defer_drawing, vFp)
+GO(gtk_print_operation_set_embed_page_setup, vFpi)
//GO(gtk_print_operation_set_export_filename,
//GO(gtk_print_operation_set_has_selection,
//GO(gtk_print_operation_set_job_name,
//GO(gtk_print_operation_set_n_pages,
-//GO(gtk_print_operation_set_print_settings,
+GO(gtk_print_operation_set_print_settings, vFpp)
//GO(gtk_print_operation_set_show_progress,
//GO(gtk_print_operation_set_support_selection,
//GO(gtk_print_operation_set_track_print_status,
-//GO(gtk_print_operation_set_unit,
+GO(gtk_print_operation_set_unit, vFpu)
//GO(gtk_print_operation_set_use_full_page,
GO(gtk_print_pages_get_type, LFv)
GO(gtk_print_quality_get_type, LFv)
-//GO(gtk_print_run_page_setup_dialog,
+GO(gtk_print_run_page_setup_dialog, pFppp)
//GO(gtk_print_run_page_setup_dialog_async,
-//GO(gtk_print_settings_copy,
+GO(gtk_print_settings_copy, pFp)
//GO(gtk_print_settings_foreach,
-//GO(gtk_print_settings_get,
-//GO(gtk_print_settings_get_bool,
+GO(gtk_print_settings_get, pFpp)
+GO(gtk_print_settings_get_bool, iFpp)
//GO(gtk_print_settings_get_collate,
//GO(gtk_print_settings_get_default_source,
//GO(gtk_print_settings_get_dither,
-//GO(gtk_print_settings_get_double,
-//GO(gtk_print_settings_get_double_with_default,
-//GO(gtk_print_settings_get_duplex,
+GO(gtk_print_settings_get_double, dFpp)
+GO(gtk_print_settings_get_double_with_default, dFppd)
+GO(gtk_print_settings_get_duplex, uFp)
//GO(gtk_print_settings_get_finishings,
-//GO(gtk_print_settings_get_int,
-//GO(gtk_print_settings_get_int_with_default,
-//GO(gtk_print_settings_get_length,
+GO(gtk_print_settings_get_int, iFpp)
+GO(gtk_print_settings_get_int_with_default, iFppi)
+GO(gtk_print_settings_get_length, dFppu)
//GO(gtk_print_settings_get_media_type,
//GO(gtk_print_settings_get_n_copies,
//GO(gtk_print_settings_get_number_up,
-//GO(gtk_print_settings_get_number_up_layout,
-//GO(gtk_print_settings_get_orientation,
-//GO(gtk_print_settings_get_output_bin,
-//GO(gtk_print_settings_get_page_ranges,
-//GO(gtk_print_settings_get_page_set,
-//GO(gtk_print_settings_get_paper_height,
-//GO(gtk_print_settings_get_paper_size,
+GO(gtk_print_settings_get_number_up_layout, uFp)
+GO(gtk_print_settings_get_orientation, uFp)
+GO(gtk_print_settings_get_output_bin, pFp)
+GO(gtk_print_settings_get_page_ranges, pFpp)
+GO(gtk_print_settings_get_page_set, uFp)
+GO(gtk_print_settings_get_paper_height, dFpu)
+GO(gtk_print_settings_get_paper_size, pFp)
//GO(gtk_print_settings_get_paper_width,
-//GO(gtk_print_settings_get_printer,
+GO(gtk_print_settings_get_printer, pFp)
//GO(gtk_print_settings_get_printer_lpi,
-//GO(gtk_print_settings_get_print_pages,
-//GO(gtk_print_settings_get_quality,
-//GO(gtk_print_settings_get_resolution,
+GO(gtk_print_settings_get_print_pages, uFp)
+GO(gtk_print_settings_get_quality, uFp)
+GO(gtk_print_settings_get_resolution, iFp)
//GO(gtk_print_settings_get_resolution_x,
-//GO(gtk_print_settings_get_resolution_y,
-//GO(gtk_print_settings_get_reverse,
-//GO(gtk_print_settings_get_scale,
+GO(gtk_print_settings_get_resolution_y, iFp)
+GO(gtk_print_settings_get_reverse, iFp)
+GO(gtk_print_settings_get_scale, dFp)
GO(gtk_print_settings_get_type, LFv)
//GO(gtk_print_settings_get_use_color,
//GO(gtk_print_settings_has_key,
//GO(gtk_print_settings_load_file,
-//GO(gtk_print_settings_load_key_file,
-//GO(gtk_print_settings_new,
-//GO(gtk_print_settings_new_from_file,
-//GO(gtk_print_settings_new_from_key_file,
-//GO(gtk_print_settings_set,
-//GO(gtk_print_settings_set_bool,
-//GO(gtk_print_settings_set_collate,
+GO(gtk_print_settings_load_key_file, iFpppp)
+GO(gtk_print_settings_new, pFv)
+GO(gtk_print_settings_new_from_file, pFpp)
+GO(gtk_print_settings_new_from_key_file, pFppp)
+GO(gtk_print_settings_set, vFppp)
+GO(gtk_print_settings_set_bool, vFppi)
+GO(gtk_print_settings_set_collate, vFpi)
//GO(gtk_print_settings_set_default_source,
//GO(gtk_print_settings_set_dither,
-//GO(gtk_print_settings_set_double,
-//GO(gtk_print_settings_set_duplex,
+GO(gtk_print_settings_set_double, vFppd)
+GO(gtk_print_settings_set_duplex, vFpu)
//GO(gtk_print_settings_set_finishings,
-//GO(gtk_print_settings_set_int,
-//GO(gtk_print_settings_set_length,
+GO(gtk_print_settings_set_int, vFppi)
+GO(gtk_print_settings_set_length, vFppdu)
//GO(gtk_print_settings_set_media_type,
-//GO(gtk_print_settings_set_n_copies,
+GO(gtk_print_settings_set_n_copies, vFpi)
//GO(gtk_print_settings_set_number_up,
-//GO(gtk_print_settings_set_number_up_layout,
-//GO(gtk_print_settings_set_orientation,
-//GO(gtk_print_settings_set_output_bin,
-//GO(gtk_print_settings_set_page_ranges,
-//GO(gtk_print_settings_set_page_set,
-//GO(gtk_print_settings_set_paper_height,
-//GO(gtk_print_settings_set_paper_size,
+GO(gtk_print_settings_set_number_up_layout, vFpu)
+GO(gtk_print_settings_set_orientation, vFpu)
+GO(gtk_print_settings_set_output_bin, vFpp)
+GO(gtk_print_settings_set_page_ranges, vFppi)
+GO(gtk_print_settings_set_page_set, vFpu)
+GO(gtk_print_settings_set_paper_height, vFpdu)
+GO(gtk_print_settings_set_paper_size, vFpp)
//GO(gtk_print_settings_set_paper_width,
-//GO(gtk_print_settings_set_printer,
+GO(gtk_print_settings_set_printer, vFpp)
//GO(gtk_print_settings_set_printer_lpi,
-//GO(gtk_print_settings_set_print_pages,
-//GO(gtk_print_settings_set_quality,
-//GO(gtk_print_settings_set_resolution,
-//GO(gtk_print_settings_set_resolution_xy,
-//GO(gtk_print_settings_set_reverse,
-//GO(gtk_print_settings_set_scale,
+GO(gtk_print_settings_set_print_pages, vFpu)
+GO(gtk_print_settings_set_quality, vFpu)
+GO(gtk_print_settings_set_resolution, vFpi)
+GO(gtk_print_settings_set_resolution_xy, vFpii)
+GO(gtk_print_settings_set_reverse, vFpi)
+GO(gtk_print_settings_set_scale, vFpd)
//GO(gtk_print_settings_set_use_color,
-//GO(gtk_print_settings_to_file,
-//GO(gtk_print_settings_to_key_file,
+GO(gtk_print_settings_to_file, iFppp)
+GO(gtk_print_settings_to_key_file, vFppp)
//GO(gtk_print_settings_unset,
GO(gtk_print_status_get_type, LFv)
//GO(gtk_print_unix_dialog_add_custom_tab,
@@ -2171,25 +2171,25 @@ GO(gtk_print_status_get_type, LFv)
//GO(gtk_print_unix_dialog_get_embed_page_setup,
//GO(gtk_print_unix_dialog_get_has_selection,
//GO(gtk_print_unix_dialog_get_manual_capabilities,
-//GO(gtk_print_unix_dialog_get_page_setup,
+GO(gtk_print_unix_dialog_get_page_setup, pFp)
//GO(gtk_print_unix_dialog_get_page_setup_set,
-//GO(gtk_print_unix_dialog_get_selected_printer,
-//GO(gtk_print_unix_dialog_get_settings,
+GO(gtk_print_unix_dialog_get_selected_printer, pFp)
+GO(gtk_print_unix_dialog_get_settings, pFp)
//GO(gtk_print_unix_dialog_get_support_selection,
GO(gtk_print_unix_dialog_get_type, LFv)
-//GO(gtk_print_unix_dialog_new,
+GO(gtk_print_unix_dialog_new, pFpp)
//GO(gtk_print_unix_dialog_set_current_page,
-//GO(gtk_print_unix_dialog_set_embed_page_setup,
-//GO(gtk_print_unix_dialog_set_has_selection,
-//GO(gtk_print_unix_dialog_set_manual_capabilities,
+GO(gtk_print_unix_dialog_set_embed_page_setup, vFpi)
+GO(gtk_print_unix_dialog_set_has_selection, vFpi)
+GO(gtk_print_unix_dialog_set_manual_capabilities, vFpi)
//GO(gtk_print_unix_dialog_set_page_setup,
-//GO(gtk_print_unix_dialog_set_settings,
-//GO(gtk_print_unix_dialog_set_support_selection,
+GO(gtk_print_unix_dialog_set_settings, vFpp)
+GO(gtk_print_unix_dialog_set_support_selection, vFpi)
GO(gtk_private_flags_get_type, LFv)
-GO(gtk_progress_bar_get_ellipsize, iFp)
+GO(gtk_progress_bar_get_ellipsize, uFp)
GO(gtk_progress_bar_get_fraction, dFp)
-GO(gtk_progress_bar_get_orientation, iFp)
-GO(gtk_progress_bar_get_pulse_step, fFp)
+GO(gtk_progress_bar_get_orientation, uFp)
+GO(gtk_progress_bar_get_pulse_step, dFp)
GO(gtk_progress_bar_get_text, pFp)
GO(gtk_progress_bar_get_type, LFv)
GO(gtk_progress_bar_new, pFv)
@@ -2198,11 +2198,11 @@ GO(gtk_progress_bar_orientation_get_type, LFv)
GO(gtk_progress_bar_pulse, vFp)
GO(gtk_progress_bar_set_activity_blocks, vFpu)
GO(gtk_progress_bar_set_activity_step, vFpu)
-GO(gtk_progress_bar_set_bar_style, vFpi)
+GO(gtk_progress_bar_set_bar_style, vFpu)
GO(gtk_progress_bar_set_discrete_blocks, vFpu)
-GO(gtk_progress_bar_set_ellipsize, vFpi)
+GO(gtk_progress_bar_set_ellipsize, vFpu)
GO(gtk_progress_bar_set_fraction, vFpd)
-GO(gtk_progress_bar_set_orientation, vFpi)
+GO(gtk_progress_bar_set_orientation, vFpu)
GO(gtk_progress_bar_set_pulse_step, vFpd)
GO(gtk_progress_bar_set_text, vFpp)
GO(gtk_progress_bar_style_get_type, LFv)
@@ -2271,8 +2271,8 @@ GO(gtk_range_get_show_fill_level, iFp)
GO(gtk_range_get_slider_range, vFppp)
GO(gtk_range_get_slider_size_fixed, iFp)
GO(gtk_range_get_type, LFv)
-GO(gtk_range_get_update_policy, iFp)
-GO(gtk_range_get_upper_stepper_sensitivity, iFp)
+GO(gtk_range_get_update_policy, uFp)
+GO(gtk_range_get_upper_stepper_sensitivity, uFp)
GO(gtk_range_get_value, dFp)
GO(gtk_range_set_adjustment, vFpp)
GO(gtk_range_set_fill_level, vFpd)
@@ -2286,8 +2286,8 @@ GO(gtk_range_set_restrict_to_fill_level, vFpi)
GO(gtk_range_set_round_digits, vFpi)
GO(gtk_range_set_show_fill_level, vFpi)
GO(gtk_range_set_slider_size_fixed, vFpi)
-GO(gtk_range_set_update_policy, vFpi)
-GO(gtk_range_set_upper_stepper_sensitivity, vFpi)
+GO(gtk_range_set_update_policy, vFpu)
+GO(gtk_range_set_upper_stepper_sensitivity, vFpu)
GO(gtk_range_set_value, vFpd)
GO(gtk_rc_add_class_style, vFpp)
GO(gtk_rc_add_default_file, vFp)
@@ -2301,7 +2301,7 @@ GO(gtk_rc_get_im_module_file, pFv)
GO(gtk_rc_get_im_module_path, pFv)
GO(gtk_rc_get_module_dir, pFv)
GO(gtk_rc_get_style, pFp)
-GO(gtk_rc_get_style_by_paths, pFpppi)
+GO(gtk_rc_get_style_by_paths, pFpppL)
GO(gtk_rc_get_theme_dir, pFv)
GO(gtk_rc_parse, vFp)
GO(gtk_rc_parse_color, uFpp)
@@ -2325,33 +2325,33 @@ GO(gtk_rc_style_new, pFv)
GO(gtk_rc_style_ref, vFp)
GO(gtk_rc_style_unref, vFp)
GO(gtk_rc_token_type_get_type, LFv)
-//GO(gtk_recent_action_get_show_numbers,
+GO(gtk_recent_action_get_show_numbers, iFp)
GO(gtk_recent_action_get_type, LFv)
-//GO(gtk_recent_action_new,
-//GO(gtk_recent_action_new_for_manager,
-//GO(gtk_recent_action_set_show_numbers,
+GO(gtk_recent_action_new, pFpppp)
+GO(gtk_recent_action_new_for_manager, pFppppp)
+GO(gtk_recent_action_set_show_numbers, vFpi)
//GO(gtk_recent_chooser_add_filter,
GO(gtk_recent_chooser_dialog_get_type, LFv)
//GO(gtk_recent_chooser_dialog_new,
//GO(gtk_recent_chooser_dialog_new_for_manager,
GO(gtk_recent_chooser_error_get_type, LFv)
-//GO(gtk_recent_chooser_error_quark,
-//GO(gtk_recent_chooser_get_current_item,
-//GO(gtk_recent_chooser_get_current_uri,
-//GO(gtk_recent_chooser_get_filter,
-//GO(gtk_recent_chooser_get_items,
-//GO(gtk_recent_chooser_get_limit,
+GO(gtk_recent_chooser_error_quark, uFv)
+GO(gtk_recent_chooser_get_current_item, pFp)
+GO(gtk_recent_chooser_get_current_uri, pFp)
+GO(gtk_recent_chooser_get_filter, pFp)
+GO(gtk_recent_chooser_get_items, pFp)
+GO(gtk_recent_chooser_get_limit, iFp)
//GO(gtk_recent_chooser_get_local_only,
//GO(gtk_recent_chooser_get_select_multiple,
-//GO(gtk_recent_chooser_get_show_icons,
+GO(gtk_recent_chooser_get_show_icons, iFp)
//GO(gtk_recent_chooser_get_show_not_found,
//GO(gtk_recent_chooser_get_show_numbers,
//GO(gtk_recent_chooser_get_show_private,
//GO(gtk_recent_chooser_get_show_tips,
-//GO(gtk_recent_chooser_get_sort_type,
+GO(gtk_recent_chooser_get_sort_type, uFp)
GO(gtk_recent_chooser_get_type, LFv)
-//GO(gtk_recent_chooser_get_uris,
-//GO(gtk_recent_chooser_list_filters,
+GO(gtk_recent_chooser_get_uris, pFpp)
+GO(gtk_recent_chooser_list_filters, pFp)
//GO(gtk_recent_chooser_menu_get_show_numbers,
GO(gtk_recent_chooser_menu_get_type, LFv)
//GO(gtk_recent_chooser_menu_new,
@@ -2359,24 +2359,24 @@ GO(gtk_recent_chooser_menu_get_type, LFv)
//GO(gtk_recent_chooser_menu_set_show_numbers,
//GO(gtk_recent_chooser_remove_filter,
//GO(gtk_recent_chooser_select_all,
-//GO(gtk_recent_chooser_select_uri,
+GO(gtk_recent_chooser_select_uri, iFppp)
//GO(gtk_recent_chooser_set_current_uri,
-//GO(gtk_recent_chooser_set_filter,
-//GO(gtk_recent_chooser_set_limit,
+GO(gtk_recent_chooser_set_filter, vFpp)
+GO(gtk_recent_chooser_set_limit, vFpi)
//GO(gtk_recent_chooser_set_local_only,
//GO(gtk_recent_chooser_set_select_multiple,
-//GO(gtk_recent_chooser_set_show_icons,
+GO(gtk_recent_chooser_set_show_icons, vFpi)
//GO(gtk_recent_chooser_set_show_not_found,
//GO(gtk_recent_chooser_set_show_numbers,
//GO(gtk_recent_chooser_set_show_private,
//GO(gtk_recent_chooser_set_show_tips,
//GO(gtk_recent_chooser_set_sort_func,
-//GO(gtk_recent_chooser_set_sort_type,
-//GO(gtk_recent_chooser_unselect_all,
-//GO(gtk_recent_chooser_unselect_uri,
+GO(gtk_recent_chooser_set_sort_type, vFpu)
+GO(gtk_recent_chooser_unselect_all, vFp)
+GO(gtk_recent_chooser_unselect_uri, vFpp)
GO(gtk_recent_chooser_widget_get_type, LFv)
//GO(gtk_recent_chooser_widget_new,
-//GO(gtk_recent_chooser_widget_new_for_manager,
+GO(gtk_recent_chooser_widget_new_for_manager, pFp)
GO(gtk_recent_filter_add_age, vFpi)
GO(gtk_recent_filter_add_application, vFpp)
//GOM(gtk_recent_filter_add_custom, vFEpippp)
@@ -2387,7 +2387,7 @@ GO(gtk_recent_filter_add_pixbuf_formats, vFp)
GO(gtk_recent_filter_filter, iFpp)
GO(gtk_recent_filter_flags_get_type, LFv)
GO(gtk_recent_filter_get_name, pFp)
-GO(gtk_recent_filter_get_needed, iFp)
+GO(gtk_recent_filter_get_needed, uFp)
GO(gtk_recent_filter_get_type, LFv)
GO(gtk_recent_filter_new, pFv)
GO(gtk_recent_filter_set_name, vFpp)
@@ -2439,52 +2439,52 @@ GO(gtk_requisition_free, vFp)
GO(gtk_requisition_get_type, LFv)
GO(gtk_resize_mode_get_type, LFv)
GO(gtk_response_type_get_type, LFv)
-//GO(gtk_rgb_to_hsv,
-//GO(gtk_ruler_draw_pos,
+GO(gtk_rgb_to_hsv, vFdddppp)
+GO(gtk_ruler_draw_pos, vFp)
//GO(gtk_ruler_draw_ticks,
-//GO(gtk_ruler_get_metric,
-//GO(gtk_ruler_get_range,
+GO(gtk_ruler_get_metric, uFp)
+GO(gtk_ruler_get_range, vFppppp)
GO(gtk_ruler_get_type, LFv)
-//GO(gtk_ruler_set_metric,
-//GO(gtk_ruler_set_range,
-GO(gtk_scale_add_mark, vFpdip)
-//GO(gtk_scale_button_get_adjustment,
+GO(gtk_ruler_set_metric, vFpu)
+GO(gtk_ruler_set_range, vFpdddd)
+GO(gtk_scale_add_mark, vFpdup)
+GO(gtk_scale_button_get_adjustment, pFp)
//GO(gtk_scale_button_get_minus_button,
-//GO(gtk_scale_button_get_orientation,
+GO(gtk_scale_button_get_orientation, uFp)
//GO(gtk_scale_button_get_plus_button,
-//GO(gtk_scale_button_get_popup,
+GO(gtk_scale_button_get_popup, pFp)
GO(gtk_scale_button_get_type, LFv)
-//GO(gtk_scale_button_get_value,
-//GO(gtk_scale_button_new,
-//GO(gtk_scale_button_set_adjustment,
-//GO(gtk_scale_button_set_icons,
-//GO(gtk_scale_button_set_orientation,
-//GO(gtk_scale_button_set_value,
+GO(gtk_scale_button_get_value, dFp)
+GO(gtk_scale_button_new, pFudddp)
+GO(gtk_scale_button_set_adjustment, vFpp)
+GO(gtk_scale_button_set_icons, vFpp)
+GO(gtk_scale_button_set_orientation, vFpu)
+GO(gtk_scale_button_set_value, vFpd)
GO(gtk_scale_clear_marks, vFp)
GO(gtk_scale_get_digits, iFp)
GO(gtk_scale_get_draw_value, iFp)
GO(gtk_scale_get_layout, pFp)
GO(gtk_scale_get_layout_offsets, vFppp)
GO(gtk_scale_get_type, LFv)
-GO(gtk_scale_get_value_pos, iFp)
+GO(gtk_scale_get_value_pos, uFp)
GO(gtk_scale_set_digits, vFpi)
GO(gtk_scale_set_draw_value, vFpi)
-GO(gtk_scale_set_value_pos, vFpi)
+GO(gtk_scale_set_value_pos, vFpu)
GO(gtk_scrollbar_get_type, LFv)
GO(gtk_scrolled_window_add_with_viewport, vFpp)
GO(gtk_scrolled_window_get_hadjustment, pFp)
GO(gtk_scrolled_window_get_hscrollbar, pFp)
-GO(gtk_scrolled_window_get_placement, iFp)
+GO(gtk_scrolled_window_get_placement, uFp)
GO(gtk_scrolled_window_get_policy, vFppp)
-GO(gtk_scrolled_window_get_shadow_type, iFp)
+GO(gtk_scrolled_window_get_shadow_type, uFp)
GO(gtk_scrolled_window_get_type, LFv)
GO(gtk_scrolled_window_get_vadjustment, pFp)
GO(gtk_scrolled_window_get_vscrollbar, pFp)
GO(gtk_scrolled_window_new, pFpp)
GO(gtk_scrolled_window_set_hadjustment, vFpp)
-GO(gtk_scrolled_window_set_placement, vFpi)
-GO(gtk_scrolled_window_set_policy, vFpii)
-GO(gtk_scrolled_window_set_shadow_type, vFpi)
+GO(gtk_scrolled_window_set_placement, vFpu)
+GO(gtk_scrolled_window_set_policy, vFpuu)
+GO(gtk_scrolled_window_set_shadow_type, vFpu)
GO(gtk_scrolled_window_set_vadjustment, vFpp)
GO(gtk_scrolled_window_unset_placement, vFp)
GO(gtk_scroll_step_get_type, LFv)
@@ -2548,7 +2548,7 @@ GOM(gtk_signal_connect_full, LFEppppppii)
//GO(gtk_signal_connect_while_alive,
//GO(gtk_signal_emit,
//GO(gtk_signal_emit_by_name,
-//GO(gtk_signal_emit_stop_by_name,
+GO(gtk_signal_emit_stop_by_name, vFpp)
//GO(gtk_signal_emitv,
//GO(gtk_signal_emitv_by_name,
//GO(gtk_signal_new,
@@ -2556,14 +2556,14 @@ GOM(gtk_signal_connect_full, LFEppppppii)
GO(gtk_signal_run_type_get_type, LFv)
GO(gtk_size_group_add_widget, vFpp)
GO(gtk_size_group_get_ignore_hidden, iFp)
-GO(gtk_size_group_get_mode, iFp)
+GO(gtk_size_group_get_mode, uFp)
GO(gtk_size_group_get_type, LFv)
GO(gtk_size_group_get_widgets, pFp)
GO(gtk_size_group_mode_get_type, LFv)
-GO(gtk_size_group_new, pFi)
+GO(gtk_size_group_new, pFu)
GO(gtk_size_group_remove_widget, vFpp)
GO(gtk_size_group_set_ignore_hidden, vFpi)
-GO(gtk_size_group_set_mode, vFpi)
+GO(gtk_size_group_set_mode, vFpu)
GO(gtk_socket_add_id, vFpp)
GO(gtk_socket_get_id, pFp)
GO(gtk_socket_get_plug_window, pFp)
@@ -2579,7 +2579,7 @@ GO(gtk_spin_button_get_numeric, iFp)
GO(gtk_spin_button_get_range, vFppp)
GO(gtk_spin_button_get_snap_to_ticks, iFp)
GO(gtk_spin_button_get_type, LFv)
-GO(gtk_spin_button_get_update_policy, iFp)
+GO(gtk_spin_button_get_update_policy, uFp)
GO(gtk_spin_button_get_value, dFp)
GO(gtk_spin_button_get_value_as_int, iFp)
GO(gtk_spin_button_get_wrap, iFp)
@@ -2591,10 +2591,10 @@ GO(gtk_spin_button_set_increments, vFpdd)
GO(gtk_spin_button_set_numeric, vFpi)
GO(gtk_spin_button_set_range, vFpdd)
GO(gtk_spin_button_set_snap_to_ticks, vFpi)
-GO(gtk_spin_button_set_update_policy, vFpi)
+GO(gtk_spin_button_set_update_policy, vFpu)
GO(gtk_spin_button_set_value, vFpd)
GO(gtk_spin_button_set_wrap, vFpi)
-GO(gtk_spin_button_spin, vFpid)
+GO(gtk_spin_button_spin, vFpud)
GO(gtk_spin_button_update, vFp)
GO(gtk_spin_button_update_policy_get_type, LFv)
GO(gtk_spinner_get_type, LFv)
@@ -2622,7 +2622,7 @@ GO(gtk_status_icon_get_pixbuf, pFp)
GO(gtk_status_icon_get_screen, pFp)
GO(gtk_status_icon_get_size, iFp)
GO(gtk_status_icon_get_stock, pFp)
-GO(gtk_status_icon_get_storage_type, iFp)
+GO(gtk_status_icon_get_storage_type, uFp)
GO(gtk_status_icon_get_title, pFp)
GO(gtk_status_icon_get_tooltip_markup, pFp)
GO(gtk_status_icon_get_tooltip_text, pFp)
@@ -2658,26 +2658,26 @@ GO(gtk_stock_item_free, vFp)
GO(gtk_stock_list_ids, pFv)
GO(gtk_stock_lookup, iFpp)
GOM(gtk_stock_set_translate_func, vFEpppp)
-GO(gtk_style_apply_default_background, vFppiipiiii)
+GO(gtk_style_apply_default_background, vFppiupiiii)
GO(gtk_style_attach, pFpp)
GO(gtk_style_copy, pFp)
GO(gtk_style_detach, vFp)
GO(gtk_style_get, vFpippppppppppp) //vaarg, wrap with gtk_style_get_valist?
GO(gtk_style_get_font, pFp)
-GO(gtk_style_get_style_property, vFpipp)
+GO(gtk_style_get_style_property, vFpLpp)
GO(gtk_style_get_type, LFv)
//GO(gtk_style_get_valist, vFpipp)
GO(gtk_style_lookup_color, iFppp)
GO(gtk_style_lookup_icon_set, pFpp)
GO(gtk_style_new, pFv)
GO(gtk_style_ref, pFp)
-GO(gtk_style_render_icon, pFppiiipp)
-GO(gtk_style_set_background, vFppi)
+GO(gtk_style_render_icon, pFppuuupp)
+GO(gtk_style_set_background, vFppu)
GO(gtk_style_set_font, vFpp)
GO(gtk_style_unref, vFp)
GO(gtk_submenu_direction_get_type, LFv)
GO(gtk_submenu_placement_get_type, LFv)
-GO(gtk_table_attach, vFppuuuuiiuu)
+GO(gtk_table_attach, vFppuuuuuuuu)
GO(gtk_table_attach_defaults, vFppuuuu)
GO(gtk_table_get_col_spacing, uFpu)
GO(gtk_table_get_default_col_spacing, uFp)
@@ -2704,7 +2704,7 @@ GO(gtk_target_list_find, iFppp)
GO(gtk_target_list_get_type, LFv)
GO(gtk_target_list_new, pFpu)
GO(gtk_target_list_ref, pFp)
-GO(gtk_target_list_remove, iFppp)
+GO(gtk_target_list_remove, vFpp)
GO(gtk_target_list_unref, vFp)
GO(gtk_targets_include_image, iFpii)
GO(gtk_targets_include_rich_text, iFpip)
@@ -2714,22 +2714,22 @@ GO(gtk_target_table_free, vFpi)
GO(gtk_target_table_new_from_list, pFpp)
GO(gtk_tearoff_menu_item_get_type, LFv)
GO(gtk_tearoff_menu_item_new, pFv)
-//GO(gtk_test_create_simple_window,
+GO(gtk_test_create_simple_window, pFpp)
//GO(gtk_test_create_widget,
//GO(gtk_test_display_button_window,
-//GO(gtk_test_find_label,
-//GO(gtk_test_find_sibling,
-//GO(gtk_test_find_widget,
+GO(gtk_test_find_label, pFpp)
+GO(gtk_test_find_sibling, pFpL)
+GO(gtk_test_find_widget, pFppL)
//GO(gtk_test_init,
-//GO(gtk_test_list_all_types,
+GO(gtk_test_list_all_types, pFp)
//GO(gtk_test_register_all_types,
-//GO(gtk_test_slider_get_value,
-//GO(gtk_test_slider_set_perc,
-//GO(gtk_test_spin_button_click,
-//GO(gtk_test_text_get,
-//GO(gtk_test_text_set,
+GO(gtk_test_slider_get_value, dFp)
+GO(gtk_test_slider_set_perc, vFpd)
+GO(gtk_test_spin_button_click, iFpui)
+GO(gtk_test_text_get, pFp)
+GO(gtk_test_text_set, vFpp)
//GO(gtk_test_widget_click,
-//GO(gtk_test_widget_send_key,
+GO(gtk_test_widget_send_key, iFpuu)
GO(gtk_text_anchored_child_set_layout, vFpp)
GO(gtk_text_attributes_copy, pFp)
GO(gtk_text_attributes_copy_values, vFpp)
@@ -2754,7 +2754,7 @@ GO(gtk_text_buffer_delete_interactive, iFpppi)
GO(gtk_text_buffer_delete_mark, vFpp)
GO(gtk_text_buffer_delete_mark_by_name, vFpp)
GO(gtk_text_buffer_delete_selection, iFpii)
-GO(gtk_text_buffer_deserialize, iFpppppup)
+GO(gtk_text_buffer_deserialize, iFpppppLp)
GO(gtk_text_buffer_deserialize_get_can_create_tags, iFpp)
GO(gtk_text_buffer_deserialize_set_can_create_tags, vFppi)
GO(gtk_text_buffer_end_user_action, vFp)
@@ -2867,7 +2867,7 @@ GO(gtk_text_iter_forward_lines, iFpi)
GO(gtk_text_iter_forward_search, iFppuppp)
GO(gtk_text_iter_forward_sentence_end, iFp)
GO(gtk_text_iter_forward_sentence_ends, iFpi)
-GO(gtk_text_iter_forward_to_end, iFp)
+GO(gtk_text_iter_forward_to_end, vFp)
GO(gtk_text_iter_forward_to_line_end, iFp)
GO(gtk_text_iter_forward_to_tag_toggle, iFpp)
GO(gtk_text_iter_forward_visible_cursor_position, iFp)
@@ -2994,14 +2994,14 @@ GO(gtk_text_tag_table_new, pFv)
GO(gtk_text_tag_table_remove, vFpp)
GO(gtk_text_thaw, vFp)
GO(gtk_text_view_add_child_at_anchor, vFppp)
-GO(gtk_text_view_add_child_in_window, vFppiii)
+GO(gtk_text_view_add_child_in_window, vFppuii)
GO(gtk_text_view_backward_display_line, iFpp)
GO(gtk_text_view_backward_display_line_start, iFpp)
GO(gtk_text_view_buffer_to_window_coords, vFpiiipp)
GO(gtk_text_view_forward_display_line, iFpp)
GO(gtk_text_view_forward_display_line_end, iFpp)
GO(gtk_text_view_get_accepts_tab, iFp)
-GO(gtk_text_view_get_border_window_size, iFpi)
+GO(gtk_text_view_get_border_window_size, iFpu)
GO(gtk_text_view_get_buffer, pFp)
GO(gtk_text_view_get_cursor_visible, iFp)
GO(gtk_text_view_get_default_attributes, pFp)
@@ -3011,7 +3011,7 @@ GO(gtk_text_view_get_indent, iFp)
GO(gtk_text_view_get_iter_at_location, vFppii)
GO(gtk_text_view_get_iter_at_position, vFpppii)
GO(gtk_text_view_get_iter_location, vFppp)
-GO(gtk_text_view_get_justification, iFp)
+GO(gtk_text_view_get_justification, uFp)
GO(gtk_text_view_get_left_margin, iFp)
GO(gtk_text_view_get_line_at_y, vFppip)
GO(gtk_text_view_get_line_yrange, vFpppp)
@@ -3024,9 +3024,9 @@ GO(gtk_text_view_get_tabs, pFp)
GO(gtk_text_view_get_type, LFv)
GO(gtk_text_view_get_vadjustment, pFp)
GO(gtk_text_view_get_visible_rect, vFpp)
-GO(gtk_text_view_get_window, pFpi)
-GO(gtk_text_view_get_window_type, iFpp)
-GO(gtk_text_view_get_wrap_mode, iFp)
+GO(gtk_text_view_get_window, pFpu)
+GO(gtk_text_view_get_window_type, uFpp)
+GO(gtk_text_view_get_wrap_mode, uFp)
GO(gtk_text_view_im_context_filter_keypress, iFpp)
GO(gtk_text_view_move_child, vFppii)
GO(gtk_text_view_move_mark_onscreen, iFpp)
@@ -3039,12 +3039,12 @@ GO(gtk_text_view_scroll_mark_onscreen, vFpp)
GO(gtk_text_view_scroll_to_iter, iFppdidd)
GO(gtk_text_view_scroll_to_mark, vFppdidd)
GO(gtk_text_view_set_accepts_tab, vFpi)
-GO(gtk_text_view_set_border_window_size, vFpii)
+GO(gtk_text_view_set_border_window_size, vFpui)
GO(gtk_text_view_set_buffer, vFpp)
GO(gtk_text_view_set_cursor_visible, vFpi)
GO(gtk_text_view_set_editable, vFpi)
GO(gtk_text_view_set_indent, vFpi)
-GO(gtk_text_view_set_justification, vFpi)
+GO(gtk_text_view_set_justification, vFpu)
GO(gtk_text_view_set_left_margin, vFpi)
GO(gtk_text_view_set_overwrite, vFpi)
GO(gtk_text_view_set_pixels_above_lines, vFpi)
@@ -3052,9 +3052,9 @@ GO(gtk_text_view_set_pixels_below_lines, vFpi)
GO(gtk_text_view_set_pixels_inside_wrap, vFpi)
GO(gtk_text_view_set_right_margin, vFpi)
GO(gtk_text_view_set_tabs, vFpp)
-GO(gtk_text_view_set_wrap_mode, vFpi)
+GO(gtk_text_view_set_wrap_mode, vFpu)
GO(gtk_text_view_starts_display_line, iFpp)
-GO(gtk_text_view_window_to_buffer_coords, vFpiiipp)
+GO(gtk_text_view_window_to_buffer_coords, vFpuiipp)
GO(gtk_text_window_type_get_type, LFv)
//GO(gtk_theme_engine_create_rc_style,
//GO(gtk_theme_engine_get,
@@ -3063,18 +3063,18 @@ GOM(gtk_timeout_add, uFEupp)
//GOM(gtk_timeout_add_full, uFuBppB)
GO(gtk_timeout_remove, vFu)
GO(gtk_tips_query_get_type, LFv)
-//GO(gtk_tips_query_new,
-//GO(gtk_tips_query_set_caller,
-//GO(gtk_tips_query_set_labels,
+GO(gtk_tips_query_new, pFv)
+GO(gtk_tips_query_set_caller, vFpp)
+GO(gtk_tips_query_set_labels, vFppp)
//GO(gtk_tips_query_start_query,
-//GO(gtk_tips_query_stop_query,
+GO(gtk_tips_query_stop_query, vFp)
//GO(gtk_toggle_action_get_active,
-//GO(gtk_toggle_action_get_draw_as_radio,
+GO(gtk_toggle_action_get_draw_as_radio, iFp)
GO(gtk_toggle_action_get_type, LFv)
-//GO(gtk_toggle_action_new,
+GO(gtk_toggle_action_new, pFpppp)
//GO(gtk_toggle_action_set_active,
-//GO(gtk_toggle_action_set_draw_as_radio,
-//GO(gtk_toggle_action_toggled,
+GO(gtk_toggle_action_set_draw_as_radio, vFpi)
+GO(gtk_toggle_action_toggled, vFp)
GO(gtk_toggle_button_get_active, iFp)
GO(gtk_toggle_button_get_inconsistent, iFp)
GO(gtk_toggle_button_get_mode, iFp)
@@ -3097,14 +3097,14 @@ GO(gtk_toolbar_append_space, vFp)
GO(gtk_toolbar_append_widget, vFpppp)
GO(gtk_toolbar_child_type_get_type, LFv)
GO(gtk_toolbar_get_drop_index, iFpii)
-GO(gtk_toolbar_get_icon_size, iFp)
+GO(gtk_toolbar_get_icon_size, uFp)
GO(gtk_toolbar_get_item_index, iFpp)
GO(gtk_toolbar_get_n_items, iFp)
GO(gtk_toolbar_get_nth_item, pFpi)
-GO(gtk_toolbar_get_orientation, iFp)
-GO(gtk_toolbar_get_relief_style, iFp)
+GO(gtk_toolbar_get_orientation, uFp)
+GO(gtk_toolbar_get_relief_style, uFp)
GO(gtk_toolbar_get_show_arrow, iFp)
-GO(gtk_toolbar_get_style, iFp)
+GO(gtk_toolbar_get_style, uFp)
GO(gtk_toolbar_get_tooltips, iFp)
GO(gtk_toolbar_get_type, LFv)
GO(gtk_toolbar_insert, vFppi)
@@ -3120,10 +3120,10 @@ GO(gtk_toolbar_prepend_space, vFp)
GO(gtk_toolbar_prepend_widget, vFpppp)
GO(gtk_toolbar_remove_space, vFpi)
GO(gtk_toolbar_set_drop_highlight_item, vFppi)
-GO(gtk_toolbar_set_icon_size, vFpi)
-GO(gtk_toolbar_set_orientation, vFpi)
+GO(gtk_toolbar_set_icon_size, vFpu)
+GO(gtk_toolbar_set_orientation, vFpu)
GO(gtk_toolbar_set_show_arrow, vFpi)
-GO(gtk_toolbar_set_style, vFpi)
+GO(gtk_toolbar_set_style, vFpu)
GO(gtk_toolbar_set_tooltips, vFpi)
GO(gtk_toolbar_space_style_get_type, LFv)
GO(gtk_toolbar_style_get_type, LFv)
@@ -3144,100 +3144,100 @@ GO(gtk_tool_button_set_label, vFpp)
GO(gtk_tool_button_set_label_widget, vFpp)
GO(gtk_tool_button_set_stock_id, vFpp)
GO(gtk_tool_button_set_use_underline, vFpi)
-//GO(gtk_tool_item_get_ellipsize_mode,
+GO(gtk_tool_item_get_ellipsize_mode, uFp)
//GO(gtk_tool_item_get_expand,
//GO(gtk_tool_item_get_homogeneous,
-//GO(gtk_tool_item_get_icon_size,
+GO(gtk_tool_item_get_icon_size, uFp)
//GO(gtk_tool_item_get_is_important,
//GO(gtk_tool_item_get_orientation,
-//GO(gtk_tool_item_get_proxy_menu_item,
-//GO(gtk_tool_item_get_relief_style,
-//GO(gtk_tool_item_get_text_alignment,
-//GO(gtk_tool_item_get_text_orientation,
-//GO(gtk_tool_item_get_text_size_group,
-//GO(gtk_tool_item_get_toolbar_style,
+GO(gtk_tool_item_get_proxy_menu_item, pFpp)
+GO(gtk_tool_item_get_relief_style, uFp)
+GO(gtk_tool_item_get_text_alignment, fFp)
+GO(gtk_tool_item_get_text_orientation, uFp)
+GO(gtk_tool_item_get_text_size_group, pFp)
+GO(gtk_tool_item_get_toolbar_style, uFp)
GO(gtk_tool_item_get_type, LFv)
//GO(gtk_tool_item_get_use_drag_window,
//GO(gtk_tool_item_get_visible_horizontal,
//GO(gtk_tool_item_get_visible_vertical,
-//GO(gtk_tool_item_group_get_collapsed,
-//GO(gtk_tool_item_group_get_drop_item,
-//GO(gtk_tool_item_group_get_ellipsize,
-//GO(gtk_tool_item_group_get_header_relief,
-//GO(gtk_tool_item_group_get_item_position,
-//GO(gtk_tool_item_group_get_label,
-//GO(gtk_tool_item_group_get_label_widget,
-//GO(gtk_tool_item_group_get_n_items,
-//GO(gtk_tool_item_group_get_nth_item,
+GO(gtk_tool_item_group_get_collapsed, iFp)
+GO(gtk_tool_item_group_get_drop_item, pFpii)
+GO(gtk_tool_item_group_get_ellipsize, uFp)
+GO(gtk_tool_item_group_get_header_relief, uFp)
+GO(gtk_tool_item_group_get_item_position, iFpp)
+GO(gtk_tool_item_group_get_label, pFp)
+GO(gtk_tool_item_group_get_label_widget, pFp)
+GO(gtk_tool_item_group_get_n_items, uFp)
+GO(gtk_tool_item_group_get_nth_item, pFpu)
GO(gtk_tool_item_group_get_type, LFv)
//GO(gtk_tool_item_group_insert,
//GO(gtk_tool_item_group_new,
-//GO(gtk_tool_item_group_set_collapsed,
-//GO(gtk_tool_item_group_set_ellipsize,
-//GO(gtk_tool_item_group_set_header_relief,
-//GO(gtk_tool_item_group_set_item_position,
-//GO(gtk_tool_item_group_set_label,
-//GO(gtk_tool_item_group_set_label_widget,
+GO(gtk_tool_item_group_set_collapsed, vFpi)
+GO(gtk_tool_item_group_set_ellipsize, vFpu)
+GO(gtk_tool_item_group_set_header_relief, vFpu)
+GO(gtk_tool_item_group_set_item_position, vFppi)
+GO(gtk_tool_item_group_set_label, vFpp)
+GO(gtk_tool_item_group_set_label_widget, vFpp)
//GO(gtk_tool_item_new,
//GO(gtk_tool_item_rebuild_menu,
-//GO(gtk_tool_item_retrieve_proxy_menu_item,
+GO(gtk_tool_item_retrieve_proxy_menu_item, pFp)
//GO(gtk_tool_item_set_expand,
//GO(gtk_tool_item_set_homogeneous,
-//GO(gtk_tool_item_set_is_important,
-//GO(gtk_tool_item_set_proxy_menu_item,
-//GO(gtk_tool_item_set_tooltip,
-//GO(gtk_tool_item_set_tooltip_markup,
+GO(gtk_tool_item_set_is_important, vFpi)
+GO(gtk_tool_item_set_proxy_menu_item, vFppp)
+GO(gtk_tool_item_set_tooltip, vFpppp)
+GO(gtk_tool_item_set_tooltip_markup, vFpp)
//GO(gtk_tool_item_set_tooltip_text,
//GO(gtk_tool_item_set_use_drag_window,
//GO(gtk_tool_item_set_visible_horizontal,
//GO(gtk_tool_item_set_visible_vertical,
-//GO(gtk_tool_item_toolbar_reconfigured,
-//GO(gtk_tool_palette_add_drag_dest,
+GO(gtk_tool_item_toolbar_reconfigured, vFp)
+GO(gtk_tool_palette_add_drag_dest, vFppuuu)
GO(gtk_tool_palette_drag_targets_get_type, LFv)
//GO(gtk_tool_palette_get_drag_item,
-//GO(gtk_tool_palette_get_drag_target_group,
+GO(gtk_tool_palette_get_drag_target_group, pFv)
//GO(gtk_tool_palette_get_drag_target_item,
-//GO(gtk_tool_palette_get_drop_group,
-//GO(gtk_tool_palette_get_drop_item,
+GO(gtk_tool_palette_get_drop_group, pFpii)
+GO(gtk_tool_palette_get_drop_item, pFpii)
//GO(gtk_tool_palette_get_exclusive,
-//GO(gtk_tool_palette_get_expand,
-//GO(gtk_tool_palette_get_group_position,
+GO(gtk_tool_palette_get_expand, iFpp)
+GO(gtk_tool_palette_get_group_position, iFpp)
//GO(gtk_tool_palette_get_hadjustment,
-//GO(gtk_tool_palette_get_icon_size,
-//GO(gtk_tool_palette_get_style,
+GO(gtk_tool_palette_get_icon_size, uFp)
+GO(gtk_tool_palette_get_style, uFp)
GO(gtk_tool_palette_get_type, LFv)
-//GO(gtk_tool_palette_get_vadjustment,
+GO(gtk_tool_palette_get_vadjustment, pFp)
//GO(gtk_tool_palette_new,
-//GO(gtk_tool_palette_set_drag_source,
+GO(gtk_tool_palette_set_drag_source, vFpu)
//GO(gtk_tool_palette_set_exclusive,
-//GO(gtk_tool_palette_set_expand,
-//GO(gtk_tool_palette_set_group_position,
-//GO(gtk_tool_palette_set_icon_size,
-//GO(gtk_tool_palette_set_style,
+GO(gtk_tool_palette_set_expand, vFppi)
+GO(gtk_tool_palette_set_group_position, vFppi)
+GO(gtk_tool_palette_set_icon_size, vFpu)
+GO(gtk_tool_palette_set_style, vFpu)
//GO(gtk_tool_palette_unset_icon_size,
-//GO(gtk_tool_palette_unset_style,
-//GO(gtk_tool_shell_get_ellipsize_mode,
-//GO(gtk_tool_shell_get_icon_size,
+GO(gtk_tool_palette_unset_style, vFp)
+GO(gtk_tool_shell_get_ellipsize_mode, uFp)
+GO(gtk_tool_shell_get_icon_size, uFp)
//GO(gtk_tool_shell_get_orientation,
-//GO(gtk_tool_shell_get_relief_style,
-//GO(gtk_tool_shell_get_style,
-//GO(gtk_tool_shell_get_text_alignment,
-//GO(gtk_tool_shell_get_text_orientation,
-//GO(gtk_tool_shell_get_text_size_group,
+GO(gtk_tool_shell_get_relief_style, uFp)
+GO(gtk_tool_shell_get_style, uFp)
+GO(gtk_tool_shell_get_text_alignment, fFp)
+GO(gtk_tool_shell_get_text_orientation, uFp)
+GO(gtk_tool_shell_get_text_size_group, pFp)
GO(gtk_tool_shell_get_type, LFv)
-//GO(gtk_tool_shell_rebuild_menu,
+GO(gtk_tool_shell_rebuild_menu, vFp)
GO(gtk_tooltip_get_type, LFv)
GO(gtk_tooltips_data_get, pFp)
GO(gtk_tooltips_disable, vFp)
GO(gtk_tooltips_enable, vFp)
-//GO(gtk_tooltip_set_custom,
-//GO(gtk_tooltip_set_icon,
-//GO(gtk_tooltip_set_icon_from_gicon,
-//GO(gtk_tooltip_set_icon_from_icon_name,
+GO(gtk_tooltip_set_custom, vFpp)
+GO(gtk_tooltip_set_icon, vFpp)
+GO(gtk_tooltip_set_icon_from_gicon, vFppu)
+GO(gtk_tooltip_set_icon_from_icon_name, vFppu)
//GO(gtk_tooltip_set_icon_from_stock,
//GO(gtk_tooltip_set_markup,
-//GO(gtk_tooltip_set_text,
-//GO(gtk_tooltip_set_tip_area,
+GO(gtk_tooltip_set_text, vFpp)
+GO(gtk_tooltip_set_tip_area, vFpp)
GO(gtk_tooltips_force_window, vFp)
GO(gtk_tooltips_get_info_from_tip_window, iFppp)
GO(gtk_tooltips_get_type, LFv)
@@ -3252,7 +3252,7 @@ GO(gtk_tray_icon_get_type, LFv)
//GO(gtk_tree_drag_dest_drag_data_received,
GO(gtk_tree_drag_dest_get_type, LFv)
//GO(gtk_tree_drag_dest_row_drop_possible,
-//GO(gtk_tree_drag_source_drag_data_delete,
+GO(gtk_tree_drag_source_drag_data_delete, iFpp)
//GO(gtk_tree_drag_source_drag_data_get,
GO(gtk_tree_drag_source_get_type, LFv)
//GO(gtk_tree_drag_source_row_draggable,
@@ -3271,23 +3271,23 @@ GO(gtk_tree_item_get_type, LFv)
GO(gtk_tree_iter_copy, pFp)
GO(gtk_tree_iter_free, vFp)
GO(gtk_tree_iter_get_type, LFv)
-//GO(gtk_tree_model_filter_clear_cache,
-//GO(gtk_tree_model_filter_convert_child_iter_to_iter,
+GO(gtk_tree_model_filter_clear_cache, vFp)
+GO(gtk_tree_model_filter_convert_child_iter_to_iter, iFppp)
//GO(gtk_tree_model_filter_convert_child_path_to_path,
-//GO(gtk_tree_model_filter_convert_iter_to_child_iter,
-//GO(gtk_tree_model_filter_convert_path_to_child_path,
-//GO(gtk_tree_model_filter_get_model,
+GO(gtk_tree_model_filter_convert_iter_to_child_iter, vFppp)
+GO(gtk_tree_model_filter_convert_path_to_child_path, pFpp)
+GO(gtk_tree_model_filter_get_model, pFp)
GO(gtk_tree_model_filter_get_type, LFv)
-//GO(gtk_tree_model_filter_new,
+GO(gtk_tree_model_filter_new, pFpp)
//GO(gtk_tree_model_filter_refilter,
//GO(gtk_tree_model_filter_set_modify_func,
-//GO(gtk_tree_model_filter_set_visible_column,
+GO(gtk_tree_model_filter_set_visible_column, vFpi)
//GO(gtk_tree_model_filter_set_visible_func,
GO(gtk_tree_model_flags_get_type, LFv)
GOM(gtk_tree_model_foreach, vFEppp)
GOM(gtk_tree_model_get, vFEppV)
-GO(gtk_tree_model_get_column_type, iFpi)
-GO(gtk_tree_model_get_flags, iFp)
+GO(gtk_tree_model_get_column_type, LFpi)
+GO(gtk_tree_model_get_flags, uFp)
GO(gtk_tree_model_get_iter, iFppp)
GO(gtk_tree_model_get_iter_first, iFpp)
GO(gtk_tree_model_get_iter_from_string, iFppp)
@@ -3317,7 +3317,7 @@ GO(gtk_tree_model_rows_reordered, vFpppp)
//GO(gtk_tree_model_sort_get_model,
GO(gtk_tree_model_sort_get_type, LFv)
//GO(gtk_tree_model_sort_iter_is_valid,
-//GO(gtk_tree_model_sort_new_with_model,
+GO(gtk_tree_model_sort_new_with_model, pFp)
//GO(gtk_tree_model_sort_reset_default_sort_func,
GO(gtk_tree_model_unref_node, vFpp)
//GO(gtk_tree_new,
@@ -3386,7 +3386,7 @@ GO(gtk_tree_sortable_get_sort_column_id, iFppp)
GO(gtk_tree_sortable_get_type, LFv)
GO(gtk_tree_sortable_has_default_sort_func, iFp)
GOM(gtk_tree_sortable_set_default_sort_func, vFEpppp)
-GO(gtk_tree_sortable_set_sort_column_id, vFpii)
+GO(gtk_tree_sortable_set_sort_column_id, vFpiu)
GOM(gtk_tree_sortable_set_sort_func, vFEpippp)
GO(gtk_tree_sortable_sort_column_changed, vFp)
GO(gtk_tree_store_append, vFppp)
@@ -3436,10 +3436,10 @@ GO(gtk_tree_view_column_get_max_width, iFp)
GO(gtk_tree_view_column_get_min_width, iFp)
GO(gtk_tree_view_column_get_reorderable, iFp)
GO(gtk_tree_view_column_get_resizable, iFp)
-GO(gtk_tree_view_column_get_sizing, iFp)
+GO(gtk_tree_view_column_get_sizing, uFp)
GO(gtk_tree_view_column_get_sort_column_id, iFp)
GO(gtk_tree_view_column_get_sort_indicator, iFp)
-GO(gtk_tree_view_column_get_sort_order, iFp)
+GO(gtk_tree_view_column_get_sort_order, uFp)
GO(gtk_tree_view_column_get_spacing, iFp)
GO(gtk_tree_view_column_get_title, pFp)
GO(gtk_tree_view_column_get_tree_view, pFp)
@@ -3463,10 +3463,10 @@ GO(gtk_tree_view_column_set_max_width, vFpi)
GO(gtk_tree_view_column_set_min_width, vFpi)
GO(gtk_tree_view_column_set_reorderable, vFpi)
GO(gtk_tree_view_column_set_resizable, vFpi)
-GO(gtk_tree_view_column_set_sizing, vFpi)
-GO(gtk_tree_view_column_set_sort_column_id, iFp)
+GO(gtk_tree_view_column_set_sizing, vFpu)
+GO(gtk_tree_view_column_set_sort_column_id, vFpi)
GO(gtk_tree_view_column_set_sort_indicator, vFpi)
-GO(gtk_tree_view_column_set_sort_order, vFpi)
+GO(gtk_tree_view_column_set_sort_order, vFpu)
GO(gtk_tree_view_column_set_spacing, vFpi)
GO(gtk_tree_view_column_set_title, vFpp)
GO(gtk_tree_view_column_set_visible, vFpi)
@@ -3481,7 +3481,7 @@ GO(gtk_tree_view_convert_widget_to_tree_coords, vFpiipp)
GO(gtk_tree_view_create_row_drag_icon, pFpp)
GO(gtk_tree_view_drop_position_get_type, LFv)
GO(gtk_tree_view_enable_model_drag_dest, vFppiu)
-GO(gtk_tree_view_enable_model_drag_source, vFpipiu)
+GO(gtk_tree_view_enable_model_drag_source, vFpupiu)
GO(gtk_tree_view_expand_all, vFp)
GO(gtk_tree_view_expand_row, iFppi)
GO(gtk_tree_view_expand_to_path, vFpp)
@@ -3497,7 +3497,7 @@ GO(gtk_tree_view_get_enable_search, iFp)
GO(gtk_tree_view_get_enable_tree_lines, iFp)
GO(gtk_tree_view_get_expander_column, pFp)
GO(gtk_tree_view_get_fixed_height_mode, iFp)
-GO(gtk_tree_view_get_grid_lines, iFp)
+GO(gtk_tree_view_get_grid_lines, uFp)
GO(gtk_tree_view_get_hadjustment, pFp)
GO(gtk_tree_view_get_headers_clickable, iFp)
GO(gtk_tree_view_get_headers_visible, iFp)
@@ -3533,7 +3533,7 @@ GO(gtk_tree_view_move_column_after, vFppp)
GO(gtk_tree_view_new, pFv)
GO(gtk_tree_view_new_with_model, pFp)
GO(gtk_tree_view_remove_column, iFpp)
-GO(gtk_tree_view_row_activated, vFp)
+GO(gtk_tree_view_row_activated, vFppp)
GO(gtk_tree_view_row_expanded, iFpp)
GO(gtk_tree_view_scroll_to_cell, vFpppiff)
GO(gtk_tree_view_scroll_to_point, vFpii)
@@ -3541,12 +3541,12 @@ GO(gtk_tree_view_scroll_to_point, vFpii)
GO(gtk_tree_view_set_cursor, vFpppi)
GO(gtk_tree_view_set_cursor_on_cell, vFppppi)
//GOM(gtk_tree_view_set_destroy_count_func, vFEpBpB)
-GO(gtk_tree_view_set_drag_dest_row, vFppi)
+GO(gtk_tree_view_set_drag_dest_row, vFppu)
GO(gtk_tree_view_set_enable_search, vFpi)
GO(gtk_tree_view_set_enable_tree_lines, vFpi)
GO(gtk_tree_view_set_expander_column, vFpp)
GO(gtk_tree_view_set_fixed_height_mode, vFpi)
-GO(gtk_tree_view_set_grid_lines, vFpi)
+GO(gtk_tree_view_set_grid_lines, vFpu)
GO(gtk_tree_view_set_hadjustment, vFpp)
GO(gtk_tree_view_set_headers_clickable, vFpi)
GO(gtk_tree_view_set_headers_visible, vFpi)
@@ -3573,22 +3573,22 @@ GO(gtk_tree_view_unset_rows_drag_source, vFp)
GO(gtk_tree_view_widget_to_tree_coords, vFpiipp)
GO(gtk_true, iFv)
GOM(gtk_type_class, pFEi)
-GO(gtk_type_enum_find_value, pFip)
-GO(gtk_type_enum_get_values, pFi)
-GO(gtk_type_flags_find_value, pFip)
-GO(gtk_type_flags_get_values, pFi)
-GO(gtk_type_init, vFi)
-GO(gtk_type_new, pFi)
+GO(gtk_type_enum_find_value, pFLp)
+GO(gtk_type_enum_get_values, pFL)
+GO(gtk_type_flags_find_value, pFLp)
+GO(gtk_type_flags_get_values, pFL)
+GO(gtk_type_init, vFu)
+GO(gtk_type_new, pFL)
GOM(gtk_type_unique, iFEpp)
-GO(gtk_ui_manager_add_ui, vFpipppii)
+GO(gtk_ui_manager_add_ui, vFpupppui)
GO(gtk_ui_manager_add_ui_from_file, uFppp)
-GO(gtk_ui_manager_add_ui_from_string, uFppLp)
+GO(gtk_ui_manager_add_ui_from_string, uFpplp)
GO(gtk_ui_manager_ensure_update, vFp)
GO(gtk_ui_manager_get_accel_group, pFp)
GO(gtk_ui_manager_get_action, pFpp)
GO(gtk_ui_manager_get_action_groups, pFp)
GO(gtk_ui_manager_get_add_tearoffs, iFp)
-GO(gtk_ui_manager_get_toplevels, pFpi)
+GO(gtk_ui_manager_get_toplevels, pFpu)
GO(gtk_ui_manager_get_type, LFv)
GO(gtk_ui_manager_get_ui, pFp)
GO(gtk_ui_manager_get_widget, pFpp)
@@ -3607,17 +3607,17 @@ GO(gtk_vbutton_box_get_layout_default, iFv)
GO(gtk_vbutton_box_get_spacing_default, iFv)
GO(gtk_vbutton_box_get_type, LFv)
GO(gtk_vbutton_box_new, pFv)
-GO(gtk_vbutton_box_set_layout_default, vFi)
+GO(gtk_vbutton_box_set_layout_default, vFu)
GO(gtk_vbutton_box_set_spacing_default, vFi)
GO(gtk_viewport_get_bin_window, pFp)
GO(gtk_viewport_get_hadjustment, pFp)
-GO(gtk_viewport_get_shadow_type, iFp)
+GO(gtk_viewport_get_shadow_type, uFp)
GO(gtk_viewport_get_type, LFv)
GO(gtk_viewport_get_vadjustment, pFp)
GO(gtk_viewport_get_view_window, pFp)
GO(gtk_viewport_new, pFpp)
GO(gtk_viewport_set_hadjustment, vFpp)
-GO(gtk_viewport_set_shadow_type, vFpi)
+GO(gtk_viewport_set_shadow_type, vFpu)
GO(gtk_viewport_set_vadjustment, vFpp)
GO(gtk_visibility_get_type, LFv)
GO(gtk_volume_button_get_type, LFv)
@@ -3658,7 +3658,7 @@ GO(gtk_widget_freeze_child_notify, vFp)
GO(gtk_widget_get_accessible, pFp)
GO(gtk_widget_get_action, pFp)
GO(gtk_widget_get_allocation, vFpp)
-GO(gtk_widget_get_ancestor, pFpi)
+GO(gtk_widget_get_ancestor, pFpL)
GO(gtk_widget_get_app_paintable, iFp)
GO(gtk_widget_get_can_default, iFp)
GO(gtk_widget_get_can_focus, iFp)
@@ -3668,14 +3668,14 @@ GO(gtk_widget_get_clipboard, pFpp)
GO(gtk_widget_get_colormap, pFp)
GO(gtk_widget_get_composite_name, pFp)
GO(gtk_widget_get_default_colormap, pFv)
-GO(gtk_widget_get_default_direction, iFv)
+GO(gtk_widget_get_default_direction, uFv)
GO(gtk_widget_get_default_style, pFv)
GO(gtk_widget_get_default_visual, pFv)
-GO(gtk_widget_get_direction, iFp)
+GO(gtk_widget_get_direction, uFp)
GO(gtk_widget_get_display, pFp)
GO(gtk_widget_get_double_buffered, iFp)
GO(gtk_widget_get_events, iFp)
-GO(gtk_widget_get_extension_events, iFp)
+GO(gtk_widget_get_extension_events, uFp)
GO(gtk_widget_get_has_tooltip, iFp)
GO(gtk_widget_get_has_window, iFp)
GO(gtk_widget_get_mapped, iFp)
@@ -3695,7 +3695,7 @@ GO(gtk_widget_get_sensitive, iFp)
GO(gtk_widget_get_settings, pFp)
GO(gtk_widget_get_size_request, vFppp)
GO(gtk_widget_get_snapshot, pFpp)
-GO(gtk_widget_get_state, iFp)
+GO(gtk_widget_get_state, uFp)
GO(gtk_widget_get_style, pFp)
GO(gtk_widget_get_tooltip_markup, pFp)
GO(gtk_widget_get_tooltip_text, pFp)
@@ -3724,12 +3724,12 @@ GO(gtk_widget_is_drawable, iFp)
GO(gtk_widget_is_focus, iFp)
GO(gtk_widget_is_sensitive, iFp)
GO(gtk_widget_is_toplevel, iFp)
-GO(gtk_widget_keynav_failed, iFpi)
+GO(gtk_widget_keynav_failed, iFpu)
GO(gtk_widget_list_accel_closures, pFp)
GO(gtk_widget_list_mnemonic_labels, pFp)
GO(gtk_widget_map, vFp)
GO(gtk_widget_mnemonic_activate, iFpi)
-GO(gtk_widget_modify_base, vFpip)
+GO(gtk_widget_modify_base, vFpup)
GO(gtk_widget_modify_bg, vFpip)
GO(gtk_widget_modify_cursor, vFppp)
GO(gtk_widget_modify_fg, vFpip)
@@ -3753,7 +3753,7 @@ GO(gtk_widget_ref, pFp)
GO(gtk_widget_region_intersect, pFpp)
GO(gtk_widget_remove_accelerator, iFppui)
GO(gtk_widget_remove_mnemonic_label, vFpp)
-GO(gtk_widget_render_icon, pFppip)
+GO(gtk_widget_render_icon, pFppup)
GO(gtk_widget_reparent, vFpp)
GO(gtk_widget_reset_rc_styles, vFp)
GO(gtk_widget_reset_shapes, vFp)
@@ -3769,11 +3769,11 @@ GO(gtk_widget_set_child_visible, vFpi)
GO(gtk_widget_set_colormap, vFpp)
GO(gtk_widget_set_composite_name, vFpp)
GO(gtk_widget_set_default_colormap, vFp)
-GO(gtk_widget_set_default_direction, vFi)
-GO(gtk_widget_set_direction, vFpi)
+GO(gtk_widget_set_default_direction, vFu)
+GO(gtk_widget_set_direction, vFpu)
GO(gtk_widget_set_double_buffered, vFpi)
GO(gtk_widget_set_events, vFpi)
-GO(gtk_widget_set_extension_events, vFpi)
+GO(gtk_widget_set_extension_events, vFpu)
GO(gtk_widget_set_has_tooltip, vFpi)
GO(gtk_widget_set_has_window, vFpi)
GO(gtk_widget_set_mapped, vFpi)
@@ -3787,7 +3787,7 @@ GO(gtk_widget_set_redraw_on_allocate, vFpi)
GO(gtk_widget_set_scroll_adjustments, iFppp)
GO(gtk_widget_set_sensitive, vFpi)
GO(gtk_widget_set_size_request, vFpii)
-GO(gtk_widget_set_state, vFpi)
+GO(gtk_widget_set_state, vFpu)
GO(gtk_widget_set_style, vFpp)
GO(gtk_widget_set_tooltip_markup, vFpp)
GO(gtk_widget_set_tooltip_text, vFpp)
@@ -3834,13 +3834,13 @@ GO(gtk_window_get_destroy_with_parent, iFp)
GO(gtk_window_get_focus, pFp)
GO(gtk_window_get_focus_on_map, iFp)
GO(gtk_window_get_frame_dimensions, vFppppp)
-GO(gtk_window_get_gravity, iFp)
+GO(gtk_window_get_gravity, uFp)
GO(gtk_window_get_group, pFp)
GO(gtk_window_get_has_frame, iFp)
GO(gtk_window_get_icon, pFp)
GO(gtk_window_get_icon_list, pFp)
GO(gtk_window_get_icon_name, pFp)
-GO(gtk_window_get_mnemonic_modifier, iFp)
+GO(gtk_window_get_mnemonic_modifier, uFp)
GO(gtk_window_get_mnemonics_visible, iFp)
GO(gtk_window_get_modal, iFp)
GO(gtk_window_get_opacity, dFp)
@@ -3854,7 +3854,7 @@ GO(gtk_window_get_skip_taskbar_hint, iFp)
GO(gtk_window_get_title, pFp)
GO(gtk_window_get_transient_for, pFp)
GO(gtk_window_get_type, LFv)
-GO(gtk_window_get_type_hint, iFp)
+GO(gtk_window_get_type_hint, uFp)
GO(gtk_window_get_urgency_hint, iFp)
GO(gtk_window_get_window_type, uFp)
GO(gtk_window_group_add_window, vFpp)
@@ -3871,7 +3871,7 @@ GO(gtk_window_list_toplevels, pFv)
GO(gtk_window_maximize, vFp)
GO(gtk_window_mnemonic_activate, iFpui)
GO(gtk_window_move, vFpii)
-GO(gtk_window_new, pFi)
+GO(gtk_window_new, pFu)
GO(gtk_window_parse_geometry, iFpp)
GO(gtk_window_position_get_type, LFv)
GO(gtk_window_present, vFp)
@@ -3896,8 +3896,8 @@ GO(gtk_window_set_destroy_with_parent, vFpi)
GO(gtk_window_set_focus, vFpp)
GO(gtk_window_set_focus_on_map, vFpi)
GO(gtk_window_set_frame_dimensions, vFpiiii)
-GO(gtk_window_set_geometry_hints, vFpppi)
-GO(gtk_window_set_gravity, vFpi)
+GO(gtk_window_set_geometry_hints, vFpppu)
+GO(gtk_window_set_gravity, vFpu)
GO(gtk_window_set_has_frame, vFpi)
GO(gtk_window_set_icon, vFpp)
GO(gtk_window_set_icon_from_file, iFppp)
@@ -3905,12 +3905,12 @@ GO(gtk_window_set_icon_list, vFpp)
GO(gtk_window_set_icon_name, vFpp)
GO(gtk_window_set_keep_above, vFpi)
GO(gtk_window_set_keep_below, vFpi)
-GO(gtk_window_set_mnemonic_modifier, vFpi)
+GO(gtk_window_set_mnemonic_modifier, vFpu)
GO(gtk_window_set_mnemonics_visible, vFpi)
GO(gtk_window_set_modal, vFpi)
GO(gtk_window_set_opacity, vFpd)
GO(gtk_window_set_policy, vFpiii)
-GO(gtk_window_set_position, vFpi)
+GO(gtk_window_set_position, vFpu)
GO(gtk_window_set_resizable, vFpi)
GO(gtk_window_set_role, vFpp)
GO(gtk_window_set_screen, vFpp)
@@ -3919,7 +3919,7 @@ GO(gtk_window_set_skip_taskbar_hint, vFpi)
GO(gtk_window_set_startup_id, vFpp)
GO(gtk_window_set_title, vFpp)
GO(gtk_window_set_transient_for, vFpp)
-GO(gtk_window_set_type_hint, vFpi)
+GO(gtk_window_set_type_hint, vFpu)
GO(gtk_window_set_urgency_hint, vFpi)
GO(gtk_window_set_wmclass, vFppp)
GO(gtk_window_stick, vFp)
diff --git a/src/wrapped/wrappedicui18n67.c b/src/wrapped/wrappedicui18n67.c
new file mode 100644
index 0000000..13630f3
--- /dev/null
+++ b/src/wrapped/wrappedicui18n67.c
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+#include "myalign.h"
+
+const char* icui18n67Name = "libicui18n.so.67";
+#define LIBNAME icui18n67
+
+#define CUSTOM_INIT \
+ SETALT(my67_); \
+ setNeededLibs(lib, 1, "libicuuc.so.67");
+
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedicui18n67_private.h b/src/wrapped/wrappedicui18n67_private.h
new file mode 100644
index 0000000..431164b
--- /dev/null
+++ b/src/wrapped/wrappedicui18n67_private.h
@@ -0,0 +1,100 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error meh!
+#endif
+
+GO(ucal_add_67, vFpiip)
+GO(ucal_clear_67, vFp)
+GO(ucal_clearField_67, vFpi)
+GO(ucal_clone_67, pFpp)
+GO(ucal_close_67, vFp)
+GO(ucal_countAvailable_67, iFv)
+GO(ucal_equivalentTo_67, cFpp)
+GO(ucal_get_67, iFpip)
+GO(ucal_getAttribute_67, iFpi)
+GO(ucal_getAvailable_67, pFi)
+GO(ucal_getCanonicalTimeZoneID_67, iFpipipp)
+GO(ucal_getDayOfWeekType_67, iFpip)
+GO(ucal_getDefaultTimeZone_67, iFpip)
+GO(ucal_getDSTSavings_67, iFpp)
+GO(ucal_getFieldDifference_67, iFpdip)
+GO(ucal_getGregorianChange_67, dFpp)
+GO(ucal_getHostTimeZone_67, iFpip)
+GO(ucal_getKeywordValuesForLocale_67, pFppCp)
+GO(ucal_getLimit_67, iFpiip)
+GO(ucal_getLocaleByType_67, pFpip)
+GO(ucal_getMillis_67, dFpp)
+GO(ucal_getNow_67, dFv)
+GO(ucal_getTimeZoneDisplayName_67, iFpippip)
+GO(ucal_getTimeZoneID_67, iFppip)
+GO(ucal_getTimeZoneIDForWindowsID_67, iFpippip)
+GO(ucal_getTimeZoneOffsetFromLocal_67, vFpiippp)
+GO(ucal_getTimeZoneTransitionDate_67, cFpipp)
+GO(ucal_getType_67, pFpp)
+GO(ucal_getTZDataVersion_67, pFp)
+GO(ucal_getWeekendTransition_67, iFpip)
+GO(ucal_getWindowsTimeZoneID_67, iFpipip)
+GO(ucal_inDaylightTime_67, cFpp)
+GO(ucal_isSet_67, cFpi)
+GO(ucal_isWeekend_67, cFpdp)
+GO(ucal_open_67, pFpipip)
+GO(ucal_openCountryTimeZones_67, pFpp)
+GO(ucal_openTimeZoneIDEnumeration_67, pFippp)
+GO(ucal_openTimeZones_67, pFp)
+GO(ucal_roll_67, vFpiip)
+GO(ucal_set_67, vFpii)
+GO(ucal_setAttribute_67, vFpii)
+GO(ucal_setDate_67, vFpiiip)
+GO(ucal_setDateTime_67, vFpiiiiiip)
+GO(ucal_setDefaultTimeZone_67, vFpp)
+GO(ucal_setGregorianChange_67, vFpdp)
+GO(ucal_setMillis_67, vFpdp)
+GO(ucal_setTimeZone_67, vFppip)
+
+GO(ucol_clone_67, pFpp)
+GO(ucol_close_67, vFp)
+GO(ucol_closeElements_67, vFp)
+GO(ucol_setMaxVariable_67, vFpip)
+GO(ucol_getOffset_67, iFp)
+GO(ucol_getRules_67, pFpp)
+GO(ucol_getSortKey_67, iFppipi)
+GO(ucol_getStrength_67, iFp)
+GO(ucol_getVersion_67, vFpp)
+GO(ucol_next_67, iFpp)
+GO(ucol_previous_67, iFpp)
+GO(ucol_open_67, pFpp)
+GO(ucol_openElements_67, pFppip)
+GO(ucol_openRules_67, pFpiiipp)
+GO(ucol_safeClone_67, pFpppp)
+GO(ucol_setAttribute_67, vFpiip)
+GO(ucol_setVariableTop_67, uFppip)
+GO(ucol_strcoll_67, iFppipi)
+
+GO(udat_close_67, vFp)
+GO(udat_countSymbols_67, iFpi)
+GO(udat_getSymbols_67, iFpiipip)
+GO(udat_format_67, iFpdpipp)
+GO(udat_open_67, pFiippipip)
+GO(udat_setCalendar_67, vFpp)
+GO(udat_toPattern_67, iFpCpip)
+
+GO(unum_close_67, vFp)
+GO(unum_getAttribute_67, iFpi)
+GO(unum_getSymbol_67, iFpipip)
+GO(unum_open_67, pFipippp)
+GO(unum_toPattern_67, iFpCpip)
+
+GO(udatpg_close_67, vFp)
+GO(udatpg_getBestPattern_67, iFppipip)
+GO(udatpg_open_67, pFpp)
+
+GO(ulocdata_getCLDRVersion_67, vFpp)
+GO(ulocdata_getMeasurementSystem_67, iFpp)
+
+GO(usearch_close_67, vFp)
+GO(usearch_first_67, iFpp)
+GO(usearch_getBreakIterator_67, pFp)
+GO(usearch_getMatchedLength_67, iFp)
+GO(usearch_last_67, iFpp)
+GO(usearch_openFromCollator_67, pFpipippp)
+GO(usearch_setPattern_67, vFppip)
+GO(usearch_setText_67, vFppip)
diff --git a/src/wrapped/wrappedicui18n72.c b/src/wrapped/wrappedicui18n72.c
new file mode 100644
index 0000000..7a39dd1
--- /dev/null
+++ b/src/wrapped/wrappedicui18n72.c
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+#include "myalign.h"
+
+const char* icui18n72Name = "libicui18n.so.72";
+#define LIBNAME icui18n72
+
+#define CUSTOM_INIT \
+ SETALT(my72_); \
+ setNeededLibs(lib, 1, "libicuuc.so.72");
+
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedicui18n72_private.h b/src/wrapped/wrappedicui18n72_private.h
new file mode 100644
index 0000000..351b7e6
--- /dev/null
+++ b/src/wrapped/wrappedicui18n72_private.h
@@ -0,0 +1,103 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error meh!
+#endif
+
+// UDate is double
+// UBool is int8_t
+
+GO(ucal_add_72, vFpiip)
+GO(ucal_clear_72, vFp)
+GO(ucal_clearField_72, vFpi)
+GO(ucal_clone_72, pFpp)
+GO(ucal_close_72, vFp)
+GO(ucal_countAvailable_72, iFv)
+GO(ucal_equivalentTo_72, cFpp)
+GO(ucal_get_72, iFpip)
+GO(ucal_getAttribute_72, iFpi)
+GO(ucal_getAvailable_72, pFi)
+GO(ucal_getCanonicalTimeZoneID_72, iFpipipp)
+GO(ucal_getDayOfWeekType_72, iFpip)
+GO(ucal_getDefaultTimeZone_72, iFpip)
+GO(ucal_getDSTSavings_72, iFpp)
+GO(ucal_getFieldDifference_72, iFpdip)
+GO(ucal_getGregorianChange_72, dFpp)
+GO(ucal_getHostTimeZone_72, iFpip)
+GO(ucal_getKeywordValuesForLocale_72, pFppCp)
+GO(ucal_getLimit_72, iFpiip)
+GO(ucal_getLocaleByType_72, pFpip)
+GO(ucal_getMillis_72, dFpp)
+GO(ucal_getNow_72, dFv)
+GO(ucal_getTimeZoneDisplayName_72, iFpippip)
+GO(ucal_getTimeZoneID_72, iFppip)
+GO(ucal_getTimeZoneIDForWindowsID_72, iFpippip)
+GO(ucal_getTimeZoneOffsetFromLocal_72, vFpiippp)
+GO(ucal_getTimeZoneTransitionDate_72, cFpipp)
+GO(ucal_getType_72, pFpp)
+GO(ucal_getTZDataVersion_72, pFp)
+GO(ucal_getWeekendTransition_72, iFpip)
+GO(ucal_getWindowsTimeZoneID_72, iFpipip)
+GO(ucal_inDaylightTime_72, cFpp)
+GO(ucal_isSet_72, cFpi)
+GO(ucal_isWeekend_72, cFpdp)
+GO(ucal_open_72, pFpipip)
+GO(ucal_openCountryTimeZones_72, pFpp)
+GO(ucal_openTimeZoneIDEnumeration_72, pFippp)
+GO(ucal_openTimeZones_72, pFp)
+GO(ucal_roll_72, vFpiip)
+GO(ucal_set_72, vFpii)
+GO(ucal_setAttribute_72, vFpii)
+GO(ucal_setDate_72, vFpiiip)
+GO(ucal_setDateTime_72, vFpiiiiiip)
+GO(ucal_setDefaultTimeZone_72, vFpp)
+GO(ucal_setGregorianChange_72, vFpdp)
+GO(ucal_setMillis_72, vFpdp)
+GO(ucal_setTimeZone_72, vFppip)
+
+GO(ucol_clone_72, pFpp)
+GO(ucol_close_72, vFp)
+GO(ucol_closeElements_72, vFp)
+GO(ucol_setMaxVariable_72, vFpip)
+GO(ucol_getOffset_72, iFp)
+GO(ucol_getRules_72, pFpp)
+GO(ucol_getSortKey_72, iFppipi)
+GO(ucol_getStrength_72, iFp)
+GO(ucol_getVersion_72, vFpp)
+GO(ucol_next_72, iFpp)
+GO(ucol_previous_72, iFpp)
+GO(ucol_open_72, pFpp)
+GO(ucol_openElements_72, pFppip)
+GO(ucol_openRules_72, pFpiiipp)
+GO(ucol_safeClone_72, pFpppp)
+GO(ucol_setAttribute_72, vFpiip)
+GO(ucol_setVariableTop_72, uFppip)
+GO(ucol_strcoll_72, iFppipi)
+
+GO(udat_close_72, vFp)
+GO(udat_countSymbols_72, iFpi)
+GO(udat_getSymbols_72, iFpiipip)
+GO(udat_format_72, iFpdpipp)
+GO(udat_open_72, pFiippipip)
+GO(udat_setCalendar_72, vFpp)
+GO(udat_toPattern_72, iFpCpip)
+
+GO(unum_close_72, vFp)
+GO(unum_getAttribute_72, iFpi)
+GO(unum_getSymbol_72, iFpipip)
+GO(unum_open_72, pFipippp)
+GO(unum_toPattern_72, iFpCpip)
+
+GO(udatpg_close_72, vFp)
+GO(udatpg_getBestPattern_72, iFppipip)
+GO(udatpg_open_72, pFpp)
+
+GO(ulocdata_getCLDRVersion_72, vFpp)
+GO(ulocdata_getMeasurementSystem_72, iFpp)
+
+GO(usearch_close_72, vFp)
+GO(usearch_first_72, iFpp)
+GO(usearch_getBreakIterator_72, pFp)
+GO(usearch_getMatchedLength_72, iFp)
+GO(usearch_last_72, iFpp)
+GO(usearch_openFromCollator_72, pFpipippp)
+GO(usearch_setPattern_72, vFppip)
+GO(usearch_setText_72, vFppip)
diff --git a/src/wrapped/wrappedicuuc67.c b/src/wrapped/wrappedicuuc67.c
new file mode 100644
index 0000000..a2c2cb4
--- /dev/null
+++ b/src/wrapped/wrappedicuuc67.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+#include "myalign.h"
+
+const char* icuuc67Name = "libicuuc.so.67";
+#define LIBNAME icuuc67
+
+#define CUSTOM_INIT \
+ SETALT(my67_); \
+
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedicuuc67_private.h b/src/wrapped/wrappedicuuc67_private.h
new file mode 100644
index 0000000..276342d
--- /dev/null
+++ b/src/wrapped/wrappedicuuc67_private.h
@@ -0,0 +1,86 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error meh!
+#endif
+
+GO(ubrk_clone_67, pFpp)
+GO(ubrk_close_67, vFp)
+GO(ubrk_countAvailable_67, iFv)
+GO(ubrk_current_67, iFp)
+GO(ubrk_first_67, iFp)
+GO(ubrk_following_67, iFpi)
+GO(ubrk_getAvailable_67, pFi)
+GO(ubrk_getBinaryRules_67, iFppip)
+GO(ubrk_getLocaleByType_67, pFpip)
+GO(ubrk_getRuleStatus_67, iFp)
+GO(ubrk_getRuleStatusVec_67, iFppip)
+GO(ubrk_isBoundary_67, cFpi)
+GO(ubrk_last_67, iFp)
+GO(ubrk_next_67, iFp)
+GO(ubrk_open_67, pFppip)
+GO(ubrk_openBinaryRules_67, pFpipip)
+GO(ubrk_openRules_67, pFpipipp)
+GO(ubrk_preceding_67, iFpi)
+GO(ubrk_previous_67, iFp)
+GO(ubrk_refreshUText_67, vFppp)
+GO(ubrk_safeClone_67, pFpppp)
+GO(ubrk_setText_67, vFppip)
+GO(ubrk_setUText_67, vFppp)
+GO(ubrk_swap_67, iFppipp)
+
+GO(ucurr_forLocale_67, iFppip)
+GO(ucurr_getName_67, pFppippp)
+
+GO(uloc_canonicalize_67, iFppip)
+GO(uloc_countAvailable_67, iFv)
+GO(uloc_getAvailable_67, pFi)
+GO(uloc_getBaseName_67, iFppip)
+GO(uloc_getCharacterOrientation_67, iFpp)
+GO(uloc_getCountry_67, iFppip)
+GO(uloc_getDefault_67, pFv)
+GO(uloc_getDisplayCountry_67, iFpppip)
+GO(uloc_getDisplayLanguage_67, iFpppip)
+GO(uloc_getDisplayName_67, iFpppip)
+GO(uloc_getISO3Country_67, pFp)
+GO(uloc_getISO3Language_67, pFp)
+GO(uloc_getKeywordValue_67, iFpppip)
+GO(uloc_getLanguage_67, iFppip)
+GO(uloc_getLCID_67, uFp)
+GO(uloc_getName_67, iFppip)
+GO(uloc_getParent_67, iFppip)
+GO(uloc_setKeywordValue_67, iFpppip)
+
+GO(ures_close_67, vFp)
+GO(ures_getByKey_67, pFpppp)
+GO(ures_getSize_67, iFp)
+GO(ures_getStringByIndex_67, pFpipp)
+GO(ures_open_67, pFppp)
+
+GO(uldn_close_67, vFp)
+GO(uldn_keyValueDisplayName_67, iFppppip)
+GO(uldn_open_67, pFpip)
+
+GO(uenum_close_67, vFp)
+GO(uenum_count_67, iFpp)
+GO(uenum_next_67, pFppp)
+
+GO(uidna_close_67, vFp)
+GO(uidna_nameToASCII_67, iFppipipp)
+GO(uidna_nameToUnicode_67, iFppipipp)
+GO(uidna_openUTS46_67, pFpp)
+
+GO(unorm2_getNFCInstance_67, pFp)
+GO(unorm2_getNFDInstance_67, pFp)
+GO(unorm2_getNFKCInstance_67, pFp)
+GO(unorm2_getNFKDInstance_67, pFp)
+GO(unorm2_isNormalized_67, CFppip)
+GO(unorm2_normalize_67, iFppipip)
+
+GO(u_charsToUChars_67, vFppi)
+GO(u_getVersion_67, vFp)
+GO(u_strcmp_67, iFpp)
+GO(u_strcpy_67, pFpp)
+GO(u_strlen_67, iFp)
+GO(u_strncpy_67, pFppi)
+GO(u_tolower_67, uFu)
+GO(u_toupper_67, uFu)
+GO(u_uastrncpy_67, pFppi)
diff --git a/src/wrapped/wrappedicuuc72.c b/src/wrapped/wrappedicuuc72.c
new file mode 100644
index 0000000..6582780
--- /dev/null
+++ b/src/wrapped/wrappedicuuc72.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+#include "myalign.h"
+
+const char* icuuc72Name = "libicuuc.so.72";
+#define LIBNAME icuuc72
+
+#define CUSTOM_INIT \
+ SETALT(my72_); \
+
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedicuuc72_private.h b/src/wrapped/wrappedicuuc72_private.h
new file mode 100644
index 0000000..99d2dd8
--- /dev/null
+++ b/src/wrapped/wrappedicuuc72_private.h
@@ -0,0 +1,86 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error meh!
+#endif
+
+GO(ubrk_clone_72, pFpp)
+GO(ubrk_close_72, vFp)
+GO(ubrk_countAvailable_72, iFv)
+GO(ubrk_current_72, iFp)
+GO(ubrk_first_72, iFp)
+GO(ubrk_following_72, iFpi)
+GO(ubrk_getAvailable_72, pFi)
+GO(ubrk_getBinaryRules_72, iFppip)
+GO(ubrk_getLocaleByType_72, pFpip)
+GO(ubrk_getRuleStatus_72, iFp)
+GO(ubrk_getRuleStatusVec_72, iFppip)
+GO(ubrk_isBoundary_72, cFpi)
+GO(ubrk_last_72, iFp)
+GO(ubrk_next_72, iFp)
+GO(ubrk_open_72, pFppip)
+GO(ubrk_openBinaryRules_72, pFpipip)
+GO(ubrk_openRules_72, pFpipipp)
+GO(ubrk_preceding_72, iFpi)
+GO(ubrk_previous_72, iFp)
+GO(ubrk_refreshUText_72, vFppp)
+GO(ubrk_safeClone_72, pFpppp)
+GO(ubrk_setText_72, vFppip)
+GO(ubrk_setUText_72, vFppp)
+GO(ubrk_swap_72, iFppipp)
+
+GO(ucurr_forLocale_72, iFppip)
+GO(ucurr_getName_72, pFppippp)
+
+GO(uloc_canonicalize_72, iFppip)
+GO(uloc_countAvailable_72, iFv)
+GO(uloc_getAvailable_72, pFi)
+GO(uloc_getBaseName_72, iFppip)
+GO(uloc_getCharacterOrientation_72, iFpp)
+GO(uloc_getCountry_72, iFppip)
+GO(uloc_getDefault_72, pFv)
+GO(uloc_getDisplayCountry_72, iFpppip)
+GO(uloc_getDisplayLanguage_72, iFpppip)
+GO(uloc_getDisplayName_72, iFpppip)
+GO(uloc_getISO3Country_72, pFp)
+GO(uloc_getISO3Language_72, pFp)
+GO(uloc_getKeywordValue_72, iFpppip)
+GO(uloc_getLanguage_72, iFppip)
+GO(uloc_getLCID_72, uFp)
+GO(uloc_getName_72, iFppip)
+GO(uloc_getParent_72, iFppip)
+GO(uloc_setKeywordValue_72, iFpppip)
+
+GO(ures_close_72, vFp)
+GO(ures_getByKey_72, pFpppp)
+GO(ures_getSize_72, iFp)
+GO(ures_getStringByIndex_72, pFpipp)
+GO(ures_open_72, pFppp)
+
+GO(uldn_close_72, vFp)
+GO(uldn_keyValueDisplayName_72, iFppppip)
+GO(uldn_open_72, pFpip)
+
+GO(uenum_close_72, vFp)
+GO(uenum_count_72, iFpp)
+GO(uenum_next_72, pFppp)
+
+GO(uidna_close_72, vFp)
+GO(uidna_nameToASCII_72, iFppipipp)
+GO(uidna_nameToUnicode_72, iFppipipp)
+GO(uidna_openUTS46_72, pFpp)
+
+GO(unorm2_getNFCInstance_72, pFp)
+GO(unorm2_getNFDInstance_72, pFp)
+GO(unorm2_getNFKCInstance_72, pFp)
+GO(unorm2_getNFKDInstance_72, pFp)
+GO(unorm2_isNormalized_72, CFppip)
+GO(unorm2_normalize_72, iFppipip)
+
+GO(u_charsToUChars_72, vFppi)
+GO(u_getVersion_72, vFp)
+GO(u_strcmp_72, iFpp)
+GO(u_strcpy_72, pFpp)
+GO(u_strlen_72, iFp)
+GO(u_strncpy_72, pFppi)
+GO(u_tolower_72, uFu)
+GO(u_toupper_72, uFu)
+GO(u_uastrncpy_72, pFppi)
diff --git a/src/wrapped/wrappedkrb5.c b/src/wrapped/wrappedkrb5.c
index 2641981..abad8c5 100755..100644
--- a/src/wrapped/wrappedkrb5.c
+++ b/src/wrapped/wrappedkrb5.c
@@ -34,10 +34,10 @@ GO(4)
// krb5_prompter ...
#define GO(A) \
-static uintptr_t my_krb5_prompter_fct_##A = 0; \
-static int my_krb5_prompter_##A(void* a, void* b, void* c, void* d, int e, void* f) \
-{ \
- return RunFunction(my_context, my_krb5_prompter_fct_##A, 6, a, b, c, d, e, f); \
+static uintptr_t my_krb5_prompter_fct_##A = 0; \
+static int my_krb5_prompter_##A(void* a, void* b, void* c, void* d, int e, void* f) \
+{ \
+ return RunFunctionFmt(my_krb5_prompter_fct_##A, "ppppip", a, b, c, d, e, f); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedkrb5_private.h b/src/wrapped/wrappedkrb5_private.h
index d06e984..d06e984 100755..100644
--- a/src/wrapped/wrappedkrb5_private.h
+++ b/src/wrapped/wrappedkrb5_private.h
diff --git a/src/wrapped/wrappedlber.c b/src/wrapped/wrappedlber.c
index 16eefc5..16eefc5 100755..100644
--- a/src/wrapped/wrappedlber.c
+++ b/src/wrapped/wrappedlber.c
diff --git a/src/wrapped/wrappedlber_private.h b/src/wrapped/wrappedlber_private.h
index 4f1b1d1..4f1b1d1 100755..100644
--- a/src/wrapped/wrappedlber_private.h
+++ b/src/wrapped/wrappedlber_private.h
diff --git a/src/wrapped/wrappedldapr.c b/src/wrapped/wrappedldapr.c
index 7b5087e..fbaee98 100755..100644
--- a/src/wrapped/wrappedldapr.c
+++ b/src/wrapped/wrappedldapr.c
@@ -41,10 +41,10 @@ GO(4)
// LDAP_SASL_INTERACT_PROC ...
#define GO(A) \
-static uintptr_t my_LDAP_SASL_INTERACT_PROC_fct_##A = 0; \
-static int my_LDAP_SASL_INTERACT_PROC_##A(void* a, unsigned b, void* c, void* d) \
-{ \
- return RunFunction(my_context, my_LDAP_SASL_INTERACT_PROC_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_LDAP_SASL_INTERACT_PROC_fct_##A = 0; \
+static int my_LDAP_SASL_INTERACT_PROC_##A(void* a, unsigned b, void* c, void* d) \
+{ \
+ return RunFunctionFmt(my_LDAP_SASL_INTERACT_PROC_fct_##A, "pupp", a, b, c, d); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedldapr_private.h b/src/wrapped/wrappedldapr_private.h
index 97ae8fe..97ae8fe 100755..100644
--- a/src/wrapped/wrappedldapr_private.h
+++ b/src/wrapped/wrappedldapr_private.h
diff --git a/src/wrapped/wrappedldlinux.c b/src/wrapped/wrappedldlinux.c
index d88c10c..83245e9 100755..100644
--- a/src/wrapped/wrappedldlinux.c
+++ b/src/wrapped/wrappedldlinux.c
@@ -14,6 +14,7 @@
#include "emu/x64emu_private.h"
#include "elfloader.h"
#include "box64context.h"
+#include "x64tls.h"
typedef struct my_tls_s {
unsigned long int i;
@@ -23,8 +24,14 @@ typedef struct my_tls_s {
EXPORT void* my___tls_get_addr(void* p)
{
my_tls_t *t = (my_tls_t*)p;
- void* ret = (void*)((char*)GetTLSPointer(my_context, my_context->elfs[t->i])+t->o);
- return ret;
+ tlsdatasize_t* ptr = getTLSData(my_context);
+ return ptr->data+GetTLSBase(my_context->elfs[t->i])+t->o;
+}
+
+EXPORT void* my___libc_stack_end;
+void stSetup(box64context_t* context)
+{
+ my___libc_stack_end = context->stack; // is this the end, or should I add stasz?
}
// don't try to load the actual ld-linux (because name is variable), just use box64 itself, as it's linked to ld-linux
@@ -36,6 +43,9 @@ const char* ldlinuxName = "ld-linux.so.2";
lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \
else
+#define CUSTOM_INIT \
+ stSetup(box64); \
+
// define all standard library functions
#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedldlinux_private.h b/src/wrapped/wrappedldlinux_private.h
index 7b863d1..9bdcccb 100755..100644
--- a/src/wrapped/wrappedldlinux_private.h
+++ b/src/wrapped/wrappedldlinux_private.h
@@ -14,7 +14,7 @@
// _dl_rtld_di_serinfo
// _dl_tls_setup
DATA(__libc_enable_secure, sizeof(void*))
-DATA(__libc_stack_end, sizeof(void*))
+DATAM(__libc_stack_end, sizeof(void*))
DATA(__pointer_chk_guard, sizeof(void*))
DATAB(_r_debug, 40)
DATA(_rtld_global, sizeof(void*))
diff --git a/src/wrapped/wrappedlib_init.h b/src/wrapped/wrappedlib_init.h
index f6b5266..f6b5266 100755..100644
--- a/src/wrapped/wrappedlib_init.h
+++ b/src/wrapped/wrappedlib_init.h
diff --git a/src/wrapped/wrappedlibasound.c b/src/wrapped/wrappedlibasound.c
index 11fffc6..c49f391 100755..100644
--- a/src/wrapped/wrappedlibasound.c
+++ b/src/wrapped/wrappedlibasound.c
@@ -47,10 +47,10 @@ GO(3)
// snd_async_callback_t
#define GO(A) \
-static uintptr_t my_async_fct_##A = 0; \
-static void* my_async_##A(void* handler) \
-{ \
- return (void*)RunFunction(my_context, my_async_fct_##A, 1, handler);\
+static uintptr_t my_async_fct_##A = 0; \
+static void* my_async_##A(void* handler) \
+{ \
+ return (void*)RunFunctionFmt(my_async_fct_##A, "p", handler); \
}
SUPER()
#undef GO
@@ -67,6 +67,28 @@ static void* findAsyncFct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for Asound Async callback\n");
return NULL;
}
+// snd_mixer_elem_callback_t
+#define GO(A) \
+static uintptr_t my_elem_fct_##A = 0; \
+static int my_elem_##A(void* elem, uint32_t mask) \
+{ \
+ return (int)RunFunctionFmt(my_elem_fct_##A, "pu", elem, mask); \
+}
+SUPER()
+#undef GO
+static void* findElemFct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_elem_fct_##A == (uintptr_t)fct) return my_elem_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_elem_fct_##A == 0) {my_elem_fct_##A = (uintptr_t)fct; return my_elem_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for Asound Elem callback\n");
+ return NULL;
+}
EXPORT int my_snd_async_add_handler(x64emu_t *emu, void *handler, int fd, void* callback, void *private_data)
@@ -115,6 +137,11 @@ EXPORT int my_snd_lib_error_set_handler(x64emu_t* emu, void* handler)
return my->snd_lib_error_set_handler(error_handler);
}
+EXPORT void my_snd_mixer_elem_set_callback(x64emu_t* emu, void* handler, void* f)
+{
+ my->snd_mixer_elem_set_callback(handler, findElemFct(f));
+}
+
void* my_dlopen(x64emu_t* emu, void *filename, int flag); // defined in wrappedlibdl.c
char* my_dlerror(x64emu_t* emu);
int my_dlclose(x64emu_t* emu, void *handle);
diff --git a/src/wrapped/wrappedlibasound_private.h b/src/wrapped/wrappedlibasound_private.h
index fdb34b0..ab6e05b 100755..100644
--- a/src/wrapped/wrappedlibasound_private.h
+++ b/src/wrapped/wrappedlibasound_private.h
@@ -476,6 +476,7 @@ GO(snd_pcm_sw_params_get_xfer_align, iFpp)
GO(snd_pcm_sw_params_get_xrun_mode, iFp)
GO(snd_pcm_sw_params_malloc, iFp)
GO(snd_pcm_sw_params_set_avail_min, iFppu)
+GO(snd_pcm_sw_params_set_period_event, iFppi)
GO(snd_pcm_sw_params_set_silence_size, iFppu)
GO(snd_pcm_sw_params_set_silence_threshold, iFppu)
GO(snd_pcm_sw_params_set_sleep_min, iFppu)
@@ -919,9 +920,9 @@ GO(snd_mixer_get_count, uFp)
GO(snd_mixer_class_unregister, iFp)
GO(snd_mixer_elem_next, pFp)
GO(snd_mixer_elem_prev, pFp)
-//GO(snd_mixer_elem_set_callback, vFpP)
-//GO(snd_mixer_elem_get_callback_private, pFp)
-//GO(snd_mixer_elem_set_callback_private, vFpp)
+GOM(snd_mixer_elem_set_callback, vFEpp)
+GO(snd_mixer_elem_get_callback_private, pFp)
+GO(snd_mixer_elem_set_callback_private, vFpp)
GO(snd_mixer_elem_get_type, iFp)
//GO(snd_mixer_class_register, iFpp)
GO(snd_mixer_add_elem, iFpp)
@@ -954,6 +955,8 @@ GO(snd_mixer_selem_get_id, vFpp)
GO(snd_mixer_selem_get_name, pFp)
GO(snd_mixer_selem_get_index, uFp)
GO(snd_mixer_find_selem, pFpp)
+GO(snd_mixer_selem_ask_playback_dB_vol, iFplip)
+GO(snd_mixer_selem_ask_playback_vol_dB, iFplp)
GO(snd_mixer_selem_is_active, iFp)
GO(snd_mixer_selem_is_playback_mono, iFp)
GO(snd_mixer_selem_has_playback_channel, iFpi)
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index ca4db82..0672692 100755..100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -24,7 +24,7 @@
#include <poll.h>
#include <sys/epoll.h>
#include <ftw.h>
-#include <sys/syscall.h>
+#include <sys/syscall.h>
#include <sys/socket.h>
#include <sys/utsname.h>
#include <sys/mman.h>
@@ -39,6 +39,7 @@
#include <malloc.h>
#include <getopt.h>
#include <sys/prctl.h>
+#include <sys/ptrace.h>
#undef LOG_INFO
#undef LOG_DEBUG
@@ -131,10 +132,10 @@ GO(15)
// compare
#define GO(A) \
-static uintptr_t my_compare_fct_##A = 0; \
-static int my_compare_##A(void* a, void* b) \
-{ \
- return (int)RunFunction(my_context, my_compare_fct_##A, 2, a, b);\
+static uintptr_t my_compare_fct_##A = 0; \
+static int my_compare_##A(void* a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my_compare_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -160,7 +161,7 @@ static int my_ftw64_##A(void* fpath, void* sb, int flag) \
{ \
struct x64_stat64 x64st; \
UnalignStat64(sb, &x64st); \
- return (int)RunFunction(my_context, my_ftw64_fct_##A, 3, fpath, &x64st, flag); \
+ return (int)RunFunctionFmt(my_ftw64_fct_##A, "ppi", fpath, &x64st, flag); \
}
SUPER()
#undef GO
@@ -182,9 +183,9 @@ static void* findftw64Fct(void* fct)
static uintptr_t my_nftw64_fct_##A = 0; \
static int my_nftw64_##A(void* fpath, void* sb, int flag, void* ftwbuff) \
{ \
- struct x64_stat64 x64st; \
- UnalignStat64(sb, &x64st); \
- return (int)RunFunction(my_context, my_nftw64_fct_##A, 4, fpath, &x64st, flag, ftwbuff); \
+ struct x64_stat64 x64st; \
+ UnalignStat64(sb, &x64st); \
+ return (int)RunFunctionFmt(my_nftw64_fct_##A, "ppip", fpath, &x64st, flag, ftwbuff); \
}
SUPER()
#undef GO
@@ -202,10 +203,10 @@ static void* findnftw64Fct(void* fct)
}
// globerr
#define GO(A) \
-static uintptr_t my_globerr_fct_##A = 0; \
-static int my_globerr_##A(void* epath, int eerrno) \
-{ \
- return (int)RunFunction(my_context, my_globerr_fct_##A, 2, epath, eerrno); \
+static uintptr_t my_globerr_fct_##A = 0; \
+static int my_globerr_##A(void* epath, int eerrno) \
+{ \
+ return (int)RunFunctionFmt(my_globerr_fct_##A, "pi", epath, eerrno); \
}
SUPER()
#undef GO
@@ -225,10 +226,10 @@ static void* findgloberrFct(void* fct)
}
// free
#define GO(A) \
-static uintptr_t my_free_fct_##A = 0; \
-static void my_free_##A(void* p) \
-{ \
- RunFunction(my_context, my_free_fct_##A, 1, p); \
+static uintptr_t my_free_fct_##A = 0; \
+static void my_free_##A(void* p) \
+{ \
+ RunFunctionFmt(my_free_fct_##A, "p", p); \
}
SUPER()
#undef GO
@@ -251,10 +252,10 @@ static void* findfreeFct(void* fct)
#undef dirent
// filter_dir
#define GO(A) \
-static uintptr_t my_filter_dir_fct_##A = 0; \
-static int my_filter_dir_##A(const struct dirent* a) \
-{ \
- return (int)RunFunction(my_context, my_filter_dir_fct_##A, 1, a); \
+static uintptr_t my_filter_dir_fct_##A = 0; \
+static int my_filter_dir_##A(const struct dirent* a) \
+{ \
+ return (int)RunFunctionFmt(my_filter_dir_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -274,10 +275,10 @@ static void* findfilter_dirFct(void* fct)
}
// compare_dir
#define GO(A) \
-static uintptr_t my_compare_dir_fct_##A = 0; \
-static int my_compare_dir_##A(const struct dirent* a, const struct dirent* b) \
-{ \
- return (int)RunFunction(my_context, my_compare_dir_fct_##A, 2, a, b); \
+static uintptr_t my_compare_dir_fct_##A = 0; \
+static int my_compare_dir_##A(const struct dirent* a, const struct dirent* b) \
+{ \
+ return (int)RunFunctionFmt(my_compare_dir_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -299,10 +300,10 @@ static void* findcompare_dirFct(void* fct)
// filter64
#define GO(A) \
-static uintptr_t my_filter64_fct_##A = 0; \
-static int my_filter64_##A(const struct dirent64* a) \
-{ \
- return (int)RunFunction(my_context, my_filter64_fct_##A, 1, a); \
+static uintptr_t my_filter64_fct_##A = 0; \
+static int my_filter64_##A(const struct dirent64* a) \
+{ \
+ return (int)RunFunctionFmt(my_filter64_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -325,7 +326,7 @@ static void* findfilter64Fct(void* fct)
static uintptr_t my_compare64_fct_##A = 0; \
static int my_compare64_##A(const struct dirent64* a, const struct dirent64* b) \
{ \
- return (int)RunFunction(my_context, my_compare64_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_compare64_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -345,10 +346,10 @@ static void* findcompare64Fct(void* fct)
}
// printf_output
#define GO(A) \
-static uintptr_t my_printf_output_fct_##A = 0; \
-static int my_printf_output_##A(void* a, void* b, void* c) \
-{ \
- return (int)RunFunction(my_context, my_printf_output_fct_##A, 3, a, b, c); \
+static uintptr_t my_printf_output_fct_##A = 0; \
+static int my_printf_output_##A(void* a, void* b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my_printf_output_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -368,10 +369,10 @@ static void* findprintf_outputFct(void* fct)
}
// printf_arginfo
#define GO(A) \
-static uintptr_t my_printf_arginfo_fct_##A = 0; \
-static int my_printf_arginfo_##A(void* a, size_t b, void* c, void* d) \
-{ \
- return (int)RunFunction(my_context, my_printf_arginfo_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_printf_arginfo_fct_##A = 0; \
+static int my_printf_arginfo_##A(void* a, size_t b, void* c, void* d) \
+{ \
+ return (int)RunFunctionFmt(my_printf_arginfo_fct_##A, "pLpp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -391,10 +392,10 @@ static void* findprintf_arginfoFct(void* fct)
}
// printf_type
#define GO(A) \
-static uintptr_t my_printf_type_fct_##A = 0; \
-static void my_printf_type_##A(void* a, va_list* b) \
-{ \
- RunFunction(my_context, my_printf_type_fct_##A, 2, a, b); \
+static uintptr_t my_printf_type_fct_##A = 0; \
+static void my_printf_type_##A(void* a, va_list* b) \
+{ \
+ RunFunctionFmt(my_printf_type_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -416,8 +417,8 @@ static void* findprintf_typeFct(void* fct)
#undef SUPER
// some my_XXX declare and defines
-int32_t my___libc_start_main(x64emu_t* emu, int *(main) (int, char * *, char * *),
- int argc, char * * ubp_av, void (*init) (void), void (*fini) (void),
+int32_t my___libc_start_main(x64emu_t* emu, int *(main) (int, char * *, char * *),
+ int argc, char * * ubp_av, void (*init) (void), void (*fini) (void),
void (*rtld_fini) (void), void (* stack_end)); // implemented in x64run_private.c
EXPORT void my___libc_init_first(x64emu_t* emu, int argc, char* arg0, char** b)
{
@@ -437,7 +438,7 @@ void EXPORT my___stack_chk_fail(x64emu_t* emu)
if(cycle_log) {
print_cycle_log(LOG_INFO);
}
- StopEmu(emu, buff);
+ StopEmu(emu, buff, emu->segs[_CS]==0x23);
}
void EXPORT my___gmon_start__(x64emu_t *emu)
{
@@ -447,8 +448,7 @@ void EXPORT my___gmon_start__(x64emu_t *emu)
int EXPORT my___cxa_atexit(x64emu_t* emu, void* p, void* a, void* dso_handle)
{
- (void)dso_handle;
- AddCleanup1Arg(emu, p, a);
+ AddCleanup1Arg(emu, p, a, dso_handle);
return 0;
}
void EXPORT my___cxa_finalize(x64emu_t* emu, void* p)
@@ -462,7 +462,7 @@ void EXPORT my___cxa_finalize(x64emu_t* emu, void* p)
}
int EXPORT my_atexit(x64emu_t* emu, void *p)
{
- AddCleanup(emu, p);
+ AddCleanup(emu, p, NULL); // should grab current dso_handle?
return 0;
}
@@ -483,6 +483,11 @@ int my_dl_iterate_phdr(x64emu_t *emu, void* F, void *data);
pid_t EXPORT my_fork(x64emu_t* emu)
{
+ #if 1
+ emu->quit = 1;
+ emu->fork = 3; // use regular fork...
+ return 0;
+ #else
// execute atforks prepare functions, in reverse order
for (int i=my_context->atfork_sz-1; i>=0; --i)
if(my_context->atforks[i].prepare)
@@ -495,7 +500,7 @@ pid_t EXPORT my_fork(x64emu_t* emu)
if(v<0) {
printf_log(LOG_NONE, "BOX64: Warning, fork errored... (%d)\n", v);
// error...
- } else if(v>0) {
+ } else if(v>0) {
// execute atforks parent functions
for (int i=0; i<my_context->atfork_sz; --i)
if(my_context->atforks[i].parent)
@@ -508,6 +513,7 @@ pid_t EXPORT my_fork(x64emu_t* emu)
RunFunctionWithEmu(emu, 0, my_context->atforks[i].child, 0);
}
return v;
+ #endif
}
pid_t EXPORT my___fork(x64emu_t* emu) __attribute__((alias("my_fork")));
pid_t EXPORT my_vfork(x64emu_t* emu)
@@ -685,32 +691,17 @@ EXPORT int my___fprintf_chk(x64emu_t *emu, void* F, int flag, void* fmt, void* b
return vfprintf(F, fmt, VARARGS);
}
-#if 0
-EXPORT int my_wprintf(x64emu_t *emu, void* fmt, void* b, va_list V) {
- #ifndef NOALIGN
- // need to align on arm
- myStackAlignW((const char*)fmt, b, emu->scratch);
- PREPARE_VALIST;
- void* f = vwprintf;
- return ((iFpp_t)f)(fmt, VARARGS);
+EXPORT int my_vwprintf(x64emu_t *emu, void* fmt, x64_va_list_t b) {
+ (void)emu;
+ #ifdef CONVERT_VALIST
+ CONVERT_VALIST(b);
#else
- // other platform don't need that
- return vwprintf((const wchar_t*)fmt, V);
- #endif
-}
-EXPORT int my___wprintf_chk(x64emu_t *emu, int flag, void* fmt, void* b, va_list V) {
- #ifndef NOALIGN
- // need to align on arm
- myStackAlignW((const char*)fmt, b, emu->scratch);
+ myStackAlignWValist(emu, (const char*)fmt, emu->scratch, b);
PREPARE_VALIST;
- void* f = vwprintf;
- return ((iFpp_t)f)(fmt, VARARGS);
- #else
- // other platform don't need that
- return vwprintf((const wchar_t*)fmt, V);
#endif
+ int r = vwprintf(fmt, VARARGS);
+ return r;
}
-#endif
EXPORT int my_fwprintf(x64emu_t *emu, void* F, void* fmt, void* b) {
myStackAlignW(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2);
@@ -743,19 +734,42 @@ EXPORT int my___vfwprintf_chk(x64emu_t *emu, void* F, int flag, void* fmt, x64_v
return vfwprintf(F, fmt, VARARGS);
}
-#if 0
-EXPORT int my_vwprintf(x64emu_t *emu, void* fmt, void* b) {
- #ifndef NOALIGN
- myStackAlignW((const char*)fmt, b, emu->scratch);
+EXPORT int my_dprintf(x64emu_t *emu, int d, void* fmt, void* b) {
+ myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2);
PREPARE_VALIST;
- void* f = vwprintf;
- return ((iFpp_t)f)(fmt, VARARGS);
+ return vdprintf(d, fmt, VARARGS);
+}
+
+EXPORT int my___dprintf_chk(x64emu_t *emu, int d, int flag, void* fmt, void* b) {
+ (void)flag;
+ myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 3);
+ PREPARE_VALIST;
+ return vdprintf(d, fmt, VARARGS);
+}
+
+
+EXPORT int my_vdprintf(x64emu_t *emu, int d, void* fmt, x64_va_list_t b) {
+ #ifdef CONVERT_VALIST
+ CONVERT_VALIST(b);
+ #else
+ myStackAlignValist(emu, (const char*)fmt, emu->scratch, b);
+ PREPARE_VALIST;
+ #endif
+ return vdprintf(d, fmt, VARARGS);
+}
+
+EXPORT int my___vdprintf_chk(x64emu_t *emu, int d, int flag, void* fmt, x64_va_list_t b) {
+ (void)flag;
+ #ifdef CONVERT_VALIST
+ CONVERT_VALIST(b);
#else
- void* f = vwprintf;
- return ((iFpp_t)f)(fmt, b);
+ myStackAlignValist(emu, (const char*)fmt, emu->scratch, b);
+ PREPARE_VALIST;
#endif
+ return vdprintf(d, fmt, VARARGS);
}
+#if 0
EXPORT void *my_div(void *result, int numerator, int denominator) {
*(div_t *)result = div(numerator, denominator);
return result;
@@ -910,6 +924,14 @@ EXPORT int my___isoc99_sscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t*
return vsscanf(stream, fmt, VARARGS);
}
+EXPORT int my___isoc99_swscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t* b)
+{
+ myStackAlignScanf(emu, (const char*)fmt, b, emu->scratch, 2);
+ PREPARE_VALIST;
+
+ return vswscanf(stream, fmt, VARARGS);
+}
+
EXPORT int my_vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) {
(void)emu;
#ifdef CONVERT_VALIST
@@ -922,7 +944,17 @@ EXPORT int my_vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_
return r;
}
EXPORT int my___vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) __attribute__((alias("my_vsnprintf")));
-EXPORT int my___vsnprintf_chk(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) __attribute__((alias("my_vsnprintf")));
+EXPORT int my___vsnprintf_chk(x64emu_t* emu, void* buff, size_t s, int flags, size_t slen, void * fmt, x64_va_list_t b) {
+ (void)emu;
+ #ifdef CONVERT_VALIST
+ CONVERT_VALIST(b);
+ #else
+ myStackAlignValist(emu, (const char*)fmt, emu->scratch, b);
+ PREPARE_VALIST;
+ #endif
+ int r = vsnprintf(buff, s, fmt, VARARGS);
+ return r;
+}
#if 0
EXPORT int my_vasprintf(x64emu_t* emu, void* strp, void* fmt, void* b, va_list V)
{
@@ -1282,7 +1314,17 @@ EXPORT void* my_tsearch(x64emu_t* emu, void* key, void* root, void* fnc)
EXPORT void my_tdestroy(x64emu_t* emu, void* root, void* fnc)
{
(void)emu;
- return tdestroy(root, findfreeFct(fnc));
+ tdestroy(root, findfreeFct(fnc));
+}
+EXPORT void* my_tdelete(x64emu_t* emu, void* key, void** root, void* fnc)
+{
+ (void)emu;
+ return tdelete(key, root, findcompareFct(fnc));
+}
+EXPORT void* my_tfind(x64emu_t* emu, void* key, void** root, void* fnc)
+{
+ (void)emu;
+ return tfind(key, root, findcompareFct(fnc));
}
EXPORT void* my_lfind(x64emu_t* emu, void* key, void* base, size_t* nmemb, size_t size, void* fnc)
{
@@ -1548,7 +1590,7 @@ void CreateCPUInfoFile(int fd)
P;
sprintf(buff, "bogomips\t: %g\n", bogoMips);
P;
- sprintf(buff, "flags\t\t: fpu cx8 sep cmov clflush mmx sse sse2 syscall tsc lahf_lm ssse3 ht tm lm fma fxsr cpuid pclmulqdq cx16 aes movbe pni\n");
+ sprintf(buff, "flags\t\t: fpu cx8 sep cmov clflush mmx sse sse2 syscall tsc lahf_lm ssse3 ht tm lm fma fxsr cpuid pclmulqdq cx16 aes movbe pni sse4_1 popcnt\n");
P;
sprintf(buff, "address sizes\t: 46 bits physical, 48 bits virtual\n");
P;
@@ -1630,7 +1672,7 @@ EXPORT int32_t my___open(x64emu_t* emu, void* pathname, int32_t flags, uint32_t
// unprotectDB((uintptr_t)p, count-ret, 1);
// int l;
// do {
-// l = read(fd, p, count-ret);
+// l = read(fd, p, count-ret);
// if(l>0) {
// p+=l; ret+=l;
// }
@@ -1854,11 +1896,11 @@ EXPORT int32_t my_execv(x64emu_t* emu, const char* path, char* const argv[])
int n=skip_first;
while(argv[n]) ++n;
int toadd = script?2:1;
- const char** newargv = (const char**)box_calloc(n+toadd+1, sizeof(char*));
+ const char** newargv = (const char**)box_calloc(n+toadd+2, sizeof(char*));
newargv[0] = x86?emu->context->box86path:emu->context->box64path;
if(script) newargv[1] = emu->context->bashpath; // script needs to be launched with bash
memcpy(newargv+toadd, argv+skip_first, sizeof(char*)*(n+toadd));
- if(self)
+ if(self)
newargv[1] = emu->context->fullpath;
else {
// TODO check if envp is not environ and add the value on a copy
@@ -2034,7 +2076,7 @@ EXPORT int32_t my_execvp(x64emu_t* emu, const char* path, char* const argv[])
// uname -m is redirected to box64 -m
path = my_context->box64path;
char *argv2[3] = { my_context->box64path, argv[1], NULL };
-
+
return execvp(path, argv2);
}
@@ -2048,7 +2090,7 @@ EXPORT int32_t my_execl(x64emu_t* emu, const char* path)
int x64 = FileIsX64ELF(path);
int x86 = my_context->box86path?FileIsX86ELF(path):0;
int script = (my_context->bashpath && FileIsShell(path))?1:0;
- printf_log(LOG_DEBUG, "execl(\"%s\", ...), IsX86=%d, self=%d\n", path, x64, self);
+ printf_log(LOG_DEBUG, "execle(\"%s\", ...), IsX86=%d, self=%d\n", path, x64, self);
// count argv...
int i=0;
while(getVargN(emu, i+1)) ++i;
@@ -2061,12 +2103,42 @@ EXPORT int32_t my_execl(x64emu_t* emu, const char* path)
for (int k=0; k<i; ++k)
newargv[j++] = getVargN(emu, k+1);
if(self) newargv[1] = emu->context->fullpath;
- printf_log(LOG_DEBUG, " => execl(\"%s\", %p [\"%s\", \"%s\"...:%d])\n", newargv[0], newargv, newargv[1], i?newargv[2]:"", i);
+ printf_log(LOG_DEBUG, " => execle(\"%s\", %p [\"%s\", \"%s\"...:%d])\n", newargv[0], newargv, newargv[1], i?newargv[2]:"", i);
int ret = execv(newargv[0], newargv);
box_free(newargv);
return ret;
}
+EXPORT int32_t my_execle(x64emu_t* emu, const char* path)
+{
+ int self = isProcSelf(path, "exe");
+ int x64 = FileIsX64ELF(path);
+ int x86 = my_context->box86path?FileIsX86ELF(path):0;
+ int script = (my_context->bashpath && FileIsShell(path))?1:0;
+ printf_log(LOG_DEBUG, "execl(\"%s\", ...), IsX86=%d, self=%d\n", path, x64, self);
+ // hack to update the environ var if needed
+ // count argv...
+ int i=0;
+ while(getVargN(emu, i+1)) ++i;
+ int toadd = script?2:((x64||self)?1:0);
+ char** newargv = (char**)box_calloc(i+toadd+1, sizeof(char*));
+ char** envp = (char**)getVargN(emu, i+2);
+ if(envp == my_context->envv && environ) {
+ envp = environ;
+ }
+ int j=0;
+ if ((x64 || x86 || script || self))
+ newargv[j++] = x86?emu->context->box86path:emu->context->box64path;
+ if(script) newargv[j++] = emu->context->bashpath;
+ for (int k=0; k<i; ++k)
+ newargv[j++] = getVargN(emu, k+1);
+ if(self) newargv[1] = emu->context->fullpath;
+ printf_log(LOG_DEBUG, " => execle(\"%s\", %p [\"%s\", \"%s\"...:%d], %p)\n", newargv[0], newargv, newargv[1], i?newargv[2]:"", i, envp);
+ int ret = execve(newargv[0], newargv, envp);
+ box_free(newargv);
+ return ret;
+}
+
EXPORT int32_t my_execlp(x64emu_t* emu, const char* path)
{
// need to use BOX64_PATH / PATH here...
@@ -2105,7 +2177,7 @@ EXPORT int32_t my_execlp(x64emu_t* emu, const char* path)
return ret;
}
-EXPORT int32_t my_posix_spawn(x64emu_t* emu, pid_t* pid, const char* fullpath,
+EXPORT int32_t my_posix_spawn(x64emu_t* emu, pid_t* pid, const char* fullpath,
const posix_spawn_file_actions_t *actions, const posix_spawnattr_t* attrp, char* const argv[], char* const envp[])
{
int self = isProcSelf(fullpath, "exe");
@@ -2138,13 +2210,13 @@ EXPORT int32_t my_posix_spawn(x64emu_t* emu, pid_t* pid, const char* fullpath,
ret = posix_spawn(pid, newargv[0], actions, attrp, (char* const*)newargv, envp);
printf_log(/*LOG_DEBUG*/LOG_INFO, "posix_spawn returned %d\n", ret);
//box_free(newargv);
- } else
+ } else
ret = posix_spawn(pid, fullpath, actions, attrp, argv, envp);
return ret;
}
// execvp should use PATH to search for the program first
-EXPORT int32_t my_posix_spawnp(x64emu_t* emu, pid_t* pid, const char* path,
+EXPORT int32_t my_posix_spawnp(x64emu_t* emu, pid_t* pid, const char* path,
const posix_spawn_file_actions_t *actions, const posix_spawnattr_t* attrp, char* const argv[], char* const envp[])
{
// need to use BOX64_PATH / PATH here...
@@ -2187,7 +2259,10 @@ EXPORT void my__Jv_RegisterClasses() {}
EXPORT int32_t my___cxa_thread_atexit_impl(x64emu_t* emu, void* dtor, void* obj, void* dso)
{
(void)emu;
- printf_log(LOG_INFO, "Warning, call to __cxa_thread_atexit_impl(%p, %p, %p) ignored\n", dtor, obj, dso);
+ //printf_log(LOG_INFO, "Warning, call to __cxa_thread_atexit_impl(%p, %p, %p) ignored\n", dtor, obj, dso);
+ AddCleanup1Arg(emu, dtor, obj, dso);
+ return 0;
+
return 0;
}
@@ -2210,7 +2285,7 @@ EXPORT int32_t my___register_atfork(x64emu_t *emu, void* prepare, void* parent,
EXPORT uint64_t my___umoddi3(uint64_t a, uint64_t b)
{
return a%b;
-}
+}
EXPORT uint64_t my___udivdi3(uint64_t a, uint64_t b)
{
return a/b;
@@ -2275,8 +2350,8 @@ EXPORT int32_t my_fcntl(x64emu_t* emu, int32_t a, int32_t b, void* c)
int ret = fcntl(a, b, c);
if(b==F_GETFL && ret!=-1)
ret = of_unconvert(ret);
-
- return ret;
+
+ return ret;
}
EXPORT int32_t my___fcntl(x64emu_t* emu, int32_t a, int32_t b, void* c) __attribute__((alias("my_fcntl")));
@@ -2349,10 +2424,10 @@ void InitCpuModel()
my___cpu_model.__cpu_vendor = VENDOR_INTEL;
my___cpu_model.__cpu_type = INTEL_PENTIUM_M;
my___cpu_model.__cpu_subtype = 0; // N/A
- my___cpu_model.__cpu_features[0] = (1<<FEATURE_CMOV)
- | (1<<FEATURE_MMX)
- | (1<<FEATURE_SSE)
- | (1<<FEATURE_SSE2)
+ my___cpu_model.__cpu_features[0] = (1<<FEATURE_CMOV)
+ | (1<<FEATURE_MMX)
+ | (1<<FEATURE_SSE)
+ | (1<<FEATURE_SSE2)
| (1<<FEATURE_SSE3)
| (1<<FEATURE_SSSE3)
| (1<<FEATURE_MOVBE)
@@ -2371,12 +2446,6 @@ void ctSetup()
my___ctype_tolower = *(__ctype_tolower_loc());
}
-EXPORT void* my___libc_stack_end;
-void stSetup(box64context_t* context)
-{
- my___libc_stack_end = context->stack; // is this the end, or should I add stasz?
-}
-
EXPORT void my___register_frame_info(void* a, void* b)
{
// nothing
@@ -2425,8 +2494,8 @@ void EXPORT my_longjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p,
if(((__jmp_buf_tag_t*)p)->__mask_was_saved) {
sigprocmask(SIG_SETMASK, &((__jmp_buf_tag_t*)p)->__saved_mask, NULL);
}
- if(emu->quitonlongjmp) {
- emu->longjmp = 1;
+ if(emu->flags.quitonlongjmp) {
+ emu->flags.longjmp = 1;
emu->quit = 1;
}
}
@@ -2450,6 +2519,11 @@ EXPORT int32_t my___sigsetjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/vo
((__jmp_buf_tag_t*)p)->__mask_was_saved = 1;
} else
((__jmp_buf_tag_t*)p)->__mask_was_saved = 0;
+ // quit emulation loop and create a new jumpbuf if needed
+ if(!emu->flags.jmpbuf_ready) {
+ emu->flags.need_jmpbuf = 1;
+ emu->quit = 1;
+ }
return 0;
}
EXPORT int32_t my_sigsetjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int savesigs)
@@ -2492,7 +2566,7 @@ EXPORT int my_readlinkat(x64emu_t* emu, int fd, void* path, void* buf, size_t bu
EXPORT void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot, int flags, int fd, int64_t offset)
{
(void)emu;
- if(prot&PROT_WRITE)
+ if(prot&PROT_WRITE)
prot|=PROT_READ; // PROT_READ is implicit with PROT_WRITE on i386
if(box64_log<LOG_DEBUG) {dynarec_log(LOG_DEBUG, "mmap64(%p, %lu, 0x%x, 0x%x, %d, %ld) => ", addr, length, prot, flags, fd, offset);}
#ifndef NOALIGN
@@ -2508,7 +2582,7 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot
#endif
void* ret = mmap64(addr, length, prot, flags, fd, offset);
#ifndef NOALIGN
- if((ret!=(void*)-1) && (flags&0x40) &&
+ if((ret!=(void*)-1) && (flags&0x40) &&
(((uintptr_t)ret>0xffffffffLL) || (box64_wine && ((uintptr_t)ret&0xffff)))) {
printf_log(LOG_DEBUG, "Warning, mmap on 32bits didn't worked, ask %p, got %p ", addr, ret);
munmap(ret, length);
@@ -2559,7 +2633,7 @@ EXPORT void* my_mremap(x64emu_t* emu, void* old_addr, size_t old_size, size_t ne
uint32_t prot = getProtection((uintptr_t)old_addr)&~PROT_CUSTOM;
if(ret==old_addr) {
if(old_size && old_size<new_size) {
- setProtection((uintptr_t)ret+old_size, new_size-old_size, prot);
+ setProtection_mmap((uintptr_t)ret+old_size, new_size-old_size, prot);
#ifdef DYNAREC
if(box64_dynarec)
addDBFromAddressRange((uintptr_t)ret+old_size, new_size-old_size);
@@ -2568,10 +2642,10 @@ EXPORT void* my_mremap(x64emu_t* emu, void* old_addr, size_t old_size, size_t ne
freeProtection((uintptr_t)ret+new_size, old_size-new_size);
#ifdef DYNAREC
if(box64_dynarec)
- cleanDBFromAddressRange((uintptr_t)ret+new_size, new_size-old_size, 1);
+ cleanDBFromAddressRange((uintptr_t)ret+new_size, old_size-new_size, 1);
#endif
} else if(!old_size) {
- setProtection((uintptr_t)ret, new_size, prot);
+ setProtection_mmap((uintptr_t)ret, new_size, prot);
#ifdef DYNAREC
if(box64_dynarec)
addDBFromAddressRange((uintptr_t)ret, new_size);
@@ -2618,19 +2692,26 @@ EXPORT int my_mprotect(x64emu_t* emu, void *addr, unsigned long len, int prot)
{
(void)emu;
dynarec_log(LOG_DEBUG, "mprotect(%p, %lu, 0x%x)\n", addr, len, prot);
- if(prot&PROT_WRITE)
+ if(prot&PROT_WRITE)
prot|=PROT_READ; // PROT_READ is implicit with PROT_WRITE on x86_64
int ret = mprotect(addr, len, prot);
#ifdef DYNAREC
- if(box64_dynarec && !ret) {
+ if(box64_dynarec && !ret && len) {
if(prot& PROT_EXEC)
addDBFromAddressRange((uintptr_t)addr, len);
else
- cleanDBFromAddressRange((uintptr_t)addr, len, 0);
+ cleanDBFromAddressRange((uintptr_t)addr, len, 1);
}
#endif
- if(!ret)
- updateProtection((uintptr_t)addr, len, prot);
+ if(!ret && len) {
+ if(prot)
+ updateProtection((uintptr_t)addr, len, prot);
+ else {
+ // avoid allocating detailled protection for a no prot 0
+ freeProtection((uintptr_t)addr, len);
+ setProtection_mmap((uintptr_t)addr, len, prot);
+ }
+ }
return ret;
}
@@ -2674,7 +2755,13 @@ EXPORT int my_getopt_long_only(int argc, char* const argv[], const char* optstri
return ret;
}
-#if 0
+typedef struct {
+ void *read;
+ void *write;
+ void *seek;
+ void *close;
+} my_cookie_io_functions_t;
+
typedef struct my_cookie_s {
uintptr_t r, w, s, c;
void* cookie;
@@ -2683,39 +2770,41 @@ typedef struct my_cookie_s {
static ssize_t my_cookie_read(void *p, char *buf, size_t size)
{
my_cookie_t* cookie = (my_cookie_t*)p;
- return (ssize_t)RunFunction(my_context, cookie->r, 3, cookie->cookie, buf, size);
+ return (ssize_t)RunFunctionFmt(cookie->r, "ppL", cookie->cookie, buf, size) ;
}
static ssize_t my_cookie_write(void *p, const char *buf, size_t size)
{
my_cookie_t* cookie = (my_cookie_t*)p;
- return (ssize_t)RunFunction(my_context, cookie->w, 3, cookie->cookie, buf, size);
+ return (ssize_t)RunFunctionFmt(cookie->w, "ppL", cookie->cookie, buf, size) ;
}
static int my_cookie_seek(void *p, off64_t *offset, int whence)
{
my_cookie_t* cookie = (my_cookie_t*)p;
- return RunFunction(my_context, cookie->s, 3, cookie->cookie, offset, whence);
+ return RunFunctionFmt(cookie->s, "ppi", cookie->cookie, offset, whence) ;
}
static int my_cookie_close(void *p)
{
my_cookie_t* cookie = (my_cookie_t*)p;
int ret = 0;
if(cookie->c)
- ret = RunFunction(my_context, cookie->c, 1, cookie->cookie);
+ ret = RunFunctionFmt(cookie->c, "p", cookie->cookie) ;
box_free(cookie);
return ret;
}
-EXPORT void* my_fopencookie(x64emu_t* emu, void* cookie, void* mode, void* read, void* write, void* seek, void* close)
+EXPORT void* my_fopencookie(x64emu_t* emu, void* cookie, void* mode, my_cookie_io_functions_t *s)
{
- cookie_io_functions_t io_funcs = {read?my_cookie_read:NULL, write?my_cookie_write:NULL, seek?my_cookie_seek:NULL, my_cookie_close};
+ cookie_io_functions_t io_funcs = {s->read?my_cookie_read:NULL, s->write?my_cookie_write:NULL, s->seek?my_cookie_seek:NULL, my_cookie_close};
my_cookie_t *cb = (my_cookie_t*)box_calloc(1, sizeof(my_cookie_t));
- cb->r = (uintptr_t)read;
- cb->w = (uintptr_t)write;
- cb->s = (uintptr_t)seek;
- cb->c = (uintptr_t)close;
+ cb->r = (uintptr_t)s->read;
+ cb->w = (uintptr_t)s->write;
+ cb->s = (uintptr_t)s->seek;
+ cb->c = (uintptr_t)s->close;
cb->cookie = cookie;
return fopencookie(cb, mode, io_funcs);
}
+#if 0
+
EXPORT long my_prlimit64(void* pid, uint32_t res, void* new_rlim, void* old_rlim)
{
return syscall(__NR_prlimit64, pid, res, new_rlim, old_rlim);
@@ -2898,6 +2987,15 @@ EXPORT int my_semctl(int semid, int semnum, int cmd, union semun b)
return ret;
}
+EXPORT int my_ptrace(x64emu_t* emu, int request, pid_t pid, void* addr, void* data)
+{
+ if(request == PTRACE_POKEUSER) {
+ // lets just ignore this for now!
+ return 0;
+ }
+ return ptrace(request, pid, addr, data);
+}
+
// Backtrace stuff
#include "elfs/elfdwarf_private.h"
@@ -2911,7 +3009,7 @@ EXPORT int my_backtrace(x64emu_t* emu, void** buffer, int size)
buffer[0] = (void*)addr;
while (++idx < size) {
uintptr_t ret_addr = get_parent_registers(unwind, FindElfAddress(my_context, addr), addr, &success);
- if (ret_addr == (uintptr_t)GetExit()) {
+ if (ret_addr == my_context->exit_bridge) {
// TODO: do something to be able to get the function name
buffer[idx] = (void*)ret_addr;
success = 2;
@@ -2941,7 +3039,7 @@ EXPORT int my_backtrace_ip(x64emu_t* emu, void** buffer, int size)
buffer[0] = (void*)addr;
while ((++idx < size) && success) {
uintptr_t ret_addr = get_parent_registers(unwind, FindElfAddress(my_context, addr), addr, &success);
- if (ret_addr == (uintptr_t)GetExit()) {
+ if (ret_addr == my_context->exit_bridge) {
// TODO: do something to be able to get the function name
buffer[idx] = (void*)ret_addr;
success = 2;
@@ -2972,7 +3070,7 @@ EXPORT int my_backtrace_ip(x64emu_t* emu, void** buffer, int size)
unwind->regs[7] += 8;
buffer[idx] = (void*)ret_addr;
success = 2;
- } else
+ } else
break;
}
} else
@@ -3019,7 +3117,7 @@ EXPORT void my_backtrace_symbols_fd(x64emu_t* emu, uintptr_t* buffer, int size,
if(!sz) sz=0x100; // arbitrary value...
if(symbname && buffer[i]>=start && (buffer[i]<(start+sz) || !sz))
snprintf(s, 200, "%s+%ld [%p]\n", symbname, buffer[i] - start, (void*)buffer[i]);
- else
+ else
snprintf(s, 200, "??? [%p]\n", (void*)buffer[i]);
int dummy = write(fd, s, strlen(s));
(void)dummy;
@@ -3096,10 +3194,10 @@ static int clone_fn(void* p)
updateGlibcTidCache(); // update cache tid if needed
x64emu_t *emu = arg->emu;
R_RSP = arg->stack;
- emu->quitonexit = 1;
+ emu->flags.quitonexit = 1;
thread_set_emu(emu);
int ret = RunFunctionWithEmu(emu, 0, arg->fnc, 1, arg->args);
- int exited = (emu->quitonexit==2);
+ int exited = (emu->flags.quitonexit==2);
thread_set_emu(NULL);
FreeX64Emu(&emu);
if(arg->stack_clone_used)
@@ -3116,8 +3214,8 @@ EXPORT int my_clone(x64emu_t* emu, void* fn, void* stack, int flags, void* args,
void* mystack = NULL;
clone_arg_t* arg = (clone_arg_t*)box_calloc(1, sizeof(clone_arg_t));
x64emu_t * newemu = NewX64Emu(emu->context, R_RIP, (uintptr_t)stack, 0, 0);
- SetupX64Emu(newemu);
- CloneEmu(newemu, emu);
+ SetupX64Emu(newemu, emu);
+ //CloneEmu(newemu, emu);
if(my_context->stack_clone_used) {
printf_log(LOG_DEBUG, " no free stack_clone ");
mystack = box_malloc(1024*1024); // stack for own process... memory leak, but no practical way to remove it
@@ -3175,15 +3273,17 @@ EXPORT int my_register_printf_type(x64emu_t* emu, void* f)
return my->register_printf_type(findprintf_typeFct(f));
}
+extern int box64_quit;
EXPORT void my_exit(x64emu_t* emu, int code)
{
- if(emu->quitonexit) {
+ if(emu->flags.quitonexit) {
emu->quit = 1;
R_EAX = code;
- emu->quitonexit = 2;
+ emu->flags.quitonexit = 2;
return;
}
emu->quit = 1;
+ box64_quit = 1;
exit(code);
}
@@ -3220,7 +3320,6 @@ EXPORT char my___libc_single_threaded = 0;
box64->libclib = lib; \
/*InitCpuModel();*/ \
ctSetup(); \
- stSetup(box64); \
obstackSetup(); \
my_environ = my__environ = my___environ = box64->envv; \
my___progname_full = my_program_invocation_name = box64->argv[0]; \
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index ecf8c05..933178e 100755..100644
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -24,7 +24,7 @@ GO(__adjtimex, iFp)
GOW(adjtimex, iFp)
//GOW(advance,
GO(alarm, uFu)
-GOW(aligned_alloc, pFLL)
+GO(aligned_alloc, pFUU)
GOW(alphasort, iFpp)
GOW(alphasort64, iFpp)
//GO(__arch_prctl,
@@ -94,7 +94,7 @@ GOW(brk, iFp)
GOM(bsearch, pFEppLLp)
GOW(btowc, uFi)
GO(__bzero, vFpL)
-GOW(bzero, vFpL)
+GO(bzero, vFpL)
//GO(c16rtomb, LFpW!)
//GOW(c32rtomb, LFpu!)
GOW(calloc, pFLL)
@@ -177,7 +177,7 @@ GO(ctime_r, pFpp)
//DATA(__ctype32_toupper,
DATA(__ctype_b, sizeof(void*))
GO(__ctype_b_loc, pFv)
-GOW(__ctype_get_mb_cur_max, LFv)
+GO(__ctype_get_mb_cur_max, LFv)
//GO(__ctype_init,
DATAM(__ctype_tolower, sizeof(void*))
GO(__ctype_tolower_loc, pFv)
@@ -219,8 +219,8 @@ GOWM(dl_iterate_phdr, iFEpp)
//GO(_dl_sym,
//GO(_dl_vsym,
GOW(dngettext, pFpppL)
-//GO(dprintf, iFipV)
-//GO(__dprintf_chk,
+GOM(dprintf, iFEipV)
+GOM(__dprintf_chk, iFEiipV)
GO(drand48, dFv)
GO(drand48_r, iFpp)
GOW(dup, iFi)
@@ -294,7 +294,7 @@ GO(eventfd, iFui)
GO(eventfd_read, iFip)
GO(eventfd_write, iFiL)
GOM(execl, iFEpV) // First argument is also part of the variadic
-//GOM(execle, iFEpV) // First argument is also part of the variadic
+GOM(execle, iFEpV) // First argument is also part of the variadic
GOM(execlp, iFEpV) // First argument is also part of the variadic
GOM(execv, iFEpp)
GOWM(execve, iFEppp)
@@ -324,7 +324,7 @@ GOWM(__fcntl, iFEiiN)
GOWM(fcntl, iFEiiN)
GOWM(fcntl64, iFEiiN)
GO(fcvt, pFdipp)
-GOW(fcvt_r, iFdipppL)
+GO(fcvt_r, iFdipppL)
GO(fdatasync, iFi)
GO(__fdelt_chk, LFL)
//GO(__fdelt_warn,
@@ -341,7 +341,7 @@ GOW(fflush, iFS)
GO(fflush_unlocked, iFS)
//GO(__ffs,
GO(ffs, iFi)
-GOW(ffsl, iFl)
+GO(ffsl, iFI)
GO(ffsll, iFI)
GOW(fgetc, iFp)
GOW(fgetc_unlocked, iFp)
@@ -384,11 +384,11 @@ GO(fmtmsg, iFlpippp)
GO(fnmatch, iFppi)
GOM(fopen, pFEpp)
GOWM(fopen64, pFEpp)
-//GO(fopencookie, pFpp?)
+GOM(fopencookie, pFEppV)
//GO(__fork,
GOWM(fork, iFEv)
//GO(__fortify_fail,
-GOW(fpathconf, lFii)
+GO(fpathconf, lFii)
GO(__fpending, LFp)
GOM(fprintf, iFEppV)
GOM(__fprintf_chk, iFEpipV)
@@ -402,11 +402,11 @@ GO(fputwc, uFip)
GO(fputwc_unlocked, uFip)
GO(fputws, iFpp)
GO(fputws_unlocked, iFpp)
-GOW(fread, LFpLLp)
+GO(fread, LFpLLp)
GO(__freadable, iFp)
GO(__fread_chk, LFpLLLp)
GO(__freading, iFp)
-GOW(fread_unlocked, LFpLLp)
+GO(fread_unlocked, LFpLLp)
GO(__fread_unlocked_chk, LFpLLLp)
GO(free, vFp)
GO(freeaddrinfo, vFp)
@@ -421,9 +421,9 @@ GOW(frexpf, fFfp)
GOW(frexpl, DFDp)
GOM(fscanf, iFEppV)
GO(fseek, iFpli)
-GOW(fseeko, iFpli)
+GO(fseeko, iFpIi)
GO(__fseeko64, iFpli)
-GOW(fseeko64, iFpli)
+GO(fseeko64, iFpli)
GO(__fsetlocking, iFpi)
GO(fsetpos, iFpp)
GO(fsetpos64, iFpp)
@@ -437,14 +437,14 @@ GOW(fstatfs64, iFip)
GOW(fstatvfs, iFip)
GOW(fstatvfs64, iFip)
GO(fsync, iFi)
-GOW(ftell, lFp)
-GOW(ftello, lFp)
+GO(ftell, lFp)
+GO(ftello, IFp)
GO(__ftello64, lFp)
-GOW(ftello64, lFp)
+GO(ftello64, lFp)
GO(ftime, iFp)
GO(ftok, iFpi)
-GOW(ftruncate, iFil)
-GOW(ftruncate64, iFil)
+GO(ftruncate, iFiI)
+GO(ftruncate64, iFil)
GOW(ftrylockfile, iFp)
GOW(fts64_children, pFpi)
GOW(fts64_close, iFp)
@@ -466,7 +466,7 @@ GO(fwide, iFpi)
GOWM(fwprintf, iFEppV)
GOM(__fwprintf_chk, iFEpipV)
GO(__fwritable, iFp)
-GOW(fwrite, LFpLLp)
+GO(fwrite, LFpLLp)
GO(fwrite_unlocked, LFpLLp)
GO(__fwriting, iFp)
//GO(fwscanf, iFppV)
@@ -496,16 +496,16 @@ GOWM(getcontext, iFEp)
GOW(getcpu, iFpp)
GOW(getc_unlocked, iFp)
GO(get_current_dir_name, pFv)
-GOW(getcwd, pFpL)
+GO(getcwd, pFpL)
GO(__getcwd_chk, pFpLL)
GO(getdate, pFp)
//DATAB(getdate_err,
GOW(getdate_r, iFpp)
GOW(__getdelim, lFppip)
-GOW(getdelim, lFppip)
-GOW(getdents64, lFipL)
-GOW(getdirentries, lFipLp)
-GOW(getdirentries64, lFipLp)
+GO(getdelim, lFppip)
+GO(getdents64, lFipL)
+GO(getdirentries, IFipUp)
+GO(getdirentries64, lFipLp)
GO(getdomainname, iFpL)
//GO(__getdomainname_chk,
GOW(getdtablesize, iFv)
@@ -541,7 +541,7 @@ GOW(getifaddrs, iFp)
//GO(getipv4sourcefilter, iFi??pp!)
GOW(getitimer, iFup)
//GO(get_kernel_syms, // Deprecated
-GOW(getline, lFppp)
+GO(getline, lFppp)
GO(getloadavg, iFpi)
GO(getlogin, pFv)
GOW(getlogin_r, iFpL)
@@ -675,7 +675,7 @@ GOW(group_member, iFu)
GOW(gsignal, iFi)
//GO(gtty, // Deprecated
GOW(hasmntopt, pFpp)
-GO(hcreate, iFL)
+GO(hcreate, iFU)
//GOW(hcreate_r, iFL!)
GOW(hdestroy, vFv)
//GOW(hdestroy_r, vF!)
@@ -738,8 +738,8 @@ GOW(inet_pton, iFipp)
//GO(__inet_pton_length,
GO(initgroups, iFpu)
//GO(init_module, // Deprecated
-GOW(initstate, pFupL)
-GOW(initstate_r, iFupLp)
+GO(initstate, pFupL)
+GO(initstate_r, iFupLp)
GO(innetgr, iFpppp)
GO(inotify_add_watch, iFipu)
GO(inotify_init, iFv)
@@ -929,7 +929,7 @@ GOM(__isoc99_fscanf, iFEppV)
//GO(__isoc99_fwscanf, iFppV)
GOM(__isoc99_scanf, iFEpV)
GOM(__isoc99_sscanf, iFEppV)
-//GO(__isoc99_swscanf, iFppV)
+GOM(__isoc99_swscanf, iFEppV)
GOM(__isoc99_vfscanf, iFEppp)
//GO(__isoc99_vfwscanf, iFppA)
//GO(__isoc99_vscanf, iFpA)
@@ -1095,8 +1095,8 @@ GO(localtime, pFp)
GO2(localtime64, pFp, localtime)
GOW(localtime_r, pFpp)
GO2(localtime64_r, pFpp, localtime_r) //Weak
-GO(lockf, iFiil)
-GOW(lockf64, iFiil)
+GO(lockf, iFiiI)
+GO(lockf64, iFiil)
//DATAB(locs,
GOWM(_longjmp, vFEpi)
GOWM(longjmp, vFEpi)
@@ -1106,8 +1106,8 @@ GO(lrand48_r, iFpp)
GO(lremovexattr, iFpp)
GOM(lsearch, pFEpppLp)
GO(__lseek, IFiIi)
-GOW(lseek, lFili)
-GOW(lseek64, lFili)
+GO(lseek, IFiIi)
+GO(lseek64, lFili)
GO(lsetxattr, iFpppLi)
GOM(lstat, iFEpp)
GOM(lstat64, iFEpp)
@@ -1118,27 +1118,27 @@ GO(__madvise, iFpLi)
GOW(madvise, iFpLi)
GOWM(makecontext, iFEppiV)
GOWM(mallinfo, pFEp)
-GO(malloc, pFL) // need to wrap to clear allocated memory?
+GO(malloc, pFL)
//GO(malloc_get_state, // Obsolete
GOW(malloc_info, iFip)
//GO(malloc_set_state, // Obsolete
GOW(malloc_stats, vFv)
-GOW(malloc_trim, iFL)
-GOW(malloc_usable_size, LFp)
+GO(malloc_trim, iFL)
+GO(malloc_usable_size, LFp)
GOW(mallopt, iFii)
//DATAB(mallwatch,
-GO(mblen, iFpL)
+GO(mblen, iFpU)
GO(__mbrlen, LFpLp)
-GOW(mbrlen, LFpLp)
+GO(mbrlen, LFpLp)
//GO(mbrtoc16, LFppL!)
//GOW(mbrtoc32, LFppL!)
GO(__mbrtowc, LFppLp)
-GOW(mbrtowc, LFppLp)
+GO(mbrtowc, LFppLp)
GOW(mbsinit, iFp)
-GOW(mbsnrtowcs, LFppLLp)
-//GO(__mbsnrtowcs_chk,
-GOW(mbsrtowcs, LFppLp)
-//GO(__mbsrtowcs_chk,
+GO(mbsnrtowcs, LFppLLp)
+GO(__mbsnrtowcs_chk, LFppLLpL)
+GO(mbsrtowcs, LFppLp)
+GO(__mbsrtowcs_chk, LFppLpL)
GO(mbstowcs, LFppL)
//GO(__mbstowcs_chk,
GO(mbtowc, iFppL)
@@ -1148,21 +1148,22 @@ GO(mcheck_check_all, vFv)
//GO(_mcleanup,
GO(_mcount, vFpp)
GO2(mcount, vFpp, _mcount)
-GOW(memalign, pFLL)
-GOW(memccpy, pFppiL)
+GO(memalign, pFLL)
+GO(memccpy, pFppiL)
GO(memchr, pFpiL)
GO(memcmp, iFppL)
+GO(__memcmpeq, iFppL)
GO(memcpy, pFppL)
GO(__memcpy_chk, pFppuL)
GO(memfd_create, iFpu)
GO(memfrob, pFpL)
-GOW(memmem, pFpLpL)
-GO(memmove, pFppL)
+GO(memmem, pFpLpL)
+GO(memmove, pFppU)
GO(__memmove_chk, pFppLL)
GO(__mempcpy, pFppL)
GO(mempcpy, pFppL)
GO(__mempcpy_chk, pFppLL)
-GOW(memrchr, pFpiL)
+GO(memrchr, pFpiL)
GO(memset, pFpiL)
GO(__memset_chk, pFpiLL)
//GO(__mempcpy_small,
@@ -1173,8 +1174,8 @@ GO(mkdirat, iFipu)
GO(mkdtemp, pFp)
GO(mkfifo, iFpu)
GO(mkfifoat, iFipu)
-GO(mknod, iFpuu)
-GO(mknodat, iFipuu)
+GO(mknod, iFpuL)
+GO(mknodat, iFipuL)
GO(mkostemp, iFpi)
GOW(mkostemp64, iFpi)
GO(mkostemps, iFpii)
@@ -1204,7 +1205,7 @@ GOW(mount, iFpppLp)
GO(mprobe, iFp)
//GO(__mprotect,
GOWM(mprotect, iFEpLi)
-GO(mrand48, lFv)
+GO(mrand48, IFv)
GO(mrand48_r, iFpp)
GOM(mremap, pFEpLLiN) //weal
GO(msgctl, iFiip)
@@ -1291,7 +1292,7 @@ GOW(openat, iFipON)
GO(__openat_2, iFipO)
GOW(openat64, iFipON)
GO(__openat64_2, iFipO)
-GO(open_by_handle_at, iFipO)
+GO(open_by_handle_at, iFipi)
//GO(__open_catalog,
GOW(opendir, pFp)
GO(openlog, vFpii)
@@ -1303,9 +1304,9 @@ DATA(opterr, sizeof(int))
DATA(optind, sizeof(int))
DATA(optopt, sizeof(int))
GO(__overflow, iFpi)
-//GO(parse_printf_format,
+GO(parse_printf_format, LFpLp)
//GO(passwd2des, // Deprecated
-GOW(pathconf, lFpi)
+GO(pathconf, lFpi)
GOW(pause, iFv)
//GO(__pause_nocancel,
GO(pclose, iFp)
@@ -1313,7 +1314,7 @@ GO(perror, vFp)
GOW(personality, iFL)
GO(__pipe, iFp)
GOW(pipe, iFp)
-GOW(pipe2, iFpO)
+GO(pipe2, iFpi)
//GO(pivot_root, // Deprecated
GO(pkey_alloc, iFuu)
GO(pkey_free, iFi)
@@ -1326,23 +1327,23 @@ GO(pkey_set, iFiu)
GO(pmap_set, iFLLiW)
GO(pmap_unset, iFLL)
GO(__poll, iFpLi)
-GOW(poll, iFpLi)
+GO(poll, iFpLi)
GO(__poll_chk, iFpuiL)
GO(popen, pFpp)
GO(posix_fadvise, iFilli)
-GOW(posix_fadvise64, iFilli)
+GO(posix_fadvise64, iFilli)
GO(posix_fallocate, iFill)
GO(posix_fallocate64, iFill)
//GO(__posix_getopt,
GO(posix_madvise, iFpLi)
-GOW(posix_memalign, iFpLL)
+GO(posix_memalign, iFpLL)
GOW(posix_openpt, iFi)
GOM(posix_spawn, iFEpppppp)
GOW(posix_spawnattr_destroy, iFp)
GO(posix_spawnattr_getflags, iFpp)
GO(posix_spawnattr_getpgroup, iFpp)
-//GO(posix_spawnattr_getschedparam, iF!!)
-//GO(posix_spawnattr_getschedpolicy, iF!p)
+GO(posix_spawnattr_getschedparam, iFpp)
+GO(posix_spawnattr_getschedpolicy, iFpp)
GO(posix_spawnattr_getsigdefault, iFpp)
GO(posix_spawnattr_getsigmask, iFpp)
GOW(posix_spawnattr_init, iFp)
@@ -1361,11 +1362,11 @@ GOW(posix_spawn_file_actions_destroy, iFp)
GOW(posix_spawn_file_actions_init, iFp)
GOM(posix_spawnp, iFEpppppp)
GO(ppoll, iFpLpp)
-//GO(__ppoll_chk,
+GO(__ppoll_chk, iFpuppL)
GOWM(prctl, iFEiLLLL)
-GOW(pread, lFipLl)
+GO(pread, IFipUI)
GOW(__pread64, lFipLI)
-GOW(pread64, lFipLl)
+GO(pread64, lFipLl)
//GO(__pread64_chk,
GO(__pread_chk, lFipLlL)
GO(preadv, lFipil)
@@ -1381,12 +1382,12 @@ GO(prlimit, iFiupp)
GOW(prlimit64, iFiupp)
GO(process_vm_readv, lFipLpLL)
GO(process_vm_writev, lFipLpLL)
-GOW(profil, iFpLLu)
+GO(profil, iFpLLu)
//GO(__profile_frequency,
DATA(__progname, sizeof(void*))
DATA(__progname_full, sizeof(void))
GOW(pselect, iFippppp)
-//GO(psiginfo, vF!p)
+GO(psiginfo, vFpp)
GO(psignal, vFip)
//GO(pthread_attr_destroy,
//GO(pthread_attr_getdetachstate,
@@ -1419,7 +1420,7 @@ GO(psignal, vFip)
//GO(pthread_setcancelstate,
//GO(pthread_setcanceltype,
//GO(pthread_setschedparam,
-GO(ptrace, lFuipp)
+GOM(ptrace, lFEuipp)
GO(ptsname, pFi)
GOW(ptsname_r, iFipL)
//GO(__ptsname_r_chk,
@@ -1438,14 +1439,14 @@ GO(putspent, iFpp)
GOW(pututline, pFp)
GO(pututxline, pFp)
GO(putw, iFip)
-GO(putwc, uFip)
-GO(putwchar, uFi)
-GO(putwchar_unlocked, uFi)
-GO(putwc_unlocked, uFip)
-GOW(pvalloc, pFL)
-GOW(pwrite, lFipLl)
+GO(putwc, uFup)
+GO(putwchar, uFu)
+GO(putwchar_unlocked, uFu)
+GO(putwc_unlocked, uFup)
+GO(pvalloc, pFL)
+GO(pwrite, IFipUI)
//GOW(__pwrite64,
-GOW(pwrite64, lFipLl)
+GO(pwrite64, lFipLl)
GO(pwritev, lFipil)
GO(pwritev2, lFipili)
GO(pwritev64, lFipil)
@@ -1453,7 +1454,7 @@ GO(pwritev64v2, lFipili)
GO(qecvt, pFDipp)
GOW(qecvt_r, iFDipppL)
GO(qfcvt, pFDipp)
-GOW(qfcvt_r, iFDipppL)
+GO(qfcvt_r, iFDipppL)
GO(qgcvt, pFDip)
GOM(qsort, vFEpLLp)
GOWM(qsort_r, vFEpLLpp)
@@ -1472,7 +1473,7 @@ GO(rcmd_af, iFpWppppW)
//DATAB(__rcmd_errstr,
GOW(__read, lFipL)
GO(read, lFipL)
-GOW(readahead, lFilL)
+GO(readahead, lFilL)
GO(__read_chk, lFipLL)
GOW(readdir, pFp) // struct dirent is 280 bytes on x86_64 and ARM64
GOW(readdir64, pFp)
@@ -1485,7 +1486,7 @@ GOM(readlinkat, iFEippL)
//GO(__read_nocancel,
GOW(readv, lFipi)
GO(realloc, pFpL)
-GOW(reallocarray, pFpLL)
+GO(reallocarray, pFpLL)
GOM(realpath, pFEpp)
GO2(__realpath_chk, pFEppv, my_realpath)
GO(reboot, iFi)
@@ -1493,12 +1494,12 @@ GO(reboot, iFi)
GOW(re_compile_fastmap, iFp)
GOW(re_compile_pattern, pFpLp)
GOW(__recv, lFipLi)
-GOW(recv, lFipLi)
+GO(recv, lFipLi)
GO(__recv_chk, lFipLLi)
GOW(recvfrom, lFipLipp)
//GO(__recvfrom_chk,
GO(recvmmsg, iFipuip)
-GOW(recvmsg, lFipi)
+GO(recvmsg, lFipi)
//GOW(re_exec, // Deprecated
GOW(regcomp, iFppi)
GOW(regerror, LFippL)
@@ -1510,7 +1511,7 @@ GOW(register_printf_modifier, iFp)
GOWM(register_printf_specifier, iFEipp)
GOWM(register_printf_type, iFEp)
//GO(registerrpc, // Deprecated?
-GOW(remap_file_pages, iFpLiLi)
+GO(remap_file_pages, iFpLiLi)
//GOW(re_match, iFppii!)
//GOW(re_match_2, iFppipii!i)
//DATA(re_max_failures,
@@ -1560,7 +1561,7 @@ GO(ruserok, iFpipp)
GO(ruserok_af, iFpippW)
//GO(ruserpass,
GO(__sbrk, pFl)
-GOW(sbrk, pFl)
+GO(sbrk, pFl)
GOW(scalbn, dFdi)
GOW(scalbnf, fFfi)
GOW(scalbnl, DFDi)
@@ -1601,16 +1602,16 @@ GO(semget, iFiii)
GO(semop, iFipL)
GO(semtimedop, iFipLp)
GO(__send, lFipLi)
-GOW(send, lFipLi)
+GO(send, lFipLi)
GO(sendfile, lFiipL)
GOW(sendfile64, lFiipL)
GO(__sendmmsg, iFipui)
GOW(sendmmsg, iFipui)
-GOW(sendmsg, lFipi)
+GO(sendmsg, lFipi)
GOW(sendto, lFipLipu)
GO(setaliasent, vFv)
GO(setbuf, vFpp)
-GOW(setbuffer, vFppL)
+GO(setbuffer, vFppL)
GOWM(setcontext, iFEp)
GO(setdomainname, iFpL)
GO(setegid, iFu)
@@ -1666,7 +1667,7 @@ GOW(setuid, iFu)
GO(setusershell, vFv)
GOW(setutent, vFv)
GO(setutxent, vFv)
-GOW(setvbuf, iFppiL)
+GO(setvbuf, iFppiL)
GO(setxattr, iFpppLi)
//GO(sgetsgent,
//GOW(sgetsgent_r,
@@ -1692,7 +1693,7 @@ GO(siggetmask, iFv)
GO(sighold, iFi)
GO(sigignore, iFi)
GO(siginterrupt, iFii)
-//GO(sigisemptyset, iF!)
+GO(sigisemptyset, iFp)
//GO(__sigismember,
GO(sigismember, iFpi)
GOM(siglongjmp, vFEpi)
@@ -1701,7 +1702,7 @@ GO(signalfd, iFipi)
GO(__signbit, iFd)
GO(__signbitf, iFf)
GO(__signbitl, iFD)
-//GO(sigorset, iF!!!)
+GO(sigorset, iFppp)
//GO(__sigpause,
//GOW(sigpause, // Deprecated
GO(sigpending, iFp)
@@ -1713,7 +1714,7 @@ GOM(sigset, pFEip)
GOM(__sigsetjmp, iFEpi)
GOM(sigsetjmp, iFEpi)
GOW(sigsetmask, iFi)
-//GO(sigstack, iF!!)
+GO(sigstack, iFpp)
GO(__sigsuspend, iFp)
GOW(sigsuspend, iFp)
GO(__sigtimedwait, iFppp)
@@ -1735,7 +1736,7 @@ GOM(__sprintf_chk, iFEpilpV)
//GOW(sprofil,
GOW(srand, vFu)
GO(srand48, vFl)
-GOW(srand48_r, iFlp)
+GO(srand48_r, iFlp)
GOW(srandom, vFu)
GOW(srandom_r, iFup)
GOM(sscanf, iFEppV)
@@ -1760,7 +1761,7 @@ GO(stpcpy, pFpp)
GO(__stpcpy_chk, pFppL)
//GO(__stpcpy_small,
GO(__stpncpy, pFppL)
-GOW(stpncpy, pFppL)
+GO(stpncpy, pFppL)
GO(__stpncpy_chk, pFppLL)
GO(__strcasecmp, iFpp)
GO(strcasecmp, iFpp)
@@ -1788,17 +1789,17 @@ GOW(strdup, pFp)
GO(strerror, pFi)
GO(strerror_l, pFip)
GO(__strerror_r, pFipL)
-GOW(strerror_r, pFipL)
+GO(strerror_r, pFipL)
//GO(strfmon, lFpLpV)
//GO(__strfmon_l,
//GOW(strfmon_l, lFpLppV)
GO(strfromd, iFpLpd)
GO(strfromf, iFpLpf)
-//GO(strfromf128,
-GOW(strfromf32, iFpLpf)
-GOW(strfromf32x, iFpLpd)
-GOW(strfromf64, iFpLpd)
-GOW(strfromf64x, iFpLpD)
+GO(strfromf128, iFpLpD)
+GO(strfromf32, iFpLpf)
+GO(strfromf32x, iFpLpd)
+GO(strfromf64, iFpLpd)
+GO(strfromf64x, iFpLpD)
GO(strfroml, iFpLpD)
GO(strfry, pFp)
GO(strftime, LFpLpp)
@@ -1814,7 +1815,7 @@ GO(strncmp, iFppL)
GO(strncpy, pFppL)
GO(__strncpy_chk, pFppLL)
GO(__strndup, pFpL)
-GOW(strndup, pFpL)
+GO(strndup, pFpL)
GO(strnlen, LFpL)
GO(strpbrk, pFpp)
//GO(__strpbrk_c2,
@@ -1839,7 +1840,7 @@ GO(__strtod_l, dFppp)
GOW(strtod_l, dFppp)
//GO(__strtod_nan,
GO(strtof, fFpp)
-//GO(strtof128,
+GO(strtof128, DFpp)
//GO(__strtof128_internal,
//GOW(strtof128_l,
//GO(__strtof128_nan,
@@ -1860,7 +1861,7 @@ GO(strtok, pFpp)
GO(__strtok_r, pFppp)
GOW(strtok_r, pFppp)
//GO(__strtok_r_1c,
-GOW(strtol, lFppi)
+GO(strtol, lFppi)
GO(strtold, DFpp)
GO(__strtold_internal, DFppi)
GO(__strtold_l, DFppp)
@@ -1868,16 +1869,16 @@ GOW(strtold_l, DFppp)
//GO(__strtold_nan,
GO(__strtol_internal, lFppii)
GO(__strtol_l, lFppi)
-GOW(strtol_l, lFppip)
+GO(strtol_l, lFppip)
GOW(strtoll, IFppi)
GO(__strtoll_internal, IFppii)
GOW(__strtoll_l, IFppip)
GOW(strtoll_l, IFppip)
GOW(strtoq, IFppi)
-GOW(strtoul, LFppi)
+GO(strtoul, LFppi)
GO(__strtoul_internal, LFppii)
//GO(__strtoul_l,
-GOW(strtoul_l, LFppip)
+GO(strtoul_l, LFppip)
GOW(strtoull, UFppi)
GO(__strtoull_internal, UFppii)
GOW(__strtoull_l, LFppip)
@@ -1888,7 +1889,7 @@ GOW(strtouq, UFppi)
GOW(strverscmp, iFpp)
GO(strxfrm, LFppL)
GO(__strxfrm_l, LFppLL)
-GOW(strxfrm_l, LFppLp)
+GO(strxfrm_l, LFppLp)
//GO(stty, // Deprecated
//DATAB(svcauthdes_stats,
//GO(svcerr_auth, vF!u)
@@ -1932,7 +1933,7 @@ GO(sync_file_range, iFillu)
GO(syncfs, iFi)
GOM(syscall, lFEv)
GO(__sysconf, lFi)
-GOW(sysconf, lFi)
+GO(sysconf, IFi)
GO(__sysctl, iFpipppL)
GOW(sysctl, iFpipppL) // Deprecated
DATA(_sys_errlist, sizeof(void*))
@@ -1956,14 +1957,14 @@ GO(tcsendbreak, iFii)
GO(tcsetattr, iFiip)
GO(tcsetpgrp, iFii)
//GO(__tdelete,
-//GOW(tdelete, pFpp@)
+GOWM(tdelete, pFEppp)
GOWM(tdestroy, vFEpp)
GO(tee, lFiiLu)
GO(telldir, lFp)
GO(tempnam, pFpp)
GOW(textdomain, pFp)
//GO(__tfind,
-//GOW(tfind, pFpp@)
+GOWM(tfind, pFEppp)
GOW(tgkill, iFiii)
//GO(thrd_current,
//GO(thrd_equal,
@@ -2004,12 +2005,12 @@ GOW(towupper, uFu)
GO(__towupper_l, iFip)
GOW(towupper_l, uFup)
//GO(tr_break,
-GOW(truncate, iFpl)
-GOW(truncate64, iFpl)
+GO(truncate, iFpI)
+GO(truncate64, iFpl)
//GO(__tsearch,
GOWM(tsearch, pFEppp)
GO(ttyname, pFi)
-GOW(ttyname_r, iFipL)
+GO(ttyname_r, iFipL)
//GO(__ttyname_r_chk,
GO(ttyslot, iFv)
//GO(__twalk,
@@ -2047,11 +2048,11 @@ GO(utimensat, iFippi)
GOW(utimes, iFpp)
GOW(utmpname, iFp)
GO(utmpxname, iFp)
-GOW(valloc, pFL)
+GO(valloc, pFL)
GOWM(vasprintf, iFEppA)
GOM(__vasprintf_chk, iFEpipp)
-//GOW(vdprintf, iFipA)
-//GO(__vdprintf_chk,
+GOM(vdprintf, iFEipA)
+GOM(__vdprintf_chk, iFEiipA)
//GO(verr, vFipA)
//GO(verrx, vFipA)
GOW(versionsort, iFpp)
@@ -2073,7 +2074,7 @@ GOM(__vprintf_chk, iFEvpp)
//GOW(vscanf, iFpA)
GOWM(__vsnprintf, iFEpLpA)
GOWM(vsnprintf, iFEpLpA)
-GOM(__vsnprintf_chk, iFEpLvvpp)
+GOM(__vsnprintf_chk, iFEpLiLpp)
GOWM(vsprintf, iFEppA)
GOM(__vsprintf_chk, iFEpvvppp)
GOWM(__vsscanf, iFEppp)
@@ -2086,7 +2087,7 @@ GOM(__vsyslog_chk, vFEiipA)
//GO(vtimes, // Deprecated
//GO(vwarn, vFpA)
//GO(vwarnx, vFpA)
-//GO(vwprintf, iFpA)
+GOM(vwprintf, iFEpA)
//GO(__vwprintf_chk,
//GO(vwscanf, iFpA)
GOW(__wait, iFp)
@@ -2100,17 +2101,17 @@ GOM(warn, vFEpV)
GOM(warnx, vFEpV)
GOW(wcpcpy, pFpp)
//GO(__wcpcpy_chk,
-GOW(wcpncpy, pFppL)
+GO(wcpncpy, pFppL)
//GO(__wcpncpy_chk,
-GOW(wcrtomb, LFpip)
+GO(wcrtomb, LFpup)
//GO(__wcrtomb_chk,
GOW(wcscasecmp, iFpp)
GO(__wcscasecmp_l, iFppp)
GOW(wcscasecmp_l, iFppp)
GOW(wcscat, pFpp)
GO(__wcscat_chk, pFppL)
-GO(wcschr, pFpi)
-GOW(wcschrnul, pFpi)
+GO(wcschr, pFpu)
+GO(wcschrnul, pFpu)
GO(wcscmp, iFpp)
GOW(wcscoll, iFpp)
GO(__wcscoll_l, iFppp)
@@ -2121,9 +2122,9 @@ GO(wcscspn, LFpp)
GO(wcsdup, pFp)
GO(wcsftime, LFpLpp)
GO(__wcsftime_l, LFpLppp)
-GOW(wcsftime_l, LFpLppp)
+GO(wcsftime_l, LFpLppp)
GO(wcslen, LFp)
-GOW(wcsncasecmp, iFppL)
+GO(wcsncasecmp, iFppL)
//GO(__wcsncasecmp_l,
//GOW(wcsncasecmp_l, iFppL!)
GO(wcsncat, pFppL)
@@ -2132,11 +2133,11 @@ GO(wcsncmp, iFppL)
GOW(wcsncpy, pFppL)
GO(__wcsncpy_chk, pFppLL)
GO(wcsnlen, LFpL)
-GOW(wcsnrtombs, LFppLLp)
+GO(wcsnrtombs, LFppLLp)
//GO(__wcsnrtombs_chk,
GO(wcspbrk, pFpp)
-GO(wcsrchr, pFpi)
-GOW(wcsrtombs, LFppLp)
+GO(wcsrchr, pFpu)
+GO(wcsrtombs, LFppLp)
//GO(__wcsrtombs_chk,
GO(wcsspn, LFpp)
GO(wcsstr, pFpp)
@@ -2145,7 +2146,7 @@ GO(wcstod, dFpp)
//GO(__wcstod_l,
//GOW(wcstod_l, dFpp!)
GO(wcstof, fFpp)
-//GO(wcstof128,
+GO(wcstof128, DFpp)
//GO(__wcstof128_internal,
//GOW(wcstof128_l,
GOW(wcstof32, fFpp)
@@ -2161,7 +2162,7 @@ GOW(wcstof64x, DFpp)
//GOW(wcstof_l, fFpp!)
GO(wcstoimax, lFppi)
GO(wcstok, pFppp)
-GOW(wcstol, lFppi)
+GO(wcstol, lFppi)
GO(wcstold, DFpp)
//GO(__wcstold_internal,
//GO(__wcstold_l,
@@ -2176,7 +2177,7 @@ GOW(wcstoll, IFppi)
GO(wcstombs, LFppL)
//GO(__wcstombs_chk,
GOW(wcstoq, IFppi)
-GOW(wcstoul, LFppi)
+GO(wcstoul, LFppi)
//GO(__wcstoul_internal,
//GO(__wcstoul_l,
//GOW(wcstoul_l, LFppi!)
@@ -2190,9 +2191,9 @@ GOW(wcswcs, pFpp)
GO(wcswidth, iFpL)
GO(wcsxfrm, LFppL)
GO(__wcsxfrm_l, LFppLL)
-GOW(wcsxfrm_l, LFppLp)
+GO(wcsxfrm_l, LFppLp)
GO(wctob, iFu)
-GO(wctomb, iFpi)
+GO(wctomb, iFpu)
GO(__wctomb_chk, iFpuL)
GOW(wctrans, pFp)
//GO(__wctrans_l,
@@ -2200,24 +2201,24 @@ GOW(wctrans_l, pFpp)
GOW(wctype, LFp)
GOW(wctype_l, LFpp)
GO(__wctype_l, LFpp)
-GO(wcwidth, iFi)
-GO(wmemchr, pFpiL)
+GO(wcwidth, iFu)
+GO(wmemchr, pFpuL)
GO(wmemcmp, iFppL)
GOW(wmemcpy, pFppL)
GO(__wmemcpy_chk, pFppLL)
-GOW(wmemmove, pFppL)
-//GO(__wmemmove_chk,
+GO(wmemmove, pFppL)
+GO(__wmemmove_chk, pFppLL)
GOW(wmempcpy, pFppL)
//GO(__wmempcpy_chk,
-GO(wmemset, pFpiL)
-//GO(__wmemset_chk,
+GO(wmemset, pFpuL)
+GO(__wmemset_chk, pFpuLL)
GO(wordexp, iFppi)
GO(wordfree, vFp)
//GO(__woverflow,
GOM(wprintf, iFEpV)
GOM(__wprintf_chk, lFEipV)
GOW(__write, lFipL)
-GOW(write, lFipL)
+GO(write, lFipL)
//GO(__write_nocancel,
GOW(writev, lFipi)
//GO(wscanf, iFpV)
diff --git a/src/wrapped/wrappedlibcmusl.c b/src/wrapped/wrappedlibcmusl.c
new file mode 100644
index 0000000..acef30b
--- /dev/null
+++ b/src/wrapped/wrappedlibcmusl.c
@@ -0,0 +1,35 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "elfloader.h"
+#include "box64context.h"
+#include "x64tls.h"
+
+
+// don't try to load the actual ld-linux (because name is variable), just use box64 itself, as it's linked to ld-linux
+const char* libcmuslName = "libc.musl-x86_64.so.1";
+#define LIBNAME libcmusl
+
+#define PRE_INIT\
+ if(1) \
+ lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \
+ else
+
+#define CUSTOM_INIT \
+ box64_musl = 1; \
+ setNeededLibs(lib, 4, "libc.so.6", "libdl.so.2", "libm.so.6", "libpthread.so.0");
+
+// define all standard library functions
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedlibcmusl_private.h b/src/wrapped/wrappedlibcmusl_private.h
new file mode 100644
index 0000000..b295d35
--- /dev/null
+++ b/src/wrapped/wrappedlibcmusl_private.h
@@ -0,0 +1,4 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error meh!
+#endif
+
diff --git a/src/wrapped/wrappedlibcrypt.c b/src/wrapped/wrappedlibcrypt.c
index 58b7e4e..58b7e4e 100755..100644
--- a/src/wrapped/wrappedlibcrypt.c
+++ b/src/wrapped/wrappedlibcrypt.c
diff --git a/src/wrapped/wrappedlibcrypt_private.h b/src/wrapped/wrappedlibcrypt_private.h
index 4c08778..4c08778 100755..100644
--- a/src/wrapped/wrappedlibcrypt_private.h
+++ b/src/wrapped/wrappedlibcrypt_private.h
diff --git a/src/wrapped/wrappedlibcups.c b/src/wrapped/wrappedlibcups.c
index a99f0b4..16ea472 100755..100644
--- a/src/wrapped/wrappedlibcups.c
+++ b/src/wrapped/wrappedlibcups.c
@@ -21,5 +21,54 @@
const char* libcupsName = "libcups.so.2";
#define LIBNAME libcups
+#define ADDED_FUNCTIONS() \
+
+#include "generated/wrappedlibcupstypes.h"
+
+#include "wrappercallback.h"
+
+#define SUPER() \
+GO(0) \
+GO(1) \
+GO(2) \
+GO(3) \
+GO(4)
+
+// cups_dest_cb_t ...
+#define GO(A) \
+static uintptr_t my_cups_dest_cb_t_fct_##A = 0; \
+static int my_cups_dest_cb_t_##A(void* a, uint32_t b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my_cups_dest_cb_t_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_cups_dest_cb_t_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_cups_dest_cb_t_fct_##A == (uintptr_t)fct) return my_cups_dest_cb_t_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_cups_dest_cb_t_fct_##A == 0) {my_cups_dest_cb_t_fct_##A = (uintptr_t)fct; return my_cups_dest_cb_t_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libcups cups_dest_cb_t callback\n");
+ return NULL;
+}
+
+#undef SUPER
+
+EXPORT int my_cupsEnumDests(x64emu_t* emu, uint32_t flags, int msec, int* cancel, uint32_t type, uint32_t mask, void* f, void* data)
+{
+ my->cupsEnumDests(flags, msec, cancel, type, mask, find_cups_dest_cb_t_Fct(f), data);
+}
+
+#define CUSTOM_INIT \
+ getMy(lib);
+
+#define CUSTOM_FINI \
+ freeMy();
+
#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedlibcups_private.h b/src/wrapped/wrappedlibcups_private.h
index 83f12f9..4978426 100755..100644
--- a/src/wrapped/wrappedlibcups_private.h
+++ b/src/wrapped/wrappedlibcups_private.h
@@ -52,7 +52,7 @@ GO(cupsAddOption, iFppip)
//GO(_cupsConnect,
//GO(cupsConnectDest,
//GO(_cupsConvertOptions,
-//GO(cupsCopyDest,
+GO(cupsCopyDest, iFpip)
//GO(cupsCopyDestConflicts,
//GO(cupsCopyDestInfo,
//GO(_cupsCreateDest,
@@ -72,7 +72,7 @@ GO(cupsAddOption, iFppip)
//GO(cupsEncodeOptions2,
//GO(_cupsEncodingName,
//GO(cupsEncryption,
-//GO(cupsEnumDests,
+GOM(cupsEnumDests, iFEuipuupp)
//GO(_cupsFileCheck,
//GO(_cupsFileCheckFilter,
//GO(cupsFileClose,
@@ -167,7 +167,7 @@ GO(cupsLastErrorString, pFv)
GO(cupsLocalizeDestOption, pFpppp)
GO(cupsLocalizeDestValue, pFppppp)
//GO(cupsMakeServerCredentials,
-//GO(cupsMarkOptions,
+GO(cupsMarkOptions, iFpip)
//GO(_cupsMessageFree,
//GO(_cupsMessageLoad,
//GO(_cupsMessageLookup,
@@ -282,15 +282,15 @@ GO(cupsSetDefaultDest, vFppip)
//GO(httpAssembleURI,
//GO(httpAssembleURIf,
//GO(httpAssembleUUID,
-//GO(httpBlocking,
+GO(httpBlocking, vFpi)
//GO(httpCheck,
//GO(httpClearCookie,
//GO(httpClearFields,
-//GO(httpClose,
+GO(httpClose, vFp)
//GO(httpCompareCredentials,
//GO(httpConnect,
GO(httpConnect2, pFpipiiiip)
-//GO(httpConnectEncrypt,
+GO(httpConnectEncrypt, pFpii)
//GO(httpCopyCredentials,
//GO(_httpCreateCredentials,
//GO(httpCredentialsAreValidForName,
@@ -306,7 +306,7 @@ GO(httpConnect2, pFpipiiiip)
//GO(httpEncode64_2,
//GO(_httpEncodeURI,
//GO(httpEncryption,
-//GO(httpError,
+GO(httpError, iFp)
//GO(httpFieldValue,
//GO(httpFlush,
//GO(httpFlushWrite,
@@ -503,7 +503,7 @@ GO(httpConnect2, pFpipiiiip)
//GO(_ppdCacheGetSource,
//GO(_ppdCacheGetType,
//GO(_ppdCacheWriteFile,
-//GO(ppdClose,
+GO(ppdClose, vFp)
//GO(ppdCollect,
//GO(ppdCollect2,
//GO(ppdConflicts,
@@ -514,14 +514,14 @@ GO(httpConnect2, pFpipiiiip)
//GO(ppdEmitJCL,
//GO(ppdEmitJCLEnd,
//GO(ppdEmitString,
-//GO(ppdErrorString,
-//GO(ppdFindAttr,
-//GO(ppdFindChoice,
+GO(ppdErrorString, pFi)
+GO(ppdFindAttr, pFppp)
+GO(ppdFindChoice, pFpp)
//GO(ppdFindCustomOption,
//GO(ppdFindCustomParam,
-//GO(ppdFindMarkedChoice,
+GO(ppdFindMarkedChoice, pFpp)
//GO(ppdFindNextAttr,
-//GO(ppdFindOption,
+GO(ppdFindOption, pFpp)
//GO(ppdFirstCustomParam,
//GO(ppdFirstOption,
//GO(_ppdFreeLanguages,
@@ -531,13 +531,13 @@ GO(httpConnect2, pFpipiiiip)
//GO(_ppdHashName,
//GO(ppdInstallableConflict,
//GO(ppdIsMarked,
-//GO(ppdLastError,
+GO(ppdLastError, iFp)
//GO(ppdLocalize,
//GO(ppdLocalizeAttr,
//GO(_ppdLocalizedAttr,
//GO(ppdLocalizeIPPReason,
//GO(ppdLocalizeMarkerName,
-//GO(ppdMarkDefaults,
+GO(ppdMarkDefaults, vFp)
//GO(ppdMarkOption,
//GO(ppdNextCustomParam,
//GO(ppdNextOption,
@@ -545,9 +545,9 @@ GO(httpConnect2, pFpipiiiip)
//GO(_ppdOpen,
//GO(ppdOpen,
//GO(ppdOpen2,
-//GO(ppdOpenFd,
+GO(ppdOpenFd, pFi)
//GO(_ppdOpenFile,
-//GO(ppdOpenFile,
+GO(ppdOpenFile, pFp)
//GO(ppdPageLength,
//GO(ppdPageSize,
//GO(ppdPageSizeLimits,
diff --git a/src/wrapped/wrappedlibdl.c b/src/wrapped/wrappedlibdl.c
index 9dee46b..47c47c6 100755..100644
--- a/src/wrapped/wrappedlibdl.c
+++ b/src/wrapped/wrappedlibdl.c
@@ -19,10 +19,16 @@
#include "elfloader.h"
#include "elfs/elfloader_private.h"
+typedef struct dllib_s {
+ library_t* lib;
+ int count;
+ int dlopened;
+ int is_self;
+ int full;
+} dllib_t;
+
typedef struct dlprivate_s {
- library_t **libs;
- size_t *count;
- size_t *dlopened;
+ dllib_t *dllibs;
size_t lib_sz;
size_t lib_cap;
char* last_error;
@@ -37,8 +43,6 @@ void FreeDLPrivate(dlprivate_t **lib) {
box_free(*lib);
}
-static needed_libs_t dl_loaded = {0};
-
// dead_cells consider the "2" value to be some king of issue?
#define MIN_NLIB 3
@@ -57,6 +61,20 @@ const char* libdlName = "libdl.so.2";
#define CLEARERR if(dl->last_error) box_free(dl->last_error); dl->last_error = NULL;
+void RemoveDlopen(library_t** lib, int idx)
+{
+ if(!my_context)
+ return;
+ dlprivate_t *dl = my_context->dlprivate;
+ if(dl && idx<dl->lib_sz) {
+ if(lib!=&dl->dllibs[idx].lib)
+ dl->dllibs[idx].lib = NULL;
+ dl->dllibs[idx].count = 0;
+ dl->dllibs[idx].dlopened = 0;
+ dl->dllibs[idx].full = 0;
+ }
+}
+
extern int box64_zoom;
// Implementation
void* my_dlopen(x64emu_t* emu, void *filename, int flag)
@@ -112,50 +130,69 @@ void* my_dlopen(x64emu_t* emu, void *filename, int flag)
}
// check if alread dlopenned...
for (size_t i=MIN_NLIB; i<dl->lib_sz; ++i) {
- if(IsSameLib(dl->libs[i], rfilename)) {
+ if(dl->dllibs[i].full && IsSameLib(dl->dllibs[i].lib, rfilename)) {
if(flag&0x4) { // don't re-open in RTLD_NOLOAD mode
- if(dl->count[i]==0 && dl->dlopened[i]) {
+ if(dl->dllibs[i].count==0 && dl->dllibs[i].dlopened) {
printf_dlsym(LOG_DEBUG, " => not present anymore\n");
return NULL; // don't re-open in RTLD_NOLOAD mode
}
}
- IncRefCount(dl->libs[i], emu);
- dl->count[i] = dl->count[i]+1;
- printf_dlsym(LOG_DEBUG, "dlopen: Recycling %s/%p count=%ld (dlopened=%ld, elf_index=%d)\n", rfilename, (void*)(i+1), dl->count[i], dl->dlopened[i], GetElfIndex(dl->libs[i]));
+ IncRefCount(dl->dllibs[i].lib, emu);
+ ++dl->dllibs[i].count;
+ if(!is_local && isLibLocal(dl->dllibs[i].lib))
+ promoteLocalLibGlobal(dl->dllibs[i].lib);
+ printf_dlsym(LOG_DEBUG, "dlopen: Recycling %s/%p count=%ld (dlopened=%ld, elf_index=%d)\n", rfilename, (void*)(i+1), dl->dllibs[i].count, dl->dllibs[i].dlopened, GetElfIndex(dl->dllibs[i].lib));
return (void*)(i+1);
}
}
+ lib = GetLibInternal(rfilename);
if(flag&0x4) { //RTLD_NOLOAD is just a "check" if lib is already loaded
+ if(lib) {
+ if(dl->lib_sz == dl->lib_cap) {
+ dl->lib_cap += 4;
+ dl->dllibs = (dllib_t*)box_realloc(dl->dllibs, sizeof(dllib_t)*dl->lib_cap);
+ // memset count...
+ memset(dl->dllibs+dl->lib_sz, 0, (dl->lib_cap-dl->lib_sz)*sizeof(dllib_t));
+ if(!dl->lib_sz)
+ dl->lib_sz = MIN_NLIB;
+ }
+ intptr_t idx = dl->lib_sz++;
+ dl->dllibs[idx].lib = lib;
+ ++dl->dllibs[idx].count;
+ dl->dllibs[idx].dlopened = dlopened;
+ dl->dllibs[idx].is_self = lib?0:1;
+ dl->dllibs[idx].full = 1;
+ IncRefCount(dl->dllibs[idx].lib, emu);
+ SetDlOpenIdx(lib, idx);
+ printf_dlsym(LOG_DEBUG, "dlopen: New handle %p (%s), dlopened=%ld\n", (void*)(idx+1), (char*)filename, dlopened);
+ return (void*)(idx+1);
+
+ }
printf_dlsym(LOG_DEBUG, " => not present\n");
return NULL;
}
- dlopened = (GetLibInternal(rfilename)==NULL);
+ dlopened = (lib==NULL);
// Then open the lib
- my_context->deferedInit = 1;
+ my_context->deferredInit = 1;
int bindnow = (!box64_musl && (flag&0x2))?1:0;
- needed_libs_t tmp = {0};
- char* names[] = {rfilename};
- library_t* libs[] = { NULL };
- tmp.size = tmp.cap = 1;
- tmp.names = names;
- tmp.libs = libs;
- if(AddNeededLib(NULL, is_local, bindnow, &tmp, my_context, emu)) {
+ needed_libs_t *tmp = new_neededlib(1);
+ tmp->names[0] = rfilename;
+ if(AddNeededLib(NULL, is_local, bindnow, tmp, NULL, my_context, emu)) {
printf_dlsym(strchr(rfilename,'/')?LOG_DEBUG:LOG_INFO, "Warning: Cannot dlopen(\"%s\"/%p, %X)\n", rfilename, filename, flag);
if(!dl->last_error)
dl->last_error = box_malloc(129);
snprintf(dl->last_error, 129, "Cannot dlopen(\"%s\"/%p, %X)\n", rfilename, filename, flag);
+ RemoveNeededLib(NULL, is_local, tmp, my_context, emu);
return NULL;
}
- add1_neededlib(&dl_loaded);
- dl_loaded.names[dl_loaded.size-1] = tmp.names[0];
- dl_loaded.libs[dl_loaded.size-1] = tmp.libs[0];
+ free_neededlib(tmp);
lib = GetLibInternal(rfilename);
- RunDeferedElfInit(emu);
+ RunDeferredElfInit(emu);
} else {
// check if already dlopenned...
for (size_t i=MIN_NLIB; i<dl->lib_sz; ++i) {
- if(!dl->libs[i]) {
- dl->count[i] = dl->count[i]+1;
+ if(dl->dllibs[i].is_self) {
+ ++dl->dllibs[i].count;
return (void*)(i+1);
}
}
@@ -165,18 +202,19 @@ void* my_dlopen(x64emu_t* emu, void *filename, int flag)
if(dl->lib_sz == dl->lib_cap) {
dl->lib_cap += 4;
- dl->libs = (library_t**)box_realloc(dl->libs, sizeof(library_t*)*dl->lib_cap);
- dl->count = (size_t*)box_realloc(dl->count, sizeof(size_t)*dl->lib_cap);
- dl->dlopened = (size_t*)box_realloc(dl->dlopened, sizeof(size_t)*dl->lib_cap);
+ dl->dllibs = (dllib_t*)box_realloc(dl->dllibs, sizeof(dllib_t)*dl->lib_cap);
// memset count...
- memset(dl->count+dl->lib_sz, 0, (dl->lib_cap-dl->lib_sz)*sizeof(size_t));
+ memset(dl->dllibs+dl->lib_sz, 0, (dl->lib_cap-dl->lib_sz)*sizeof(dllib_t));
if(!dl->lib_sz)
dl->lib_sz = MIN_NLIB;
}
- intptr_t idx = dl->lib_sz++;
- dl->libs[idx] = lib;
- dl->count[idx] = dl->count[idx]+1;
- dl->dlopened[idx] = dlopened;
+ intptr_t idx = dl->lib_sz++;
+ dl->dllibs[idx].lib = lib;
+ ++dl->dllibs[idx].count;
+ dl->dllibs[idx].dlopened = dlopened;
+ dl->dllibs[idx].is_self = lib?0:1;
+ dl->dllibs[idx].full = 1;
+ SetDlOpenIdx(lib, idx);
printf_dlsym(LOG_DEBUG, "dlopen: New handle %p (%s), dlopened=%ld\n", (void*)(idx+1), (char*)filename, dlopened);
return (void*)(idx+1);
}
@@ -196,7 +234,7 @@ char* my_dlerror(x64emu_t* emu)
KHASH_SET_INIT_INT(libs);
-int recursive_dlsym_lib(kh_libs_t* collection, library_t* lib, const char* rsymbol, uintptr_t *start, uintptr_t *end, int version, const char* vername)
+int recursive_dlsym_lib(kh_libs_t* collection, library_t* lib, const char* rsymbol, uintptr_t *start, uintptr_t *end, int version, const char* vername, const char* globdefver, const char* weakdefver)
{
if(!lib)
return 0;
@@ -208,60 +246,71 @@ int recursive_dlsym_lib(kh_libs_t* collection, library_t* lib, const char* rsymb
// TODO: should use librarian functions instead!
int weak;
// look in the library itself
- if(lib->getglobal(lib, rsymbol, start, end, 0, &weak, version, vername, 1))
+ if(lib->getglobal(lib, rsymbol, start, end, 0, &weak, version, vername, 1, globdefver))
return 1;
- if(lib->getweak(lib, rsymbol, start, end, 0, &weak, version, vername, 1))
+ if(lib->getweak(lib, rsymbol, start, end, 0, &weak, version, vername, 1, weakdefver))
return 1;
// look in other libs
int n = GetNeededLibsN(lib);
for (int i=0; i<n; ++i) {
library_t *l = GetNeededLib(lib, i);
- if(recursive_dlsym_lib(collection, l, rsymbol, start, end, version, vername))
+ if(recursive_dlsym_lib(collection, l, rsymbol, start, end, version, vername, globdefver, weakdefver))
return 1;
}
return 0;
}
-int my_dlsym_lib(library_t* lib, const char* rsymbol, uintptr_t *start, uintptr_t *end, int version, const char* vername)
+int my_dlsym_lib(library_t* lib, const char* rsymbol, uintptr_t *start, uintptr_t *end, int version, const char* vername, const char* globdefver, const char* weakdefver)
{
kh_libs_t *collection = kh_init(libs);
- int ret = recursive_dlsym_lib(collection, lib, rsymbol, start, end, version, vername);
+ int ret = recursive_dlsym_lib(collection, lib, rsymbol, start, end, version, vername, globdefver, weakdefver);
kh_destroy(libs, collection);
return ret;
}
+int GetTID();
void* my_dlsym(x64emu_t* emu, void *handle, void *symbol)
{
(void)emu;
+ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_lock(&mutex);
dlprivate_t *dl = my_context->dlprivate;
uintptr_t start = 0, end = 0;
char* rsymbol = (char*)symbol;
CLEARERR
- printf_dlsym(LOG_DEBUG, "Call to dlsym(%p, \"%s\")%s", handle, rsymbol, dlsym_error?"":"\n");
+ printf_dlsym(LOG_DEBUG, "%04d|Call to dlsym(%p, \"%s\")%s", GetTID(), handle, rsymbol, dlsym_error?"":"\n");
if(handle==NULL) {
// special case, look globably
- if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, -1, NULL)) {
+ const char* globdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 0, rsymbol);
+ const char* weakdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 1, rsymbol);
+ if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, -1, NULL, globdefver, weakdefver)) {
printf_dlsym(LOG_NEVER, "%p\n", (void*)start);
+ pthread_mutex_unlock(&mutex);
return (void*)start;
}
if(!dl->last_error)
dl->last_error = box_malloc(129);
snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p)\n", rsymbol, handle);
printf_dlsym(LOG_NEVER, "%p\n", NULL);
+ pthread_mutex_unlock(&mutex);
return NULL;
}
if(handle==(void*)~0LL) {
// special case, look globably but no self (RTLD_NEXT)
+ const char* globdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 0, rsymbol);
+ const char* weakdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 1, rsymbol);
elfheader_t *elf = FindElfAddress(my_context, *(uintptr_t*)R_RSP); // use return address to guess "self"
- if(GetNoSelfSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, elf, 0, -1, NULL)) {
+ if(GetNoSelfSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, elf, 0, -1, NULL, globdefver, weakdefver)) {
printf_dlsym(LOG_NEVER, "%p\n", (void*)start);
+ pthread_mutex_unlock(&mutex);
return (void*)start;
}
if(!dl->last_error)
dl->last_error = box_malloc(129);
snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p)\n", rsymbol, handle);
printf_dlsym(LOG_NEVER, "%p\n", NULL);
+ pthread_mutex_unlock(&mutex);
return NULL;
}
size_t nlib = (size_t)handle;
@@ -272,41 +321,49 @@ void* my_dlsym(x64emu_t* emu, void *handle, void *symbol)
dl->last_error = box_malloc(129);
snprintf(dl->last_error, 129, "Bad handle %p)\n", handle);
printf_dlsym(LOG_NEVER, "%p\n", NULL);
+ pthread_mutex_unlock(&mutex);
return NULL;
}
- if(dl->count[nlib]==0) {
+ if(!dl->dllibs[nlib].count || !dl->dllibs[nlib].full) {
if(!dl->last_error)
dl->last_error = box_malloc(129);
snprintf(dl->last_error, 129, "Bad handle %p (already closed))\n", handle);
printf_dlsym(LOG_NEVER, "%p\n", (void*)NULL);
+ pthread_mutex_unlock(&mutex);
return NULL;
}
- if(dl->libs[nlib]) {
- if(my_dlsym_lib(dl->libs[nlib], rsymbol, &start, &end, -1, NULL)==0) {
+ if(dl->dllibs[nlib].lib) {
+ const char* globdefver = GetMaplibDefaultVersion(my_context->maplib, (my_context->maplib==dl->dllibs[nlib].lib->maplib)?NULL:dl->dllibs[nlib].lib->maplib, 0, rsymbol);
+ const char* weakdefver = GetMaplibDefaultVersion(my_context->maplib, (my_context->maplib==dl->dllibs[nlib].lib->maplib)?NULL:dl->dllibs[nlib].lib->maplib, 1, rsymbol);
+ if(my_dlsym_lib(dl->dllibs[nlib].lib, rsymbol, &start, &end, -1, NULL, globdefver, weakdefver)==0) {
// not found
- printf_dlsym(LOG_NEVER, "%p\nCall to dlsym(%s, \"%s\") Symbol not found\n", NULL, GetNameLib(dl->libs[nlib]), rsymbol);
+ printf_dlsym(LOG_NEVER, "%p\nCall to dlsym(%s, \"%s\") Symbol not found\n", NULL, GetNameLib(dl->dllibs[nlib].lib), rsymbol);
printf_log(LOG_DEBUG, " Symbol not found\n");
if(!dl->last_error)
dl->last_error = box_malloc(129);
- snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p(%s)", rsymbol, handle, GetNameLib(dl->libs[nlib]));
+ snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p(%s)", rsymbol, handle, GetNameLib(dl->dllibs[nlib].lib));
+ pthread_mutex_unlock(&mutex);
return NULL;
}
} else {
// still usefull?
// => look globably
- const char* defver = GetDefaultVersion(my_context->globaldefver, rsymbol);
- if(!defver) defver = GetDefaultVersion(my_context->weakdefver, rsymbol);
- if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, -1, defver)) {
+ const char* globdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 0, rsymbol);
+ const char* weakdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 1, rsymbol);
+ if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, -1, NULL, globdefver, weakdefver)) {
printf_dlsym(LOG_NEVER, "%p\n", (void*)start);
+ pthread_mutex_unlock(&mutex);
return (void*)start;
}
if(!dl->last_error)
dl->last_error = box_malloc(129);
snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p)\n", rsymbol, handle);
printf_dlsym(LOG_NEVER, "%p\n", NULL);
+ pthread_mutex_unlock(&mutex);
return NULL;
}
printf_dlsym(LOG_NEVER, "%p\n", (void*)start);
+ pthread_mutex_unlock(&mutex);
return (void*)start;
}
int my_dlclose(x64emu_t* emu, void *handle)
@@ -325,15 +382,15 @@ int my_dlclose(x64emu_t* emu, void *handle)
printf_dlsym(LOG_DEBUG, "dlclose: %s\n", dl->last_error);
return -1;
}
- if(dl->count[nlib]==0) {
+ if(!dl->dllibs[nlib].count || !dl->dllibs[nlib].full) {
if(!dl->last_error)
dl->last_error = box_malloc(129);
snprintf(dl->last_error, 129, "Bad handle %p (already closed))\n", handle);
printf_dlsym(LOG_DEBUG, "dlclose: %s\n", dl->last_error);
return -1;
}
- dl->count[nlib] = dl->count[nlib]-1;
- FiniLibrary(dl->libs[nlib], emu);
+ --dl->dllibs[nlib].count;
+ DecRefCount(&dl->dllibs[nlib].lib, emu);
return 0;
}
int my_dladdr1(x64emu_t* emu, void *addr, void *i, void** extra_info, int flags)
@@ -372,7 +429,9 @@ void* my_dlvsym(x64emu_t* emu, void *handle, void *symbol, const char *vername)
printf_dlsym(LOG_DEBUG, "Call to dlvsym(%p, \"%s\", %s)%s", handle, rsymbol, vername?vername:"(nil)", dlsym_error?"":"\n");
if(handle==NULL) {
// special case, look globably
- if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, version, vername)) {
+ const char* globdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 0, rsymbol);
+ const char* weakdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 1, rsymbol);
+ if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, version, vername, globdefver, weakdefver)) {
printf_dlsym(LOG_NEVER, "%p\n", (void*)start);
return (void*)start;
}
@@ -384,8 +443,10 @@ void* my_dlvsym(x64emu_t* emu, void *handle, void *symbol, const char *vername)
}
if(handle==(void*)~0LL) {
// special case, look globably but no self (RTLD_NEXT)
+ const char* globdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 0, rsymbol);
+ const char* weakdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 1, rsymbol);
elfheader_t *elf = FindElfAddress(my_context, *(uintptr_t*)R_RSP); // use return address to guess "self"
- if(GetNoSelfSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, elf, 0, version, vername)) {
+ if(GetNoSelfSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, elf, 0, version, vername, globdefver, weakdefver)) {
printf_dlsym(LOG_NEVER, "%p\n", (void*)start);
return (void*)start;
}
@@ -405,28 +466,30 @@ void* my_dlvsym(x64emu_t* emu, void *handle, void *symbol, const char *vername)
printf_dlsym(LOG_NEVER, "%p\n", NULL);
return NULL;
}
- if(dl->count[nlib]==0) {
+ if(!dl->dllibs[nlib].count || !dl->dllibs[nlib].full) {
if(!dl->last_error)
dl->last_error = box_malloc(129);
snprintf(dl->last_error, 129, "Bad handle %p (already closed))\n", handle);
printf_dlsym(LOG_NEVER, "%p\n", (void*)NULL);
return NULL;
}
- if(dl->libs[nlib]) {
- if(my_dlsym_lib(dl->libs[nlib], rsymbol, &start, &end, version, vername)==0) {
+ if(dl->dllibs[nlib].lib) {
+ const char* globdefver = GetMaplibDefaultVersion(my_context->maplib, (my_context->maplib==dl->dllibs[nlib].lib->maplib)?NULL:dl->dllibs[nlib].lib->maplib, 0, rsymbol);
+ const char* weakdefver = GetMaplibDefaultVersion(my_context->maplib, (my_context->maplib==dl->dllibs[nlib].lib->maplib)?NULL:dl->dllibs[nlib].lib->maplib, 1, rsymbol);
+ if(my_dlsym_lib(dl->dllibs[nlib].lib, rsymbol, &start, &end, version, vername, globdefver, weakdefver)==0) {
// not found
- printf_dlsym(LOG_NEVER, "%p\nCall to dlvsym(%s, \"%s\", %s) Symbol not found\n", NULL, GetNameLib(dl->libs[nlib]), rsymbol, vername?vername:"(nil)");
+ printf_dlsym(LOG_NEVER, "%p\nCall to dlvsym(%s, \"%s\", %s) Symbol not found\n", NULL, GetNameLib(dl->dllibs[nlib].lib), rsymbol, vername?vername:"(nil)");
printf_log(LOG_DEBUG, " Symbol not found\n");
if(!dl->last_error)
dl->last_error = box_malloc(129);
- snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p(%s)", rsymbol, handle, GetNameLib(dl->libs[nlib]));
+ snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p(%s)", rsymbol, handle, GetNameLib(dl->dllibs[nlib].lib));
return NULL;
}
} else {
// still usefull?
- const char* defver = GetDefaultVersion(my_context->globaldefver, rsymbol);
- if(!defver) defver = GetDefaultVersion(my_context->weakdefver, rsymbol);
- if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, -1, defver)) {
+ const char* globdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 0, rsymbol);
+ const char* weakdefver = GetMaplibDefaultVersion(my_context->maplib, NULL, 1, rsymbol);
+ if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, -1, NULL, globdefver, weakdefver)) {
printf_dlsym(LOG_NEVER, "%p\n", (void*)start);
return (void*)start;
}
@@ -458,14 +521,14 @@ int my_dlinfo(x64emu_t* emu, void* handle, int request, void* info)
printf_dlsym(LOG_DEBUG, "dlinfo: %s\n", dl->last_error);
return -1;
}
- if(dl->count[nlib]==0) {
+ if(!dl->dllibs[nlib].count || !dl->dllibs[nlib].full) {
if(!dl->last_error)
dl->last_error = box_malloc(129);
snprintf(dl->last_error, 129, "Bad handle %p (already closed))\n", handle);
printf_dlsym(LOG_DEBUG, "dlinfo: %s\n", dl->last_error);
return -1;
}
- library_t *lib = dl->libs[nlib];
+ library_t *lib = dl->dllibs[nlib].lib;
//elfheader_t *h = (GetElfIndex(lib)>-1)?my_context->elfs[GetElfIndex(lib)]:NULL;
switch(request) {
case 2: // RTLD_DI_LINKMAP
@@ -493,7 +556,19 @@ typedef struct my_dl_find_object_s {
EXPORT int my__dl_find_object(x64emu_t* emu, void* addr, my_dl_find_object_t* result)
{
- printf_log(LOG_INFO, "Unimplemented _dl_find_object called\n");
+ //printf_log(LOG_INFO, "Unimplemented _dl_find_object called\n");
+ uintptr_t start=0, sz=0;
+ elfheader_t* h = FindElfAddress(my_context, (uintptr_t)addr);
+ if(h) {
+ // find an actual elf
+ const char* name = FindNearestSymbolName(h, addr, &start, &sz);
+ result->dlfo_map_start = (void*)start;
+ result->dlfo_map_end = (void*)(start+sz-1);
+ result->dlfo_eh_frame = (void*)(h->ehframehdr+h->delta);
+ result->dlfo_flags = 0; // unused it seems
+ result->dlf_link_map = (struct link_map *)getLinkMapElf(h);
+ return 0;
+ }
return -1;
}
diff --git a/src/wrapped/wrappedlibdl_private.h b/src/wrapped/wrappedlibdl_private.h
index f547ffb..f547ffb 100755..100644
--- a/src/wrapped/wrappedlibdl_private.h
+++ b/src/wrapped/wrappedlibdl_private.h
diff --git a/src/wrapped/wrappedlibdrm.c b/src/wrapped/wrappedlibdrm.c
index 01f4967..01f4967 100755..100644
--- a/src/wrapped/wrappedlibdrm.c
+++ b/src/wrapped/wrappedlibdrm.c
diff --git a/src/wrapped/wrappedlibdrm_private.h b/src/wrapped/wrappedlibdrm_private.h
index 8116d2a..a368b88 100755..100644
--- a/src/wrapped/wrappedlibdrm_private.h
+++ b/src/wrapped/wrappedlibdrm_private.h
@@ -64,7 +64,7 @@ GO(drmFreeVersion, vFp)
GO(drmGetDeviceNameFromFd, pFi)
//GO(drmGetDeviceNameFromFd2,
GO(drmGetDevices, iFpi)
-//GO(drmGetDevices2,
+GO(drmGetDevices2, iFupi)
//GO(drmGetEntry,
//GO(drmGetHashTable,
//GO(drmGetInterruptFromBusID,
@@ -79,14 +79,14 @@ GO(drmGetNodeTypeFromFd, iFi)
//GO(drmGetStats,
GO(drmGetVersion, pFi)
//GO(drmHandleEvent,
-//GO(drmHashCreate,
-//GO(drmHashDelete,
-//GO(drmHashDestroy,
-//GO(drmHashFirst,
-//GO(drmHashInsert,
-//GO(drmHashLookup,
-//GO(drmHashNext,
-//GO(drmIoctl,
+GO(drmHashCreate, pFv)
+GO(drmHashDelete, iFpL)
+GO(drmHashDestroy, iFp)
+GO(drmHashFirst, iFppp)
+GO(drmHashInsert, iFpLL)
+GO(drmHashLookup, iFpLp)
+GO(drmHashNext, iFppp)
+GO(drmIoctl, iFiLp)
//GO(drmIsMaster,
//GO(drmMalloc,
//GO(drmMap,
diff --git a/src/wrapped/wrappedlibegl.c b/src/wrapped/wrappedlibegl.c
index 2a19ed9..2a19ed9 100755..100644
--- a/src/wrapped/wrappedlibegl.c
+++ b/src/wrapped/wrappedlibegl.c
diff --git a/src/wrapped/wrappedlibegl_private.h b/src/wrapped/wrappedlibegl_private.h
index e109388..e109388 100755..100644
--- a/src/wrapped/wrappedlibegl_private.h
+++ b/src/wrapped/wrappedlibegl_private.h
diff --git a/src/wrapped/wrappedlibfuse.c b/src/wrapped/wrappedlibfuse.c
index ee75fa3..2bac509 100755..100644
--- a/src/wrapped/wrappedlibfuse.c
+++ b/src/wrapped/wrappedlibfuse.c
@@ -140,10 +140,10 @@ GO(3)
// fuse_opt_proc
#define GO(A) \
-static uintptr_t my_fuse_opt_proc_fct_##A = 0; \
-static int my_fuse_opt_proc_##A(void* a, void* b, int c, void* d) \
-{ \
- return (int)RunFunction(my_context, my_fuse_opt_proc_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_fuse_opt_proc_fct_##A = 0; \
+static int my_fuse_opt_proc_##A(void* a, void* b, int c, void* d) \
+{ \
+ return (int)RunFunctionFmt(my_fuse_opt_proc_fct_##A, "ppip", a, b, c, d); \
}
SUPER()
#undef GO
@@ -163,11 +163,11 @@ static void* findfuse_opt_procFct(void* fct)
// init
#define GO(A) \
-static uintptr_t my_init_fct_##A = 0; \
-static void my_init_##A(void* a, void* b) \
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "init"); \
- RunFunction(my_context, my_init_fct_##A, 2, a, b);\
+static uintptr_t my_init_fct_##A = 0; \
+static void my_init_##A(void* a, void* b) \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "init"); \
+ RunFunctionFmt(my_init_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -187,11 +187,11 @@ static void* find_init_Fct(void* fct)
// destroy
#define GO(A) \
-static uintptr_t my_destroy_fct_##A = 0; \
-static void my_destroy_##A(void* a) \
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "destroy"); \
- RunFunction(my_context, my_destroy_fct_##A, 1, a); \
+static uintptr_t my_destroy_fct_##A = 0; \
+static void my_destroy_##A(void* a) \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "destroy"); \
+ RunFunctionFmt(my_destroy_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -215,7 +215,7 @@ static uintptr_t my_lookup_fct_##A = 0;
static void my_lookup_##A(void* a, unsigned long b, const char* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s(%p, %lu, %s)\n", "lookup", a, b, c); \
- RunFunction(my_context, my_lookup_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_lookup_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -235,11 +235,11 @@ static void* find_lookup_Fct(void* fct)
// forget
#define GO(A) \
-static uintptr_t my_forget_fct_##A = 0; \
-static void my_forget_##A(void* a, unsigned long b, unsigned long c)\
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "forget"); \
- RunFunction(my_context, my_forget_fct_##A, 3, a, b, c); \
+static uintptr_t my_forget_fct_##A = 0; \
+static void my_forget_##A(void* a, unsigned long b, unsigned long c) \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "forget"); \
+ RunFunctionFmt(my_forget_fct_##A, "pLL", a, b, c); \
}
SUPER()
#undef GO
@@ -259,11 +259,11 @@ static void* find_forget_Fct(void* fct)
// getattr
#define GO(A) \
-static uintptr_t my_getattr_fct_##A = 0; \
-static void my_getattr_##A(void* a, unsigned long b, void* c) \
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "getattr"); \
- RunFunction(my_context, my_getattr_fct_##A, 3, a, b, c); \
+static uintptr_t my_getattr_fct_##A = 0; \
+static void my_getattr_##A(void* a, unsigned long b, void* c) \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "getattr"); \
+ RunFunctionFmt(my_getattr_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -283,13 +283,13 @@ static void* find_getattr_Fct(void* fct)
// setattr
#define GO(A) \
-static uintptr_t my_setattr_fct_##A = 0; \
-static void my_setattr_##A(void* a, unsigned long b, struct stat* c, int d, void* e) \
-{ \
- struct stat c_; \
- AlignStat64(c, &c_); \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "setattr"); \
- RunFunction(my_context, my_setattr_fct_##A, 5, a, b, &c_, d, e); \
+static uintptr_t my_setattr_fct_##A = 0; \
+static void my_setattr_##A(void* a, unsigned long b, struct stat* c, int d, void* e)\
+{ \
+ struct stat c_; \
+ AlignStat64(c, &c_); \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "setattr"); \
+ RunFunctionFmt(my_setattr_fct_##A, "pLpip", a, b, &c_, d, e); \
}
SUPER()
#undef GO
@@ -309,11 +309,11 @@ static void* find_setattr_Fct(void* fct)
// readlink
#define GO(A) \
-static uintptr_t my_readlink_fct_##A = 0; \
-static void my_readlink_##A(void* a, unsigned long b) \
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "readlink"); \
- RunFunction(my_context, my_readlink_fct_##A, 2, a, b); \
+static uintptr_t my_readlink_fct_##A = 0; \
+static void my_readlink_##A(void* a, unsigned long b) \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "readlink"); \
+ RunFunctionFmt(my_readlink_fct_##A, "pL", a, b); \
}
SUPER()
#undef GO
@@ -336,8 +336,8 @@ static void* find_readlink_Fct(void* fct)
static uintptr_t my_mknod_fct_##A = 0; \
static void my_mknod_##A(void* a, unsigned long b, const char* c, mode_t d, dev_t e) \
{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "mknod"); \
- RunFunction(my_context, my_mknod_fct_##A, 5, a, b, c, of_convert(d), e); \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "mknod"); \
+ RunFunctionFmt(my_mknod_fct_##A, "pLpuL", a, b, c, of_convert(d), e); \
}
SUPER()
#undef GO
@@ -357,11 +357,11 @@ static void* find_mknod_Fct(void* fct)
// mkdir
#define GO(A) \
-static uintptr_t my_mkdir_fct_##A = 0; \
-static void my_mkdir_##A(void* a, unsigned long b, const char* c, mode_t d) \
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "mkdir"); \
- RunFunction(my_context, my_mkdir_fct_##A, 4, a, b, c, of_convert(d)); \
+static uintptr_t my_mkdir_fct_##A = 0; \
+static void my_mkdir_##A(void* a, unsigned long b, const char* c, mode_t d) \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "mkdir"); \
+ RunFunctionFmt(my_mkdir_fct_##A, "pLpu", a, b, c, of_convert(d)); \
}
SUPER()
#undef GO
@@ -385,7 +385,7 @@ static uintptr_t my_unlink_fct_##A = 0; \
static void my_unlink_##A(void* a, unsigned long b, const char* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "unlink"); \
- RunFunction(my_context, my_unlink_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_unlink_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -405,11 +405,11 @@ static void* find_unlink_Fct(void* fct)
// rmdir
#define GO(A) \
-static uintptr_t my_rmdir_fct_##A = 0; \
-static void my_rmdir_##A(void* a, unsigned long b, const char* c) \
+static uintptr_t my_rmdir_fct_##A = 0; \
+static void my_rmdir_##A(void* a, unsigned long b, const char* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "rmdir"); \
- RunFunction(my_context, my_rmdir_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_rmdir_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -429,11 +429,11 @@ static void* find_rmdir_Fct(void* fct)
// symlink
#define GO(A) \
-static uintptr_t my_symlink_fct_##A = 0; \
+static uintptr_t my_symlink_fct_##A = 0; \
static void my_symlink_##A(void* a, const char* b, unsigned long c, const char* d) \
-{ \
+{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "symlink"); \
- RunFunction(my_context, my_symlink_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_symlink_fct_##A, "ppLp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -453,11 +453,11 @@ static void* find_symlink_Fct(void* fct)
// rename
#define GO(A) \
-static uintptr_t my_rename_fct_##A = 0; \
+static uintptr_t my_rename_fct_##A = 0; \
static void my_rename_##A(void* a, unsigned long b, const char* c, unsigned long d, const char* e) \
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "rename"); \
- RunFunction(my_context, my_rename_fct_##A, 5, a, b, c, d, e); \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "rename"); \
+ RunFunctionFmt(my_rename_fct_##A, "pLpLp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -477,11 +477,11 @@ static void* find_rename_Fct(void* fct)
// link
#define GO(A) \
-static uintptr_t my_link_fct_##A = 0; \
+static uintptr_t my_link_fct_##A = 0; \
static void my_link_##A(void* a, unsigned long b, unsigned long c, const char* d) \
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "link"); \
- RunFunction(my_context, my_link_fct_##A, 4, a, b, c, d); \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "link"); \
+ RunFunctionFmt(my_link_fct_##A, "pLLp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -501,11 +501,11 @@ static void* find_link_Fct(void* fct)
// open
#define GO(A) \
-static uintptr_t my_open_fct_##A = 0; \
-static void my_open_##A(void* a, unsigned long b, const char* c)\
-{ \
+static uintptr_t my_open_fct_##A = 0; \
+static void my_open_##A(void* a, unsigned long b, const char* c) \
+{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "open"); \
- RunFunction(my_context, my_open_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_open_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -525,11 +525,11 @@ static void* find_open_Fct(void* fct)
// read
#define GO(A) \
-static uintptr_t my_read_fct_##A = 0; \
+static uintptr_t my_read_fct_##A = 0; \
static void my_read_##A(void* a, unsigned long b, const char* c, size_t d, off_t e, void* f) \
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "read"); \
- RunFunction(my_context, my_read_fct_##A, 6, a, b, c, d, e, f); \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "read"); \
+ RunFunctionFmt(my_read_fct_##A, "pLpLlp", a, b, c, d, e, f); \
}
SUPER()
#undef GO
@@ -549,11 +549,11 @@ static void* find_read_Fct(void* fct)
// write
#define GO(A) \
-static uintptr_t my_write_fct_##A = 0; \
+static uintptr_t my_write_fct_##A = 0; \
static void my_write_##A(void* a, unsigned long b, const char* c, size_t d, off_t e, void* f) \
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "write"); \
- RunFunction(my_context, my_write_fct_##A, 6, a, b, c, d, e, f); \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "write"); \
+ RunFunctionFmt(my_write_fct_##A, "pLpLlp", a, b, c, d, e, f); \
}
SUPER()
#undef GO
@@ -577,7 +577,7 @@ static uintptr_t my_flush_fct_##A = 0; \
static void my_flush_##A(void* a, unsigned long b, const char* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "flush"); \
- RunFunction(my_context, my_flush_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_flush_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -597,11 +597,11 @@ static void* find_flush_Fct(void* fct)
// release
#define GO(A) \
-static uintptr_t my_release_fct_##A = 0; \
-static void my_release_##A(void* a, unsigned long b, const char* c) \
+static uintptr_t my_release_fct_##A = 0; \
+static void my_release_##A(void* a, unsigned long b, const char* c) \
{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "release"); \
- RunFunction(my_context, my_release_fct_##A, 3, a, b, c); \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "release"); \
+ RunFunctionFmt(my_release_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -621,11 +621,11 @@ static void* find_release_Fct(void* fct)
// fsync
#define GO(A) \
-static uintptr_t my_fsync_fct_##A = 0; \
-static void my_fsync_##A(void* a, unsigned long b, int c, void* d) \
-{ \
- printf_log(LOG_DEBUG, "fuse: call %s\n", "fsync"); \
- RunFunction(my_context, my_fsync_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_fsync_fct_##A = 0; \
+static void my_fsync_##A(void* a, unsigned long b, int c, void* d) \
+{ \
+ printf_log(LOG_DEBUG, "fuse: call %s\n", "fsync"); \
+ RunFunctionFmt(my_fsync_fct_##A, "pLip", a, b, c, d); \
}
SUPER()
#undef GO
@@ -649,7 +649,7 @@ static uintptr_t my_opendir_fct_##A = 0;
static void my_opendir_##A(void* a, unsigned long b, void* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s(%p, %lu, %p)\n", "opendir", a, b, c); \
- RunFunction(my_context, my_opendir_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_opendir_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -673,7 +673,7 @@ static uintptr_t my_readdir_fct_##A = 0;
static void my_readdir_##A(void* a, unsigned long b, size_t c, off_t d, void* e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "readdir"); \
- RunFunction(my_context, my_readdir_fct_##A, 5, a, b, c, d, e); \
+ RunFunctionFmt(my_readdir_fct_##A, "pLLlp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -697,7 +697,7 @@ static uintptr_t my_releasedir_fct_##A = 0;
static void my_releasedir_##A(void* a, unsigned long b, void* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s(%p, %lu, %p)\n", "releasedir", a, b, c); \
- RunFunction(my_context, my_releasedir_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_releasedir_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -721,7 +721,7 @@ static uintptr_t my_fsyncdir_fct_##A = 0; \
static void my_fsyncdir_##A(void* a, unsigned long b, int c, void* d) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "fsyncdir"); \
- RunFunction(my_context, my_fsyncdir_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_fsyncdir_fct_##A, "pLip", a, b, c, d); \
}
SUPER()
#undef GO
@@ -745,7 +745,7 @@ static uintptr_t my_statfs_fct_##A = 0; \
static void my_statfs_##A(void* a, unsigned long b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "statfs"); \
- RunFunction(my_context, my_statfs_fct_##A, 2, a, b); \
+ RunFunctionFmt(my_statfs_fct_##A, "pL", a, b); \
}
SUPER()
#undef GO
@@ -769,7 +769,7 @@ static uintptr_t my_setxattr_fct_##A = 0;
static void my_setxattr_##A(void* a, unsigned long b, const char* c, const char* d, size_t e, int f) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "setxattr"); \
- RunFunction(my_context, my_setxattr_fct_##A, 6, a, b, c, d, e, f); \
+ RunFunctionFmt(my_setxattr_fct_##A, "pLppLi", a, b, c, d, e, f); \
}
SUPER()
#undef GO
@@ -793,7 +793,7 @@ static uintptr_t my_getxattr_fct_##A = 0;
static void my_getxattr_##A(void* a, unsigned long b, const char* c, const char* d, size_t e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "getxattr"); \
- RunFunction(my_context, my_getxattr_fct_##A, 5, a, b, c, d, e); \
+ RunFunctionFmt(my_getxattr_fct_##A, "pLppL", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -817,7 +817,7 @@ static uintptr_t my_listxattr_fct_##A = 0; \
static void my_listxattr_##A(void* a, unsigned long b, size_t c)\
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "listxattr"); \
- RunFunction(my_context, my_listxattr_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_listxattr_fct_##A, "pLL", a, b, c); \
}
SUPER()
#undef GO
@@ -841,7 +841,7 @@ static uintptr_t my_removexattr_fct_##A = 0; \
static void my_removexattr_##A(void* a, unsigned long b, const char* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "removexattr"); \
- RunFunction(my_context, my_removexattr_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_removexattr_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -865,7 +865,7 @@ static uintptr_t my_access_fct_##A = 0; \
static void my_access_##A(void* a, unsigned long b, int c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "access"); \
- RunFunction(my_context, my_access_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_access_fct_##A, "pLi", a, b, c); \
}
SUPER()
#undef GO
@@ -889,7 +889,7 @@ static uintptr_t my_create_fct_##A = 0;
static void my_create_##A(void* a, unsigned long b, const char* c, mode_t d, void* e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "create"); \
- RunFunction(my_context, my_create_fct_##A, 5, a, b, c, of_convert(d), e); \
+ RunFunctionFmt(my_create_fct_##A, "pLpup", a, b, c, of_convert(d), e); \
}
SUPER()
#undef GO
@@ -913,7 +913,7 @@ static uintptr_t my_getlk_fct_##A = 0; \
static void my_getlk_##A(void* a, unsigned long b, void* c, void* d)\
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "getlk"); \
- RunFunction(my_context, my_getlk_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_getlk_fct_##A, "pLpp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -937,7 +937,7 @@ static uintptr_t my_setlk_fct_##A = 0; \
static void my_setlk_##A(void* a, unsigned long b, void* c, void* d, int e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "setlk"); \
- RunFunction(my_context, my_setlk_fct_##A, 5, a, b, c, d, e); \
+ RunFunctionFmt(my_setlk_fct_##A, "pLppi", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -961,7 +961,7 @@ static uintptr_t my_bmap_fct_##A = 0; \
static void my_bmap_##A(void* a, unsigned long b, size_t c, uint64_t d) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "bmap"); \
- RunFunction(my_context, my_bmap_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_bmap_fct_##A, "pLLU", a, b, c, d); \
}
SUPER()
#undef GO
@@ -985,7 +985,7 @@ static uintptr_t my_ioctl_fct_##A = 0;
static void my_ioctl_##A(void* a, unsigned long b, int c, void* d, void* e, unsigned f, void* g, size_t h, size_t i)\
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "ioctl"); \
- RunFunction(my_context, my_ioctl_fct_##A, 9, a, b, c, d, e, f, g, h, i); \
+ RunFunctionFmt(my_ioctl_fct_##A, "pLippupLL", a, b, c, d, e, f, g, h, i); \
}
SUPER()
#undef GO
@@ -1009,7 +1009,7 @@ static uintptr_t my_poll_fct_##A = 0; \
static void my_poll_##A(void* a, unsigned long b, void* c, void* d) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "poll"); \
- RunFunction(my_context, my_poll_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_poll_fct_##A, "pLpp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -1033,7 +1033,7 @@ static uintptr_t my_write_buf_fct_##A = 0;
static void my_write_buf_##A(void* a, unsigned long b, void* c, off_t d, void* e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "write_buf"); \
- RunFunction(my_context, my_write_buf_fct_##A, 5, a, b, c, d, e); \
+ RunFunctionFmt(my_write_buf_fct_##A, "pLplp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -1057,7 +1057,7 @@ static uintptr_t my_retrieve_reply_fct_##A = 0;
static void my_retrieve_reply_##A(void* a, void* b, unsigned long c, off_t d, void* e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "retrieve_reply"); \
- RunFunction(my_context, my_retrieve_reply_fct_##A, 5, a, b, c, d, e); \
+ RunFunctionFmt(my_retrieve_reply_fct_##A, "ppLlp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -1081,7 +1081,7 @@ static uintptr_t my_forget_multi_fct_##A = 0; \
static void my_forget_multi_##A(void* a, size_t b, void* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "forget_multi"); \
- RunFunction(my_context, my_forget_multi_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_forget_multi_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -1105,7 +1105,7 @@ static uintptr_t my_flock_fct_##A = 0; \
static void my_flock_##A(void* a, unsigned long b, void* c, int d) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "flock"); \
- RunFunction(my_context, my_flock_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_flock_fct_##A, "pLpi", a, b, c, d); \
}
SUPER()
#undef GO
@@ -1129,7 +1129,7 @@ static uintptr_t my_fallocate_fct_##A = 0;
static void my_fallocate_##A(void* a, unsigned long b, int c, off_t d, off_t e, void* f) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "fallocate"); \
- RunFunction(my_context, my_fallocate_fct_##A, 6, a, b, c, d, e, f); \
+ RunFunctionFmt(my_fallocate_fct_##A, "pLillp", a, b, c, d, e, f); \
}
SUPER()
#undef GO
@@ -1155,7 +1155,7 @@ static int my_getattr_op_##A(const char * a, struct stat * b)
printf_log(LOG_DEBUG, "fuse: call %s\n", "getattr_op"); \
struct x64_stat64 b_; \
UnalignStat64(b, &b_); \
- int ret = (int)RunFunction(my_context, my_getattr_op_fct_##A, 2, a, &b_); \
+ int ret = (int)RunFunctionFmt(my_getattr_op_fct_##A, "pp", a, &b_); \
AlignStat64(&b_, b); \
return ret; \
}
@@ -1181,7 +1181,7 @@ static uintptr_t my_readlink_op_fct_##A = 0; \
static int my_readlink_op_##A(const char * a, char * b, size_t c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "readlink_op"); \
- return (int)RunFunction(my_context, my_readlink_op_fct_##A, 3, a, b, c);\
+ return (int)RunFunctionFmt(my_readlink_op_fct_##A, "ppL", a, b, c);\
}
SUPER()
#undef GO
@@ -1205,7 +1205,7 @@ static uintptr_t my_getdir_op_fct_##A = 0;
static int my_getdir_op_##A(const char * a, void* b, void* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "getdir_op"); \
- return (int)RunFunction(my_context, my_getdir_op_fct_##A, 3, a, b, AddCheckBridge(my_lib->w.bridge, iFppiU, c, 0, NULL)); \
+ return (int)RunFunctionFmt(my_getdir_op_fct_##A, "ppp", a, b, AddCheckBridge(my_lib->w.bridge, iFppiU, c, 0, NULL)); \
}
SUPER()
#undef GO
@@ -1229,7 +1229,7 @@ static uintptr_t my_mknod_op_fct_##A = 0; \
static int my_mknod_op_##A(const char * a, mode_t b, dev_t c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "mknod_op"); \
- return (int)RunFunction(my_context, my_mknod_op_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_mknod_op_fct_##A, "puU", a, b, c); \
}
SUPER()
#undef GO
@@ -1253,7 +1253,7 @@ static uintptr_t my_mkdir_op_fct_##A = 0; \
static int my_mkdir_op_##A(const char * a, mode_t b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "mkdir_op"); \
- return (int)RunFunction(my_context, my_mkdir_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_mkdir_op_fct_##A, "pu", a, b); \
}
SUPER()
#undef GO
@@ -1277,7 +1277,7 @@ static uintptr_t my_unlink_op_fct_##A = 0; \
static int my_unlink_op_##A(const char * a) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "unlink_op"); \
- return (int)RunFunction(my_context, my_unlink_op_fct_##A, 1, a); \
+ return (int)RunFunctionFmt(my_unlink_op_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -1301,7 +1301,7 @@ static uintptr_t my_rmdir_op_fct_##A = 0; \
static int my_rmdir_op_##A(const char * a) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "rmdir_op"); \
- return (int)RunFunction(my_context, my_rmdir_op_fct_##A, 1, a); \
+ return (int)RunFunctionFmt(my_rmdir_op_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -1325,7 +1325,7 @@ static uintptr_t my_symlink_op_fct_##A = 0; \
static int my_symlink_op_##A(const char * a, const char * b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "symlink_op"); \
- return (int)RunFunction(my_context, my_symlink_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_symlink_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1349,7 +1349,7 @@ static uintptr_t my_rename_op_fct_##A = 0; \
static int my_rename_op_##A(const char * a, const char * b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "rename_op"); \
- return (int)RunFunction(my_context, my_rename_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_rename_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1373,7 +1373,7 @@ static uintptr_t my_link_op_fct_##A = 0; \
static int my_link_op_##A(const char * a, const char * b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "link_op"); \
- return (int)RunFunction(my_context, my_link_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_link_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1397,7 +1397,7 @@ static uintptr_t my_chmod_op_fct_##A = 0; \
static int my_chmod_op_##A(const char * a, mode_t b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "chmod_op"); \
- return (int)RunFunction(my_context, my_chmod_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_chmod_op_fct_##A, "pu", a, b); \
}
SUPER()
#undef GO
@@ -1421,7 +1421,7 @@ static uintptr_t my_chown_op_fct_##A = 0; \
static int my_chown_op_##A(const char * a, uid_t b, gid_t c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "chown_op"); \
- return (int)RunFunction(my_context, my_chown_op_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_chown_op_fct_##A, "puu", a, b, c); \
}
SUPER()
#undef GO
@@ -1445,7 +1445,7 @@ static uintptr_t my_truncate_op_fct_##A = 0; \
static int my_truncate_op_##A(const char * a, off_t b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "truncate_op"); \
- return (int)RunFunction(my_context, my_truncate_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_truncate_op_fct_##A, "pl", a, b); \
}
SUPER()
#undef GO
@@ -1469,7 +1469,7 @@ static uintptr_t my_utime_op_fct_##A = 0; \
static int my_utime_op_##A(const char * a, void* b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "utime_op"); \
- return (int)RunFunction(my_context, my_utime_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_utime_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1493,7 +1493,7 @@ static uintptr_t my_open_op_fct_##A = 0; \
static int my_open_op_##A(const char * a, void* b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "open_op"); \
- return (int)RunFunction(my_context, my_open_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_open_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1517,7 +1517,7 @@ static uintptr_t my_read_op_fct_##A = 0;
static int my_read_op_##A(const char * a, char * b, size_t c, off_t d, void* e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "read_op"); \
- return (int)RunFunction(my_context, my_read_op_fct_##A, 5, a, b, c, d, e); \
+ return (int)RunFunctionFmt(my_read_op_fct_##A, "ppLlp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -1541,7 +1541,7 @@ static uintptr_t my_write_op_fct_##A = 0;
static int my_write_op_##A(const char * a, const char * b, size_t c, off_t d, void* e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "write_op"); \
- return (int)RunFunction(my_context, my_write_op_fct_##A, 5, a, b, c, d, e); \
+ return (int)RunFunctionFmt(my_write_op_fct_##A, "ppLlp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -1565,7 +1565,7 @@ static uintptr_t my_statfs_op_fct_##A = 0; \
static int my_statfs_op_##A(const char * a, void* b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "statfs_op"); \
- return (int)RunFunction(my_context, my_statfs_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_statfs_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1589,7 +1589,7 @@ static uintptr_t my_flush_op_fct_##A = 0; \
static int my_flush_op_##A(const char * a, void* b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "flush_op"); \
- return (int)RunFunction(my_context, my_flush_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_flush_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1613,7 +1613,7 @@ static uintptr_t my_release_op_fct_##A = 0; \
static int my_release_op_##A(const char * a, void* b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "release_op"); \
- return (int)RunFunction(my_context, my_release_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_release_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1637,7 +1637,7 @@ static uintptr_t my_fsync_op_fct_##A = 0; \
static int my_fsync_op_##A(const char * a, int b, void* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "fsync_op"); \
- return (int)RunFunction(my_context, my_fsync_op_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_fsync_op_fct_##A, "pip", a, b, c); \
}
SUPER()
#undef GO
@@ -1661,7 +1661,7 @@ static uintptr_t my_setxattr_op_fct_##A = 0;
static int my_setxattr_op_##A(const char * a, const char * b, const char * c, size_t d, int e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "setxattr_op"); \
- return (int)RunFunction(my_context, my_setxattr_op_fct_##A, 5, a, b, c, d, e); \
+ return (int)RunFunctionFmt(my_setxattr_op_fct_##A, "pppLi", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -1685,7 +1685,7 @@ static uintptr_t my_getxattr_op_fct_##A = 0;
static int my_getxattr_op_##A(const char * a, const char * b, char * c, size_t d) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "getxattr_op"); \
- return (int)RunFunction(my_context, my_getxattr_op_fct_##A, 4, a, b, c, d); \
+ return (int)RunFunctionFmt(my_getxattr_op_fct_##A, "pppL", a, b, c, d); \
}
SUPER()
#undef GO
@@ -1709,7 +1709,7 @@ static uintptr_t my_listxattr_op_fct_##A = 0;
static int my_listxattr_op_##A(const char * a, char * b, size_t c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "listxattr_op"); \
- return (int)RunFunction(my_context, my_listxattr_op_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_listxattr_op_fct_##A, "ppL", a, b, c); \
}
SUPER()
#undef GO
@@ -1733,7 +1733,7 @@ static uintptr_t my_removexattr_op_fct_##A = 0;
static int my_removexattr_op_##A(const char * a, const char * b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "removexattr_op"); \
- return (int)RunFunction(my_context, my_removexattr_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_removexattr_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1757,7 +1757,7 @@ static uintptr_t my_opendir_op_fct_##A = 0; \
static int my_opendir_op_##A(const char * a, void* b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "opendir_op"); \
- return (int)RunFunction(my_context, my_opendir_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_opendir_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1781,7 +1781,7 @@ static uintptr_t my_readdir_op_fct_##A = 0;
static int my_readdir_op_##A(const char * a, void * b, fuse_fill_dir_t c, off_t d, void* e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "readdir_op"); \
- return (int)RunFunction(my_context, my_readdir_op_fct_##A, 5, a, b, AddCheckBridge(my_lib->w.bridge, iFpppUi, c, 0, NULL), d, e); \
+ return (int)RunFunctionFmt(my_readdir_op_fct_##A, "ppplp", a, b, AddCheckBridge(my_lib->w.bridge, iFpppUi, c, 0, NULL), d, e); \
}
SUPER()
#undef GO
@@ -1805,7 +1805,7 @@ static uintptr_t my_releasedir_op_fct_##A = 0; \
static int my_releasedir_op_##A(const char * a, void* b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "releasedir_op"); \
- return (int)RunFunction(my_context, my_releasedir_op_fct_##A,2, a, b); \
+ return (int)RunFunctionFmt(my_releasedir_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -1829,7 +1829,7 @@ static uintptr_t my_fsyncdir_op_fct_##A = 0; \
static int my_fsyncdir_op_##A(const char * a, int b, void* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "fsyncdir_op"); \
- return (int)RunFunction(my_context, my_fsyncdir_op_fct_##A, 3, a, b, c);\
+ return (int)RunFunctionFmt(my_fsyncdir_op_fct_##A, "pip", a, b, c);\
}
SUPER()
#undef GO
@@ -1853,7 +1853,7 @@ static uintptr_t my_init_op_fct_##A = 0; \
static void* my_init_op_##A(void* a) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "init_op"); \
- return (void*)RunFunction(my_context, my_init_op_fct_##A, 1, a); \
+ return (void*)RunFunctionFmt(my_init_op_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -1877,7 +1877,7 @@ static uintptr_t my_destroy_op_fct_##A = 0; \
static void my_destroy_op_##A(void * a) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "destroy_op"); \
- RunFunction(my_context, my_destroy_op_fct_##A, 1, a); \
+ RunFunctionFmt(my_destroy_op_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -1901,7 +1901,7 @@ static uintptr_t my_access_op_fct_##A = 0; \
static int my_access_op_##A(const char * a, int b) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "access_op"); \
- return (int)RunFunction(my_context, my_access_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_access_op_fct_##A, "pi", a, b); \
}
SUPER()
#undef GO
@@ -1925,7 +1925,7 @@ static uintptr_t my_create_op_fct_##A = 0; \
static int my_create_op_##A(const char * a, mode_t b, void* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "create_op"); \
- return (int)RunFunction(my_context, my_create_op_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_create_op_fct_##A, "pup", a, b, c); \
}
SUPER()
#undef GO
@@ -1949,7 +1949,7 @@ static uintptr_t my_ftruncate_op_fct_##A = 0;
static int my_ftruncate_op_##A(const char * a, off_t b, void* c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "ftruncate_op"); \
- return (int)RunFunction(my_context, my_ftruncate_op_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_ftruncate_op_fct_##A, "plp", a, b, c); \
}
SUPER()
#undef GO
@@ -1975,7 +1975,7 @@ static int my_fgetattr_op_##A(const char * a, struct stat* b, void* c)
printf_log(LOG_DEBUG, "fuse: call %s\n", "fgetattr_op"); \
struct x64_stat64 b_; \
UnalignStat64(b, &b_); \
- int ret = (int)RunFunction(my_context, my_fgetattr_op_fct_##A, 3, a, &b_, c); \
+ int ret = (int)RunFunctionFmt(my_fgetattr_op_fct_##A, "ppp", a, &b_, c); \
AlignStat64(&b_, b); \
return ret; \
}
@@ -2001,7 +2001,7 @@ static uintptr_t my_lock_op_fct_##A = 0;
static int my_lock_op_##A(const char * a, void* b, int c, void* d) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "lock_op"); \
- return (int)RunFunction(my_context, my_lock_op_fct_##A, 4, a, b, c, d); \
+ return (int)RunFunctionFmt(my_lock_op_fct_##A, "ppip", a, b, c, d); \
}
SUPER()
#undef GO
@@ -2025,7 +2025,7 @@ static uintptr_t my_utimens_op_fct_##A = 0; \
static int my_utimens_op_##A(const char * a, const struct timespec b[2]) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "utimens_op"); \
- return (int)RunFunction(my_context, my_utimens_op_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_utimens_op_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -2049,7 +2049,7 @@ static uintptr_t my_bmap_op_fct_##A = 0; \
static int my_bmap_op_##A(const char * a, size_t b, uint64_t *c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "bmap_op"); \
- return (int)RunFunction(my_context, my_bmap_op_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_bmap_op_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
@@ -2073,7 +2073,7 @@ static uintptr_t my_ioctl_op_fct_##A = 0;
static int my_ioctl_op_##A(const char * a, int b, void* c, void* d, unsigned int e, void* f) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "ioctl_op"); \
- return (int)RunFunction(my_context, my_ioctl_op_fct_##A, 6, a, b, c, d, e, f); \
+ return (int)RunFunctionFmt(my_ioctl_op_fct_##A, "pippup", a, b, c, d, e, f); \
}
SUPER()
#undef GO
@@ -2097,7 +2097,7 @@ static uintptr_t my_poll_op_fct_##A = 0; \
static int my_poll_op_##A(const char * a, void* b, void* c, unsigned * d) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "poll_op"); \
- return (int)RunFunction(my_context, my_poll_op_fct_##A, 4, a, b, c, d); \
+ return (int)RunFunctionFmt(my_poll_op_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -2121,7 +2121,7 @@ static uintptr_t my_write_buf_op_fct_##A = 0;
static int my_write_buf_op_##A(const char * a, void* b, off_t c, void* d) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "write_buf_op"); \
- return (int)RunFunction(my_context, my_write_buf_op_fct_##A, 4, a, b, c, d); \
+ return (int)RunFunctionFmt(my_write_buf_op_fct_##A, "pplp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -2145,7 +2145,7 @@ static uintptr_t my_read_buf_op_fct_##A = 0;
static int my_read_buf_op_##A(const char * a, void* b, size_t c, off_t d, void* e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "read_buf_op"); \
- return (int)RunFunction(my_context, my_read_buf_op_fct_##A, 5, a, b, c, d, e); \
+ return (int)RunFunctionFmt(my_read_buf_op_fct_##A, "ppLlp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -2169,7 +2169,7 @@ static uintptr_t my_flock_op_fct_##A = 0; \
static int my_flock_op_##A(const char * a, void* b, int c) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "flock_op"); \
- return (int)RunFunction(my_context, my_flock_op_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_flock_op_fct_##A, "ppi", a, b, c); \
}
SUPER()
#undef GO
@@ -2193,7 +2193,7 @@ static uintptr_t my_fallocate_op_fct_##A = 0;
static int my_fallocate_op_##A(const char * a, int b, off_t c, off_t d, void* e) \
{ \
printf_log(LOG_DEBUG, "fuse: call %s\n", "fallocate_op"); \
- return (int)RunFunction(my_context, my_fallocate_op_fct_##A, 5, a, b, c, d, e); \
+ return (int)RunFunctionFmt(my_fallocate_op_fct_##A, "pillp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -2376,5 +2376,5 @@ box64_showsegv=1;
#define CUSTOM_FINI \
freeMy();
-
+
#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedlibfuse_private.h b/src/wrapped/wrappedlibfuse_private.h
index cc8e9cb..cc8e9cb 100755..100644
--- a/src/wrapped/wrappedlibfuse_private.h
+++ b/src/wrapped/wrappedlibfuse_private.h
diff --git a/src/wrapped/wrappedlibgl.c b/src/wrapped/wrappedlibgl.c
index f210a25..1d5eb93 100755..100644
--- a/src/wrapped/wrappedlibgl.c
+++ b/src/wrapped/wrappedlibgl.c
@@ -23,7 +23,7 @@ static library_t* my_lib = NULL;
// FIXME: old wrapped* type of file, cannot use generated/wrappedlibgltypes.h
-EXPORT void* my_glXGetProcAddress(x64emu_t* emu, void* name)
+EXPORT void* my_glXGetProcAddress(x64emu_t* emu, void* name)
{
khint_t k;
const char* rname = (const char*)name;
@@ -58,7 +58,7 @@ GO(4)
static uintptr_t my_debug_callback_fct_##A = 0; \
static void my_debug_callback_##A(int32_t a, int32_t b, uint32_t c, int32_t d, int32_t e, const char* f, const void* g) \
{ \
- RunFunction(my_context, my_debug_callback_fct_##A, 7, a, b, c, d, e, f, g); \
+ RunFunctionFmt(my_debug_callback_fct_##A, "iiuiipp", a, b, c, d, e, f, g); \
}
SUPER()
#undef GO
@@ -80,7 +80,7 @@ static void* find_debug_callback_Fct(void* fct)
static uintptr_t my_program_callback_fct_##A = 0; \
static void my_program_callback_##A(int32_t a, void* b) \
{ \
- RunFunction(my_context, my_program_callback_fct_##A, 2, a, b); \
+ RunFunctionFmt(my_program_callback_fct_##A, "ip", a, b); \
}
SUPER()
#undef GO
@@ -359,7 +359,7 @@ void* getGLProcAddress(x64emu_t* emu, glprocaddress_t procaddr, const char* rnam
}
#undef GO
#undef SUPER
- } else
+ } else
symbol = procaddr(rname);
if(!symbol) {
printf_dlsym(LOG_DEBUG, "%p\n", NULL);
@@ -371,7 +371,7 @@ void* getGLProcAddress(x64emu_t* emu, glprocaddress_t procaddr, const char* rnam
printf_dlsym(LOG_DEBUG, "%p\n", (void*)ret);
return (void*)ret; // already bridged
}
- // get wrapper
+ // get wrapper
k = kh_get(symbolmap, wrappers->glwrappers, rname);
if(k==kh_end(wrappers->glwrappers) && strstr(rname, "ARB")==NULL) {
// try again, adding ARB at the end if not present
@@ -397,4 +397,4 @@ void* getGLProcAddress(x64emu_t* emu, glprocaddress_t procaddr, const char* rnam
ret = AddBridge(emu->context->system, kh_value(wrappers->glwrappers, k), symbol, 0, constname);
printf_dlsym(LOG_DEBUG, "%p\n", (void*)ret);
return (void*)ret;
-} \ No newline at end of file
+}
diff --git a/src/wrapped/wrappedlibgl_private.h b/src/wrapped/wrappedlibgl_private.h
index eb9bdbf..c87bb80 100755..100644
--- a/src/wrapped/wrappedlibgl_private.h
+++ b/src/wrapped/wrappedlibgl_private.h
@@ -1,2902 +1,2903 @@
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
#error meh!
#endif
+//VERSION_1_0
+GO(glAccum, vFuf)
+GO(glAlphaFunc, vFuf)
+GO(glBegin, vFu)
+GO(glBitmap, vFiiffffp)
+GO(glBlendFunc, vFuu)
+GO(glCallList, vFu)
+GO(glCallLists, vFiup)
+GO(glClear, vFi)
+GO(glClearAccum, vFffff)
+GO(glClearColor, vFffff)
+GO(glClearDepth, vFd)
+GO(glClearIndex, vFf)
+GO(glClearStencil, vFi)
+GO(glClipPlane, vFup)
+GO(glColor3b, vFccc)
+GO(glColor3bv, vFp)
+GO(glColor3d, vFddd)
+GO(glColor3dv, vFp)
+GO(glColor3f, vFfff)
+GO(glColor3fv, vFp)
+GO(glColor3i, vFiii)
+GO(glColor3iv, vFp)
+GO(glColor3s, vFiii)
+GO(glColor3sv, vFp)
+GO(glColor3ub, vFCCC)
+GO(glColor3ubv, vFp)
+GO(glColor3ui, vFuuu)
+GO(glColor3uiv, vFp)
+GO(glColor3us, vFWWW)
+GO(glColor3usv, vFp)
+GO(glColor4b, vFcccc)
+GO(glColor4bv, vFp)
+GO(glColor4d, vFdddd)
+GO(glColor4dv, vFp)
+GO(glColor4f, vFffff)
+GO(glColor4fv, vFp)
+GO(glColor4i, vFiiii)
+GO(glColor4iv, vFp)
+GO(glColor4s, vFiiii)
+GO(glColor4sv, vFp)
+GO(glColor4ub, vFCCCC)
+GO(glColor4ubv, vFp)
+GO(glColor4ui, vFuuuu)
+GO(glColor4uiv, vFp)
+GO(glColor4us, vFWWWW)
+GO(glColor4usv, vFp)
+GO(glColorMask, vFCCCC)
+GO(glColorMaterial, vFuu)
+GO(glCopyPixels, vFiiiiu)
+GO(glCullFace, vFu)
+GO(glDeleteLists, vFui)
+GO(glDepthFunc, vFu)
+GO(glDepthMask, vFi)
+GO(glDepthRange, vFdd)
+GO(glDisable, vFu)
+GO(glDrawBuffer, vFu)
+GO(glDrawPixels, vFiiuup)
+GO(glEdgeFlag, vFi)
+GO(glEdgeFlagv, vFp)
+GO(glEnable, vFu)
+GO(glEnd, vFv)
+GO(glEndList, vFv)
+GO(glEvalCoord1d, vFd)
+GO(glEvalCoord1dv, vFp)
+GO(glEvalCoord1f, vFf)
+GO(glEvalCoord1fv, vFp)
+GO(glEvalCoord2d, vFdd)
+GO(glEvalCoord2dv, vFp)
+GO(glEvalCoord2f, vFff)
+GO(glEvalCoord2fv, vFp)
+GO(glEvalMesh1, vFuii)
+GO(glEvalMesh2, vFuiiii)
+GO(glEvalPoint1, vFi)
+GO(glEvalPoint2, vFii)
+GO(glFeedbackBuffer, vFiup)
+GO(glFinish, vFv)
+GO(glFlush, vFv)
+GO(glFogf, vFuf)
+GO(glFogfv, vFup)
+GO(glFogi, vFui)
+GO(glFogiv, vFup)
+GO(glFrontFace, vFu)
+GO(glFrustum, vFdddddd)
+GO(glGenLists, uFi)
+GO(glGetBooleanv, vFup)
+GO(glGetClipPlane, vFup)
+GO(glGetDoublev, vFup)
+GO(glGetError, uFv)
+GO(glGetFloatv, vFup)
+GO(glGetIntegerv, vFup)
+GO(glGetLightfv, vFuup)
+GO(glGetLightiv, vFuup)
+GO(glGetMapdv, vFuup)
+GO(glGetMapfv, vFuup)
+GO(glGetMapiv, vFuup)
+GO(glGetMaterialfv, vFuup)
+GO(glGetMaterialiv, vFuup)
+GO(glGetPixelMapfv, vFup)
+GO(glGetPixelMapuiv, vFup)
+GO(glGetPixelMapusv, vFup)
+GO(glGetPolygonStipple, vFp)
+GO(glGetString, pFu)
+GO(glGetTexEnvfv, vFuup)
+GO(glGetTexEnviv, vFuup)
+GO(glGetTexGendv, vFuup)
+GO(glGetTexGenfv, vFuup)
+GO(glGetTexGeniv, vFuup)
+GO(glGetTexImage, vFuiuup)
+GO(glGetTexLevelParameterfv, vFuiup)
+GO(glGetTexLevelParameteriv, vFuiup)
+GO(glGetTexParameterfv, vFuup)
+GO(glGetTexParameteriv, vFuup)
+GO(glHint, vFuu)
+GO(glIndexMask, vFu)
+GO(glIndexd, vFd)
+GO(glIndexdv, vFp)
+GO(glIndexf, vFf)
+GO(glIndexfv, vFp)
+GO(glIndexi, vFi)
+GO(glIndexiv, vFp)
+GO(glIndexs, vFi)
+GO(glIndexsv, vFp)
+GO(glInitNames, vFv)
+GO(glIsEnabled, iFu)
+GO(glIsList, iFu)
+GO(glLightModelf, vFuf)
+GO(glLightModelfv, vFup)
+GO(glLightModeli, vFui)
+GO(glLightModeliv, vFup)
+GO(glLightf, vFuuf)
+GO(glLightfv, vFuup)
+GO(glLighti, vFuui)
+GO(glLightiv, vFuup)
+GO(glLineStipple, vFiW)
+GO(glLineWidth, vFf)
+GO(glListBase, vFu)
+GO(glLoadIdentity, vFv)
+GO(glLoadMatrixd, vFp)
+GO(glLoadMatrixf, vFp)
+GO(glLoadName, vFu)
+GO(glLogicOp, vFu)
+GO(glMap1d, vFuddiip)
+GO(glMap1f, vFuffiip)
+GO(glMap2d, vFuddiiddiip)
+GO(glMap2f, vFuffiiffiip)
+GO(glMapGrid1d, vFidd)
+GO(glMapGrid1f, vFiff)
+GO(glMapGrid2d, vFiddidd)
+GO(glMapGrid2f, vFiffiff)
+GO(glMaterialf, vFuuf)
+GO(glMaterialfv, vFuup)
+GO(glMateriali, vFuui)
+GO(glMaterialiv, vFuup)
+GO(glMatrixMode, vFu)
+GO(glMultMatrixd, vFp)
+GO(glMultMatrixf, vFp)
+GO(glNewList, vFuu)
+GO(glNormal3b, vFiii)
+GO(glNormal3bv, vFp)
+GO(glNormal3d, vFddd)
+GO(glNormal3dv, vFp)
+GO(glNormal3f, vFfff)
+GO(glNormal3fv, vFp)
+GO(glNormal3i, vFiii)
+GO(glNormal3iv, vFp)
+GO(glNormal3s, vFiii)
+GO(glNormal3sv, vFp)
+GO(glOrtho, vFdddddd)
+GO(glPassThrough, vFf)
+GO(glPixelMapfv, vFuip)
+GO(glPixelMapuiv, vFuip)
+GO(glPixelMapusv, vFuip)
+GO(glPixelStoref, vFuf)
+GO(glPixelStorei, vFui)
+GO(glPixelTransferf, vFuf)
+GO(glPixelTransferi, vFui)
+GO(glPixelZoom, vFff)
+GO(glPointSize, vFf)
+GO(glPolygonMode, vFuu)
+GO(glPolygonStipple, vFp)
+GO(glPopAttrib, vFv)
+GO(glPopMatrix, vFv)
+GO(glPopName, vFv)
+GO(glPushAttrib, vFi)
+GO(glPushMatrix, vFv)
+GO(glPushName, vFu)
+GO(glRasterPos2d, vFdd)
+GO(glRasterPos2dv, vFp)
+GO(glRasterPos2f, vFff)
+GO(glRasterPos2fv, vFp)
+GO(glRasterPos2i, vFii)
+GO(glRasterPos2iv, vFp)
+GO(glRasterPos2s, vFii)
+GO(glRasterPos2sv, vFp)
+GO(glRasterPos3d, vFddd)
+GO(glRasterPos3dv, vFp)
+GO(glRasterPos3f, vFfff)
+GO(glRasterPos3fv, vFp)
+GO(glRasterPos3i, vFiii)
+GO(glRasterPos3iv, vFp)
+GO(glRasterPos3s, vFiii)
+GO(glRasterPos3sv, vFp)
+GO(glRasterPos4d, vFdddd)
+GO(glRasterPos4dv, vFp)
+GO(glRasterPos4f, vFffff)
+GO(glRasterPos4fv, vFp)
+GO(glRasterPos4i, vFiiii)
+GO(glRasterPos4iv, vFp)
+GO(glRasterPos4s, vFiiii)
+GO(glRasterPos4sv, vFp)
+GO(glReadBuffer, vFu)
+GO(glReadPixels, vFiiiiuup)
+GO(glRectd, vFdddd)
+GO(glRectdv, vFpp)
+GO(glRectf, vFffff)
+GO(glRectfv, vFpp)
+GO(glRecti, vFiiii)
+GO(glRectiv, vFpp)
+GO(glRects, vFiiii)
+GO(glRectsv, vFpp)
+GO(glRenderMode, iFu)
+GO(glRotated, vFdddd)
+GO(glRotatef, vFffff)
+GO(glScaled, vFddd)
+GO(glScalef, vFfff)
+GO(glScissor, vFiiii)
+GO(glSelectBuffer, vFip)
+GO(glShadeModel, vFu)
+GO(glStencilFunc, vFuiu)
+GO(glStencilMask, vFu)
+GO(glStencilOp, vFuuu)
+GO(glTexCoord1d, vFd)
+GO(glTexCoord1dv, vFp)
+GO(glTexCoord1f, vFf)
+GO(glTexCoord1fv, vFp)
+GO(glTexCoord1i, vFi)
+GO(glTexCoord1iv, vFp)
+GO(glTexCoord1s, vFi)
+GO(glTexCoord1sv, vFp)
+GO(glTexCoord2d, vFdd)
+GO(glTexCoord2dv, vFp)
+GO(glTexCoord2f, vFff)
+GO(glTexCoord2fv, vFp)
+GO(glTexCoord2i, vFii)
+GO(glTexCoord2iv, vFp)
+GO(glTexCoord2s, vFii)
+GO(glTexCoord2sv, vFp)
+GO(glTexCoord3d, vFddd)
+GO(glTexCoord3dv, vFp)
+GO(glTexCoord3f, vFfff)
+GO(glTexCoord3fv, vFp)
+GO(glTexCoord3i, vFiii)
+GO(glTexCoord3iv, vFp)
+GO(glTexCoord3s, vFiii)
+GO(glTexCoord3sv, vFp)
+GO(glTexCoord4d, vFdddd)
+GO(glTexCoord4dv, vFp)
+GO(glTexCoord4f, vFffff)
+GO(glTexCoord4fv, vFp)
+GO(glTexCoord4i, vFiiii)
+GO(glTexCoord4iv, vFp)
+GO(glTexCoord4s, vFiiii)
+GO(glTexCoord4sv, vFp)
+GO(glTexEnvf, vFuuf)
+GO(glTexEnvfv, vFuup)
+GO(glTexEnvi, vFuui)
+GO(glTexEnviv, vFuup)
+GO(glTexGend, vFuud)
+GO(glTexGendv, vFuup)
+GO(glTexGenf, vFuuf)
+GO(glTexGenfv, vFuup)
+GO(glTexGeni, vFuui)
+GO(glTexGeniv, vFuup)
+GO(glTexImage1D, vFuiiiiuup)
+GO(glTexImage2D, vFuiiiiiuup)
+GO(glTexParameterf, vFuuf)
+GO(glTexParameterfv, vFuup)
+GO(glTexParameteri, vFuui)
+GO(glTexParameteriv, vFuup)
+GO(glTranslated, vFddd)
+GO(glTranslatef, vFfff)
+GO(glVertex2d, vFdd)
+GO(glVertex2dv, vFp)
+GO(glVertex2f, vFff)
+GO(glVertex2fv, vFp)
+GO(glVertex2i, vFii)
+GO(glVertex2iv, vFp)
+GO(glVertex2s, vFii)
+GO(glVertex2sv, vFp)
+GO(glVertex3d, vFddd)
+GO(glVertex3dv, vFp)
+GO(glVertex3f, vFfff)
+GO(glVertex3fv, vFp)
+GO(glVertex3i, vFiii)
+GO(glVertex3iv, vFp)
+GO(glVertex3s, vFiii)
+GO(glVertex3sv, vFp)
+GO(glVertex4d, vFdddd)
+GO(glVertex4dv, vFp)
+GO(glVertex4f, vFffff)
+GO(glVertex4fv, vFp)
+GO(glVertex4i, vFiiii)
+GO(glVertex4iv, vFp)
+GO(glVertex4s, vFiiii)
+GO(glVertex4sv, vFp)
+GO(glViewport, vFiiii)
+//VERSION_1_1
+GO(glAreTexturesResident, CFipp)
+GO(glArrayElement, vFi)
+GO(glBindTexture, vFuu)
+GO(glColorPointer, vFiuip)
+GO(glCopyTexImage1D, vFuiuiiii)
+GO(glCopyTexImage2D, vFuiuiiiii)
+GO(glCopyTexSubImage1D, vFuiiiii)
+GO(glCopyTexSubImage2D, vFuiiiiiii)
+GO(glDeleteTextures, vFip)
+GO(glDisableClientState, vFu)
+GO(glDrawArrays, vFuii)
+GO(glDrawElements, vFuiup)
+GO(glEdgeFlagPointer, vFip)
+GO(glEnableClientState, vFu)
+GO(glGenTextures, vFip)
+GO(glGetPointerv, vFup)
+GO(glIndexPointer, vFuip)
+GO(glIndexub, vFu)
+GO(glIndexubv, vFp)
+GO(glInterleavedArrays, vFuip)
+GO(glIsTexture, iFu)
+GO(glNormalPointer, vFuip)
+GO(glPolygonOffset, vFff)
+GO(glPopClientAttrib, vFv)
+GO(glPrioritizeTextures, vFipp)
+GO(glPushClientAttrib, vFi)
+GO(glTexCoordPointer, vFiuip)
+GO(glTexSubImage1D, vFuiiiuup)
+GO(glTexSubImage2D, vFuiiiiiuup)
+GO(glVertexPointer, vFiuip)
+//VERSION_1_2
+GO(glBlendColor, vFffff)
+GO(glBlendEquation, vFu)
+GO(glColorSubTable, vFuiiuup)
+GO(glColorTable, vFuuiuup)
+GO(glColorTableParameterfv, vFuup)
+GO(glColorTableParameteriv, vFuup)
+GO(glConvolutionFilter1D, vFuuiuup)
+GO(glConvolutionFilter2D, vFuuiiuup)
+GO(glConvolutionParameterf, vFuuf)
+GO(glConvolutionParameterfv, vFuup)
+GO(glConvolutionParameteri, vFuui)
+GO(glConvolutionParameteriv, vFuup)
+GO(glCopyColorSubTable, vFuiiii)
+GO(glCopyColorTable, vFuuiii)
+GO(glCopyConvolutionFilter1D, vFuuiii)
+GO(glCopyConvolutionFilter2D, vFuuiiii)
+GO(glCopyTexSubImage3D, vFuiiiiiiii)
+GO(glDrawRangeElements, vFuuuiup)
+GO(glGetColorTable, vFuuup)
+GO(glGetColorTableParameterfv, vFuup)
+GO(glGetColorTableParameteriv, vFuup)
+GO(glGetConvolutionFilter, vFuuup)
+GO(glGetConvolutionParameterfv, vFuup)
+GO(glGetConvolutionParameteriv, vFuup)
+GO(glGetHistogram, vFuiuup)
+GO(glGetHistogramParameterfv, vFuup)
+GO(glGetHistogramParameteriv, vFuup)
+GO(glGetMinmax, vFuCuup)
+GO(glGetMinmaxParameterfv, vFuup)
+GO(glGetMinmaxParameteriv, vFuup)
+GO(glGetSeparableFilter, vFuuuppp)
+GO(glHistogram, vFuiui)
+GO(glMinmax, vFuui)
+GO(glResetHistogram, vFu)
+GO(glResetMinmax, vFu)
+GO(glSeparableFilter2D, vFuuiiuupp)
+GO(glTexImage3D, vFuiiiiiiuup)
+GO(glTexSubImage3D, vFuiiiiiiiuup)
+//VERSION_1_3
+GO(glActiveTexture, vFu)
+GO(glClientActiveTexture, vFu)
+GO(glCompressedTexImage1D, vFuiuiiip)
+GO(glCompressedTexImage2D, vFuiuiiiip)
+GO(glCompressedTexImage3D, vFuiuiiiiip)
+GO(glCompressedTexSubImage1D, vFuiiiuip)
+GO(glCompressedTexSubImage2D, vFuiiiiiuip)
+GO(glCompressedTexSubImage3D, vFuiiiiiiiuip)
+GO(glGetCompressedTexImage, vFuip)
+GO(glLoadTransposeMatrixd, vFp)
+GO(glLoadTransposeMatrixf, vFp)
+GO(glMultTransposeMatrixd, vFp)
+GO(glMultTransposeMatrixf, vFp)
+GO(glMultiTexCoord1d, vFud)
+GO(glMultiTexCoord1dv, vFup)
+GO(glMultiTexCoord1f, vFuf)
+GO(glMultiTexCoord1fv, vFup)
+GO(glMultiTexCoord1i, vFui)
+GO(glMultiTexCoord1iv, vFup)
+GO(glMultiTexCoord1s, vFui)
+GO(glMultiTexCoord1sv, vFup)
+GO(glMultiTexCoord2d, vFudd)
+GO(glMultiTexCoord2dv, vFup)
+GO(glMultiTexCoord2f, vFuff)
+GO(glMultiTexCoord2fv, vFup)
+GO(glMultiTexCoord2i, vFuii)
+GO(glMultiTexCoord2iv, vFup)
+GO(glMultiTexCoord2s, vFuii)
+GO(glMultiTexCoord2sv, vFup)
+GO(glMultiTexCoord3d, vFuddd)
+GO(glMultiTexCoord3dv, vFup)
+GO(glMultiTexCoord3f, vFufff)
+GO(glMultiTexCoord3fv, vFup)
+GO(glMultiTexCoord3i, vFuiii)
+GO(glMultiTexCoord3iv, vFup)
+GO(glMultiTexCoord3s, vFuiii)
+GO(glMultiTexCoord3sv, vFup)
+GO(glMultiTexCoord4d, vFudddd)
+GO(glMultiTexCoord4dv, vFup)
+GO(glMultiTexCoord4f, vFuffff)
+GO(glMultiTexCoord4fv, vFup)
+GO(glMultiTexCoord4i, vFuiiii)
+GO(glMultiTexCoord4iv, vFup)
+GO(glMultiTexCoord4s, vFuiiii)
+GO(glMultiTexCoord4sv, vFup)
+GO(glSampleCoverage, vFfi)
+//VERSION_1_4
+GO(glBlendFuncSeparate, vFuuuu)
+GO(glFogCoordPointer, vFuip)
+GO(glFogCoordd, vFd)
+GO(glFogCoorddv, vFp)
+GO(glFogCoordf, vFf)
+GO(glFogCoordfv, vFp)
+GO(glMultiDrawArrays, vFuppi)
+GO(glMultiDrawElements, vFupupi)
+GO(glPointParameterf, vFuf)
+GO(glPointParameterfv, vFup)
+GO(glPointParameteri, vFui)
+GO(glPointParameteriv, vFup)
+GO(glSecondaryColor3b, vFiii)
+GO(glSecondaryColor3bv, vFp)
+GO(glSecondaryColor3d, vFddd)
+GO(glSecondaryColor3dv, vFp)
+GO(glSecondaryColor3f, vFfff)
+GO(glSecondaryColor3fv, vFp)
+GO(glSecondaryColor3i, vFiii)
+GO(glSecondaryColor3iv, vFp)
+GO(glSecondaryColor3s, vFiii)
+GO(glSecondaryColor3sv, vFp)
+GO(glSecondaryColor3ub, vFuuu)
+GO(glSecondaryColor3ubv, vFp)
+GO(glSecondaryColor3ui, vFuuu)
+GO(glSecondaryColor3uiv, vFp)
+GO(glSecondaryColor3us, vFuuu)
+GO(glSecondaryColor3usv, vFp)
+GO(glSecondaryColorPointer, vFiuip)
+GO(glWindowPos2d, vFdd)
+GO(glWindowPos2dv, vFp)
+GO(glWindowPos2f, vFff)
+GO(glWindowPos2fv, vFp)
+GO(glWindowPos2i, vFii)
+GO(glWindowPos2iv, vFp)
+GO(glWindowPos2s, vFii)
+GO(glWindowPos2sv, vFp)
+GO(glWindowPos3d, vFddd)
+GO(glWindowPos3dv, vFp)
+GO(glWindowPos3f, vFfff)
+GO(glWindowPos3fv, vFp)
+GO(glWindowPos3i, vFiii)
+GO(glWindowPos3iv, vFp)
+GO(glWindowPos3s, vFiii)
+GO(glWindowPos3sv, vFp)
+//VERSION_1_5
+GO(glBeginQuery, vFuu)
+GO(glBindBuffer, vFuu)
+GO(glBufferData, vFulpu)
+GO(glBufferSubData, vFullp)
+GO(glDeleteBuffers, vFip)
+GO(glDeleteQueries, vFip)
+GO(glEndQuery, vFu)
+GO(glGenBuffers, vFip)
+GO(glGenQueries, vFip)
+GO(glGetBufferParameteriv, vFuup)
+GO(glGetBufferPointerv, vFuup)
+GO(glGetBufferSubData, vFullp)
+GO(glGetQueryObjectiv, vFuup)
+GO(glGetQueryObjectuiv, vFuup)
+GO(glGetQueryiv, vFuup)
+GO(glIsBuffer, iFu)
+GO(glIsQuery, iFu)
+GO(glMapBuffer, pFuu)
+GO(glUnmapBuffer, iFu)
+//VERSION_2_0
+GO(glAttachShader, vFuu)
+GO(glBindAttribLocation, vFuup)
+GO(glBlendEquationSeparate, vFuu)
+GO(glCompileShader, vFu)
+GO(glCreateProgram, uFv)
+GO(glCreateShader, uFu)
+GO(glDeleteProgram, vFu)
+GO(glDeleteShader, vFu)
+GO(glDetachShader, vFuu)
+GO(glDisableVertexAttribArray, vFu)
+GO(glDrawBuffers, vFip)
+GO(glEnableVertexAttribArray, vFu)
+GO(glGetActiveAttrib, vFuuipppp)
+GO(glGetActiveUniform, vFuuipppp)
+GO(glGetAttachedShaders, vFuipp)
+GO(glGetAttribLocation, iFup)
+GO(glGetProgramInfoLog, vFuipp)
+GO(glGetProgramiv, vFuup)
+GO(glGetShaderInfoLog, vFuipp)
+GO(glGetShaderSource, vFuipp)
+GO(glGetShaderiv, vFuup)
+GO(glGetUniformLocation, iFup)
+GO(glGetUniformfv, vFuip)
+GO(glGetUniformiv, vFuip)
+GO(glGetVertexAttribPointerv, vFuup)
+GO(glGetVertexAttribdv, vFuup)
+GO(glGetVertexAttribfv, vFuup)
+GO(glGetVertexAttribiv, vFuup)
+GO(glIsProgram, iFu)
+GO(glIsShader, iFu)
+GO(glLinkProgram, vFu)
+GO(glShaderSource, vFuipp)
+GO(glStencilFuncSeparate, vFuuiu)
+GO(glStencilMaskSeparate, vFuu)
+GO(glStencilOpSeparate, vFuuuu)
+GO(glUniform1f, vFif)
+GO(glUniform1fv, vFiip)
+GO(glUniform1i, vFii)
+GO(glUniform1iv, vFiip)
+GO(glUniform2f, vFiff)
+GO(glUniform2fv, vFiip)
+GO(glUniform2i, vFiii)
+GO(glUniform2iv, vFiip)
+GO(glUniform3f, vFifff)
+GO(glUniform3fv, vFiip)
+GO(glUniform3i, vFiiii)
+GO(glUniform3iv, vFiip)
+GO(glUniform4f, vFiffff)
+GO(glUniform4fv, vFiip)
+GO(glUniform4i, vFiiiii)
+GO(glUniform4iv, vFiip)
+GO(glUniformMatrix2fv, vFiiip)
+GO(glUniformMatrix3fv, vFiiip)
+GO(glUniformMatrix4fv, vFiiip)
+GO(glUseProgram, vFu)
+GO(glValidateProgram, vFu)
+GO(glVertexAttrib1d, vFud)
+GO(glVertexAttrib1dv, vFup)
+GO(glVertexAttrib1f, vFuf)
+GO(glVertexAttrib1fv, vFup)
+GO(glVertexAttrib1s, vFui)
+GO(glVertexAttrib1sv, vFup)
+GO(glVertexAttrib2d, vFudd)
+GO(glVertexAttrib2dv, vFup)
+GO(glVertexAttrib2f, vFuff)
+GO(glVertexAttrib2fv, vFup)
+GO(glVertexAttrib2s, vFuii)
+GO(glVertexAttrib2sv, vFup)
+GO(glVertexAttrib3d, vFuddd)
+GO(glVertexAttrib3dv, vFup)
+GO(glVertexAttrib3f, vFufff)
+GO(glVertexAttrib3fv, vFup)
+GO(glVertexAttrib3s, vFuiii)
+GO(glVertexAttrib3sv, vFup)
+GO(glVertexAttrib4Nbv, vFup)
+GO(glVertexAttrib4Niv, vFup)
+GO(glVertexAttrib4Nsv, vFup)
+GO(glVertexAttrib4Nub, vFuuuuu)
+GO(glVertexAttrib4Nubv, vFup)
+GO(glVertexAttrib4Nuiv, vFup)
+GO(glVertexAttrib4Nusv, vFup)
+GO(glVertexAttrib4bv, vFup)
+GO(glVertexAttrib4d, vFudddd)
+GO(glVertexAttrib4dv, vFup)
+GO(glVertexAttrib4f, vFuffff)
+GO(glVertexAttrib4fv, vFup)
+GO(glVertexAttrib4iv, vFup)
+GO(glVertexAttrib4s, vFuiiii)
+GO(glVertexAttrib4sv, vFup)
+GO(glVertexAttrib4ubv, vFup)
+GO(glVertexAttrib4uiv, vFup)
+GO(glVertexAttrib4usv, vFup)
+GO(glVertexAttribPointer, vFuiuiip)
+//VERSION_2_1
+GO(glUniformMatrix2x3fv, vFiiip)
+GO(glUniformMatrix2x4fv, vFiiip)
+GO(glUniformMatrix3x2fv, vFiiip)
+GO(glUniformMatrix3x4fv, vFiiip)
+GO(glUniformMatrix4x2fv, vFiiip)
+GO(glUniformMatrix4x3fv, vFiiip)
+//VERSION_3_0
+GO(glBeginConditionalRender, vFuu)
+GO(glBeginTransformFeedback, vFu)
+GO(glBindBufferBase, vFuuu)
+GO(glBindBufferRange, vFuuuii)
+GO(glBindFragDataLocation, vFuup)
+GO(glClampColor, vFuu)
+GO(glClearBufferfi, vFuifi)
+GO(glClearBufferfv, vFuip)
+GO(glClearBufferiv, vFuip)
+GO(glClearBufferuiv, vFuip)
+GO(glColorMaski, vFuiiii)
+GO(glDisablei, vFuu)
+GO(glEnablei, vFuu)
+GO(glEndConditionalRender, vFv)
+GO(glEndTransformFeedback, vFv)
+GO(glGetBooleani_v, vFuup)
+GO(glGetFragDataLocation, iFup)
+GO(glGetIntegeri_v, vFuup)
+GO(glGetStringi, pFuu)
+GO(glGetTexParameterIiv, vFuup)
+GO(glGetTexParameterIuiv, vFuup)
+GO(glGetTransformFeedbackVarying, vFuuipppp)
+GO(glGetUniformuiv, vFuip)
+GO(glGetVertexAttribIiv, vFuup)
+GO(glGetVertexAttribIuiv, vFuup)
+GO(glIsEnabledi, iFuu)
+GO(glTexParameterIiv, vFuup)
+GO(glTexParameterIuiv, vFuup)
+GO(glTransformFeedbackVaryings, vFuipu)
+GO(glUniform1ui, vFiu)
+GO(glUniform1uiv, vFiip)
+GO(glUniform2ui, vFiuu)
+GO(glUniform2uiv, vFiip)
+GO(glUniform3ui, vFiuuu)
+GO(glUniform3uiv, vFiip)
+GO(glUniform4ui, vFiuuuu)
+GO(glUniform4uiv, vFiip)
+GO(glVertexAttribI1i, vFui)
+GO(glVertexAttribI1iv, vFup)
+GO(glVertexAttribI1ui, vFuu)
+GO(glVertexAttribI1uiv, vFup)
+GO(glVertexAttribI2i, vFuii)
+GO(glVertexAttribI2iv, vFup)
+GO(glVertexAttribI2ui, vFuuu)
+GO(glVertexAttribI2uiv, vFup)
+GO(glVertexAttribI3i, vFuiii)
+GO(glVertexAttribI3iv, vFup)
+GO(glVertexAttribI3ui, vFuuuu)
+GO(glVertexAttribI3uiv, vFup)
+GO(glVertexAttribI4bv, vFup)
+GO(glVertexAttribI4i, vFuiiii)
+GO(glVertexAttribI4iv, vFup)
+GO(glVertexAttribI4sv, vFup)
+GO(glVertexAttribI4ubv, vFup)
+GO(glVertexAttribI4ui, vFuuuuu)
+GO(glVertexAttribI4uiv, vFup)
+GO(glVertexAttribI4usv, vFup)
+GO(glVertexAttribIPointer, vFuiuip)
+//VERSION_3_1
+GO(glDrawArraysInstanced, vFuiii)
+GO(glDrawElementsInstanced, vFuiupi)
+GO(glPrimitiveRestartIndex, vFu)
+GO(glTexBuffer, vFuuu)
+//VERSION_3_2
+GO(glFramebufferTexture, vFuuui)
+GO(glGetBufferParameteri64v, vFuup)
+GO(glGetInteger64i_v, vFuup)
+//VERSION_3_3
+GO(glVertexAttribDivisor, vFuu)
+//VERSION_4_0
+GO(glBlendEquationSeparatei, vFuuu)
+GO(glBlendEquationi, vFuu)
+GO(glBlendFuncSeparatei, vFuuuuu)
+GO(glBlendFunci, vFuuu)
+GO(glMinSampleShading, vFf)
+//VERSION_4_3
+GO(glInvalidateNamedFramebuffer, vFiup)
+//VERSION_4_4
+GO(glBindBuffersBase, vFiuip)
+GO(glBindBuffersRange, vFuuippp)
+GO(glBindImageTextures, vFuip)
+GO(glBindSamplers, vFuip)
+GO(glBindTextures, vFuip)
+GO(glBindVertexBuffers, vFuippp)
+GO(glBufferStorage, vFulpu)
+GO(glClearTexImage, vFuiuup)
+GO(glClearTexSubImage, vFuiiiiiiiiip)
+//VERSION_4_5
+GO(glClipControl, vFii)
+GO(glCreateTransformFeedbacks, vFlp)
+GO(glTransformFeedbackBufferBase, vFuuu)
+GO(glTransformFeedbackBufferRange, vFuuull)
+GO(glGetTransformFeedbackiv, vFuip)
+GO(glGetTransformFeedbacki_v, vFuiup)
+GO(glGetTransformFeedbacki64_v, vFuuup)
+GO(glCreateBuffers, vFlp)
+GO(glNamedBufferStorage, vFulpu)
+GO(glNamedBufferStorageEXT, vFulpu)
+GO(glNamedBufferData, vFulpi)
+GO(glNamedBufferSubData, vFullp)
+GO(glCopyNamedBufferSubData, vFuulll)
+GO(glClearNamedBufferData, vFuiiip)
+GO(glClearNamedBufferSubData, vFuulluup)
+GO(glMapNamedBuffer, pFui)
+GO(glMapNamedBufferRange, pFullu)
+GO(glUnmapNamedBuffer, iFu)
+GO(glFlushMappedNamedBufferRange, vFull)
+GO(glGetNamedBufferParameteriv, vFuip)
+GO(glGetNamedBufferParameteri64v, vFuip)
+GO(glGetNamedBufferPointerv, vFuip)
+GO(glGetNamedBufferSubData, vFullp)
+GO(glCreateFramebuffers, vFlp)
+GO(glNamedFramebufferRenderbuffer, vFuiiu)
+GO(glNamedFramebufferParameteri, vFuii)
+GO(glNamedFramebufferTexture, vFuiui)
+GO(glNamedFramebufferTextureLayer, vFuiuii)
+GO(glNamedFramebufferDrawBuffer, vFui)
+GO(glNamedFramebufferDrawBuffers, vFulp)
+GO(glNamedFramebufferReadBuffer, vFui)
+GO(glInvalidateNamedFramebufferData, vFulp)
+GO(glInvalidateNamedFramebufferSubData, vFuipiiii)
+GO(glClearNamedFramebufferiv, vFuuip)
+GO(glClearNamedFramebufferuiv, vFuuip)
+GO(glClearNamedFramebufferfv, vFuuip)
+GO(glClearNamedFramebufferfi, vFuuifi)
+GO(glBlitNamedFramebuffer, vFuuiiiiiiiiui)
+GO(glCheckNamedFramebufferStatus, iFui)
+GO(glGetNamedFramebufferParameteriv, vFuip)
+GO(glGetNamedFramebufferAttachmentParameteriv, vFuiip)
+GO(glCreateRenderbuffers, vFlp)
+GO(glNamedRenderbufferStorage, vFuill)
+GO(glNamedRenderbufferStorageMultisample, vFulill)
+GO(glGetNamedRenderbufferParameteriv, vFuip)
+GO(glCreateTextures, vFilp)
+GO(glTextureBuffer, vFuiu)
+GO(glTextureBufferRange, vFuuull)
+GO(glTextureStorage1D, vFuiui)
+GO(glTextureStorage2D, vFulill)
+GO(glTextureStorage3D, vFuiuiii)
+GO(glTextureStorage2DMultisample, vFuiuiiC)
+GO(glTextureStorage3DMultisample, vFuiuiiiC)
+GO(glTextureSubImage1D, vFuiiiuup)
+GO(glTextureSubImage2D, vFuiiiiiuup)
+GO(glTextureSubImage3D, vFuiiiiiiiuup)
+GO(glCompressedTextureSubImage1D, vFuiiiuip)
+GO(glCompressedTextureSubImage2D, vFuiiiiiuip)
+GO(glCompressedTextureSubImage3D, vFuiiiiiiiuip)
+GO(glCopyTextureSubImage1D, vFuiiiii)
+GO(glCopyTextureSubImage2D, vFuiiiiiii)
+GO(glCopyTextureSubImage3D, vFuiiiiiiii)
+GO(glTextureParameterf, vFuif)
+GO(glTextureParameterfv, vFuip)
+GO(glTextureParameteri, vFuii)
+GO(glTextureParameterIiv, vFuip)
+GO(glTextureParameterIuiv, vFuup)
+GO(glTextureParameteriv, vFuip)
+GO(glGenerateTextureMipmap, vFu)
+GO(glBindTextureUnit, vFuu)
+GO(glGetTextureImage, vFuiuuip)
+GO(glGetCompressedTextureImage, vFuiip)
+GO(glGetTextureLevelParameterfv, vFuiup)
+GO(glGetTextureLevelParameteriv, vFuiup)
+GO(glGetTextureParameterfv, vFuip)
+GO(glGetTextureParameterIiv, vFuip)
+GO(glGetTextureParameterIuiv, vFuip)
+GO(glGetTextureParameteriv, vFuip)
+GO(glCreateVertexArrays, vFlp)
+GO(glDisableVertexArrayAttrib, vFuu)
+GO(glEnableVertexArrayAttrib, vFuu)
+GO(glVertexArrayElementBuffer, vFuu)
+GO(glVertexArrayVertexBuffer, vFuuull)
+GO(glVertexArrayVertexBuffers, vFuuippp)
+GO(glVertexArrayAttribBinding, vFuuu)
+GO(glVertexArrayAttribFormat, vFuuiiiu)
+GO(glVertexArrayAttribIFormat, vFuuiiu)
+GO(glVertexArrayAttribLFormat, vFuuiiu)
+GO(glVertexArrayBindingDivisor, vFuuu)
+GO(glGetVertexArrayiv, vFuip)
+GO(glGetVertexArrayIndexediv, vFuuip)
+GO(glGetVertexArrayIndexed64iv, vFuuip)
+GO(glCreateSamplers, vFlp)
+GO(glCreateProgramPipelines, vFip)
+GO(glTextureBarrier, vFv)
+GO(glTextureParameteriiv, vFuip)
+GO(glTextureParameteriuiv, vFuip)
+GO(glCreateQueries, vFilp)
+GO(glGetQueryBufferObjecti64v, vFuuil)
+GO(glGetQueryBufferObjectiv, vFuuil)
+GO(glGetQueryBufferObjectui64v, vFuuil)
+GO(glGetQueryBufferObjectuiv, vFuuul)
+GO(glMemoryBarrierByRegion, vFu)
+GO(glGetTextureSubImage, vFuiiiiiiiuuip)
+GO(glGetCompressedTextureSubImage, vFuiiiiiiiip)
+GO(glGetGraphicsResetStatus, iFv)
+//VERSION_4_6
+GO(glSpecializeShader, vFippp)
+
+GO(glTexturePageCommitmentEXT, vFuiiiiiiiC)
+GO(glVertexArrayVertexAttribDivisorEXT, vFuuu)
+
// _fini
//3DFX_tbuffer
-GO(glTbufferMask3DFX,vFu)
+GO(glTbufferMask3DFX, vFu)
//AMD_debug_output
-GOM(glDebugMessageCallbackAMD,vFEpp)
-GO(glDebugMessageEnableAMD,vFuuipi)
-GO(glDebugMessageInsertAMD,vFuuuip)
-GO(glGetDebugMessageLogAMD,uFuippppp)
+GOM(glDebugMessageCallbackAMD, vFEpp)
+GO(glDebugMessageEnableAMD, vFuuipC)
+GO(glDebugMessageInsertAMD, vFuuuip)
+GO(glGetDebugMessageLogAMD, uFuippppp)
//AMD_draw_buffers_blend
-GO(glBlendEquationIndexedAMD,vFuu)
-GO(glBlendEquationSeparateIndexedAMD,vFuuu)
-GO(glBlendFuncIndexedAMD,vFuuu)
-GO(glBlendFuncSeparateIndexedAMD,vFuuuuu)
+GO(glBlendEquationIndexedAMD, vFuu)
+GO(glBlendEquationSeparateIndexedAMD, vFuuu)
+GO(glBlendFuncIndexedAMD, vFuuu)
+GO(glBlendFuncSeparateIndexedAMD, vFuuuuu)
//AMD_multi_draw_indirect
-GO(glMultiDrawArraysIndirectAMD,vFupii)
-GO(glMultiDrawElementsIndirectAMD,vFuupii)
+GO(glMultiDrawArraysIndirectAMD, vFupii)
+GO(glMultiDrawElementsIndirectAMD, vFuupii)
//AMD_name_gen_delete
-GO(glDeleteNamesAMD,vFuup)
-GO(glGenNamesAMD,vFuup)
-GO(glIsNameAMD,iFuu)
+GO(glDeleteNamesAMD, vFuup)
+GO(glGenNamesAMD, vFuup)
+GO(glIsNameAMD, iFuu)
//AMD_performance_monitor
-GO(glBeginPerfMonitorAMD,vFu)
-GO(glDeletePerfMonitorsAMD,vFip)
-GO(glEndPerfMonitorAMD,vFu)
-GO(glGenPerfMonitorsAMD,vFip)
-GO(glGetPerfMonitorCounterDataAMD,vFuuipp)
-GO(glGetPerfMonitorCounterInfoAMD,vFuuup)
-GO(glGetPerfMonitorCounterStringAMD,vFuuipp)
-GO(glGetPerfMonitorCountersAMD,vFuppip)
-GO(glGetPerfMonitorGroupStringAMD,vFuipp)
-GO(glGetPerfMonitorGroupsAMD,vFpip)
-GO(glSelectPerfMonitorCountersAMD,vFuiuip)
+GO(glBeginPerfMonitorAMD, vFu)
+GO(glDeletePerfMonitorsAMD, vFip)
+GO(glEndPerfMonitorAMD, vFu)
+GO(glGenPerfMonitorsAMD, vFip)
+GO(glGetPerfMonitorCounterDataAMD, vFuuipp)
+GO(glGetPerfMonitorCounterInfoAMD, vFuuup)
+GO(glGetPerfMonitorCounterStringAMD, vFuuipp)
+GO(glGetPerfMonitorCountersAMD, vFuppip)
+GO(glGetPerfMonitorGroupStringAMD, vFuipp)
+GO(glGetPerfMonitorGroupsAMD, vFpip)
+GO(glSelectPerfMonitorCountersAMD, vFuCuip)
//AMD_sample_positions
-GO(glSetMultisamplefvAMD,vFuup)
+GO(glSetMultisamplefvAMD, vFuup)
//AMD_sparse_texture
-GO(glTexStorageSparseAMD,vFuuiiiii)
-GO(glTextureStorageSparseAMD,vFuuuiiiii)
+GO(glTexStorageSparseAMD, vFuuiiiiu)
+GO(glTextureStorageSparseAMD, vFuuuiiiiu)
//AMD_stencil_operation_extended
-GO(glStencilOpValueAMD,vFuu)
+GO(glStencilOpValueAMD, vFuu)
//AMD_vertex_shader_tessellator
-GO(glTessellationFactorAMD,vFf)
-GO(glTessellationModeAMD,vFu)
+GO(glTessellationFactorAMD, vFf)
+GO(glTessellationModeAMD, vFu)
//APPLE_element_array
-GO(glDrawElementArrayAPPLE,vFuii)
-GO(glDrawRangeElementArrayAPPLE,vFuuuii)
-GO(glElementPointerAPPLE,vFup)
-GO(glMultiDrawElementArrayAPPLE,vFuppi)
-GO(glMultiDrawRangeElementArrayAPPLE,vFuuuppi)
+GO(glDrawElementArrayAPPLE, vFuii)
+GO(glDrawRangeElementArrayAPPLE, vFuuuii)
+GO(glElementPointerAPPLE, vFup)
+GO(glMultiDrawElementArrayAPPLE, vFuppi)
+GO(glMultiDrawRangeElementArrayAPPLE, vFuuuppi)
//APPLE_fence
-GO(glDeleteFencesAPPLE,vFip)
-GO(glFinishFenceAPPLE,vFu)
-GO(glFinishObjectAPPLE,vFui)
-GO(glGenFencesAPPLE,vFip)
-GO(glIsFenceAPPLE,iFu)
-GO(glSetFenceAPPLE,vFu)
-GO(glTestFenceAPPLE,iFu)
-GO(glTestObjectAPPLE,iFuu)
+GO(glDeleteFencesAPPLE, vFip)
+GO(glFinishFenceAPPLE, vFu)
+GO(glFinishObjectAPPLE, vFui)
+GO(glGenFencesAPPLE, vFip)
+GO(glIsFenceAPPLE, iFu)
+GO(glSetFenceAPPLE, vFu)
+GO(glTestFenceAPPLE, iFu)
+GO(glTestObjectAPPLE, iFuu)
//APPLE_flush_buffer_range
-GO(glBufferParameteriAPPLE,vFuui)
-GO(glFlushMappedBufferRangeAPPLE,vFuii)
+GO(glBufferParameteriAPPLE, vFuui)
+GO(glFlushMappedBufferRangeAPPLE, vFull)
//APPLE_object_purgeable
-GO(glGetObjectParameterivAPPLE,vFuuup)
-GO(glObjectPurgeableAPPLE,uFuuu)
-GO(glObjectUnpurgeableAPPLE,uFuuu)
+GO(glGetObjectParameterivAPPLE, vFuuup)
+GO(glObjectPurgeableAPPLE, uFuuu)
+GO(glObjectUnpurgeableAPPLE, uFuuu)
//APPLE_texture_range
-GO(glGetTexParameterPointervAPPLE,vFuup)
-GO(glTextureRangeAPPLE,vFuip)
+GO(glGetTexParameterPointervAPPLE, vFuup)
+GO(glTextureRangeAPPLE, vFuip)
//APPLE_vertex_array_object
-GO(glBindVertexArrayAPPLE,vFu)
-GO(glDeleteVertexArraysAPPLE,vFip)
-GO(glGenVertexArraysAPPLE,vFip)
-GO(glIsVertexArrayAPPLE,iFu)
+GO(glBindVertexArrayAPPLE, vFu)
+GO(glDeleteVertexArraysAPPLE, vFip)
+GO(glGenVertexArraysAPPLE, vFip)
+GO(glIsVertexArrayAPPLE, iFu)
//APPLE_vertex_array_range
-GO(glFlushVertexArrayRangeAPPLE,vFip)
-GO(glVertexArrayParameteriAPPLE,vFui)
-GO(glVertexArrayRangeAPPLE,vFip)
+GO(glFlushVertexArrayRangeAPPLE, vFip)
+GO(glVertexArrayParameteriAPPLE, vFui)
+GO(glVertexArrayRangeAPPLE, vFip)
//APPLE_vertex_program_evaluators
-GO(glDisableVertexAttribAPPLE,vFuu)
-GO(glEnableVertexAttribAPPLE,vFuu)
-GO(glIsVertexAttribEnabledAPPLE,iFuu)
-GO(glMapVertexAttrib1dAPPLE,vFuuddiip)
-GO(glMapVertexAttrib1fAPPLE,vFuuffiip)
-GO(glMapVertexAttrib2dAPPLE,vFuuddiiddiip)
-GO(glMapVertexAttrib2fAPPLE,vFuuffiiffiip)
+GO(glDisableVertexAttribAPPLE, vFuu)
+GO(glEnableVertexAttribAPPLE, vFuu)
+GO(glIsVertexAttribEnabledAPPLE, iFuu)
+GO(glMapVertexAttrib1dAPPLE, vFuuddiip)
+GO(glMapVertexAttrib1fAPPLE, vFuuffiip)
+GO(glMapVertexAttrib2dAPPLE, vFuuddiiddiip)
+GO(glMapVertexAttrib2fAPPLE, vFuuffiiffiip)
//ARB_ES2_compatibility
-GO(glClearDepthf,vFf)
-GO(glDepthRangef,vFff)
-GO(glGetShaderPrecisionFormat,vFuupp)
-GO(glReleaseShaderCompiler,vFv)
-GO(glShaderBinary,vFipupi)
+GO(glClearDepthf, vFf)
+GO(glDepthRangef, vFff)
+GO(glGetShaderPrecisionFormat, vFuupp)
+GO(glReleaseShaderCompiler, vFv)
+GO(glShaderBinary, vFipupi)
//ARB_base_instance
-GO(glDrawArraysInstancedBaseInstance,vFuiiiu)
-GO(glDrawElementsInstancedBaseInstance,vFuiupiu)
-GO(glDrawElementsInstancedBaseVertexBaseInstance,vFuiupiiu)
+GO(glDrawArraysInstancedBaseInstance, vFuiiiu)
+GO(glDrawElementsInstancedBaseInstance, vFuiupiu)
+GO(glDrawElementsInstancedBaseVertexBaseInstance, vFuiupiiu)
//ARB_blend_func_extended
-GO(glBindFragDataLocationIndexed,vFuuup)
-GO(glGetFragDataIndex,iFup)
+GO(glBindFragDataLocationIndexed, vFuuup)
+GO(glGetFragDataIndex, iFup)
//ARB_cl_event
-GO(glCreateSyncFromCLeventARB,pFppi)
+GO(glCreateSyncFromCLeventARB, pFppu)
//ARB_clear_buffer_object
-GO(glClearBufferData,vFuuuup)
-GO(glClearBufferSubData,vFuuiiuup)
-GO(glClearNamedBufferDataEXT,vFuuuup)
-GO(glClearNamedBufferSubDataEXT,vFuuuuiip)
+GO(glClearBufferData, vFuuuup)
+GO(glClearBufferSubData, vFuulluup)
+GO(glClearNamedBufferDataEXT, vFuuuup)
+GO(glClearNamedBufferSubDataEXT, vFuulluup)
//ARB_color_buffer_float
-GO(glClampColorARB,vFuu)
+GO(glClampColorARB, vFuu)
//ARB_compute_shader
-GO(glDispatchCompute,vFuuu)
-GO(glDispatchComputeIndirect,vFi)
+GO(glDispatchCompute, vFuuu)
+GO(glDispatchComputeIndirect, vFi)
//ARB_copy_buffer
-GO(glCopyBufferSubData,vFuuiii)
+GO(glCopyBufferSubData, vFuulll)
//ARB_copy_image
-GO(glCopyImageSubData,vFuuiiiiuuiiiiiii)
+GO(glCopyImageSubData, vFuuiiiiuuiiiiiii)
//ARB_debug_output
-GOM(glDebugMessageCallbackARB,vFEpp)
-GO(glDebugMessageControlARB,vFuuuipi)
-GO(glDebugMessageInsertARB,vFuuuuip)
-GO(glGetDebugMessageLogARB,uFuipppppp)
+GOM(glDebugMessageCallbackARB, vFEpp)
+GO(glDebugMessageControlARB, vFuuuipC)
+GO(glDebugMessageInsertARB, vFuuuuip)
+GO(glGetDebugMessageLogARB, uFuipppppp)
//ARB_draw_buffers
-GO(glDrawBuffersARB,vFip)
+GO(glDrawBuffersARB, vFip)
//ARB_draw_buffers_blend
-GO(glBlendEquationSeparateiARB,vFuuu)
-GO(glBlendEquationiARB,vFuu)
-GO(glBlendFuncSeparateiARB,vFuuuuu)
-GO(glBlendFunciARB,vFuuu)
+GO(glBlendEquationSeparateiARB, vFuuu)
+GO(glBlendEquationiARB, vFuu)
+GO(glBlendFuncSeparateiARB, vFuuuuu)
+GO(glBlendFunciARB, vFuuu)
//ARB_draw_elements_base_vertex
-GO(glDrawElementsBaseVertex,vFuiupi)
-GO(glDrawElementsInstancedBaseVertex,vFuiupii)
-GO(glDrawRangeElementsBaseVertex,vFuuuiupi)
-GO(glMultiDrawElementsBaseVertex,vFupupip)
+GO(glDrawElementsBaseVertex, vFuiupi)
+GO(glDrawElementsInstancedBaseVertex, vFuiupii)
+GO(glDrawRangeElementsBaseVertex, vFuuuiupi)
+GO(glMultiDrawElementsBaseVertex, vFupupip)
//ARB_draw_indirect
-GO(glDrawArraysIndirect,vFup)
-GO(glDrawElementsIndirect,vFuup)
+GO(glDrawArraysIndirect, vFup)
+GO(glDrawElementsIndirect, vFuup)
//ARB_draw_instanced
-GO(glDrawArraysInstancedARB,vFuiii)
-GO(glDrawElementsInstancedARB,vFuiupi)
+GO(glDrawArraysInstancedARB, vFuiii)
+GO(glDrawElementsInstancedARB, vFuiupi)
//ARB_framebuffer_no_attachments
-GO(glFramebufferParameteri,vFuui)
-GO(glGetFramebufferParameteriv,vFuup)
-GO(glGetNamedFramebufferParameterivEXT,vFuup)
-GO(glNamedFramebufferParameteriEXT,vFuui)
+GO(glFramebufferParameteri, vFuui)
+GO(glGetFramebufferParameteriv, vFuup)
+GO(glGetNamedFramebufferParameterivEXT, vFuup)
+GO(glNamedFramebufferParameteriEXT, vFuui)
//ARB_framebuffer_object
-GO(glBindFramebuffer,vFuu)
-GO(glBindRenderbuffer,vFuu)
-GO(glBlitFramebuffer,vFiiiiiiiiiu)
-GO(glCheckFramebufferStatus,uFu)
-GO(glDeleteFramebuffers,vFip)
-GO(glDeleteRenderbuffers,vFip)
-GO(glFramebufferRenderbuffer,vFuuuu)
-GO(glFramebufferTexture1D,vFuuuui)
-GO(glFramebufferTexture2D,vFuuuui)
-GO(glFramebufferTexture3D,vFuuuuii)
-GO(glFramebufferTextureLayer,vFuuuii)
-GO(glGenFramebuffers,vFip)
-GO(glGenRenderbuffers,vFip)
-GO(glGenerateMipmap,vFu)
-GO(glGetFramebufferAttachmentParameteriv,vFuuup)
-GO(glGetRenderbufferParameteriv,vFuup)
-GO(glIsFramebuffer,iFu)
-GO(glIsRenderbuffer,iFu)
-GO(glRenderbufferStorage,vFuuii)
-GO(glRenderbufferStorageMultisample,vFuiuii)
+GO(glBindFramebuffer, vFuu)
+GO(glBindRenderbuffer, vFuu)
+GO(glBlitFramebuffer, vFiiiiiiiiiu)
+GO(glCheckFramebufferStatus, uFu)
+GO(glDeleteFramebuffers, vFip)
+GO(glDeleteRenderbuffers, vFip)
+GO(glFramebufferRenderbuffer, vFuuuu)
+GO(glFramebufferTexture1D, vFuuuui)
+GO(glFramebufferTexture2D, vFuuuui)
+GO(glFramebufferTexture3D, vFuuuuii)
+GO(glFramebufferTextureLayer, vFuuuii)
+GO(glGenFramebuffers, vFip)
+GO(glGenRenderbuffers, vFip)
+GO(glGenerateMipmap, vFu)
+GO(glGetFramebufferAttachmentParameteriv, vFuuup)
+GO(glGetRenderbufferParameteriv, vFuup)
+GO(glIsFramebuffer, iFu)
+GO(glIsRenderbuffer, iFu)
+GO(glRenderbufferStorage, vFuuii)
+GO(glRenderbufferStorageMultisample, vFuiuii)
//ARB_geometry_shader4
-GO(glFramebufferTextureARB,vFuuui)
-GO(glFramebufferTextureFaceARB,vFuuuiu)
-GO(glFramebufferTextureLayerARB,vFuuuii)
-GO(glProgramParameteriARB,vFuui)
+GO(glFramebufferTextureARB, vFuuui)
+GO(glFramebufferTextureFaceARB, vFuuuiu)
+GO(glFramebufferTextureLayerARB, vFuuuii)
+GO(glProgramParameteriARB, vFuui)
//ARB_get_program_binary
-GO(glGetProgramBinary,vFuippp)
-GO(glProgramBinary,vFuupi)
-GO(glProgramParameteri,vFuui)
+GO(glGetProgramBinary, vFuippp)
+GO(glProgramBinary, vFuupi)
+GO(glProgramParameteri, vFuui)
//ARB_gpu_shader_fp64
-GO(glGetUniformdv,vFuip)
-GO(glUniform1d,vFid)
-GO(glUniform1dv,vFiip)
-GO(glUniform2d,vFidd)
-GO(glUniform2dv,vFiip)
-GO(glUniform3d,vFiddd)
-GO(glUniform3dv,vFiip)
-GO(glUniform4d,vFidddd)
-GO(glUniform4dv,vFiip)
-GO(glUniformMatrix2dv,vFiiip)
-GO(glUniformMatrix2x3dv,vFiiip)
-GO(glUniformMatrix2x4dv,vFiiip)
-GO(glUniformMatrix3dv,vFiiip)
-GO(glUniformMatrix3x2dv,vFiiip)
-GO(glUniformMatrix3x4dv,vFiiip)
-GO(glUniformMatrix4dv,vFiiip)
-GO(glUniformMatrix4x2dv,vFiiip)
-GO(glUniformMatrix4x3dv,vFiiip)
+GO(glGetUniformdv, vFuip)
+GO(glUniform1d, vFid)
+GO(glUniform1dv, vFiip)
+GO(glUniform2d, vFidd)
+GO(glUniform2dv, vFiip)
+GO(glUniform3d, vFiddd)
+GO(glUniform3dv, vFiip)
+GO(glUniform4d, vFidddd)
+GO(glUniform4dv, vFiip)
+GO(glUniformMatrix2dv, vFiiip)
+GO(glUniformMatrix2x3dv, vFiiip)
+GO(glUniformMatrix2x4dv, vFiiip)
+GO(glUniformMatrix3dv, vFiiip)
+GO(glUniformMatrix3x2dv, vFiiip)
+GO(glUniformMatrix3x4dv, vFiiip)
+GO(glUniformMatrix4dv, vFiiip)
+GO(glUniformMatrix4x2dv, vFiiip)
+GO(glUniformMatrix4x3dv, vFiiCp)
//ARB_instanced_arrays
-GO(glVertexAttribDivisorARB,vFuu)
+GO(glVertexAttribDivisorARB, vFuu)
//ARB_internalformat_query
-GO(glGetInternalformativ,vFuuuip)
+GO(glGetInternalformativ, vFuuuip)
//ARB_internalformat_query2
-GO(glGetInternalformati64v,vFuuuip)
+GO(glGetInternalformati64v, vFuuuip)
//ARB_invalidate_subdata
-GO(glInvalidateBufferData,vFu)
-GO(glInvalidateBufferSubData,vFuii)
-GO(glInvalidateFramebuffer,vFuip)
-GO(glInvalidateSubFramebuffer,vFuipiiii)
-GO(glInvalidateTexImage,vFui)
-GO(glInvalidateTexSubImage,vFuiiiiiii)
+GO(glInvalidateBufferData, vFu)
+GO(glInvalidateBufferSubData, vFuii)
+GO(glInvalidateFramebuffer, vFuip)
+GO(glInvalidateSubFramebuffer, vFuipiiii)
+GO(glInvalidateTexImage, vFui)
+GO(glInvalidateTexSubImage, vFuiiiiiii)
//ARB_map_buffer_range
-GO(glFlushMappedBufferRange,vFull)
-GO(glMapBufferRange,pFulli)
+GO(glFlushMappedBufferRange, vFull)
+GO(glMapBufferRange, pFullu)
//ARB_matrix_palette
-GO(glCurrentPaletteMatrixARB,vFi)
-GO(glMatrixIndexPointerARB,vFiuip)
-GO(glMatrixIndexubvARB,vFip)
-GO(glMatrixIndexuivARB,vFip)
-GO(glMatrixIndexusvARB,vFip)
+GO(glCurrentPaletteMatrixARB, vFi)
+GO(glMatrixIndexPointerARB, vFiuip)
+GO(glMatrixIndexubvARB, vFip)
+GO(glMatrixIndexuivARB, vFip)
+GO(glMatrixIndexusvARB, vFip)
//ARB_multi_draw_indirect
-GO(glMultiDrawArraysIndirect,vFupii)
-GO(glMultiDrawElementsIndirect,vFuupii)
+GO(glMultiDrawArraysIndirect, vFupii)
+GO(glMultiDrawElementsIndirect, vFuupii)
//ARB_multisample
-GO(glSampleCoverageARB,vFfi)
+GO(glSampleCoverageARB, vFfC)
//ARB_multitexture
-GO(glActiveTextureARB,vFu)
-GO(glClientActiveTextureARB,vFu)
-GO(glMultiTexCoord1dARB,vFud)
-GO(glMultiTexCoord1dvARB,vFup)
-GO(glMultiTexCoord1fARB,vFuf)
-GO(glMultiTexCoord1fvARB,vFup)
-GO(glMultiTexCoord1iARB,vFui)
-GO(glMultiTexCoord1ivARB,vFup)
-GO(glMultiTexCoord1sARB,vFui)
-GO(glMultiTexCoord1svARB,vFup)
-GO(glMultiTexCoord2dARB,vFudd)
-GO(glMultiTexCoord2dvARB,vFup)
-GO(glMultiTexCoord2fARB,vFuff)
-GO(glMultiTexCoord2fvARB,vFup)
-GO(glMultiTexCoord2iARB,vFuii)
-GO(glMultiTexCoord2ivARB,vFup)
-GO(glMultiTexCoord2sARB,vFuii)
-GO(glMultiTexCoord2svARB,vFup)
-GO(glMultiTexCoord3dARB,vFuddd)
-GO(glMultiTexCoord3dvARB,vFup)
-GO(glMultiTexCoord3fARB,vFufff)
-GO(glMultiTexCoord3fvARB,vFup)
-GO(glMultiTexCoord3iARB,vFuiii)
-GO(glMultiTexCoord3ivARB,vFup)
-GO(glMultiTexCoord3sARB,vFuiii)
-GO(glMultiTexCoord3svARB,vFup)
-GO(glMultiTexCoord4dARB,vFudddd)
-GO(glMultiTexCoord4dvARB,vFup)
-GO(glMultiTexCoord4fARB,vFuffff)
-GO(glMultiTexCoord4fvARB,vFup)
-GO(glMultiTexCoord4iARB,vFuiiii)
-GO(glMultiTexCoord4ivARB,vFup)
-GO(glMultiTexCoord4sARB,vFuiiii)
-GO(glMultiTexCoord4svARB,vFup)
+GO(glActiveTextureARB, vFu)
+GO(glClientActiveTextureARB, vFu)
+GO(glMultiTexCoord1dARB, vFud)
+GO(glMultiTexCoord1dvARB, vFup)
+GO(glMultiTexCoord1fARB, vFuf)
+GO(glMultiTexCoord1fvARB, vFup)
+GO(glMultiTexCoord1iARB, vFui)
+GO(glMultiTexCoord1ivARB, vFup)
+GO(glMultiTexCoord1sARB, vFui)
+GO(glMultiTexCoord1svARB, vFup)
+GO(glMultiTexCoord2dARB, vFudd)
+GO(glMultiTexCoord2dvARB, vFup)
+GO(glMultiTexCoord2fARB, vFuff)
+GO(glMultiTexCoord2fvARB, vFup)
+GO(glMultiTexCoord2iARB, vFuii)
+GO(glMultiTexCoord2ivARB, vFup)
+GO(glMultiTexCoord2sARB, vFuii)
+GO(glMultiTexCoord2svARB, vFup)
+GO(glMultiTexCoord3dARB, vFuddd)
+GO(glMultiTexCoord3dvARB, vFup)
+GO(glMultiTexCoord3fARB, vFufff)
+GO(glMultiTexCoord3fvARB, vFup)
+GO(glMultiTexCoord3iARB, vFuiii)
+GO(glMultiTexCoord3ivARB, vFup)
+GO(glMultiTexCoord3sARB, vFuiii)
+GO(glMultiTexCoord3svARB, vFup)
+GO(glMultiTexCoord4dARB, vFudddd)
+GO(glMultiTexCoord4dvARB, vFup)
+GO(glMultiTexCoord4fARB, vFuffff)
+GO(glMultiTexCoord4fvARB, vFup)
+GO(glMultiTexCoord4iARB, vFuiiii)
+GO(glMultiTexCoord4ivARB, vFup)
+GO(glMultiTexCoord4sARB, vFuiiii)
+GO(glMultiTexCoord4svARB, vFup)
//ARB_occlusion_query
-GO(glBeginQueryARB,vFuu)
-GO(glDeleteQueriesARB,vFip)
-GO(glEndQueryARB,vFu)
-GO(glGenQueriesARB,vFip)
-GO(glGetQueryObjectivARB,vFuup)
-GO(glGetQueryObjectuivARB,vFuup)
-GO(glGetQueryivARB,vFuup)
-GO(glIsQueryARB,iFu)
+GO(glBeginQueryARB, vFuu)
+GO(glDeleteQueriesARB, vFip)
+GO(glEndQueryARB, vFu)
+GO(glGenQueriesARB, vFip)
+GO(glGetQueryObjectivARB, vFuup)
+GO(glGetQueryObjectuivARB, vFuup)
+GO(glGetQueryivARB, vFuup)
+GO(glIsQueryARB, iFu)
//ARB_point_parameters
-GO(glPointParameterfARB,vFuf)
-GO(glPointParameterfvARB,vFup)
+GO(glPointParameterfARB, vFuf)
+GO(glPointParameterfvARB, vFup)
//ARB_program_interface_query
-GO(glGetProgramInterfaceiv,vFuuup)
-GO(glGetProgramResourceIndex,uFuup)
-GO(glGetProgramResourceLocation,iFuup)
-GO(glGetProgramResourceLocationIndex,iFuup)
-GO(glGetProgramResourceName,vFuuuipp)
-GO(glGetProgramResourceiv,vFuuuipipp)
+GO(glGetProgramInterfaceiv, vFuuup)
+GO(glGetProgramResourceIndex, uFuup)
+GO(glGetProgramResourceLocation, iFuup)
+GO(glGetProgramResourceLocationIndex, iFuup)
+GO(glGetProgramResourceName, vFuuuipp)
+GO(glGetProgramResourceiv, vFuuuipipp)
//ARB_provoking_vertex
-GO(glProvokingVertex,vFu)
+GO(glProvokingVertex, vFu)
//ARB_robustness
-GO(glGetGraphicsResetStatusARB,uFv)
-GO(glGetnColorTableARB,vFuuuip)
-GO(glGetnCompressedTexImageARB,vFuiip)
-GO(glGetnConvolutionFilterARB,vFuuuip)
-GO(glGetnHistogramARB,vFuiuuip)
-GO(glGetnMapdvARB,vFuuip)
-GO(glGetnMapfvARB,vFuuip)
-GO(glGetnMapivARB,vFuuip)
-GO(glGetnMinmaxARB,vFuiuuip)
-GO(glGetnPixelMapfvARB,vFuip)
-GO(glGetnPixelMapuivARB,vFuip)
-GO(glGetnPixelMapusvARB,vFuip)
-GO(glGetnPolygonStippleARB,vFip)
-GO(glGetnSeparableFilterARB,vFuuuipipp)
-GO(glGetnTexImageARB,vFuiuuip)
-GO(glGetnUniformdvARB,vFuiip)
-GO(glGetnUniformfvARB,vFuiip)
-GO(glGetnUniformivARB,vFuiip)
-GO(glGetnUniformuivARB,vFuiip)
-GO(glReadnPixelsARB,vFiiiiuuip)
+GO(glGetGraphicsResetStatusARB, uFv)
+GO(glGetnColorTableARB, vFuuuip)
+GO(glGetnCompressedTexImageARB, vFuiip)
+GO(glGetnConvolutionFilterARB, vFuuuip)
+GO(glGetnHistogramARB, vFuiuuip)
+GO(glGetnMapdvARB, vFuuip)
+GO(glGetnMapfvARB, vFuuip)
+GO(glGetnMapivARB, vFuuip)
+GO(glGetnMinmaxARB, vFuCuuip)
+GO(glGetnPixelMapfvARB, vFuip)
+GO(glGetnPixelMapuivARB, vFuip)
+GO(glGetnPixelMapusvARB, vFuip)
+GO(glGetnPolygonStippleARB, vFip)
+GO(glGetnSeparableFilterARB, vFuuuipipp)
+GO(glGetnTexImageARB, vFuiuuip)
+GO(glGetnUniformdvARB, vFuiip)
+GO(glGetnUniformfvARB, vFuiip)
+GO(glGetnUniformivARB, vFuiip)
+GO(glGetnUniformuivARB, vFuiip)
+GO(glReadnPixelsARB, vFiiiiuuip)
//ARB_sample_shading
-GO(glMinSampleShadingARB,vFf)
+GO(glMinSampleShadingARB, vFf)
//ARB_sampler_objects
-GO(glBindSampler,vFuu)
-GO(glDeleteSamplers,vFip)
-GO(glGenSamplers,vFip)
-GO(glGetSamplerParameterIiv,vFuup)
-GO(glGetSamplerParameterIuiv,vFuup)
-GO(glGetSamplerParameterfv,vFuup)
-GO(glGetSamplerParameteriv,vFuup)
-GO(glIsSampler,iFu)
-GO(glSamplerParameterIiv,vFuup)
-GO(glSamplerParameterIuiv,vFuup)
-GO(glSamplerParameterf,vFuuf)
-GO(glSamplerParameterfv,vFuup)
-GO(glSamplerParameteri,vFuui)
-GO(glSamplerParameteriv,vFuup)
+GO(glBindSampler, vFuu)
+GO(glDeleteSamplers, vFip)
+GO(glGenSamplers, vFip)
+GO(glGetSamplerParameterIiv, vFuup)
+GO(glGetSamplerParameterIuiv, vFuup)
+GO(glGetSamplerParameterfv, vFuup)
+GO(glGetSamplerParameteriv, vFuup)
+GO(glIsSampler, iFu)
+GO(glSamplerParameterIiv, vFuup)
+GO(glSamplerParameterIuiv, vFuup)
+GO(glSamplerParameterf, vFuuf)
+GO(glSamplerParameterfv, vFuup)
+GO(glSamplerParameteri, vFuui)
+GO(glSamplerParameteriv, vFuup)
//ARB_separate_shader_objects
-GO(glActiveShaderProgram,vFuu)
-GO(glBindProgramPipeline,vFu)
-GO(glCreateShaderProgramv,uFuip)
-GO(glDeleteProgramPipelines,vFip)
-GO(glGenProgramPipelines,vFip)
-GO(glGetProgramPipelineInfoLog,vFuipp)
-GO(glGetProgramPipelineiv,vFuup)
-GO(glIsProgramPipeline,iFu)
-GO(glProgramUniform1d,vFuid)
-GO(glProgramUniform1dv,vFuiip)
-GO(glProgramUniform1f,vFuif)
-GO(glProgramUniform1fv,vFuiip)
-GO(glProgramUniform1i,vFuii)
-GO(glProgramUniform1iv,vFuiip)
-GO(glProgramUniform1ui,vFuiu)
-GO(glProgramUniform1uiv,vFuiip)
-GO(glProgramUniform2d,vFuidd)
-GO(glProgramUniform2dv,vFuiip)
-GO(glProgramUniform2f,vFuiff)
-GO(glProgramUniform2fv,vFuiip)
-GO(glProgramUniform2i,vFuiii)
-GO(glProgramUniform2iv,vFuiip)
-GO(glProgramUniform2ui,vFuiuu)
-GO(glProgramUniform2uiv,vFuiip)
-GO(glProgramUniform3d,vFuiddd)
-GO(glProgramUniform3dv,vFuiip)
-GO(glProgramUniform3f,vFuifff)
-GO(glProgramUniform3fv,vFuiip)
-GO(glProgramUniform3i,vFuiiii)
-GO(glProgramUniform3iv,vFuiip)
-GO(glProgramUniform3ui,vFuiuuu)
-GO(glProgramUniform3uiv,vFuiip)
-GO(glProgramUniform4d,vFuidddd)
-GO(glProgramUniform4dv,vFuiip)
-GO(glProgramUniform4f,vFuiffff)
-GO(glProgramUniform4fv,vFuiip)
-GO(glProgramUniform4i,vFuiiiii)
-GO(glProgramUniform4iv,vFuiip)
-GO(glProgramUniform4ui,vFuiuuuu)
-GO(glProgramUniform4uiv,vFuiip)
-GO(glProgramUniformMatrix2dv,vFuiiip)
-GO(glProgramUniformMatrix2fv,vFuiiip)
-GO(glProgramUniformMatrix2x3dv,vFuiiip)
-GO(glProgramUniformMatrix2x3fv,vFuiiip)
-GO(glProgramUniformMatrix2x4dv,vFuiiip)
-GO(glProgramUniformMatrix2x4fv,vFuiiip)
-GO(glProgramUniformMatrix3dv,vFuiiip)
-GO(glProgramUniformMatrix3fv,vFuiiip)
-GO(glProgramUniformMatrix3x2dv,vFuiiip)
-GO(glProgramUniformMatrix3x2fv,vFuiiip)
-GO(glProgramUniformMatrix3x4dv,vFuiiip)
-GO(glProgramUniformMatrix3x4fv,vFuiiip)
-GO(glProgramUniformMatrix4dv,vFuiiip)
-GO(glProgramUniformMatrix4fv,vFuiiip)
-GO(glProgramUniformMatrix4x2dv,vFuiiip)
-GO(glProgramUniformMatrix4x2fv,vFuiiip)
-GO(glProgramUniformMatrix4x3dv,vFuiiip)
-GO(glProgramUniformMatrix4x3fv,vFuiiip)
-GO(glUseProgramStages,vFuiu)
-GO(glValidateProgramPipeline,vFu)
+GO(glActiveShaderProgram, vFuu)
+GO(glBindProgramPipeline, vFu)
+GO(glCreateShaderProgramv, uFuip)
+GO(glDeleteProgramPipelines, vFip)
+GO(glGenProgramPipelines, vFip)
+GO(glGetProgramPipelineInfoLog, vFuipp)
+GO(glGetProgramPipelineiv, vFuup)
+GO(glIsProgramPipeline, iFu)
+GO(glProgramUniform1d, vFuid)
+GO(glProgramUniform1dv, vFuiip)
+GO(glProgramUniform1f, vFuif)
+GO(glProgramUniform1fv, vFuiip)
+GO(glProgramUniform1i, vFuii)
+GO(glProgramUniform1iv, vFuiip)
+GO(glProgramUniform1ui, vFuiu)
+GO(glProgramUniform1uiv, vFuiip)
+GO(glProgramUniform2d, vFuidd)
+GO(glProgramUniform2dv, vFuiip)
+GO(glProgramUniform2f, vFuiff)
+GO(glProgramUniform2fv, vFuiip)
+GO(glProgramUniform2i, vFuiii)
+GO(glProgramUniform2iv, vFuiip)
+GO(glProgramUniform2ui, vFuiuu)
+GO(glProgramUniform2uiv, vFuiip)
+GO(glProgramUniform3d, vFuiddd)
+GO(glProgramUniform3dv, vFuiip)
+GO(glProgramUniform3f, vFuifff)
+GO(glProgramUniform3fv, vFuiip)
+GO(glProgramUniform3i, vFuiiii)
+GO(glProgramUniform3iv, vFuiip)
+GO(glProgramUniform3ui, vFuiuuu)
+GO(glProgramUniform3uiv, vFuiip)
+GO(glProgramUniform4d, vFuidddd)
+GO(glProgramUniform4dv, vFuiip)
+GO(glProgramUniform4f, vFuiffff)
+GO(glProgramUniform4fv, vFuiip)
+GO(glProgramUniform4i, vFuiiiii)
+GO(glProgramUniform4iv, vFuiip)
+GO(glProgramUniform4ui, vFuiuuuu)
+GO(glProgramUniform4uiv, vFuiip)
+GO(glProgramUniformMatrix2dv, vFuiiip)
+GO(glProgramUniformMatrix2fv, vFuiiip)
+GO(glProgramUniformMatrix2x3dv, vFuiiip)
+GO(glProgramUniformMatrix2x3fv, vFuiiip)
+GO(glProgramUniformMatrix2x4dv, vFuiiip)
+GO(glProgramUniformMatrix2x4fv, vFuiiip)
+GO(glProgramUniformMatrix3dv, vFuiiip)
+GO(glProgramUniformMatrix3fv, vFuiiip)
+GO(glProgramUniformMatrix3x2dv, vFuiiip)
+GO(glProgramUniformMatrix3x2fv, vFuiiip)
+GO(glProgramUniformMatrix3x4dv, vFuiiip)
+GO(glProgramUniformMatrix3x4fv, vFuiiip)
+GO(glProgramUniformMatrix4dv, vFuiiip)
+GO(glProgramUniformMatrix4fv, vFuiiip)
+GO(glProgramUniformMatrix4x2dv, vFuiiip)
+GO(glProgramUniformMatrix4x2fv, vFuiiip)
+GO(glProgramUniformMatrix4x3dv, vFuiiip)
+GO(glProgramUniformMatrix4x3fv, vFuiiip)
+GO(glUseProgramStages, vFuuu)
+GO(glValidateProgramPipeline, vFu)
//ARB_shader_atomic_counters
-GO(glGetActiveAtomicCounterBufferiv,vFuuup)
+GO(glGetActiveAtomicCounterBufferiv, vFuuup)
//ARB_shader_image_load_store
-GO(glBindImageTexture,vFuuiiiuu)
-GO(glMemoryBarrier,vFi)
+GO(glBindImageTexture, vFuuiCiuu)
+GO(glMemoryBarrier, vFi)
//ARB_shader_objects
-GO(glAttachObjectARB,vFuu)
-GO(glCompileShaderARB,vFu)
-GO(glCreateProgramObjectARB,uFv)
-GO(glCreateShaderObjectARB,uFu)
-GO(glDeleteObjectARB,vFu)
-GO(glDetachObjectARB,vFuu)
-GO(glGetActiveUniformARB,vFuuipppp)
-GO(glGetAttachedObjectsARB,vFuipp)
-GO(glGetHandleARB,uFu)
-GO(glGetInfoLogARB,vFuipp)
-GO(glGetObjectParameterfvARB,vFuup)
-GO(glGetObjectParameterivARB,vFuup)
-GO(glGetShaderSourceARB,vFuipp)
-GO(glGetUniformLocationARB,iFup)
-GO(glGetUniformfvARB,vFuip)
-GO(glGetUniformivARB,vFuip)
-GO(glLinkProgramARB,vFu)
-GO(glShaderSourceARB,vFuipp)
-GO(glUniform1fARB,vFif)
-GO(glUniform1fvARB,vFiip)
-GO(glUniform1iARB,vFii)
-GO(glUniform1ivARB,vFiip)
-GO(glUniform2fARB,vFiff)
-GO(glUniform2fvARB,vFiip)
-GO(glUniform2iARB,vFiii)
-GO(glUniform2ivARB,vFiip)
-GO(glUniform3fARB,vFifff)
-GO(glUniform3fvARB,vFiip)
-GO(glUniform3iARB,vFiiii)
-GO(glUniform3ivARB,vFiip)
-GO(glUniform4fARB,vFiffff)
-GO(glUniform4fvARB,vFiip)
-GO(glUniform4iARB,vFiiiii)
-GO(glUniform4ivARB,vFiip)
-GO(glUniformMatrix2fvARB,vFiiip)
-GO(glUniformMatrix3fvARB,vFiiip)
-GO(glUniformMatrix4fvARB,vFiiip)
-GO(glUseProgramObjectARB,vFu)
-GO(glValidateProgramARB,vFu)
+GO(glAttachObjectARB, vFuu)
+GO(glCompileShaderARB, vFu)
+GO(glCreateProgramObjectARB, uFv)
+GO(glCreateShaderObjectARB, uFu)
+GO(glDeleteObjectARB, vFu)
+GO(glDetachObjectARB, vFuu)
+GO(glGetActiveUniformARB, vFuuipppp)
+GO(glGetAttachedObjectsARB, vFuipp)
+GO(glGetHandleARB, uFu)
+GO(glGetInfoLogARB, vFuipp)
+GO(glGetObjectParameterfvARB, vFuup)
+GO(glGetObjectParameterivARB, vFuup)
+GO(glGetShaderSourceARB, vFuipp)
+GO(glGetUniformLocationARB, iFup)
+GO(glGetUniformfvARB, vFuip)
+GO(glGetUniformivARB, vFuip)
+GO(glLinkProgramARB, vFu)
+GO(glShaderSourceARB, vFuipp)
+GO(glUniform1fARB, vFif)
+GO(glUniform1fvARB, vFiip)
+GO(glUniform1iARB, vFii)
+GO(glUniform1ivARB, vFiip)
+GO(glUniform2fARB, vFiff)
+GO(glUniform2fvARB, vFiip)
+GO(glUniform2iARB, vFiii)
+GO(glUniform2ivARB, vFiip)
+GO(glUniform3fARB, vFifff)
+GO(glUniform3fvARB, vFiip)
+GO(glUniform3iARB, vFiiii)
+GO(glUniform3ivARB, vFiip)
+GO(glUniform4fARB, vFiffff)
+GO(glUniform4fvARB, vFiip)
+GO(glUniform4iARB, vFiiiii)
+GO(glUniform4ivARB, vFiip)
+GO(glUniformMatrix2fvARB, vFiiip)
+GO(glUniformMatrix3fvARB, vFiiip)
+GO(glUniformMatrix4fvARB, vFiiCp)
+GO(glUseProgramObjectARB, vFu)
+GO(glValidateProgramARB, vFu)
//ARB_shader_storage_buffer_object
-GO(glShaderStorageBlockBinding,vFuuu)
+GO(glShaderStorageBlockBinding, vFuuu)
//ARB_shader_subroutine
-GO(glGetActiveSubroutineName,vFuuuipp)
-GO(glGetActiveSubroutineUniformName,vFuuuipp)
-GO(glGetActiveSubroutineUniformiv,vFuuuup)
-GO(glGetProgramStageiv,vFuuup)
-GO(glGetSubroutineIndex,uFuup)
-GO(glGetSubroutineUniformLocation,iFuup)
-GO(glGetUniformSubroutineuiv,vFuip)
-GO(glUniformSubroutinesuiv,vFuip)
+GO(glGetActiveSubroutineName, vFuuuipp)
+GO(glGetActiveSubroutineUniformName, vFuuuipp)
+GO(glGetActiveSubroutineUniformiv, vFuuuup)
+GO(glGetProgramStageiv, vFuuup)
+GO(glGetSubroutineIndex, uFuup)
+GO(glGetSubroutineUniformLocation, iFuup)
+GO(glGetUniformSubroutineuiv, vFuip)
+GO(glUniformSubroutinesuiv, vFuip)
//ARB_shading_language_include
-GO(glCompileShaderIncludeARB,vFuipp)
-GO(glDeleteNamedStringARB,vFip)
-GO(glGetNamedStringARB,vFipipp)
-GO(glGetNamedStringivARB,vFipup)
-GO(glIsNamedStringARB,iFip)
-GO(glNamedStringARB,vFuipip)
+GO(glCompileShaderIncludeARB, vFuipp)
+GO(glDeleteNamedStringARB, vFip)
+GO(glGetNamedStringARB, vFipipp)
+GO(glGetNamedStringivARB, vFipup)
+GO(glIsNamedStringARB, CFip)
+GO(glNamedStringARB, vFuipip)
//ARB_sync
-GO(glClientWaitSync,iFpuU)
-GO(glDeleteSync,vFp)
-GO(glFenceSync,pFiu)
-GO(glGetInteger64v,vFup)
-GO(glGetSynciv,vFpuipp)
-GO(glIsSync,iFp)
-GO(glWaitSync,vFpiu)
+GO(glClientWaitSync, uFpuL)
+GO(glDeleteSync, vFp)
+GO(glFenceSync, pFuu)
+GO(glGetInteger64v, vFup)
+GO(glGetSynciv, vFpuipp)
+GO(glIsSync, CFp)
+GO(glWaitSync, vFpuL)
//ARB_tessellation_shader
-GO(glPatchParameterfv,vFup)
-GO(glPatchParameteri,vFui)
+GO(glPatchParameterfv, vFup)
+GO(glPatchParameteri, vFui)
//ARB_texture_buffer_object
-GO(glTexBufferARB,vFuuu)
+GO(glTexBufferARB, vFuuu)
//ARB_texture_buffer_range
-GO(glTexBufferRange,vFuuuii)
-GO(glTextureBufferRangeEXT,vFuuuuii)
+GO(glTexBufferRange, vFuuull)
+GO(glTextureBufferRangeEXT, vFuuuull)
//ARB_texture_compression
-GO(glCompressedTexImage1DARB,vFuiuiiip)
-GO(glCompressedTexImage2DARB,vFuiuiiiip)
-GO(glCompressedTexImage3DARB,vFuiuiiiiip)
-GO(glCompressedTexSubImage1DARB,vFuiiiuip)
-GO(glCompressedTexSubImage2DARB,vFuiiiiiuip)
-GO(glCompressedTexSubImage3DARB,vFuiiiiiiiuip)
-GO(glGetCompressedTexImageARB,vFuip)
+GO(glCompressedTexImage1DARB, vFuiuiiip)
+GO(glCompressedTexImage2DARB, vFuiuiiiip)
+GO(glCompressedTexImage3DARB, vFuiuiiiiip)
+GO(glCompressedTexSubImage1DARB, vFuiiiuip)
+GO(glCompressedTexSubImage2DARB, vFuiiiiiuip)
+GO(glCompressedTexSubImage3DARB, vFuiiiiiiiuip)
+GO(glGetCompressedTexImageARB, vFuip)
//ARB_texture_multisample
-GO(glGetMultisamplefv,vFuup)
-GO(glSampleMaski,vFui)
-GO(glTexImage2DMultisample,vFuiiiii)
-GO(glTexImage3DMultisample,vFuiiiiii)
+GO(glGetMultisamplefv, vFuup)
+GO(glSampleMaski, vFui)
+GO(glTexImage2DMultisample, vFuiiiii)
+GO(glTexImage3DMultisample, vFuiiiiii)
//ARB_texture_storage
-GO(glTexStorage1D,vFuiui)
-GO(glTexStorage2D,vFuiuii)
-GO(glTexStorage3D,vFuiuiii)
-GO(glTextureStorage1DEXT,vFuuiui)
-GO(glTextureStorage2DEXT,vFuuiuii)
-GO(glTextureStorage3DEXT,vFuuiuiii)
+GO(glTexStorage1D, vFuiui)
+GO(glTexStorage2D, vFuiuii)
+GO(glTexStorage3D, vFuiuiii)
+GO(glTextureStorage1DEXT, vFuuiui)
+GO(glTextureStorage2DEXT, vFuuiuii)
+GO(glTextureStorage3DEXT, vFuuiuiii)
//ARB_texture_storage_multisample
-GO(glTexStorage2DMultisample,vFuiuiii)
-GO(glTexStorage3DMultisample,vFuiuiiii)
-GO(glTextureStorage2DMultisampleEXT,vFuuiuiii)
-GO(glTextureStorage3DMultisampleEXT,vFuuiuiiii)
+GO(glTexStorage2DMultisample, vFuiuiiC)
+GO(glTexStorage3DMultisample, vFuiuiiiC)
+GO(glTextureStorage2DMultisampleEXT, vFuuiuiiC)
+GO(glTextureStorage3DMultisampleEXT, vFuuiuiiiC)
//ARB_texture_view
-GO(glTextureView,vFuuuuuuuu)
+GO(glTextureView, vFuuuuuuuu)
//ARB_timer_query
-GO(glGetQueryObjecti64v,vFuup)
-GO(glGetQueryObjectui64v,vFuup)
-GO(glQueryCounter,vFuu)
+GO(glGetQueryObjecti64v, vFuup)
+GO(glGetQueryObjectui64v, vFuup)
+GO(glQueryCounter, vFuu)
//ARB_transform_feedback2
-GO(glBindTransformFeedback,vFuu)
-GO(glDeleteTransformFeedbacks,vFip)
-GO(glDrawTransformFeedback,vFuu)
-GO(glGenTransformFeedbacks,vFip)
-GO(glIsTransformFeedback,iFu)
-GO(glPauseTransformFeedback,vFv)
-GO(glResumeTransformFeedback,vFv)
+GO(glBindTransformFeedback, vFuu)
+GO(glDeleteTransformFeedbacks, vFip)
+GO(glDrawTransformFeedback, vFuu)
+GO(glGenTransformFeedbacks, vFip)
+GO(glIsTransformFeedback, iFu)
+GO(glPauseTransformFeedback, vFv)
+GO(glResumeTransformFeedback, vFv)
//ARB_transform_feedback3
-GO(glBeginQueryIndexed,vFuuu)
-GO(glDrawTransformFeedbackStream,vFuuu)
-GO(glEndQueryIndexed,vFuu)
-GO(glGetQueryIndexediv,vFuuup)
+GO(glBeginQueryIndexed, vFuuu)
+GO(glDrawTransformFeedbackStream, vFuuu)
+GO(glEndQueryIndexed, vFuu)
+GO(glGetQueryIndexediv, vFuuup)
//ARB_transform_feedback_instanced
-GO(glDrawTransformFeedbackInstanced,vFuui)
-GO(glDrawTransformFeedbackStreamInstanced,vFuuui)
+GO(glDrawTransformFeedbackInstanced, vFuui)
+GO(glDrawTransformFeedbackStreamInstanced, vFuuui)
//ARB_transpose_matrix
-GO(glLoadTransposeMatrixdARB,vFp)
-GO(glLoadTransposeMatrixfARB,vFp)
-GO(glMultTransposeMatrixdARB,vFp)
-GO(glMultTransposeMatrixfARB,vFp)
+GO(glLoadTransposeMatrixdARB, vFp)
+GO(glLoadTransposeMatrixfARB, vFp)
+GO(glMultTransposeMatrixdARB, vFp)
+GO(glMultTransposeMatrixfARB, vFp)
//ARB_uniform_buffer_object
-GO(glGetActiveUniformBlockName,vFuuipp)
-GO(glGetActiveUniformBlockiv,vFuuup)
-GO(glGetActiveUniformName,vFuuipp)
-GO(glGetActiveUniformsiv,vFuipup)
-GO(glGetUniformBlockIndex,uFup)
-GO(glGetUniformIndices,vFuipp)
-GO(glUniformBlockBinding,vFuuu)
+GO(glGetActiveUniformBlockName, vFuuipp)
+GO(glGetActiveUniformBlockiv, vFuuup)
+GO(glGetActiveUniformName, vFuuipp)
+GO(glGetActiveUniformsiv, vFuipup)
+GO(glGetUniformBlockIndex, uFup)
+GO(glGetUniformIndices, vFuipp)
+GO(glUniformBlockBinding, vFuuu)
//ARB_vertex_array_object
-GO(glBindVertexArray,vFu)
-GO(glDeleteVertexArrays,vFip)
-GO(glGenVertexArrays,vFip)
-GO(glIsVertexArray,iFu)
+GO(glBindVertexArray, vFu)
+GO(glDeleteVertexArrays, vFip)
+GO(glGenVertexArrays, vFip)
+GO(glIsVertexArray, iFu)
//ARB_vertex_attrib_64bit
-GO(glGetVertexAttribLdv,vFuup)
-GO(glVertexAttribL1d,vFud)
-GO(glVertexAttribL1dv,vFup)
-GO(glVertexAttribL2d,vFudd)
-GO(glVertexAttribL2dv,vFup)
-GO(glVertexAttribL3d,vFuddd)
-GO(glVertexAttribL3dv,vFup)
-GO(glVertexAttribL4d,vFudddd)
-GO(glVertexAttribL4dv,vFup)
-GO(glVertexAttribLPointer,vFuiuip)
+GO(glGetVertexAttribLdv, vFuup)
+GO(glVertexAttribL1d, vFud)
+GO(glVertexAttribL1dv, vFup)
+GO(glVertexAttribL2d, vFudd)
+GO(glVertexAttribL2dv, vFup)
+GO(glVertexAttribL3d, vFuddd)
+GO(glVertexAttribL3dv, vFup)
+GO(glVertexAttribL4d, vFudddd)
+GO(glVertexAttribL4dv, vFup)
+GO(glVertexAttribLPointer, vFuiuip)
//ARB_vertex_attrib_binding
-GO(glBindVertexBuffer,vFuuii)
-GO(glVertexArrayBindVertexBufferEXT,vFuuuii)
-GO(glVertexArrayVertexAttribBindingEXT,vFuuu)
-GO(glVertexArrayVertexAttribFormatEXT,vFuuiuiu)
-GO(glVertexArrayVertexAttribIFormatEXT,vFuuiuu)
-GO(glVertexArrayVertexAttribLFormatEXT,vFuuiuu)
-GO(glVertexArrayVertexBindingDivisorEXT,vFuuu)
-GO(glVertexAttribBinding,vFuu)
-GO(glVertexAttribFormat,vFuiuiu)
-GO(glVertexAttribIFormat,vFuiuu)
-GO(glVertexAttribLFormat,vFuiuu)
-GO(glVertexBindingDivisor,vFuu)
+GO(glBindVertexBuffer, vFuuli)
+GO(glVertexArrayBindVertexBufferEXT, vFuuuli)
+GO(glVertexArrayVertexAttribBindingEXT, vFuuu)
+GO(glVertexArrayVertexAttribFormatEXT, vFuuiuCu)
+GO(glVertexArrayVertexAttribIFormatEXT, vFuuiuu)
+GO(glVertexArrayVertexAttribLFormatEXT, vFuuiuu)
+GO(glVertexArrayVertexBindingDivisorEXT, vFuuu)
+GO(glVertexAttribBinding, vFuu)
+GO(glVertexAttribFormat, vFuiuCu)
+GO(glVertexAttribIFormat, vFuiuu)
+GO(glVertexAttribLFormat, vFuiuu)
+GO(glVertexBindingDivisor, vFuu)
//ARB_vertex_blend
-GO(glVertexBlendARB,vFi)
-GO(glWeightPointerARB,vFiuip)
-GO(glWeightbvARB,vFip)
-GO(glWeightdvARB,vFip)
-GO(glWeightfvARB,vFip)
-GO(glWeightivARB,vFip)
-GO(glWeightsvARB,vFip)
-GO(glWeightubvARB,vFip)
-GO(glWeightuivARB,vFip)
-GO(glWeightusvARB,vFip)
+GO(glVertexBlendARB, vFi)
+GO(glWeightPointerARB, vFiuip)
+GO(glWeightbvARB, vFip)
+GO(glWeightdvARB, vFip)
+GO(glWeightfvARB, vFip)
+GO(glWeightivARB, vFip)
+GO(glWeightsvARB, vFip)
+GO(glWeightubvARB, vFip)
+GO(glWeightuivARB, vFip)
+GO(glWeightusvARB, vFip)
//ARB_vertex_buffer_object
-GO(glBindBufferARB,vFuu)
-GO(glBufferDataARB,vFuipu)
-GO(glBufferSubDataARB,vFuiip)
-GO(glDeleteBuffersARB,vFip)
-GO(glGenBuffersARB,vFip)
-GO(glGetBufferParameterivARB,vFuup)
-GO(glGetBufferPointervARB,vFuup)
-GO(glGetBufferSubDataARB,vFuiip)
-GO(glIsBufferARB,iFu)
-GO(glMapBufferARB,pFuu)
-GO(glUnmapBufferARB,iFu)
+GO(glBindBufferARB, vFuu)
+GO(glBufferDataARB, vFulpu)
+GO(glBufferSubDataARB, vFullp)
+GO(glDeleteBuffersARB, vFip)
+GO(glGenBuffersARB, vFip)
+GO(glGetBufferParameterivARB, vFuup)
+GO(glGetBufferPointervARB, vFuup)
+GO(glGetBufferSubDataARB, vFullp)
+GO(glIsBufferARB, iFu)
+GO(glMapBufferARB, pFuu)
+GO(glUnmapBufferARB, iFu)
//ARB_vertex_program
-GO(glBindProgramARB,vFuu)
-GO(glDeleteProgramsARB,vFip)
-GO(glDisableVertexAttribArrayARB,vFu)
-GO(glEnableVertexAttribArrayARB,vFu)
-GO(glGenProgramsARB,vFip)
-GO(glGetProgramEnvParameterdvARB,vFuup)
-GO(glGetProgramEnvParameterfvARB,vFuup)
-GO(glGetProgramLocalParameterdvARB,vFuup)
-GO(glGetProgramLocalParameterfvARB,vFuup)
-GO(glGetProgramStringARB,vFuup)
-GO(glGetProgramivARB,vFuup)
-GO(glGetVertexAttribPointervARB,vFuup)
-GO(glGetVertexAttribdvARB,vFuup)
-GO(glGetVertexAttribfvARB,vFuup)
-GO(glGetVertexAttribivARB,vFuup)
-GO(glIsProgramARB,iFu)
-GO(glProgramEnvParameter4dARB,vFuudddd)
-GO(glProgramEnvParameter4dvARB,vFuup)
-GO(glProgramEnvParameter4fARB,vFuuffff)
-GO(glProgramEnvParameter4fvARB,vFuup)
-GO(glProgramLocalParameter4dARB,vFuudddd)
-GO(glProgramLocalParameter4dvARB,vFuup)
-GO(glProgramLocalParameter4fARB,vFuuffff)
-GO(glProgramLocalParameter4fvARB,vFuup)
-GO(glProgramStringARB,vFuuip)
-GO(glVertexAttrib1dARB,vFud)
-GO(glVertexAttrib1dvARB,vFup)
-GO(glVertexAttrib1fARB,vFuf)
-GO(glVertexAttrib1fvARB,vFup)
-GO(glVertexAttrib1sARB,vFui)
-GO(glVertexAttrib1svARB,vFup)
-GO(glVertexAttrib2dARB,vFudd)
-GO(glVertexAttrib2dvARB,vFup)
-GO(glVertexAttrib2fARB,vFuff)
-GO(glVertexAttrib2fvARB,vFup)
-GO(glVertexAttrib2sARB,vFuii)
-GO(glVertexAttrib2svARB,vFup)
-GO(glVertexAttrib3dARB,vFuddd)
-GO(glVertexAttrib3dvARB,vFup)
-GO(glVertexAttrib3fARB,vFufff)
-GO(glVertexAttrib3fvARB,vFup)
-GO(glVertexAttrib3sARB,vFuiii)
-GO(glVertexAttrib3svARB,vFup)
-GO(glVertexAttrib4NbvARB,vFup)
-GO(glVertexAttrib4NivARB,vFup)
-GO(glVertexAttrib4NsvARB,vFup)
-GO(glVertexAttrib4NubARB,vFuuuuu)
-GO(glVertexAttrib4NubvARB,vFup)
-GO(glVertexAttrib4NuivARB,vFup)
-GO(glVertexAttrib4NusvARB,vFup)
-GO(glVertexAttrib4bvARB,vFup)
-GO(glVertexAttrib4dARB,vFudddd)
-GO(glVertexAttrib4dvARB,vFup)
-GO(glVertexAttrib4fARB,vFuffff)
-GO(glVertexAttrib4fvARB,vFup)
-GO(glVertexAttrib4ivARB,vFup)
-GO(glVertexAttrib4sARB,vFuiiii)
-GO(glVertexAttrib4svARB,vFup)
-GO(glVertexAttrib4ubvARB,vFup)
-GO(glVertexAttrib4uivARB,vFup)
-GO(glVertexAttrib4usvARB,vFup)
-GO(glVertexAttribPointerARB,vFuiuiip)
+GO(glBindProgramARB, vFuu)
+GO(glDeleteProgramsARB, vFip)
+GO(glDisableVertexAttribArrayARB, vFu)
+GO(glEnableVertexAttribArrayARB, vFu)
+GO(glGenProgramsARB, vFip)
+GO(glGetProgramEnvParameterdvARB, vFuup)
+GO(glGetProgramEnvParameterfvARB, vFuup)
+GO(glGetProgramLocalParameterdvARB, vFuup)
+GO(glGetProgramLocalParameterfvARB, vFuup)
+GO(glGetProgramStringARB, vFuup)
+GO(glGetProgramivARB, vFuup)
+GO(glGetVertexAttribPointervARB, vFuup)
+GO(glGetVertexAttribdvARB, vFuup)
+GO(glGetVertexAttribfvARB, vFuup)
+GO(glGetVertexAttribivARB, vFuup)
+GO(glIsProgramARB, iFu)
+GO(glProgramEnvParameter4dARB, vFuudddd)
+GO(glProgramEnvParameter4dvARB, vFuup)
+GO(glProgramEnvParameter4fARB, vFuuffff)
+GO(glProgramEnvParameter4fvARB, vFuup)
+GO(glProgramLocalParameter4dARB, vFuudddd)
+GO(glProgramLocalParameter4dvARB, vFuup)
+GO(glProgramLocalParameter4fARB, vFuuffff)
+GO(glProgramLocalParameter4fvARB, vFuup)
+GO(glProgramStringARB, vFuuip)
+GO(glVertexAttrib1dARB, vFud)
+GO(glVertexAttrib1dvARB, vFup)
+GO(glVertexAttrib1fARB, vFuf)
+GO(glVertexAttrib1fvARB, vFup)
+GO(glVertexAttrib1sARB, vFui)
+GO(glVertexAttrib1svARB, vFup)
+GO(glVertexAttrib2dARB, vFudd)
+GO(glVertexAttrib2dvARB, vFup)
+GO(glVertexAttrib2fARB, vFuff)
+GO(glVertexAttrib2fvARB, vFup)
+GO(glVertexAttrib2sARB, vFuii)
+GO(glVertexAttrib2svARB, vFup)
+GO(glVertexAttrib3dARB, vFuddd)
+GO(glVertexAttrib3dvARB, vFup)
+GO(glVertexAttrib3fARB, vFufff)
+GO(glVertexAttrib3fvARB, vFup)
+GO(glVertexAttrib3sARB, vFuiii)
+GO(glVertexAttrib3svARB, vFup)
+GO(glVertexAttrib4NbvARB, vFup)
+GO(glVertexAttrib4NivARB, vFup)
+GO(glVertexAttrib4NsvARB, vFup)
+GO(glVertexAttrib4NubARB, vFuuuuu)
+GO(glVertexAttrib4NubvARB, vFup)
+GO(glVertexAttrib4NuivARB, vFup)
+GO(glVertexAttrib4NusvARB, vFup)
+GO(glVertexAttrib4bvARB, vFup)
+GO(glVertexAttrib4dARB, vFudddd)
+GO(glVertexAttrib4dvARB, vFup)
+GO(glVertexAttrib4fARB, vFuffff)
+GO(glVertexAttrib4fvARB, vFup)
+GO(glVertexAttrib4ivARB, vFup)
+GO(glVertexAttrib4sARB, vFuiiii)
+GO(glVertexAttrib4svARB, vFup)
+GO(glVertexAttrib4ubvARB, vFup)
+GO(glVertexAttrib4uivARB, vFup)
+GO(glVertexAttrib4usvARB, vFup)
+GO(glVertexAttribPointerARB, vFuiuCip)
//ARB_vertex_shader
-GO(glBindAttribLocationARB,vFuup)
-GO(glGetActiveAttribARB,vFuuipppp)
-GO(glGetAttribLocationARB,iFup)
+GO(glBindAttribLocationARB, vFuup)
+GO(glGetActiveAttribARB, vFuuipppp)
+GO(glGetAttribLocationARB, iFup)
//ARB_vertex_type_2_10_10_10_rev
-GO(glColorP3ui,vFuu)
-GO(glColorP3uiv,vFup)
-GO(glColorP4ui,vFuu)
-GO(glColorP4uiv,vFup)
-GO(glMultiTexCoordP1ui,vFuuu)
-GO(glMultiTexCoordP1uiv,vFuup)
-GO(glMultiTexCoordP2ui,vFuuu)
-GO(glMultiTexCoordP2uiv,vFuup)
-GO(glMultiTexCoordP3ui,vFuuu)
-GO(glMultiTexCoordP3uiv,vFuup)
-GO(glMultiTexCoordP4ui,vFuuu)
-GO(glMultiTexCoordP4uiv,vFuup)
-GO(glNormalP3ui,vFuu)
-GO(glNormalP3uiv,vFup)
-GO(glSecondaryColorP3ui,vFuu)
-GO(glSecondaryColorP3uiv,vFup)
-GO(glTexCoordP1ui,vFuu)
-GO(glTexCoordP1uiv,vFup)
-GO(glTexCoordP2ui,vFuu)
-GO(glTexCoordP2uiv,vFup)
-GO(glTexCoordP3ui,vFuu)
-GO(glTexCoordP3uiv,vFup)
-GO(glTexCoordP4ui,vFuu)
-GO(glTexCoordP4uiv,vFup)
-GO(glVertexAttribP1ui,vFuuiu)
-GO(glVertexAttribP1uiv,vFuuip)
-GO(glVertexAttribP2ui,vFuuiu)
-GO(glVertexAttribP2uiv,vFuuip)
-GO(glVertexAttribP3ui,vFuuiu)
-GO(glVertexAttribP3uiv,vFuuip)
-GO(glVertexAttribP4ui,vFuuiu)
-GO(glVertexAttribP4uiv,vFuuip)
-GO(glVertexP2ui,vFuu)
-GO(glVertexP2uiv,vFup)
-GO(glVertexP3ui,vFuu)
-GO(glVertexP3uiv,vFup)
-GO(glVertexP4ui,vFuu)
-GO(glVertexP4uiv,vFup)
+GO(glColorP3ui, vFuu)
+GO(glColorP3uiv, vFup)
+GO(glColorP4ui, vFuu)
+GO(glColorP4uiv, vFup)
+GO(glMultiTexCoordP1ui, vFuuu)
+GO(glMultiTexCoordP1uiv, vFuup)
+GO(glMultiTexCoordP2ui, vFuuu)
+GO(glMultiTexCoordP2uiv, vFuup)
+GO(glMultiTexCoordP3ui, vFuuu)
+GO(glMultiTexCoordP3uiv, vFuup)
+GO(glMultiTexCoordP4ui, vFuuu)
+GO(glMultiTexCoordP4uiv, vFuup)
+GO(glNormalP3ui, vFuu)
+GO(glNormalP3uiv, vFup)
+GO(glSecondaryColorP3ui, vFuu)
+GO(glSecondaryColorP3uiv, vFup)
+GO(glTexCoordP1ui, vFuu)
+GO(glTexCoordP1uiv, vFup)
+GO(glTexCoordP2ui, vFuu)
+GO(glTexCoordP2uiv, vFup)
+GO(glTexCoordP3ui, vFuu)
+GO(glTexCoordP3uiv, vFup)
+GO(glTexCoordP4ui, vFuu)
+GO(glTexCoordP4uiv, vFup)
+GO(glVertexAttribP1ui, vFuuiu)
+GO(glVertexAttribP1uiv, vFuuip)
+GO(glVertexAttribP2ui, vFuuiu)
+GO(glVertexAttribP2uiv, vFuuip)
+GO(glVertexAttribP3ui, vFuuiu)
+GO(glVertexAttribP3uiv, vFuuip)
+GO(glVertexAttribP4ui, vFuuCu)
+GO(glVertexAttribP4uiv, vFuuCp)
+GO(glVertexP2ui, vFuu)
+GO(glVertexP2uiv, vFup)
+GO(glVertexP3ui, vFuu)
+GO(glVertexP3uiv, vFup)
+GO(glVertexP4ui, vFuu)
+GO(glVertexP4uiv, vFup)
//ARB_viewport_array
-GO(glDepthRangeArrayv,vFuip)
-GO(glDepthRangeIndexed,vFudd)
-GO(glGetDoublei_v,vFuup)
-GO(glGetFloati_v,vFuup)
-GO(glScissorArrayv,vFuip)
-GO(glScissorIndexed,vFuiiii)
-GO(glScissorIndexedv,vFup)
-GO(glViewportArrayv,vFuip)
-GO(glViewportIndexedf,vFuffff)
-GO(glViewportIndexedfv,vFup)
+GO(glDepthRangeArrayv, vFuip)
+GO(glDepthRangeIndexed, vFudd)
+GO(glGetDoublei_v, vFuup)
+GO(glGetFloati_v, vFuup)
+GO(glScissorArrayv, vFuip)
+GO(glScissorIndexed, vFuiiii)
+GO(glScissorIndexedv, vFup)
+GO(glViewportArrayv, vFuip)
+GO(glViewportIndexedf, vFuffff)
+GO(glViewportIndexedfv, vFup)
//ARB_window_pos
-GO(glWindowPos2dARB,vFdd)
-GO(glWindowPos2dvARB,vFp)
-GO(glWindowPos2fARB,vFff)
-GO(glWindowPos2fvARB,vFp)
-GO(glWindowPos2iARB,vFii)
-GO(glWindowPos2ivARB,vFp)
-GO(glWindowPos2sARB,vFii)
-GO(glWindowPos2svARB,vFp)
-GO(glWindowPos3dARB,vFddd)
-GO(glWindowPos3dvARB,vFp)
-GO(glWindowPos3fARB,vFfff)
-GO(glWindowPos3fvARB,vFp)
-GO(glWindowPos3iARB,vFiii)
-GO(glWindowPos3ivARB,vFp)
-GO(glWindowPos3sARB,vFiii)
-GO(glWindowPos3svARB,vFp)
+GO(glWindowPos2dARB, vFdd)
+GO(glWindowPos2dvARB, vFp)
+GO(glWindowPos2fARB, vFff)
+GO(glWindowPos2fvARB, vFp)
+GO(glWindowPos2iARB, vFii)
+GO(glWindowPos2ivARB, vFp)
+GO(glWindowPos2sARB, vFii)
+GO(glWindowPos2svARB, vFp)
+GO(glWindowPos3dARB, vFddd)
+GO(glWindowPos3dvARB, vFp)
+GO(glWindowPos3fARB, vFfff)
+GO(glWindowPos3fvARB, vFp)
+GO(glWindowPos3iARB, vFiii)
+GO(glWindowPos3ivARB, vFp)
+GO(glWindowPos3sARB, vFiii)
+GO(glWindowPos3svARB, vFp)
//ATI_draw_buffers
-GO(glDrawBuffersATI,vFip)
+GO(glDrawBuffersATI, vFip)
//ATI_element_array
-GO(glDrawElementArrayATI,vFui)
-GO(glDrawRangeElementArrayATI,vFuuui)
-GO(glElementPointerATI,vFup)
+GO(glDrawElementArrayATI, vFui)
+GO(glDrawRangeElementArrayATI, vFuuui)
+GO(glElementPointerATI, vFup)
//ATI_envmap_bumpmap
-GO(glGetTexBumpParameterfvATI,vFup)
-GO(glGetTexBumpParameterivATI,vFup)
-GO(glTexBumpParameterfvATI,vFup)
-GO(glTexBumpParameterivATI,vFup)
+GO(glGetTexBumpParameterfvATI, vFup)
+GO(glGetTexBumpParameterivATI, vFup)
+GO(glTexBumpParameterfvATI, vFup)
+GO(glTexBumpParameterivATI, vFup)
//ATI_fragment_shader
-GO(glAlphaFragmentOp1ATI,vFuuuuuu)
-GO(glAlphaFragmentOp2ATI,vFuuuuuuuuu)
-GO(glAlphaFragmentOp3ATI,vFuuuuuuuuuuuu)
-GO(glBeginFragmentShaderATI,vFv)
-GO(glBindFragmentShaderATI,vFu)
-GO(glColorFragmentOp1ATI,vFuuuuuuu)
-GO(glColorFragmentOp2ATI,vFuuuuuuuuuu)
-GO(glColorFragmentOp3ATI,vFuuuuuuuuuuuuu)
-GO(glDeleteFragmentShaderATI,vFu)
-GO(glEndFragmentShaderATI,vFv)
-GO(glGenFragmentShadersATI,uFu)
-GO(glPassTexCoordATI,vFuuu)
-GO(glSampleMapATI,vFuuu)
-GO(glSetFragmentShaderConstantATI,vFup)
+GO(glAlphaFragmentOp1ATI, vFuuuuuu)
+GO(glAlphaFragmentOp2ATI, vFuuuuuuuuu)
+GO(glAlphaFragmentOp3ATI, vFuuuuuuuuuuuu)
+GO(glBeginFragmentShaderATI, vFv)
+GO(glBindFragmentShaderATI, vFu)
+GO(glColorFragmentOp1ATI, vFuuuuuuu)
+GO(glColorFragmentOp2ATI, vFuuuuuuuuuu)
+GO(glColorFragmentOp3ATI, vFuuuuuuuuuuuuu)
+GO(glDeleteFragmentShaderATI, vFu)
+GO(glEndFragmentShaderATI, vFv)
+GO(glGenFragmentShadersATI, uFu)
+GO(glPassTexCoordATI, vFuuu)
+GO(glSampleMapATI, vFuuu)
+GO(glSetFragmentShaderConstantATI, vFup)
//ATI_map_object_buffer
-GO(glMapObjectBufferATI,pFu)
-GO(glUnmapObjectBufferATI,vFu)
+GO(glMapObjectBufferATI, pFu)
+GO(glUnmapObjectBufferATI, vFu)
//ATI_pn_triangles
-GO(glPNTrianglesfATI,vFuf)
-GO(glPNTrianglesiATI,vFui)
+GO(glPNTrianglesfATI, vFuf)
+GO(glPNTrianglesiATI, vFui)
//ATI_separate_stencil
-GO(glStencilFuncSeparateATI,vFuuiu)
-GO(glStencilOpSeparateATI,vFuuuu)
+GO(glStencilFuncSeparateATI, vFuuiu)
+GO(glStencilOpSeparateATI, vFuuuu)
//ATI_vertex_array_object
-GO(glArrayObjectATI,vFuiuiuu)
-GO(glFreeObjectBufferATI,vFu)
-GO(glGetArrayObjectfvATI,vFuup)
-GO(glGetArrayObjectivATI,vFuup)
-GO(glGetObjectBufferfvATI,vFuup)
-GO(glGetObjectBufferivATI,vFuup)
-GO(glGetVariantArrayObjectfvATI,vFuup)
-GO(glGetVariantArrayObjectivATI,vFuup)
-GO(glIsObjectBufferATI,iFu)
-GO(glNewObjectBufferATI,uFipu)
-GO(glUpdateObjectBufferATI,vFuuipu)
-GO(glVariantArrayObjectATI,vFuuiuu)
+GO(glArrayObjectATI, vFuiuiuu)
+GO(glFreeObjectBufferATI, vFu)
+GO(glGetArrayObjectfvATI, vFuup)
+GO(glGetArrayObjectivATI, vFuup)
+GO(glGetObjectBufferfvATI, vFuup)
+GO(glGetObjectBufferivATI, vFuup)
+GO(glGetVariantArrayObjectfvATI, vFuup)
+GO(glGetVariantArrayObjectivATI, vFuup)
+GO(glIsObjectBufferATI, iFu)
+GO(glNewObjectBufferATI, uFipu)
+GO(glUpdateObjectBufferATI, vFuuipu)
+GO(glVariantArrayObjectATI, vFuuiuu)
//ATI_vertex_attrib_array_object
-GO(glGetVertexAttribArrayObjectfvATI,vFuup)
-GO(glGetVertexAttribArrayObjectivATI,vFuup)
-GO(glVertexAttribArrayObjectATI,vFuiuiiuu)
+GO(glGetVertexAttribArrayObjectfvATI, vFuup)
+GO(glGetVertexAttribArrayObjectivATI, vFuup)
+GO(glVertexAttribArrayObjectATI, vFuiuCiuu)
//ATI_vertex_streams
-GO(glClientActiveVertexStreamATI,vFu)
-GO(glNormalStream3bATI,vFuiii)
-GO(glNormalStream3bvATI,vFup)
-GO(glNormalStream3dATI,vFuddd)
-GO(glNormalStream3dvATI,vFup)
-GO(glNormalStream3fATI,vFufff)
-GO(glNormalStream3fvATI,vFup)
-GO(glNormalStream3iATI,vFuiii)
-GO(glNormalStream3ivATI,vFup)
-GO(glNormalStream3sATI,vFuiii)
-GO(glNormalStream3svATI,vFup)
-GO(glVertexBlendEnvfATI,vFuf)
-GO(glVertexBlendEnviATI,vFui)
-GO(glVertexStream1dATI,vFud)
-GO(glVertexStream1dvATI,vFup)
-GO(glVertexStream1fATI,vFuf)
-GO(glVertexStream1fvATI,vFup)
-GO(glVertexStream1iATI,vFui)
-GO(glVertexStream1ivATI,vFup)
-GO(glVertexStream1sATI,vFui)
-GO(glVertexStream1svATI,vFup)
-GO(glVertexStream2dATI,vFudd)
-GO(glVertexStream2dvATI,vFup)
-GO(glVertexStream2fATI,vFuff)
-GO(glVertexStream2fvATI,vFup)
-GO(glVertexStream2iATI,vFuii)
-GO(glVertexStream2ivATI,vFup)
-GO(glVertexStream2sATI,vFuii)
-GO(glVertexStream2svATI,vFup)
-GO(glVertexStream3dATI,vFuddd)
-GO(glVertexStream3dvATI,vFup)
-GO(glVertexStream3fATI,vFufff)
-GO(glVertexStream3fvATI,vFup)
-GO(glVertexStream3iATI,vFuiii)
-GO(glVertexStream3ivATI,vFup)
-GO(glVertexStream3sATI,vFuiii)
-GO(glVertexStream3svATI,vFup)
-GO(glVertexStream4dATI,vFudddd)
-GO(glVertexStream4dvATI,vFup)
-GO(glVertexStream4fATI,vFuffff)
-GO(glVertexStream4fvATI,vFup)
-GO(glVertexStream4iATI,vFuiiii)
-GO(glVertexStream4ivATI,vFup)
-GO(glVertexStream4sATI,vFuiiii)
-GO(glVertexStream4svATI,vFup)
+GO(glClientActiveVertexStreamATI, vFu)
+GO(glNormalStream3bATI, vFuccc)
+GO(glNormalStream3bvATI, vFup)
+GO(glNormalStream3dATI, vFuddd)
+GO(glNormalStream3dvATI, vFup)
+GO(glNormalStream3fATI, vFufff)
+GO(glNormalStream3fvATI, vFup)
+GO(glNormalStream3iATI, vFuiii)
+GO(glNormalStream3ivATI, vFup)
+GO(glNormalStream3sATI, vFuwww)
+GO(glNormalStream3svATI, vFup)
+GO(glVertexBlendEnvfATI, vFuf)
+GO(glVertexBlendEnviATI, vFui)
+GO(glVertexStream1dATI, vFud)
+GO(glVertexStream1dvATI, vFup)
+GO(glVertexStream1fATI, vFuf)
+GO(glVertexStream1fvATI, vFup)
+GO(glVertexStream1iATI, vFui)
+GO(glVertexStream1ivATI, vFup)
+GO(glVertexStream1sATI, vFuw)
+GO(glVertexStream1svATI, vFup)
+GO(glVertexStream2dATI, vFudd)
+GO(glVertexStream2dvATI, vFup)
+GO(glVertexStream2fATI, vFuff)
+GO(glVertexStream2fvATI, vFup)
+GO(glVertexStream2iATI, vFuii)
+GO(glVertexStream2ivATI, vFup)
+GO(glVertexStream2sATI, vFuww)
+GO(glVertexStream2svATI, vFup)
+GO(glVertexStream3dATI, vFuddd)
+GO(glVertexStream3dvATI, vFup)
+GO(glVertexStream3fATI, vFufff)
+GO(glVertexStream3fvATI, vFup)
+GO(glVertexStream3iATI, vFuiii)
+GO(glVertexStream3ivATI, vFup)
+GO(glVertexStream3sATI, vFuiii)
+GO(glVertexStream3svATI, vFup)
+GO(glVertexStream4dATI, vFudddd)
+GO(glVertexStream4dvATI, vFup)
+GO(glVertexStream4fATI, vFuffff)
+GO(glVertexStream4fvATI, vFup)
+GO(glVertexStream4iATI, vFuiiii)
+GO(glVertexStream4ivATI, vFup)
+GO(glVertexStream4sATI, vFuwwww)
+GO(glVertexStream4svATI, vFup)
//EXT_bindable_uniform
-GO(glGetUniformBufferSizeEXT,iFui)
-GO(glGetUniformOffsetEXT,iFui)
-GO(glUniformBufferEXT,vFuiu)
+GO(glGetUniformBufferSizeEXT, iFui)
+GO(glGetUniformOffsetEXT, lFui)
+GO(glUniformBufferEXT, vFuiu)
//EXT_blend_color
-GO(glBlendColorEXT,vFffff)
+GO(glBlendColorEXT, vFffff)
//EXT_blend_equation_separate
-GO(glBlendEquationSeparateEXT,vFuu)
+GO(glBlendEquationSeparateEXT, vFuu)
//EXT_blend_func_separate
-GO(glBlendFuncSeparateEXT,vFuuuu)
+GO(glBlendFuncSeparateEXT, vFuuuu)
//EXT_blend_minmax
-GO(glBlendEquationEXT,vFu)
+GO(glBlendEquationEXT, vFu)
//EXT_color_subtable
-GO(glColorSubTableEXT,vFuiiuup)
-GO(glCopyColorSubTableEXT,vFuiiii)
+GO(glColorSubTableEXT, vFuiiuup)
+GO(glCopyColorSubTableEXT, vFuiiii)
//EXT_compiled_vertex_array
-GO(glLockArraysEXT,vFii)
-GO(glUnlockArraysEXT,vFv)
+GO(glLockArraysEXT, vFii)
+GO(glUnlockArraysEXT, vFv)
//EXT_convolution
-GO(glConvolutionFilter1DEXT,vFuuiuup)
-GO(glConvolutionFilter2DEXT,vFuuiiuup)
-GO(glConvolutionParameterfEXT,vFuuf)
-GO(glConvolutionParameterfvEXT,vFuup)
-GO(glConvolutionParameteriEXT,vFuui)
-GO(glConvolutionParameterivEXT,vFuup)
-GO(glCopyConvolutionFilter1DEXT,vFuuiii)
-GO(glCopyConvolutionFilter2DEXT,vFuuiiii)
-GO(glGetConvolutionFilterEXT,vFuuup)
-GO(glGetConvolutionParameterfvEXT,vFuup)
-GO(glGetConvolutionParameterivEXT,vFuup)
-GO(glGetSeparableFilterEXT,vFuuuppp)
-GO(glSeparableFilter2DEXT,vFuuiiuupp)
+GO(glConvolutionFilter1DEXT, vFuuiuup)
+GO(glConvolutionFilter2DEXT, vFuuiiuup)
+GO(glConvolutionParameterfEXT, vFuuf)
+GO(glConvolutionParameterfvEXT, vFuup)
+GO(glConvolutionParameteriEXT, vFuui)
+GO(glConvolutionParameterivEXT, vFuup)
+GO(glCopyConvolutionFilter1DEXT, vFuuiii)
+GO(glCopyConvolutionFilter2DEXT, vFuuiiii)
+GO(glGetConvolutionFilterEXT, vFuuup)
+GO(glGetConvolutionParameterfvEXT, vFuup)
+GO(glGetConvolutionParameterivEXT, vFuup)
+GO(glGetSeparableFilterEXT, vFuuuppp)
+GO(glSeparableFilter2DEXT, vFuuiiuupp)
//EXT_coordinate_frame
-GO(glBinormal3bEXT,vFiii)
-GO(glBinormal3bvEXT,vFp)
-GO(glBinormal3dEXT,vFddd)
-GO(glBinormal3dvEXT,vFp)
-GO(glBinormal3fEXT,vFfff)
-GO(glBinormal3fvEXT,vFp)
-GO(glBinormal3iEXT,vFiii)
-GO(glBinormal3ivEXT,vFp)
-GO(glBinormal3sEXT,vFiii)
-GO(glBinormal3svEXT,vFp)
-GO(glBinormalPointerEXT,vFuip)
-GO(glTangent3bEXT,vFiii)
-GO(glTangent3bvEXT,vFp)
-GO(glTangent3dEXT,vFddd)
-GO(glTangent3dvEXT,vFp)
-GO(glTangent3fEXT,vFfff)
-GO(glTangent3fvEXT,vFp)
-GO(glTangent3iEXT,vFiii)
-GO(glTangent3ivEXT,vFp)
-GO(glTangent3sEXT,vFiii)
-GO(glTangent3svEXT,vFp)
-GO(glTangentPointerEXT,vFuip)
+GO(glBinormal3bEXT, vFiii)
+GO(glBinormal3bvEXT, vFp)
+GO(glBinormal3dEXT, vFddd)
+GO(glBinormal3dvEXT, vFp)
+GO(glBinormal3fEXT, vFfff)
+GO(glBinormal3fvEXT, vFp)
+GO(glBinormal3iEXT, vFiii)
+GO(glBinormal3ivEXT, vFp)
+GO(glBinormal3sEXT, vFiii)
+GO(glBinormal3svEXT, vFp)
+GO(glBinormalPointerEXT, vFuip)
+GO(glTangent3bEXT, vFiii)
+GO(glTangent3bvEXT, vFp)
+GO(glTangent3dEXT, vFddd)
+GO(glTangent3dvEXT, vFp)
+GO(glTangent3fEXT, vFfff)
+GO(glTangent3fvEXT, vFp)
+GO(glTangent3iEXT, vFiii)
+GO(glTangent3ivEXT, vFp)
+GO(glTangent3sEXT, vFiii)
+GO(glTangent3svEXT, vFp)
+GO(glTangentPointerEXT, vFuip)
//EXT_copy_texture
-GO(glCopyTexImage1DEXT,vFuiuiiii)
-GO(glCopyTexImage2DEXT,vFuiuiiiii)
-GO(glCopyTexSubImage1DEXT,vFuiiiii)
-GO(glCopyTexSubImage2DEXT,vFuiiiiiii)
-GO(glCopyTexSubImage3DEXT,vFuiiiiiiii)
+GO(glCopyTexImage1DEXT, vFuiuiiii)
+GO(glCopyTexImage2DEXT, vFuiuiiiii)
+GO(glCopyTexSubImage1DEXT, vFuiiiii)
+GO(glCopyTexSubImage2DEXT, vFuiiiiiii)
+GO(glCopyTexSubImage3DEXT, vFuiiiiiiii)
//EXT_cull_vertex
-GO(glCullParameterdvEXT,vFup)
-GO(glCullParameterfvEXT,vFup)
+GO(glCullParameterdvEXT, vFup)
+GO(glCullParameterfvEXT, vFup)
//EXT_depth_bounds_test
-GO(glDepthBoundsEXT,vFdd)
+GO(glDepthBoundsEXT, vFdd)
//EXT_direct_state_access
-GO(glBindMultiTextureEXT,vFuuu)
-GO(glCheckNamedFramebufferStatusEXT,uFuu)
-GO(glClientAttribDefaultEXT,vFi)
-GO(glCompressedMultiTexImage1DEXT,vFuuiuiiip)
-GO(glCompressedMultiTexImage2DEXT,vFuuiuiiiip)
-GO(glCompressedMultiTexImage3DEXT,vFuuiuiiiiip)
-GO(glCompressedMultiTexSubImage1DEXT,vFuuiiiuip)
-GO(glCompressedMultiTexSubImage2DEXT,vFuuiiiiiuip)
-GO(glCompressedMultiTexSubImage3DEXT,vFuuiiiiiiiuip)
-GO(glCompressedTextureImage1DEXT,vFuuiuiiip)
-GO(glCompressedTextureImage2DEXT,vFuuiuiiiip)
-GO(glCompressedTextureImage3DEXT,vFuuiuiiiiip)
-GO(glCompressedTextureSubImage1DEXT,vFuuiiiuip)
-GO(glCompressedTextureSubImage2DEXT,vFuuiiiiiuip)
-GO(glCompressedTextureSubImage3DEXT,vFuuiiiiiiiuip)
-GO(glCopyMultiTexImage1DEXT,vFuuiuiiii)
-GO(glCopyMultiTexImage2DEXT,vFuuiuiiiii)
-GO(glCopyMultiTexSubImage1DEXT,vFuuiiiii)
-GO(glCopyMultiTexSubImage2DEXT,vFuuiiiiiii)
-GO(glCopyMultiTexSubImage3DEXT,vFuuiiiiiiii)
-GO(glCopyTextureImage1DEXT,vFuuiuiiii)
-GO(glCopyTextureImage2DEXT,vFuuiuiiiii)
-GO(glCopyTextureSubImage1DEXT,vFuuiiiii)
-GO(glCopyTextureSubImage2DEXT,vFuuiiiiiii)
-GO(glCopyTextureSubImage3DEXT,vFuuiiiiiiii)
-GO(glDisableClientStateIndexedEXT,vFuu)
-GO(glDisableClientStateiEXT,vFuu)
-GO(glDisableVertexArrayAttribEXT,vFuu)
-GO(glDisableVertexArrayEXT,vFuu)
-GO(glEnableClientStateIndexedEXT,vFuu)
-GO(glEnableClientStateiEXT,vFuu)
-GO(glEnableVertexArrayAttribEXT,vFuu)
-GO(glEnableVertexArrayEXT,vFuu)
-GO(glFlushMappedNamedBufferRangeEXT,vFuii)
-GO(glFramebufferDrawBufferEXT,vFuu)
-GO(glFramebufferDrawBuffersEXT,vFuip)
-GO(glFramebufferReadBufferEXT,vFuu)
-GO(glGenerateMultiTexMipmapEXT,vFuu)
-GO(glGenerateTextureMipmapEXT,vFuu)
-GO(glGetCompressedMultiTexImageEXT,vFuuip)
-GO(glGetCompressedTextureImageEXT,vFuuip)
-GO(glGetDoubleIndexedvEXT,vFuup)
-GO(glGetDoublei_vEXT,vFuup)
-GO(glGetFloatIndexedvEXT,vFuup)
-GO(glGetFloati_vEXT,vFuup)
-GO(glGetFramebufferParameterivEXT,vFuup)
-GO(glGetMultiTexEnvfvEXT,vFuuup)
-GO(glGetMultiTexEnvivEXT,vFuuup)
-GO(glGetMultiTexGendvEXT,vFuuup)
-GO(glGetMultiTexGenfvEXT,vFuuup)
-GO(glGetMultiTexGenivEXT,vFuuup)
-GO(glGetMultiTexImageEXT,vFuuiuup)
-GO(glGetMultiTexLevelParameterfvEXT,vFuuiup)
-GO(glGetMultiTexLevelParameterivEXT,vFuuiup)
-GO(glGetMultiTexParameterIivEXT,vFuuup)
-GO(glGetMultiTexParameterIuivEXT,vFuuup)
-GO(glGetMultiTexParameterfvEXT,vFuuup)
-GO(glGetMultiTexParameterivEXT,vFuuup)
-GO(glGetNamedBufferParameterivEXT,vFuup)
-GO(glGetNamedBufferPointervEXT,vFuup)
-GO(glGetNamedBufferSubDataEXT,vFuiip)
-GO(glGetNamedFramebufferAttachmentParameterivEXT,vFuuup)
-GO(glGetNamedProgramLocalParameterIivEXT,vFuuup)
-GO(glGetNamedProgramLocalParameterIuivEXT,vFuuup)
-GO(glGetNamedProgramLocalParameterdvEXT,vFuuup)
-GO(glGetNamedProgramLocalParameterfvEXT,vFuuup)
-GO(glGetNamedProgramStringEXT,vFuuup)
-GO(glGetNamedProgramivEXT,vFuuup)
-GO(glGetNamedRenderbufferParameterivEXT,vFuup)
-GO(glGetPointerIndexedvEXT,vFuup)
-GO(glGetPointeri_vEXT,vFuup)
-GO(glGetTextureImageEXT,vFuuiuup)
-GO(glGetTextureLevelParameterfvEXT,vFuuiup)
-GO(glGetTextureLevelParameterivEXT,vFuuiup)
-GO(glGetTextureParameterIivEXT,vFuuup)
-GO(glGetTextureParameterIuivEXT,vFuuup)
-GO(glGetTextureParameterfvEXT,vFuuup)
-GO(glGetTextureParameterivEXT,vFuuup)
-GO(glGetVertexArrayIntegeri_vEXT,vFuuup)
-GO(glGetVertexArrayIntegervEXT,vFuup)
-GO(glGetVertexArrayPointeri_vEXT,vFuuup)
-GO(glGetVertexArrayPointervEXT,vFuup)
-GO(glMapNamedBufferEXT,pFuu)
-GO(glMapNamedBufferRangeEXT,pFuiii)
-GO(glMatrixFrustumEXT,vFudddddd)
-GO(glMatrixLoadIdentityEXT,vFu)
-GO(glMatrixLoadTransposedEXT,vFup)
-GO(glMatrixLoadTransposefEXT,vFup)
-GO(glMatrixLoaddEXT,vFup)
-GO(glMatrixLoadfEXT,vFup)
-GO(glMatrixMultTransposedEXT,vFup)
-GO(glMatrixMultTransposefEXT,vFup)
-GO(glMatrixMultdEXT,vFup)
-GO(glMatrixMultfEXT,vFup)
-GO(glMatrixOrthoEXT,vFudddddd)
-GO(glMatrixPopEXT,vFu)
-GO(glMatrixPushEXT,vFu)
-GO(glMatrixRotatedEXT,vFudddd)
-GO(glMatrixRotatefEXT,vFuffff)
-GO(glMatrixScaledEXT,vFuddd)
-GO(glMatrixScalefEXT,vFufff)
-GO(glMatrixTranslatedEXT,vFuddd)
-GO(glMatrixTranslatefEXT,vFufff)
-GO(glMultiTexBufferEXT,vFuuuu)
-GO(glMultiTexCoordPointerEXT,vFuiuip)
-GO(glMultiTexEnvfEXT,vFuuuf)
-GO(glMultiTexEnvfvEXT,vFuuup)
-GO(glMultiTexEnviEXT,vFuuui)
-GO(glMultiTexEnvivEXT,vFuuup)
-GO(glMultiTexGendEXT,vFuuud)
-GO(glMultiTexGendvEXT,vFuuup)
-GO(glMultiTexGenfEXT,vFuuuf)
-GO(glMultiTexGenfvEXT,vFuuup)
-GO(glMultiTexGeniEXT,vFuuui)
-GO(glMultiTexGenivEXT,vFuuup)
-GO(glMultiTexImage1DEXT,vFuuiuiiuup)
-GO(glMultiTexImage2DEXT,vFuuiuiiiuup)
-GO(glMultiTexImage3DEXT,vFuuiuiiiiuup)
-GO(glMultiTexParameterIivEXT,vFuuup)
-GO(glMultiTexParameterIuivEXT,vFuuup)
-GO(glMultiTexParameterfEXT,vFuuuf)
-GO(glMultiTexParameterfvEXT,vFuuup)
-GO(glMultiTexParameteriEXT,vFuuui)
-GO(glMultiTexParameterivEXT,vFuuup)
-GO(glMultiTexRenderbufferEXT,vFuuu)
-GO(glMultiTexSubImage1DEXT,vFuuiiiuup)
-GO(glMultiTexSubImage2DEXT,vFuuiiiiiuup)
-GO(glMultiTexSubImage3DEXT,vFuuiiiiiiiuup)
-GO(glNamedBufferDataEXT,vFuipu)
-GO(glNamedBufferSubDataEXT,vFuiip)
-GO(glNamedCopyBufferSubDataEXT,vFuuiii)
-GO(glNamedFramebufferRenderbufferEXT,vFuuuu)
-GO(glNamedFramebufferTexture1DEXT,vFuuuui)
-GO(glNamedFramebufferTexture2DEXT,vFuuuui)
-GO(glNamedFramebufferTexture3DEXT,vFuuuuii)
-GO(glNamedFramebufferTextureEXT,vFuuui)
-GO(glNamedFramebufferTextureFaceEXT,vFuuuiu)
-GO(glNamedFramebufferTextureLayerEXT,vFuuuii)
-GO(glNamedProgramLocalParameter4dEXT,vFuuudddd)
-GO(glNamedProgramLocalParameter4dvEXT,vFuuup)
-GO(glNamedProgramLocalParameter4fEXT,vFuuuffff)
-GO(glNamedProgramLocalParameter4fvEXT,vFuuup)
-GO(glNamedProgramLocalParameterI4iEXT,vFuuuiiii)
-GO(glNamedProgramLocalParameterI4ivEXT,vFuuup)
-GO(glNamedProgramLocalParameterI4uiEXT,vFuuuuuuu)
-GO(glNamedProgramLocalParameterI4uivEXT,vFuuup)
-GO(glNamedProgramLocalParameters4fvEXT,vFuuuip)
-GO(glNamedProgramLocalParametersI4ivEXT,vFuuuip)
-GO(glNamedProgramLocalParametersI4uivEXT,vFuuuip)
-GO(glNamedProgramStringEXT,vFuuuip)
-GO(glNamedRenderbufferStorageEXT,vFuuii)
-GO(glNamedRenderbufferStorageMultisampleCoverageEXT,vFuiiuii)
-GO(glNamedRenderbufferStorageMultisampleEXT,vFuiuii)
-GO(glProgramUniform1dEXT,vFuid)
-GO(glProgramUniform1dvEXT,vFuiip)
-GO(glProgramUniform1fEXT,vFuif)
-GO(glProgramUniform1fvEXT,vFuiip)
-GO(glProgramUniform1iEXT,vFuii)
-GO(glProgramUniform1ivEXT,vFuiip)
-GO(glProgramUniform1uiEXT,vFuiu)
-GO(glProgramUniform1uivEXT,vFuiip)
-GO(glProgramUniform2dEXT,vFuidd)
-GO(glProgramUniform2dvEXT,vFuiip)
-GO(glProgramUniform2fEXT,vFuiff)
-GO(glProgramUniform2fvEXT,vFuiip)
-GO(glProgramUniform2iEXT,vFuiii)
-GO(glProgramUniform2ivEXT,vFuiip)
-GO(glProgramUniform2uiEXT,vFuiuu)
-GO(glProgramUniform2uivEXT,vFuiip)
-GO(glProgramUniform3dEXT,vFuiddd)
-GO(glProgramUniform3dvEXT,vFuiip)
-GO(glProgramUniform3fEXT,vFuifff)
-GO(glProgramUniform3fvEXT,vFuiip)
-GO(glProgramUniform3iEXT,vFuiiii)
-GO(glProgramUniform3ivEXT,vFuiip)
-GO(glProgramUniform3uiEXT,vFuiuuu)
-GO(glProgramUniform3uivEXT,vFuiip)
-GO(glProgramUniform4dEXT,vFuidddd)
-GO(glProgramUniform4dvEXT,vFuiip)
-GO(glProgramUniform4fEXT,vFuiffff)
-GO(glProgramUniform4fvEXT,vFuiip)
-GO(glProgramUniform4iEXT,vFuiiiii)
-GO(glProgramUniform4ivEXT,vFuiip)
-GO(glProgramUniform4uiEXT,vFuiuuuu)
-GO(glProgramUniform4uivEXT,vFuiip)
-GO(glProgramUniformMatrix2dvEXT,vFuiiip)
-GO(glProgramUniformMatrix2fvEXT,vFuiiip)
-GO(glProgramUniformMatrix2x3dvEXT,vFuiiip)
-GO(glProgramUniformMatrix2x3fvEXT,vFuiiip)
-GO(glProgramUniformMatrix2x4dvEXT,vFuiiip)
-GO(glProgramUniformMatrix2x4fvEXT,vFuiiip)
-GO(glProgramUniformMatrix3dvEXT,vFuiiip)
-GO(glProgramUniformMatrix3fvEXT,vFuiiip)
-GO(glProgramUniformMatrix3x2dvEXT,vFuiiip)
-GO(glProgramUniformMatrix3x2fvEXT,vFuiiip)
-GO(glProgramUniformMatrix3x4dvEXT,vFuiiip)
-GO(glProgramUniformMatrix3x4fvEXT,vFuiiip)
-GO(glProgramUniformMatrix4dvEXT,vFuiiip)
-GO(glProgramUniformMatrix4fvEXT,vFuiiip)
-GO(glProgramUniformMatrix4x2dvEXT,vFuiiip)
-GO(glProgramUniformMatrix4x2fvEXT,vFuiiip)
-GO(glProgramUniformMatrix4x3dvEXT,vFuiiip)
-GO(glProgramUniformMatrix4x3fvEXT,vFuiiip)
-GO(glPushClientAttribDefaultEXT,vFi)
-GO(glTextureBufferEXT,vFuuuu)
-GO(glTextureImage1DEXT,vFuuiuiiuup)
-GO(glTextureImage2DEXT,vFuuiuiiiuup)
-GO(glTextureImage3DEXT,vFuuiuiiiiuup)
-GO(glTextureParameterIivEXT,vFuuup)
-GO(glTextureParameterIuivEXT,vFuuup)
-GO(glTextureParameterfEXT,vFuuuf)
-GO(glTextureParameterfvEXT,vFuuup)
-GO(glTextureParameteriEXT,vFuuui)
-GO(glTextureParameterivEXT,vFuuup)
-GO(glTextureRenderbufferEXT,vFuuu)
-GO(glTextureSubImage1DEXT,vFuuiiiuup)
-GO(glTextureSubImage2DEXT,vFuuiiiiiuup)
-GO(glTextureSubImage3DEXT,vFuuiiiiiiiuup)
-GO(glUnmapNamedBufferEXT,iFu)
-GO(glVertexArrayColorOffsetEXT,vFuuiuii)
-GO(glVertexArrayEdgeFlagOffsetEXT,vFuuii)
-GO(glVertexArrayFogCoordOffsetEXT,vFuuuii)
-GO(glVertexArrayIndexOffsetEXT,vFuuuii)
-GO(glVertexArrayMultiTexCoordOffsetEXT,vFuuuiuii)
-GO(glVertexArrayNormalOffsetEXT,vFuuuii)
-GO(glVertexArraySecondaryColorOffsetEXT,vFuuiuii)
-GO(glVertexArrayTexCoordOffsetEXT,vFuuiuii)
-GO(glVertexArrayVertexAttribIOffsetEXT,vFuuuiuii)
-GO(glVertexArrayVertexAttribOffsetEXT,vFuuuiuiii)
-GO(glVertexArrayVertexOffsetEXT,vFuuiuii)
+GO(glBindMultiTextureEXT, vFuuu)
+GO(glCheckNamedFramebufferStatusEXT, uFuu)
+GO(glClientAttribDefaultEXT, vFi)
+GO(glCompressedMultiTexImage1DEXT, vFuuiuiiip)
+GO(glCompressedMultiTexImage2DEXT, vFuuiuiiiip)
+GO(glCompressedMultiTexImage3DEXT, vFuuiuiiiiip)
+GO(glCompressedMultiTexSubImage1DEXT, vFuuiiiuip)
+GO(glCompressedMultiTexSubImage2DEXT, vFuuiiiiiuip)
+GO(glCompressedMultiTexSubImage3DEXT, vFuuiiiiiiiuip)
+GO(glCompressedTextureImage1DEXT, vFuuiuiiip)
+GO(glCompressedTextureImage2DEXT, vFuuiuiiiip)
+GO(glCompressedTextureImage3DEXT, vFuuiuiiiiip)
+GO(glCompressedTextureSubImage1DEXT, vFuuiiiuip)
+GO(glCompressedTextureSubImage2DEXT, vFuuiiiiiuip)
+GO(glCompressedTextureSubImage3DEXT, vFuuiiiiiiiuip)
+GO(glCopyMultiTexImage1DEXT, vFuuiuiiii)
+GO(glCopyMultiTexImage2DEXT, vFuuiuiiiii)
+GO(glCopyMultiTexSubImage1DEXT, vFuuiiiii)
+GO(glCopyMultiTexSubImage2DEXT, vFuuiiiiiii)
+GO(glCopyMultiTexSubImage3DEXT, vFuuiiiiiiii)
+GO(glCopyTextureImage1DEXT, vFuuiuiiii)
+GO(glCopyTextureImage2DEXT, vFuuiuiiiii)
+GO(glCopyTextureSubImage1DEXT, vFuuiiiii)
+GO(glCopyTextureSubImage2DEXT, vFuuiiiiiii)
+GO(glCopyTextureSubImage3DEXT, vFuuiiiiiiii)
+GO(glDisableClientStateIndexedEXT, vFuu)
+GO(glDisableClientStateiEXT, vFuu)
+GO(glDisableVertexArrayAttribEXT, vFuu)
+GO(glDisableVertexArrayEXT, vFuu)
+GO(glEnableClientStateIndexedEXT, vFuu)
+GO(glEnableClientStateiEXT, vFuu)
+GO(glEnableVertexArrayAttribEXT, vFuu)
+GO(glEnableVertexArrayEXT, vFuu)
+GO(glFlushMappedNamedBufferRangeEXT, vFull)
+GO(glFramebufferDrawBufferEXT, vFuu)
+GO(glFramebufferDrawBuffersEXT, vFuip)
+GO(glFramebufferReadBufferEXT, vFuu)
+GO(glGenerateMultiTexMipmapEXT, vFuu)
+GO(glGenerateTextureMipmapEXT, vFuu)
+GO(glGetCompressedMultiTexImageEXT, vFuuip)
+GO(glGetCompressedTextureImageEXT, vFuuip)
+GO(glGetDoubleIndexedvEXT, vFuup)
+GO(glGetDoublei_vEXT, vFuup)
+GO(glGetFloatIndexedvEXT, vFuup)
+GO(glGetFloati_vEXT, vFuup)
+GO(glGetFramebufferParameterivEXT, vFuup)
+GO(glGetMultiTexEnvfvEXT, vFuuup)
+GO(glGetMultiTexEnvivEXT, vFuuup)
+GO(glGetMultiTexGendvEXT, vFuuup)
+GO(glGetMultiTexGenfvEXT, vFuuup)
+GO(glGetMultiTexGenivEXT, vFuuup)
+GO(glGetMultiTexImageEXT, vFuuiuup)
+GO(glGetMultiTexLevelParameterfvEXT, vFuuiup)
+GO(glGetMultiTexLevelParameterivEXT, vFuuiup)
+GO(glGetMultiTexParameterIivEXT, vFuuup)
+GO(glGetMultiTexParameterIuivEXT, vFuuup)
+GO(glGetMultiTexParameterfvEXT, vFuuup)
+GO(glGetMultiTexParameterivEXT, vFuuup)
+GO(glGetNamedBufferParameterivEXT, vFuup)
+GO(glGetNamedBufferPointervEXT, vFuup)
+GO(glGetNamedBufferSubDataEXT, vFullp)
+GO(glGetNamedFramebufferAttachmentParameterivEXT, vFuuup)
+GO(glGetNamedProgramLocalParameterIivEXT, vFuuup)
+GO(glGetNamedProgramLocalParameterIuivEXT, vFuuup)
+GO(glGetNamedProgramLocalParameterdvEXT, vFuuup)
+GO(glGetNamedProgramLocalParameterfvEXT, vFuuup)
+GO(glGetNamedProgramStringEXT, vFuuup)
+GO(glGetNamedProgramivEXT, vFuuup)
+GO(glGetNamedRenderbufferParameterivEXT, vFuup)
+GO(glGetPointerIndexedvEXT, vFuup)
+GO(glGetPointeri_vEXT, vFuup)
+GO(glGetTextureImageEXT, vFuuiuup)
+GO(glGetTextureLevelParameterfvEXT, vFuuiup)
+GO(glGetTextureLevelParameterivEXT, vFuuiup)
+GO(glGetTextureParameterIivEXT, vFuuup)
+GO(glGetTextureParameterIuivEXT, vFuuup)
+GO(glGetTextureParameterfvEXT, vFuuup)
+GO(glGetTextureParameterivEXT, vFuuup)
+GO(glGetVertexArrayIntegeri_vEXT, vFuuup)
+GO(glGetVertexArrayIntegervEXT, vFuup)
+GO(glGetVertexArrayPointeri_vEXT, vFuuup)
+GO(glGetVertexArrayPointervEXT, vFuup)
+GO(glMapNamedBufferEXT, pFuu)
+GO(glMapNamedBufferRangeEXT, pFullu)
+GO(glMatrixFrustumEXT, vFudddddd)
+GO(glMatrixLoadIdentityEXT, vFu)
+GO(glMatrixLoadTransposedEXT, vFup)
+GO(glMatrixLoadTransposefEXT, vFup)
+GO(glMatrixLoaddEXT, vFup)
+GO(glMatrixLoadfEXT, vFup)
+GO(glMatrixMultTransposedEXT, vFup)
+GO(glMatrixMultTransposefEXT, vFup)
+GO(glMatrixMultdEXT, vFup)
+GO(glMatrixMultfEXT, vFup)
+GO(glMatrixOrthoEXT, vFudddddd)
+GO(glMatrixPopEXT, vFu)
+GO(glMatrixPushEXT, vFu)
+GO(glMatrixRotatedEXT, vFudddd)
+GO(glMatrixRotatefEXT, vFuffff)
+GO(glMatrixScaledEXT, vFuddd)
+GO(glMatrixScalefEXT, vFufff)
+GO(glMatrixTranslatedEXT, vFuddd)
+GO(glMatrixTranslatefEXT, vFufff)
+GO(glMultiTexBufferEXT, vFuuuu)
+GO(glMultiTexCoordPointerEXT, vFuiuip)
+GO(glMultiTexEnvfEXT, vFuuuf)
+GO(glMultiTexEnvfvEXT, vFuuup)
+GO(glMultiTexEnviEXT, vFuuui)
+GO(glMultiTexEnvivEXT, vFuuup)
+GO(glMultiTexGendEXT, vFuuud)
+GO(glMultiTexGendvEXT, vFuuup)
+GO(glMultiTexGenfEXT, vFuuuf)
+GO(glMultiTexGenfvEXT, vFuuup)
+GO(glMultiTexGeniEXT, vFuuui)
+GO(glMultiTexGenivEXT, vFuuup)
+GO(glMultiTexImage1DEXT, vFuuiiiiuup)
+GO(glMultiTexImage2DEXT, vFuuiiiiiuup)
+GO(glMultiTexImage3DEXT, vFuuiiiiiiuup)
+GO(glMultiTexParameterIivEXT, vFuuup)
+GO(glMultiTexParameterIuivEXT, vFuuup)
+GO(glMultiTexParameterfEXT, vFuuuf)
+GO(glMultiTexParameterfvEXT, vFuuup)
+GO(glMultiTexParameteriEXT, vFuuui)
+GO(glMultiTexParameterivEXT, vFuuup)
+GO(glMultiTexRenderbufferEXT, vFuuu)
+GO(glMultiTexSubImage1DEXT, vFuuiiiuup)
+GO(glMultiTexSubImage2DEXT, vFuuiiiiiuup)
+GO(glMultiTexSubImage3DEXT, vFuuiiiiiiiuup)
+GO(glNamedBufferDataEXT, vFulpu)
+GO(glNamedBufferSubDataEXT, vFullp)
+GO(glNamedCopyBufferSubDataEXT, vFuulll)
+GO(glNamedFramebufferRenderbufferEXT, vFuuuu)
+GO(glNamedFramebufferTexture1DEXT, vFuuuui)
+GO(glNamedFramebufferTexture2DEXT, vFuuuui)
+GO(glNamedFramebufferTexture3DEXT, vFuuuuii)
+GO(glNamedFramebufferTextureEXT, vFuuui)
+GO(glNamedFramebufferTextureFaceEXT, vFuuuiu)
+GO(glNamedFramebufferTextureLayerEXT, vFuuuii)
+GO(glNamedProgramLocalParameter4dEXT, vFuuudddd)
+GO(glNamedProgramLocalParameter4dvEXT, vFuuup)
+GO(glNamedProgramLocalParameter4fEXT, vFuuuffff)
+GO(glNamedProgramLocalParameter4fvEXT, vFuuup)
+GO(glNamedProgramLocalParameterI4iEXT, vFuuuiiii)
+GO(glNamedProgramLocalParameterI4ivEXT, vFuuup)
+GO(glNamedProgramLocalParameterI4uiEXT, vFuuuuuuu)
+GO(glNamedProgramLocalParameterI4uivEXT, vFuuup)
+GO(glNamedProgramLocalParameters4fvEXT, vFuuuip)
+GO(glNamedProgramLocalParametersI4ivEXT, vFuuuip)
+GO(glNamedProgramLocalParametersI4uivEXT, vFuuuip)
+GO(glNamedProgramStringEXT, vFuuuip)
+GO(glNamedRenderbufferStorageEXT, vFuuii)
+GO(glNamedRenderbufferStorageMultisampleCoverageEXT, vFuiiuii)
+GO(glNamedRenderbufferStorageMultisampleEXT, vFuiuii)
+GO(glProgramUniform1dEXT, vFuid)
+GO(glProgramUniform1dvEXT, vFuiip)
+GO(glProgramUniform1fEXT, vFuif)
+GO(glProgramUniform1fvEXT, vFuiip)
+GO(glProgramUniform1iEXT, vFuii)
+GO(glProgramUniform1ivEXT, vFuiip)
+GO(glProgramUniform1uiEXT, vFuiu)
+GO(glProgramUniform1uivEXT, vFuiip)
+GO(glProgramUniform2dEXT, vFuidd)
+GO(glProgramUniform2dvEXT, vFuiip)
+GO(glProgramUniform2fEXT, vFuiff)
+GO(glProgramUniform2fvEXT, vFuiip)
+GO(glProgramUniform2iEXT, vFuiii)
+GO(glProgramUniform2ivEXT, vFuiip)
+GO(glProgramUniform2uiEXT, vFuiuu)
+GO(glProgramUniform2uivEXT, vFuiip)
+GO(glProgramUniform3dEXT, vFuiddd)
+GO(glProgramUniform3dvEXT, vFuiip)
+GO(glProgramUniform3fEXT, vFuifff)
+GO(glProgramUniform3fvEXT, vFuiip)
+GO(glProgramUniform3iEXT, vFuiiii)
+GO(glProgramUniform3ivEXT, vFuiip)
+GO(glProgramUniform3uiEXT, vFuiuuu)
+GO(glProgramUniform3uivEXT, vFuiip)
+GO(glProgramUniform4dEXT, vFuidddd)
+GO(glProgramUniform4dvEXT, vFuiip)
+GO(glProgramUniform4fEXT, vFuiffff)
+GO(glProgramUniform4fvEXT, vFuiip)
+GO(glProgramUniform4iEXT, vFuiiiii)
+GO(glProgramUniform4ivEXT, vFuiip)
+GO(glProgramUniform4uiEXT, vFuiuuuu)
+GO(glProgramUniform4uivEXT, vFuiip)
+GO(glProgramUniformMatrix2dvEXT, vFuiiip)
+GO(glProgramUniformMatrix2fvEXT, vFuiiip)
+GO(glProgramUniformMatrix2x3dvEXT, vFuiiip)
+GO(glProgramUniformMatrix2x3fvEXT, vFuiiip)
+GO(glProgramUniformMatrix2x4dvEXT, vFuiiip)
+GO(glProgramUniformMatrix2x4fvEXT, vFuiiip)
+GO(glProgramUniformMatrix3dvEXT, vFuiiip)
+GO(glProgramUniformMatrix3fvEXT, vFuiiip)
+GO(glProgramUniformMatrix3x2dvEXT, vFuiiip)
+GO(glProgramUniformMatrix3x2fvEXT, vFuiiip)
+GO(glProgramUniformMatrix3x4dvEXT, vFuiiip)
+GO(glProgramUniformMatrix3x4fvEXT, vFuiiip)
+GO(glProgramUniformMatrix4dvEXT, vFuiiip)
+GO(glProgramUniformMatrix4fvEXT, vFuiiip)
+GO(glProgramUniformMatrix4x2dvEXT, vFuiiip)
+GO(glProgramUniformMatrix4x2fvEXT, vFuiiip)
+GO(glProgramUniformMatrix4x3dvEXT, vFuiiCp)
+GO(glProgramUniformMatrix4x3fvEXT, vFuiiCp)
+GO(glPushClientAttribDefaultEXT, vFi)
+GO(glTextureBufferEXT, vFuuuu)
+GO(glTextureImage1DEXT, vFuuiiiiuup)
+GO(glTextureImage2DEXT, vFuuiiiiiuup)
+GO(glTextureImage3DEXT, vFuuiiiiiiuup)
+GO(glTextureParameterIivEXT, vFuuup)
+GO(glTextureParameterIuivEXT, vFuuup)
+GO(glTextureParameterfEXT, vFuuuf)
+GO(glTextureParameterfvEXT, vFuuup)
+GO(glTextureParameteriEXT, vFuuui)
+GO(glTextureParameterivEXT, vFuuup)
+GO(glTextureRenderbufferEXT, vFuuu)
+GO(glTextureSubImage1DEXT, vFuuiiiuup)
+GO(glTextureSubImage2DEXT, vFuuiiiiiuup)
+GO(glTextureSubImage3DEXT, vFuuiiiiiiiuup)
+GO(glUnmapNamedBufferEXT, iFu)
+GO(glVertexArrayColorOffsetEXT, vFuuiuii)
+GO(glVertexArrayEdgeFlagOffsetEXT, vFuuil)
+GO(glVertexArrayFogCoordOffsetEXT, vFuuuil)
+GO(glVertexArrayIndexOffsetEXT, vFuuuii)
+GO(glVertexArrayMultiTexCoordOffsetEXT, vFuuuiuil)
+GO(glVertexArrayNormalOffsetEXT, vFuuuii)
+GO(glVertexArraySecondaryColorOffsetEXT, vFuuiuil)
+GO(glVertexArrayTexCoordOffsetEXT, vFuuiuii)
+GO(glVertexArrayVertexAttribIOffsetEXT, vFuuuiuii)
+GO(glVertexArrayVertexAttribOffsetEXT, vFuuuiuCil)
+GO(glVertexArrayVertexOffsetEXT, vFuuiuii)
//EXT_draw_buffers2
-GO(glColorMaskIndexedEXT,vFuiiii)
-GO(glDisableIndexedEXT,vFuu)
-GO(glEnableIndexedEXT,vFuu)
-GO(glGetBooleanIndexedvEXT,vFuup)
-GO(glGetIntegerIndexedvEXT,vFuup)
-GO(glIsEnabledIndexedEXT,iFuu)
+GO(glColorMaskIndexedEXT, vFuCCCC)
+GO(glDisableIndexedEXT, vFuu)
+GO(glEnableIndexedEXT, vFuu)
+GO(glGetBooleanIndexedvEXT, vFuup)
+GO(glGetIntegerIndexedvEXT, vFuup)
+GO(glIsEnabledIndexedEXT, CFuu)
//EXT_draw_instanced
-GO(glDrawArraysInstancedEXT,vFuiii)
-GO(glDrawElementsInstancedEXT,vFuiupi)
+GO(glDrawArraysInstancedEXT, vFuiii)
+GO(glDrawElementsInstancedEXT, vFuiupi)
//EXT_draw_range_elements
-GO(glDrawRangeElementsEXT,vFuuuiup)
+GO(glDrawRangeElementsEXT, vFuuuiup)
//EXT_fog_coord
-GO(glFogCoordPointerEXT,vFuip)
-GO(glFogCoorddEXT,vFd)
-GO(glFogCoorddvEXT,vFp)
-GO(glFogCoordfEXT,vFf)
-GO(glFogCoordfvEXT,vFp)
+GO(glFogCoordPointerEXT, vFuip)
+GO(glFogCoorddEXT, vFd)
+GO(glFogCoorddvEXT, vFp)
+GO(glFogCoordfEXT, vFf)
+GO(glFogCoordfvEXT, vFp)
//EXT_framebuffer_blit
-GO(glBlitFramebufferEXT,vFiiiiiiiiiu)
+GO(glBlitFramebufferEXT, vFiiiiiiiiuu)
//EXT_framebuffer_object
-GO(glBindFramebufferEXT,vFuu)
-GO(glBindRenderbufferEXT,vFuu)
-GO(glCheckFramebufferStatusEXT,uFu)
-GO(glDeleteFramebuffersEXT,vFip)
-GO(glDeleteRenderbuffersEXT,vFip)
-GO(glFramebufferRenderbufferEXT,vFuuuu)
-GO(glFramebufferTexture1DEXT,vFuuuui)
-GO(glFramebufferTexture2DEXT,vFuuuui)
-GO(glFramebufferTexture3DEXT,vFuuuuii)
-GO(glGenFramebuffersEXT,vFip)
-GO(glGenRenderbuffersEXT,vFip)
-GO(glGenerateMipmapEXT,vFu)
-GO(glGetFramebufferAttachmentParameterivEXT,vFuuup)
-GO(glGetRenderbufferParameterivEXT,vFuup)
-GO(glIsFramebufferEXT,iFu)
-GO(glIsRenderbufferEXT,iFu)
-GO(glRenderbufferStorageEXT,vFuuii)
+GO(glBindFramebufferEXT, vFuu)
+GO(glBindRenderbufferEXT, vFuu)
+GO(glCheckFramebufferStatusEXT, uFu)
+GO(glDeleteFramebuffersEXT, vFip)
+GO(glDeleteRenderbuffersEXT, vFip)
+GO(glFramebufferRenderbufferEXT, vFuuuu)
+GO(glFramebufferTexture1DEXT, vFuuuui)
+GO(glFramebufferTexture2DEXT, vFuuuui)
+GO(glFramebufferTexture3DEXT, vFuuuuii)
+GO(glGenFramebuffersEXT, vFip)
+GO(glGenRenderbuffersEXT, vFip)
+GO(glGenerateMipmapEXT, vFu)
+GO(glGetFramebufferAttachmentParameterivEXT, vFuuup)
+GO(glGetRenderbufferParameterivEXT, vFuup)
+GO(glIsFramebufferEXT, iFu)
+GO(glIsRenderbufferEXT, iFu)
+GO(glRenderbufferStorageEXT, vFuuii)
//EXT_geometry_shader4
-GO(glProgramParameteriEXT,vFuui)
+GO(glProgramParameteriEXT, vFuui)
//EXT_gpu_program_parameters
-GO(glProgramEnvParameters4fvEXT,vFuuip)
-GO(glProgramLocalParameters4fvEXT,vFuuip)
+GO(glProgramEnvParameters4fvEXT, vFuuip)
+GO(glProgramLocalParameters4fvEXT, vFuuip)
//EXT_gpu_shader4
-GO(glBindFragDataLocationEXT,vFuup)
-GO(glGetFragDataLocationEXT,iFup)
-GO(glGetUniformuivEXT,vFuip)
-GO(glUniform1uiEXT,vFiu)
-GO(glUniform1uivEXT,vFiip)
-GO(glUniform2uiEXT,vFiuu)
-GO(glUniform2uivEXT,vFiip)
-GO(glUniform3uiEXT,vFiuuu)
-GO(glUniform3uivEXT,vFiip)
-GO(glUniform4uiEXT,vFiuuuu)
-GO(glUniform4uivEXT,vFiip)
+GO(glBindFragDataLocationEXT, vFuup)
+GO(glGetFragDataLocationEXT, iFup)
+GO(glGetUniformuivEXT, vFuip)
+GO(glUniform1uiEXT, vFiu)
+GO(glUniform1uivEXT, vFiip)
+GO(glUniform2uiEXT, vFiuu)
+GO(glUniform2uivEXT, vFiip)
+GO(glUniform3uiEXT, vFiuuu)
+GO(glUniform3uivEXT, vFiip)
+GO(glUniform4uiEXT, vFiuuuu)
+GO(glUniform4uivEXT, vFiip)
//EXT_histogram
-GO(glGetHistogramEXT,vFuiuup)
-GO(glGetHistogramParameterfvEXT,vFuup)
-GO(glGetHistogramParameterivEXT,vFuup)
-GO(glGetMinmaxEXT,vFuiuup)
-GO(glGetMinmaxParameterfvEXT,vFuup)
-GO(glGetMinmaxParameterivEXT,vFuup)
-GO(glHistogramEXT,vFuiui)
-GO(glMinmaxEXT,vFuui)
-GO(glResetHistogramEXT,vFu)
-GO(glResetMinmaxEXT,vFu)
+GO(glGetHistogramEXT, vFuiuup)
+GO(glGetHistogramParameterfvEXT, vFuup)
+GO(glGetHistogramParameterivEXT, vFuup)
+GO(glGetMinmaxEXT, vFuCuup)
+GO(glGetMinmaxParameterfvEXT, vFuup)
+GO(glGetMinmaxParameterivEXT, vFuup)
+GO(glHistogramEXT, vFuiuC)
+GO(glMinmaxEXT, vFuuC)
+GO(glResetHistogramEXT, vFu)
+GO(glResetMinmaxEXT, vFu)
//EXT_index_func
-GO(glIndexFuncEXT,vFuf)
+GO(glIndexFuncEXT, vFuf)
//EXT_index_material
-GO(glIndexMaterialEXT,vFuu)
+GO(glIndexMaterialEXT, vFuu)
//EXT_light_texture
-GO(glApplyTextureEXT,vFu)
-GO(glTextureLightEXT,vFu)
-GO(glTextureMaterialEXT,vFuu)
+GO(glApplyTextureEXT, vFu)
+GO(glTextureLightEXT, vFu)
+GO(glTextureMaterialEXT, vFuu)
//EXT_multi_draw_arrays
-GO(glMultiDrawArraysEXT,vFuppi)
-GO(glMultiDrawElementsEXT,vFupupi)
+GO(glMultiDrawArraysEXT, vFuppi)
+GO(glMultiDrawElementsEXT, vFupupi)
//EXT_multisample
-GO(glSampleMaskEXT,vFfi)
-GO(glSamplePatternEXT,vFu)
+GO(glSampleMaskEXT, vFfi)
+GO(glSamplePatternEXT, vFu)
//EXT_paletted_texture
-GO(glColorTableEXT,vFuuiuup)
-GO(glGetColorTableEXT,vFuuup)
-GO(glGetColorTableParameterfvEXT,vFuup)
-GO(glGetColorTableParameterivEXT,vFuup)
+GO(glColorTableEXT, vFuuiuup)
+GO(glGetColorTableEXT, vFuuup)
+GO(glGetColorTableParameterfvEXT, vFuup)
+GO(glGetColorTableParameterivEXT, vFuup)
//EXT_pixel_transform
-GO(glGetPixelTransformParameterfvEXT,vFuup)
-GO(glGetPixelTransformParameterivEXT,vFuup)
-GO(glPixelTransformParameterfEXT,vFuuf)
-GO(glPixelTransformParameterfvEXT,vFuup)
-GO(glPixelTransformParameteriEXT,vFuui)
-GO(glPixelTransformParameterivEXT,vFuup)
+GO(glGetPixelTransformParameterfvEXT, vFuup)
+GO(glGetPixelTransformParameterivEXT, vFuup)
+GO(glPixelTransformParameterfEXT, vFuuf)
+GO(glPixelTransformParameterfvEXT, vFuup)
+GO(glPixelTransformParameteriEXT, vFuui)
+GO(glPixelTransformParameterivEXT, vFuup)
//EXT_point_parameters
-GO(glPointParameterfEXT,vFuf)
-GO(glPointParameterfvEXT,vFup)
+GO(glPointParameterfEXT, vFuf)
+GO(glPointParameterfvEXT, vFup)
//EXT_polygon_offset
-GO(glPolygonOffsetEXT,vFff)
+GO(glPolygonOffsetEXT, vFff)
//EXT_provoking_vertex
-GO(glProvokingVertexEXT,vFu)
+GO(glProvokingVertexEXT, vFu)
//EXT_secondary_color
-GO(glSecondaryColor3bEXT,vFiii)
-GO(glSecondaryColor3bvEXT,vFp)
-GO(glSecondaryColor3dEXT,vFddd)
-GO(glSecondaryColor3dvEXT,vFp)
-GO(glSecondaryColor3fEXT,vFfff)
-GO(glSecondaryColor3fvEXT,vFp)
-GO(glSecondaryColor3iEXT,vFiii)
-GO(glSecondaryColor3ivEXT,vFp)
-GO(glSecondaryColor3sEXT,vFiii)
-GO(glSecondaryColor3svEXT,vFp)
-GO(glSecondaryColor3ubEXT,vFuuu)
-GO(glSecondaryColor3ubvEXT,vFp)
-GO(glSecondaryColor3uiEXT,vFuuu)
-GO(glSecondaryColor3uivEXT,vFp)
-GO(glSecondaryColor3usEXT,vFuuu)
-GO(glSecondaryColor3usvEXT,vFp)
-GO(glSecondaryColorPointerEXT,vFiuip)
+GO(glSecondaryColor3bEXT, vFccc)
+GO(glSecondaryColor3bvEXT, vFp)
+GO(glSecondaryColor3dEXT, vFddd)
+GO(glSecondaryColor3dvEXT, vFp)
+GO(glSecondaryColor3fEXT, vFfff)
+GO(glSecondaryColor3fvEXT, vFp)
+GO(glSecondaryColor3iEXT, vFiii)
+GO(glSecondaryColor3ivEXT, vFp)
+GO(glSecondaryColor3sEXT, vFiii)
+GO(glSecondaryColor3svEXT, vFp)
+GO(glSecondaryColor3ubEXT, vFCCC)
+GO(glSecondaryColor3ubvEXT, vFp)
+GO(glSecondaryColor3uiEXT, vFuuu)
+GO(glSecondaryColor3uivEXT, vFp)
+GO(glSecondaryColor3usEXT, vFWWW)
+GO(glSecondaryColor3usvEXT, vFp)
+GO(glSecondaryColorPointerEXT, vFiuip)
//EXT_separate_shader_objects
-GO(glActiveProgramEXT,vFu)
-GO(glCreateShaderProgramEXT,uFup)
-GO(glUseShaderProgramEXT,vFuu)
+GO(glActiveProgramEXT, vFu)
+GO(glCreateShaderProgramEXT, uFup)
+GO(glUseShaderProgramEXT, vFuu)
//EXT_shader_image_load_store
-GO(glBindImageTextureEXT,vFuuiiiui)
-GO(glMemoryBarrierEXT,vFi)
+GO(glBindImageTextureEXT, vFuuiCiui)
+GO(glMemoryBarrierEXT, vFi)
//EXT_stencil_clear_tag
-GO(glStencilClearTagEXT,vFiu)
+GO(glStencilClearTagEXT, vFiu)
//EXT_stencil_two_side
-GO(glActiveStencilFaceEXT,vFu)
+GO(glActiveStencilFaceEXT, vFu)
//EXT_subtexture
-GO(glTexSubImage1DEXT,vFuiiiuup)
-GO(glTexSubImage2DEXT,vFuiiiiiuup)
+GO(glTexSubImage1DEXT, vFuiiiuup)
+GO(glTexSubImage2DEXT, vFuiiiiiuup)
//EXT_texture3D
-GO(glTexImage3DEXT,vFuiuiiiiuup)
-GO(glTexSubImage3DEXT,vFuiiiiiiiuup)
+GO(glTexImage3DEXT, vFuiuiiiiuup)
+GO(glTexSubImage3DEXT, vFuiiiiiiiuup)
//EXT_texture_buffer_object
-GO(glTexBufferEXT,vFuuu)
+GO(glTexBufferEXT, vFuuu)
//EXT_texture_integer
-GO(glClearColorIiEXT,vFiiii)
-GO(glClearColorIuiEXT,vFuuuu)
-GO(glGetTexParameterIivEXT,vFuup)
-GO(glGetTexParameterIuivEXT,vFuup)
-GO(glTexParameterIivEXT,vFuup)
-GO(glTexParameterIuivEXT,vFuup)
+GO(glClearColorIiEXT, vFiiii)
+GO(glClearColorIuiEXT, vFuuuu)
+GO(glGetTexParameterIivEXT, vFuup)
+GO(glGetTexParameterIuivEXT, vFuup)
+GO(glTexParameterIivEXT, vFuup)
+GO(glTexParameterIuivEXT, vFuup)
//EXT_texture_object
-GO(glAreTexturesResidentEXT,iFipp)
-GO(glBindTextureEXT,vFuu)
-GO(glDeleteTexturesEXT,vFip)
-GO(glGenTexturesEXT,vFip)
-GO(glIsTextureEXT,iFu)
-GO(glPrioritizeTexturesEXT,vFipp)
+GO(glAreTexturesResidentEXT, iFipp)
+GO(glBindTextureEXT, vFuu)
+GO(glDeleteTexturesEXT, vFip)
+GO(glGenTexturesEXT, vFip)
+GO(glIsTextureEXT, iFu)
+GO(glPrioritizeTexturesEXT, vFipp)
//EXT_texture_perturb_normal
-GO(glTextureNormalEXT,vFu)
+GO(glTextureNormalEXT, vFu)
//EXT_timer_query
-GO(glGetQueryObjecti64vEXT,vFuup)
-GO(glGetQueryObjectui64vEXT,vFuup)
+GO(glGetQueryObjecti64vEXT, vFuup)
+GO(glGetQueryObjectui64vEXT, vFuup)
//EXT_transform_feedback
-GO(glBeginTransformFeedbackEXT,vFu)
-GO(glBindBufferBaseEXT,vFuuu)
-GO(glBindBufferOffsetEXT,vFuuui)
-GO(glBindBufferRangeEXT,vFuuuii)
-GO(glEndTransformFeedbackEXT,vFv)
-GO(glGetTransformFeedbackVaryingEXT,vFuuipppp)
-GO(glTransformFeedbackVaryingsEXT,vFuipu)
+GO(glBeginTransformFeedbackEXT, vFu)
+GO(glBindBufferBaseEXT, vFuuu)
+GO(glBindBufferOffsetEXT, vFuuui)
+GO(glBindBufferRangeEXT, vFuuuii)
+GO(glEndTransformFeedbackEXT, vFv)
+GO(glGetTransformFeedbackVaryingEXT, vFuuipppp)
+GO(glTransformFeedbackVaryingsEXT, vFuipu)
//EXT_vertex_array
-GO(glArrayElementEXT,vFi)
-GO(glColorPointerEXT,vFiuiip)
-GO(glDrawArraysEXT,vFuii)
-GO(glEdgeFlagPointerEXT,vFiip)
-GO(glGetPointervEXT,vFup)
-GO(glIndexPointerEXT,vFuiip)
-GO(glNormalPointerEXT,vFuiip)
-GO(glTexCoordPointerEXT,vFiuiip)
-GO(glVertexPointerEXT,vFiuiip)
+GO(glArrayElementEXT, vFi)
+GO(glColorPointerEXT, vFiuiip)
+GO(glDrawArraysEXT, vFuii)
+GO(glEdgeFlagPointerEXT, vFiip)
+GO(glGetPointervEXT, vFup)
+GO(glIndexPointerEXT, vFuiip)
+GO(glNormalPointerEXT, vFuiip)
+GO(glTexCoordPointerEXT, vFiuiip)
+GO(glVertexPointerEXT, vFiuiip)
//EXT_vertex_attrib_64bit
-GO(glGetVertexAttribLdvEXT,vFuup)
-GO(glVertexArrayVertexAttribLOffsetEXT,vFuuuiuii)
-GO(glVertexAttribL1dEXT,vFud)
-GO(glVertexAttribL1dvEXT,vFup)
-GO(glVertexAttribL2dEXT,vFudd)
-GO(glVertexAttribL2dvEXT,vFup)
-GO(glVertexAttribL3dEXT,vFuddd)
-GO(glVertexAttribL3dvEXT,vFup)
-GO(glVertexAttribL4dEXT,vFudddd)
-GO(glVertexAttribL4dvEXT,vFup)
-GO(glVertexAttribLPointerEXT,vFuiuip)
+GO(glGetVertexAttribLdvEXT, vFuup)
+GO(glVertexArrayVertexAttribLOffsetEXT, vFuuuiuil)
+GO(glVertexAttribL1dEXT, vFud)
+GO(glVertexAttribL1dvEXT, vFup)
+GO(glVertexAttribL2dEXT, vFudd)
+GO(glVertexAttribL2dvEXT, vFup)
+GO(glVertexAttribL3dEXT, vFuddd)
+GO(glVertexAttribL3dvEXT, vFup)
+GO(glVertexAttribL4dEXT, vFudddd)
+GO(glVertexAttribL4dvEXT, vFup)
+GO(glVertexAttribLPointerEXT, vFuiuip)
//EXT_vertex_shader
-GO(glBeginVertexShaderEXT,vFv)
-GO(glBindLightParameterEXT,uFuu)
-GO(glBindMaterialParameterEXT,uFuu)
-GO(glBindParameterEXT,uFu)
-GO(glBindTexGenParameterEXT,uFuuu)
-GO(glBindTextureUnitParameterEXT,uFuu)
-GO(glBindVertexShaderEXT,vFu)
-GO(glDeleteVertexShaderEXT,vFu)
-GO(glDisableVariantClientStateEXT,vFu)
-GO(glEnableVariantClientStateEXT,vFu)
-GO(glEndVertexShaderEXT,vFv)
-GO(glExtractComponentEXT,vFuuu)
-GO(glGenSymbolsEXT,uFuuuu)
-GO(glGenVertexShadersEXT,uFu)
-GO(glGetInvariantBooleanvEXT,vFuup)
-GO(glGetInvariantFloatvEXT,vFuup)
-GO(glGetInvariantIntegervEXT,vFuup)
-GO(glGetLocalConstantBooleanvEXT,vFuup)
-GO(glGetLocalConstantFloatvEXT,vFuup)
-GO(glGetLocalConstantIntegervEXT,vFuup)
-GO(glGetVariantBooleanvEXT,vFuup)
-GO(glGetVariantFloatvEXT,vFuup)
-GO(glGetVariantIntegervEXT,vFuup)
-GO(glGetVariantPointervEXT,vFuup)
-GO(glInsertComponentEXT,vFuuu)
-GO(glIsVariantEnabledEXT,iFuu)
-GO(glSetInvariantEXT,vFuup)
-GO(glSetLocalConstantEXT,vFuup)
-GO(glShaderOp1EXT,vFuuu)
-GO(glShaderOp2EXT,vFuuuu)
-GO(glShaderOp3EXT,vFuuuuu)
-GO(glSwizzleEXT,vFuuuuuu)
-GO(glVariantPointerEXT,vFuuup)
-GO(glVariantbvEXT,vFup)
-GO(glVariantdvEXT,vFup)
-GO(glVariantfvEXT,vFup)
-GO(glVariantivEXT,vFup)
-GO(glVariantsvEXT,vFup)
-GO(glVariantubvEXT,vFup)
-GO(glVariantuivEXT,vFup)
-GO(glVariantusvEXT,vFup)
-GO(glWriteMaskEXT,vFuuuuuu)
+GO(glBeginVertexShaderEXT, vFv)
+GO(glBindLightParameterEXT, uFuu)
+GO(glBindMaterialParameterEXT, uFuu)
+GO(glBindParameterEXT, uFu)
+GO(glBindTexGenParameterEXT, uFuuu)
+GO(glBindTextureUnitParameterEXT, uFuu)
+GO(glBindVertexShaderEXT, vFu)
+GO(glDeleteVertexShaderEXT, vFu)
+GO(glDisableVariantClientStateEXT, vFu)
+GO(glEnableVariantClientStateEXT, vFu)
+GO(glEndVertexShaderEXT, vFv)
+GO(glExtractComponentEXT, vFuuu)
+GO(glGenSymbolsEXT, uFuuuu)
+GO(glGenVertexShadersEXT, uFu)
+GO(glGetInvariantBooleanvEXT, vFuup)
+GO(glGetInvariantFloatvEXT, vFuup)
+GO(glGetInvariantIntegervEXT, vFuup)
+GO(glGetLocalConstantBooleanvEXT, vFuup)
+GO(glGetLocalConstantFloatvEXT, vFuup)
+GO(glGetLocalConstantIntegervEXT, vFuup)
+GO(glGetVariantBooleanvEXT, vFuup)
+GO(glGetVariantFloatvEXT, vFuup)
+GO(glGetVariantIntegervEXT, vFuup)
+GO(glGetVariantPointervEXT, vFuup)
+GO(glInsertComponentEXT, vFuuu)
+GO(glIsVariantEnabledEXT, CFuu)
+GO(glSetInvariantEXT, vFuup)
+GO(glSetLocalConstantEXT, vFuup)
+GO(glShaderOp1EXT, vFuuu)
+GO(glShaderOp2EXT, vFuuuu)
+GO(glShaderOp3EXT, vFuuuuu)
+GO(glSwizzleEXT, vFuuuuuu)
+GO(glVariantPointerEXT, vFuuup)
+GO(glVariantbvEXT, vFup)
+GO(glVariantdvEXT, vFup)
+GO(glVariantfvEXT, vFup)
+GO(glVariantivEXT, vFup)
+GO(glVariantsvEXT, vFup)
+GO(glVariantubvEXT, vFup)
+GO(glVariantuivEXT, vFup)
+GO(glVariantusvEXT, vFup)
+GO(glWriteMaskEXT, vFuuuuuu)
//EXT_vertex_weighting
-GO(glVertexWeightPointerEXT,vFiuip)
-GO(glVertexWeightfEXT,vFf)
-GO(glVertexWeightfvEXT,vFp)
+GO(glVertexWeightPointerEXT, vFiuip)
+GO(glVertexWeightfEXT, vFf)
+GO(glVertexWeightfvEXT, vFp)
//EXT_x11_sync_object
-GO(glImportSyncEXT,pFuii)
+GO(glImportSyncEXT, pFulu)
//GREMEDY_frame_terminator
-GO(glFrameTerminatorGREMEDY,vFv)
+GO(glFrameTerminatorGREMEDY, vFv)
//GREMEDY_string_marker
-GO(glStringMarkerGREMEDY,vFip)
+GO(glStringMarkerGREMEDY, vFip)
//HP_image_transform
-GO(glGetImageTransformParameterfvHP,vFuup)
-GO(glGetImageTransformParameterivHP,vFuup)
-GO(glImageTransformParameterfHP,vFuuf)
-GO(glImageTransformParameterfvHP,vFuup)
-GO(glImageTransformParameteriHP,vFuui)
-GO(glImageTransformParameterivHP,vFuup)
+GO(glGetImageTransformParameterfvHP, vFuup)
+GO(glGetImageTransformParameterivHP, vFuup)
+GO(glImageTransformParameterfHP, vFuuf)
+GO(glImageTransformParameterfvHP, vFuup)
+GO(glImageTransformParameteriHP, vFuui)
+GO(glImageTransformParameterivHP, vFuup)
//IBM_multimode_draw_arrays
-GO(glMultiModeDrawArraysIBM,vFpppii)
-GO(glMultiModeDrawElementsIBM,vFppupii)
+GO(glMultiModeDrawArraysIBM, vFpppii)
+GO(glMultiModeDrawElementsIBM, vFppupii)
//IBM_static_data
-GO(glFlushStaticDataIBM,vFu)
+GO(glFlushStaticDataIBM, vFu)
//IBM_vertex_array_lists
-GO(glColorPointerListIBM,vFiuipi)
-GO(glEdgeFlagPointerListIBM,vFipi)
-GO(glFogCoordPointerListIBM,vFuipi)
-GO(glIndexPointerListIBM,vFuipi)
-GO(glNormalPointerListIBM,vFuipi)
-GO(glSecondaryColorPointerListIBM,vFiuipi)
-GO(glTexCoordPointerListIBM,vFiuipi)
-GO(glVertexPointerListIBM,vFiuipi)
+GO(glColorPointerListIBM, vFiuipi)
+GO(glEdgeFlagPointerListIBM, vFipi)
+GO(glFogCoordPointerListIBM, vFuipi)
+GO(glIndexPointerListIBM, vFuipi)
+GO(glNormalPointerListIBM, vFuipi)
+GO(glSecondaryColorPointerListIBM, vFiuipi)
+GO(glTexCoordPointerListIBM, vFiuipi)
+GO(glVertexPointerListIBM, vFiuipi)
//INGR_blend_func_separate
-GO(glBlendFuncSeparateINGR,vFuuuu)
+GO(glBlendFuncSeparateINGR, vFuuuu)
//INTEL_map_texture
-GO(glMapTexture2DINTEL,pFuiipp)
-GO(glSyncTextureINTEL,vFu)
-GO(glUnmapTexture2DINTEL,vFui)
+GO(glMapTexture2DINTEL, pFuiupp)
+GO(glSyncTextureINTEL, vFu)
+GO(glUnmapTexture2DINTEL, vFui)
//INTEL_parallel_arrays
-GO(glColorPointervINTEL,vFiup)
-GO(glNormalPointervINTEL,vFup)
-GO(glTexCoordPointervINTEL,vFiup)
-GO(glVertexPointervINTEL,vFiup)
+GO(glColorPointervINTEL, vFiup)
+GO(glNormalPointervINTEL, vFup)
+GO(glTexCoordPointervINTEL, vFiup)
+GO(glVertexPointervINTEL, vFiup)
//KHR_debug
-GOM(glDebugMessageCallback,vFEpp) // not ideal, because the my_ version will always exist, even if glDebugMessageCallback doesn't
-GO(glDebugMessageControl,vFuuuipi)
-GO(glDebugMessageInsert,vFuuuuip)
-GO(glGetDebugMessageLog,uFuipppppp)
-GO(glGetObjectLabel,vFuuipp)
-GO(glGetObjectPtrLabel,vFpipp)
-GO(glObjectLabel,vFuuip)
-GO(glObjectPtrLabel,vFpip)
-GO(glPopDebugGroup,vFv)
-GO(glPushDebugGroup,vFuuip)
+GOM(glDebugMessageCallback, vFEpp) // not ideal, because the my_ version will always exist, even if glDebugMessageCallback doesn't
+GO(glDebugMessageControl, vFuuuipi)
+GO(glDebugMessageInsert, vFuuuuip)
+GO(glGetDebugMessageLog, uFuipppppp)
+GO(glGetObjectLabel, vFuuipp)
+GO(glGetObjectPtrLabel, vFpipp)
+GO(glObjectLabel, vFuuip)
+GO(glObjectPtrLabel, vFpip)
+GO(glPopDebugGroup, vFv)
+GO(glPushDebugGroup, vFuuip)
//MESA_resize_buffers
-GO(glResizeBuffersMESA,vFv)
+GO(glResizeBuffersMESA, vFv)
//MESA_window_pos
-GO(glWindowPos2dMESA,vFdd)
-GO(glWindowPos2dvMESA,vFp)
-GO(glWindowPos2fMESA,vFff)
-GO(glWindowPos2fvMESA,vFp)
-GO(glWindowPos2iMESA,vFii)
-GO(glWindowPos2ivMESA,vFp)
-GO(glWindowPos2sMESA,vFii)
-GO(glWindowPos2svMESA,vFp)
-GO(glWindowPos3dMESA,vFddd)
-GO(glWindowPos3dvMESA,vFp)
-GO(glWindowPos3fMESA,vFfff)
-GO(glWindowPos3fvMESA,vFp)
-GO(glWindowPos3iMESA,vFiii)
-GO(glWindowPos3ivMESA,vFp)
-GO(glWindowPos3sMESA,vFiii)
-GO(glWindowPos3svMESA,vFp)
-GO(glWindowPos4dMESA,vFdddd)
-GO(glWindowPos4dvMESA,vFp)
-GO(glWindowPos4fMESA,vFffff)
-GO(glWindowPos4fvMESA,vFp)
-GO(glWindowPos4iMESA,vFiiii)
-GO(glWindowPos4ivMESA,vFp)
-GO(glWindowPos4sMESA,vFiiii)
-GO(glWindowPos4svMESA,vFp)
+GO(glWindowPos2dMESA, vFdd)
+GO(glWindowPos2dvMESA, vFp)
+GO(glWindowPos2fMESA, vFff)
+GO(glWindowPos2fvMESA, vFp)
+GO(glWindowPos2iMESA, vFii)
+GO(glWindowPos2ivMESA, vFp)
+GO(glWindowPos2sMESA, vFww)
+GO(glWindowPos2svMESA, vFp)
+GO(glWindowPos3dMESA, vFddd)
+GO(glWindowPos3dvMESA, vFp)
+GO(glWindowPos3fMESA, vFfff)
+GO(glWindowPos3fvMESA, vFp)
+GO(glWindowPos3iMESA, vFiii)
+GO(glWindowPos3ivMESA, vFp)
+GO(glWindowPos3sMESA, vFwww)
+GO(glWindowPos3svMESA, vFp)
+GO(glWindowPos4dMESA, vFdddd)
+GO(glWindowPos4dvMESA, vFp)
+GO(glWindowPos4fMESA, vFffff)
+GO(glWindowPos4fvMESA, vFp)
+GO(glWindowPos4iMESA, vFiiii)
+GO(glWindowPos4ivMESA, vFp)
+GO(glWindowPos4sMESA, vFwwww)
+GO(glWindowPos4svMESA, vFp)
//NVX_conditional_render
-GO(glBeginConditionalRenderNVX,vFu)
-GO(glEndConditionalRenderNVX,vFv)
+GO(glBeginConditionalRenderNVX, vFu)
+GO(glEndConditionalRenderNVX, vFv)
//NV_bindless_texture
-GO(glGetImageHandleNV,uFuiiiu)
-GO(glGetTextureHandleNV,uFu)
-GO(glGetTextureSamplerHandleNV,uFuu)
-GO(glIsImageHandleResidentNV,iFu)
-GO(glIsTextureHandleResidentNV,iFu)
-GO(glMakeImageHandleNonResidentNV,vFu)
-GO(glMakeImageHandleResidentNV,vFuu)
-GO(glMakeTextureHandleNonResidentNV,vFu)
-GO(glMakeTextureHandleResidentNV,vFu)
-GO(glProgramUniformHandleui64NV,vFuiu)
-GO(glProgramUniformHandleui64vNV,vFuiip)
-GO(glUniformHandleui64NV,vFiu)
-GO(glUniformHandleui64vNV,vFiip)
+GO(glGetImageHandleNV, LFuiCiu)
+GO(glGetTextureHandleNV, LFu)
+GO(glGetTextureSamplerHandleNV, LFuu)
+GO(glIsImageHandleResidentNV, CFL)
+GO(glIsTextureHandleResidentNV, iFu)
+GO(glMakeImageHandleNonResidentNV, vFu)
+GO(glMakeImageHandleResidentNV, vFLu)
+GO(glMakeTextureHandleNonResidentNV, vFu)
+GO(glMakeTextureHandleResidentNV, vFu)
+GO(glProgramUniformHandleui64NV, vFuiL)
+GO(glProgramUniformHandleui64vNV, vFuiip)
+GO(glUniformHandleui64NV, vFiL)
+GO(glUniformHandleui64vNV, vFiip)
//NV_conditional_render
-GO(glBeginConditionalRenderNV,vFuu)
-GO(glEndConditionalRenderNV,vFv)
+GO(glBeginConditionalRenderNV, vFuu)
+GO(glEndConditionalRenderNV, vFv)
//NV_copy_image
-GO(glCopyImageSubDataNV,vFuuiiiiuuiiiiiii)
+GO(glCopyImageSubDataNV, vFuuiiiiuuiiiiiii)
//NV_depth_buffer_float
-GO(glClearDepthdNV,vFd)
-GO(glDepthBoundsdNV,vFdd)
-GO(glDepthRangedNV,vFdd)
+GO(glClearDepthdNV, vFd)
+GO(glDepthBoundsdNV, vFdd)
+GO(glDepthRangedNV, vFdd)
//NV_draw_texture
-GO(glDrawTextureNV,vFuufffffffff)
+GO(glDrawTextureNV, vFuufffffffff)
//NV_evaluators
-GO(glEvalMapsNV,vFuu)
-GO(glGetMapAttribParameterfvNV,vFuuup)
-GO(glGetMapAttribParameterivNV,vFuuup)
-GO(glGetMapControlPointsNV,vFuuuiiip)
-GO(glGetMapParameterfvNV,vFuup)
-GO(glGetMapParameterivNV,vFuup)
-GO(glMapControlPointsNV,vFuuuiiiiip)
-GO(glMapParameterfvNV,vFuup)
-GO(glMapParameterivNV,vFuup)
+GO(glEvalMapsNV, vFuu)
+GO(glGetMapAttribParameterfvNV, vFuuup)
+GO(glGetMapAttribParameterivNV, vFuuup)
+GO(glGetMapControlPointsNV, vFuuuiiCp)
+GO(glGetMapParameterfvNV, vFuup)
+GO(glGetMapParameterivNV, vFuup)
+GO(glMapControlPointsNV, vFuuuiiiiCp)
+GO(glMapParameterfvNV, vFuup)
+GO(glMapParameterivNV, vFuup)
//NV_explicit_multisample
-GO(glGetMultisamplefvNV,vFuup)
-GO(glSampleMaskIndexedNV,vFui)
-GO(glTexRenderbufferNV,vFuu)
+GO(glGetMultisamplefvNV, vFuup)
+GO(glSampleMaskIndexedNV, vFui)
+GO(glTexRenderbufferNV, vFuu)
//NV_fence
-GO(glDeleteFencesNV,vFip)
-GO(glFinishFenceNV,vFu)
-GO(glGenFencesNV,vFip)
-GO(glGetFenceivNV,vFuup)
-GO(glIsFenceNV,iFu)
-GO(glSetFenceNV,vFuu)
-GO(glTestFenceNV,iFu)
+GO(glDeleteFencesNV, vFip)
+GO(glFinishFenceNV, vFu)
+GO(glGenFencesNV, vFip)
+GO(glGetFenceivNV, vFuup)
+GO(glIsFenceNV, iFu)
+GO(glSetFenceNV, vFuu)
+GO(glTestFenceNV, iFu)
//NV_fragment_program
-GO(glGetProgramNamedParameterdvNV,vFuipp)
-GO(glGetProgramNamedParameterfvNV,vFuipp)
-GO(glProgramNamedParameter4dNV,vFuipdddd)
-GO(glProgramNamedParameter4dvNV,vFuipp)
-GO(glProgramNamedParameter4fNV,vFuipffff)
-GO(glProgramNamedParameter4fvNV,vFuipp)
+GO(glGetProgramNamedParameterdvNV, vFuipp)
+GO(glGetProgramNamedParameterfvNV, vFuipp)
+GO(glProgramNamedParameter4dNV, vFuipdddd)
+GO(glProgramNamedParameter4dvNV, vFuipp)
+GO(glProgramNamedParameter4fNV, vFuipffff)
+GO(glProgramNamedParameter4fvNV, vFuipp)
//NV_framebuffer_multisample_coverage
-GO(glRenderbufferStorageMultisampleCoverageNV,vFuiiuii)
+GO(glRenderbufferStorageMultisampleCoverageNV, vFuiiuii)
//NV_geometry_program4
-GO(glFramebufferTextureEXT,vFuuui)
-GO(glFramebufferTextureFaceEXT,vFuuuiu)
-GO(glFramebufferTextureLayerEXT,vFuuuii)
-GO(glProgramVertexLimitNV,vFui)
+GO(glFramebufferTextureEXT, vFuuui)
+GO(glFramebufferTextureFaceEXT, vFuuuiu)
+GO(glFramebufferTextureLayerEXT, vFuuuii)
+GO(glProgramVertexLimitNV, vFui)
//NV_gpu_program4
-GO(glGetProgramEnvParameterIivNV,vFuup)
-GO(glGetProgramEnvParameterIuivNV,vFuup)
-GO(glGetProgramLocalParameterIivNV,vFuup)
-GO(glGetProgramLocalParameterIuivNV,vFuup)
-GO(glProgramEnvParameterI4iNV,vFuuiiii)
-GO(glProgramEnvParameterI4ivNV,vFuup)
-GO(glProgramEnvParameterI4uiNV,vFuuuuuu)
-GO(glProgramEnvParameterI4uivNV,vFuup)
-GO(glProgramEnvParametersI4ivNV,vFuuip)
-GO(glProgramEnvParametersI4uivNV,vFuuip)
-GO(glProgramLocalParameterI4iNV,vFuuiiii)
-GO(glProgramLocalParameterI4ivNV,vFuup)
-GO(glProgramLocalParameterI4uiNV,vFuuuuuu)
-GO(glProgramLocalParameterI4uivNV,vFuup)
-GO(glProgramLocalParametersI4ivNV,vFuuip)
-GO(glProgramLocalParametersI4uivNV,vFuuip)
+GO(glGetProgramEnvParameterIivNV, vFuup)
+GO(glGetProgramEnvParameterIuivNV, vFuup)
+GO(glGetProgramLocalParameterIivNV, vFuup)
+GO(glGetProgramLocalParameterIuivNV, vFuup)
+GO(glProgramEnvParameterI4iNV, vFuuiiii)
+GO(glProgramEnvParameterI4ivNV, vFuup)
+GO(glProgramEnvParameterI4uiNV, vFuuuuuu)
+GO(glProgramEnvParameterI4uivNV, vFuup)
+GO(glProgramEnvParametersI4ivNV, vFuuip)
+GO(glProgramEnvParametersI4uivNV, vFuuip)
+GO(glProgramLocalParameterI4iNV, vFuuiiii)
+GO(glProgramLocalParameterI4ivNV, vFuup)
+GO(glProgramLocalParameterI4uiNV, vFuuuuuu)
+GO(glProgramLocalParameterI4uivNV, vFuup)
+GO(glProgramLocalParametersI4ivNV, vFuuip)
+GO(glProgramLocalParametersI4uivNV, vFuuip)
//NV_gpu_program5
-GO(glGetProgramSubroutineParameteruivNV,vFuup)
-GO(glProgramSubroutineParametersuivNV,vFuip)
+GO(glGetProgramSubroutineParameteruivNV, vFuup)
+GO(glProgramSubroutineParametersuivNV, vFuip)
//NV_gpu_shader5
-GO(glGetUniformi64vNV,vFuip)
-GO(glProgramUniform1i64NV,vFuii)
-GO(glProgramUniform1i64vNV,vFuiip)
-GO(glProgramUniform1ui64NV,vFuiu)
-GO(glProgramUniform1ui64vNV,vFuiip)
-GO(glProgramUniform2i64NV,vFuiii)
-GO(glProgramUniform2i64vNV,vFuiip)
-GO(glProgramUniform2ui64NV,vFuiuu)
-GO(glProgramUniform2ui64vNV,vFuiip)
-GO(glProgramUniform3i64NV,vFuiiii)
-GO(glProgramUniform3i64vNV,vFuiip)
-GO(glProgramUniform3ui64NV,vFuiuuu)
-GO(glProgramUniform3ui64vNV,vFuiip)
-GO(glProgramUniform4i64NV,vFuiiiii)
-GO(glProgramUniform4i64vNV,vFuiip)
-GO(glProgramUniform4ui64NV,vFuiuuuu)
-GO(glProgramUniform4ui64vNV,vFuiip)
-GO(glUniform1i64NV,vFii)
-GO(glUniform1i64vNV,vFiip)
-GO(glUniform1ui64NV,vFiu)
-GO(glUniform1ui64vNV,vFiip)
-GO(glUniform2i64NV,vFiii)
-GO(glUniform2i64vNV,vFiip)
-GO(glUniform2ui64NV,vFiuu)
-GO(glUniform2ui64vNV,vFiip)
-GO(glUniform3i64NV,vFiiii)
-GO(glUniform3i64vNV,vFiip)
-GO(glUniform3ui64NV,vFiuuu)
-GO(glUniform3ui64vNV,vFiip)
-GO(glUniform4i64NV,vFiiiii)
-GO(glUniform4i64vNV,vFiip)
-GO(glUniform4ui64NV,vFiuuuu)
-GO(glUniform4ui64vNV,vFiip)
+GO(glGetUniformi64vNV, vFuip)
+GO(glProgramUniform1i64NV, vFuil)
+GO(glProgramUniform1i64vNV, vFuiip)
+GO(glProgramUniform1ui64NV, vFuiu)
+GO(glProgramUniform1ui64vNV, vFuiip)
+GO(glProgramUniform2i64NV, vFuill)
+GO(glProgramUniform2i64vNV, vFuiip)
+GO(glProgramUniform2ui64NV, vFuiLL)
+GO(glProgramUniform2ui64vNV, vFuiip)
+GO(glProgramUniform3i64NV, vFuilll)
+GO(glProgramUniform3i64vNV, vFuiip)
+GO(glProgramUniform3ui64NV, vFuiLLL)
+GO(glProgramUniform3ui64vNV, vFuiip)
+GO(glProgramUniform4i64NV, vFuillll)
+GO(glProgramUniform4i64vNV, vFuiip)
+GO(glProgramUniform4ui64NV, vFuiLLLL)
+GO(glProgramUniform4ui64vNV, vFuiip)
+GO(glUniform1i64NV, vFil)
+GO(glUniform1i64vNV, vFiip)
+GO(glUniform1ui64NV, vFiu)
+GO(glUniform1ui64vNV, vFiip)
+GO(glUniform2i64NV, vFill)
+GO(glUniform2i64vNV, vFiip)
+GO(glUniform2ui64NV, vFiLL)
+GO(glUniform2ui64vNV, vFiip)
+GO(glUniform3i64NV, vFilll)
+GO(glUniform3i64vNV, vFiip)
+GO(glUniform3ui64NV, vFiLLL)
+GO(glUniform3ui64vNV, vFiip)
+GO(glUniform4i64NV, vFillll)
+GO(glUniform4i64vNV, vFiip)
+GO(glUniform4ui64NV, vFiLLLL)
+GO(glUniform4ui64vNV, vFiip)
//NV_half_float
-GO(glColor3hNV,vFiii)
-GO(glColor3hvNV,vFp)
-GO(glColor4hNV,vFiiii)
-GO(glColor4hvNV,vFp)
-GO(glFogCoordhNV,vFi)
-GO(glFogCoordhvNV,vFp)
-GO(glMultiTexCoord1hNV,vFui)
-GO(glMultiTexCoord1hvNV,vFup)
-GO(glMultiTexCoord2hNV,vFuii)
-GO(glMultiTexCoord2hvNV,vFup)
-GO(glMultiTexCoord3hNV,vFuiii)
-GO(glMultiTexCoord3hvNV,vFup)
-GO(glMultiTexCoord4hNV,vFuiiii)
-GO(glMultiTexCoord4hvNV,vFup)
-GO(glNormal3hNV,vFiii)
-GO(glNormal3hvNV,vFp)
-GO(glSecondaryColor3hNV,vFiii)
-GO(glSecondaryColor3hvNV,vFp)
-GO(glTexCoord1hNV,vFi)
-GO(glTexCoord1hvNV,vFp)
-GO(glTexCoord2hNV,vFii)
-GO(glTexCoord2hvNV,vFp)
-GO(glTexCoord3hNV,vFiii)
-GO(glTexCoord3hvNV,vFp)
-GO(glTexCoord4hNV,vFiiii)
-GO(glTexCoord4hvNV,vFp)
-GO(glVertex2hNV,vFii)
-GO(glVertex2hvNV,vFp)
-GO(glVertex3hNV,vFiii)
-GO(glVertex3hvNV,vFp)
-GO(glVertex4hNV,vFiiii)
-GO(glVertex4hvNV,vFp)
-GO(glVertexAttrib1hNV,vFui)
-GO(glVertexAttrib1hvNV,vFup)
-GO(glVertexAttrib2hNV,vFuii)
-GO(glVertexAttrib2hvNV,vFup)
-GO(glVertexAttrib3hNV,vFuiii)
-GO(glVertexAttrib3hvNV,vFup)
-GO(glVertexAttrib4hNV,vFuiiii)
-GO(glVertexAttrib4hvNV,vFup)
-GO(glVertexAttribs1hvNV,vFuip)
-GO(glVertexAttribs2hvNV,vFuip)
-GO(glVertexAttribs3hvNV,vFuip)
-GO(glVertexAttribs4hvNV,vFuip)
-GO(glVertexWeighthNV,vFi)
-GO(glVertexWeighthvNV,vFp)
+GO(glColor3hNV, vFiii)
+GO(glColor3hvNV, vFp)
+GO(glColor4hNV, vFiiii)
+GO(glColor4hvNV, vFp)
+GO(glFogCoordhNV, vFi)
+GO(glFogCoordhvNV, vFp)
+GO(glMultiTexCoord1hNV, vFuW)
+GO(glMultiTexCoord1hvNV, vFup)
+GO(glMultiTexCoord2hNV, vFuWW)
+GO(glMultiTexCoord2hvNV, vFup)
+GO(glMultiTexCoord3hNV, vFuWWW)
+GO(glMultiTexCoord3hvNV, vFup)
+GO(glMultiTexCoord4hNV, vFuWWWW)
+GO(glMultiTexCoord4hvNV, vFup)
+GO(glNormal3hNV, vFiii)
+GO(glNormal3hvNV, vFp)
+GO(glSecondaryColor3hNV, vFWWW)
+GO(glSecondaryColor3hvNV, vFp)
+GO(glTexCoord1hNV, vFi)
+GO(glTexCoord1hvNV, vFp)
+GO(glTexCoord2hNV, vFWW)
+GO(glTexCoord2hvNV, vFp)
+GO(glTexCoord3hNV, vFiii)
+GO(glTexCoord3hvNV, vFp)
+GO(glTexCoord4hNV, vFWWWW)
+GO(glTexCoord4hvNV, vFp)
+GO(glVertex2hNV, vFii)
+GO(glVertex2hvNV, vFp)
+GO(glVertex3hNV, vFiii)
+GO(glVertex3hvNV, vFp)
+GO(glVertex4hNV, vFiiii)
+GO(glVertex4hvNV, vFp)
+GO(glVertexAttrib1hNV, vFuW)
+GO(glVertexAttrib1hvNV, vFup)
+GO(glVertexAttrib2hNV, vFuWW)
+GO(glVertexAttrib2hvNV, vFup)
+GO(glVertexAttrib3hNV, vFuWWW)
+GO(glVertexAttrib3hvNV, vFup)
+GO(glVertexAttrib4hNV, vFuWWWW)
+GO(glVertexAttrib4hvNV, vFup)
+GO(glVertexAttribs1hvNV, vFuip)
+GO(glVertexAttribs2hvNV, vFuip)
+GO(glVertexAttribs3hvNV, vFuip)
+GO(glVertexAttribs4hvNV, vFuip)
+GO(glVertexWeighthNV, vFW)
+GO(glVertexWeighthvNV, vFp)
//NV_occlusion_query
-GO(glBeginOcclusionQueryNV,vFu)
-GO(glDeleteOcclusionQueriesNV,vFip)
-GO(glEndOcclusionQueryNV,vFv)
-GO(glGenOcclusionQueriesNV,vFip)
-GO(glGetOcclusionQueryivNV,vFuup)
-GO(glGetOcclusionQueryuivNV,vFuup)
-GO(glIsOcclusionQueryNV,iFu)
+GO(glBeginOcclusionQueryNV, vFu)
+GO(glDeleteOcclusionQueriesNV, vFip)
+GO(glEndOcclusionQueryNV, vFv)
+GO(glGenOcclusionQueriesNV, vFip)
+GO(glGetOcclusionQueryivNV, vFuup)
+GO(glGetOcclusionQueryuivNV, vFuup)
+GO(glIsOcclusionQueryNV, iFu)
//NV_parameter_buffer_object
-GO(glProgramBufferParametersIivNV,vFuuuip)
-GO(glProgramBufferParametersIuivNV,vFuuuip)
-GO(glProgramBufferParametersfvNV,vFuuuip)
+GO(glProgramBufferParametersIivNV, vFuuuip)
+GO(glProgramBufferParametersIuivNV, vFuuuip)
+GO(glProgramBufferParametersfvNV, vFuuuip)
//NV_pixel_data_range
-GO(glFlushPixelDataRangeNV,vFu)
-GO(glPixelDataRangeNV,vFuip)
+GO(glFlushPixelDataRangeNV, vFu)
+GO(glPixelDataRangeNV, vFuip)
//NV_point_sprite
-GO(glPointParameteriNV,vFui)
-GO(glPointParameterivNV,vFup)
+GO(glPointParameteriNV, vFui)
+GO(glPointParameterivNV, vFup)
//NV_present_video
-GO(glGetVideoi64vNV,vFuup)
-GO(glGetVideoivNV,vFuup)
-GO(glGetVideoui64vNV,vFuup)
-GO(glGetVideouivNV,vFuup)
-GO(glPresentFrameDualFillNV,vFuuuuuuuuuuuuu)
-GO(glPresentFrameKeyedNV,vFuuuuuuuuuuu)
+GO(glGetVideoi64vNV, vFuup)
+GO(glGetVideoivNV, vFuup)
+GO(glGetVideoui64vNV, vFuup)
+GO(glGetVideouivNV, vFuup)
+GO(glPresentFrameDualFillNV, vFuLuuuuuuuuuuu)
+GO(glPresentFrameKeyedNV, vFuLuuuuuuuuu)
//NV_primitive_restart
-GO(glPrimitiveRestartIndexNV,vFu)
-GO(glPrimitiveRestartNV,vFv)
+GO(glPrimitiveRestartIndexNV, vFu)
+GO(glPrimitiveRestartNV, vFv)
//NV_register_combiners
-GO(glCombinerInputNV,vFuuuuuu)
-GO(glCombinerOutputNV,vFuuuuuuuiii)
-GO(glCombinerParameterfNV,vFuf)
-GO(glCombinerParameterfvNV,vFup)
-GO(glCombinerParameteriNV,vFui)
-GO(glCombinerParameterivNV,vFup)
-GO(glFinalCombinerInputNV,vFuuuu)
-GO(glGetCombinerInputParameterfvNV,vFuuuup)
-GO(glGetCombinerInputParameterivNV,vFuuuup)
-GO(glGetCombinerOutputParameterfvNV,vFuuup)
-GO(glGetCombinerOutputParameterivNV,vFuuup)
-GO(glGetFinalCombinerInputParameterfvNV,vFuup)
-GO(glGetFinalCombinerInputParameterivNV,vFuup)
+GO(glCombinerInputNV, vFuuuuuu)
+GO(glCombinerOutputNV, vFuuuuuuuCCC)
+GO(glCombinerParameterfNV, vFuf)
+GO(glCombinerParameterfvNV, vFup)
+GO(glCombinerParameteriNV, vFui)
+GO(glCombinerParameterivNV, vFup)
+GO(glFinalCombinerInputNV, vFuuuu)
+GO(glGetCombinerInputParameterfvNV, vFuuuup)
+GO(glGetCombinerInputParameterivNV, vFuuuup)
+GO(glGetCombinerOutputParameterfvNV, vFuuup)
+GO(glGetCombinerOutputParameterivNV, vFuuup)
+GO(glGetFinalCombinerInputParameterfvNV, vFuup)
+GO(glGetFinalCombinerInputParameterivNV, vFuup)
//NV_register_combiners2
-GO(glCombinerStageParameterfvNV,vFuup)
-GO(glGetCombinerStageParameterfvNV,vFuup)
+GO(glCombinerStageParameterfvNV, vFuup)
+GO(glGetCombinerStageParameterfvNV, vFuup)
//NV_shader_buffer_load
-GO(glGetBufferParameterui64vNV,vFuup)
-GO(glGetIntegerui64vNV,vFup)
-GO(glGetNamedBufferParameterui64vNV,vFuup)
-GO(glGetUniformui64vNV,vFuip)
-GO(glIsBufferResidentNV,iFu)
-GO(glIsNamedBufferResidentNV,iFu)
-GO(glMakeBufferNonResidentNV,vFu)
-GO(glMakeBufferResidentNV,vFuu)
-GO(glMakeNamedBufferNonResidentNV,vFu)
-GO(glMakeNamedBufferResidentNV,vFuu)
-GO(glProgramUniformui64NV,vFuiu)
-GO(glProgramUniformui64vNV,vFuiip)
-GO(glUniformui64NV,vFiu)
-GO(glUniformui64vNV,vFiip)
+GO(glGetBufferParameterui64vNV, vFuup)
+GO(glGetIntegerui64vNV, vFup)
+GO(glGetNamedBufferParameterui64vNV, vFuup)
+GO(glGetUniformui64vNV, vFuip)
+GO(glIsBufferResidentNV, CFu)
+GO(glIsNamedBufferResidentNV, iFu)
+GO(glMakeBufferNonResidentNV, vFu)
+GO(glMakeBufferResidentNV, vFuu)
+GO(glMakeNamedBufferNonResidentNV, vFu)
+GO(glMakeNamedBufferResidentNV, vFuu)
+GO(glProgramUniformui64NV, vFuiL)
+GO(glProgramUniformui64vNV, vFuiip)
+GO(glUniformui64NV, vFiL)
+GO(glUniformui64vNV, vFiip)
//NV_texture_barrier
-GO(glTextureBarrierNV,vFv)
+GO(glTextureBarrierNV, vFv)
//NV_texture_multisample
-GO(glTexImage2DMultisampleCoverageNV,vFuiiiiii)
-GO(glTexImage3DMultisampleCoverageNV,vFuiiiiiii)
-GO(glTextureImage2DMultisampleCoverageNV,vFuuiiiiii)
-GO(glTextureImage2DMultisampleNV,vFuuiiiii)
-GO(glTextureImage3DMultisampleCoverageNV,vFuuiiiiiii)
-GO(glTextureImage3DMultisampleNV,vFuuiiiiii)
+GO(glTexImage2DMultisampleCoverageNV, vFuiiiiiC)
+GO(glTexImage3DMultisampleCoverageNV, vFuiiiiiiC)
+GO(glTextureImage2DMultisampleCoverageNV, vFuuiiiiiC)
+GO(glTextureImage2DMultisampleNV, vFuuiiiiC)
+GO(glTextureImage3DMultisampleCoverageNV, vFuuiiiiiiC)
+GO(glTextureImage3DMultisampleNV, vFuuiiiiiC)
//NV_transform_feedback
-GO(glActiveVaryingNV,vFup)
-GO(glBeginTransformFeedbackNV,vFu)
-GO(glBindBufferBaseNV,vFuuu)
-GO(glBindBufferOffsetNV,vFuuui)
-GO(glBindBufferRangeNV,vFuuuii)
-GO(glEndTransformFeedbackNV,vFv)
-GO(glGetActiveVaryingNV,vFuuipppp)
-GO(glGetTransformFeedbackVaryingNV,vFuup)
-GO(glGetVaryingLocationNV,iFup)
-GO(glTransformFeedbackAttribsNV,vFipu)
-GO(glTransformFeedbackStreamAttribsNV,vFipipu)
-GO(glTransformFeedbackVaryingsNV,vFuipu)
+GO(glActiveVaryingNV, vFup)
+GO(glBeginTransformFeedbackNV, vFu)
+GO(glBindBufferBaseNV, vFuuu)
+GO(glBindBufferOffsetNV, vFuuul)
+GO(glBindBufferRangeNV, vFuuull)
+GO(glEndTransformFeedbackNV, vFv)
+GO(glGetActiveVaryingNV, vFuuipppp)
+GO(glGetTransformFeedbackVaryingNV, vFuup)
+GO(glGetVaryingLocationNV, iFup)
+GO(glTransformFeedbackAttribsNV, vFipu)
+GO(glTransformFeedbackStreamAttribsNV, vFipipu)
+GO(glTransformFeedbackVaryingsNV, vFuipu)
//NV_transform_feedback2
-GO(glBindTransformFeedbackNV,vFuu)
-GO(glDeleteTransformFeedbacksNV,vFip)
-GO(glDrawTransformFeedbackNV,vFuu)
-GO(glGenTransformFeedbacksNV,vFip)
-GO(glIsTransformFeedbackNV,iFu)
-GO(glPauseTransformFeedbackNV,vFv)
-GO(glResumeTransformFeedbackNV,vFv)
+GO(glBindTransformFeedbackNV, vFuu)
+GO(glDeleteTransformFeedbacksNV, vFip)
+GO(glDrawTransformFeedbackNV, vFuu)
+GO(glGenTransformFeedbacksNV, vFip)
+GO(glIsTransformFeedbackNV, iFu)
+GO(glPauseTransformFeedbackNV, vFv)
+GO(glResumeTransformFeedbackNV, vFv)
//NV_vdpau_interop
-GO(glVDPAUFiniNV,vFv)
-GO(glVDPAUGetSurfaceivNV,vFuuipp)
-GO(glVDPAUInitNV,vFpp)
-GO(glVDPAUIsSurfaceNV,vFu)
-GO(glVDPAUMapSurfacesNV,vFip)
-GO(glVDPAURegisterOutputSurfaceNV,uFpuip)
-GO(glVDPAURegisterVideoSurfaceNV,uFpuip)
-GO(glVDPAUSurfaceAccessNV,vFuu)
-GO(glVDPAUUnmapSurfacesNV,vFip)
-GO(glVDPAUUnregisterSurfaceNV,vFu)
+GO(glVDPAUFiniNV, vFv)
+GO(glVDPAUGetSurfaceivNV, vFluipp)
+GO(glVDPAUInitNV, vFpp)
+GO(glVDPAUIsSurfaceNV, CFl)
+GO(glVDPAUMapSurfacesNV, vFip)
+GO(glVDPAURegisterOutputSurfaceNV, lFpuip)
+GO(glVDPAURegisterVideoSurfaceNV, uFpuip)
+GO(glVDPAUSurfaceAccessNV, vFlu)
+GO(glVDPAUUnmapSurfacesNV, vFip)
+GO(glVDPAUUnregisterSurfaceNV, vFl)
//NV_vertex_array_range
-GO(glFlushVertexArrayRangeNV,vFv)
-GO(glVertexArrayRangeNV,vFip)
+GO(glFlushVertexArrayRangeNV, vFv)
+GO(glVertexArrayRangeNV, vFip)
//NV_vertex_attrib_integer_64bit
-GO(glGetVertexAttribLi64vNV,vFuup)
-GO(glGetVertexAttribLui64vNV,vFuup)
-GO(glVertexAttribL1i64NV,vFui)
-GO(glVertexAttribL1i64vNV,vFup)
-GO(glVertexAttribL1ui64NV,vFuu)
-GO(glVertexAttribL1ui64vNV,vFup)
-GO(glVertexAttribL2i64NV,vFuii)
-GO(glVertexAttribL2i64vNV,vFup)
-GO(glVertexAttribL2ui64NV,vFuuu)
-GO(glVertexAttribL2ui64vNV,vFup)
-GO(glVertexAttribL3i64NV,vFuiii)
-GO(glVertexAttribL3i64vNV,vFup)
-GO(glVertexAttribL3ui64NV,vFuuuu)
-GO(glVertexAttribL3ui64vNV,vFup)
-GO(glVertexAttribL4i64NV,vFuiiii)
-GO(glVertexAttribL4i64vNV,vFup)
-GO(glVertexAttribL4ui64NV,vFuuuuu)
-GO(glVertexAttribL4ui64vNV,vFup)
-GO(glVertexAttribLFormatNV,vFuiui)
+GO(glGetVertexAttribLi64vNV, vFuup)
+GO(glGetVertexAttribLui64vNV, vFuup)
+GO(glVertexAttribL1i64NV, vFul)
+GO(glVertexAttribL1i64vNV, vFup)
+GO(glVertexAttribL1ui64NV, vFuL)
+GO(glVertexAttribL1ui64vNV, vFup)
+GO(glVertexAttribL2i64NV, vFull)
+GO(glVertexAttribL2i64vNV, vFup)
+GO(glVertexAttribL2ui64NV, vFuLL)
+GO(glVertexAttribL2ui64vNV, vFup)
+GO(glVertexAttribL3i64NV, vFulll)
+GO(glVertexAttribL3i64vNV, vFup)
+GO(glVertexAttribL3ui64NV, vFuLLL)
+GO(glVertexAttribL3ui64vNV, vFup)
+GO(glVertexAttribL4i64NV, vFullll)
+GO(glVertexAttribL4i64vNV, vFup)
+GO(glVertexAttribL4ui64NV, vFuLLLL)
+GO(glVertexAttribL4ui64vNV, vFup)
+GO(glVertexAttribLFormatNV, vFuiui)
//NV_vertex_buffer_unified_memory
-GO(glBufferAddressRangeNV,vFuuui)
-GO(glColorFormatNV,vFiui)
-GO(glEdgeFlagFormatNV,vFi)
-GO(glFogCoordFormatNV,vFui)
-GO(glGetIntegerui64i_vNV,vFuup)
-GO(glIndexFormatNV,vFui)
-GO(glNormalFormatNV,vFui)
-GO(glSecondaryColorFormatNV,vFiui)
-GO(glTexCoordFormatNV,vFiui)
-GO(glVertexAttribFormatNV,vFuiuii)
-GO(glVertexAttribIFormatNV,vFuiui)
-GO(glVertexFormatNV,vFiui)
+GO(glBufferAddressRangeNV, vFuuLl)
+GO(glColorFormatNV, vFiui)
+GO(glEdgeFlagFormatNV, vFi)
+GO(glFogCoordFormatNV, vFui)
+GO(glGetIntegerui64i_vNV, vFuup)
+GO(glIndexFormatNV, vFui)
+GO(glNormalFormatNV, vFui)
+GO(glSecondaryColorFormatNV, vFiui)
+GO(glTexCoordFormatNV, vFiui)
+GO(glVertexAttribFormatNV, vFuiuCi)
+GO(glVertexAttribIFormatNV, vFuiui)
+GO(glVertexFormatNV, vFiui)
//NV_vertex_program
-GO(glAreProgramsResidentNV,iFipp)
-GO(glBindProgramNV,vFuu)
-GO(glDeleteProgramsNV,vFip)
-GO(glExecuteProgramNV,vFuup)
-GO(glGenProgramsNV,vFip)
-GO(glGetProgramParameterdvNV,vFuuup)
-GO(glGetProgramParameterfvNV,vFuuup)
-GO(glGetProgramStringNV,vFuup)
-GO(glGetProgramivNV,vFuup)
-GO(glGetTrackMatrixivNV,vFuuup)
-GO(glGetVertexAttribPointervNV,vFuup)
-GO(glGetVertexAttribdvNV,vFuup)
-GO(glGetVertexAttribfvNV,vFuup)
-GO(glGetVertexAttribivNV,vFuup)
-GO(glIsProgramNV,iFu)
-GO(glLoadProgramNV,vFuuip)
-GO(glProgramParameter4dNV,vFuudddd)
-GO(glProgramParameter4dvNV,vFuup)
-GO(glProgramParameter4fNV,vFuuffff)
-GO(glProgramParameter4fvNV,vFuup)
-GO(glProgramParameters4dvNV,vFuuip)
-GO(glProgramParameters4fvNV,vFuuip)
-GO(glRequestResidentProgramsNV,vFip)
-GO(glTrackMatrixNV,vFuuuu)
-GO(glVertexAttrib1dNV,vFud)
-GO(glVertexAttrib1dvNV,vFup)
-GO(glVertexAttrib1fNV,vFuf)
-GO(glVertexAttrib1fvNV,vFup)
-GO(glVertexAttrib1sNV,vFui)
-GO(glVertexAttrib1svNV,vFup)
-GO(glVertexAttrib2dNV,vFudd)
-GO(glVertexAttrib2dvNV,vFup)
-GO(glVertexAttrib2fNV,vFuff)
-GO(glVertexAttrib2fvNV,vFup)
-GO(glVertexAttrib2sNV,vFuii)
-GO(glVertexAttrib2svNV,vFup)
-GO(glVertexAttrib3dNV,vFuddd)
-GO(glVertexAttrib3dvNV,vFup)
-GO(glVertexAttrib3fNV,vFufff)
-GO(glVertexAttrib3fvNV,vFup)
-GO(glVertexAttrib3sNV,vFuiii)
-GO(glVertexAttrib3svNV,vFup)
-GO(glVertexAttrib4dNV,vFudddd)
-GO(glVertexAttrib4dvNV,vFup)
-GO(glVertexAttrib4fNV,vFuffff)
-GO(glVertexAttrib4fvNV,vFup)
-GO(glVertexAttrib4sNV,vFuiiii)
-GO(glVertexAttrib4svNV,vFup)
-GO(glVertexAttrib4ubNV,vFuuuuu)
-GO(glVertexAttrib4ubvNV,vFup)
-GO(glVertexAttribPointerNV,vFuiuip)
-GO(glVertexAttribs1dvNV,vFuip)
-GO(glVertexAttribs1fvNV,vFuip)
-GO(glVertexAttribs1svNV,vFuip)
-GO(glVertexAttribs2dvNV,vFuip)
-GO(glVertexAttribs2fvNV,vFuip)
-GO(glVertexAttribs2svNV,vFuip)
-GO(glVertexAttribs3dvNV,vFuip)
-GO(glVertexAttribs3fvNV,vFuip)
-GO(glVertexAttribs3svNV,vFuip)
-GO(glVertexAttribs4dvNV,vFuip)
-GO(glVertexAttribs4fvNV,vFuip)
-GO(glVertexAttribs4svNV,vFuip)
-GO(glVertexAttribs4ubvNV,vFuip)
+GO(glAreProgramsResidentNV, CFipp)
+GO(glBindProgramNV, vFuu)
+GO(glDeleteProgramsNV, vFip)
+GO(glExecuteProgramNV, vFuup)
+GO(glGenProgramsNV, vFip)
+GO(glGetProgramParameterdvNV, vFuuup)
+GO(glGetProgramParameterfvNV, vFuuup)
+GO(glGetProgramStringNV, vFuup)
+GO(glGetProgramivNV, vFuup)
+GO(glGetTrackMatrixivNV, vFuuup)
+GO(glGetVertexAttribPointervNV, vFuup)
+GO(glGetVertexAttribdvNV, vFuup)
+GO(glGetVertexAttribfvNV, vFuup)
+GO(glGetVertexAttribivNV, vFuup)
+GO(glIsProgramNV, iFu)
+GO(glLoadProgramNV, vFuuip)
+GO(glProgramParameter4dNV, vFuudddd)
+GO(glProgramParameter4dvNV, vFuup)
+GO(glProgramParameter4fNV, vFuuffff)
+GO(glProgramParameter4fvNV, vFuup)
+GO(glProgramParameters4dvNV, vFuuip)
+GO(glProgramParameters4fvNV, vFuuip)
+GO(glRequestResidentProgramsNV, vFip)
+GO(glTrackMatrixNV, vFuuuu)
+GO(glVertexAttrib1dNV, vFud)
+GO(glVertexAttrib1dvNV, vFup)
+GO(glVertexAttrib1fNV, vFuf)
+GO(glVertexAttrib1fvNV, vFup)
+GO(glVertexAttrib1sNV, vFuw)
+GO(glVertexAttrib1svNV, vFup)
+GO(glVertexAttrib2dNV, vFudd)
+GO(glVertexAttrib2dvNV, vFup)
+GO(glVertexAttrib2fNV, vFuff)
+GO(glVertexAttrib2fvNV, vFup)
+GO(glVertexAttrib2sNV, vFuww)
+GO(glVertexAttrib2svNV, vFup)
+GO(glVertexAttrib3dNV, vFuddd)
+GO(glVertexAttrib3dvNV, vFup)
+GO(glVertexAttrib3fNV, vFufff)
+GO(glVertexAttrib3fvNV, vFup)
+GO(glVertexAttrib3sNV, vFuwww)
+GO(glVertexAttrib3svNV, vFup)
+GO(glVertexAttrib4dNV, vFudddd)
+GO(glVertexAttrib4dvNV, vFup)
+GO(glVertexAttrib4fNV, vFuffff)
+GO(glVertexAttrib4fvNV, vFup)
+GO(glVertexAttrib4sNV, vFuwwww)
+GO(glVertexAttrib4svNV, vFup)
+GO(glVertexAttrib4ubNV, vFuCCCC)
+GO(glVertexAttrib4ubvNV, vFup)
+GO(glVertexAttribPointerNV, vFuiuip)
+GO(glVertexAttribs1dvNV, vFuip)
+GO(glVertexAttribs1fvNV, vFuip)
+GO(glVertexAttribs1svNV, vFuip)
+GO(glVertexAttribs2dvNV, vFuip)
+GO(glVertexAttribs2fvNV, vFuip)
+GO(glVertexAttribs2svNV, vFuip)
+GO(glVertexAttribs3dvNV, vFuip)
+GO(glVertexAttribs3fvNV, vFuip)
+GO(glVertexAttribs3svNV, vFuip)
+GO(glVertexAttribs4dvNV, vFuip)
+GO(glVertexAttribs4fvNV, vFuip)
+GO(glVertexAttribs4svNV, vFuip)
+GO(glVertexAttribs4ubvNV, vFuip)
//NV_vertex_program4
-GO(glGetVertexAttribIivEXT,vFuup)
-GO(glGetVertexAttribIuivEXT,vFuup)
-GO(glVertexAttribI1iEXT,vFui)
-GO(glVertexAttribI1ivEXT,vFup)
-GO(glVertexAttribI1uiEXT,vFuu)
-GO(glVertexAttribI1uivEXT,vFup)
-GO(glVertexAttribI2iEXT,vFuii)
-GO(glVertexAttribI2ivEXT,vFup)
-GO(glVertexAttribI2uiEXT,vFuuu)
-GO(glVertexAttribI2uivEXT,vFup)
-GO(glVertexAttribI3iEXT,vFuiii)
-GO(glVertexAttribI3ivEXT,vFup)
-GO(glVertexAttribI3uiEXT,vFuuuu)
-GO(glVertexAttribI3uivEXT,vFup)
-GO(glVertexAttribI4bvEXT,vFup)
-GO(glVertexAttribI4iEXT,vFuiiii)
-GO(glVertexAttribI4ivEXT,vFup)
-GO(glVertexAttribI4svEXT,vFup)
-GO(glVertexAttribI4ubvEXT,vFup)
-GO(glVertexAttribI4uiEXT,vFuuuuu)
-GO(glVertexAttribI4uivEXT,vFup)
-GO(glVertexAttribI4usvEXT,vFup)
-GO(glVertexAttribIPointerEXT,vFuiuip)
+GO(glGetVertexAttribIivEXT, vFuup)
+GO(glGetVertexAttribIuivEXT, vFuup)
+GO(glVertexAttribI1iEXT, vFui)
+GO(glVertexAttribI1ivEXT, vFup)
+GO(glVertexAttribI1uiEXT, vFuu)
+GO(glVertexAttribI1uivEXT, vFup)
+GO(glVertexAttribI2iEXT, vFuii)
+GO(glVertexAttribI2ivEXT, vFup)
+GO(glVertexAttribI2uiEXT, vFuuu)
+GO(glVertexAttribI2uivEXT, vFup)
+GO(glVertexAttribI3iEXT, vFuiii)
+GO(glVertexAttribI3ivEXT, vFup)
+GO(glVertexAttribI3uiEXT, vFuuuu)
+GO(glVertexAttribI3uivEXT, vFup)
+GO(glVertexAttribI4bvEXT, vFup)
+GO(glVertexAttribI4iEXT, vFuiiii)
+GO(glVertexAttribI4ivEXT, vFup)
+GO(glVertexAttribI4svEXT, vFup)
+GO(glVertexAttribI4ubvEXT, vFup)
+GO(glVertexAttribI4uiEXT, vFuuuuu)
+GO(glVertexAttribI4uivEXT, vFup)
+GO(glVertexAttribI4usvEXT, vFup)
+GO(glVertexAttribIPointerEXT, vFuiuip)
//NV_video_capture
-GO(glBeginVideoCaptureNV,vFu)
-GO(glBindVideoCaptureStreamBufferNV,vFuuui)
-GO(glBindVideoCaptureStreamTextureNV,vFuuuuu)
-GO(glEndVideoCaptureNV,vFu)
-GO(glGetVideoCaptureStreamdvNV,vFuuup)
-GO(glGetVideoCaptureStreamfvNV,vFuuup)
-GO(glGetVideoCaptureStreamivNV,vFuuup)
-GO(glGetVideoCaptureivNV,vFuup)
-GO(glVideoCaptureNV,uFupp)
-GO(glVideoCaptureStreamParameterdvNV,vFuuup)
-GO(glVideoCaptureStreamParameterfvNV,vFuuup)
-GO(glVideoCaptureStreamParameterivNV,vFuuup)
+GO(glBeginVideoCaptureNV, vFu)
+GO(glBindVideoCaptureStreamBufferNV, vFuuul)
+GO(glBindVideoCaptureStreamTextureNV, vFuuuuu)
+GO(glEndVideoCaptureNV, vFu)
+GO(glGetVideoCaptureStreamdvNV, vFuuup)
+GO(glGetVideoCaptureStreamfvNV, vFuuup)
+GO(glGetVideoCaptureStreamivNV, vFuuup)
+GO(glGetVideoCaptureivNV, vFuup)
+GO(glVideoCaptureNV, uFupp)
+GO(glVideoCaptureStreamParameterdvNV, vFuuup)
+GO(glVideoCaptureStreamParameterfvNV, vFuuup)
+GO(glVideoCaptureStreamParameterivNV, vFuuup)
//OES_byte_coordinates
-GO(glMultiTexCoord1bOES,vFui)
-GO(glMultiTexCoord1bvOES,vFup)
-GO(glMultiTexCoord2bOES,vFuii)
-GO(glMultiTexCoord2bvOES,vFup)
-GO(glMultiTexCoord3bOES,vFuiii)
-GO(glMultiTexCoord3bvOES,vFup)
-GO(glMultiTexCoord4bOES,vFuiiii)
-GO(glMultiTexCoord4bvOES,vFup)
-GO(glTexCoord1bOES,vFi)
-GO(glTexCoord1bvOES,vFp)
-GO(glTexCoord2bOES,vFii)
-GO(glTexCoord2bvOES,vFp)
-GO(glTexCoord3bOES,vFiii)
-GO(glTexCoord3bvOES,vFp)
-GO(glTexCoord4bOES,vFiiii)
-GO(glTexCoord4bvOES,vFp)
-GO(glVertex2bOES,vFi)
-GO(glVertex2bvOES,vFp)
-GO(glVertex3bOES,vFii)
-GO(glVertex3bvOES,vFp)
-GO(glVertex4bOES,vFiii)
-GO(glVertex4bvOES,vFp)
+GO(glMultiTexCoord1bOES, vFuc)
+GO(glMultiTexCoord1bvOES, vFup)
+GO(glMultiTexCoord2bOES, vFucc)
+GO(glMultiTexCoord2bvOES, vFup)
+GO(glMultiTexCoord3bOES, vFuiii)
+GO(glMultiTexCoord3bvOES, vFup)
+GO(glMultiTexCoord4bOES, vFucccc)
+GO(glMultiTexCoord4bvOES, vFup)
+GO(glTexCoord1bOES, vFi)
+GO(glTexCoord1bvOES, vFp)
+GO(glTexCoord2bOES, vFii)
+GO(glTexCoord2bvOES, vFp)
+GO(glTexCoord3bOES, vFiii)
+GO(glTexCoord3bvOES, vFp)
+GO(glTexCoord4bOES, vFiiii)
+GO(glTexCoord4bvOES, vFp)
+GO(glVertex2bOES, vFcc)
+GO(glVertex2bvOES, vFp)
+GO(glVertex3bOES, vFii)
+GO(glVertex3bvOES, vFp)
+GO(glVertex4bOES, vFcccc)
+GO(glVertex4bvOES, vFp)
//OES_fixed_point
-GO(glAccumxOES,vFui)
-GO(glAlphaFuncxOES,vFui)
-GO(glBitmapxOES,vFiiiiiip)
-GO(glBlendColorxOES,vFiiii)
-GO(glClearAccumxOES,vFiiii)
-GO(glClearColorxOES,vFiiii)
-GO(glClearDepthxOES,vFi)
-GO(glClipPlanexOES,vFup)
-GO(glColor3xOES,vFiii)
-GO(glColor3xvOES,vFp)
-GO(glColor4xOES,vFiiii)
-GO(glColor4xvOES,vFp)
-GO(glConvolutionParameterxOES,vFuui)
-GO(glConvolutionParameterxvOES,vFuup)
-GO(glDepthRangexOES,vFii)
-GO(glEvalCoord1xOES,vFi)
-GO(glEvalCoord1xvOES,vFp)
-GO(glEvalCoord2xOES,vFii)
-GO(glEvalCoord2xvOES,vFp)
-GO(glFeedbackBufferxOES,vFiup)
-GO(glFogxOES,vFui)
-GO(glFogxvOES,vFup)
-GO(glFrustumxOES,vFiiiiii)
-GO(glGetClipPlanexOES,vFup)
-GO(glGetConvolutionParameterxvOES,vFuup)
-GO(glGetFixedvOES,vFup)
-GO(glGetHistogramParameterxvOES,vFuup)
-GO(glGetLightxOES,vFuup)
-GO(glGetMapxvOES,vFuup)
-GO(glGetMaterialxOES,vFuui)
-GO(glGetPixelMapxv,vFuip)
-GO(glGetTexEnvxvOES,vFuup)
-GO(glGetTexGenxvOES,vFuup)
-GO(glGetTexLevelParameterxvOES,vFuiup)
-GO(glGetTexParameterxvOES,vFuup)
-GO(glIndexxOES,vFi)
-GO(glIndexxvOES,vFp)
-GO(glLightModelxOES,vFui)
-GO(glLightModelxvOES,vFup)
-GO(glLightxOES,vFuui)
-GO(glLightxvOES,vFuup)
-GO(glLineWidthxOES,vFi)
-GO(glLoadMatrixxOES,vFp)
-GO(glLoadTransposeMatrixxOES,vFp)
-GO(glMap1xOES,vFuiiiii)
-GO(glMap2xOES,vFuiiiiiiiii)
-GO(glMapGrid1xOES,vFiii)
-GO(glMapGrid2xOES,vFiiiii)
-GO(glMaterialxOES,vFuui)
-GO(glMaterialxvOES,vFuup)
-GO(glMultMatrixxOES,vFp)
-GO(glMultTransposeMatrixxOES,vFp)
-GO(glMultiTexCoord1xOES,vFui)
-GO(glMultiTexCoord1xvOES,vFup)
-GO(glMultiTexCoord2xOES,vFuii)
-GO(glMultiTexCoord2xvOES,vFup)
-GO(glMultiTexCoord3xOES,vFuiii)
-GO(glMultiTexCoord3xvOES,vFup)
-GO(glMultiTexCoord4xOES,vFuiiii)
-GO(glMultiTexCoord4xvOES,vFup)
-GO(glNormal3xOES,vFiii)
-GO(glNormal3xvOES,vFp)
-GO(glOrthoxOES,vFiiiiii)
-GO(glPassThroughxOES,vFi)
-GO(glPixelMapx,vFuip)
-GO(glPixelStorex,vFui)
-GO(glPixelTransferxOES,vFui)
-GO(glPixelZoomxOES,vFii)
-GO(glPointParameterxvOES,vFup)
-GO(glPointSizexOES,vFi)
-GO(glPolygonOffsetxOES,vFii)
-GO(glPrioritizeTexturesxOES,vFipp)
-GO(glRasterPos2xOES,vFii)
-GO(glRasterPos2xvOES,vFp)
-GO(glRasterPos3xOES,vFiii)
-GO(glRasterPos3xvOES,vFp)
-GO(glRasterPos4xOES,vFiiii)
-GO(glRasterPos4xvOES,vFp)
-GO(glRectxOES,vFiiii)
-GO(glRectxvOES,vFpp)
-GO(glRotatexOES,vFiiii)
-GO(glSampleCoverageOES,vFii)
-GO(glScalexOES,vFiii)
-GO(glTexCoord1xOES,vFi)
-GO(glTexCoord1xvOES,vFp)
-GO(glTexCoord2xOES,vFii)
-GO(glTexCoord2xvOES,vFp)
-GO(glTexCoord3xOES,vFiii)
-GO(glTexCoord3xvOES,vFp)
-GO(glTexCoord4xOES,vFiiii)
-GO(glTexCoord4xvOES,vFp)
-GO(glTexEnvxOES,vFuui)
-GO(glTexEnvxvOES,vFuup)
-GO(glTexGenxOES,vFuui)
-GO(glTexGenxvOES,vFuup)
-GO(glTexParameterxOES,vFuui)
-GO(glTexParameterxvOES,vFuup)
-GO(glTranslatexOES,vFiii)
-GO(glVertex2xOES,vFi)
-GO(glVertex2xvOES,vFp)
-GO(glVertex3xOES,vFii)
-GO(glVertex3xvOES,vFp)
-GO(glVertex4xOES,vFiii)
-GO(glVertex4xvOES,vFp)
+GO(glAccumxOES, vFui)
+GO(glAlphaFuncxOES, vFui)
+GO(glBitmapxOES, vFiiiiiip)
+GO(glBlendColorxOES, vFiiii)
+GO(glClearAccumxOES, vFiiii)
+GO(glClearColorxOES, vFiiii)
+GO(glClearDepthxOES, vFi)
+GO(glClipPlanexOES, vFup)
+GO(glColor3xOES, vFiii)
+GO(glColor3xvOES, vFp)
+GO(glColor4xOES, vFiiii)
+GO(glColor4xvOES, vFp)
+GO(glConvolutionParameterxOES, vFuui)
+GO(glConvolutionParameterxvOES, vFuup)
+GO(glDepthRangexOES, vFii)
+GO(glEvalCoord1xOES, vFi)
+GO(glEvalCoord1xvOES, vFp)
+GO(glEvalCoord2xOES, vFii)
+GO(glEvalCoord2xvOES, vFp)
+GO(glFeedbackBufferxOES, vFiup)
+GO(glFogxOES, vFui)
+GO(glFogxvOES, vFup)
+GO(glFrustumxOES, vFiiiiii)
+GO(glGetClipPlanexOES, vFup)
+GO(glGetConvolutionParameterxvOES, vFuup)
+GO(glGetFixedvOES, vFup)
+GO(glGetHistogramParameterxvOES, vFuup)
+GO(glGetLightxOES, vFuup)
+GO(glGetMapxvOES, vFuup)
+GO(glGetMaterialxOES, vFuui)
+GO(glGetPixelMapxv, vFuip)
+GO(glGetTexEnvxvOES, vFuup)
+GO(glGetTexGenxvOES, vFuup)
+GO(glGetTexLevelParameterxvOES, vFuiup)
+GO(glGetTexParameterxvOES, vFuup)
+GO(glIndexxOES, vFi)
+GO(glIndexxvOES, vFp)
+GO(glLightModelxOES, vFui)
+GO(glLightModelxvOES, vFup)
+GO(glLightxOES, vFuui)
+GO(glLightxvOES, vFuup)
+GO(glLineWidthxOES, vFi)
+GO(glLoadMatrixxOES, vFp)
+GO(glLoadTransposeMatrixxOES, vFp)
+GO(glMap1xOES, vFuiiiii)
+GO(glMap2xOES, vFuiiiiiiiii)
+GO(glMapGrid1xOES, vFiii)
+GO(glMapGrid2xOES, vFiiiii)
+GO(glMaterialxOES, vFuui)
+GO(glMaterialxvOES, vFuup)
+GO(glMultMatrixxOES, vFp)
+GO(glMultTransposeMatrixxOES, vFp)
+GO(glMultiTexCoord1xOES, vFui)
+GO(glMultiTexCoord1xvOES, vFup)
+GO(glMultiTexCoord2xOES, vFuii)
+GO(glMultiTexCoord2xvOES, vFup)
+GO(glMultiTexCoord3xOES, vFuiii)
+GO(glMultiTexCoord3xvOES, vFup)
+GO(glMultiTexCoord4xOES, vFuiiii)
+GO(glMultiTexCoord4xvOES, vFup)
+GO(glNormal3xOES, vFiii)
+GO(glNormal3xvOES, vFp)
+GO(glOrthoxOES, vFiiiiii)
+GO(glPassThroughxOES, vFi)
+GO(glPixelMapx, vFuip)
+GO(glPixelStorex, vFui)
+GO(glPixelTransferxOES, vFui)
+GO(glPixelZoomxOES, vFii)
+GO(glPointParameterxvOES, vFup)
+GO(glPointSizexOES, vFi)
+GO(glPolygonOffsetxOES, vFii)
+GO(glPrioritizeTexturesxOES, vFipp)
+GO(glRasterPos2xOES, vFii)
+GO(glRasterPos2xvOES, vFp)
+GO(glRasterPos3xOES, vFiii)
+GO(glRasterPos3xvOES, vFp)
+GO(glRasterPos4xOES, vFiiii)
+GO(glRasterPos4xvOES, vFp)
+GO(glRectxOES, vFiiii)
+GO(glRectxvOES, vFpp)
+GO(glRotatexOES, vFiiii)
+GO(glSampleCoverageOES, vFii)
+GO(glScalexOES, vFiii)
+GO(glTexCoord1xOES, vFi)
+GO(glTexCoord1xvOES, vFp)
+GO(glTexCoord2xOES, vFii)
+GO(glTexCoord2xvOES, vFp)
+GO(glTexCoord3xOES, vFiii)
+GO(glTexCoord3xvOES, vFp)
+GO(glTexCoord4xOES, vFiiii)
+GO(glTexCoord4xvOES, vFp)
+GO(glTexEnvxOES, vFuui)
+GO(glTexEnvxvOES, vFuup)
+GO(glTexGenxOES, vFuui)
+GO(glTexGenxvOES, vFuup)
+GO(glTexParameterxOES, vFuui)
+GO(glTexParameterxvOES, vFuup)
+GO(glTranslatexOES, vFiii)
+GO(glVertex2xOES, vFi)
+GO(glVertex2xvOES, vFp)
+GO(glVertex3xOES, vFii)
+GO(glVertex3xvOES, vFp)
+GO(glVertex4xOES, vFiii)
+GO(glVertex4xvOES, vFp)
//OES_query_matrix
-GO(glQueryMatrixxOES,iFpp)
+GO(glQueryMatrixxOES, uFpp)
//OES_single_precision
-GO(glClearDepthfOES,vFf)
-GO(glClipPlanefOES,vFup)
-GO(glDepthRangefOES,vFff)
-GO(glFrustumfOES,vFffffff)
-GO(glGetClipPlanefOES,vFup)
-GO(glOrthofOES,vFffffff)
+GO(glClearDepthfOES, vFf)
+GO(glClipPlanefOES, vFup)
+GO(glDepthRangefOES, vFff)
+GO(glFrustumfOES, vFffffff)
+GO(glGetClipPlanefOES, vFup)
+GO(glOrthofOES, vFffffff)
//PGI_misc_hints
-GO(glHintPGI,vFui)
+GO(glHintPGI, vFui)
//SGIS_detail_texture
-GO(glDetailTexFuncSGIS,vFuip)
-GO(glGetDetailTexFuncSGIS,vFup)
+GO(glDetailTexFuncSGIS, vFuip)
+GO(glGetDetailTexFuncSGIS, vFup)
//SGIS_fog_function
-GO(glFogFuncSGIS,vFip)
-GO(glGetFogFuncSGIS,vFp)
+GO(glFogFuncSGIS, vFip)
+GO(glGetFogFuncSGIS, vFp)
//SGIS_multisample
-GO(glSampleMaskSGIS,vFfi)
-GO(glSamplePatternSGIS,vFu)
+GO(glSampleMaskSGIS, vFfC)
+GO(glSamplePatternSGIS, vFu)
//SGIS_pixel_texture
-GO(glGetPixelTexGenParameterfvSGIS,vFup)
-GO(glGetPixelTexGenParameterivSGIS,vFup)
-GO(glPixelTexGenParameterfSGIS,vFuf)
-GO(glPixelTexGenParameterfvSGIS,vFup)
-GO(glPixelTexGenParameteriSGIS,vFui)
-GO(glPixelTexGenParameterivSGIS,vFup)
+GO(glGetPixelTexGenParameterfvSGIS, vFup)
+GO(glGetPixelTexGenParameterivSGIS, vFup)
+GO(glPixelTexGenParameterfSGIS, vFuf)
+GO(glPixelTexGenParameterfvSGIS, vFup)
+GO(glPixelTexGenParameteriSGIS, vFui)
+GO(glPixelTexGenParameterivSGIS, vFup)
//SGIS_point_parameters
-GO(glPointParameterfSGIS,vFuf)
-GO(glPointParameterfvSGIS,vFup)
+GO(glPointParameterfSGIS, vFuf)
+GO(glPointParameterfvSGIS, vFup)
//SGIS_sharpen_texture
-GO(glGetSharpenTexFuncSGIS,vFup)
-GO(glSharpenTexFuncSGIS,vFuip)
+GO(glGetSharpenTexFuncSGIS, vFup)
+GO(glSharpenTexFuncSGIS, vFuip)
//SGIS_texture4D
-GO(glTexImage4DSGIS,vFuiuiiiiiuup)
-GO(glTexSubImage4DSGIS,vFuiiiiiiiiiuup)
+GO(glTexImage4DSGIS, vFuiuiiiiiuup)
+GO(glTexSubImage4DSGIS, vFuiiiiiiiiiuup)
//SGIS_texture_color_mask
-GO(glTextureColorMaskSGIS,vFiiii)
+GO(glTextureColorMaskSGIS, vFCCCC)
//SGIS_texture_filter4
-GO(glGetTexFilterFuncSGIS,vFuup)
-GO(glTexFilterFuncSGIS,vFuuip)
+GO(glGetTexFilterFuncSGIS, vFuup)
+GO(glTexFilterFuncSGIS, vFuuip)
//SGIX_async
-GO(glAsyncMarkerSGIX,vFu)
-GO(glDeleteAsyncMarkersSGIX,vFui)
-GO(glFinishAsyncSGIX,iFp)
-GO(glGenAsyncMarkersSGIX,uFi)
-GO(glIsAsyncMarkerSGIX,iFu)
-GO(glPollAsyncSGIX,iFp)
+GO(glAsyncMarkerSGIX, vFu)
+GO(glDeleteAsyncMarkersSGIX, vFui)
+GO(glFinishAsyncSGIX, iFp)
+GO(glGenAsyncMarkersSGIX, uFi)
+GO(glIsAsyncMarkerSGIX, CFu)
+GO(glPollAsyncSGIX, iFp)
//SGIX_flush_raster
-GO(glFlushRasterSGIX,vFv)
+GO(glFlushRasterSGIX, vFv)
//SGIX_fragment_lighting
-GO(glFragmentColorMaterialSGIX,vFuu)
-GO(glFragmentLightModelfSGIX,vFuf)
-GO(glFragmentLightModelfvSGIX,vFup)
-GO(glFragmentLightModeliSGIX,vFui)
-GO(glFragmentLightModelivSGIX,vFup)
-GO(glFragmentLightfSGIX,vFuuf)
-GO(glFragmentLightfvSGIX,vFuup)
-GO(glFragmentLightiSGIX,vFuui)
-GO(glFragmentLightivSGIX,vFuup)
-GO(glFragmentMaterialfSGIX,vFuuf)
-GO(glFragmentMaterialfvSGIX,vFuup)
-GO(glFragmentMaterialiSGIX,vFuui)
-GO(glFragmentMaterialivSGIX,vFuup)
-GO(glGetFragmentLightfvSGIX,vFuup)
-GO(glGetFragmentLightivSGIX,vFuup)
-GO(glGetFragmentMaterialfvSGIX,vFuup)
-GO(glGetFragmentMaterialivSGIX,vFuup)
-GO(glLightEnviSGIX,vFui)
+GO(glFragmentColorMaterialSGIX, vFuu)
+GO(glFragmentLightModelfSGIX, vFuf)
+GO(glFragmentLightModelfvSGIX, vFup)
+GO(glFragmentLightModeliSGIX, vFui)
+GO(glFragmentLightModelivSGIX, vFup)
+GO(glFragmentLightfSGIX, vFuuf)
+GO(glFragmentLightfvSGIX, vFuup)
+GO(glFragmentLightiSGIX, vFuui)
+GO(glFragmentLightivSGIX, vFuup)
+GO(glFragmentMaterialfSGIX, vFuuf)
+GO(glFragmentMaterialfvSGIX, vFuup)
+GO(glFragmentMaterialiSGIX, vFuui)
+GO(glFragmentMaterialivSGIX, vFuup)
+GO(glGetFragmentLightfvSGIX, vFuup)
+GO(glGetFragmentLightivSGIX, vFuup)
+GO(glGetFragmentMaterialfvSGIX, vFuup)
+GO(glGetFragmentMaterialivSGIX, vFuup)
+GO(glLightEnviSGIX, vFui)
//SGIX_framezoom
-GO(glFrameZoomSGIX,vFi)
+GO(glFrameZoomSGIX, vFi)
//SGIX_igloo_interface
-GO(glIglooInterfaceSGIX,vFup)
+GO(glIglooInterfaceSGIX, vFup)
//SGIX_instruments
-GO(glGetInstrumentsSGIX,iFv)
-GO(glInstrumentsBufferSGIX,vFip)
-GO(glPollInstrumentsSGIX,iFp)
-GO(glReadInstrumentsSGIX,vFi)
-GO(glStartInstrumentsSGIX,vFv)
-GO(glStopInstrumentsSGIX,vFi)
+GO(glGetInstrumentsSGIX, iFv)
+GO(glInstrumentsBufferSGIX, vFip)
+GO(glPollInstrumentsSGIX, iFp)
+GO(glReadInstrumentsSGIX, vFi)
+GO(glStartInstrumentsSGIX, vFv)
+GO(glStopInstrumentsSGIX, vFi)
//SGIX_list_priority
-GO(glGetListParameterfvSGIX,vFuup)
-GO(glGetListParameterivSGIX,vFuup)
-GO(glListParameterfSGIX,vFuuf)
-GO(glListParameterfvSGIX,vFuup)
-GO(glListParameteriSGIX,vFuui)
-GO(glListParameterivSGIX,vFuup)
+GO(glGetListParameterfvSGIX, vFuup)
+GO(glGetListParameterivSGIX, vFuup)
+GO(glListParameterfSGIX, vFuuf)
+GO(glListParameterfvSGIX, vFuup)
+GO(glListParameteriSGIX, vFuui)
+GO(glListParameterivSGIX, vFuup)
//SGIX_pixel_texture
-GO(glPixelTexGenSGIX,vFu)
+GO(glPixelTexGenSGIX, vFu)
//SGIX_polynomial_ffd
-GO(glDeformSGIX,vFi)
-GO(glDeformationMap3dSGIX,vFuddiiddiiddiip)
-GO(glDeformationMap3fSGIX,vFuffiiffiiffiip)
-GO(glLoadIdentityDeformationMapSGIX,vFi)
+GO(glDeformSGIX, vFi)
+GO(glDeformationMap3dSGIX, vFuddiiddiiddiip)
+GO(glDeformationMap3fSGIX, vFuffiiffiiffiip)
+GO(glLoadIdentityDeformationMapSGIX, vFu)
//SGIX_reference_plane
-GO(glReferencePlaneSGIX,vFp)
+GO(glReferencePlaneSGIX, vFp)
//SGIX_sprite
-GO(glSpriteParameterfSGIX,vFuf)
-GO(glSpriteParameterfvSGIX,vFup)
-GO(glSpriteParameteriSGIX,vFui)
-GO(glSpriteParameterivSGIX,vFup)
+GO(glSpriteParameterfSGIX, vFuf)
+GO(glSpriteParameterfvSGIX, vFup)
+GO(glSpriteParameteriSGIX, vFui)
+GO(glSpriteParameterivSGIX, vFup)
//SGIX_tag_sample_buffer
-GO(glTagSampleBufferSGIX,vFv)
+GO(glTagSampleBufferSGIX, vFv)
//SGI_color_table
-GO(glColorTableParameterfvSGI,vFuup)
-GO(glColorTableParameterivSGI,vFuup)
-GO(glColorTableSGI,vFuuiuup)
-GO(glCopyColorTableSGI,vFuuiii)
-GO(glGetColorTableParameterfvSGI,vFuup)
-GO(glGetColorTableParameterivSGI,vFuup)
-GO(glGetColorTableSGI,vFuuup)
+GO(glColorTableParameterfvSGI, vFuup)
+GO(glColorTableParameterivSGI, vFuup)
+GO(glColorTableSGI, vFuuiuup)
+GO(glCopyColorTableSGI, vFuuiii)
+GO(glGetColorTableParameterfvSGI, vFuup)
+GO(glGetColorTableParameterivSGI, vFuup)
+GO(glGetColorTableSGI, vFuuup)
//SUNX_constant_data
-GO(glFinishTextureSUNX,vFv)
+GO(glFinishTextureSUNX, vFv)
//SUN_global_alpha
-GO(glGlobalAlphaFactorbSUN,vFi)
-GO(glGlobalAlphaFactordSUN,vFd)
-GO(glGlobalAlphaFactorfSUN,vFf)
-GO(glGlobalAlphaFactoriSUN,vFi)
-GO(glGlobalAlphaFactorsSUN,vFi)
-GO(glGlobalAlphaFactorubSUN,vFu)
-GO(glGlobalAlphaFactoruiSUN,vFu)
-GO(glGlobalAlphaFactorusSUN,vFu)
+GO(glGlobalAlphaFactorbSUN, vFc)
+GO(glGlobalAlphaFactordSUN, vFd)
+GO(glGlobalAlphaFactorfSUN, vFf)
+GO(glGlobalAlphaFactoriSUN, vFi)
+GO(glGlobalAlphaFactorsSUN, vFw)
+GO(glGlobalAlphaFactorubSUN, vFu)
+GO(glGlobalAlphaFactoruiSUN, vFu)
+GO(glGlobalAlphaFactorusSUN, vFu)
//SUN_mesh_array
-GO(glDrawMeshArraysSUN,vFuiii)
+GO(glDrawMeshArraysSUN, vFuiii)
//SUN_triangle_list
-GO(glReplacementCodePointerSUN,vFuip)
-GO(glReplacementCodeubSUN,vFu)
-GO(glReplacementCodeubvSUN,vFp)
-GO(glReplacementCodeuiSUN,vFu)
-GO(glReplacementCodeuivSUN,vFp)
-GO(glReplacementCodeusSUN,vFu)
-GO(glReplacementCodeusvSUN,vFp)
+GO(glReplacementCodePointerSUN, vFuip)
+GO(glReplacementCodeubSUN, vFC)
+GO(glReplacementCodeubvSUN, vFp)
+GO(glReplacementCodeuiSUN, vFu)
+GO(glReplacementCodeuivSUN, vFp)
+GO(glReplacementCodeusSUN, vFW)
+GO(glReplacementCodeusvSUN, vFp)
//SUN_vertex
-GO(glColor3fVertex3fSUN,vFffffff)
-GO(glColor3fVertex3fvSUN,vFpp)
-GO(glColor4fNormal3fVertex3fSUN,vFffffffffff)
-GO(glColor4fNormal3fVertex3fvSUN,vFppp)
-GO(glColor4ubVertex2fSUN,vFuuuuff)
-GO(glColor4ubVertex2fvSUN,vFpp)
-GO(glColor4ubVertex3fSUN,vFuuuufff)
-GO(glColor4ubVertex3fvSUN,vFpp)
-GO(glNormal3fVertex3fSUN,vFffffff)
-GO(glNormal3fVertex3fvSUN,vFpp)
-GO(glReplacementCodeuiColor3fVertex3fSUN,vFuffffff)
-GO(glReplacementCodeuiColor3fVertex3fvSUN,vFppp)
-GO(glReplacementCodeuiColor4fNormal3fVertex3fSUN,vFuffffffffff)
-GO(glReplacementCodeuiColor4fNormal3fVertex3fvSUN,vFpppp)
-GO(glReplacementCodeuiColor4ubVertex3fSUN,vFuuuuufff)
-GO(glReplacementCodeuiColor4ubVertex3fvSUN,vFppp)
-GO(glReplacementCodeuiNormal3fVertex3fSUN,vFuffffff)
-GO(glReplacementCodeuiNormal3fVertex3fvSUN,vFppp)
-GO(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN,vFuffffffffffff)
-GO(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN,vFppppp)
-GO(glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN,vFuffffffff)
-GO(glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN,vFpppp)
-GO(glReplacementCodeuiTexCoord2fVertex3fSUN,vFufffff)
-GO(glReplacementCodeuiTexCoord2fVertex3fvSUN,vFppp)
-GO(glReplacementCodeuiVertex3fSUN,vFufff)
-GO(glReplacementCodeuiVertex3fvSUN,vFpp)
-GO(glTexCoord2fColor3fVertex3fSUN,vFffffffff)
-GO(glTexCoord2fColor3fVertex3fvSUN,vFppp)
-GO(glTexCoord2fColor4fNormal3fVertex3fSUN,vFffffffffffff)
-GO(glTexCoord2fColor4fNormal3fVertex3fvSUN,vFpppp)
-GO(glTexCoord2fColor4ubVertex3fSUN,vFffuuuufff)
-GO(glTexCoord2fColor4ubVertex3fvSUN,vFppp)
-GO(glTexCoord2fNormal3fVertex3fSUN,vFffffffff)
-GO(glTexCoord2fNormal3fVertex3fvSUN,vFppp)
-GO(glTexCoord2fVertex3fSUN,vFfffff)
-GO(glTexCoord2fVertex3fvSUN,vFpp)
-GO(glTexCoord4fColor4fNormal3fVertex4fSUN,vFfffffffffffffff)
-GO(glTexCoord4fColor4fNormal3fVertex4fvSUN,vFpppp)
-GO(glTexCoord4fVertex4fSUN,vFffffffff)
-GO(glTexCoord4fVertex4fvSUN,vFpp)
-//VERSION_1_0
-GO(glAccum,vFuf)
-GO(glAlphaFunc,vFuf)
-GO(glBegin,vFu)
-GO(glBitmap,vFiiffffp)
-GO(glBlendFunc,vFuu)
-GO(glCallList,vFu)
-GO(glCallLists,vFiup)
-GO(glClear,vFi)
-GO(glClearAccum,vFffff)
-GO(glClearColor,vFffff)
-GO(glClearDepth,vFd)
-GO(glClearIndex,vFf)
-GO(glClearStencil,vFi)
-GO(glClipPlane,vFup)
-GO(glColor3b,vFiii)
-GO(glColor3bv,vFp)
-GO(glColor3d,vFddd)
-GO(glColor3dv,vFp)
-GO(glColor3f,vFfff)
-GO(glColor3fv,vFp)
-GO(glColor3i,vFiii)
-GO(glColor3iv,vFp)
-GO(glColor3s,vFiii)
-GO(glColor3sv,vFp)
-GO(glColor3ub,vFuuu)
-GO(glColor3ubv,vFp)
-GO(glColor3ui,vFuuu)
-GO(glColor3uiv,vFp)
-GO(glColor3us,vFuuu)
-GO(glColor3usv,vFp)
-GO(glColor4b,vFiiii)
-GO(glColor4bv,vFp)
-GO(glColor4d,vFdddd)
-GO(glColor4dv,vFp)
-GO(glColor4f,vFffff)
-GO(glColor4fv,vFp)
-GO(glColor4i,vFiiii)
-GO(glColor4iv,vFp)
-GO(glColor4s,vFiiii)
-GO(glColor4sv,vFp)
-GO(glColor4ub,vFuuuu)
-GO(glColor4ubv,vFp)
-GO(glColor4ui,vFuuuu)
-GO(glColor4uiv,vFp)
-GO(glColor4us,vFuuuu)
-GO(glColor4usv,vFp)
-GO(glColorMask,vFiiii)
-GO(glColorMaterial,vFuu)
-GO(glCopyPixels,vFiiiiu)
-GO(glCullFace,vFu)
-GO(glDeleteLists,vFui)
-GO(glDepthFunc,vFu)
-GO(glDepthMask,vFi)
-GO(glDepthRange,vFdd)
-GO(glDisable,vFu)
-GO(glDrawBuffer,vFu)
-GO(glDrawPixels,vFiiuup)
-GO(glEdgeFlag,vFi)
-GO(glEdgeFlagv,vFp)
-GO(glEnable,vFu)
-GO(glEnd,vFv)
-GO(glEndList,vFv)
-GO(glEvalCoord1d,vFd)
-GO(glEvalCoord1dv,vFp)
-GO(glEvalCoord1f,vFf)
-GO(glEvalCoord1fv,vFp)
-GO(glEvalCoord2d,vFdd)
-GO(glEvalCoord2dv,vFp)
-GO(glEvalCoord2f,vFff)
-GO(glEvalCoord2fv,vFp)
-GO(glEvalMesh1,vFuii)
-GO(glEvalMesh2,vFuiiii)
-GO(glEvalPoint1,vFi)
-GO(glEvalPoint2,vFii)
-GO(glFeedbackBuffer,vFiup)
-GO(glFinish,vFv)
-GO(glFlush,vFv)
-GO(glFogf,vFuf)
-GO(glFogfv,vFup)
-GO(glFogi,vFui)
-GO(glFogiv,vFup)
-GO(glFrontFace,vFu)
-GO(glFrustum,vFdddddd)
-GO(glGenLists,uFi)
-GO(glGetBooleanv,vFup)
-GO(glGetClipPlane,vFup)
-GO(glGetDoublev,vFup)
-GO(glGetError,uFv)
-GO(glGetFloatv,vFup)
-GO(glGetIntegerv,vFup)
-GO(glGetLightfv,vFuup)
-GO(glGetLightiv,vFuup)
-GO(glGetMapdv,vFuup)
-GO(glGetMapfv,vFuup)
-GO(glGetMapiv,vFuup)
-GO(glGetMaterialfv,vFuup)
-GO(glGetMaterialiv,vFuup)
-GO(glGetPixelMapfv,vFup)
-GO(glGetPixelMapuiv,vFup)
-GO(glGetPixelMapusv,vFup)
-GO(glGetPolygonStipple,vFp)
-GO(glGetString,pFu)
-GO(glGetTexEnvfv,vFuup)
-GO(glGetTexEnviv,vFuup)
-GO(glGetTexGendv,vFuup)
-GO(glGetTexGenfv,vFuup)
-GO(glGetTexGeniv,vFuup)
-GO(glGetTexImage,vFuiuup)
-GO(glGetTexLevelParameterfv,vFuiup)
-GO(glGetTexLevelParameteriv,vFuiup)
-GO(glGetTexParameterfv,vFuup)
-GO(glGetTexParameteriv,vFuup)
-GO(glHint,vFuu)
-GO(glIndexMask,vFu)
-GO(glIndexd,vFd)
-GO(glIndexdv,vFp)
-GO(glIndexf,vFf)
-GO(glIndexfv,vFp)
-GO(glIndexi,vFi)
-GO(glIndexiv,vFp)
-GO(glIndexs,vFi)
-GO(glIndexsv,vFp)
-GO(glInitNames,vFv)
-GO(glIsEnabled,iFu)
-GO(glIsList,iFu)
-GO(glLightModelf,vFuf)
-GO(glLightModelfv,vFup)
-GO(glLightModeli,vFui)
-GO(glLightModeliv,vFup)
-GO(glLightf,vFuuf)
-GO(glLightfv,vFuup)
-GO(glLighti,vFuui)
-GO(glLightiv,vFuup)
-GO(glLineStipple,vFiu)
-GO(glLineWidth,vFf)
-GO(glListBase,vFu)
-GO(glLoadIdentity,vFv)
-GO(glLoadMatrixd,vFp)
-GO(glLoadMatrixf,vFp)
-GO(glLoadName,vFu)
-GO(glLogicOp,vFu)
-GO(glMap1d,vFuddiip)
-GO(glMap1f,vFuffiip)
-GO(glMap2d,vFuddiiddiip)
-GO(glMap2f,vFuffiiffiip)
-GO(glMapGrid1d,vFidd)
-GO(glMapGrid1f,vFiff)
-GO(glMapGrid2d,vFiddidd)
-GO(glMapGrid2f,vFiffiff)
-GO(glMaterialf,vFuuf)
-GO(glMaterialfv,vFuup)
-GO(glMateriali,vFuui)
-GO(glMaterialiv,vFuup)
-GO(glMatrixMode,vFu)
-GO(glMultMatrixd,vFp)
-GO(glMultMatrixf,vFp)
-GO(glNewList,vFuu)
-GO(glNormal3b,vFiii)
-GO(glNormal3bv,vFp)
-GO(glNormal3d,vFddd)
-GO(glNormal3dv,vFp)
-GO(glNormal3f,vFfff)
-GO(glNormal3fv,vFp)
-GO(glNormal3i,vFiii)
-GO(glNormal3iv,vFp)
-GO(glNormal3s,vFiii)
-GO(glNormal3sv,vFp)
-GO(glOrtho,vFdddddd)
-GO(glPassThrough,vFf)
-GO(glPixelMapfv,vFuip)
-GO(glPixelMapuiv,vFuip)
-GO(glPixelMapusv,vFuip)
-GO(glPixelStoref,vFuf)
-GO(glPixelStorei,vFui)
-GO(glPixelTransferf,vFuf)
-GO(glPixelTransferi,vFui)
-GO(glPixelZoom,vFff)
-GO(glPointSize,vFf)
-GO(glPolygonMode,vFuu)
-GO(glPolygonStipple,vFp)
-GO(glPopAttrib,vFv)
-GO(glPopMatrix,vFv)
-GO(glPopName,vFv)
-GO(glPushAttrib,vFi)
-GO(glPushMatrix,vFv)
-GO(glPushName,vFu)
-GO(glRasterPos2d,vFdd)
-GO(glRasterPos2dv,vFp)
-GO(glRasterPos2f,vFff)
-GO(glRasterPos2fv,vFp)
-GO(glRasterPos2i,vFii)
-GO(glRasterPos2iv,vFp)
-GO(glRasterPos2s,vFii)
-GO(glRasterPos2sv,vFp)
-GO(glRasterPos3d,vFddd)
-GO(glRasterPos3dv,vFp)
-GO(glRasterPos3f,vFfff)
-GO(glRasterPos3fv,vFp)
-GO(glRasterPos3i,vFiii)
-GO(glRasterPos3iv,vFp)
-GO(glRasterPos3s,vFiii)
-GO(glRasterPos3sv,vFp)
-GO(glRasterPos4d,vFdddd)
-GO(glRasterPos4dv,vFp)
-GO(glRasterPos4f,vFffff)
-GO(glRasterPos4fv,vFp)
-GO(glRasterPos4i,vFiiii)
-GO(glRasterPos4iv,vFp)
-GO(glRasterPos4s,vFiiii)
-GO(glRasterPos4sv,vFp)
-GO(glReadBuffer,vFu)
-GO(glReadPixels,vFiiiiuup)
-GO(glRectd,vFdddd)
-GO(glRectdv,vFpp)
-GO(glRectf,vFffff)
-GO(glRectfv,vFpp)
-GO(glRecti,vFiiii)
-GO(glRectiv,vFpp)
-GO(glRects,vFiiii)
-GO(glRectsv,vFpp)
-GO(glRenderMode,iFu)
-GO(glRotated,vFdddd)
-GO(glRotatef,vFffff)
-GO(glScaled,vFddd)
-GO(glScalef,vFfff)
-GO(glScissor,vFiiii)
-GO(glSelectBuffer,vFip)
-GO(glShadeModel,vFu)
-GO(glStencilFunc,vFuiu)
-GO(glStencilMask,vFu)
-GO(glStencilOp,vFuuu)
-GO(glTexCoord1d,vFd)
-GO(glTexCoord1dv,vFp)
-GO(glTexCoord1f,vFf)
-GO(glTexCoord1fv,vFp)
-GO(glTexCoord1i,vFi)
-GO(glTexCoord1iv,vFp)
-GO(glTexCoord1s,vFi)
-GO(glTexCoord1sv,vFp)
-GO(glTexCoord2d,vFdd)
-GO(glTexCoord2dv,vFp)
-GO(glTexCoord2f,vFff)
-GO(glTexCoord2fv,vFp)
-GO(glTexCoord2i,vFii)
-GO(glTexCoord2iv,vFp)
-GO(glTexCoord2s,vFii)
-GO(glTexCoord2sv,vFp)
-GO(glTexCoord3d,vFddd)
-GO(glTexCoord3dv,vFp)
-GO(glTexCoord3f,vFfff)
-GO(glTexCoord3fv,vFp)
-GO(glTexCoord3i,vFiii)
-GO(glTexCoord3iv,vFp)
-GO(glTexCoord3s,vFiii)
-GO(glTexCoord3sv,vFp)
-GO(glTexCoord4d,vFdddd)
-GO(glTexCoord4dv,vFp)
-GO(glTexCoord4f,vFffff)
-GO(glTexCoord4fv,vFp)
-GO(glTexCoord4i,vFiiii)
-GO(glTexCoord4iv,vFp)
-GO(glTexCoord4s,vFiiii)
-GO(glTexCoord4sv,vFp)
-GO(glTexEnvf,vFuuf)
-GO(glTexEnvfv,vFuup)
-GO(glTexEnvi,vFuui)
-GO(glTexEnviv,vFuup)
-GO(glTexGend,vFuud)
-GO(glTexGendv,vFuup)
-GO(glTexGenf,vFuuf)
-GO(glTexGenfv,vFuup)
-GO(glTexGeni,vFuui)
-GO(glTexGeniv,vFuup)
-GO(glTexImage1D,vFuiiiiuup)
-GO(glTexImage2D,vFuiiiiiuup)
-GO(glTexParameterf,vFuuf)
-GO(glTexParameterfv,vFuup)
-GO(glTexParameteri,vFuui)
-GO(glTexParameteriv,vFuup)
-GO(glTranslated,vFddd)
-GO(glTranslatef,vFfff)
-GO(glVertex2d,vFdd)
-GO(glVertex2dv,vFp)
-GO(glVertex2f,vFff)
-GO(glVertex2fv,vFp)
-GO(glVertex2i,vFii)
-GO(glVertex2iv,vFp)
-GO(glVertex2s,vFii)
-GO(glVertex2sv,vFp)
-GO(glVertex3d,vFddd)
-GO(glVertex3dv,vFp)
-GO(glVertex3f,vFfff)
-GO(glVertex3fv,vFp)
-GO(glVertex3i,vFiii)
-GO(glVertex3iv,vFp)
-GO(glVertex3s,vFiii)
-GO(glVertex3sv,vFp)
-GO(glVertex4d,vFdddd)
-GO(glVertex4dv,vFp)
-GO(glVertex4f,vFffff)
-GO(glVertex4fv,vFp)
-GO(glVertex4i,vFiiii)
-GO(glVertex4iv,vFp)
-GO(glVertex4s,vFiiii)
-GO(glVertex4sv,vFp)
-GO(glViewport,vFiiii)
-//VERSION_1_1
-GO(glAreTexturesResident,iFipp)
-GO(glArrayElement,vFi)
-GO(glBindTexture,vFuu)
-GO(glColorPointer,vFiuip)
-GO(glCopyTexImage1D,vFuiuiiii)
-GO(glCopyTexImage2D,vFuiuiiiii)
-GO(glCopyTexSubImage1D,vFuiiiii)
-GO(glCopyTexSubImage2D,vFuiiiiiii)
-GO(glDeleteTextures,vFip)
-GO(glDisableClientState,vFu)
-GO(glDrawArrays,vFuii)
-GO(glDrawElements,vFuiup)
-GO(glEdgeFlagPointer,vFip)
-GO(glEnableClientState,vFu)
-GO(glGenTextures,vFip)
-GO(glGetPointerv,vFup)
-GO(glIndexPointer,vFuip)
-GO(glIndexub,vFu)
-GO(glIndexubv,vFp)
-GO(glInterleavedArrays,vFuip)
-GO(glIsTexture,iFu)
-GO(glNormalPointer,vFuip)
-GO(glPolygonOffset,vFff)
-GO(glPopClientAttrib,vFv)
-GO(glPrioritizeTextures,vFipp)
-GO(glPushClientAttrib,vFi)
-GO(glTexCoordPointer,vFiuip)
-GO(glTexSubImage1D,vFuiiiuup)
-GO(glTexSubImage2D,vFuiiiiiuup)
-GO(glVertexPointer,vFiuip)
-//VERSION_1_2
-GO(glBlendColor,vFffff)
-GO(glBlendEquation,vFu)
-GO(glColorSubTable,vFuiiuup)
-GO(glColorTable,vFuuiuup)
-GO(glColorTableParameterfv,vFuup)
-GO(glColorTableParameteriv,vFuup)
-GO(glConvolutionFilter1D,vFuuiuup)
-GO(glConvolutionFilter2D,vFuuiiuup)
-GO(glConvolutionParameterf,vFuuf)
-GO(glConvolutionParameterfv,vFuup)
-GO(glConvolutionParameteri,vFuui)
-GO(glConvolutionParameteriv,vFuup)
-GO(glCopyColorSubTable,vFuiiii)
-GO(glCopyColorTable,vFuuiii)
-GO(glCopyConvolutionFilter1D,vFuuiii)
-GO(glCopyConvolutionFilter2D,vFuuiiii)
-GO(glCopyTexSubImage3D,vFuiiiiiiii)
-GO(glDrawRangeElements,vFuuuiup)
-GO(glGetColorTable,vFuuup)
-GO(glGetColorTableParameterfv,vFuup)
-GO(glGetColorTableParameteriv,vFuup)
-GO(glGetConvolutionFilter,vFuuup)
-GO(glGetConvolutionParameterfv,vFuup)
-GO(glGetConvolutionParameteriv,vFuup)
-GO(glGetHistogram,vFuiuup)
-GO(glGetHistogramParameterfv,vFuup)
-GO(glGetHistogramParameteriv,vFuup)
-GO(glGetMinmax,vFuiuup)
-GO(glGetMinmaxParameterfv,vFuup)
-GO(glGetMinmaxParameteriv,vFuup)
-GO(glGetSeparableFilter,vFuuuppp)
-GO(glHistogram,vFuiui)
-GO(glMinmax,vFuui)
-GO(glResetHistogram,vFu)
-GO(glResetMinmax,vFu)
-GO(glSeparableFilter2D,vFuuiiuupp)
-GO(glTexImage3D,vFuiiiiiiuup)
-GO(glTexSubImage3D,vFuiiiiiiiuup)
-//VERSION_1_3
-GO(glActiveTexture,vFu)
-GO(glClientActiveTexture,vFu)
-GO(glCompressedTexImage1D,vFuiuiiip)
-GO(glCompressedTexImage2D,vFuiuiiiip)
-GO(glCompressedTexImage3D,vFuiuiiiiip)
-GO(glCompressedTexSubImage1D,vFuiiiuip)
-GO(glCompressedTexSubImage2D,vFuiiiiiuip)
-GO(glCompressedTexSubImage3D,vFuiiiiiiiuip)
-GO(glGetCompressedTexImage,vFuip)
-GO(glLoadTransposeMatrixd,vFp)
-GO(glLoadTransposeMatrixf,vFp)
-GO(glMultTransposeMatrixd,vFp)
-GO(glMultTransposeMatrixf,vFp)
-GO(glMultiTexCoord1d,vFud)
-GO(glMultiTexCoord1dv,vFup)
-GO(glMultiTexCoord1f,vFuf)
-GO(glMultiTexCoord1fv,vFup)
-GO(glMultiTexCoord1i,vFui)
-GO(glMultiTexCoord1iv,vFup)
-GO(glMultiTexCoord1s,vFui)
-GO(glMultiTexCoord1sv,vFup)
-GO(glMultiTexCoord2d,vFudd)
-GO(glMultiTexCoord2dv,vFup)
-GO(glMultiTexCoord2f,vFuff)
-GO(glMultiTexCoord2fv,vFup)
-GO(glMultiTexCoord2i,vFuii)
-GO(glMultiTexCoord2iv,vFup)
-GO(glMultiTexCoord2s,vFuii)
-GO(glMultiTexCoord2sv,vFup)
-GO(glMultiTexCoord3d,vFuddd)
-GO(glMultiTexCoord3dv,vFup)
-GO(glMultiTexCoord3f,vFufff)
-GO(glMultiTexCoord3fv,vFup)
-GO(glMultiTexCoord3i,vFuiii)
-GO(glMultiTexCoord3iv,vFup)
-GO(glMultiTexCoord3s,vFuiii)
-GO(glMultiTexCoord3sv,vFup)
-GO(glMultiTexCoord4d,vFudddd)
-GO(glMultiTexCoord4dv,vFup)
-GO(glMultiTexCoord4f,vFuffff)
-GO(glMultiTexCoord4fv,vFup)
-GO(glMultiTexCoord4i,vFuiiii)
-GO(glMultiTexCoord4iv,vFup)
-GO(glMultiTexCoord4s,vFuiiii)
-GO(glMultiTexCoord4sv,vFup)
-GO(glSampleCoverage,vFfi)
-//VERSION_1_4
-GO(glBlendFuncSeparate,vFuuuu)
-GO(glFogCoordPointer,vFuip)
-GO(glFogCoordd,vFd)
-GO(glFogCoorddv,vFp)
-GO(glFogCoordf,vFf)
-GO(glFogCoordfv,vFp)
-GO(glMultiDrawArrays,vFuppi)
-GO(glMultiDrawElements,vFupupi)
-GO(glPointParameterf,vFuf)
-GO(glPointParameterfv,vFup)
-GO(glPointParameteri,vFui)
-GO(glPointParameteriv,vFup)
-GO(glSecondaryColor3b,vFiii)
-GO(glSecondaryColor3bv,vFp)
-GO(glSecondaryColor3d,vFddd)
-GO(glSecondaryColor3dv,vFp)
-GO(glSecondaryColor3f,vFfff)
-GO(glSecondaryColor3fv,vFp)
-GO(glSecondaryColor3i,vFiii)
-GO(glSecondaryColor3iv,vFp)
-GO(glSecondaryColor3s,vFiii)
-GO(glSecondaryColor3sv,vFp)
-GO(glSecondaryColor3ub,vFuuu)
-GO(glSecondaryColor3ubv,vFp)
-GO(glSecondaryColor3ui,vFuuu)
-GO(glSecondaryColor3uiv,vFp)
-GO(glSecondaryColor3us,vFuuu)
-GO(glSecondaryColor3usv,vFp)
-GO(glSecondaryColorPointer,vFiuip)
-GO(glWindowPos2d,vFdd)
-GO(glWindowPos2dv,vFp)
-GO(glWindowPos2f,vFff)
-GO(glWindowPos2fv,vFp)
-GO(glWindowPos2i,vFii)
-GO(glWindowPos2iv,vFp)
-GO(glWindowPos2s,vFii)
-GO(glWindowPos2sv,vFp)
-GO(glWindowPos3d,vFddd)
-GO(glWindowPos3dv,vFp)
-GO(glWindowPos3f,vFfff)
-GO(glWindowPos3fv,vFp)
-GO(glWindowPos3i,vFiii)
-GO(glWindowPos3iv,vFp)
-GO(glWindowPos3s,vFiii)
-GO(glWindowPos3sv,vFp)
-//VERSION_1_5
-GO(glBeginQuery,vFuu)
-GO(glBindBuffer,vFuu)
-GO(glBufferData,vFuipu)
-GO(glBufferSubData,vFuiip)
-GO(glDeleteBuffers,vFip)
-GO(glDeleteQueries,vFip)
-GO(glEndQuery,vFu)
-GO(glGenBuffers,vFip)
-GO(glGenQueries,vFip)
-GO(glGetBufferParameteriv,vFuup)
-GO(glGetBufferPointerv,vFuup)
-GO(glGetBufferSubData,vFuiip)
-GO(glGetQueryObjectiv,vFuup)
-GO(glGetQueryObjectuiv,vFuup)
-GO(glGetQueryiv,vFuup)
-GO(glIsBuffer,iFu)
-GO(glIsQuery,iFu)
-GO(glMapBuffer,pFuu)
-GO(glUnmapBuffer,iFu)
-//VERSION_2_0
-GO(glAttachShader,vFuu)
-GO(glBindAttribLocation,vFuup)
-GO(glBlendEquationSeparate,vFuu)
-GO(glCompileShader,vFu)
-GO(glCreateProgram,uFv)
-GO(glCreateShader,uFu)
-GO(glDeleteProgram,vFu)
-GO(glDeleteShader,vFu)
-GO(glDetachShader,vFuu)
-GO(glDisableVertexAttribArray,vFu)
-GO(glDrawBuffers,vFip)
-GO(glEnableVertexAttribArray,vFu)
-GO(glGetActiveAttrib,vFuuipppp)
-GO(glGetActiveUniform,vFuuipppp)
-GO(glGetAttachedShaders,vFuipp)
-GO(glGetAttribLocation,iFup)
-GO(glGetProgramInfoLog,vFuipp)
-GO(glGetProgramiv,vFuup)
-GO(glGetShaderInfoLog,vFuipp)
-GO(glGetShaderSource,vFuipp)
-GO(glGetShaderiv,vFuup)
-GO(glGetUniformLocation,iFup)
-GO(glGetUniformfv,vFuip)
-GO(glGetUniformiv,vFuip)
-GO(glGetVertexAttribPointerv,vFuup)
-GO(glGetVertexAttribdv,vFuup)
-GO(glGetVertexAttribfv,vFuup)
-GO(glGetVertexAttribiv,vFuup)
-GO(glIsProgram,iFu)
-GO(glIsShader,iFu)
-GO(glLinkProgram,vFu)
-GO(glShaderSource,vFuipp)
-GO(glStencilFuncSeparate,vFuuiu)
-GO(glStencilMaskSeparate,vFuu)
-GO(glStencilOpSeparate,vFuuuu)
-GO(glUniform1f,vFif)
-GO(glUniform1fv,vFiip)
-GO(glUniform1i,vFii)
-GO(glUniform1iv,vFiip)
-GO(glUniform2f,vFiff)
-GO(glUniform2fv,vFiip)
-GO(glUniform2i,vFiii)
-GO(glUniform2iv,vFiip)
-GO(glUniform3f,vFifff)
-GO(glUniform3fv,vFiip)
-GO(glUniform3i,vFiiii)
-GO(glUniform3iv,vFiip)
-GO(glUniform4f,vFiffff)
-GO(glUniform4fv,vFiip)
-GO(glUniform4i,vFiiiii)
-GO(glUniform4iv,vFiip)
-GO(glUniformMatrix2fv,vFiiip)
-GO(glUniformMatrix3fv,vFiiip)
-GO(glUniformMatrix4fv,vFiiip)
-GO(glUseProgram,vFu)
-GO(glValidateProgram,vFu)
-GO(glVertexAttrib1d,vFud)
-GO(glVertexAttrib1dv,vFup)
-GO(glVertexAttrib1f,vFuf)
-GO(glVertexAttrib1fv,vFup)
-GO(glVertexAttrib1s,vFui)
-GO(glVertexAttrib1sv,vFup)
-GO(glVertexAttrib2d,vFudd)
-GO(glVertexAttrib2dv,vFup)
-GO(glVertexAttrib2f,vFuff)
-GO(glVertexAttrib2fv,vFup)
-GO(glVertexAttrib2s,vFuii)
-GO(glVertexAttrib2sv,vFup)
-GO(glVertexAttrib3d,vFuddd)
-GO(glVertexAttrib3dv,vFup)
-GO(glVertexAttrib3f,vFufff)
-GO(glVertexAttrib3fv,vFup)
-GO(glVertexAttrib3s,vFuiii)
-GO(glVertexAttrib3sv,vFup)
-GO(glVertexAttrib4Nbv,vFup)
-GO(glVertexAttrib4Niv,vFup)
-GO(glVertexAttrib4Nsv,vFup)
-GO(glVertexAttrib4Nub,vFuuuuu)
-GO(glVertexAttrib4Nubv,vFup)
-GO(glVertexAttrib4Nuiv,vFup)
-GO(glVertexAttrib4Nusv,vFup)
-GO(glVertexAttrib4bv,vFup)
-GO(glVertexAttrib4d,vFudddd)
-GO(glVertexAttrib4dv,vFup)
-GO(glVertexAttrib4f,vFuffff)
-GO(glVertexAttrib4fv,vFup)
-GO(glVertexAttrib4iv,vFup)
-GO(glVertexAttrib4s,vFuiiii)
-GO(glVertexAttrib4sv,vFup)
-GO(glVertexAttrib4ubv,vFup)
-GO(glVertexAttrib4uiv,vFup)
-GO(glVertexAttrib4usv,vFup)
-GO(glVertexAttribPointer,vFuiuiip)
-//VERSION_2_1
-GO(glUniformMatrix2x3fv,vFiiip)
-GO(glUniformMatrix2x4fv,vFiiip)
-GO(glUniformMatrix3x2fv,vFiiip)
-GO(glUniformMatrix3x4fv,vFiiip)
-GO(glUniformMatrix4x2fv,vFiiip)
-GO(glUniformMatrix4x3fv,vFiiip)
-//VERSION_3_0
-GO(glBeginConditionalRender,vFuu)
-GO(glBeginTransformFeedback,vFu)
-GO(glBindBufferBase,vFuuu)
-GO(glBindBufferRange,vFuuuii)
-GO(glBindFragDataLocation,vFuup)
-GO(glClampColor,vFuu)
-GO(glClearBufferfi,vFuifi)
-GO(glClearBufferfv,vFuip)
-GO(glClearBufferiv,vFuip)
-GO(glClearBufferuiv,vFuip)
-GO(glColorMaski,vFuiiii)
-GO(glDisablei,vFuu)
-GO(glEnablei,vFuu)
-GO(glEndConditionalRender,vFv)
-GO(glEndTransformFeedback,vFv)
-GO(glGetBooleani_v,vFuup)
-GO(glGetFragDataLocation,iFup)
-GO(glGetIntegeri_v,vFuup)
-GO(glGetStringi,pFuu)
-GO(glGetTexParameterIiv,vFuup)
-GO(glGetTexParameterIuiv,vFuup)
-GO(glGetTransformFeedbackVarying,vFuuipppp)
-GO(glGetUniformuiv,vFuip)
-GO(glGetVertexAttribIiv,vFuup)
-GO(glGetVertexAttribIuiv,vFuup)
-GO(glIsEnabledi,iFuu)
-GO(glTexParameterIiv,vFuup)
-GO(glTexParameterIuiv,vFuup)
-GO(glTransformFeedbackVaryings,vFuipu)
-GO(glUniform1ui,vFiu)
-GO(glUniform1uiv,vFiip)
-GO(glUniform2ui,vFiuu)
-GO(glUniform2uiv,vFiip)
-GO(glUniform3ui,vFiuuu)
-GO(glUniform3uiv,vFiip)
-GO(glUniform4ui,vFiuuuu)
-GO(glUniform4uiv,vFiip)
-GO(glVertexAttribI1i,vFui)
-GO(glVertexAttribI1iv,vFup)
-GO(glVertexAttribI1ui,vFuu)
-GO(glVertexAttribI1uiv,vFup)
-GO(glVertexAttribI2i,vFuii)
-GO(glVertexAttribI2iv,vFup)
-GO(glVertexAttribI2ui,vFuuu)
-GO(glVertexAttribI2uiv,vFup)
-GO(glVertexAttribI3i,vFuiii)
-GO(glVertexAttribI3iv,vFup)
-GO(glVertexAttribI3ui,vFuuuu)
-GO(glVertexAttribI3uiv,vFup)
-GO(glVertexAttribI4bv,vFup)
-GO(glVertexAttribI4i,vFuiiii)
-GO(glVertexAttribI4iv,vFup)
-GO(glVertexAttribI4sv,vFup)
-GO(glVertexAttribI4ubv,vFup)
-GO(glVertexAttribI4ui,vFuuuuu)
-GO(glVertexAttribI4uiv,vFup)
-GO(glVertexAttribI4usv,vFup)
-GO(glVertexAttribIPointer,vFuiuip)
-//VERSION_3_1
-GO(glDrawArraysInstanced,vFuiii)
-GO(glDrawElementsInstanced,vFuiupi)
-GO(glPrimitiveRestartIndex,vFu)
-GO(glTexBuffer,vFuuu)
-//VERSION_3_2
-GO(glFramebufferTexture,vFuuui)
-GO(glGetBufferParameteri64v,vFuup)
-GO(glGetInteger64i_v,vFuup)
-//VERSION_3_3
-GO(glVertexAttribDivisor,vFuu)
-//VERSION_4_0
-GO(glBlendEquationSeparatei,vFuuu)
-GO(glBlendEquationi,vFuu)
-GO(glBlendFuncSeparatei,vFuuuuu)
-GO(glBlendFunci,vFuuu)
-GO(glMinSampleShading,vFf)
-//VERSION_4_3
-GO(glInvalidateNamedFramebuffer, vFiup)
-//VERSION_4_4
-GO(glBindBuffersBase, vFiuip)
-GO(glBindBuffersRange, vFiuippp)
-GO(glBindImageTextures, vFuip)
-GO(glBindSamplers, vFuip)
-GO(glBindTextures, vFuip)
-GO(glBindVertexBuffers, vFuippp)
-GO(glBufferStorage, vFiupu)
-GO(glClearTexImage, vFuiiip)
-GO(glClearTexSubImage, vFuiiiiiiiiip)
-//VERSION_4_5
-GO(glClipControl, vFii)
-GO(glCreateTransformFeedbacks, vFlp)
-GO(glTransformFeedbackBufferBase, vFuuu)
-GO(glTransformFeedbackBufferRange, vFuuull)
-GO(glGetTransformFeedbackiv, vFuip)
-GO(glGetTransformFeedbacki_v, vFuiup)
-GO(glGetTransformFeedbacki64_v, vFuiup)
-GO(glCreateBuffers, vFlp)
-GO(glNamedBufferStorage, vFulpu)
-GO(glNamedBufferStorageEXT, vFulpu)
-GO(glNamedBufferData, vFulpi)
-GO(glNamedBufferSubData, vFullp)
-GO(glCopyNamedBufferSubData, vFuulll)
-GO(glClearNamedBufferData, vFuiiip)
-GO(glClearNamedBufferSubData, vFuilliip)
-GO(glMapNamedBuffer, pFui)
-GO(glMapNamedBufferRange, pFullu)
-GO(glUnmapNamedBuffer, iFu)
-GO(glFlushMappedNamedBufferRange, vFull)
-GO(glGetNamedBufferParameteriv, vFuip)
-GO(glGetNamedBufferParameteri64v, vFuip)
-GO(glGetNamedBufferPointerv, vFuip)
-GO(glGetNamedBufferSubData, vFullp)
-GO(glCreateFramebuffers, vFlp)
-GO(glNamedFramebufferRenderbuffer, vFuiiu)
-GO(glNamedFramebufferParameteri, vFuii)
-GO(glNamedFramebufferTexture, vFuiui)
-GO(glNamedFramebufferTextureLayer, vFuiuii)
-GO(glNamedFramebufferDrawBuffer, vFui)
-GO(glNamedFramebufferDrawBuffers, vFulp)
-GO(glNamedFramebufferReadBuffer, vFui)
-GO(glInvalidateNamedFramebufferData, vFulp)
-GO(glInvalidateNamedFramebufferSubData, vFulpiill)
-GO(glClearNamedFramebufferiv, vFuiip)
-GO(glClearNamedFramebufferuiv, vFuiip)
-GO(glClearNamedFramebufferfv, vFuiip)
-GO(glClearNamedFramebufferfi, vFuiifi)
-GO(glBlitNamedFramebuffer, vFuuiiiiiiiiui)
-GO(glCheckNamedFramebufferStatus, iFui)
-GO(glGetNamedFramebufferParameteriv, vFuip)
-GO(glGetNamedFramebufferAttachmentParameteriv, vFuiip)
-GO(glCreateRenderbuffers, vFlp)
-GO(glNamedRenderbufferStorage, vFuill)
-GO(glNamedRenderbufferStorageMultisample, vFulill)
-GO(glGetNamedRenderbufferParameteriv, vFuip)
-GO(glCreateTextures, vFilp)
-GO(glTextureBuffer, vFuiu)
-GO(glTextureBufferRange, vFuiull)
-GO(glTextureStorage1D, vFulil)
-GO(glTextureStorage2D, vFulill)
-GO(glTextureStorage3D, vFulilll)
-GO(glTextureStorage2DMultisample, vFulilli)
-GO(glTextureStorage3DMultisample, vFulillli)
-GO(glTextureSubImage1D, vFuiiliip)
-GO(glTextureSubImage2D, vFuiiilliip)
-GO(glTextureSubImage3D, vFuiiiillliip)
-GO(glCompressedTextureSubImage1D, vFuiililp)
-GO(glCompressedTextureSubImage2D, vFuiiillilp)
-GO(glCompressedTextureSubImage3D, vFuiiiilllilp)
-GO(glCopyTextureSubImage1D, vFuiiiil)
-GO(glCopyTextureSubImage2D, vFuiiiiill)
-GO(glCopyTextureSubImage3D, vFuiiiiiiill)
-GO(glTextureParameterf, vFuif)
-GO(glTextureParameterfv, vFuip)
-GO(glTextureParameteri, vFuii)
-GO(glTextureParameterIiv, vFuip)
-GO(glTextureParameterIuiv, vFuip)
-GO(glTextureParameteriv, vFuip)
-GO(glGenerateTextureMipmap, vFu)
-GO(glBindTextureUnit, vFuu)
-GO(glGetTextureImage, vFuiiilp)
-GO(glGetCompressedTextureImage, vFuilp)
-GO(glGetTextureLevelParameterfv, vFuiip)
-GO(glGetTextureLevelParameteriv, vFuiip)
-GO(glGetTextureParameterfv, vFuip)
-GO(glGetTextureParameterIiv, vFuip)
-GO(glGetTextureParameterIuiv, vFuip)
-GO(glGetTextureParameteriv, vFuip)
-GO(glCreateVertexArrays, vFlp)
-GO(glDisableVertexArrayAttrib, vFuu)
-GO(glEnableVertexArrayAttrib, vFuu)
-GO(glVertexArrayElementBuffer, vFuu)
-GO(glVertexArrayVertexBuffer, vFuuull)
-GO(glVertexArrayVertexBuffers, vFuulppp)
-GO(glVertexArrayAttribBinding, vFuuu)
-GO(glVertexArrayAttribFormat, vFuuiiiu)
-GO(glVertexArrayAttribIFormat, vFuuiiu)
-GO(glVertexArrayAttribLFormat, vFuuiiu)
-GO(glVertexArrayBindingDivisor, vFuuu)
-GO(glGetVertexArrayiv, vFuip)
-GO(glGetVertexArrayIndexediv, vFuuip)
-GO(glGetVertexArrayIndexed64iv, vFuuip)
-GO(glCreateSamplers, vFlp)
-GO(glCreateProgramPipelines, vFip)
-GO(glTextureBarrier, vFv)
-GO(glTextureParameteriiv, vFuip)
-GO(glTextureParameteriuiv, vFuip)
-GO(glCreateQueries, vFilp)
-GO(glGetQueryBufferObjecti64v, vFuuil)
-GO(glGetQueryBufferObjectiv, vFuuil)
-GO(glGetQueryBufferObjectui64v, vFuuil)
-GO(glGetQueryBufferObjectuiv, vFuuil)
-GO(glMemoryBarrierByRegion, vFu)
-GO(glGetTextureSubImage, vFuiiiillliilp)
-GO(glGetCompressedTextureSubImage, vFuiiiillllp)
-GO(glGetGraphicsResetStatus, iFv)
-//VERSION_4_6
-GO(glSpecializeShader, vFippp)
-
-GO(glTexturePageCommitmentEXT, vFuiiiillli)
-GO(glVertexArrayVertexAttribDivisorEXT, vFuuu)
+GO(glColor3fVertex3fSUN, vFffffff)
+GO(glColor3fVertex3fvSUN, vFpp)
+GO(glColor4fNormal3fVertex3fSUN, vFffffffffff)
+GO(glColor4fNormal3fVertex3fvSUN, vFppp)
+GO(glColor4ubVertex2fSUN, vFCCCCff)
+GO(glColor4ubVertex2fvSUN, vFpp)
+GO(glColor4ubVertex3fSUN, vFCCCCfff)
+GO(glColor4ubVertex3fvSUN, vFpp)
+GO(glNormal3fVertex3fSUN, vFffffff)
+GO(glNormal3fVertex3fvSUN, vFpp)
+GO(glReplacementCodeuiColor3fVertex3fSUN, vFuffffff)
+GO(glReplacementCodeuiColor3fVertex3fvSUN, vFppp)
+GO(glReplacementCodeuiColor4fNormal3fVertex3fSUN, vFuffffffffff)
+GO(glReplacementCodeuiColor4fNormal3fVertex3fvSUN, vFpppp)
+GO(glReplacementCodeuiColor4ubVertex3fSUN, vFuCCCCfff)
+GO(glReplacementCodeuiColor4ubVertex3fvSUN, vFppp)
+GO(glReplacementCodeuiNormal3fVertex3fSUN, vFuffffff)
+GO(glReplacementCodeuiNormal3fVertex3fvSUN, vFppp)
+GO(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN, vFuffffffffffff)
+GO(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN, vFppppp)
+GO(glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN, vFuffffffff)
+GO(glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN, vFpppp)
+GO(glReplacementCodeuiTexCoord2fVertex3fSUN, vFufffff)
+GO(glReplacementCodeuiTexCoord2fVertex3fvSUN, vFppp)
+GO(glReplacementCodeuiVertex3fSUN, vFufff)
+GO(glReplacementCodeuiVertex3fvSUN, vFpp)
+GO(glTexCoord2fColor3fVertex3fSUN, vFffffffff)
+GO(glTexCoord2fColor3fVertex3fvSUN, vFppp)
+GO(glTexCoord2fColor4fNormal3fVertex3fSUN, vFffffffffffff)
+GO(glTexCoord2fColor4fNormal3fVertex3fvSUN, vFpppp)
+GO(glTexCoord2fColor4ubVertex3fSUN, vFffCCCCfff)
+GO(glTexCoord2fColor4ubVertex3fvSUN, vFppp)
+GO(glTexCoord2fNormal3fVertex3fSUN, vFffffffff)
+GO(glTexCoord2fNormal3fVertex3fvSUN, vFppp)
+GO(glTexCoord2fVertex3fSUN, vFfffff)
+GO(glTexCoord2fVertex3fvSUN, vFpp)
+GO(glTexCoord4fColor4fNormal3fVertex4fSUN, vFfffffffffffffff)
+GO(glTexCoord4fColor4fNormal3fVertex4fvSUN, vFpppp)
+GO(glTexCoord4fVertex4fSUN, vFffffffff)
+GO(glTexCoord4fVertex4fvSUN, vFpp)
//GL_ARB_polygon_offset_clamp
GO(glPolygonOffsetClamp, vFfff)
@@ -2909,45 +2910,45 @@ GO(glRenderbufferStorageMultisampleEXT, vFilill)
GO(glFramebufferTexture2DMultisampleEXT, vFiiiuil)
//GL_KTX_buffer_region
-GO(glBufferRegionEnabled,uFv)
-GO(glNewBufferRegion,uFi)
-GO(glDeleteBufferRegion,vFi)
-GO(glReadBufferRegion,vFuiiii)
-GO(glDrawBufferRegion,vFuiiiiii)
+GO(glBufferRegionEnabled, uFv)
+GO(glNewBufferRegion, uFi)
+GO(glDeleteBufferRegion, vFi)
+GO(glReadBufferRegion, vFuiiii)
+GO(glDrawBufferRegion, vFuiiiiii)
//GL_ARB_sparse_buffer
-GO(glBufferPageCommitmentARB, vFippi)
-GO(glNamedBufferPageCommitmentARB, vFuppi)
+GO(glBufferPageCommitmentARB, vFullC)
+GO(glNamedBufferPageCommitmentARB, vFullC)
GO(glNamedBufferPageCommitmentEXT, vFuppi)
//GL_ARB_sparse_texture
GO(TexPageCommitmentARB, vFiiiiiiiii)
//glx
-GO(glXBindHyperpipeSGIX,iFpi)
+GO(glXBindHyperpipeSGIX, iFpi)
GO(glXBindTexImageEXT, vFppip)
GO(glXBindSwapBarrierNV, iFpuu)
GO(glXBindSwapBarrierSGIX,vFii)
GO(glXBindVideoCaptureDeviceNV, iFpup)
GO(glXBindVideoDeviceNV, iFpuup)
GO(glXBindVideoImageNV, iFpppi)
-GO(glXChangeDrawableAttributes,vFp)
-GO(glXChangeDrawableAttributesSGIX,vFp)
-GO(glXClientInfo,vFv)
-GO(glXCopyContext,vFppp)
+GO(glXChangeDrawableAttributes, vFp)
+GO(glXChangeDrawableAttributesSGIX, vFp)
+GO(glXClientInfo, vFv)
+GO(glXCopyContext, vFppp)
GO(glXChooseFBConfig, pFpipp)
GO(glXChooseFBConfigSGIX, pFpipp)
GO(glXCreateContext,pFpppi)
GO(glXCreateContextAttribsARB, pFpppip)
-GO(glXCreateContextWithConfigSGIX,pFppipi)
-GO(glXCreateGLXPbufferSGIX,pFppuup)
-GO(glXCreateGLXPixmap,pFppp)
-GO(glXCreateGLXPixmapWithConfigSGIX,pFppp)
-GO(glXCreateGLXVideoSourceSGIX,pFpippip)
-GO(glXCreateNewContext,pFppipi)
-GO(glXCreatePbuffer,pFppp)
-GO(glXCreatePixmap,pFppp)
-GO(glXCreateWindow,pFpppp)
+GO(glXCreateContextWithConfigSGIX, pFppipi)
+GO(glXCreateGLXPbufferSGIX, pFppuup)
+GO(glXCreateGLXPixmap, pFppp)
+GO(glXCreateGLXPixmapWithConfigSGIX, pFppp)
+GO(glXCreateGLXVideoSourceSGIX, pFpippip)
+GO(glXCreateNewContext, pFppipi)
+GO(glXCreatePbuffer, pFppp)
+GO(glXCreatePixmap, pFppp)
+GO(glXCreateWindow, pFpppp)
GO(glXChooseVisual, pFpip)
GO(glXCopyImageSubDataNV, vFppuiiiiipuiiiiiiii)
GO(glXCopySubBufferMESA, vFppiiii)
@@ -3061,15 +3062,15 @@ GO(glXAllocateMemoryNV, pFlfff)
GO(glXFreeMemoryNV, vFp)
//GLX_ARB_????
-GO(glSpecializeShaderARB, vFippp)
+GO(glSpecializeShaderARB, vFupupp)
//GL_EXT_debug_label
-GO(glGetObjectLabelEXT, vFiulpp)
-GO(glLabelObjectEXT, vFiulp)
+GO(glGetObjectLabelEXT, vFuuipp)
+GO(glLabelObjectEXT, vFuuip)
//GL_EXT_debug_marker
GO(glInsertEventMarkerEXT, vFlp)
-GO(glPushGroupMarkerEXT, vFlp)
+GO(glPushGroupMarkerEXT, vFip)
GO(glPopGroupMarkerEXT, vFv)
//GL_KHR_blend_equation_advanced
@@ -3077,7 +3078,7 @@ GO(glBlendBarrierKHR, vFv)
//Some various other extension
GO(glResolveMultisampleFramebufferAPPLE, vFv)
-GO(glTexPageCommitmentARB, vFiiiiillli)
+GO(glTexPageCommitmentARB, vFuiiiiiiiC)
//GL_ARB_sample_locations
GO(glFramebufferSampleLocationsfvARB, vFiulp)
@@ -3088,42 +3089,42 @@ GO(glEvaluateDepthValuesARB, vFv)
GO(glMaxShaderCompilerThreadsARB, vFu)
//GL_ARB_indirect_parameters
-GO(glMultiDrawArraysIndirectCountARB, vFiplll)
-GO(glMultiDrawElementsIndirectCountARB, vFiiplll)
+GO(glMultiDrawArraysIndirectCountARB, vFuplii)
+GO(glMultiDrawElementsIndirectCountARB, vFuuplii)
//GL_ARB_gpu_shader_int64
-GO(glUniform1i64ARB, vFiI)
-GO(glUniform2i64ARB, vFiII)
-GO(glUniform3i64ARB, vFiIII)
-GO(glUniform4i64ARB, vFiIIII)
+GO(glUniform1i64ARB, vFil)
+GO(glUniform2i64ARB, vFill)
+GO(glUniform3i64ARB, vFilll)
+GO(glUniform4i64ARB, vFillll)
GO(glUniform1i64vARB, vFilp)
GO(glUniform2i64vARB,vFilp)
GO(glUniform3i64vARB,vFilp)
-GO(glUniform4i64vARB,vFilp)
+GO(glUniform4i64vARB, vFiip)
GO(glUniform1ui64ARB,vFiU)
-GO(glUniform2ui64ARB,vFiUU)
-GO(glUniform3ui64ARB, vFiUUU)
-GO(glUniform4ui64ARB, vFiUUUU)
+GO(glUniform2ui64ARB, vFiLL)
+GO(glUniform3ui64ARB, vFiLLL)
+GO(glUniform4ui64ARB, vFiLLLL)
GO(glUniform1ui64vARB, vFilp)
GO(glUniform2ui64vARB, vFilp)
GO(glUniform3ui64vARB, vFilp)
GO(glUniform4ui64vARB, vFilp)
GO(glGetUniformi64vARB, vFuip)
GO(glGetUniformui64vARB, vFuip)
-GO(glGetnUniformi64vARB, vFuilp)
-GO(glGetnUniformui64vARB, vFuilp)
-GO(glProgramUniform1i64ARB, vFuiI)
-GO(glProgramUniform2i64ARB, vFuiII)
-GO(glProgramUniform3i64ARB, vFuiIII)
-GO(glProgramUniform4i64ARB, vFuiIIII)
+GO(glGetnUniformi64vARB, vFuiip)
+GO(glGetnUniformui64vARB, vFuiip)
+GO(glProgramUniform1i64ARB, vFuil)
+GO(glProgramUniform2i64ARB, vFuill)
+GO(glProgramUniform3i64ARB, vFuilll)
+GO(glProgramUniform4i64ARB, vFuillll)
GO(glProgramUniform1i64vARB, vFuilp)
GO(glProgramUniform2i64vARB, vFuilp)
GO(glProgramUniform3i64vARB, vFuilp)
-GO(glProgramUniform4i64vARB, vFuilp)
+GO(glProgramUniform4i64vARB, vFuiip)
GO(glProgramUniform1ui64ARB, vFuiU)
-GO(glProgramUniform2ui64ARB, vFuiUU)
-GO(glProgramUniform3ui64ARB, vFuiUUU)
-GO(glProgramUniform4ui64ARB, vFuiUUUU)
+GO(glProgramUniform2ui64ARB, vFuiLL)
+GO(glProgramUniform3ui64ARB, vFuiLLL)
+GO(glProgramUniform4ui64ARB, vFuiLLLL)
GO(glProgramUniform1ui64vARB, vFuilp)
GO(glProgramUniform2ui64vARB, vFuilp)
GO(glProgramUniform3ui64vARB, vFuilp)
@@ -3155,23 +3156,23 @@ GO(glGetVertexAttribLui64vARB, vFuip)
//GL_OES_EGL_image
GO(glEGLImageTargetTexture2DOES, vFip)
-GO(glEGLImageTargetRenderbufferStorageOES, vFip)
+GO(glEGLImageTargetRenderbufferStorageOES, vFup)
//GL_MESA_program_debug
GOM(glProgramCallbackMESA, vFEipp)
GO(glGetProgramRegisterfvMESA, vFilpp)
//GL_????_ATI
-GO(glBlendEquationSeparateATI, vFii)
+GO(glBlendEquationSeparateATI, vFuu)
//GL_AMD_interleaved_elements
GO(glVertexAttribParameteriAMD, vFuii)
//GL_AMD_occlusion_query_event
-GO(glQueryObjectParameteruiAMD, vFiuiu)
+GO(glQueryObjectParameteruiAMD, vFuuuu)
//GL_EXT_raster_multisample
-GO(glRasterSamplesEXT, vFui)
+GO(glRasterSamplesEXT, vFuC)
//GL_INTEL_performance_query
GO(glBeginPerfQueryINTEL, vFu)
@@ -3181,17 +3182,17 @@ GO(glEndPerfQueryINTEL, vFu)
GO(glGetFirstPerfQueryIdINTEL, vFp)
GO(glGetNextPerfQueryIdINTEL, vFup)
GO(glGetPerfCounterInfoINTEL, vFuuupupppppp)
-GO(glGetPerfQueryDataINTEL, vFuulpp)
+GO(glGetPerfQueryDataINTEL, vFuuipp)
GO(glGetPerfQueryIdByNameINTEL, vFpp)
GO(glGetPerfQueryInfoINTEL, vFuuppppp)
//GL_NV_bindless_multi_draw_indirect
-GO(glMultiDrawArraysIndirectBindlessNV, vFiplli)
-GO(glMultiDrawElementsIndirectBindlessNV, vFiiplli)
+GO(glMultiDrawArraysIndirectBindlessNV, vFupiii)
+GO(glMultiDrawElementsIndirectBindlessNV, vFuupiii)
//GL_NV_bindless_multi_draw_indirect_count
-GO(glMultiDrawArraysIndirectBindlessCountNV, vFipllli)
-GO(glMultiDrawElementsIndirectBindlessCountNV, vFiipllli)
+GO(glMultiDrawArraysIndirectBindlessCountNV, vFupiiii)
+GO(glMultiDrawElementsIndirectBindlessCountNV, vFuupiiii)
//GL_NV_blend_equation_advanced
GO(glBlendParameteriNV, vFii)
@@ -3202,10 +3203,10 @@ GO(glCreateStatesNV, vFlp)
GO(glDeleteStatesNV, vFlp)
GO(glIsStateNV, iFu)
GO(glStateCaptureNV, vFui)
-GO(glGetCommandHeaderNV, uFiu)
-GO(glGetStageIndexNV, WFi)
-GO(glDrawCommandsNV, vFiuppu)
-GO(glDrawCommandsAddressNV, vFippu)
+GO(glGetCommandHeaderNV, uFuu)
+GO(glGetStageIndexNV, WFu)
+GO(glDrawCommandsNV, vFuuppu)
+GO(glDrawCommandsAddressNV, vFuppu)
GO(glDrawCommandsStatesNV, vFuppppu)
GO(glDrawCommandsStatesAddressNV, vFppppu)
GO(glCreateCommandListsNV, vFlp)
@@ -3224,24 +3225,24 @@ GO(glFragmentCoverageColorNV, vFu)
//GL_NV_framebuffer_mixed_samples
GO(glCoverageModulationTableNV, vFlp)
-GO(glGetCoverageModulationTableNV, vFlp)
+GO(glGetCoverageModulationTableNV, vFip)
GO(glCoverageModulationNV, vFi)
//GL_NV_internalformat_sample_query
-GO(glGetInternalformatSampleivNV, vFiililp)
+GO(glGetInternalformatSampleivNV, vFuuiuip)
//GL_NV_path_rendering
GO(glGenPathsNV, uFl)
GO(glDeletePathsNV, vFul)
GO(glIsPathNV, iFu)
-GO(glPathCommandsNV, vFulplup)
-GO(glPathCoordsNV, vFulip)
-GO(glPathSubCommandsNV, vFulllplip)
-GO(glPathSubCoordsNV, vFullip)
-GO(glPathStringNV, vFuilp)
-GO(glPathGlyphsNV, vFuipulipiuf)
-GO(glPathGlyphRangeNV, vFuipuliuf)
-GO(glWeightPathsNV, vFulpp)
+GO(glPathCommandsNV, vFuipiup)
+GO(glPathCoordsNV, vFuiup)
+GO(glPathSubCommandsNV, vFuiiipiup)
+GO(glPathSubCoordsNV, vFuiiup)
+GO(glPathStringNV, vFuuip)
+GO(glPathGlyphsNV, vFuupuiupuuf)
+GO(glPathGlyphRangeNV, vFuupuuiuuf)
+GO(glWeightPathsNV, vFuipp)
GO(glCopyPathNV, vFuu)
GO(glInterpolatePathsNV, vFuuuf)
GO(glTransformPathNV, vFuuip)
@@ -3250,46 +3251,46 @@ GO(glPathParameteriNV, vFuii)
GO(glPathParameterfvNV, vFuip)
GO(glPathParameterfNV, vFuif)
GO(glPathDashArrayNV, vFulp)
-GO(glPathStencilFuncNV, vFiiu)
+GO(glPathStencilFuncNV, vFuiu)
GO(glPathStencilDepthOffsetNV, vFff)
-GO(glStencilFillPathNV, vFuiu)
+GO(glStencilFillPathNV, vFuuu)
GO(glStencilStrokePathNV, vFuiu)
-GO(glStencilFillPathInstancedNV, vFlipuiuip)
-GO(glStencilStrokePathInstancedNV, vFlipuiuip)
+GO(glStencilFillPathInstancedNV, vFiupuuuup)
+GO(glStencilStrokePathInstancedNV, vFiupuiuup)
GO(glPathCoverDepthFuncNV, vFi)
GO(glCoverFillPathNV, vFui)
GO(glCoverStrokePathNV, vFui)
GO(glCoverFillPathInstancedNV, vFlipuiip)
-GO(glCoverStrokePathInstancedNV, vFlipuiip)
+GO(glCoverStrokePathInstancedNV, vFiupuuup)
GO(glGetPathParameterivNV, vFuip)
GO(glGetPathParameterfvNV, vFuip)
GO(glGetPathCommandsNV, vFup)
GO(glGetPathCoordsNV, vFup)
GO(glGetPathDashArrayNV, vFup)
-GO(glGetPathMetricsNV, vFulipulp)
-GO(glGetPathMetricRangeNV, vFuullp)
-GO(glGetPathSpacingNV, vFilipufip)
-GO(glIsPointInFillPathNV, iFuuff)
-GO(glIsPointInStrokePathNV, iFuff)
-GO(glGetPathLengthNV, fFull)
-GO(glPointAlongPathNV, iFullfpppp)
+GO(glGetPathMetricsNV, vFuiupuip)
+GO(glGetPathMetricRangeNV, vFuuiip)
+GO(glGetPathSpacingNV, vFuiupuffup)
+GO(glIsPointInFillPathNV, CFuuff)
+GO(glIsPointInStrokePathNV, CFuff)
+GO(glGetPathLengthNV, fFuii)
+GO(glPointAlongPathNV, CFuiifpppp)
GO(glMatrixLoad3x2fNV, vFip)
GO(glMatrixLoad3x3fNV, vFip)
GO(glMatrixLoadTranspose3x3fNV, vFip)
GO(glMatrixMult3x2fNV, vFip)
GO(glMatrixMult3x3fNV, vFip)
GO(glMatrixMultTranspose3x3fNV, vFip)
-GO(glStencilThenCoverFillPathNV, vFuiui)
-GO(glStencilThenCoverStrokePathNV, vFuiui)
-GO(glStencilThenCoverFillPathInstancedNV, vFlipuiuiip)
-GO(glStencilThenCoverStrokePathInstancedNV, vFlipuiuiip)
-GO(glPathGlyphIndexRangeNV, iFipuufp)
-GO(glPathGlyphIndexArrayNV, iFuipuuluf)
-GO(glPathMemoryGlyphIndexArrayNV, iFuilpluluf)
-GO(glProgramPathFragmentInputGenNV, vFuiiip)
-GO(glGetProgramResourcefvNV, vFuiulplpp)
-GO(glPathColorGenNV, vFiiip)
-GO(glPathTexGenNV, vFiiip)
+GO(glStencilThenCoverFillPathNV, vFuuuu)
+GO(glStencilThenCoverStrokePathNV, vFuiuu)
+GO(glStencilThenCoverFillPathInstancedNV, vFiupuuuuup)
+GO(glStencilThenCoverStrokePathInstancedNV, vFiupuiuuup)
+GO(glPathGlyphIndexRangeNV, uFupuufp)
+GO(glPathGlyphIndexArrayNV, uFuupuuiuf)
+GO(glPathMemoryGlyphIndexArrayNV, uFuulpiuiuf)
+GO(glProgramPathFragmentInputGenNV, vFuiuip)
+GO(glGetProgramResourcefvNV, vFuuuipipp)
+GO(glPathColorGenNV, vFuuup)
+GO(glPathTexGenNV, vFuuip)
GO(glPathFogGenNV, vFi)
GO(glGetPathColorGenivNV, vFiip)
GO(glGetPathColorGenfvNV, vFiip)
@@ -3298,7 +3299,7 @@ GO(glGetPathTexGenfvNV, vFiip)
//GL_NV_sample_locations
GO(glFramebufferSampleLocationsfvNV, vFiulp)
-GO(glNamedFramebufferSampleLocationsfvNV, vFuulp)
+GO(glNamedFramebufferSampleLocationsfvNV, vFuuip)
GO(glResolveDepthValuesNV, vFv)
//GL_KHR_robustness
@@ -3408,40 +3409,40 @@ GO(glGetClipPlanef,vFup)
GO(glOrthof,vFffffff)
// GL_EXT_window_rectangles
-GO(glWindowRectanglesEXT, vFilp)
+GO(glWindowRectanglesEXT, vFuip)
// GL_EXT_memory_object
-GO(glGetUnsignedBytevEXT, vFip)
-GO(glGetUnsignedBytei_vEXT, vFiup)
+GO(glGetUnsignedBytevEXT, vFup)
+GO(glGetUnsignedBytei_vEXT, vFuup)
GO(glDeleteMemoryObjectsEXT, vFlp)
GO(glIsMemoryObjectEXT, iFu)
GO(glCreateMemoryObjectsEXT, vFlp)
GO(glMemoryObjectParameterivEXT, vFuip)
GO(glGetMemoryObjectParameterivEXT, vFuip)
-GO(glTexStorageMem2DEXT, vFililluU)
-GO(glTexStorageMem2DMultisampleEXT, vFililliuU)
-GO(glTexStorageMem3DEXT, vFilillluU)
-GO(glTexStorageMem3DMultisampleEXT, vFilillliuU)
-GO(glBufferStorageMemEXT, vFiluU)
-GO(glTextureStorageMem2DEXT, vFulilluU)
-GO(glTextureStorageMem2DMultisampleEXT, vFulilliuU)
-GO(glTextureStorageMem3DEXT, vFulillluU)
-GO(glTextureStorageMem3DMultisampleEXT, vFulillliuU)
-GO(glNamedBufferStorageMemEXT, vFuluU)
-GO(glTexStorageMem1DEXT, vFililuU)
-GO(glTextureStorageMem1DEXT, vFuliluU)
+GO(glTexStorageMem2DEXT, vFuiuiiuL)
+GO(glTexStorageMem2DMultisampleEXT, vFuiuiiCuL)
+GO(glTexStorageMem3DEXT, vFuiuiiiuL)
+GO(glTexStorageMem3DMultisampleEXT, vFuiuiiiCuL)
+GO(glBufferStorageMemEXT, vFuluL)
+GO(glTextureStorageMem2DEXT, vFuiuiiuL)
+GO(glTextureStorageMem2DMultisampleEXT, vFuiuiiCuL)
+GO(glTextureStorageMem3DEXT, vFuiuiiiuL)
+GO(glTextureStorageMem3DMultisampleEXT, vFuiuiiiCuL)
+GO(glNamedBufferStorageMemEXT, vFuluL)
+GO(glTexStorageMem1DEXT, vFuiuiuL)
+GO(glTextureStorageMem1DEXT, vFuiuiuL)
// GL_EXT_semaphore
GO(glGenSemaphoresEXT, vFlp)
GO(glDeleteSemaphoresEXT, vFlp)
GO(glIsSemaphoreEXT, iFu)
-GO(glSemaphoreParameterui64vEXT, vFuip)
+GO(glSemaphoreParameterui64vEXT, vFuup)
GO(glGetSemaphoreParameterui64vEXT, vFuip)
GO(glWaitSemaphoreEXT, vFuupupp)
GO(glSignalSemaphoreEXT, vFuupupp)
// GL_EXT_memory_object_fd
-GO(glImportMemoryFdEXT, vFuUii)
+GO(glImportMemoryFdEXT, vFuLui)
// GL_KHR_parallel_shader_compile
GO(glMaxShaderCompilerThreadsKHR, vFu)
@@ -3465,27 +3466,27 @@ GO(glRenderbufferStorageMultisampleIMG, vFilill)
GO(glGetTranslatedShaderSourceANGLE, vFulpp)
// GL_EXT_EGL_image_storage
-GO(glEGLImageTargetTexStorageEXT, vFipp)
+GO(glEGLImageTargetTexStorageEXT, vFupp)
GO(glEGLImageTargetTextureStorageEXT, vFupp)
// GL_EXT_external_buffer
-GO(glBufferStorageExternalEXT, vFillpu)
-GO(glNamedBufferStorageExternalEXT, vFullpp)
+GO(glBufferStorageExternalEXT, vFullpu)
+GO(glNamedBufferStorageExternalEXT, vFullpu)
// GL_EXT_memory_object_win32
-GO(glImportMemoryWin32HandleEXT, vFuUip)
-GO(glImportMemoryWin32NameEXT, vFuUip)
+GO(glImportMemoryWin32HandleEXT, vFuLup)
+GO(glImportMemoryWin32NameEXT, vFuLup)
// GL_EXT_semaphore_win32
-GO(glImportSemaphoreWin32HandleEXT, vFuip)
+GO(glImportSemaphoreWin32HandleEXT, vFuup)
GO(glImportSemaphoreWin32NameEXT, vFuip)
// GL_EXT_shader_framebuffer_fetch_non_coherent
GO(glFramebufferFetchBarrierEXT, vFv)
// GL_EXT_win32_keyed_mutex
-GO(glAcquireKeyedMutexWin32EXT, iFuUu)
-GO(glReleaseKeyedMutexWin32EXT, iFuU)
+GO(glAcquireKeyedMutexWin32EXT, CFuLu)
+GO(glReleaseKeyedMutexWin32EXT, CFuL)
// GL_INTEL_framebuffer_CMAA
GO(glApplyFramebufferAttachmentCMAAINTEL, vFv)
@@ -3503,73 +3504,73 @@ GO(glConservativeRasterParameterfNV, vFif)
GO(glConservativeRasterParameteriNV, vFii)
// GL_NV_draw_vulkan_image
-GO(glDrawVkImageNV, vFUufffffffff)
+GO(glDrawVkImageNV, vFLufffffffff)
GOM(glGetVkProcAddrNV, pFEp)
GO(glWaitVkSemaphoreNV, vFU)
GO(glSignalVkSemaphoreNV, vFU)
-GO(glSignalVkFenceNV, vFU)
+GO(glSignalVkFenceNV, vFL)
// GL_NV_gpu_multicast
GO(glRenderGpuMaskNV, vFu)
GO(glMulticastBufferSubDataNV, vFuullp)
GO(glMulticastCopyBufferSubDataNV, vFuuuulll)
-GO(glMulticastCopyImageSubDataNV, vFuuuiiiiiuiiiiilll)
-GO(glMulticastBlitFramebufferNV, vFuuiiiiiiiiui)
-GO(glMulticastFramebufferSampleLocationsfvNV, vFuuulp)
+GO(glMulticastCopyImageSubDataNV, vFuuuuiiiiuuiiiiiii)
+GO(glMulticastBlitFramebufferNV, vFuuiiiiiiiiuu)
+GO(glMulticastFramebufferSampleLocationsfvNV, vFuuuip)
GO(glMulticastBarrierNV, vFv)
GO(glMulticastWaitSyncNV, vFuu)
GO(glMulticastGetQueryObjectivNV, vFuuip)
-GO(glMulticastGetQueryObjectuivNV, vFuuip)
-GO(glMulticastGetQueryObjecti64vNV, vFuuip)
-GO(glMulticastGetQueryObjectui64vNV, vFuuip)
+GO(glMulticastGetQueryObjectuivNV, vFuuup)
+GO(glMulticastGetQueryObjecti64vNV, vFuuup)
+GO(glMulticastGetQueryObjectui64vNV, vFuuup)
// GL_NV_memory_attachment
-GO(glGetMemoryObjectDetachedResourcesuivNV, vFuiilp)
+GO(glGetMemoryObjectDetachedResourcesuivNV, vFuuiip)
GO(glResetMemoryObjectParameterNV, vFui)
GO(glTexAttachMemoryNV, vFiuU)
-GO(glBufferAttachMemoryNV, vFiuU)
+GO(glBufferAttachMemoryNV, vFuuL)
GO(glTextureAttachMemoryNV, vFuuU)
-GO(glNamedBufferAttachMemoryNV, vFuuU)
+GO(glNamedBufferAttachMemoryNV, vFuuL)
// GL_NV_mesh_shader
GO(glDrawMeshTasksNV, vFuu)
GO(glDrawMeshTasksIndirectNV, vFl)
-GO(glMultiDrawMeshTasksIndirectNV, vFlll)
-GO(glMultiDrawMeshTasksIndirectCountNV, vFllll)
+GO(glMultiDrawMeshTasksIndirectNV, vFlii)
+GO(glMultiDrawMeshTasksIndirectCountNV, vFllii)
// GL_NV_query_resource
-GO(glQueryResourceNV, iFiiup)
+GO(glQueryResourceNV, iFuiup)
// GL_NV_query_resource_tag
GO(glGenQueryResourceTagNV, vFlp)
-GO(glDeleteQueryResourceTagNV, vFlp)
-GO(glQueryResourceTagNV, vFup)
+GO(glDeleteQueryResourceTagNV, vFip)
+GO(glQueryResourceTagNV, vFip)
// GL_NV_scissor_exclusive
-GO(glScissorExclusiveArrayvNV, vFulp)
-GO(glScissorExclusiveNV, vFiill)
+GO(glScissorExclusiveArrayvNV, vFuip)
+GO(glScissorExclusiveNV, vFiiii)
// GL_NV_shading_rate_image
GO(glBindShadingRateImageNV, vFu)
-GO(glShadingRateImagePaletteNV, vFuulp)
+GO(glShadingRateImagePaletteNV, vFuuip)
GO(glGetShadingRateImagePaletteNV, vFuup)
-GO(glShadingRateImageBarrierNV, vFi)
+GO(glShadingRateImageBarrierNV, vFC)
GO(glShadingRateSampleOrderNV, vFi)
-GO(glShadingRateSampleOrderCustomNV, vFiup)
-GO(glGetShadingRateSampleLocationivNV, vFiuup)
+GO(glShadingRateSampleOrderCustomNV, vFuup)
+GO(glGetShadingRateSampleLocationivNV, vFuuup)
// GL_NV_viewport_swizzle
-GO(glViewportSwizzleNV, vFuiiii)
+GO(glViewportSwizzleNV, vFuuuuu)
// GL_OVR_multiview
-GO(glFramebufferTextureMultiviewOVR, vFiiuiil)
+GO(glFramebufferTextureMultiviewOVR, vFuuuiii)
GO(glNamedFramebufferTextureMultiviewOVR, vFuiuiil)
// GL_AMD_framebuffer_sample_positions
-GO(glFramebufferSamplePositionsfvAMD, vFiuup)
+GO(glFramebufferSamplePositionsfvAMD, vFuuup)
GO(glNamedFramebufferSamplePositionsfvAMD, vFuuup)
-GO(glGetFramebufferParameterfvAMD, vFiiuulp)
-GO(glGetNamedFramebufferParameterfvAMD, vFuiuulp)
+GO(glGetFramebufferParameterfvAMD, vFuuuuip)
+GO(glGetNamedFramebufferParameterfvAMD, vFuuuuip)
// GL_ANGLE_framebuffer_blit
GO(glBlitFramebufferANGLE, vFiiiiiiiiui)
@@ -3703,9 +3704,9 @@ GO(glClearPixelLocalStorageuiEXT, vFllp)
GO(glTexPageCommitmentEXT, vFiiiiillli)
// GL_EXT_texture_storage
-GO(glTexStorage1DEXT, vFilil)
-GO(glTexStorage2DEXT, vFilill)
-GO(glTexStorage3DEXT, vFililll)
+GO(glTexStorage1DEXT, vFuiui)
+GO(glTexStorage2DEXT, vFuiuii)
+GO(glTexStorage3DEXT, vFuiuiii)
// GL_EXT_texture_view
GO(glTextureViewEXT, vFuiuiuuuu)
@@ -3980,3 +3981,26 @@ GO(wglGetSwapIntervalEXT, iFv)
// GL_MESA_framebuffer_flip_y
GO(glFramebufferParameteriMESA, vFiii)
GO(glGetFramebufferParameterivMESA, vFiip)
+
+// GL_NVX_gpu_multicast2
+GO(glUploadGpuMaskNVX, vFu)
+GO(glMulticastViewportArrayvNVX, vFuulp)
+GO(glMulticastViewportPositionWScaleNVX, vFuuff)
+GO(glMulticastScissorArrayvNVX, vFuuip)
+GO(glAsyncCopyBufferSubDataNVX, uFippuuuulllipp)
+GO(glAsyncCopyImageSubDataNVX, uFippuuuuiiiiuuiiiiiiiipp)
+
+// GL_NVX_progress_fence
+GO(glCreateProgressFenceNVX, uFv)
+GO(glSignalSemaphoreui64NVX, vFulpp)
+GO(glWaitSemaphoreui64NVX, vFuipp)
+GO(glClientWaitSemaphoreui64NVX, vFipp)
+
+// GL_NV_memory_object_sparse
+GO(glBufferPageCommitmentMemNV, vFulluLC)
+GO(glTexPageCommitmentMemNV, vFuiiiiiiiiuLC)
+GO(glNamedBufferPageCommitmentMemNV, vFulluLC)
+GO(glTexturePageCommitmentMemNV, vFuiiiiiiiiuLC)
+
+// GL_NV_vdpau_interop2
+GO(glVDPAURegisterVideoSurfaceWithPictureStructureNV, lFpuipC)
diff --git a/src/wrapped/wrappedlibglu.c b/src/wrapped/wrappedlibglu.c
index 57a2bb4..8c37087 100755..100644
--- a/src/wrapped/wrappedlibglu.c
+++ b/src/wrapped/wrappedlibglu.c
@@ -42,7 +42,7 @@ GO(9) \
static uintptr_t my_glu_callback_fct_##A = 0; \
static void my_glu_callback_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_glu_callback_fct_##A, 2, a, b); \
+ RunFunctionFmt(my_glu_callback_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -64,7 +64,7 @@ static void* findglu_callbackFct(void* fct)
static uintptr_t my_glu_callback4_fct_##A = 0; \
static void my_glu_callback4_##A(void* a, void* b, void* c, void* d) \
{ \
- RunFunction(my_context, my_glu_callback4_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_glu_callback4_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -86,7 +86,7 @@ static void* findglu_callback4Fct(void* fct)
static uintptr_t my_glu_callback5_fct_##A = 0; \
static void my_glu_callback5_##A(void* a, void* b, void* c, void* d, void* e) \
{ \
- RunFunction(my_context, my_glu_callback5_fct_##A, 5, a, b, c, d, e); \
+ RunFunctionFmt(my_glu_callback5_fct_##A, "ppppp", a, b, c, d, e); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedlibglu_private.h b/src/wrapped/wrappedlibglu_private.h
index a7c6b4a..a7c6b4a 100755..100644
--- a/src/wrapped/wrappedlibglu_private.h
+++ b/src/wrapped/wrappedlibglu_private.h
diff --git a/src/wrapped/wrappedlibharfbuzz.c b/src/wrapped/wrappedlibharfbuzz.c
new file mode 100644
index 0000000..8f4bb2c
--- /dev/null
+++ b/src/wrapped/wrappedlibharfbuzz.c
@@ -0,0 +1,1217 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+#include "wrappedlibs.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include <unistd.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include "debug.h"
+#include "callback.h"
+
+const char* libharfbuzzName = "libharfbuzz.so.0";
+#define LIBNAME libharfbuzz
+
+#include "generated/wrappedlibharfbuzztypes.h"
+
+#include "wrappercallback.h"
+
+struct hb_atomic_int_t
+{
+ int v;
+};
+
+struct hb_reference_count_t
+{
+ struct hb_atomic_int_t ref_count;
+};
+
+struct hb_atomic_ptr_t {
+ void* v;
+};
+
+struct hb_object_header_t
+{
+ struct hb_reference_count_t ref_count;
+ struct hb_atomic_int_t writable;
+ struct hb_atomic_ptr_t user_data;
+};
+
+/*
+ * hb_draw_funcs_t
+ */
+
+#define HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS \
+ HB_DRAW_FUNC_IMPLEMENT (move_to) \
+ HB_DRAW_FUNC_IMPLEMENT (line_to) \
+ HB_DRAW_FUNC_IMPLEMENT (quadratic_to) \
+ HB_DRAW_FUNC_IMPLEMENT (cubic_to) \
+ HB_DRAW_FUNC_IMPLEMENT (close_path) \
+ /* ^--- Add new callbacks here */
+
+struct hb_draw_funcs_t__func {
+#define HB_DRAW_FUNC_IMPLEMENT(name) void* name;
+ HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_DRAW_FUNC_IMPLEMENT
+};
+
+struct hb_draw_funcs_t__destroy {
+#define HB_DRAW_FUNC_IMPLEMENT(name) void* name;
+ HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_DRAW_FUNC_IMPLEMENT
+};
+
+struct hb_draw_funcs_t
+{
+ struct hb_object_header_t header;
+
+ struct hb_draw_funcs_t__func func;
+
+ struct {
+#define HB_DRAW_FUNC_IMPLEMENT(name) void *name;
+ HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_DRAW_FUNC_IMPLEMENT
+ } *user_data;
+
+ struct hb_draw_funcs_t__destroy* destroy;
+};
+
+/*
+ * hb_font_funcs_t
+ */
+
+#define HB_FONT_FUNCS_IMPLEMENT_CALLBACKS \
+ HB_FONT_FUNC_IMPLEMENT (get_,font_h_extents) \
+ HB_FONT_FUNC_IMPLEMENT (get_,font_v_extents) \
+ HB_FONT_FUNC_IMPLEMENT (get_,nominal_glyph) \
+ HB_FONT_FUNC_IMPLEMENT (get_,nominal_glyphs) \
+ HB_FONT_FUNC_IMPLEMENT (get_,variation_glyph) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_h_advance) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_v_advance) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_h_advances) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_v_advances) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_h_origin) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_v_origin) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_h_kerning) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_v_kerning) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_extents) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_contour_point) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_name) \
+ HB_FONT_FUNC_IMPLEMENT (get_,glyph_from_name) \
+ HB_FONT_FUNC_IMPLEMENT (,draw_glyph) \
+ HB_FONT_FUNC_IMPLEMENT (,paint_glyph) \
+ /* ^--- Add new callbacks here */
+
+struct hb_font_funcs_t__destroy {
+#define HB_FONT_FUNC_IMPLEMENT(get_,name) void* name;
+ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_FONT_FUNC_IMPLEMENT
+};
+
+struct hb_font_funcs_t
+{
+ struct hb_object_header_t header;
+
+ struct {
+#define HB_FONT_FUNC_IMPLEMENT(get_,name) void* name;
+ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_FONT_FUNC_IMPLEMENT
+ } *user_data;
+
+ struct hb_font_funcs_t__destroy* destroy;
+
+ union get_t {
+ struct get_funcs_t {
+#define HB_FONT_FUNC_IMPLEMENT(get_,name) void* name;
+ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_FONT_FUNC_IMPLEMENT
+ } f;
+ void (*array[0
+#define HB_FONT_FUNC_IMPLEMENT(get_,name) +1
+ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_FONT_FUNC_IMPLEMENT
+ ]) ();
+ } get;
+};
+
+/*
+ * hb_unicode_funcs_t
+ */
+
+#define HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS \
+ HB_UNICODE_FUNC_IMPLEMENT (combining_class) \
+ HB_UNICODE_FUNC_IMPLEMENT (eastasian_width) \
+ HB_UNICODE_FUNC_IMPLEMENT (general_category) \
+ HB_UNICODE_FUNC_IMPLEMENT (mirroring) \
+ HB_UNICODE_FUNC_IMPLEMENT (script) \
+ HB_UNICODE_FUNC_IMPLEMENT (compose) \
+ HB_UNICODE_FUNC_IMPLEMENT (decompose) \
+ HB_UNICODE_FUNC_IMPLEMENT (decompose_compatibility) \
+ /* ^--- Add new callbacks here */
+
+/* Simple callbacks are those taking a hb_codepoint_t and returning a hb_codepoint_t */
+#define HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE \
+ HB_UNICODE_FUNC_IMPLEMENT (hb_unicode_combining_class_t, combining_class) \
+ HB_UNICODE_FUNC_IMPLEMENT (unsigned int, eastasian_width) \
+ HB_UNICODE_FUNC_IMPLEMENT (hb_unicode_general_category_t, general_category) \
+ HB_UNICODE_FUNC_IMPLEMENT (hb_codepoint_t, mirroring) \
+ HB_UNICODE_FUNC_IMPLEMENT (hb_script_t, script) \
+ /* ^--- Add new simple callbacks here */
+
+
+struct hb_unicode_funcs_t__destroy {
+#define HB_UNICODE_FUNC_IMPLEMENT(name) void* name;
+ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_UNICODE_FUNC_IMPLEMENT
+};
+
+struct hb_unicode_funcs_t
+{
+ struct hb_object_header_t header;
+ struct hb_unicode_funcs_t *parent;
+
+ struct {
+#define HB_UNICODE_FUNC_IMPLEMENT(name) void* name;
+ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_UNICODE_FUNC_IMPLEMENT
+ } func;
+
+ struct {
+#define HB_UNICODE_FUNC_IMPLEMENT(name) void* name;
+ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_UNICODE_FUNC_IMPLEMENT
+ } user_data;
+
+ struct hb_unicode_funcs_t__destroy destroy;
+};
+
+#define SUPER() \
+ GO(0) \
+ GO(1) \
+ GO(2) \
+ GO(3) \
+ GO(4) \
+ GO(5) \
+ GO(6) \
+ GO(7) \
+ GO(8) \
+ GO(9) \
+ GO(10) \
+ GO(11) \
+ GO(12) \
+
+// buffer_message
+#define GO(A) \
+static uintptr_t my_buffer_message_fct_##A = 0; \
+static int my_buffer_message_##A(void* a, void* b, void* c, void* d)\
+{ \
+ return (int)RunFunctionFmt(my_buffer_message_fct_##A, "pppp", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_buffer_message_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_buffer_message_fct_##A == (uintptr_t)fct) return my_buffer_message_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_buffer_message_fct_##A == 0) {my_buffer_message_fct_##A = (uintptr_t)fct; return my_buffer_message_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz buffer message callback\n");
+ return NULL;
+}
+
+// draw close path
+#define GO(A) \
+static uintptr_t my_draw_close_path_fct_##A = 0; \
+static void my_draw_close_path_##A(void* a, void* b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_draw_close_path_fct_##A, "pppp", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_draw_close_path_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_draw_close_path_fct_##A == (uintptr_t)fct) return my_draw_close_path_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_draw_close_path_fct_##A == 0) {my_draw_close_path_fct_##A = (uintptr_t)fct; return my_draw_close_path_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz draw close path callback\n");
+ return NULL;
+}
+
+// draw cubic to
+#define GO(A) \
+static uintptr_t my_draw_cubic_to_fct_##A = 0; \
+static void my_draw_cubic_to_##A(void* a, void* b, void* c, float d1, float d2, float d3, float d4, float d5, float d6, void* e) \
+{ \
+ RunFunctionFmt(my_draw_cubic_to_fct_##A, "pppffffffp", a, b, c, d1, d2, d3, d4, d5, d6, e); \
+}
+SUPER()
+#undef GO
+static void* find_draw_cubic_to_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_draw_cubic_to_fct_##A == (uintptr_t)fct) return my_draw_cubic_to_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_draw_cubic_to_fct_##A == 0) {my_draw_cubic_to_fct_##A = (uintptr_t)fct; return my_draw_cubic_to_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz draw cubic to callback\n");
+ return NULL;
+}
+
+// draw line/move to
+#define GO(A) \
+static uintptr_t my_draw_line_or_move_to_fct_##A = 0; \
+static void my_draw_line_or_move_to_##A(void* a, void* b, void* c, float d1, float d2, void* e) \
+{ \
+ RunFunctionFmt(my_draw_line_or_move_to_fct_##A, "pppffp", a, b, c, d1, d2, e); \
+}
+SUPER()
+#undef GO
+static void* find_draw_line_or_move_to_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_draw_line_or_move_to_fct_##A == (uintptr_t)fct) return my_draw_line_or_move_to_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_draw_line_or_move_to_fct_##A == 0) {my_draw_line_or_move_to_fct_##A = (uintptr_t)fct; return my_draw_line_or_move_to_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz draw line/move to callback\n");
+ return NULL;
+}
+
+// draw quadratic to
+#define GO(A) \
+static uintptr_t my_draw_quadratic_to_fct_##A = 0; \
+static void my_draw_quadratic_to_##A(void* a, void* b, void* c, float d1, float d2, float d3, float d4, void* e) \
+{ \
+ RunFunctionFmt(my_draw_quadratic_to_fct_##A, "pppffffp", a, b, c, d1, d2, d3, d4, e); \
+}
+SUPER()
+#undef GO
+static void* find_draw_quadratic_to_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_draw_quadratic_to_fct_##A == (uintptr_t)fct) return my_draw_quadratic_to_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_draw_quadratic_to_fct_##A == 0) {my_draw_quadratic_to_fct_##A = (uintptr_t)fct; return my_draw_quadratic_to_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz draw quadratic to callback\n");
+ return NULL;
+}
+
+// reference table
+#define GO(A) \
+static uintptr_t my_reference_table_fct_##A = 0; \
+static void* my_reference_table_##A(void* a, uint32_t b, void* c) \
+{ \
+ return (void*)RunFunctionFmt(my_reference_table_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_reference_table_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_reference_table_fct_##A == (uintptr_t)fct) return my_reference_table_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_reference_table_fct_##A == 0) {my_reference_table_fct_##A = (uintptr_t)fct; return my_reference_table_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz reference table callback\n");
+ return NULL;
+}
+
+// unicode combining class
+#define GO(A) \
+static uintptr_t my_unicode_combining_class_fct_##A = 0; \
+static uint32_t my_unicode_combining_class_##A(void* a, uint32_t b, void* c)\
+{ \
+ return (uint32_t)RunFunctionFmt(my_unicode_combining_class_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_unicode_combining_class_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_unicode_combining_class_fct_##A == (uintptr_t)fct) return my_unicode_combining_class_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_unicode_combining_class_fct_##A == 0) {my_unicode_combining_class_fct_##A = (uintptr_t)fct; return my_unicode_combining_class_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz unicode combining class callback\n");
+ return NULL;
+}
+
+// unicode compose
+#define GO(A) \
+static uintptr_t my_unicode_compose_fct_##A = 0; \
+static int my_unicode_compose_##A(void* a, uint32_t b, uint32_t c, void* d, void* e)\
+{ \
+ return (int)RunFunctionFmt(my_unicode_compose_fct_##A, "puupp", a, b, c, d, e); \
+}
+SUPER()
+#undef GO
+static void* find_unicode_compose_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_unicode_compose_fct_##A == (uintptr_t)fct) return my_unicode_compose_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_unicode_compose_fct_##A == 0) {my_unicode_compose_fct_##A = (uintptr_t)fct; return my_unicode_compose_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz unicode compose callback\n");
+ return NULL;
+}
+
+// unicode decompose compatibility
+#define GO(A) \
+static uintptr_t my_unicode_decompose_compatibility_fct_##A = 0; \
+static uint32_t my_unicode_decompose_compatibility_##A(void* a, uint32_t b, void* c, void* d) \
+{ \
+ return (uint32_t)RunFunctionFmt(my_unicode_decompose_compatibility_fct_##A, "pupp", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_unicode_decompose_compatibility_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_unicode_decompose_compatibility_fct_##A == (uintptr_t)fct) return my_unicode_decompose_compatibility_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_unicode_decompose_compatibility_fct_##A == 0) {my_unicode_decompose_compatibility_fct_##A = (uintptr_t)fct; return my_unicode_decompose_compatibility_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz unicode decompose compatibility callback\n");
+ return NULL;
+}
+
+// unicode decompose
+#define GO(A) \
+static uintptr_t my_unicode_decompose_fct_##A = 0; \
+static int my_unicode_decompose_##A(void* a, uint32_t b, void* c, void* d, void* e) \
+{ \
+ return (int)RunFunctionFmt(my_unicode_decompose_fct_##A, "puppp", a, b, c, d, e); \
+}
+SUPER()
+#undef GO
+static void* find_unicode_decompose_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_unicode_decompose_fct_##A == (uintptr_t)fct) return my_unicode_decompose_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_unicode_decompose_fct_##A == 0) {my_unicode_decompose_fct_##A = (uintptr_t)fct; return my_unicode_decompose_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz unicode decompose class callback\n");
+ return NULL;
+}
+
+// unicode eastasian width
+#define GO(A) \
+static uintptr_t my_unicode_eastasian_width_fct_##A = 0; \
+static uint32_t my_unicode_eastasian_width_##A(void* a, uint32_t b, void* c) \
+{ \
+ return (uint32_t)RunFunctionFmt(my_unicode_eastasian_width_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_unicode_eastasian_width_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_unicode_eastasian_width_fct_##A == (uintptr_t)fct) return my_unicode_eastasian_width_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_unicode_eastasian_width_fct_##A == 0) {my_unicode_eastasian_width_fct_##A = (uintptr_t)fct; return my_unicode_eastasian_width_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz unicode eastasian width callback\n");
+ return NULL;
+}
+
+// unicode general category
+#define GO(A) \
+static uintptr_t my_unicode_general_category_fct_##A = 0; \
+static uint32_t my_unicode_general_category_##A(void* a, uint32_t b, void* c) \
+{ \
+ return (uint32_t)RunFunctionFmt(my_unicode_general_category_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_unicode_general_category_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_unicode_general_category_fct_##A == (uintptr_t)fct) return my_unicode_general_category_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_unicode_general_category_fct_##A == 0) {my_unicode_general_category_fct_##A = (uintptr_t)fct; return my_unicode_general_category_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz unicode general category callback\n");
+ return NULL;
+}
+
+// unicode mirroring
+#define GO(A) \
+static uintptr_t my_unicode_mirroring_fct_##A = 0; \
+static uint32_t my_unicode_mirroring_##A(void* a, uint32_t b, void* c) \
+{ \
+ return (uint32_t)RunFunctionFmt(my_unicode_mirroring_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_unicode_mirroring_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_unicode_mirroring_fct_##A == (uintptr_t)fct) return my_unicode_mirroring_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_unicode_mirroring_fct_##A == 0) {my_unicode_mirroring_fct_##A = (uintptr_t)fct; return my_unicode_mirroring_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz unicode mirroring callback\n");
+ return NULL;
+}
+
+// unicode script
+#define GO(A) \
+static uintptr_t my_unicode_script_fct_##A = 0; \
+static uint32_t my_unicode_script_##A(void* a, uint32_t b, void* c) \
+{ \
+ return (uint32_t)RunFunctionFmt(my_unicode_script_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_unicode_script_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_unicode_script_fct_##A == (uintptr_t)fct) return my_unicode_script_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_unicode_script_fct_##A == 0) {my_unicode_script_fct_##A = (uintptr_t)fct; return my_unicode_script_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz unicode script callback\n");
+ return NULL;
+}
+
+// font extents
+#define GO(A) \
+static uintptr_t my_font_extents_fct_##A = 0; \
+static int my_font_extents_##A(void* a, void* b, void* c, void* d) \
+{ \
+ return (int)RunFunctionFmt(my_font_extents_fct_##A, "pppp", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_font_extents_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_font_extents_fct_##A == (uintptr_t)fct) return my_font_extents_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_font_extents_fct_##A == 0) {my_font_extents_fct_##A = (uintptr_t)fct; return my_font_extents_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz font extents callback\n");
+ return NULL;
+}
+
+// glyph advance
+#define GO(A) \
+static uintptr_t my_glyph_advance_fct_##A = 0; \
+static int my_glyph_advance_##A(void* a, void* b, uint32_t c, void* d) \
+{ \
+ return (int)RunFunctionFmt(my_glyph_advance_fct_##A, "ppup", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_glyph_advance_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_glyph_advance_fct_##A == (uintptr_t)fct) return my_glyph_advance_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_glyph_advance_fct_##A == 0) {my_glyph_advance_fct_##A = (uintptr_t)fct; return my_glyph_advance_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz glyph advance callback\n");
+ return NULL;
+}
+
+// glyph advances
+#define GO(A) \
+static uintptr_t my_glyph_advances_fct_##A = 0; \
+static void my_glyph_advances_##A(void* a, void* b, uint32_t c, void* d, uint32_t e, void* f, uint32_t g, void* h) \
+{ \
+ RunFunctionFmt(my_glyph_advances_fct_##A, "ppupupup", a, b, c, d, e, f, g, h); \
+}
+SUPER()
+#undef GO
+static void* find_glyph_advances_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_glyph_advances_fct_##A == (uintptr_t)fct) return my_glyph_advances_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_glyph_advances_fct_##A == 0) {my_glyph_advances_fct_##A = (uintptr_t)fct; return my_glyph_advances_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz glyph advances callback\n");
+ return NULL;
+}
+
+// glyph kerning
+#define GO(A) \
+static uintptr_t my_glyph_kerning_fct_##A = 0; \
+static int my_glyph_kerning_##A(void* a, void* b, uint32_t c, uint32_t d, void* e) \
+{ \
+ return (int)RunFunctionFmt(my_glyph_kerning_fct_##A, "ppuup", a, b, c, d, e); \
+}
+SUPER()
+#undef GO
+static void* find_glyph_kerning_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_glyph_kerning_fct_##A == (uintptr_t)fct) return my_glyph_kerning_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_glyph_kerning_fct_##A == 0) {my_glyph_kerning_fct_##A = (uintptr_t)fct; return my_glyph_kerning_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz glyph kerning callback\n");
+ return NULL;
+}
+
+// glyph origin
+#define GO(A) \
+static uintptr_t my_glyph_origin_fct_##A = 0; \
+static int my_glyph_origin_##A(void* a, void* b, uint32_t c, void* d, void* e, void* f) \
+{ \
+ return (int)RunFunctionFmt(my_glyph_origin_fct_##A, "ppuppp", a, b, c, d, e, f); \
+}
+SUPER()
+#undef GO
+static void* find_glyph_origin_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_glyph_origin_fct_##A == (uintptr_t)fct) return my_glyph_origin_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_glyph_origin_fct_##A == 0) {my_glyph_origin_fct_##A = (uintptr_t)fct; return my_glyph_origin_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz glyph origin callback\n");
+ return NULL;
+}
+
+// glyph contour point
+#define GO(A) \
+static uintptr_t my_glyph_contour_pointfct_##A = 0; \
+static int my_glyph_contour_point##A(void* a, void* b, uint32_t c, uint32_t d, void* e, void* f, void* g) \
+{ \
+ return (int)RunFunctionFmt(my_glyph_contour_pointfct_##A, "ppuuppp", a, b, c, d, e, f, g); \
+}
+SUPER()
+#undef GO
+static void* find_glyph_contour_point_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_glyph_contour_pointfct_##A == (uintptr_t)fct) return my_glyph_contour_point##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_glyph_contour_pointfct_##A == 0) {my_glyph_contour_pointfct_##A = (uintptr_t)fct; return my_glyph_contour_point##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz glyph contour point callback\n");
+ return NULL;
+}
+
+// glyph extents
+#define GO(A) \
+static uintptr_t my_glyph_extents_fct_##A = 0; \
+static int my_glyph_extents_##A(void* a, void* b, uint32_t c, void* d, void* e) \
+{ \
+ return (int)RunFunctionFmt(my_glyph_extents_fct_##A, "ppupp", a, b, c, d, e); \
+}
+SUPER()
+#undef GO
+static void* find_glyph_extents_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_glyph_extents_fct_##A == (uintptr_t)fct) return my_glyph_extents_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_glyph_extents_fct_##A == 0) {my_glyph_extents_fct_##A = (uintptr_t)fct; return my_glyph_extents_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz glyph extents callback\n");
+ return NULL;
+}
+
+// glyph from name
+#define GO(A) \
+static uintptr_t my_glyph_from_name_fct_##A = 0; \
+static int my_glyph_from_name_##A(void* a, void* b, void* c, int d, void* e, void* f) \
+{ \
+ return (int)RunFunctionFmt(my_glyph_from_name_fct_##A, "pppipp", a, b, c, d, e, f); \
+}
+SUPER()
+#undef GO
+static void* find_glyph_from_name_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_glyph_from_name_fct_##A == (uintptr_t)fct) return my_glyph_from_name_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_glyph_from_name_fct_##A == 0) {my_glyph_from_name_fct_##A = (uintptr_t)fct; return my_glyph_from_name_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz glyph from name callback\n");
+ return NULL;
+}
+
+
+
+
+
+
+// glyph
+#define GO(A) \
+static uintptr_t my_glyph_fct_##A = 0; \
+static int my_glyph_##A(void* a, void* b, uint32_t c, uint32_t d, void* e, void* f) \
+{ \
+ return (int)RunFunctionFmt(my_glyph_fct_##A, "ppuupp", a, b, c, d, e, f); \
+}
+SUPER()
+#undef GO
+static void* find_glyph_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_glyph_fct_##A == (uintptr_t)fct) return my_glyph_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_glyph_fct_##A == 0) {my_glyph_fct_##A = (uintptr_t)fct; return my_glyph_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz glyph callback\n");
+ return NULL;
+}
+
+// glyph name
+#define GO(A) \
+static uintptr_t my_glyph_name_fct_##A = 0; \
+static int my_glyph_name_##A(void* a, void* b, uint32_t c, void* d, uint32_t e, void* f) \
+{ \
+ return (int)RunFunctionFmt(my_glyph_name_fct_##A, "ppupup", a, b, c, d, e, f); \
+}
+SUPER()
+#undef GO
+static void* find_glyph_name_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_glyph_name_fct_##A == (uintptr_t)fct) return my_glyph_name_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_glyph_name_fct_##A == 0) {my_glyph_name_fct_##A = (uintptr_t)fct; return my_glyph_name_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz glyph origin callback\n");
+ return NULL;
+}
+
+// glyph shape
+#define GO(A) \
+static uintptr_t my_glyph_shape_fct_##A = 0; \
+static void my_glyph_shape_##A(void* a, void* b, uint32_t c, void* d, void* e, void* f) \
+{ \
+ RunFunctionFmt(my_glyph_shape_fct_##A, "ppuppp", a, b, c, d, e, f); \
+}
+SUPER()
+#undef GO
+static void* find_glyph_shape_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_glyph_shape_fct_##A == (uintptr_t)fct) return my_glyph_shape_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_glyph_shape_fct_##A == 0) {my_glyph_shape_fct_##A = (uintptr_t)fct; return my_glyph_shape_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz glyph shape callback\n");
+ return NULL;
+}
+
+// nominal glyph
+#define GO(A) \
+static uintptr_t my_nominal_glyph_fct_##A = 0; \
+static int my_nominal_glyph_##A(void* a, void* b, uint32_t c, void* d, void* e) \
+{ \
+ return (int)RunFunctionFmt(my_nominal_glyph_fct_##A, "ppupp", a, b, c, d, e); \
+}
+SUPER()
+#undef GO
+static void* find_nominal_glyph_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_nominal_glyph_fct_##A == (uintptr_t)fct) return my_nominal_glyph_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_nominal_glyph_fct_##A == 0) {my_nominal_glyph_fct_##A = (uintptr_t)fct; return my_nominal_glyph_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz nominal glyph callback\n");
+ return NULL;
+}
+
+
+
+
+
+
+// nominal glyphs
+#define GO(A) \
+static uintptr_t my_nominal_glyphs_fct_##A = 0; \
+static uint32_t my_nominal_glyphs_##A(void* a, void* b, uint32_t c, void* d, uint32_t e, void* f, uint32_t g, void* h) \
+{ \
+ return (uint32_t)RunFunctionFmt(my_nominal_glyphs_fct_##A, "ppupupup", a, b, c, d, e, f, g, h); \
+}
+SUPER()
+#undef GO
+static void* find_nominal_glyphs_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_nominal_glyphs_fct_##A == (uintptr_t)fct) return my_nominal_glyphs_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_nominal_glyphs_fct_##A == 0) {my_nominal_glyphs_fct_##A = (uintptr_t)fct; return my_nominal_glyphs_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz nominal glyphs callback\n");
+ return NULL;
+}
+
+// variation glyph
+#define GO(A) \
+static uintptr_t my_variation_glyph_fct_##A = 0;\
+static int my_variation_glyph_##A(void* a, void* b, uint32_t c, uint32_t d, void* e, void* f) \
+{ \
+ return (int)RunFunctionFmt(my_variation_glyph_fct_##A, "ppuupp", a, b, c, d, e, f); \
+}
+SUPER()
+#undef GO
+static void* find_variation_glyph_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_variation_glyph_fct_##A == (uintptr_t)fct) return my_variation_glyph_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_variation_glyph_fct_##A == 0) {my_variation_glyph_fct_##A = (uintptr_t)fct; return my_variation_glyph_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz variation glyph callback\n");
+ return NULL;
+}
+
+// destroy
+#define GO(A) \
+static uintptr_t my_destroy_fct_##A = 0; \
+static void my_destroy_##A(void* a) \
+{ \
+ RunFunctionFmt(my_destroy_fct_##A, "p", a); \
+}
+SUPER()
+#undef GO
+static void* find_destroy_Fct(void* fct)
+{
+ if (!fct) return NULL;
+ if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if (my_destroy_fct_##A == (uintptr_t)fct) return my_destroy_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if (my_destroy_fct_##A == 0) {my_destroy_fct_##A = (uintptr_t)fct; return my_destroy_##A;}
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libharfbuzz destroy callback\n");
+ return NULL;
+}
+
+#undef SUPER
+
+#define FUNC(A) \
+EXPORT void* my_##A(x64emu_t* emu, void* data, uint32_t length, uint32_t mode, void* user_data, void* destroy) \
+{ \
+ (void)emu; \
+ return my->A(data, length, mode, user_data, find_destroy_Fct(destroy)); \
+}
+
+FUNC(hb_blob_create)
+FUNC(hb_blob_create_or_fail)
+
+#undef FUNC
+
+#define FUNC(A) \
+EXPORT int my_##A(x64emu_t* emu, void* blob, void* key, void* data, void* destroy, int replace) \
+{ \
+ (void)emu; \
+ return (int)my->A(blob, key, data, find_destroy_Fct(destroy), replace); \
+}
+
+FUNC(hb_blob_set_user_data)
+FUNC(hb_buffer_set_user_data)
+
+#undef FUNC
+
+#define FUNC(A) \
+EXPORT void my_##A(x64emu_t* emu, void* buffer, void* func, void* user_data, void* destroy) \
+{ \
+ (void)emu; \
+ my->A(buffer, find_buffer_message_Fct(func), user_data, find_destroy_Fct(destroy)); \
+}
+
+FUNC(hb_buffer_set_message_func)
+
+#undef FUNC
+
+EXPORT void my_hb_draw_funcs_destroy(x64emu_t* emu, void* funcs)
+{
+ (void)emu;
+ struct hb_draw_funcs_t__destroy destroy = {0};
+ struct hb_draw_funcs_t* funcs_ = funcs;
+
+#define HB_DRAW_FUNC_IMPLEMENT(name) \
+ if (funcs_->destroy->name) destroy.name = find_destroy_Fct(funcs_->destroy->name);
+ HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_DRAW_FUNC_IMPLEMENT
+
+ struct hb_draw_funcs_t__destroy* original = funcs_->destroy;
+ funcs_->destroy = &destroy;
+ my->hb_draw_funcs_destroy(funcs);
+ funcs_->destroy = original;
+}
+
+EXPORT void my_hb_draw_funcs_set_close_path_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_draw_funcs_set_close_path_func(funcs, find_draw_close_path_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_draw_funcs_set_cubic_to_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_draw_funcs_set_cubic_to_func(funcs, find_draw_cubic_to_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+#define FUNC(A) \
+EXPORT void my_##A(x64emu_t* emu, void* buffer, void* func, void* user_data, void* destroy) \
+{ \
+ (void)emu; \
+ my->A(buffer, find_draw_line_or_move_to_Fct(func), user_data, find_destroy_Fct(destroy)); \
+}
+
+FUNC(hb_draw_funcs_set_line_to_func)
+FUNC(hb_draw_funcs_set_move_to_func)
+
+#undef FUNC
+
+EXPORT void my_hb_draw_funcs_set_quadratic_to_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_draw_funcs_set_quadratic_to_func(funcs, find_draw_quadratic_to_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void* my_hb_face_create_for_tables(x64emu_t* emu, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ return my->hb_face_create_for_tables(find_reference_table_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT int my_hb_face_set_user_data(x64emu_t* emu, void* face, void* key, void* data, void* destroy, int replace)
+{
+ (void)emu;
+ return (int)my->hb_face_set_user_data(face, key, data, find_destroy_Fct(destroy), replace);
+}
+
+EXPORT void my_hb_font_funcs_destroy(x64emu_t* emu, void* funcs)
+{
+ (void)emu;
+ struct hb_font_funcs_t__destroy destroy = {0};
+ struct hb_font_funcs_t* funcs_ = funcs;
+
+#define HB_FONT_FUNC_IMPLEMENT(get_,name) \
+ if (funcs_->destroy->name) destroy.name = find_destroy_Fct(funcs_->destroy->name);
+ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_FONT_FUNC_IMPLEMENT
+
+ struct hb_font_funcs_t__destroy* original = funcs_->destroy;
+ funcs_->destroy = &destroy;
+ my->hb_font_funcs_destroy(funcs);
+ funcs_->destroy = original;
+}
+
+EXPORT void my_hb_unicode_funcs_destroy(x64emu_t* emu, void* funcs)
+{
+ (void)emu;
+ struct hb_unicode_funcs_t__destroy destroy = {0};
+ struct hb_unicode_funcs_t* funcs_ = funcs;
+
+#define HB_UNICODE_FUNC_IMPLEMENT(name) \
+ if (funcs_->destroy.name) destroy.name = find_destroy_Fct(funcs_->destroy.name);
+ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_UNICODE_FUNC_IMPLEMENT
+
+ struct hb_unicode_funcs_t__destroy original = funcs_->destroy;
+ funcs_->destroy = destroy;
+ my->hb_font_funcs_destroy(funcs);
+ funcs_->destroy = original;
+}
+
+EXPORT void my_hb_unicode_funcs_set_combining_class_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_unicode_funcs_set_combining_class_func(funcs, find_unicode_combining_class_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_unicode_funcs_set_compose_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_unicode_funcs_set_compose_func(funcs, find_unicode_compose_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_unicode_funcs_set_decompose_compatibility_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_unicode_funcs_set_decompose_compatibility_func(funcs, find_unicode_decompose_compatibility_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_unicode_funcs_set_decompose_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_unicode_funcs_set_decompose_func(funcs, find_unicode_decompose_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_unicode_funcs_set_eastasian_width_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_unicode_funcs_set_eastasian_width_func(funcs, find_unicode_eastasian_width_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_unicode_funcs_set_general_category_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_unicode_funcs_set_general_category_func(funcs, find_unicode_general_category_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_unicode_funcs_set_mirroring_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_unicode_funcs_set_mirroring_func(funcs, find_unicode_mirroring_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_unicode_funcs_set_script_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_unicode_funcs_set_script_func(funcs, find_unicode_script_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT int my_hb_unicode_funcs_set_user_data(x64emu_t* emu, void* funcs, void* key, void* data, void* destroy, int replace)
+{
+ (void)emu;
+ return (int)my->hb_unicode_funcs_set_user_data(funcs, key, data, find_destroy_Fct(destroy), replace);
+}
+
+#define FUNC(A) \
+EXPORT void my_##A(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy) \
+{ \
+ (void)emu; \
+ my->A(funcs, find_font_extents_Fct(func), user_data, find_destroy_Fct(destroy));\
+}
+
+FUNC(hb_font_funcs_set_font_h_extents_func)
+FUNC(hb_font_funcs_set_font_v_extents_func)
+
+#undef FUNC
+
+
+#define FUNC(A) \
+EXPORT void my_##A(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy) \
+{ \
+ (void)emu; \
+ my->A(funcs, find_glyph_advance_Fct(func), user_data, find_destroy_Fct(destroy)); \
+}
+
+FUNC(hb_font_funcs_set_glyph_h_advance_func)
+FUNC(hb_font_funcs_set_glyph_v_advance_func)
+
+#undef FUNC
+
+
+#define FUNC(A) \
+EXPORT void my_##A(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy) \
+{ \
+ (void)emu; \
+ my->A(funcs, find_glyph_advances_Fct(func), user_data, find_destroy_Fct(destroy)); \
+}
+
+FUNC(hb_font_funcs_set_glyph_h_advances_func)
+FUNC(hb_font_funcs_set_glyph_v_advances_func)
+
+#undef FUNC
+
+
+#define FUNC(A) \
+EXPORT void my_##A(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy) \
+{ \
+ (void)emu; \
+ my->A(funcs, find_glyph_kerning_Fct(func), user_data, find_destroy_Fct(destroy)); \
+}
+
+FUNC(hb_font_funcs_set_glyph_h_kerning_func)
+FUNC(hb_font_funcs_set_glyph_v_kerning_func)
+
+#undef FUNC
+
+
+#define FUNC(A) \
+EXPORT void my_##A(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy) \
+{ \
+ (void)emu; \
+ my->A(funcs, find_glyph_origin_Fct(func), user_data, find_destroy_Fct(destroy));\
+}
+
+FUNC(hb_font_funcs_set_glyph_h_origin_func)
+FUNC(hb_font_funcs_set_glyph_v_origin_func)
+
+#undef FUNC
+
+EXPORT void my_hb_font_funcs_set_glyph_contour_point_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_funcs_set_glyph_contour_point_func(funcs, find_glyph_contour_point_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_font_funcs_set_glyph_extents_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_funcs_set_glyph_extents_func(funcs, find_glyph_extents_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_font_funcs_set_glyph_from_name_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_funcs_set_glyph_from_name_func(funcs, find_glyph_from_name_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_font_funcs_set_glyph_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_funcs_set_glyph_func(funcs, find_glyph_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_font_funcs_set_glyph_name_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_funcs_set_glyph_name_func(funcs, find_glyph_name_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_font_funcs_set_glyph_shape_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_funcs_set_glyph_shape_func(funcs, find_glyph_shape_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_font_funcs_set_nominal_glyph_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_funcs_set_nominal_glyph_func(funcs, find_nominal_glyph_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_font_funcs_set_nominal_glyphs_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_funcs_set_nominal_glyphs_func(funcs, find_nominal_glyphs_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT void my_hb_font_funcs_set_variation_glyph_func(x64emu_t* emu, void* funcs, void* func, void* user_data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_funcs_set_variation_glyph_func(funcs, find_variation_glyph_Fct(func), user_data, find_destroy_Fct(destroy));
+}
+
+EXPORT int my_hb_font_funcs_set_user_data(x64emu_t* emu, void* funcs, void* key, void* data, void* destroy, int replace)
+{
+ (void)emu;
+ return (int)my->hb_font_funcs_set_user_data(funcs, key, data, find_destroy_Fct(destroy), replace);
+}
+
+EXPORT int my_hb_font_set_funcs(x64emu_t* emu, void* font, void* klass, void* data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_set_funcs(font, klass, data, find_destroy_Fct(destroy));
+}
+
+EXPORT int my_hb_font_set_funcs_data(x64emu_t* emu, void* font, void* data, void* destroy)
+{
+ (void)emu;
+ my->hb_font_set_funcs_data(font, data, find_destroy_Fct(destroy));
+}
+
+EXPORT int my_hb_font_set_user_data(x64emu_t* emu, void* font, void* key, void* data, void* destroy, int replace)
+{
+ (void)emu;
+ return (int)my->hb_font_set_user_data(font, key, data, find_destroy_Fct(destroy), replace);
+}
+
+#define CUSTOM_INIT \
+ getMy(lib);
+
+#define CUSTOM_FINI \
+ freeMy();
+
+#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedlibharfbuzz_private.h b/src/wrapped/wrappedlibharfbuzz_private.h
new file mode 100644
index 0000000..2637f84
--- /dev/null
+++ b/src/wrapped/wrappedlibharfbuzz_private.h
@@ -0,0 +1,443 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error Meh...
+#endif
+
+GO(hb_aat_layout_feature_type_get_name_id, uFpu)
+GO(hb_aat_layout_feature_type_get_selector_infos, uFpuuppp)
+GO(hb_aat_layout_get_feature_types, uFpupp)
+GO(hb_aat_layout_has_positioning, iFp)
+GO(hb_aat_layout_has_substitution, iFp)
+GO(hb_aat_layout_has_tracking, iFp)
+GO(hb_blob_copy_writable_or_fail, pFp)
+GOM(hb_blob_create, pFEpuupp)
+GOM(hb_blob_create_or_fail, pFEpuupp)
+GO(hb_blob_create_from_file, pFp)
+GO(hb_blob_create_from_file_or_fail, pFp)
+GO(hb_blob_create_sub_blob, pFpuu)
+GO(hb_blob_destroy, vFp)
+GO(hb_blob_get_data, pFpp)
+GO(hb_blob_get_data_writable, pFpp)
+GO(hb_blob_get_empty, pFv)
+GO(hb_blob_get_length, uFp)
+GO(hb_blob_get_user_data, pFpp)
+GO(hb_blob_is_immutable, iFp)
+GO(hb_blob_make_immutable, vFp)
+GO(hb_blob_reference, pFp)
+GOM(hb_blob_set_user_data, iFEppppi)
+GO(hb_buffer_add, vFpuu)
+GO(hb_buffer_add_codepoints, vFppiui)
+GO(hb_buffer_add_latin1, vFppiui)
+GO(hb_buffer_add_utf16, vFppiui)
+GO(hb_buffer_add_utf32, vFppiui)
+GO(hb_buffer_add_utf8, vFppiui)
+GO(hb_buffer_allocation_successful, iFp)
+GO(hb_buffer_append, vFppuu)
+GO(hb_buffer_clear_contents, vFp)
+GO(hb_buffer_create, pFv)
+GO(hb_buffer_create_similar, pFp)
+GO(hb_buffer_deserialize_glyphs, iFppippu)
+GO(hb_buffer_deserialize_unicode, iFppipu)
+GO(hb_buffer_destroy, vFp)
+GO(hb_buffer_diff, uFppuu)
+GO(hb_buffer_get_cluster_level, uFp)
+GO(hb_buffer_get_content_type, uFp)
+GO(hb_buffer_get_direction, uFp)
+GO(hb_buffer_get_empty, pFv)
+GO(hb_buffer_get_flags, uFp)
+GO(hb_buffer_get_glyph_infos, pFpp)
+GO(hb_buffer_get_glyph_positions, pFpp)
+GO(hb_buffer_get_invisible_glyph, uFp)
+GO(hb_buffer_get_language, pFp)
+GO(hb_buffer_get_length, uFp)
+GO(hb_buffer_get_not_found_glyph, uFp)
+GO(hb_buffer_get_replacement_codepoint, uFp)
+GO(hb_buffer_get_script, uFp)
+GO(hb_buffer_get_segment_properties, vFpp)
+GO(hb_buffer_get_unicode_funcs, pFp)
+GO(hb_buffer_get_user_data, pFpp)
+GO(hb_buffer_guess_segment_properties, vFp)
+GO(hb_buffer_has_positions, iFp)
+GO(hb_buffer_normalize_glyphs, vFp)
+GO(hb_buffer_pre_allocate, iFpu)
+GO(hb_buffer_reference, pFp)
+GO(hb_buffer_reset, vFp)
+GO(hb_buffer_reverse, vFp)
+GO(hb_buffer_reverse_clusters, vFp)
+GO(hb_buffer_reverse_range, vFpuu)
+GO(hb_buffer_serialize, uFpuupuppuu)
+GO(hb_buffer_serialize_format_from_string, uFpi)
+GO(hb_buffer_serialize_format_to_string, pFu)
+GO(hb_buffer_serialize_glyphs, uFpuupuppuu)
+GO(hb_buffer_serialize_list_formats, pFv)
+GO(hb_buffer_serialize_unicode, uFpuupupuu)
+GO(hb_buffer_set_cluster_level, vFpu)
+GO(hb_buffer_set_content_type, vFpu)
+GO(hb_buffer_set_direction, vFpu)
+GO(hb_buffer_set_flags, vFpu)
+GO(hb_buffer_set_invisible_glyph, vFpu)
+GO(hb_buffer_set_language, vFpp)
+GO(hb_buffer_set_length, iFpu)
+GOM(hb_buffer_set_message_func, vFEpppp)
+GO(hb_buffer_set_not_found_glyph, vFpu)
+GO(hb_buffer_set_replacement_codepoint, vFpu)
+GO(hb_buffer_set_script, vFpu)
+GO(hb_buffer_set_segment_properties, vFpp)
+GO(hb_buffer_set_unicode_funcs, vFpp)
+GOM(hb_buffer_set_user_data, iFEppppi)
+GO(hb_color_get_alpha, CFu)
+GO(hb_color_get_blue, CFu)
+GO(hb_color_get_green, CFu)
+GO(hb_color_get_red, CFu)
+GO(hb_direction_from_string, uFpi)
+GO(hb_direction_to_string, pFu)
+GO(hb_draw_close_path, vFppp)
+GO(hb_draw_cubic_to, vFpppffffff)
+GO(hb_draw_funcs_create, pFv) // No need to reverse.
+GOM(hb_draw_funcs_destroy, vFEp)
+GO(hb_draw_funcs_is_immutable, iFp)
+GO(hb_draw_funcs_make_immutable, vFp)
+GO(hb_draw_funcs_reference, pFp)
+GOM(hb_draw_funcs_set_close_path_func, vFEpppp)
+GOM(hb_draw_funcs_set_cubic_to_func, vFEpppp)
+GOM(hb_draw_funcs_set_line_to_func, vFEpppp)
+GOM(hb_draw_funcs_set_move_to_func, vFEpppp)
+GOM(hb_draw_funcs_set_quadratic_to_func, vFEpppp)
+GO(hb_draw_line_to, vFpppff)
+GO(hb_draw_move_to, vFpppff)
+GO(hb_draw_quadratic_to, vFpppffff)
+GO(hb_face_builder_add_table, iFpup)
+GO(hb_face_builder_create, pFv)
+GO(hb_face_builder_sort_tables, vFpp)
+GO(hb_face_collect_unicodes, vFpp)
+GO(hb_face_collect_variation_selectors, vFpp)
+GO(hb_face_collect_variation_unicodes, vFpup)
+GO(hb_face_count, uFp)
+GO(hb_face_create, pFpu)
+GOM(hb_face_create_for_tables, pFEppp)
+GO(hb_face_destroy, vFp)
+GO(hb_face_get_empty, pFv)
+GO(hb_face_get_glyph_count, uFp)
+GO(hb_face_get_index, uFp)
+GO(hb_face_get_table_tags, uFpupp)
+GO(hb_face_get_upem, uFp)
+GO(hb_face_get_user_data, pFpp)
+GO(hb_face_is_immutable, iFp)
+GO(hb_face_make_immutable, vFp)
+GO(hb_face_reference, pFp)
+GO(hb_face_reference_blob, pFp)
+GO(hb_face_reference_table, pFpu)
+GO(hb_face_set_glyph_count, vFpu)
+GO(hb_face_set_index, vFpu)
+GO(hb_face_set_upem, vFpu)
+GOM(hb_face_set_user_data, iFEppppi)
+GO(hb_feature_from_string, iFpip)
+GO(hb_feature_to_string, vFppu)
+GO(hb_font_add_glyph_origin_for_direction, vFpuupp)
+GO(hb_font_changed, vFp)
+GO(hb_font_create, pFp)
+GO(hb_font_create_sub_font, pFp)
+GO(hb_font_destroy, vFp)
+GO(hb_font_funcs_create, pFv) // No need to reverse.
+GOM(hb_font_funcs_destroy, vFEp)
+GO(hb_font_funcs_get_empty, pFv)
+GO(hb_font_funcs_get_user_data, pFpp)
+GO(hb_font_funcs_is_immutable, iFp)
+GO(hb_font_funcs_make_immutable, vFp)
+GO(hb_font_funcs_reference, pFp)
+GOM(hb_font_funcs_set_font_h_extents_func, vFEpppp)
+GOM(hb_font_funcs_set_font_v_extents_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_h_advance_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_v_advance_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_h_advances_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_v_advances_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_h_kerning_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_v_kerning_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_h_origin_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_v_origin_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_contour_point_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_extents_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_from_name_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_name_func, vFEpppp)
+GOM(hb_font_funcs_set_glyph_shape_func, vFEpppp)
+GOM(hb_font_funcs_set_nominal_glyph_func, vFEpppp)
+GOM(hb_font_funcs_set_nominal_glyphs_func, vFEpppp)
+GOM(hb_font_funcs_set_variation_glyph_func, vFEpppp)
+GOM(hb_font_funcs_set_user_data, iFEppppi)
+GO(hb_font_get_empty, pFv)
+GO(hb_font_get_extents_for_direction, vFpup)
+GO(hb_font_get_face, pFp)
+GO(hb_font_get_glyph, iFpuup)
+GO(hb_font_get_glyph_advance_for_direction, vFpuupp)
+GO(hb_font_get_glyph_advances_for_direction, vFpuupupu)
+GO(hb_font_get_glyph_contour_point, iFpuupp)
+GO(hb_font_get_glyph_contour_point_for_origin, iFpuuupp)
+GO(hb_font_get_glyph_extents, iFpup)
+GO(hb_font_get_glyph_extents_for_origin, iFpuup)
+GO(hb_font_get_glyph_from_name, iFppip)
+GO(hb_font_get_glyph_h_advance, iFpu)
+GO(hb_font_get_glyph_h_advances, vFpupupu)
+GO(hb_font_get_glyph_h_kerning, iFpuu)
+GO(hb_font_get_glyph_h_origin, iFpupp)
+GO(hb_font_get_glyph_kerning_for_direction, vFpuuupp)
+GO(hb_font_get_glyph_name, iFpupu)
+GO(hb_font_get_glyph_origin_for_direction, vFpuupp)
+GO(hb_font_get_glyph_shape, vFpupp)
+GO(hb_font_get_glyph_v_advance, iFpu)
+GO(hb_font_get_glyph_v_advances, vFpupupu)
+GO(hb_font_get_glyph_v_kerning, iFpuu)
+GO(hb_font_get_glyph_v_origin, iFpupp)
+GO(hb_font_get_h_extents, iFpp)
+GO(hb_font_get_nominal_glyph, iFpup)
+GO(hb_font_get_nominal_glyphs, uFpupupu)
+GO(hb_font_get_parent, pFp)
+GO(hb_font_get_ppem, vFppp)
+GO(hb_font_get_ptem, fFp)
+GO(hb_font_get_scale, vFppp)
+GO(hb_font_get_serial, uFp)
+GO(hb_font_get_synthetic_slant, fFp)
+GO(hb_font_get_user_data, pFpp)
+GO(hb_font_get_var_coords_design, pFpp)
+GO(hb_font_get_var_coords_normalized, pFpp)
+GO(hb_font_get_variation_glyph, iFpuup)
+GO(hb_font_get_v_extents, iFpp)
+GO(hb_font_glyph_from_string, iFppip)
+GO(hb_font_glyph_to_string, vFpupu)
+GO(hb_font_is_immutable, iFp)
+GO(hb_font_make_immutable, vFp)
+GO(hb_font_reference, pFp)
+GO(hb_font_set_face, vFpp)
+GOM(hb_font_set_funcs, vFEpppp)
+GOM(hb_font_set_funcs_data, vFEppp)
+GO(hb_font_set_parent, vFpp)
+GO(hb_font_set_ppem, vFpuu)
+GO(hb_font_set_ptem, vFpf)
+GO(hb_font_set_scale, vFpii)
+GO(hb_font_set_synthetic_slant, vFpf)
+GOM(hb_font_set_user_data, iFEppppi)
+GO(hb_font_set_var_coords_design, vFppu)
+GO(hb_font_set_var_coords_normalized, vFppu)
+GO(hb_font_set_variations, vFppu)
+GO(hb_font_set_var_named_instance, vFpu)
+GO(hb_font_subtract_glyph_origin_for_direction, vFpuupp)
+//GO(hb_ft_face_create,
+GO(hb_ft_face_create_cached, pFp)
+GO(hb_ft_face_create_referenced, pFp)
+GO(hb_ft_font_changed, vFp)
+//GO(hb_ft_font_create,
+GO(hb_ft_font_create_referenced, pFp)
+GO(hb_ft_font_get_face, pFp)
+GO(hb_ft_font_get_load_flags, iFp)
+GO(hb_ft_font_lock_face, pFp)
+GO(hb_ft_font_set_funcs, vFp)
+GO(hb_ft_font_set_load_flags, vFpi)
+GO(hb_ft_font_unlock_face, vFp)
+GO(hb_ft_hb_font_changed, iFp)
+GO(hb_glib_blob_create, pFp)
+GO(hb_glib_get_unicode_funcs, pFv)
+GO(hb_glib_script_from_script, uFu)
+GO(hb_glib_script_to_script, uFu)
+GO(hb_glyph_info_get_glyph_flags, uFp)
+GO(hb_graphite2_face_get_gr_face, pFp)
+GO(hb_graphite2_font_get_gr_font, pFp)
+GO(hb_language_from_string, pFpi)
+GO(hb_language_get_default, pFv)
+GO(hb_language_matches, iFpp)
+GO(hb_language_to_string, pFp)
+GO(hb_map_allocation_successful, iFp)
+GO(hb_map_clear, vFp)
+GO(hb_map_copy, pFp)
+GO(hb_map_create, pFv)
+GO(hb_map_del, vFpu)
+GO(hb_map_destroy, vFp)
+GO(hb_map_get, uFpu)
+GO(hb_map_get_empty, pFv)
+GO(hb_map_get_population, uFp)
+GO(hb_map_get_user_data, pFpp)
+GO(hb_map_has, iFpu)
+GO(hb_map_hash, uFp)
+GO(hb_map_is_empty, iFp)
+GO(hb_map_is_equal, iFpp)
+GO(hb_map_reference, pFp)
+GO(hb_map_set, vFpuu)
+//GO(hb_map_set_user_data,
+GO(hb_ot_color_glyph_get_layers, uFpuupp)
+GO(hb_ot_color_glyph_reference_png, pFpu)
+GO(hb_ot_color_glyph_reference_svg, pFpu)
+GO(hb_ot_color_has_layers, iFp)
+GO(hb_ot_color_has_palettes, iFp)
+GO(hb_ot_color_has_png, iFp)
+GO(hb_ot_color_has_svg, iFp)
+GO(hb_ot_color_palette_color_get_name_id, uFpu)
+GO(hb_ot_color_palette_get_colors, uFpuupp)
+GO(hb_ot_color_palette_get_count, uFp)
+GO(hb_ot_color_palette_get_flags, uFpu)
+GO(hb_ot_color_palette_get_name_id, uFpu)
+GO(hb_ot_font_set_funcs, vFp)
+GO(hb_ot_layout_collect_features, vFpupppp)
+GO(hb_ot_layout_collect_lookups, vFpupppp)
+GO(hb_ot_layout_feature_get_characters, uFpuuupp)
+GO(hb_ot_layout_feature_get_lookups, uFpuuupp)
+GO(hb_ot_layout_feature_get_name_ids, iFpuuppppp)
+GO(hb_ot_layout_feature_with_variations_get_lookups, uFpuuuupp)
+GO(hb_ot_layout_get_attach_points, uFpuupp)
+GO(hb_ot_layout_get_baseline, iFpuuuup)
+GO(hb_ot_layout_get_baseline_with_fallback, vFpuuuup)
+GO(hb_ot_layout_get_glyph_class, uFpu)
+GO(hb_ot_layout_get_glyphs_in_class, vFpup)
+GO(hb_ot_layout_get_horizontal_baseline_tag_for_script, uFu)
+GO(hb_ot_layout_get_ligature_carets, uFpuuupp)
+GO(hb_ot_layout_get_size_params, iFpppppp)
+GO(hb_ot_layout_has_glyph_classes, iFp)
+GO(hb_ot_layout_has_positioning, iFp)
+GO(hb_ot_layout_has_substitution, iFp)
+GO(hb_ot_layout_language_find_feature, iFpuuuup)
+GO(hb_ot_layout_language_get_feature_indexes, uFpuuuupp)
+GO(hb_ot_layout_language_get_feature_tags, uFpuuuupp)
+GO(hb_ot_layout_language_get_required_feature, iFpuuupp)
+GO(hb_ot_layout_language_get_required_feature_index, iFpuuup)
+GO(hb_ot_layout_lookup_collect_glyphs, vFpuupppp)
+GO(hb_ot_layout_lookup_get_glyph_alternates, uFpuuupp)
+GO(hb_ot_layout_lookup_get_optical_bound, iFpuuu)
+GO(hb_ot_layout_lookups_substitute_closure, vFppp)
+GO(hb_ot_layout_lookup_substitute_closure, vFpup)
+GO(hb_ot_layout_lookup_would_substitute, iFpupui)
+GO(hb_ot_layout_script_find_language, iFpuuup)
+GO(hb_ot_layout_script_get_language_tags, uFpuuupp)
+GO(hb_ot_layout_script_select_language, iFpuuupp)
+GO(hb_ot_layout_table_choose_script, iFpuppp)
+GO(hb_ot_layout_table_find_feature_variations, iFpupup)
+GO(hb_ot_layout_table_find_script, iFpuup)
+GO(hb_ot_layout_table_get_feature_tags, uFpuupp)
+GO(hb_ot_layout_table_get_lookup_count, uFpu)
+GO(hb_ot_layout_table_get_script_tags, uFpuupp)
+GO(hb_ot_layout_table_select_script, iFpuuppp)
+GO(hb_ot_math_get_constant, iFpu)
+GO(hb_ot_math_get_glyph_assembly, uFpuuuppp)
+GO(hb_ot_math_get_glyph_italics_correction, iFpu)
+GO(hb_ot_math_get_glyph_kerning, iFpuui)
+GO(hb_ot_math_get_glyph_kernings, uFpuuupp)
+GO(hb_ot_math_get_glyph_top_accent_attachment, iFpu)
+GO(hb_ot_math_get_glyph_variants, uFpuuupp)
+GO(hb_ot_math_get_min_connector_overlap, iFpu)
+GO(hb_ot_math_has_data, iFp)
+GO(hb_ot_math_is_glyph_extended_shape, iFpu)
+GO(hb_ot_meta_get_entry_tags, uFpupp)
+GO(hb_ot_meta_reference_entry, pFpu)
+GO(hb_ot_metrics_get_position, iFpup)
+GO(hb_ot_metrics_get_position_with_fallback, vFpup)
+GO(hb_ot_metrics_get_variation, fFpu)
+GO(hb_ot_metrics_get_x_variation, iFpu)
+GO(hb_ot_metrics_get_y_variation, iFpu)
+GO(hb_ot_name_get_utf16, uFpuppp)
+GO(hb_ot_name_get_utf32, uFpuppp)
+GO(hb_ot_name_get_utf8, uFpuppp)
+GO(hb_ot_name_list_names, pFpp)
+GO(hb_ot_shape_glyphs_closure, vFpppup)
+GO(hb_ot_shape_plan_collect_lookups, vFpup)
+GO(hb_ot_tag_from_language, uFp)
+GO(hb_ot_tags_from_script, vFupp)
+GO(hb_ot_tags_from_script_and_language, vFuppppp)
+GO(hb_ot_tags_to_script_and_language, vFuupp)
+GO(hb_ot_tag_to_language, pFu)
+GO(hb_ot_tag_to_script, uFu)
+GO(hb_ot_var_find_axis, iFpupp)
+GO(hb_ot_var_find_axis_info, iFpup)
+GO(hb_ot_var_get_axes, uFpupp)
+GO(hb_ot_var_get_axis_count, uFp)
+GO(hb_ot_var_get_axis_infos, uFpupp)
+GO(hb_ot_var_get_named_instance_count, uFp)
+GO(hb_ot_var_has_data, iFp)
+GO(hb_ot_var_named_instance_get_design_coords, uFpupp)
+GO(hb_ot_var_named_instance_get_postscript_name_id, uFpu)
+GO(hb_ot_var_named_instance_get_subfamily_name_id, uFpu)
+GO(hb_ot_var_normalize_coords, vFpupp)
+GO(hb_ot_var_normalize_variations, vFppupu)
+GO(hb_script_from_iso15924_tag, uFu)
+GO(hb_script_from_string, uFpi)
+GO(hb_script_get_horizontal_direction, uFu)
+GO(hb_script_to_iso15924_tag, uFu)
+GO(hb_segment_properties_equal, iFpp)
+GO(hb_segment_properties_hash, uFp)
+GO(hb_segment_properties_overlay, vFpp)
+GO(hb_set_add, vFpu)
+GO(hb_set_add_range, vFpuu)
+GO(hb_set_add_sorted_array, vFppu)
+GO(hb_set_allocation_successful, iFp)
+GO(hb_set_clear, vFp)
+GO(hb_set_copy, pFp)
+GO(hb_set_create, pFv)
+GO(hb_set_del, vFpu)
+GO(hb_set_del_range, vFpuu)
+GO(hb_set_destroy, vFp)
+GO(hb_set_get_empty, pFv)
+GO(hb_set_get_max, uFp)
+GO(hb_set_get_min, uFp)
+GO(hb_set_get_population, uFp)
+GO(hb_set_get_user_data, pFpp)
+GO(hb_set_has, iFpu)
+GO(hb_set_hash, uFp)
+GO(hb_set_intersect, vFpp)
+GO(hb_set_invert, vFp)
+GO(hb_set_is_empty, iFp)
+GO(hb_set_is_equal, iFpp)
+GO(hb_set_is_subset, iFpp)
+GO(hb_set_next, iFpp)
+GO(hb_set_next_many, uFpupu)
+GO(hb_set_next_range, iFppp)
+GO(hb_set_previous, iFpp)
+GO(hb_set_previous_range, iFppp)
+GO(hb_set_reference, pFp)
+GO(hb_set_set, vFpp)
+//GO(hb_set_set_user_data,
+GO(hb_set_subtract, vFpp)
+GO(hb_set_symmetric_difference, vFpp)
+GO(hb_set_union, vFpp)
+GO(hb_shape, vFpppu)
+GO(hb_shape_full, iFpppup)
+GO(hb_shape_list_shapers, pFv)
+GO(hb_shape_plan_create, pFpppup)
+GO(hb_shape_plan_create2, pFpppupup)
+GO(hb_shape_plan_create_cached, pFpppup)
+GO(hb_shape_plan_create_cached2, pFpppupup)
+GO(hb_shape_plan_destroy, vFp)
+GO(hb_shape_plan_execute, iFppppu)
+GO(hb_shape_plan_get_empty, pFv)
+GO(hb_shape_plan_get_shaper, pFp)
+GO(hb_shape_plan_get_user_data, pFpp)
+GO(hb_shape_plan_reference, pFp)
+//GO(hb_shape_plan_set_user_data,
+GO(hb_style_get_value, fFpu)
+GO(hb_tag_from_string, uFpi)
+GO(hb_tag_to_string, vFup)
+GO(hb_unicode_combining_class, uFpu)
+GO(hb_unicode_compose, iFpuup)
+GO(hb_unicode_decompose, iFpupp)
+GO(hb_unicode_decompose_compatibility, uFpup)
+GO(hb_unicode_eastasian_width, uFpu)
+GO(hb_unicode_funcs_create, pFp)
+GO(hb_unicode_funcs_destroy, vFp)
+GO(hb_unicode_funcs_get_default, pFv)
+GO(hb_unicode_funcs_get_empty, pFv)
+GO(hb_unicode_funcs_get_parent, pFp)
+GO(hb_unicode_funcs_get_user_data, pFpp)
+GO(hb_unicode_funcs_is_immutable, iFp)
+GO(hb_unicode_funcs_make_immutable, vFp)
+GOM(hb_unicode_funcs_reference, pFEp)
+GOM(hb_unicode_funcs_set_combining_class_func, vFEpppp)
+GOM(hb_unicode_funcs_set_compose_func, vFEpppp)
+GOM(hb_unicode_funcs_set_decompose_compatibility_func, vFEpppp)
+GOM(hb_unicode_funcs_set_decompose_func, vFEpppp)
+GOM(hb_unicode_funcs_set_eastasian_width_func, vFEpppp)
+GOM(hb_unicode_funcs_set_general_category_func, vFEpppp)
+GOM(hb_unicode_funcs_set_mirroring_func, vFEpppp)
+GOM(hb_unicode_funcs_set_script_func, vFEpppp)
+GOM(hb_unicode_funcs_set_user_data, iFEppppi)
+GO(hb_unicode_general_category, uFpu)
+GO(hb_unicode_mirroring, uFpu)
+GO(hb_unicode_script, uFpu)
+GO(hb_variation_from_string, iFpip)
+GO(hb_variation_to_string, vFppu)
+GO(hb_version, vFppp)
+GO(hb_version_atleast, iFuuu)
+GO(hb_version_string, pFv)
diff --git a/src/wrapped/wrappedlibibus.c b/src/wrapped/wrappedlibibus.c
index 95ea0f8..22d83a2 100644
--- a/src/wrapped/wrappedlibibus.c
+++ b/src/wrapped/wrappedlibibus.c
@@ -38,7 +38,7 @@ GO(3)
static uintptr_t my_GAsyncReadyCallback_fct_##A = 0; \
static void my_GAsyncReadyCallback_##A(void* source, void* res, void* data) \
{ \
- RunFunction(my_context, my_GAsyncReadyCallback_fct_##A, 3, source, res, data);\
+ RunFunctionFmt(my_GAsyncReadyCallback_fct_##A, "ppp", source, res, data);\
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedlibice.c b/src/wrapped/wrappedlibice.c
index 3a3ff74..3a3ff74 100755..100644
--- a/src/wrapped/wrappedlibice.c
+++ b/src/wrapped/wrappedlibice.c
diff --git a/src/wrapped/wrappedlibice_private.h b/src/wrapped/wrappedlibice_private.h
index 813d599..813d599 100755..100644
--- a/src/wrapped/wrappedlibice_private.h
+++ b/src/wrapped/wrappedlibice_private.h
diff --git a/src/wrapped/wrappedlibm.c b/src/wrapped/wrappedlibm.c
index 43bdf5c..43bdf5c 100755..100644
--- a/src/wrapped/wrappedlibm.c
+++ b/src/wrapped/wrappedlibm.c
diff --git a/src/wrapped/wrappedlibm_private.h b/src/wrapped/wrappedlibm_private.h
index 962d528..16a2f0e 100755..100644
--- a/src/wrapped/wrappedlibm_private.h
+++ b/src/wrapped/wrappedlibm_private.h
@@ -53,28 +53,28 @@ GOW(atanhl, DFD)
GO2(atanhl, KFK, atanh)
#endif
// atanl // Weak
-GOW(cabs, dFdd) // only 1 arg, but is a double complex
-GOW(cabsf, fFff) // only 1 arg, but is a float complex
+GOW(cabs, XFX)
+GOW(cabsf, xFx)
// cabsl // Weak
-GOS(cacos, pFpV) // Weak, complex
-GOM(cacosf, UFV) // Weak
-GOS(cacosh, pFpV) // Weak, complex
-GOM(cacoshf, UFV) // Weak
+GOW(cacos, XFX)
+GOW(cacosf, xFx)
+GOW(cacosh, XFX)
+GOW(cacoshf, xFx)
// cacoshl // Weak
// cacosl // Weak
-GOW(carg, dFdd) // 1arg, double complex
-GOW(cargf, fFff) // 1arg, float complex
+GOW(carg, XFX)
+GOW(cargf, xFx)
// cargl // Weak
-GOS(casin, pFpV) // Weak, complex
-GOM(casinf, UFV) // Weak
-GOS(casinh, pFpV) // Weak, complex
-GOM(casinhf, UFV) // Weak
+GOW(casin, XFX)
+GOW(casinf, xFx)
+GOW(casinh, XFX)
+GOW(casinhf, xFx)
// casinhl // Weak
// casinl // Weak
-GOS(catan, pFpV) // Weak, complex
-GOM(catanf, UFV) // Weak
-GOS(catanh, pFpV) // Weak, complex
-GOM(catanhf, UFV) // Weak
+GOS(catan, XFX)
+GOM(catanf, xFx)
+GOS(catanh, XFX)
+GOM(catanhf, xFx)
// catanhl // Weak
// catanl // Weak
GOW(cbrt, dFd)
@@ -84,10 +84,10 @@ GOW(cbrtl, DFD)
#else
GO2(cbrtl, KFK, cbrt)
#endif
-//GOS(ccos, pFpV) // Weak, return complex
-//GOM(ccosf, UFV) // Weak, return complex
-//GOS(ccosh, pFpV) // Weak, return complex
-//GOM(ccoshf, UFV) // Weak, return complex
+GOW(ccos, XFX)
+GOW(ccosf, xFx)
+GOW(ccosh, XFX)
+GOW(ccoshf, xFx)
// ccoshl // Weak
// ccosl // Weak
GOW(ceil, dFd)
@@ -97,13 +97,13 @@ GOW(ceill, DFD) // Weak
#else
GO2(ceill, KFK, ceil)
#endif
-//GOS(cexp, pFpV) // Weak, return complex
-//GOM(cexpf, UFV) // Weak, return complex
+GOW(cexp, XFX)
+GOW(cexpf, xFx)
// cexpl // Weak
// cimag // Weak
// cimagf // Weak
// cimagl // Weak
-//GOS(clog, pFpV) // return a double complex, so ret 4
+GOW(clog, XFX)
// clog10 // Weak
// __clog10
// clog10f // Weak
@@ -126,28 +126,28 @@ GOM(__coshf_finite, fFf)
GOM(__cosh_finite, dFd)
// coshl // Weak
// cosl // Weak
-//GOS(cpow, pFpVvvvvV) // Weak, return complex
-//GOM(cpowf, UFVvvV) // Weak
+GOW(cpow, XFXX)
+GOW(cpowf, xFxx)
// cpowl // Weak
-//GOS(cproj, pFpV) // double complex
-//GOM(cprojf, UFV)
+GOW(cproj, XFX)
+GOW(cprojf, xFx)
// cprojl // Weak
// creal // Weak
// crealf // Weak
// creall // Weak
-//GOS(csin, pFpV) // Weak, return complex
-//GOM(csinf, UFV) // Weak, return complex
-//GOS(csinh, pFpV) // Weak, return complex
-//GOM(csinhf, UFV) // Weak, return complex
+GOW(csin, XFX)
+GOW(csinf, xFx)
+GOW(csinh, XFX)
+GOW(csinhf, xFx)
// csinhl // Weak
// csinl // Weak
-//GOS(csqrt, pFpV)
-//GOS(csqrtf, UFV) // Weak
+GOW(csqrt, XFX)
+GOW(csqrtf, xFx)
// csqrtl // Weak
-//GOS(ctan, pFpV) // Weak, return complex
-//GOM(ctanf, UFV) // Weak, return complex
-//GOS(ctanh, pFpV) // Weak, return complex
-//GOM(ctanhf, UFV) // Weak, return complex
+GOW(ctan, XFX)
+GOW(ctanf, xFx)
+GOW(ctanh, XFX)
+GOW(ctanhf, xFx)
// ctanhl // Weak
// ctanl // Weak
// __cxa_finalize // Weak
@@ -182,7 +182,11 @@ GOM(__exp2_finite, dFd)
GOW(expf, fFf)
GOM(__expf_finite, fFf)
GOM(__exp_finite, dFd)
-// expl // Weak
+#ifdef HAVE_LD80BITS
+GOW(expl, DFD)
+#else
+GO2(expl, KFK, exp)
+#endif
GOW(expm1, dFd)
GOW(expm1f, fFf)
// expm1l // Weak
@@ -393,6 +397,9 @@ GOW(rintf, fFf)
// rintl // Weak
GOW(round, dFd)
GOW(roundf, fFf)
+GO(roundeven, dFd) //since C23
+GO(roundevenf, fFf)
+//GO(roundevenl, DFD)
// roundl // Weak
// scalb // Weak
// scalbf // Weak
diff --git a/src/wrapped/wrappedlibncurses.c b/src/wrapped/wrappedlibncurses.c
index bd20f90..bd20f90 100755..100644
--- a/src/wrapped/wrappedlibncurses.c
+++ b/src/wrapped/wrappedlibncurses.c
diff --git a/src/wrapped/wrappedlibncurses6.c b/src/wrapped/wrappedlibncurses6.c
index 4fe26c7..4fe26c7 100755..100644
--- a/src/wrapped/wrappedlibncurses6.c
+++ b/src/wrapped/wrappedlibncurses6.c
diff --git a/src/wrapped/wrappedlibncurses6_private.h b/src/wrapped/wrappedlibncurses6_private.h
index b7153d2..b7153d2 100755..100644
--- a/src/wrapped/wrappedlibncurses6_private.h
+++ b/src/wrapped/wrappedlibncurses6_private.h
diff --git a/src/wrapped/wrappedlibncurses_private.h b/src/wrapped/wrappedlibncurses_private.h
index ef182ab..ef182ab 100755..100644
--- a/src/wrapped/wrappedlibncurses_private.h
+++ b/src/wrapped/wrappedlibncurses_private.h
diff --git a/src/wrapped/wrappedlibncursesw.c b/src/wrapped/wrappedlibncursesw.c
index 2beb3e7..2beb3e7 100755..100644
--- a/src/wrapped/wrappedlibncursesw.c
+++ b/src/wrapped/wrappedlibncursesw.c
diff --git a/src/wrapped/wrappedlibncursesw6.c b/src/wrapped/wrappedlibncursesw6.c
index 4e440dc..4e440dc 100755..100644
--- a/src/wrapped/wrappedlibncursesw6.c
+++ b/src/wrapped/wrappedlibncursesw6.c
diff --git a/src/wrapped/wrappedlibncursesw6_private.h b/src/wrapped/wrappedlibncursesw6_private.h
index ef182ab..ef182ab 100755..100644
--- a/src/wrapped/wrappedlibncursesw6_private.h
+++ b/src/wrapped/wrappedlibncursesw6_private.h
diff --git a/src/wrapped/wrappedlibncursesw_private.h b/src/wrapped/wrappedlibncursesw_private.h
index b7153d2..b7153d2 100755..100644
--- a/src/wrapped/wrappedlibncursesw_private.h
+++ b/src/wrapped/wrappedlibncursesw_private.h
diff --git a/src/wrapped/wrappedlibnuma.c b/src/wrapped/wrappedlibnuma.c
new file mode 100644
index 0000000..86fcb9f
--- /dev/null
+++ b/src/wrapped/wrappedlibnuma.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+#include "myalign.h"
+
+const char* libnumaName = "libnuma.so.1";
+#define LIBNAME libnuma
+
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedlibnuma_private.h b/src/wrapped/wrappedlibnuma_private.h
new file mode 100644
index 0000000..554cdcb
--- /dev/null
+++ b/src/wrapped/wrappedlibnuma_private.h
@@ -0,0 +1,107 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error meh!
+#endif
+
+GO(copy_bitmask_to_bitmask, vFpp)
+GO(copy_bitmask_to_nodemask, vFpp)
+GO(copy_nodemask_to_bitmask, vFpp)
+//GOW(get_mempolicy,
+GOW(mbind, iFpLipLu)
+//GOW(migrate_pages,
+//GOW(move_pages,
+DATAB(numa_all_cpus_ptr, sizeof(void*))
+//DATAB(numa_all_nodes,
+DATAB(numa_all_nodes_ptr, sizeof(void*))
+GO(numa_alloc, pFL)
+GO(numa_allocate_cpumask, pFv)
+GO(numa_allocate_nodemask, pFv)
+GO(numa_alloc_interleaved, pFL)
+GO(numa_alloc_interleaved_subset, pFLp)
+//GO2(numa_alloc_interleaved_subset@libnuma_1.1,
+GO(numa_alloc_local, pFL)
+GO(numa_alloc_onnode, pFLi)
+GO(numa_available, iFv)
+GO(numa_bind, vFp)
+//GO2(numa_bind@libnuma_1.1,
+GO(numa_bitmask_alloc, pFu)
+GO(numa_bitmask_clearall, pFp)
+GO(numa_bitmask_clearbit, pFpu)
+GO(numa_bitmask_equal, iFpp)
+GO(numa_bitmask_free, vFp)
+GO(numa_bitmask_isbitset, iFpu)
+GO(numa_bitmask_nbytes, uFp)
+GO(numa_bitmask_setall, pFp)
+GO(numa_bitmask_setbit, pFpu)
+GO(numa_bitmask_weight, uFp)
+GO(numa_distance, iFii)
+GOW(numa_error, vFp)
+DATAB(numa_exit_on_error, sizeof(int))
+DATAB(numa_exit_on_warn, sizeof(int))
+GO(numa_free, vFpL)
+//GO2(numa_get_interleave_mask@libnuma_1.1,
+GO(numa_get_interleave_mask, pFv)
+GO(numa_get_interleave_node, iFv)
+GO(numa_get_membind, pFv)
+//GO2(numa_get_membind@libnuma_1.1,
+GO(numa_get_mems_allowed, pFv)
+//GO2(numa_get_run_node_mask@libnuma_1.1,
+GO(numa_get_run_node_mask, pFv)
+//GO(numa_has_preferred_many,
+//GO2(numa_interleave_memory@libnuma_1.1,
+GO(numa_interleave_memory, vFpLp)
+GO(numa_max_node, iFv)
+GO(numa_max_possible_node, iFv)
+GO(numa_migrate_pages, iFipp)
+GO(numa_move_pages, iFiLpppi)
+GO(numa_node_of_cpu, iFi)
+GO(numa_node_size, lFip)
+GO(numa_node_size64, IFip)
+//DATAB(numa_nodes_ptr,
+//GO2(numa_node_to_cpus@libnuma_1.1,
+GO(numa_node_to_cpus, iFip)
+//GO(numa_node_to_cpu_update,
+//DATAB(numa_no_nodes,
+DATAB(numa_no_nodes_ptr, sizeof(void*))
+GO(numa_num_configured_cpus, iFv)
+GO(numa_num_configured_nodes, iFv)
+//GO(numa_num_possible_cpus,
+GO(numa_num_possible_nodes, iFv)
+GO(numa_num_task_cpus, iFv)
+GO(numa_num_task_nodes, iFv)
+//GO(numa_num_thread_cpus,
+//GO(numa_num_thread_nodes,
+//GO(numa_pagesize,
+GO(numa_parse_bitmap, iFpp)
+//GO2(numa_parse_bitmap@libnuma_1.1,
+GO(numa_parse_cpustring, pFp)
+//GO(numa_parse_cpustring_all,
+GO(numa_parse_nodestring, pFp)
+//GO(numa_parse_nodestring_all,
+GO(numa_police_memory, vFpL)
+GO(numa_preferred, iFv)
+//GO(numa_preferred_many,
+GO(numa_realloc, pFpLL)
+GO(numa_run_on_node, iFi)
+GO(numa_run_on_node_mask, iFp)
+//GO2(numa_run_on_node_mask@libnuma_1.1,
+//GO(numa_run_on_node_mask_all,
+GO(numa_sched_getaffinity, iFip)
+//GO2(numa_sched_getaffinity@libnuma_1.1,
+GO(numa_sched_setaffinity, iFip)
+//GO2(numa_sched_setaffinity@libnuma_1.1,
+GO(numa_set_bind_policy, vFi)
+GO(numa_set_interleave_mask, vFp)
+//GO2(numa_set_interleave_mask@libnuma_1.1,
+GO(numa_set_localalloc, vFv)
+GO(numa_setlocal_memory, vFpL)
+GO(numa_set_membind, vFp)
+//GO2(numa_set_membind@libnuma_1.1,
+//GO(numa_set_membind_balancing,
+GO(numa_set_preferred, vFi)
+//GO(numa_set_preferred_many,
+GO(numa_set_strict, vFi)
+GO(numa_tonodemask_memory, vFpLp)
+//GO2(numa_tonodemask_memory@libnuma_1.1,
+GO(numa_tonode_memory, vFpLi)
+GOW(numa_warn, vFippppppppppppp) //use VAARG with printf style, should wrap if used
+//GOW(set_mempolicy,
diff --git a/src/wrapped/wrappedlibogg.c b/src/wrapped/wrappedlibogg.c
index f922d8a..f922d8a 100755..100644
--- a/src/wrapped/wrappedlibogg.c
+++ b/src/wrapped/wrappedlibogg.c
diff --git a/src/wrapped/wrappedlibogg_private.h b/src/wrapped/wrappedlibogg_private.h
index 3440cc2..3440cc2 100755..100644
--- a/src/wrapped/wrappedlibogg_private.h
+++ b/src/wrapped/wrappedlibogg_private.h
diff --git a/src/wrapped/wrappedlibpanel.c b/src/wrapped/wrappedlibpanel.c
index 9d706b5..9d706b5 100755..100644
--- a/src/wrapped/wrappedlibpanel.c
+++ b/src/wrapped/wrappedlibpanel.c
diff --git a/src/wrapped/wrappedlibpanel_private.h b/src/wrapped/wrappedlibpanel_private.h
index 31a7431..31a7431 100755..100644
--- a/src/wrapped/wrappedlibpanel_private.h
+++ b/src/wrapped/wrappedlibpanel_private.h
diff --git a/src/wrapped/wrappedlibpcre.c b/src/wrapped/wrappedlibpcre.c
index 1175f7d..9d3b606 100755..100644
--- a/src/wrapped/wrappedlibpcre.c
+++ b/src/wrapped/wrappedlibpcre.c
@@ -20,7 +20,7 @@ typedef void (*pcre_free_t)(void *);
EXPORT uintptr_t my_pcre_free;
void wrapped_pcre_free(void* p) {
- RunFunction(my_context, my_pcre_free, 1, p);
+ RunFunctionFmt(my_pcre_free, "p", p);
}
EXPORT pcre_free_t pcre_free = wrapped_pcre_free;
diff --git a/src/wrapped/wrappedlibpcre_private.h b/src/wrapped/wrappedlibpcre_private.h
index b851fc3..b851fc3 100755..100644
--- a/src/wrapped/wrappedlibpcre_private.h
+++ b/src/wrapped/wrappedlibpcre_private.h
diff --git a/src/wrapped/wrappedlibpthread.c b/src/wrapped/wrappedlibpthread.c
index d29218e..d29218e 100755..100644
--- a/src/wrapped/wrappedlibpthread.c
+++ b/src/wrapped/wrappedlibpthread.c
diff --git a/src/wrapped/wrappedlibpthread_private.h b/src/wrapped/wrappedlibpthread_private.h
index 2c16c02..c0fd055 100755..100644
--- a/src/wrapped/wrappedlibpthread_private.h
+++ b/src/wrapped/wrappedlibpthread_private.h
@@ -5,20 +5,20 @@
// cpu_set_t is a struct with an array, default size is fixed for all architecture
// pthread_t is like unsigned long
-// __errno_location
-// fork
-// __fork
-// __h_errno_location
-// _IO_flockfile
-// _IO_ftrylockfile
-// _IO_funlockfile
-// __libc_allocate_rtsig
-// __libc_current_sigrtmax
-// __libc_current_sigrtmin
+//GO(__errno_location,
+//GO(fork,
+//GO(__fork,
+//GO(__h_errno_location,
+//GO(_IO_flockfile,
+//GO(_IO_ftrylockfile,
+//GO(_IO_funlockfile,
+//GO(__libc_allocate_rtsig,
+//GO(__libc_current_sigrtmax,
+//GO(__libc_current_sigrtmin,
GOM(pthread_atfork, iFEppp)
GOM(__pthread_atfork, iFEppp)
GOM(pthread_attr_destroy, iFEp)
-// pthread_attr_getaffinity_np
+//GO(pthread_attr_getaffinity_np,
#ifdef NOALIGN
GO(pthread_attr_getdetachstate, iFpp)
GO(pthread_attr_getguardsize, iFpp)
@@ -85,7 +85,7 @@ GOM(_pthread_cleanup_pop, vFEpi)
GOM(_pthread_cleanup_pop_restore, vFEpi)
GOM(_pthread_cleanup_push, vFEppp)
GOM(_pthread_cleanup_push_defer, vFEppp)
-// __pthread_cleanup_routine
+//GO(__pthread_cleanup_routine,
#ifdef NOALIGN
GO(pthread_condattr_destroy, iFp)
GO(pthread_condattr_getclock, iFpp)
@@ -93,6 +93,9 @@ GO(pthread_condattr_getpshared, iFpp)
GO(pthread_condattr_init, iFp)
GO(pthread_condattr_setclock, iFpi)
GO(pthread_condattr_setpshared, iFpi)
+GO(pthread_cond_broadcast, iFp)
+GO(pthread_cond_destroy, iFp)
+GO(pthread_cond_init, iFpp)
#else
GOM(pthread_condattr_destroy, iFEp)
GOM(pthread_condattr_getclock, iFEpp)
@@ -100,12 +103,6 @@ GOM(pthread_condattr_getpshared, iFEpp)
GOM(pthread_condattr_init, iFEp)
GOM(pthread_condattr_setclock, iFEpi)
GOM(pthread_condattr_setpshared, iFEpi)
-#endif
-#ifdef NOALIGN
-GO(pthread_cond_broadcast, iFp)
-GO(pthread_cond_destroy, iFp)
-GO(pthread_cond_init, iFpp)
-#else
GOM(pthread_cond_broadcast, iFEp)
GOM(pthread_cond_destroy, iFEp)
GOM(pthread_cond_init, iFEpp)
@@ -134,7 +131,7 @@ GO(pthread_getschedparam, iFLpp)
GO(__pthread_getspecific, pFL)
GO(pthread_getspecific, pFL)
GO(pthread_getname_np, iFppL)
-// __pthread_initialize_minimal
+//GO(__pthread_initialize_minimal,
GO(pthread_join, iFLp)
GOM(__pthread_key_create, iFEpp)
GOM(pthread_key_create, iFEpp)
@@ -146,91 +143,85 @@ GO(pthread_kill_other_threads_np, vFv)
GO(__pthread_mutexattr_destroy, iFp)
GO(pthread_mutexattr_destroy, iFp)
GO(pthread_mutexattr_getkind_np, iFpp)
-// pthread_mutexattr_getprioceiling
+//GO(pthread_mutexattr_getprioceiling,
GO(pthread_mutexattr_getprotocol, iFpp)
-// pthread_mutexattr_getpshared
-// pthread_mutexattr_getrobust_np
+//GO(pthread_mutexattr_getpshared,
+GO(pthread_mutexattr_getrobust, iFpp)
+//GO(pthread_mutexattr_getrobust_np,
GO(pthread_mutexattr_gettype, iFpp)
GO(__pthread_mutexattr_init, iFp)
GO(pthread_mutexattr_init, iFp)
GO(pthread_mutexattr_setkind_np, iFpi)
-// pthread_mutexattr_setprioceiling
+//GO(pthread_mutexattr_setprioceiling,
GO(pthread_mutexattr_setprotocol, iFpi)
GO(pthread_mutexattr_setpshared, iFpi)
-// pthread_mutexattr_setrobust_np
+GO(pthread_mutexattr_setrobust, iFpi)
+//GO(pthread_mutexattr_setrobust_np,
GO(__pthread_mutexattr_settype, iFpi)
GO(pthread_mutexattr_settype, iFpi)
#else
GOM(__pthread_mutexattr_destroy, iFEp)
GOM(pthread_mutexattr_destroy, iFEp)
GOM(pthread_mutexattr_getkind_np, iFEpp)
-// pthread_mutexattr_getprioceiling
+//GO(pthread_mutexattr_getprioceiling,
GOM(pthread_mutexattr_getprotocol, iFEpp)
-// pthread_mutexattr_getpshared
-// pthread_mutexattr_getrobust_np
+//GO(pthread_mutexattr_getpshared,
+GOM(pthread_mutexattr_getrobust, iFEpp)
+//GO(pthread_mutexattr_getrobust_np,
GOM(pthread_mutexattr_gettype, iFEpp)
GOM(__pthread_mutexattr_init, iFEp)
GOM(pthread_mutexattr_init, iFEp)
GOM(pthread_mutexattr_setkind_np, iFEpi)
-// pthread_mutexattr_setprioceiling
+//GO(pthread_mutexattr_setprioceiling,
GOM(pthread_mutexattr_setprotocol, iFEpi)
GOM(pthread_mutexattr_setpshared, iFEpi)
-// pthread_mutexattr_setrobust_np
+GOM(pthread_mutexattr_setrobust, iFEpi)
+//GO(pthread_mutexattr_setrobust_np,
GOM(__pthread_mutexattr_settype, iFEpi)
GOM(pthread_mutexattr_settype, iFEpi)
#endif
-// pthread_mutex_consistent_np
-#ifdef NOALIGN
+//GO(pthread_mutex_consistent_np,
+GO(pthread_mutex_consistent, iFp)
GO(__pthread_mutex_destroy, iFp)
GO(pthread_mutex_destroy, iFp)
-// pthread_mutex_getprioceiling
+//GO(pthread_mutex_getprioceiling,
+#ifdef NOALIGN
GO(__pthread_mutex_init, iFpp)
GO(pthread_mutex_init, iFpp)
+#else
+// phtread_mutex_t is 40 bytes on x86_64, but 48bytes on ARM64
+GOM(__pthread_mutex_init, iFpp)
+GOM(pthread_mutex_init, iFpp)
+#endif
GO(__pthread_mutex_lock, iFp)
GO(pthread_mutex_lock, iFp)
-// pthread_mutex_setprioceiling
+//GO(pthread_mutex_setprioceiling,
GO(pthread_mutex_timedlock, iFpp)
GO(__pthread_mutex_trylock, iFp)
GO(pthread_mutex_trylock, iFp)
GO(__pthread_mutex_unlock, iFp)
GO(pthread_mutex_unlock, iFp)
-#else
-// phtread_mutex_t is 40 bytes on x86_64, but 48bytes on ARM64
-GOM(__pthread_mutex_destroy, iFp)
-GOM(pthread_mutex_destroy, iFp)
-// pthread_mutex_getprioceiling
-GOM(__pthread_mutex_init, iFpp)
-GOM(pthread_mutex_init, iFpp)
-GOM(__pthread_mutex_lock, iFp)
-GOM(pthread_mutex_lock, iFp)
-// pthread_mutex_setprioceiling
-GOM(pthread_mutex_timedlock, iFpp)
-GOM(__pthread_mutex_trylock, iFp)
-GOM(pthread_mutex_trylock, iFp)
-GOM(__pthread_mutex_unlock, iFp)
-GOM(pthread_mutex_unlock, iFp)
-#endif
GOM(pthread_once, iFEpp)
GOM(__pthread_once, iFEpp)
GOM(__pthread_register_cancel, vFEp)
-// __pthread_register_cancel_defer
+//GO(__pthread_register_cancel_defer,
GO(pthread_rwlockattr_destroy, vFp)
GO(pthread_rwlockattr_getkind_np, iFpp)
-// pthread_rwlockattr_getpshared
+//GO(pthread_rwlockattr_getpshared,
GO(pthread_rwlockattr_init, iFp)
GO(pthread_rwlockattr_setkind_np, iFpi)
-// pthread_rwlockattr_setpshared
-// __pthread_rwlock_destroy
+//GO(pthread_rwlockattr_setpshared,
+//GO(__pthread_rwlock_destroy,
GO(pthread_rwlock_destroy, iFp)
GO(__pthread_rwlock_init, iFpp)
GO(pthread_rwlock_init, iFpp)
GO(__pthread_rwlock_rdlock, iFp)
GO(pthread_rwlock_rdlock, iFp)
-// pthread_rwlock_timedrdlock
-// pthread_rwlock_timedwrlock
-// __pthread_rwlock_tryrdlock
+//GO(pthread_rwlock_timedrdlock,
+//GO(pthread_rwlock_timedwrlock,
+//GO(__pthread_rwlock_tryrdlock,
GO(pthread_rwlock_tryrdlock, iFp)
-// __pthread_rwlock_trywrlock
+//GO(__pthread_rwlock_trywrlock,
GO(pthread_rwlock_trywrlock, iFp)
GO(__pthread_rwlock_unlock, iFp)
GO(pthread_rwlock_unlock, iFp)
@@ -256,12 +247,12 @@ GO(pthread_testcancel, vFv)
GO(pthread_timedjoin_np, iFppp)
GO(pthread_tryjoin_np, iFpp)
GOM(__pthread_unregister_cancel, vFEp)
-// __pthread_unregister_cancel_restore
-// __pthread_unwind
+//GO(__pthread_unregister_cancel_restore,
+//GO(__pthread_unwind,
GOM(__pthread_unwind_next, vFEp)
GO(pthread_yield, iFv)
-// raise
-// __res_state
+//GO(raise,
+//GO(__res_state,
GO(sem_close, iFp)
GO(sem_clockwait, iFppp)
GO(sem_destroy, iFp)
@@ -273,6 +264,6 @@ GO(sem_timedwait, iFpp)
GO(sem_trywait, iFp)
GO(sem_unlink, iFp)
GO(sem_wait, iFp)
-// __sigaction
-// system
-// __vfork
+//GO(__sigaction,
+//GO(system,
+//GO(__vfork,
diff --git a/src/wrapped/wrappedlibresolv_private.h b/src/wrapped/wrappedlibresolv_private.h
index 1d73f4f..1d73f4f 100755..100644
--- a/src/wrapped/wrappedlibresolv_private.h
+++ b/src/wrapped/wrappedlibresolv_private.h
diff --git a/src/wrapped/wrappedlibrt.c b/src/wrapped/wrappedlibrt.c
index 29fa375..f89d353 100755..100644
--- a/src/wrapped/wrappedlibrt.c
+++ b/src/wrapped/wrappedlibrt.c
@@ -40,7 +40,7 @@ GO(3)
static uintptr_t my_sigev_notify_fct_##A = 0; \
static void my_sigev_notify_##A(void* sigval) \
{ \
- RunFunction(my_context, my_sigev_notify_fct_##A, 1, sigval);\
+ RunFunctionFmt(my_sigev_notify_fct_##A, "p", sigval);\
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedlibrt_private.h b/src/wrapped/wrappedlibrt_private.h
index 75eb3fa..75eb3fa 100755..100644
--- a/src/wrapped/wrappedlibrt_private.h
+++ b/src/wrapped/wrappedlibrt_private.h
diff --git a/src/wrapped/wrappedlibsm.c b/src/wrapped/wrappedlibsm.c
index daf095b..1ab0c30 100755..100644
--- a/src/wrapped/wrappedlibsm.c
+++ b/src/wrapped/wrappedlibsm.c
@@ -54,25 +54,25 @@ typedef struct my_SmcCallbacks_s {
static uintptr_t my_save_yourself_fct = 0;
static void my_save_yourself(void* smcConn, void* clientData, int saveType, int shutdown, int interactStyle, int fast)
{
- RunFunction(my_context, my_save_yourself_fct, 6, smcConn, clientData, saveType, shutdown, interactStyle, fast);
+ RunFunctionFmt(my_save_yourself_fct, "ppiiii", smcConn, clientData, saveType, shutdown, interactStyle, fast);
}
static uintptr_t my_die_fct = 0;
static void my_die(void* smcConn, void* clientData)
{
- RunFunction(my_context, my_die_fct, 2, smcConn, clientData);
+ RunFunctionFmt(my_die_fct, "pp", smcConn, clientData);
}
static uintptr_t my_shutdown_cancelled_fct = 0;
static void my_shutdown_cancelled(void* smcConn, void* clientData)
{
- RunFunction(my_context, my_shutdown_cancelled_fct, 2, smcConn, clientData);
+ RunFunctionFmt(my_shutdown_cancelled_fct, "pp", smcConn, clientData);
}
static uintptr_t my_save_complete_fct = 0;
static void my_save_complete(void* smcConn, void* clientData)
{
- RunFunction(my_context, my_save_complete_fct, 2, smcConn, clientData);
+ RunFunctionFmt(my_save_complete_fct, "pp", smcConn, clientData);
}
@@ -102,7 +102,7 @@ GO(4)
static uintptr_t my_Request_fct_##A = 0; \
static void my_Request_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_Request_fct_##A, 2, a, b);\
+ RunFunctionFmt(my_Request_fct_##A, "pp", a, b);\
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedlibsm_private.h b/src/wrapped/wrappedlibsm_private.h
index bc00fca..bc00fca 100755..100644
--- a/src/wrapped/wrappedlibsm_private.h
+++ b/src/wrapped/wrappedlibsm_private.h
diff --git a/src/wrapped/wrappedlibsndfile.c b/src/wrapped/wrappedlibsndfile.c
index 3766066..bbb11b5 100755..100644
--- a/src/wrapped/wrappedlibsndfile.c
+++ b/src/wrapped/wrappedlibsndfile.c
@@ -38,7 +38,7 @@ GO(4)
static uintptr_t my_sf_vio_get_filelen_fct_##A = 0; \
static int64_t my_sf_vio_get_filelen_##A(void* a) \
{ \
- return (int64_t)RunFunction(my_context, my_sf_vio_get_filelen_fct_##A, 1, a); \
+ return (int64_t)RunFunctionFmt(my_sf_vio_get_filelen_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -60,7 +60,7 @@ static void* find_sf_vio_get_filelen_Fct(void* fct)
static uintptr_t my_sf_vio_seek_fct_##A = 0; \
static int64_t my_sf_vio_seek_##A(int64_t offset, int whence, void *user_data) \
{ \
- return (int64_t)RunFunction(my_context, my_sf_vio_seek_fct_##A, 3, offset, whence, user_data); \
+ return (int64_t)RunFunctionFmt(my_sf_vio_seek_fct_##A, "Iip", offset, whence, user_data); \
}
SUPER()
#undef GO
@@ -82,7 +82,7 @@ static void* find_sf_vio_seek_Fct(void* fct)
static uintptr_t my_sf_vio_read_fct_##A = 0; \
static int64_t my_sf_vio_read_##A(void* ptr, int64_t count, void *user_data) \
{ \
- return (int64_t)RunFunction(my_context, my_sf_vio_read_fct_##A, 3, ptr, count, user_data); \
+ return (int64_t)RunFunctionFmt(my_sf_vio_read_fct_##A, "pIp", ptr, count, user_data); \
}
SUPER()
#undef GO
@@ -104,7 +104,7 @@ static void* find_sf_vio_read_Fct(void* fct)
static uintptr_t my_sf_vio_write_fct_##A = 0; \
static int64_t my_sf_vio_write_##A(const void* ptr, int64_t count, void *user_data) \
{ \
- return (int64_t)RunFunction(my_context, my_sf_vio_write_fct_##A, 3, ptr, count, user_data); \
+ return (int64_t)RunFunctionFmt(my_sf_vio_write_fct_##A, "pIp", ptr, count, user_data); \
}
SUPER()
#undef GO
@@ -126,7 +126,7 @@ static void* find_sf_vio_write_Fct(void* fct)
static uintptr_t my_sf_vio_tell_fct_##A = 0; \
static int64_t my_sf_vio_tell_##A(void* a) \
{ \
- return (int64_t)RunFunction(my_context, my_sf_vio_tell_fct_##A, 1, a); \
+ return (int64_t)RunFunctionFmt(my_sf_vio_tell_fct_##A, "p", a); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedlibsndfile_private.h b/src/wrapped/wrappedlibsndfile_private.h
index 7aef440..7aef440 100755..100644
--- a/src/wrapped/wrappedlibsndfile_private.h
+++ b/src/wrapped/wrappedlibsndfile_private.h
diff --git a/src/wrapped/wrappedlibssl.c b/src/wrapped/wrappedlibssl.c
index 48dae43..056c2ef 100755..100644
--- a/src/wrapped/wrappedlibssl.c
+++ b/src/wrapped/wrappedlibssl.c
@@ -22,6 +22,8 @@ const char* libsslName = "libssl.so.1.0.0";
#define ALTNAME "libssl.so.1.0.2"
#define ALTNAME2 "libssl.so.1.1"
+#define ADDED_FUNCTIONS() \
+
#include "generated/wrappedlibssltypes.h"
#include "wrappercallback.h"
@@ -39,7 +41,7 @@ GO(4)
static uintptr_t my_pem_passwd_cb_fct_##A = 0; \
static int my_pem_passwd_cb_##A(void* buf, int size, int rwflag, void* password) \
{ \
- return (int)RunFunction(my_context, my_pem_passwd_cb_fct_##A, 4, buf, size, rwflag, password); \
+ return (int)RunFunctionFmt(my_pem_passwd_cb_fct_##A, "piip", buf, size, rwflag, password); \
}
SUPER()
#undef GO
@@ -63,7 +65,7 @@ static void* find_pem_passwd_cb_Fct(void* fct)
static uintptr_t my_anonymous_fct_##A = 0; \
static void* my_anonymous_##A(void* a, void* b, void* c, void *d) \
{ \
- return (void*)RunFunction(my_context, my_anonymous_fct_##A, 4, a, b, c, d); \
+ return (void*)RunFunctionFmt(my_anonymous_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -88,7 +90,7 @@ static void* find_anonymous_Fct(void* fct)
static uintptr_t my_verify_fct_##A = 0; \
static int my_verify_##A(int a, void* b) \
{ \
- return (int)RunFunction(my_context, my_verify_fct_##A, 2, a, b); \
+ return (int)RunFunctionFmt(my_verify_fct_##A, "ip", a, b); \
}
SUPER()
#undef GO
@@ -122,7 +124,7 @@ static void* reverse_verify_Fct(void* fct)
static uintptr_t my_ex_new_fct_##A = 0; \
static void my_ex_new_##A(void* parent, void* ptr, void* ad, int idx, long argl, void* argp) \
{ \
- RunFunction(my_context, my_ex_new_fct_##A, 6, parent, ptr, ad, idx, argl, argp); \
+ RunFunctionFmt(my_ex_new_fct_##A, "pppilp", parent, ptr, ad, idx, argl, argp); \
}
SUPER()
#undef GO
@@ -146,7 +148,7 @@ static void* find_ex_new_Fct(void* fct)
static uintptr_t my_ex_free_fct_##A = 0; \
static void my_ex_free_##A(void* parent, void* ptr, void* ad, int idx, long argl, void* argp) \
{ \
- RunFunction(my_context, my_ex_free_fct_##A, 6, parent, ptr, ad, idx, argl, argp); \
+ RunFunctionFmt(my_ex_free_fct_##A, "pppilp", parent, ptr, ad, idx, argl, argp); \
}
SUPER()
#undef GO
@@ -170,7 +172,7 @@ static void* find_ex_free_Fct(void* fct)
static uintptr_t my_ex_dup_fct_##A = 0; \
static int my_ex_dup_##A(void* to, void* from, void* from_d, int idx, long argl, void* argp) \
{ \
- return (int) RunFunction(my_context, my_ex_dup_fct_##A, 6, to, from, from_d, idx, argl, argp); \
+ return (int) RunFunctionFmt(my_ex_dup_fct_##A, "pppilp", to, from, from_d, idx, argl, argp); \
}
SUPER()
#undef GO
@@ -194,7 +196,7 @@ static void* find_ex_dup_Fct(void* fct)
static uintptr_t my_client_cb_fct_##A = 0; \
static uint32_t my_client_cb_##A(void* ssl, void* hint, void* identity, uint32_t id_len, void* psk, uint32_t psk_len) \
{ \
- return RunFunction(my_context, my_client_cb_fct_##A, 6, ssl, hint, identity, id_len, psk, psk_len); \
+ return RunFunctionFmt(my_client_cb_fct_##A, "pppupu", ssl, hint, identity, id_len, psk, psk_len); \
}
SUPER()
#undef GO
@@ -213,12 +215,86 @@ static void* find_client_cb_Fct(void* fct)
return NULL;
}
+
+// server_cb
+#define GO(A) \
+static uintptr_t my_server_cb_fct_##A = 0; \
+static uint32_t my_server_cb_##A(void* ssl, void* identity, void* psk, uint32_t psk_len) \
+{ \
+ return RunFunctionFmt(my_server_cb_fct_##A, "pppu", ssl, identity, psk, psk_len); \
+}
+SUPER()
+#undef GO
+static void* find_server_cb_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_server_cb_fct_##A == (uintptr_t)fct) return my_server_cb_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_server_cb_fct_##A == 0) {my_server_cb_fct_##A = (uintptr_t)fct; return my_server_cb_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL server_cb callback\n");
+ return NULL;
+}
+
+
+// use_session_cb
+#define GO(A) \
+static uintptr_t my_use_session_cb_fct_##A = 0; \
+static uint32_t my_use_session_cb_##A(void* ssl, void* md, void* id, void* id_len, void* sess) \
+{ \
+ return RunFunctionFmt(my_use_session_cb_fct_##A, "ppppp", ssl, md, id, id_len, sess); \
+}
+SUPER()
+#undef GO
+static void* find_use_session_cb_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_use_session_cb_fct_##A == (uintptr_t)fct) return my_use_session_cb_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_use_session_cb_fct_##A == 0) {my_use_session_cb_fct_##A = (uintptr_t)fct; return my_use_session_cb_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL use_session_cb callback\n");
+ return NULL;
+}
+
+// sess
+#define GO(A) \
+static uintptr_t my_sess_fct_##A = 0; \
+static uint32_t my_sess_##A(void* ssl, void* sess) \
+{ \
+ return RunFunctionFmt(my_sess_fct_##A, "pp", ssl, sess);\
+}
+SUPER()
+#undef GO
+static void* find_sess_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_sess_fct_##A == (uintptr_t)fct) return my_sess_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_sess_fct_##A == 0) {my_sess_fct_##A = (uintptr_t)fct; return my_sess_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL sess callback\n");
+ return NULL;
+}
+
// proto_select
#define GO(A) \
static uintptr_t my_proto_select_fct_##A = 0; \
static int my_proto_select_##A(void* s, void* out, void* outlen, void* in, uint32_t inlen, void* arg) \
{ \
- return (int)RunFunction(my_context, my_proto_select_fct_##A, 6, s, out, outlen, in, inlen, arg); \
+ return (int)RunFunctionFmt(my_proto_select_fct_##A, "ppppup", s, out, outlen, in, inlen, arg); \
}
SUPER()
#undef GO
@@ -242,7 +318,7 @@ static void* find_proto_select_Fct(void* fct)
static uintptr_t my_client_cert_fct_##A = 0; \
static int my_client_cert_##A(void* a, void* b, void* c) \
{ \
- return (int)RunFunction(my_context, my_client_cert_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_client_cert_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -261,6 +337,79 @@ static void* find_client_cert_Fct(void* fct)
return NULL;
}
+// cookie_generate
+#define GO(A) \
+static uintptr_t my_cookie_generate_fct_##A = 0; \
+static int my_cookie_generate_##A(void* a, void* b, void* c)\
+{ \
+ return (int)RunFunctionFmt(my_cookie_generate_fct_##A, "ppp", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_cookie_generate_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_cookie_generate_fct_##A == (uintptr_t)fct) return my_cookie_generate_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_cookie_generate_fct_##A == 0) {my_cookie_generate_fct_##A = (uintptr_t)fct; return my_cookie_generate_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL cookie_generate callback\n");
+ return NULL;
+}
+
+
+// cookie_verify
+#define GO(A) \
+static uintptr_t my_cookie_verify_fct_##A = 0; \
+static int my_cookie_verify_##A(void* a, void* b, uint32_t c) \
+{ \
+ return (int)RunFunctionFmt(my_cookie_verify_fct_##A, "ppu", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_cookie_verify_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_cookie_verify_fct_##A == (uintptr_t)fct) return my_cookie_verify_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_cookie_verify_fct_##A == 0) {my_cookie_verify_fct_##A = (uintptr_t)fct; return my_cookie_verify_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL cookie_verify callback\n");
+ return NULL;
+}
+
+// alpn_select
+#define GO(A) \
+static uintptr_t my_alpn_select_fct_##A = 0; \
+static int my_alpn_select_##A(void* a, void* b, void* c, void* d, uint32_t e, void* f) \
+{ \
+ return (int)RunFunctionFmt(my_alpn_select_fct_##A, "ppppup", a, b, c, d, e, f); \
+}
+SUPER()
+#undef GO
+static void* find_alpn_select_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my_alpn_select_fct_##A == (uintptr_t)fct) return my_alpn_select_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_alpn_select_fct_##A == 0) {my_alpn_select_fct_##A = (uintptr_t)fct; return my_alpn_select_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL alpn_select callback\n");
+ return NULL;
+}
+
#undef SUPER
EXPORT void my_SSL_CTX_set_default_passwd_cb(x64emu_t* emu, void* ctx, void* cb)
@@ -305,6 +454,24 @@ EXPORT void my_SSL_set_psk_client_callback(x64emu_t* emu, void* ctx, void* cb)
my->SSL_set_psk_client_callback(ctx, find_client_cb_Fct(cb));
}
+EXPORT void my_SSL_set_psk_server_callback(x64emu_t* emu, void* ctx, void* cb)
+{
+ (void)emu;
+ my->SSL_set_psk_server_callback(ctx, find_client_cb_Fct(cb));
+}
+
+EXPORT void my_SSL_set_psk_use_session_callback(x64emu_t* emu, void* ctx, void* cb)
+{
+ (void)emu;
+ my->SSL_set_psk_use_session_callback(ctx, find_use_session_cb_Fct(cb));
+}
+
+EXPORT void my_SSL_CTX_sess_set_new_cb(x64emu_t* emu, void* ctx, void* cb)
+{
+ (void)emu;
+ my->SSL_CTX_sess_set_new_cb(ctx, find_sess_Fct(cb));
+}
+
EXPORT void my_SSL_CTX_set_next_proto_select_cb(x64emu_t* emu, void* ctx, void* cb, void* arg)
{
(void)emu;
@@ -329,6 +496,24 @@ EXPORT void my_SSL_CTX_set_client_cert_cb(x64emu_t* emu, void* ctx, void* cb)
my->SSL_CTX_set_client_cert_cb(ctx, find_client_cert_Fct(cb));
}
+EXPORT void my_SSL_CTX_set_cookie_generate_cb(x64emu_t* emu, void* ctx, void* cb)
+{
+ (void)emu;
+ my->SSL_CTX_set_cookie_generate_cb(ctx, find_cookie_generate_Fct(cb));
+}
+
+EXPORT void my_SSL_CTX_set_cookie_verify_cb(x64emu_t* emu, void* ctx, void* cb)
+{
+ (void)emu;
+ my->SSL_CTX_set_cookie_verify_cb(ctx, find_cookie_verify_Fct(cb));
+}
+
+EXPORT void my_SSL_CTX_set_alpn_select_cb(x64emu_t* emu, void* ctx, void* f ,void* arg)
+{
+ (void)emu;
+ my->SSL_CTX_set_alpn_select_cb(ctx, find_alpn_select_Fct(f), arg);
+}
+
#define CUSTOM_INIT \
getMy(lib); \
setNeededLibs(lib, 2, "libcrypto.so.1.1", "libpthread.so.0");
diff --git a/src/wrapped/wrappedlibssl3.c b/src/wrapped/wrappedlibssl3.c
new file mode 100644
index 0000000..23d2e3b
--- /dev/null
+++ b/src/wrapped/wrappedlibssl3.c
@@ -0,0 +1,367 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+
+const char* libssl3Name = "libssl.so.3";
+#define LIBNAME libssl3
+
+#include "generated/wrappedlibssl3types.h"
+
+#include "wrappercallback.h"
+
+// utility functions
+#define SUPER() \
+GO(0) \
+GO(1) \
+GO(2) \
+GO(3) \
+GO(4)
+
+// pem_passwd_cb
+#define GO(A) \
+static uintptr_t my3_pem_passwd_cb_fct_##A = 0; \
+static int my3_pem_passwd_cb_##A(void* buf, int size, int rwflag, void* password) \
+{ \
+ return (int)RunFunctionFmt(my3_pem_passwd_cb_fct_##A, "piip", buf, size, rwflag, password); \
+}
+SUPER()
+#undef GO
+static void* find_pem_passwd_cb_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_pem_passwd_cb_fct_##A == (uintptr_t)fct) return my3_pem_passwd_cb_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_pem_passwd_cb_fct_##A == 0) {my3_pem_passwd_cb_fct_##A = (uintptr_t)fct; return my3_pem_passwd_cb_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL pem_passwd_cb callback\n");
+ return NULL;
+}
+
+// anonymous
+#define GO(A) \
+static uintptr_t my3_anonymous_fct_##A = 0; \
+static void* my3_anonymous_##A(void* a, void* b, void* c, void *d) \
+{ \
+ return (void*)RunFunctionFmt(my3_anonymous_fct_##A, "pppp", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_anonymous_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_anonymous_fct_##A == (uintptr_t)fct) return my3_anonymous_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_anonymous_fct_##A == 0) {my3_anonymous_fct_##A = (uintptr_t)fct; return my3_anonymous_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL anonymous callback\n");
+ return NULL;
+}
+
+
+// verify
+#define GO(A) \
+static uintptr_t my3_verify_fct_##A = 0; \
+static int my3_verify_##A(int a, void* b) \
+{ \
+ return (int)RunFunctionFmt(my3_verify_fct_##A, "ip", a, b); \
+}
+SUPER()
+#undef GO
+static void* find_verify_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_verify_fct_##A == (uintptr_t)fct) return my3_verify_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_verify_fct_##A == 0) {my3_verify_fct_##A = (uintptr_t)fct; return my3_verify_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL verify callback\n");
+ return NULL;
+}
+static void* reverse_verify_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my3_verify_##A == fct) return (void*)my3_verify_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, iFip, fct, 0, NULL);
+}
+
+// ex_new
+#define GO(A) \
+static uintptr_t my3_ex_new_fct_##A = 0; \
+static void my3_ex_new_##A(void* parent, void* ptr, void* ad, int idx, long argl, void* argp) \
+{ \
+ RunFunctionFmt(my3_ex_new_fct_##A, "pppilp", parent, ptr, ad, idx, argl, argp); \
+}
+SUPER()
+#undef GO
+static void* find_ex_new_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_ex_new_fct_##A == (uintptr_t)fct) return my3_ex_new_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_ex_new_fct_##A == 0) {my3_ex_new_fct_##A = (uintptr_t)fct; return my3_ex_new_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL ex_new callback\n");
+ return NULL;
+}
+
+// ex_free
+#define GO(A) \
+static uintptr_t my3_ex_free_fct_##A = 0; \
+static void my3_ex_free_##A(void* parent, void* ptr, void* ad, int idx, long argl, void* argp) \
+{ \
+ RunFunctionFmt(my3_ex_free_fct_##A, "pppilp", parent, ptr, ad, idx, argl, argp); \
+}
+SUPER()
+#undef GO
+static void* find_ex_free_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_ex_free_fct_##A == (uintptr_t)fct) return my3_ex_free_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_ex_free_fct_##A == 0) {my3_ex_free_fct_##A = (uintptr_t)fct; return my3_ex_free_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL ex_free callback\n");
+ return NULL;
+}
+
+// ex_dup
+#define GO(A) \
+static uintptr_t my3_ex_dup_fct_##A = 0; \
+static int my3_ex_dup_##A(void* to, void* from, void* from_d, int idx, long argl, void* argp) \
+{ \
+ return (int) RunFunctionFmt(my3_ex_dup_fct_##A, "pppilp", to, from, from_d, idx, argl, argp); \
+}
+SUPER()
+#undef GO
+static void* find_ex_dup_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_ex_dup_fct_##A == (uintptr_t)fct) return my3_ex_dup_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_ex_dup_fct_##A == 0) {my3_ex_dup_fct_##A = (uintptr_t)fct; return my3_ex_dup_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL ex_dup callback\n");
+ return NULL;
+}
+
+// client_cb
+#define GO(A) \
+static uintptr_t my3_client_cb_fct_##A = 0; \
+static uint32_t my3_client_cb_##A(void* ssl, void* hint, void* identity, uint32_t id_len, void* psk, uint32_t psk_len) \
+{ \
+ return RunFunctionFmt(my3_client_cb_fct_##A, "pppupu", ssl, hint, identity, id_len, psk, psk_len); \
+}
+SUPER()
+#undef GO
+static void* find_client_cb_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_client_cb_fct_##A == (uintptr_t)fct) return my3_client_cb_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_client_cb_fct_##A == 0) {my3_client_cb_fct_##A = (uintptr_t)fct; return my3_client_cb_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL client_cb callback\n");
+ return NULL;
+}
+
+// proto_select
+#define GO(A) \
+static uintptr_t my3_proto_select_fct_##A = 0; \
+static int my3_proto_select_##A(void* s, void* out, void* outlen, void* in, uint32_t inlen, void* arg) \
+{ \
+ return (int)RunFunctionFmt(my3_proto_select_fct_##A, "ppppup", s, out, outlen, in, inlen, arg); \
+}
+SUPER()
+#undef GO
+static void* find_proto_select_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_proto_select_fct_##A == (uintptr_t)fct) return my3_proto_select_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_proto_select_fct_##A == 0) {my3_proto_select_fct_##A = (uintptr_t)fct; return my3_proto_select_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL proto_select callback\n");
+ return NULL;
+}
+
+// client_cert
+#define GO(A) \
+static uintptr_t my3_client_cert_fct_##A = 0; \
+static int my3_client_cert_##A(void* a, void* b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my3_client_cert_fct_##A, "ppp", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_client_cert_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_client_cert_fct_##A == (uintptr_t)fct) return my3_client_cert_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_client_cert_fct_##A == 0) {my3_client_cert_fct_##A = (uintptr_t)fct; return my3_client_cert_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL client_cert callback\n");
+ return NULL;
+}
+
+// alpn_select_cb
+#define GO(A) \
+static uintptr_t my3_alpn_select_cb_fct_##A = 0; \
+static int my3_alpn_select_cb_##A(void* a, void* b, void* c, void* d, uint32_t e, void* f) \
+{ \
+ return (int)RunFunctionFmt(my3_alpn_select_cb_fct_##A, "ppppup", a, b, c, d, e, f); \
+}
+SUPER()
+#undef GO
+static void* find_alpn_select_cb_Fct(void* fct)
+{
+ if(!fct) return NULL;
+ void* p;
+ if((p = GetNativeFnc((uintptr_t)fct))) return p;
+ #define GO(A) if(my3_alpn_select_cb_fct_##A == (uintptr_t)fct) return my3_alpn_select_cb_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my3_alpn_select_cb_fct_##A == 0) {my3_alpn_select_cb_fct_##A = (uintptr_t)fct; return my3_alpn_select_cb_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libSSL alpn_select_cb callback\n");
+ return NULL;
+}
+
+#undef SUPER
+
+EXPORT void my3_SSL_CTX_set_default_passwd_cb(x64emu_t* emu, void* ctx, void* cb)
+{
+ (void)emu;
+ my->SSL_CTX_set_default_passwd_cb(ctx, find_pem_passwd_cb_Fct(cb));
+}
+
+EXPORT long my3_SSL_CTX_callback_ctrl(x64emu_t* emu, void* ctx, int cmd, void* f)
+{
+ (void)emu;
+ return my->SSL_CTX_callback_ctrl(ctx, cmd, find_anonymous_Fct(f));
+}
+
+EXPORT long my3_SSL_callback_ctrl(x64emu_t* emu, void* ctx, int cmd, void* f)
+{
+ (void)emu;
+ return my->SSL_callback_ctrl(ctx, cmd, find_anonymous_Fct(f));
+}
+
+EXPORT void my3_SSL_CTX_set_verify(x64emu_t* emu, void* ctx, int mode, void* f)
+{
+ (void)emu;
+ my->SSL_CTX_set_verify(ctx, mode, find_verify_Fct(f));
+}
+
+EXPORT void my3_SSL_set_verify(x64emu_t* emu, void* ctx, int mode, void* f)
+{
+ (void)emu;
+ my->SSL_set_verify(ctx, mode, find_verify_Fct(f));
+}
+
+EXPORT void my3_SSL_get_ex_new_index(x64emu_t* emu, long argl, void* argp, void* new_func, void* dup_func, void* free_func)
+{
+ (void)emu;
+ my->SSL_get_ex_new_index(argl, argp, find_ex_new_Fct(new_func), find_ex_dup_Fct(dup_func), find_ex_free_Fct(free_func));
+}
+
+EXPORT void my3_SSL_set_psk_client_callback(x64emu_t* emu, void* ctx, void* cb)
+{
+ (void)emu;
+ my->SSL_set_psk_client_callback(ctx, find_client_cb_Fct(cb));
+}
+
+EXPORT void my3_SSL_CTX_set_next_proto_select_cb(x64emu_t* emu, void* ctx, void* cb, void* arg)
+{
+ (void)emu;
+ my->SSL_CTX_set_next_proto_select_cb(ctx, find_proto_select_Fct(cb), arg);
+}
+
+EXPORT void* my3_SSL_get_verify_callback(x64emu_t* emu, void* ctx)
+{
+ (void)emu;
+ return reverse_verify_Fct(my->SSL_get_verify_callback(ctx));
+}
+
+EXPORT void my3_SSL_CTX_set_cert_verify_callback(x64emu_t* emu, void* ctx, void* cb, void* arg)
+{
+ (void)emu;
+ my->SSL_CTX_set_cert_verify_callback(ctx, find_verify_Fct(cb), arg);
+}
+
+EXPORT void my3_SSL_CTX_set_client_cert_cb(x64emu_t* emu, void* ctx, void* cb)
+{
+ (void)emu;
+ my->SSL_CTX_set_client_cert_cb(ctx, find_client_cert_Fct(cb));
+}
+
+EXPORT void my3_SSL_CTX_set_alpn_select_cb(x64emu_t* emu, void* ctx, void* f, void* arg)
+{
+ my->SSL_CTX_set_alpn_select_cb(ctx, find_alpn_select_cb_Fct(f), arg);
+}
+
+#define CUSTOM_INIT \
+ SETALT(my3_); \
+ getMy(lib); \
+ setNeededLibs(lib, 2, "libcrypto.so.3", "libpthread.so.0");
+
+#define CUSTOM_FINI \
+ freeMy();
+
+#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedlibssl3_private.h b/src/wrapped/wrappedlibssl3_private.h
new file mode 100644
index 0000000..e9ff941
--- /dev/null
+++ b/src/wrapped/wrappedlibssl3_private.h
@@ -0,0 +1,605 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error meh!
+#endif
+
+//GO(BIO_f_ssl,
+//GO(BIO_new_buffer_ssl_connect,
+//GO(BIO_new_ssl,
+//GO(BIO_new_ssl_connect,
+//GO(BIO_ssl_copy_session_id,
+//GO(BIO_ssl_shutdown,
+//GO(custom_ext_add,
+//GO(custom_ext_init,
+//GO(custom_ext_parse,
+//GO(custom_exts_copy,
+//GO(custom_exts_free,
+GO(d2i_SSL_SESSION, pFppl)
+//GO(do_dtls1_write,
+//GO(dtls1_accept,
+//GO(dtls1_buffer_message,
+//GO(dtls1_check_timeout_num,
+//GO(dtls1_clear,
+//GO(dtls1_clear_received_buffer,
+//GO(dtls1_clear_sent_buffer,
+//GO(dtls1_connect,
+//GO(dtls1_ctrl,
+//GO(dtls1_default_timeout,
+//GO(dtls1_dispatch_alert,
+//GO(dtls1_double_timeout,
+//GO(dtls1_do_write,
+//GO(dtls1_free,
+//GO(dtls1_get_ccs_header,
+//GO(dtls1_get_cipher,
+//GO(dtls1_get_message,
+//GO(dtls1_get_message_header,
+//GO(dtls1_get_queue_priority,
+//GO(dtls1_get_record,
+//GO(dtls1_get_timeout,
+//GO(dtls1_handle_timeout,
+//GO(dtls1_heartbeat,
+//GO(dtls1_hm_fragment_free,
+//GO(dtls1_is_timer_expired,
+//GO(dtls1_link_min_mtu,
+//GO(dtls1_listen,
+//GO(dtls1_min_mtu,
+//GO(dtls1_new,
+//GO(dtls1_process_heartbeat,
+//GO(dtls1_read_bytes,
+//GO(dtls1_read_failed,
+//GO(dtls1_reset_seq_numbers,
+//GO(dtls1_retransmit_buffered_messages,
+//GO(dtls1_retransmit_message,
+//GO(dtls1_send_change_cipher_spec,
+//GO(dtls1_set_message_header,
+//GO(dtls1_shutdown,
+//GO(dtls1_start_timer,
+//GO(dtls1_stop_timer,
+//GO(dtls1_write_app_data_bytes,
+//GO(dtls1_write_bytes,
+//GO(DTLS_client_method,
+GO(DTLS_method, pFv)
+GO(DTLS_server_method, pFv)
+GO(DTLSv1_2_client_method, pFv)
+GO(DTLSv1_2_method, pFv)
+GO(DTLSv1_2_server_method, pFv)
+GO(DTLSv1_client_method, pFv)
+GO(DTLSv1_method, pFv)
+GO(DTLSv1_server_method, pFv)
+//GO(ERR_load_SSL_strings,
+//GO(_fini,
+GO(i2d_SSL_SESSION, iFpp)
+//GO(_init,
+//GO(n_ssl3_mac,
+//GO(OBJ_bsearch_ssl_cipher_id,
+GO(OPENSSL_init_ssl, iFUp)
+//GO(PEM_read_bio_SSL_SESSION,
+//GO(PEM_read_SSL_SESSION,
+//GO(PEM_write_bio_SSL_SESSION,
+//GO(PEM_write_SSL_SESSION,
+//GO(SRP_Calc_A_param,
+//GO(SRP_generate_client_master_secret,
+//GO(SRP_generate_server_master_secret,
+//GO(srp_verify_server_param,
+//GO(ssl23_accept,
+//GO(ssl23_connect,
+//GO(ssl23_default_timeout,
+//GO(ssl23_get_cipher,
+//GO(ssl23_get_cipher_by_char,
+//GO(ssl23_get_client_hello,
+//GO(ssl23_num_ciphers,
+//GO(ssl23_peek,
+//GO(ssl23_put_cipher_by_char,
+//GO(ssl23_read,
+//GO(ssl23_read_bytes,
+//GO(ssl23_write,
+//GO(ssl23_write_bytes,
+//GO(ssl3_accept,
+//GO(ssl3_alert_code,
+//GO(ssl3_callback_ctrl,
+//GO(ssl3_cbc_copy_mac,
+//GO(ssl3_cbc_digest_record,
+//GO(ssl3_cbc_record_digest_supported,
+//GO(ssl3_cbc_remove_padding,
+//GO(ssl3_cert_verify_mac,
+//GO(ssl3_change_cipher_state,
+//GO(ssl3_check_cert_and_algorithm,
+//GO(ssl3_choose_cipher,
+//GO(ssl3_cleanup_key_block,
+//GO(ssl3_clear,
+//GO(ssl3_client_hello,
+//GO(ssl3_comp_find,
+//GO(ssl3_connect,
+//GO(ssl3_ctrl,
+//GO(ssl3_ctx_callback_ctrl,
+//GO(ssl3_ctx_ctrl,
+//GO(ssl3_default_timeout,
+//GO(ssl3_digest_cached_records,
+//GO(ssl3_dispatch_alert,
+//GO(ssl3_do_change_cipher_spec,
+//GO(ssl3_do_compress,
+//GO(ssl3_do_uncompress,
+//GO(ssl3_do_write,
+//GO(ssl3_enc,
+//GO(ssl3_final_finish_mac,
+//GO(ssl3_finish_mac,
+//GO(ssl3_free,
+//GO(ssl3_free_digest_list,
+//GO(ssl3_generate_master_secret,
+//GO(ssl3_get_certificate_request,
+//GO(ssl3_get_cert_status,
+//GO(ssl3_get_cert_verify,
+//GO(ssl3_get_cipher,
+//GO(ssl3_get_cipher_by_char,
+//GO(ssl3_get_client_certificate,
+//GO(ssl3_get_client_hello,
+//GO(ssl3_get_client_key_exchange,
+//GO(ssl3_get_finished,
+//GO(ssl3_get_key_exchange,
+//GO(ssl3_get_message,
+//GO(ssl3_get_new_session_ticket,
+//GO(ssl3_get_next_proto,
+//GO(ssl3_get_req_cert_type,
+//GO(ssl3_get_server_certificate,
+//GO(ssl3_get_server_done,
+//GO(ssl3_get_server_hello,
+//GO(ssl3_handshake_write,
+//GO(ssl3_init_finished_mac,
+//GO(ssl3_new,
+//GO(ssl3_num_ciphers,
+//GO(ssl3_output_cert_chain,
+//GO(ssl3_peek,
+//GO(ssl3_pending,
+//GO(ssl3_put_cipher_by_char,
+//GO(ssl3_read,
+//GO(ssl3_read_bytes,
+//GO(ssl3_read_n,
+//GO(ssl3_record_sequence_update,
+//GO(ssl3_release_read_buffer,
+//GO(ssl3_release_write_buffer,
+//GO(ssl3_renegotiate,
+//GO(ssl3_renegotiate_check,
+//GO(ssl3_send_alert,
+//GO(ssl3_send_certificate_request,
+//GO(ssl3_send_cert_status,
+//GO(ssl3_send_change_cipher_spec,
+//GO(ssl3_send_client_certificate,
+//GO(ssl3_send_client_key_exchange,
+//GO(ssl3_send_client_verify,
+//GO(ssl3_send_finished,
+//GO(ssl3_send_hello_request,
+//GO(ssl3_send_newsession_ticket,
+//GO(ssl3_send_next_proto,
+//GO(ssl3_send_server_certificate,
+//GO(ssl3_send_server_done,
+//GO(ssl3_send_server_hello,
+//GO(ssl3_send_server_key_exchange,
+//GO(ssl3_set_handshake_header,
+//GO(ssl3_setup_buffers,
+//GO(ssl3_setup_key_block,
+//GO(ssl3_setup_read_buffer,
+//GO(ssl3_setup_write_buffer,
+//GO(ssl3_shutdown,
+//GO(ssl3_write,
+//GO(ssl3_write_bytes,
+//GO(ssl3_write_pending,
+GO(SSL_accept, iFp)
+//GO(ssl_add_cert_chain,
+GO(SSL_add_client_CA, iFpp)
+//GO(ssl_add_clienthello_renegotiate_ext,
+//GO(ssl_add_clienthello_tlsext,
+//GO(ssl_add_clienthello_use_srtp_ext,
+//GO(SSL_add_dir_cert_subjects_to_stack,
+//GO(SSL_add_file_cert_subjects_to_stack,
+//GO(ssl_add_serverhello_renegotiate_ext,
+//GO(ssl_add_serverhello_tlsext,
+//GO(ssl_add_serverhello_use_srtp_ext,
+//GO(SSL_alert_desc_string,
+//GO(SSL_alert_desc_string_long,
+//GO(SSL_alert_type_string,
+//GO(SSL_alert_type_string_long,
+//GO(ssl_bad_method,
+//GO(ssl_build_cert_chain,
+//GO(ssl_bytes_to_cipher_list,
+//GO(SSL_cache_hit,
+GOM(SSL_callback_ctrl, lFEpip)
+//GO(ssl_cert_add0_chain_cert,
+//GO(ssl_cert_add1_chain_cert,
+//GO(ssl_cert_clear_certs,
+//GO(ssl_cert_dup,
+//GO(ssl_cert_free,
+//GO(ssl_cert_inst,
+//GO(ssl_cert_new,
+//GO(SSL_certs_clear,
+//GO(ssl_cert_select_current,
+//GO(ssl_cert_set0_chain,
+//GO(ssl_cert_set1_chain,
+//GO(ssl_cert_set_cert_cb,
+//GO(ssl_cert_set_cert_store,
+//GO(ssl_cert_set_current,
+//GO(ssl_cert_set_default_md,
+//GO(ssl_cert_type,
+//GO(SSL_check_chain,
+//GO(ssl_check_clienthello_tlsext_late,
+GO(SSL_check_private_key, iFp)
+//GO(ssl_check_serverhello_tlsext,
+//GO(ssl_check_srvr_ecc_cert_and_alg,
+GO(SSL_CIPHER_description, pFppi)
+GO(SSL_CIPHER_find, pFpp)
+GO(SSL_CIPHER_get_bits, iFpp)
+//GO(ssl_cipher_get_cert_index,
+//GO(ssl_cipher_get_evp,
+GO(SSL_CIPHER_get_id, uFp)
+GO(SSL_CIPHER_get_name, pFp)
+GO(SSL_CIPHER_get_version, pFp)
+//GO(ssl_cipher_id_cmp,
+//GO(ssl_cipher_list_to_bytes,
+//GO(ssl_cipher_ptr_id_cmp,
+GO(SSL_clear, iFp)
+//GO(ssl_clear_bad_session,
+//GO(ssl_clear_cipher_ctx,
+//GO(ssl_clear_hash_ctx,
+//GO(SSL_COMP_add_compression_method,
+//GO(SSL_COMP_free_compression_methods,
+//GO(SSL_COMP_get_compression_methods,
+//GO(SSL_COMP_get_name,
+//GO(SSL_COMP_set0_compression_methods,
+//GO(SSL_CONF_cmd,
+//GO(SSL_CONF_cmd_argv,
+//GO(SSL_CONF_cmd_value_type,
+//GO(SSL_CONF_CTX_clear_flags,
+//GO(SSL_CONF_CTX_finish,
+//GO(SSL_CONF_CTX_free,
+//GO(SSL_CONF_CTX_new,
+//GO(SSL_CONF_CTX_set1_prefix,
+//GO(SSL_CONF_CTX_set_flags,
+//GO(SSL_CONF_CTX_set_ssl,
+//GO(SSL_CONF_CTX_set_ssl_ctx,
+GO(SSL_connect, iFp)
+//GO(SSL_copy_session_id,
+//GO(ssl_create_cipher_list,
+GO(SSL_ctrl, lFpilp)
+GO(SSL_CTX_add_client_CA, iFpp)
+//GO(SSL_CTX_add_client_custom_ext,
+//GO(SSL_CTX_add_server_custom_ext,
+//GO(SSL_CTX_add_session,
+GOM(SSL_CTX_callback_ctrl, lFEpip)
+GO(SSL_CTX_check_private_key, iFp)
+GO(SSL_CTX_config, iFpp)
+GO(SSL_CTX_ctrl, lFpilp)
+//GO(SSL_CTX_flush_sessions,
+GO(SSL_CTX_free, vFp)
+//GO(SSL_CTX_get0_certificate,
+//GO(SSL_CTX_get0_param,
+//GO(SSL_CTX_get0_privatekey,
+GO(SSL_CTX_get_cert_store, pFp)
+//GO(SSL_CTX_get_client_CA_list,
+//GO(SSL_CTX_get_client_cert_cb,
+GO(SSL_CTX_get_default_passwd_cb_userdata, pFp)
+GO(SSL_CTX_get_ex_data, pFpi)
+//GO(SSL_CTX_get_ex_new_index,
+//GO(SSL_CTX_get_info_callback,
+//GO(SSL_CTX_get_quiet_shutdown,
+//GO(SSL_CTX_get_ssl_method,
+//GO(SSL_CTX_get_timeout,
+//GO(SSL_CTX_get_verify_callback,
+//GO(SSL_CTX_get_verify_depth,
+//GO(SSL_CTX_get_verify_mode,
+GO(SSL_CTX_load_verify_locations, iFppp)
+GO(SSL_CTX_new, pFp)
+//GO(SSL_CTX_remove_session,
+//GO(SSL_CTX_sess_get_get_cb,
+//GO(SSL_CTX_sess_get_new_cb,
+//GO(SSL_CTX_sess_get_remove_cb,
+//GO(SSL_CTX_sessions,
+//GO(SSL_CTX_sess_set_get_cb,
+//GO(SSL_CTX_sess_set_new_cb,
+//GO(SSL_CTX_sess_set_remove_cb,
+//GO(SSL_CTX_set1_param,
+GO(SSL_CTX_set_alpn_protos, iFppu)
+GOM(SSL_CTX_set_alpn_select_cb, vFEppp)
+//GO(SSL_CTX_set_cert_cb,
+GO(SSL_CTX_set_cert_store, vFpp)
+GOM(SSL_CTX_set_cert_verify_callback, vFEppp)
+GO(SSL_CTX_set_ciphersuites, iFpp)
+GO(SSL_CTX_set_cipher_list, iFpp)
+GO(SSL_CTX_set_client_CA_list, vFpp)
+GOM(SSL_CTX_set_client_cert_cb, vFEpp)
+//GO(SSL_CTX_set_client_cert_engine,
+//GO(SSL_CTX_set_cookie_generate_cb,
+//GO(SSL_CTX_set_cookie_verify_cb,
+GOM(SSL_CTX_set_default_passwd_cb, vFEpp)
+GO(SSL_CTX_set_default_passwd_cb_userdata, vFpp)
+GO(SSL_CTX_set_default_verify_paths, iFp)
+//GO(SSL_CTX_set_ex_data,
+//GO(SSL_CTX_set_generate_session_id,
+//GO(SSL_CTX_set_info_callback,
+//GO(SSL_CTX_set_msg_callback,
+//GO(SSL_CTX_set_next_protos_advertised_cb,
+GOM(SSL_CTX_set_next_proto_select_cb, vFEppp)
+GO(SSL_CTX_set_options, lFpl)
+//GO(SSL_CTX_set_psk_client_callback,
+//GO(SSL_CTX_set_psk_server_callback,
+//GO(SSL_CTX_set_purpose,
+GO(SSL_CTX_set_quiet_shutdown, vFpi)
+GO(SSL_CTX_set_security_level, vFpi)
+//GO(SSL_CTX_set_session_id_context,
+//GO(SSL_CTX_set_srp_cb_arg,
+//GO(SSL_CTX_set_srp_client_pwd_callback,
+//GO(SSL_CTX_set_srp_password,
+//GO(SSL_CTX_set_srp_strength,
+//GO(SSL_CTX_set_srp_username,
+//GO(SSL_CTX_set_srp_username_callback,
+//GO(SSL_CTX_set_srp_verify_param_callback,
+//GO(SSL_CTX_set_ssl_version,
+//GO(SSL_CTX_set_timeout,
+//GO(SSL_CTX_set_tlsext_use_srtp,
+//GO(SSL_CTX_set_tmp_dh_callback,
+//GO(SSL_CTX_set_tmp_ecdh_callback,
+//GO(SSL_CTX_set_tmp_rsa_callback,
+//GO(SSL_CTX_set_trust,
+GOM(SSL_CTX_set_verify, vFEpip)
+GO(SSL_CTX_set_verify_depth, vFpi)
+//GO(SSL_CTX_SRP_CTX_free,
+//GO(SSL_CTX_SRP_CTX_init,
+GO(SSL_CTX_use_certificate, iFpp)
+GO(SSL_CTX_use_certificate_ASN1, iFpip)
+GO(SSL_CTX_use_certificate_chain_file, iFpp)
+GO(SSL_CTX_use_certificate_file, iFppi)
+GO(SSL_CTX_use_PrivateKey, iFpp)
+GO(SSL_CTX_use_PrivateKey_ASN1, iFuppi)
+GO(SSL_CTX_use_PrivateKey_file, iFppi)
+//GO(SSL_CTX_use_psk_identity_hint,
+GO(SSL_CTX_use_RSAPrivateKey, iFpp)
+GO(SSL_CTX_use_RSAPrivateKey_ASN1, iFppl)
+GO(SSL_CTX_use_RSAPrivateKey_file, iFppi)
+//GO(SSL_CTX_use_serverinfo,
+//GO(SSL_CTX_use_serverinfo_file,
+//GO(ssl_do_client_cert_cb,
+GO(SSL_do_handshake, iFp)
+//GO(SSL_dup,
+//GO(SSL_dup_CA_list,
+//GO(SSL_export_keying_material,
+//GO(SSL_extension_supported,
+//GO(ssl_fill_hello_random,
+GO(SSL_free, vFp)
+//GO(ssl_free_wbio_buffer,
+GO(SSL_get0_alpn_selected, iFppp)
+GO(SSL_get0_next_proto_negotiated, vFppp)
+//GO(SSL_get0_param,
+GO(SSL_get0_peer_certificate, pFp)
+GO(SSL_get0_session, pFp)
+GO(SSL_get1_peer_certificate, pFp)
+GO(SSL_get1_session, pFp)
+//GO(ssl_get_algorithm2,
+GO(SSL_get_certificate, pFp)
+//GO(ssl_get_cipher_by_char,
+//GO(SSL_get_cipher_list,
+GO(SSL_get_ciphers, pFp)
+//GO(ssl_get_ciphers_by_id,
+GO(SSL_get_client_CA_list, pFp)
+GO(SSL_get_current_cipher, pFp)
+//GO(SSL_get_current_compression,
+//GO(SSL_get_current_expansion,
+//GO(SSL_get_default_timeout,
+GO(SSL_get_error, iFpi)
+GO(SSL_get_ex_data, pFpi)
+GO(SSL_get_ex_data_X509_STORE_CTX_idx, iFv)
+GOM(SSL_get_ex_new_index, iFElpppp)
+//GO(SSL_get_fd,
+GO(SSL_get_finished, LFppL)
+//GO(ssl_get_handshake_digest,
+//GO(SSL_get_info_callback,
+//GO(ssl_get_new_session,
+GO(SSL_get_peer_cert_chain, pFp)
+GO(SSL_get_peer_finished, LFppL)
+//GO(ssl_get_prev_session,
+GO(SSL_get_privatekey, pFp)
+//GO(SSL_get_psk_identity,
+//GO(SSL_get_psk_identity_hint,
+//GO(SSL_get_quiet_shutdown,
+//GO(SSL_get_rbio,
+//GO(SSL_get_read_ahead,
+//GO(SSL_get_rfd,
+//GO(SSL_get_selected_srtp_profile,
+//GO(ssl_get_server_cert_serverinfo,
+//GO(SSL_get_servername,
+//GO(SSL_get_servername_type,
+//GO(ssl_get_server_send_pkey,
+GO(SSL_get_session, pFp)
+//GO(SSL_get_shared_ciphers,
+//GO(SSL_get_shared_sigalgs,
+GO(SSL_get_shutdown, iFp)
+//GO(SSL_get_sigalgs,
+//GO(ssl_get_sign_pkey,
+//GO(SSL_get_srp_g,
+//GO(SSL_get_srp_N,
+//GO(SSL_get_srp_userinfo,
+//GO(SSL_get_srp_username,
+//GO(SSL_get_srtp_profiles,
+GO(SSL_get_SSL_CTX, pFp)
+//GO(SSL_get_ssl_method,
+GOM(SSL_get_verify_callback, pFEp)
+GO(SSL_get_verify_depth, iFp)
+GO(SSL_get_verify_mode, iFp)
+GO(SSL_get_verify_result, iFp)
+GO(SSL_get_version, pFp)
+//GO(SSL_get_wbio,
+//GO(SSL_get_wfd,
+//GO(SSL_has_matching_session_id,
+//GO(ssl_init_wbio_buffer,
+GO(SSL_is_init_finished, iFp)
+GO(SSL_is_server, iFp)
+GO(SSL_library_init, iFv)
+//GO(ssl_load_ciphers,
+//GO(SSL_load_client_CA_file,
+GO(SSL_load_error_strings, vFv)
+GO(SSL_new, pFp)
+//GO(ssl_ok,
+//GO(ssl_parse_clienthello_renegotiate_ext,
+//GO(ssl_parse_clienthello_tlsext,
+//GO(ssl_parse_clienthello_use_srtp_ext,
+//GO(ssl_parse_serverhello_renegotiate_ext,
+//GO(ssl_parse_serverhello_tlsext,
+//GO(ssl_parse_serverhello_use_srtp_ext,
+GO(SSL_peek, iFppi)
+GO(SSL_pending, iFp)
+//GO(ssl_prepare_clienthello_tlsext,
+//GO(ssl_prepare_serverhello_tlsext,
+GO(SSL_read, iFppi)
+GO(SSL_renegotiate, iFp)
+GO(SSL_renegotiate_abbreviated, iFp)
+GO(SSL_renegotiate_pending, iFp)
+//GO(ssl_replace_hash,
+//GO(SSL_rstate_string,
+//GO(SSL_rstate_string_long,
+GO(SSL_select_next_proto, iFpppupu)
+//GO(ssl_sess_cert_free,
+//GO(ssl_sess_cert_new,
+GO(ssl_session_dup, pFp)
+GO(SSL_SESSION_dup, pFp)
+GO(SSL_SESSION_free, vFp)
+//GO(SSL_SESSION_get0_peer,
+//GO(SSL_SESSION_get_compress_id,
+//GO(SSL_SESSION_get_ex_data,
+//GO(SSL_SESSION_get_ex_new_index,
+//GO(SSL_SESSION_get_id,
+//GO(SSL_SESSION_get_time,
+//GO(SSL_SESSION_get_timeout,
+GO(SSL_SESSION_new, pFv)
+//GO(SSL_SESSION_print,
+//GO(SSL_SESSION_print_fp,
+GO(SSL_session_reused, iFp)
+//GO(SSL_SESSION_set1_id_context,
+//GO(SSL_SESSION_set_ex_data,
+//GO(SSL_SESSION_set_time,
+//GO(SSL_SESSION_set_timeout,
+GO(SSL_SESSION_up_ref, iFp)
+//GO(SSL_set1_param,
+GO(SSL_set_accept_state, vFp)
+//GO(SSL_set_alpn_protos,
+GO(SSL_set_bio, vFppp)
+//GO(SSL_set_cert_cb,
+//GO(ssl_set_cert_masks,
+GO(SSL_set_cipher_list, iFpp)
+GO(SSL_set_client_CA_list, vFpp)
+//GO(ssl_set_client_disabled,
+GO(SSL_set_connect_state, vFp)
+//GO(SSL_set_debug,
+GO(SSL_set_ex_data, iFpip)
+GO(SSL_set_fd, iFpi)
+//GO(SSL_set_generate_session_id,
+//GO(SSL_set_info_callback,
+//GO(SSL_set_msg_callback,
+GO(SSL_set_options, UFpU)
+//GO(ssl_set_peer_cert_type,
+GOM(SSL_set_psk_client_callback, vFEpp)
+//GO(SSL_set_psk_server_callback,
+//GO(SSL_set_purpose,
+GO(SSL_set_quiet_shutdown, vFpi)
+//GO(SSL_set_read_ahead,
+GO(SSL_set_rfd, iFpi)
+GO(SSL_set_session, iFpp)
+//GO(SSL_set_session_id_context,
+//GO(SSL_set_session_secret_cb,
+//GO(SSL_set_session_ticket_ext,
+//GO(SSL_set_session_ticket_ext_cb,
+GO(SSL_set_shutdown, iFp)
+//GO(SSL_set_srp_server_param,
+//GO(SSL_set_srp_server_param_pw,
+//GO(SSL_set_SSL_CTX,
+//GO(SSL_set_ssl_method,
+//GO(SSL_set_state,
+//GO(SSL_set_tlsext_use_srtp,
+//GO(SSL_set_tmp_dh_callback,
+//GO(SSL_set_tmp_ecdh_callback,
+//GO(SSL_set_tmp_rsa_callback,
+//GO(SSL_set_trust,
+GOM(SSL_set_verify, vFEpip)
+GO(SSL_set_verify_depth, vFpi)
+//GO(SSL_set_verify_result,
+GO(SSL_set_wfd, iFpi)
+GO(SSL_shutdown, iFp)
+//GO(SSL_SRP_CTX_free,
+//GO(SSL_SRP_CTX_init,
+//GO(SSL_srp_server_param_with_username,
+GO(SSL_state, iFp)
+//GO(SSL_state_string,
+//GO(SSL_state_string_long,
+//GO(ssl_undefined_const_function,
+//GO(ssl_undefined_function,
+//GO(ssl_undefined_void_function,
+//GO(ssl_update_cache,
+GO(SSL_use_certificate, iFpp)
+GO(SSL_use_certificate_ASN1, iFppi)
+GO(SSL_use_certificate_file, iFppi)
+GO(SSL_use_PrivateKey, iFpp)
+GO(SSL_use_PrivateKey_ASN1, iFppl)
+GO(SSL_use_PrivateKey_file, iFppi)
+//GO(SSL_use_psk_identity_hint,
+GO(SSL_use_RSAPrivateKey, iFpp)
+GO(SSL_use_RSAPrivateKey_ASN1, iFppl)
+GO(SSL_use_RSAPrivateKey_file, iFppi)
+GO(SSLv23_client_method, pFv)
+GO(SSLv23_method, pFv)
+GO(SSLv23_server_method, pFv)
+GO(SSLv2_client_method, pFv)
+GO(SSLv2_method, pFv)
+GO(SSLv2_server_method, pFv)
+GO(SSLv3_client_method, pFv)
+GO(SSLv3_method, pFv)
+GO(SSLv3_server_method, pFv)
+//GO(ssl_verify_alarm_type,
+//GO(ssl_verify_cert_chain,
+GO(SSL_version, iFp)
+//GO(SSL_want,
+GO(SSL_write, iFppi)
+//GO(tls12_check_peer_sigalg,
+//GO(tls12_get_hash,
+//GO(tls12_get_psigalgs,
+//GO(tls12_get_sigandhash,
+//GO(tls12_get_sigid,
+//GO(tls1_alert_code,
+//GO(tls1_cbc_remove_padding,
+//GO(tls1_cert_verify_mac,
+//GO(tls1_change_cipher_state,
+//GO(tls1_check_chain,
+//GO(tls1_check_curve,
+//GO(tls1_check_ec_tmp_key,
+//GO(tls1_clear,
+//GO(tls1_default_timeout,
+//GO(tls1_ec_curve_id2nid,
+//GO(tls1_ec_nid2curve_id,
+//GO(tls1_enc,
+//GO(tls1_export_keying_material,
+//GO(tls1_final_finish_mac,
+//GO(tls1_free,
+//GO(tls1_generate_master_secret,
+//GO(tls1_heartbeat,
+//GO(tls1_mac,
+//GO(tls1_new,
+//GO(tls1_process_heartbeat,
+//GO(tls1_process_sigalgs,
+//GO(tls1_process_ticket,
+//GO(tls1_save_sigalgs,
+//GO(tls1_set_cert_validity,
+//GO(tls1_set_curves,
+//GO(tls1_set_curves_list,
+//GO(tls1_set_server_sigalgs,
+//GO(tls1_set_sigalgs,
+//GO(tls1_set_sigalgs_list,
+//GO(tls1_setup_key_block,
+//GO(tls1_shared_curve,
+GO(TLS_method, pFv)
+GO(TLS_server_method, pFv)
+GO(TLS_client_method, pFv)
+GO(TLSv1_1_client_method, pFv)
+GO(TLSv1_1_method, pFv)
+GO(TLSv1_1_server_method, pFv)
+GO(TLSv1_2_client_method, pFv)
+GO(TLSv1_2_method, pFv)
+GO(TLSv1_2_server_method, pFv)
+GO(TLSv1_client_method, pFv)
+GO(TLSv1_method, pFv)
+GO(verify_callback, iFip)
+
+GO(TLSv1_server_method, pFv) // not always present in lib
diff --git a/src/wrapped/wrappedlibssl_private.h b/src/wrapped/wrappedlibssl_private.h
index 755854d..fa2a083 100755..100644
--- a/src/wrapped/wrappedlibssl_private.h
+++ b/src/wrapped/wrappedlibssl_private.h
@@ -56,13 +56,14 @@ GO(d2i_SSL_SESSION, pFppl)
//GO(dtls1_stop_timer,
//GO(dtls1_write_app_data_bytes,
//GO(dtls1_write_bytes,
-//GO(DTLS_client_method,
+GO(DTLS_client_method, pFv)
GO(DTLS_method, pFv)
GO(DTLS_server_method, pFv)
GO(DTLSv1_2_client_method, pFv)
GO(DTLSv1_2_method, pFv)
GO(DTLSv1_2_server_method, pFv)
GO(DTLSv1_client_method, pFv)
+GO(DTLSv1_listen, iFpp)
GO(DTLSv1_method, pFv)
GO(DTLSv1_server_method, pFv)
//GO(ERR_load_SSL_strings,
@@ -224,7 +225,7 @@ GO(SSL_check_private_key, iFp)
//GO(ssl_check_serverhello_tlsext,
//GO(ssl_check_srvr_ecc_cert_and_alg,
GO(SSL_CIPHER_description, pFppi)
-//GO(SSL_CIPHER_find,
+GO(SSL_CIPHER_find, pFpp)
GO(SSL_CIPHER_get_bits, iFpp)
//GO(ssl_cipher_get_cert_index,
//GO(ssl_cipher_get_evp,
@@ -243,17 +244,17 @@ GO(SSL_clear, iFp)
//GO(SSL_COMP_get_compression_methods,
//GO(SSL_COMP_get_name,
//GO(SSL_COMP_set0_compression_methods,
-//GO(SSL_CONF_cmd,
-//GO(SSL_CONF_cmd_argv,
-//GO(SSL_CONF_cmd_value_type,
+GO(SSL_CONF_cmd, iFppp)
+GO(SSL_CONF_cmd_argv, iFppp)
+GO(SSL_CONF_cmd_value_type, iFpp)
//GO(SSL_CONF_CTX_clear_flags,
-//GO(SSL_CONF_CTX_finish,
-//GO(SSL_CONF_CTX_free,
-//GO(SSL_CONF_CTX_new,
+GO(SSL_CONF_CTX_finish, iFp)
+GO(SSL_CONF_CTX_free, vFp)
+GO(SSL_CONF_CTX_new, pFv)
//GO(SSL_CONF_CTX_set1_prefix,
-//GO(SSL_CONF_CTX_set_flags,
+GO(SSL_CONF_CTX_set_flags, uFpu)
//GO(SSL_CONF_CTX_set_ssl,
-//GO(SSL_CONF_CTX_set_ssl_ctx,
+GO(SSL_CONF_CTX_set_ssl_ctx, vFpp)
GO(SSL_connect, iFp)
//GO(SSL_copy_session_id,
//GO(ssl_create_cipher_list,
@@ -264,6 +265,7 @@ GO(SSL_CTX_add_client_CA, iFpp)
//GO(SSL_CTX_add_session,
GOM(SSL_CTX_callback_ctrl, lFEpip)
GO(SSL_CTX_check_private_key, iFp)
+GO(SSL_CTX_config, iFpp)
GO(SSL_CTX_ctrl, lFpilp)
//GO(SSL_CTX_flush_sessions,
GO(SSL_CTX_free, vFp)
@@ -278,6 +280,7 @@ GO(SSL_CTX_get_ex_data, pFpi)
//GO(SSL_CTX_get_ex_new_index,
//GO(SSL_CTX_get_info_callback,
//GO(SSL_CTX_get_quiet_shutdown,
+GO(SSL_CTX_get_security_level, iFp)
//GO(SSL_CTX_get_ssl_method,
//GO(SSL_CTX_get_timeout,
//GO(SSL_CTX_get_verify_callback,
@@ -291,20 +294,21 @@ GO(SSL_CTX_new, pFp)
//GO(SSL_CTX_sess_get_remove_cb,
//GO(SSL_CTX_sessions,
//GO(SSL_CTX_sess_set_get_cb,
-//GO(SSL_CTX_sess_set_new_cb,
+GOM(SSL_CTX_sess_set_new_cb, vFEpp)
//GO(SSL_CTX_sess_set_remove_cb,
//GO(SSL_CTX_set1_param,
-//GO(SSL_CTX_set_alpn_protos,
-//GO(SSL_CTX_set_alpn_select_cb,
+GO(SSL_CTX_set_alpn_protos, iFppu)
+GOM(SSL_CTX_set_alpn_select_cb, vFEppp)
//GO(SSL_CTX_set_cert_cb,
GO(SSL_CTX_set_cert_store, vFpp)
GOM(SSL_CTX_set_cert_verify_callback, vFEppp)
GO(SSL_CTX_set_cipher_list, iFpp)
+GO(SSL_CTX_set_ciphersuites, iFpp)
GO(SSL_CTX_set_client_CA_list, vFpp)
GOM(SSL_CTX_set_client_cert_cb, vFEpp)
//GO(SSL_CTX_set_client_cert_engine,
-//GO(SSL_CTX_set_cookie_generate_cb,
-//GO(SSL_CTX_set_cookie_verify_cb,
+GOM(SSL_CTX_set_cookie_generate_cb, vFEpp)
+GOM(SSL_CTX_set_cookie_verify_cb, vFEpp)
GOM(SSL_CTX_set_default_passwd_cb, vFEpp)
GO(SSL_CTX_set_default_passwd_cb_userdata, vFpp)
GO(SSL_CTX_set_default_verify_paths, iFp)
@@ -319,6 +323,7 @@ GO(SSL_CTX_set_options, lFpl)
//GO(SSL_CTX_set_psk_server_callback,
//GO(SSL_CTX_set_purpose,
GO(SSL_CTX_set_quiet_shutdown, vFpi)
+GO(SSL_CTX_set_security_level, vFpi)
//GO(SSL_CTX_set_session_id_context,
//GO(SSL_CTX_set_srp_cb_arg,
//GO(SSL_CTX_set_srp_client_pwd_callback,
@@ -345,7 +350,7 @@ GO(SSL_CTX_use_certificate_file, iFppi)
GO(SSL_CTX_use_PrivateKey, iFpp)
GO(SSL_CTX_use_PrivateKey_ASN1, iFuppi)
GO(SSL_CTX_use_PrivateKey_file, iFppi)
-//GO(SSL_CTX_use_psk_identity_hint,
+GO(SSL_CTX_use_psk_identity_hint, iFpp)
GO(SSL_CTX_use_RSAPrivateKey, iFpp)
GO(SSL_CTX_use_RSAPrivateKey_ASN1, iFppl)
GO(SSL_CTX_use_RSAPrivateKey_file, iFppi)
@@ -360,7 +365,7 @@ GO(SSL_do_handshake, iFp)
//GO(ssl_fill_hello_random,
GO(SSL_free, vFp)
//GO(ssl_free_wbio_buffer,
-//GO(SSL_get0_alpn_selected,
+GO(SSL_get0_alpn_selected, vFppp)
GO(SSL_get0_next_proto_negotiated, vFppp)
//GO(SSL_get0_param,
GO(SSL_get0_session, pFp)
@@ -372,6 +377,7 @@ GO(SSL_get_certificate, pFp)
GO(SSL_get_ciphers, pFp)
//GO(ssl_get_ciphers_by_id,
GO(SSL_get_client_CA_list, pFp)
+GO(SSL_get_client_random, LFppL)
GO(SSL_get_current_cipher, pFp)
//GO(SSL_get_current_compression,
//GO(SSL_get_current_expansion,
@@ -393,7 +399,7 @@ GO(SSL_get_privatekey, pFp)
//GO(SSL_get_psk_identity,
//GO(SSL_get_psk_identity_hint,
//GO(SSL_get_quiet_shutdown,
-//GO(SSL_get_rbio,
+GO(SSL_get_rbio, pFp)
//GO(SSL_get_read_ahead,
//GO(SSL_get_rfd,
//GO(SSL_get_selected_srtp_profile,
@@ -405,6 +411,7 @@ GO(SSL_get_session, pFp)
//GO(SSL_get_shared_ciphers,
//GO(SSL_get_shared_sigalgs,
GO(SSL_get_shutdown, iFp)
+GO(SSL_get_state, iFp)
//GO(SSL_get_sigalgs,
//GO(ssl_get_sign_pkey,
//GO(SSL_get_srp_g,
@@ -423,6 +430,8 @@ GO(SSL_get_version, pFp)
//GO(SSL_get_wfd,
//GO(SSL_has_matching_session_id,
//GO(ssl_init_wbio_buffer,
+GO(SSL_in_init, iFP)
+GO(SSL_is_init_finished, iFp)
GO(SSL_is_server, iFp)
GO(SSL_library_init, iFv)
//GO(ssl_load_ciphers,
@@ -458,11 +467,15 @@ GO(SSL_SESSION_free, vFp)
//GO(SSL_SESSION_get_ex_data,
//GO(SSL_SESSION_get_ex_new_index,
//GO(SSL_SESSION_get_id,
+GO(SSL_SESSION_get_master_key, LFppL)
+GO(SSL_SESSION_get_ticket_lifetime_hint, LFp)
//GO(SSL_SESSION_get_time,
-//GO(SSL_SESSION_get_timeout,
+//GO(SSL_SESSION_get_timeout,
+GO(SSL_SESSION_is_resumable, iFp)
GO(SSL_SESSION_new, pFv)
//GO(SSL_SESSION_print,
//GO(SSL_SESSION_print_fp,
+GO(SSL_session_reused, iFp)
//GO(SSL_SESSION_set1_id_context,
//GO(SSL_SESSION_set_ex_data,
//GO(SSL_SESSION_set_time,
@@ -470,7 +483,7 @@ GO(SSL_SESSION_new, pFv)
GO(SSL_SESSION_up_ref, iFp)
//GO(SSL_set1_param,
GO(SSL_set_accept_state, vFp)
-//GO(SSL_set_alpn_protos,
+GO(SSL_set_alpn_protos, iFppu)
GO(SSL_set_bio, vFppp)
//GO(SSL_set_cert_cb,
//GO(ssl_set_cert_masks,
@@ -484,9 +497,11 @@ GO(SSL_set_fd, iFpi)
//GO(SSL_set_generate_session_id,
//GO(SSL_set_info_callback,
//GO(SSL_set_msg_callback,
+GO(SSL_set_options, LFpL)
//GO(ssl_set_peer_cert_type,
GOM(SSL_set_psk_client_callback, vFEpp)
-//GO(SSL_set_psk_server_callback,
+GOM(SSL_set_psk_server_callback, vFEpp)
+GOM(SSL_set_psk_use_session_callback, vFEpp)
//GO(SSL_set_purpose,
GO(SSL_set_quiet_shutdown, vFpi)
//GO(SSL_set_read_ahead,
diff --git a/src/wrapped/wrappedlibtinfo.c b/src/wrapped/wrappedlibtinfo.c
index 6e15e49..1827bb0 100755..100644
--- a/src/wrapped/wrappedlibtinfo.c
+++ b/src/wrapped/wrappedlibtinfo.c
@@ -38,7 +38,7 @@ GO(4)
static uintptr_t my_putc_fct_##A = 0; \
static int my_putc_##A(char c) \
{ \
- return (int)RunFunction(my_context, my_putc_fct_##A, 1, c); \
+ return (int)RunFunctionFmt(my_putc_fct_##A, "c", c); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedlibtinfo6.c b/src/wrapped/wrappedlibtinfo6.c
index 9b1fc0a..c14c8ae 100755..100644
--- a/src/wrapped/wrappedlibtinfo6.c
+++ b/src/wrapped/wrappedlibtinfo6.c
@@ -38,7 +38,7 @@ GO(4)
static uintptr_t my_putc_fct_##A = 0; \
static int my_putc_##A(char c) \
{ \
- return (int)RunFunction(my_context, my_putc_fct_##A, 1, c); \
+ return (int)RunFunctionFmt(my_putc_fct_##A, "c", c); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedlibtinfo6_private.h b/src/wrapped/wrappedlibtinfo6_private.h
index 41ec64f..41ec64f 100755..100644
--- a/src/wrapped/wrappedlibtinfo6_private.h
+++ b/src/wrapped/wrappedlibtinfo6_private.h
diff --git a/src/wrapped/wrappedlibtinfo_private.h b/src/wrapped/wrappedlibtinfo_private.h
index 41ec64f..41ec64f 100755..100644
--- a/src/wrapped/wrappedlibtinfo_private.h
+++ b/src/wrapped/wrappedlibtinfo_private.h
diff --git a/src/wrapped/wrappedlibusb1.c b/src/wrapped/wrappedlibusb1.c
index e34f440..c5fea90 100755..100644
--- a/src/wrapped/wrappedlibusb1.c
+++ b/src/wrapped/wrappedlibusb1.c
@@ -45,7 +45,7 @@ GO(9) \
static uintptr_t my_hotplug_fct_##A = 0; \
static int my_hotplug_##A(void* ctx, void* device, int event, void* data) \
{ \
- return (int)RunFunction(my_context, my_hotplug_fct_##A, 4, ctx, device, event, data); \
+ return (int)RunFunctionFmt(my_hotplug_fct_##A, "ppip", ctx, device, event, data); \
}
SUPER()
#undef GO
@@ -67,7 +67,7 @@ static void* findhotplugFct(void* fct)
static uintptr_t my_transfert_fct_##A = 0; \
static void my_transfert_##A(void* ctx) \
{ \
- RunFunction(my_context, my_transfert_fct_##A, 1, ctx); \
+ RunFunctionFmt(my_transfert_fct_##A, "p", ctx); \
}
SUPER()
#undef GO
@@ -139,7 +139,7 @@ EXPORT int my_libusb_submit_transfer(x64emu_t* emu, my_libusb_transfer_t* t)
{
t->callback = findtransfertFct(t->callback);
return my->libusb_submit_transfer(t); // don't put back callback, it's unknown if it's safe
-}
+}
EXPORT int my_libusb_cancel_transfer(x64emu_t* emu, my_libusb_transfer_t* t)
{
diff --git a/src/wrapped/wrappedlibusb1_private.h b/src/wrapped/wrappedlibusb1_private.h
index 6aa06db..6aa06db 100755..100644
--- a/src/wrapped/wrappedlibusb1_private.h
+++ b/src/wrapped/wrappedlibusb1_private.h
diff --git a/src/wrapped/wrappedlibuuid.c b/src/wrapped/wrappedlibuuid.c
index d80c991..d80c991 100755..100644
--- a/src/wrapped/wrappedlibuuid.c
+++ b/src/wrapped/wrappedlibuuid.c
diff --git a/src/wrapped/wrappedlibuuid_private.h b/src/wrapped/wrappedlibuuid_private.h
index 4402e96..4402e96 100755..100644
--- a/src/wrapped/wrappedlibuuid_private.h
+++ b/src/wrapped/wrappedlibuuid_private.h
diff --git a/src/wrapped/wrappedlibva.c b/src/wrapped/wrappedlibva.c
index 2900057..8c33132 100644
--- a/src/wrapped/wrappedlibva.c
+++ b/src/wrapped/wrappedlibva.c
@@ -6,13 +6,82 @@
#include "wrappedlibs.h"
+#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
#include "x64emu.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+#include "myalign.h"
const char* libvaName = "libva.so.2";
#define LIBNAME libva
+#define ADDED_FUNCTIONS() \
+
+#include "generated/wrappedlibvatypes.h"
+
+#include "wrappercallback.h"
+
+#define SUPER() \
+GO(0) \
+GO(1) \
+GO(2) \
+GO(3)
+
+// VAMessageCallback
+#define GO(A) \
+static uintptr_t my_VAMessageCallback_fct_##A = 0; \
+static void my_VAMessageCallback_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_VAMessageCallback_fct_##A, "pp", a, b); \
+}
+SUPER()
+#undef GO
+static void* findVAMessageCallbackFct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_VAMessageCallback_fct_##A == (uintptr_t)fct) return my_VAMessageCallback_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_VAMessageCallback_fct_##A == 0) {my_VAMessageCallback_fct_##A = (uintptr_t)fct; return my_VAMessageCallback_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libxa VAMessageCallback callback\n");
+ return NULL;
+}
+static void* reverse_VAMessageCallbackFct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my_VAMessageCallback_##A == fct) return (void*)my_VAMessageCallback_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, vFpp, fct, 0, NULL);
+}
+
+#undef SUPER
+
+EXPORT void* my_vaSetErrorCallback(x64emu_t* emu, void* dpy, void* f, void* ctx)
+{
+ return reverse_VAMessageCallbackFct(my->vaSetErrorCallback(dpy, findVAMessageCallbackFct(f), ctx));
+}
+
+EXPORT void* my_vaSetInfoCallback(x64emu_t* emu, void* dpy, void* f, void* ctx)
+{
+ return reverse_VAMessageCallbackFct(my->vaSetInfoCallback(dpy, findVAMessageCallbackFct(f), ctx));
+}
+
+#define CUSTOM_INIT \
+ getMy(lib);
+
+#define CUSTOM_FINI \
+ freeMy();
+
#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedlibva_private.h b/src/wrapped/wrappedlibva_private.h
index dd83be2..cba8dc0 100644
--- a/src/wrapped/wrappedlibva_private.h
+++ b/src/wrapped/wrappedlibva_private.h
@@ -78,9 +78,9 @@ GO(vaQueryVideoProcPipelineCaps, iFpupup)
GO(vaRenderPicture, iFpupi)
//GO(vaSetDisplayAttributes,
//GO(vaSetDriverName,
-//GO(vaSetErrorCallback,
+GOM(vaSetErrorCallback, pFEppp)
//GO(vaSetImagePalette,
-//GO(vaSetInfoCallback,
+GOM(vaSetInfoCallback, pFEppp)
//GO(vaSetSubpictureChromakey,
//GO(vaSetSubpictureGlobalAlpha,
//GO(vaSetSubpictureImage,
diff --git a/src/wrapped/wrappedlibvdpau.c b/src/wrapped/wrappedlibvdpau.c
index 146ef72..16eef5a 100644
--- a/src/wrapped/wrappedlibvdpau.c
+++ b/src/wrapped/wrappedlibvdpau.c
@@ -6,13 +6,37 @@
#include "wrappedlibs.h"
+#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
#include "x64emu.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+#include "myalign.h"
const char* libvdpauName = "libvdpau.so.1";
#define LIBNAME libvdpau
+
+#define ADDED_FUNCTIONS() \
+
+#include "generated/wrappedlibvdpautypes.h"
+
+#include "wrappercallback.h"
+
+EXPORT uint32_t my_vdp_device_create_x11(x64emu_t* emu, void* display, int screen, void* device, void** get_proc_address)
+{
+ return 1; // VDP_STATUS_NO_IMPLEMENTATION
+}
+
+#define CUSTOM_INIT \
+ getMy(lib);
+
+#define CUSTOM_FINI \
+ freeMy();
+
#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedlibvdpau_private.h b/src/wrapped/wrappedlibvdpau_private.h
index 3a06a03..99a0b33 100644
--- a/src/wrapped/wrappedlibvdpau_private.h
+++ b/src/wrapped/wrappedlibvdpau_private.h
@@ -2,4 +2,4 @@
#error meh!
#endif
-//GO(vdp_device_create_x11, iFpipp) // last is a pointer to a VdpGetProcAddress function \ No newline at end of file
+GOM(vdp_device_create_x11, iFpipp) // last is a pointer to a VdpGetProcAddress function \ No newline at end of file
diff --git a/src/wrapped/wrappedlibvorbis.c b/src/wrapped/wrappedlibvorbis.c
index 7449582..7449582 100755..100644
--- a/src/wrapped/wrappedlibvorbis.c
+++ b/src/wrapped/wrappedlibvorbis.c
diff --git a/src/wrapped/wrappedlibvorbis_private.h b/src/wrapped/wrappedlibvorbis_private.h
index 427ef37..427ef37 100755..100644
--- a/src/wrapped/wrappedlibvorbis_private.h
+++ b/src/wrapped/wrappedlibvorbis_private.h
diff --git a/src/wrapped/wrappedlibx11.c b/src/wrapped/wrappedlibx11.c
index bf74a1c..0ee5d08 100755..100644
--- a/src/wrapped/wrappedlibx11.c
+++ b/src/wrapped/wrappedlibx11.c
@@ -43,15 +43,15 @@ typedef struct ximage_s {
void*(*create_image)(
void* /* display */,
void* /* visual */,
- uint64_t /* depth */, // Should be uint32_t instead
- int64_t /* format */, // Should be int32_t instead
- int64_t /* offset */, // Should be int32_t instead
+ uint32_t /* depth */,
+ int32_t /* format */,
+ int32_t /* offset */,
void* /* data */,
- uint64_t /* width */, // Should be uint32_t instead
- uint64_t /* height */, // Should be uint32_t instead
- int64_t /* bitmap_pad */, // Should be int32_t instead
- int64_t /* bytes_per_line */); // Should be int32_t instead
- int64_t (*destroy_image) (void*); // Should be int32_t instead
+ uint32_t /* width */,
+ uint32_t /* height */,
+ int32_t /* bitmap_pad */,
+ int32_t /* bytes_per_line */);
+ int32_t (*destroy_image) (void*);
uintptr_t (*get_pixel) (void*, int32_t, int32_t);
int32_t (*put_pixel) (void*, int32_t, int32_t, uintptr_t);
void*(*sub_image) (void*, int32_t, int32_t, uint32_t, uint32_t); //sub_image return a new XImage that need bridging => custom wrapper
@@ -109,14 +109,14 @@ GO(11) \
GO(12) \
GO(13) \
GO(14) \
-GO(15)
+GO(15)
// wire_to_event
#define GO(A) \
static uintptr_t my_wire_to_event_fct_##A = 0; \
static int my_wire_to_event_##A(void* dpy, void* re, void* event) \
{ \
- return (int)RunFunction(my_context, my_wire_to_event_fct_##A, 3, dpy, re, event);\
+ return (int)RunFunctionFmt(my_wire_to_event_fct_##A, "ppp", dpy, re, event);\
}
SUPER()
#undef GO
@@ -149,7 +149,7 @@ static void* reverse_wire_to_eventFct(library_t* lib, void* fct)
static uintptr_t my_event_to_wire_fct_##A = 0; \
static int my_event_to_wire_##A(void* dpy, void* re, void* event) \
{ \
- return (int)RunFunction(my_context, my_event_to_wire_fct_##A, 3, dpy, re, event);\
+ return (int)RunFunctionFmt(my_event_to_wire_fct_##A, "ppp", dpy, re, event);\
}
SUPER()
#undef GO
@@ -182,7 +182,7 @@ static void* reverse_event_to_wireFct(library_t* lib, void* fct)
static uintptr_t my_error_handler_fct_##A = 0; \
static int my_error_handler_##A(void* dpy, void* error) \
{ \
- return (int)RunFunction(my_context, my_error_handler_fct_##A, 2, dpy, error);\
+ return (int)RunFunctionFmt(my_error_handler_fct_##A, "pp", dpy, error);\
}
SUPER()
#undef GO
@@ -215,7 +215,7 @@ static void* reverse_error_handlerFct(library_t* lib, void* fct)
static uintptr_t my_ioerror_handler_fct_##A = 0; \
static int my_ioerror_handler_##A(void* dpy) \
{ \
- return (int)RunFunction(my_context, my_ioerror_handler_fct_##A, 1, dpy);\
+ return (int)RunFunctionFmt(my_ioerror_handler_fct_##A, "p", dpy);\
}
SUPER()
#undef GO
@@ -248,7 +248,7 @@ static void* reverse_ioerror_handlerFct(library_t* lib, void* fct)
static uintptr_t my_exterror_handler_fct_##A = 0; \
static int my_exterror_handler_##A(void* dpy, void* err, void* codes, int* ret_code) \
{ \
- return (int)RunFunction(my_context, my_exterror_handler_fct_##A, 4, dpy, err, codes, ret_code);\
+ return (int)RunFunctionFmt(my_exterror_handler_fct_##A, "pppp", dpy, err, codes, ret_code);\
}
SUPER()
#undef GO
@@ -281,7 +281,7 @@ static void* reverse_exterror_handlerFct(library_t* lib, void* fct)
static uintptr_t my_close_display_fct_##A = 0; \
static int my_close_display_##A(void* dpy, void* codes) \
{ \
- return (int)RunFunction(my_context, my_close_display_fct_##A, 2, dpy, codes);\
+ return (int)RunFunctionFmt(my_close_display_fct_##A, "pp", dpy, codes);\
}
SUPER()
#undef GO
@@ -314,7 +314,7 @@ static void* reverse_close_displayFct(library_t* lib, void* fct)
static uintptr_t my_register_im_fct_##A = 0; \
static void my_register_im_##A(void* dpy, void* u, void* d) \
{ \
- RunFunction(my_context, my_register_im_fct_##A, 3, dpy, u, d); \
+ RunFunctionFmt(my_register_im_fct_##A, "ppp", dpy, u, d); \
}
SUPER()
#undef GO
@@ -347,7 +347,7 @@ static void* reverse_register_imFct(library_t* lib, void* fct)
static uintptr_t my_XConnectionWatchProc_fct_##A = 0; \
static void my_XConnectionWatchProc_##A(void* dpy, void* data, int op, void* d) \
{ \
- RunFunction(my_context, my_XConnectionWatchProc_fct_##A, 4, dpy, data, op, d); \
+ RunFunctionFmt(my_XConnectionWatchProc_fct_##A, "ppip", dpy, data, op, d); \
}
SUPER()
#undef GO
@@ -369,7 +369,7 @@ static void* findXConnectionWatchProcFct(void* fct)
static uintptr_t my_xifevent_fct_##A = 0; \
static int my_xifevent_##A(void* dpy, void* event, void* d) \
{ \
- return RunFunction(my_context, my_xifevent_fct_##A, 3, dpy, event, d); \
+ return RunFunctionFmt(my_xifevent_fct_##A, "ppp", dpy, event, d); \
}
SUPER()
#undef GO
@@ -391,7 +391,7 @@ static void* findxifeventFct(void* fct)
static uintptr_t my_XInternalAsyncHandler_fct_##A = 0; \
static int my_XInternalAsyncHandler_##A(void* dpy, void* rep, void* buf, int len, void* data) \
{ \
- return RunFunction(my_context, my_XInternalAsyncHandler_fct_##A, 5, dpy, rep, buf, len, data); \
+ return RunFunctionFmt(my_XInternalAsyncHandler_fct_##A, "pppip", dpy, rep, buf, len, data); \
}
SUPER()
#undef GO
@@ -414,7 +414,7 @@ static void* findXInternalAsyncHandlerFct(void* fct)
static uintptr_t my_XSynchronizeProc_fct_##A = 0; \
static int my_XSynchronizeProc_##A() \
{ \
- return (int)RunFunction(my_context, my_XSynchronizeProc_fct_##A, 0);\
+ return (int)RunFunctionFmt(my_XSynchronizeProc_fct_##A, "");\
}
SUPER()
#undef GO
@@ -447,7 +447,7 @@ static void* reverse_XSynchronizeProcFct(library_t* lib, void* fct)
static uintptr_t my_XLockDisplay_fct_##A = 0; \
static void my_XLockDisplay_##A(void* dpy) \
{ \
- RunFunction(my_context, my_XLockDisplay_fct_##A, 1, dpy); \
+ RunFunctionFmt(my_XLockDisplay_fct_##A, "p", dpy); \
}
SUPER()
#undef GO
@@ -469,7 +469,7 @@ static void* findXLockDisplayFct(void* fct)
static uintptr_t my_XUnlockDisplay_fct_##A = 0; \
static void my_XUnlockDisplay_##A(void* dpy) \
{ \
- RunFunction(my_context, my_XUnlockDisplay_fct_##A, 1, dpy); \
+ RunFunctionFmt(my_XUnlockDisplay_fct_##A, "p", dpy); \
}
SUPER()
#undef GO
@@ -556,14 +556,14 @@ static int my_XICProc_##A(void* a, void* b, void* c) \
{ \
if (my_XICProc_fct_##A == 0) \
printf_log(LOG_NONE, "%s cannot find XICProc callback\n", __func__);\
- return (int)RunFunction(my_context, my_XICProc_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_XICProc_fct_##A, "ppp", a, b, c); \
} \
static uintptr_t my_XIMProc_fct_##A = 0; \
static void my_XIMProc_##A(void* a, void* b, void* c) \
{ \
if (my_XIMProc_fct_##A == 0) \
printf_log(LOG_NONE, "%s cannot find XIMProc callback\n", __func__);\
- RunFunction(my_context, my_XIMProc_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_XIMProc_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -666,7 +666,7 @@ EXPORT void* my_XSetICValues(x64emu_t* emu, void* xic, uintptr_t* va) {
SUPER()
}
- void* res = NULL;
+ void* res = NULL;
VA_CALL(my->XSetICValues, xic, new_va, n, res);
box_free(new_va);
box_free(callbacks);
@@ -695,7 +695,7 @@ EXPORT void* my_XSetIMValues(x64emu_t* emu, void* xim, uintptr_t* va) {
SUPER()
}
#undef GO
-
+
void* res = NULL;
VA_CALL(my->XSetIMValues, xim, new_va, n, res)
box_free(new_va);
@@ -757,7 +757,7 @@ void BridgeImageFunc(x64emu_t *emu, XImage *img)
#define GO(A, W) \
fnc = CheckBridged(system, img->f.A); \
- if(!fnc) fnc = AddAutomaticBridge(emu, system, W, img->f.A, 0); \
+ if(!fnc) fnc = AddAutomaticBridge(emu, system, W, img->f.A, 0, #A); \
img->f.A = (W##_t)fnc;
uintptr_t fnc;
@@ -792,7 +792,7 @@ void UnbridgeImageFunc(x64emu_t *emu, XImage *img)
void sub_image_wrapper(x64emu_t *emu, uintptr_t fnc)
{
- pFpiiuu_t fn = (pFpiiuu_t)fnc;
+ pFpiiuu_t fn = (pFpiiuu_t)fnc;
void* img = fn(*(void**)(R_RDI), *(int32_t*)(R_RSI), *(int32_t*)(R_RDX), *(uint32_t*)(R_RCX), *(uint32_t*)(R_R8));
BridgeImageFunc(emu, (XImage*)img);
R_EAX=(uintptr_t)img;
@@ -903,7 +903,7 @@ EXPORT int my_XRegisterIMInstantiateCallback(x64emu_t* emu, void* d, void* db, v
{
return my->XRegisterIMInstantiateCallback(d, db, res_name, res_class, findregister_imFct(cb), data);
}
-
+
EXPORT int my_XUnregisterIMInstantiateCallback(x64emu_t* emu, void* d, void* db, void* res_name, void* res_class, void* cb, void* data)
{
return my->XUnregisterIMInstantiateCallback(d, db, res_name, res_class, reverse_register_imFct(my_lib, cb), data);
@@ -1108,12 +1108,12 @@ EXPORT void* my_XOpenDisplay(x64emu_t* emu, void* d)
#define GO(A, W)\
if(dpy->A) \
if(!CheckBridged(system, dpy->A)) \
- AddAutomaticBridge(emu, system, W, dpy->A, 0); \
+ AddAutomaticBridge(emu, system, W, dpy->A, 0, #A); \
#define GO2(A, B, W) \
if(dpy->A && dpy->A->B) \
if(!CheckBridged(system, dpy->A->B)) \
- AddAutomaticBridge(emu, system, W, dpy->A->B, 0); \
+ AddAutomaticBridge(emu, system, W, dpy->A->B, 0, #B "_" #A); \
GO2(free_funcs, atoms, vFp)
diff --git a/src/wrapped/wrappedlibx11_private.h b/src/wrapped/wrappedlibx11_private.h
index bd82eb6..9a98ef9 100755..100644
--- a/src/wrapped/wrappedlibx11_private.h
+++ b/src/wrapped/wrappedlibx11_private.h
@@ -17,7 +17,7 @@
// _init
// KeySymToUcs4
DATAB(_qfree, 4)
-// _Utf8GetConvByName
+//GO(_Utf8GetConvByName,
//GO(XActivateScreenSaver
GOM(XAddConnectionWatch, iFEppp)
GO(XAddExtension, pFp)
@@ -28,16 +28,16 @@ GO(XAddToExtensionList, vFpp)
//GO(XAddToSaveSet
GO(XAllocClassHint, pFv)
GO(XAllocColor, iFppp)
-GO(XAllocColorCells, iFppipipi)
-//GO(XAllocColorPlanes
-//GO(XAllocIconSize
+GO(XAllocColorCells, iFpLipupu)
+GO(XAllocColorPlanes, iFpLipiiiippp)
+GO(XAllocIconSize, pFv)
GO(_XAllocID, LFp)
GO(_XAllocIDs, vFppi)
GO(XAllocNamedColor, iFppppp)
-// _XAllocScratch
+//GO(_XAllocScratch,
GO(XAllocSizeHints, pFv)
-//GO(XAllocStandardColormap
-// _XAllocTemp
+GO(XAllocStandardColormap, pFv)
+//GO(_XAllocTemp,
GO(XAllocWMHints, pFv)
GO(XAllowEvents, iFpiL)
GO(XAllPlanes, LFv)
@@ -52,45 +52,45 @@ GO(XBitmapUnit, iFp)
GO(XBlackPixel, LFpi)
//GO(XBlackPixelOfScreen
//GO(XCellsOfScreen
-GO(XChangeActivePointerGrab, vFpupp)
+GO(XChangeActivePointerGrab, iFpuLL)
GO(XChangeGC, iFppLp)
GO(XChangeKeyboardControl, iFpLp)
GO(XChangeKeyboardMapping, iFpiipi)
GO(XChangePointerControl, iFpiiiii)
-GO(XChangeProperty, iFppppiipi)
+GO(XChangeProperty, iFpLLLiipi)
//GO(XChangeSaveSet
-GO(XChangeWindowAttributes, iFppLp)
+GO(XChangeWindowAttributes, iFpLLp)
GOM(XCheckIfEvent, iFEpppp)
GO(XCheckMaskEvent, iFplp)
GO(XCheckTypedEvent, iFpip)
-GO(XCheckTypedWindowEvent, iFppip)
+GO(XCheckTypedWindowEvent, iFpLip)
GO(XCheckWindowEvent, iFpplp)
-//GO(XCirculateSubwindows
+GO(XCirculateSubwindows, iFpLi)
//GO(XCirculateSubwindowsDown
//GO(XCirculateSubwindowsUp
-GO(XClearArea, iFppiiuui)
+GO(XClearArea, iFpLiiuui)
GO(XClearWindow, iFpp)
GO(XClipBox, iFpp)
GO(XCloseDisplay, iFp)
GO(XCloseIM, iFp)
-// _XCloseLC
+//GO(_XCloseLC,
GO(XCloseOM, iFp)
-// _XcmsAddCmapRec
+//GO(_XcmsAddCmapRec,
//GO(XcmsAddColorSpace
//GO(XcmsAddFunctionSet
//GO(XcmsAllocColor
//GO(XcmsAllocNamedColor
-// _XcmsArcTangent
+//GO(_XcmsArcTangent,
//GO(XcmsCCCOfColormap
//GO(XcmsCIELabClipab
//GO(XcmsCIELabClipL
//GO(XcmsCIELabClipLab
DATA(XcmsCIELabColorSpace, 6*sizeof(void*))
-// _XcmsCIELab_prefix // type r
+//GO(_XcmsCIELab_prefix // type r,
//GO(XcmsCIELabQueryMaxC
//GO(XcmsCIELabQueryMaxL
//GO(XcmsCIELabQueryMaxLC
-// _XcmsCIELabQueryMaxLCRGB
+//GO(_XcmsCIELabQueryMaxLCRGB,
//GO(XcmsCIELabQueryMinL
//GO(XcmsCIELabToCIEXYZ
//GO(XcmsCIELabWhiteShiftColors
@@ -98,167 +98,167 @@ DATA(XcmsCIELabColorSpace, 6*sizeof(void*))
//GO(XcmsCIELuvClipLuv
//GO(XcmsCIELuvClipuv
DATA(XcmsCIELuvColorSpace, 6*sizeof(void*))
-// _XcmsCIELuv_prefix // type r
+//GO(_XcmsCIELuv_prefix // type r,
//GO(XcmsCIELuvQueryMaxC
//GO(XcmsCIELuvQueryMaxL
//GO(XcmsCIELuvQueryMaxLC
-// _XcmsCIELuvQueryMaxLCRGB
+//GO(_XcmsCIELuvQueryMaxLCRGB,
//GO(XcmsCIELuvQueryMinL
//GO(XcmsCIELuvToCIEuvY
//GO(XcmsCIELuvWhiteShiftColors
DATA(XcmsCIEuvYColorSpace, 6*sizeof(void*))
-// _XcmsCIEuvY_prefix // type r
+//GO(_XcmsCIEuvY_prefix // type r,
//GO(XcmsCIEuvYToCIELuv
//GO(XcmsCIEuvYToCIEXYZ
//GO(XcmsCIEuvYToTekHVC
-// _XcmsCIEuvY_ValidSpec
+//GO(_XcmsCIEuvY_ValidSpec,
DATA(XcmsCIExyYColorSpace, 6*sizeof(void*)) // probably need some wrapping
-// _XcmsCIExyY_prefix // type r
+//GO(_XcmsCIExyY_prefix // type r,
//GO(XcmsCIExyYToCIEXYZ
DATA(XcmsCIEXYZColorSpace, 6*sizeof(void*))
-// _XcmsCIEXYZ_prefix // type r
+//GO(_XcmsCIEXYZ_prefix // type r,
//GO(XcmsCIEXYZToCIELab
//GO(XcmsCIEXYZToCIEuvY
//GO(XcmsCIEXYZToCIExyY
//GO(XcmsCIEXYZToRGBi
-// _XcmsCIEXYZ_ValidSpec
+//GO(_XcmsCIEXYZ_ValidSpec,
//GO(XcmsClientWhitePointOfCCC
//GO(XcmsConvertColors
-// _XcmsConvertColorsWithWhitePt
-// _XcmsCopyCmapRecAndFree
-// _XcmsCopyISOLatin1Lowered
-// _XcmsCopyPointerArray
-// _XcmsCosine
+//GO(_XcmsConvertColorsWithWhitePt,
+//GO(_XcmsCopyCmapRecAndFree,
+//GO(_XcmsCopyISOLatin1Lowered,
+//GO(_XcmsCopyPointerArray,
+//GO(_XcmsCosine,
//GO(XcmsCreateCCC
-// _XcmsCubeRoot
+//GO(_XcmsCubeRoot,
DATA(_XcmsDDColorSpaces, 6*sizeof(void*))
DATA(_XcmsDDColorSpacesInit, 6*sizeof(void*))
-// _XcmsDDConvertColors
+//GO(_XcmsDDConvertColors,
//GO(XcmsDefaultCCC
-// _XcmsDeleteCmapRec
+//GO(_XcmsDeleteCmapRec,
DATA(_XcmsDIColorSpaces, 6*sizeof(void*))
DATA(_XcmsDIColorSpacesInit, 6*sizeof(void*))
-// _XcmsDIConvertColors
+//GO(_XcmsDIConvertColors,
//GO(XcmsDisplayOfCCC
-// _XcmsEqualWhitePts
-//GO(XcmsFormatOfPrefix
+//GO(_XcmsEqualWhitePts,
+GO(XcmsFormatOfPrefix, LFp)
//GO(XcmsFreeCCC
-// _XcmsFreeIntensityMaps
-// _XcmsFreePointerArray
-// _XcmsGetElement
-// _XcmsGetIntensityMap
-// _XcmsGetProperty
-// _XcmsInitDefaultCCCs
-// _XcmsInitScrnInfo
+//GO(_XcmsFreeIntensityMaps,
+//GO(_XcmsFreePointerArray,
+//GO(_XcmsGetElement,
+//GO(_XcmsGetIntensityMap,
+//GO(_XcmsGetProperty,
+//GO(_XcmsInitDefaultCCCs,
+//GO(_XcmsInitScrnInfo,
DATA(XcmsLinearRGBFunctionSet, 3*sizeof(void*)) // probably needs some wrapping
-//GO(XcmsLookupColor
-// _XcmsLRGB_InitScrnDefault
-//GO(XcmsPrefixOfFormat
-// _XcmsPushPointerArray
+GO(XcmsLookupColor, iFpLpppL)
+//GO(_XcmsLRGB_InitScrnDefault,
+GO(XcmsPrefixOfFormat, pFL)
+//GO(_XcmsPushPointerArray,
//GO(XcmsQueryBlack
//GO(XcmsQueryBlue
-//GO(XcmsQueryColor
-//GO(XcmsQueryColors
+GO(XcmsQueryColor, iFpLpL)
+GO(XcmsQueryColors, iFpLpuL)
//GO(XcmsQueryGreen
//GO(XcmsQueryRed
//GO(XcmsQueryWhite
DATA(_XcmsRegColorSpaces, 6*sizeof(void*))
-// _XcmsRegFormatOfPrefix
-// _XcmsResolveColor
-// _XcmsResolveColorString
+//GO(_XcmsRegFormatOfPrefix,
+//GO(_XcmsResolveColor,
+//GO(_XcmsResolveColorString,
DATA(XcmsRGBColorSpace, 6*sizeof(void*))
DATA(XcmsRGBiColorSpace, 6*sizeof(void*))
-// _XcmsRGBi_prefix // type r
+//GO(_XcmsRGBi_prefix // type r,
//GO(XcmsRGBiToCIEXYZ
//GO(XcmsRGBiToRGB
-// _XcmsRGB_prefix // type r
+//GO(_XcmsRGB_prefix // type r,
//GO(XcmsRGBToRGBi
-// _XcmsRGB_to_XColor
+//GO(_XcmsRGB_to_XColor,
DATA(_XcmsSCCFuncSets, 3*sizeof(void*))
DATA(_XcmsSCCFuncSetsInit, 3*sizeof(void*))
//GO(XcmsScreenNumberOfCCC
//GO(XcmsScreenWhitePointOfCCC
//GO(XcmsSetCCCOfColormap
//GO(XcmsSetCompressionProc
-// _XcmsSetGetColor
-// _XcmsSetGetColors
+//GO(_XcmsSetGetColor,
+//GO(_XcmsSetGetColors,
//GO(XcmsSetWhiteAdjustProc
//GO(XcmsSetWhitePoint
-// _XcmsSine
-// _XcmsSquareRoot
-//GO(XcmsStoreColor
-//GO(XcmsStoreColors
-// _XcmsTekHVC_CheckModify
+//GO(_XcmsSine,
+//GO(_XcmsSquareRoot,
+GO(XcmsStoreColor, iFpLp)
+GO(XcmsStoreColors, iFpLpup)
+//GO(_XcmsTekHVC_CheckModify,
//GO(XcmsTekHVCClipC
//GO(XcmsTekHVCClipV
//GO(XcmsTekHVCClipVC
DATA(XcmsTekHVCColorSpace, 6*sizeof(void*))
-// _XcmsTekHVC_prefix // type r
+//GO(_XcmsTekHVC_prefix // type r,
//GO(XcmsTekHVCQueryMaxC
//GO(XcmsTekHVCQueryMaxV
//GO(XcmsTekHVCQueryMaxVC
-// _XcmsTekHVCQueryMaxVCRGB
+//GO(_XcmsTekHVCQueryMaxVCRGB,
//GO(XcmsTekHVCQueryMaxVSamples
//GO(XcmsTekHVCQueryMinV
//GO(XcmsTekHVCToCIEuvY
//GO(XcmsTekHVCWhiteShiftColors
DATA(XcmsUNDEFINEDColorSpace, 6*sizeof(void*))
-// _XcmsUnresolveColor
+//GO(_XcmsUnresolveColor,
//GO(XcmsVisualOfCCC
-// _XColor_to_XcmsRGB
-GO(XConfigureWindow, iFppup)
+//GO(_XColor_to_XcmsRGB,
+GO(XConfigureWindow, iFpLup)
GO(XConnectionNumber, iFp)
-// _XConnectXCB
+//GO(_XConnectXCB,
//GO(XContextDependentDrawing
-//GO(XContextualDrawing
+GO(XContextualDrawing, iFp)
GO(XConvertCase, vFLpp)
-GO(XConvertSelection, iFpppppL)
-GO(XCopyArea, iFppppiiuuii)
-GO(XCopyColormapAndFree, uFpp)
-// _XCopyEventCookie
-GO(XCopyGC, iFpppL)
-GO(XCopyPlane, iFppppiiuuiiL)
-// _XCopyToArg
-GO(XCreateBitmapFromData, pFpppuu)
+GO(XConvertSelection, iFpLLLLL)
+GO(XCopyArea, iFpLLpiiuuii)
+GO(XCopyColormapAndFree, LFpL)
+//GO(_XCopyEventCookie,
+GO(XCopyGC, iFppLp)
+GO(XCopyPlane, iFpLLpiiuuiiL)
+//GO(_XCopyToArg,
+GO(XCreateBitmapFromData, LFpLpuu)
GO(XCreateColormap, pFpppi)
-GO(XCreateFontCursor, pFpu)
+GO(XCreateFontCursor, LFpu)
GO(XCreateFontSet, pFppppp)
-GO(XCreateGC, pFppup)
-//GO(XCreateGlyphCursor
+GO(XCreateGC, pFpLLp)
+GO(XCreateGlyphCursor, LFpLLuupp)
GOM(XCreateIC, pFEpV) // use vararg
GOM(XCreateImage, pFEppuiipuuii)
GO(dummy_XCreateImage, pFppuiipuuii) // to have the wrapper
DATAB(_XCreateMutex_fn, sizeof(void*))
GO(XCreateOC, pFp)
-GO(XCreatePixmap, pFppuuu)
-GO(XCreatePixmapCursor, pFpppppuu)
-GO(XCreatePixmapFromBitmapData, pFpppuuLLu)
+GO(XCreatePixmap, LFpLuuu)
+GO(XCreatePixmapCursor, LFpLLppuu)
+GO(XCreatePixmapFromBitmapData, LFpLpuuLLu)
GO(XCreateRegion, pFv)
-GO(XCreateSimpleWindow, pFppiiuuuLL)
+GO(XCreateSimpleWindow, LFpLiiuuuLL)
GO(XCreateWindow, pFppiiuuuiupLp)
DATAB(_Xdebug, sizeof(void*))
-GO(XDefaultColormap, pFpi)
-GO(XDefaultColormapOfScreen, pFp)
+GO(XDefaultColormap, LFpi)
+GO(XDefaultColormapOfScreen, LFp)
GO(XDefaultDepth, iFpi)
GO(XDefaultDepthOfScreen, iFp)
-// _XDefaultError
+//GO(_XDefaultError,
GO(XDefaultGC, pFpi)
GO(XDefaultGCOfScreen, pFp)
GO(_XDefaultIOError, iFp)
-// _XDefaultOpenIM
-// _XDefaultOpenOM
-GO(XDefaultRootWindow, pFp)
+//GO(_XDefaultOpenIM,
+//GO(_XDefaultOpenOM,
+GO(XDefaultRootWindow, LFp)
GO(XDefaultScreen, iFp)
GO(XDefaultScreenOfDisplay, pFp)
GO(XDefaultString, pFv)
GO(XDefaultVisual, pFpi)
GO(XDefaultVisualOfScreen, pFp)
-// _XDefaultWireError
-GO(XDefineCursor, iFppp)
+//GO(_XDefaultWireError,
+GO(XDefineCursor, iFpLL)
GO(XDeleteContext, iFpLi)
//GO(XDeleteModifiermapEntry
-GO(XDeleteProperty, iFppp)
-// _XDeq
+GO(XDeleteProperty, iFpLL)
+//GO(_XDeq,
GOM(_XDeqAsyncHandler, vFEpp)
GO(XDestroyIC, vFp)
GOM(XDestroyImage, iFEp) //need to unbridge
@@ -276,7 +276,7 @@ GO(XDisplayKeycodes, iFppp)
GO(XDisplayName, pFp)
GO(XDisplayOfIM, pFp)
GO(XDisplayOfOM, pFp)
-//GO(XDisplayOfScreen
+GO(XDisplayOfScreen, pFp)
//GO(XDisplayPlanes
GO(XDisplayString, pFp)
GO(XDisplayWidth, iFpi)
@@ -287,17 +287,17 @@ GO(XDrawArc, iFpppiiuuii)
//GO(XDrawArcs
//GO(XDrawImageString
//GO(XDrawImageString16
-GO(XDrawLine, iFpppiiii)
+GO(XDrawLine, iFpLpiiii)
GO(XDrawLines, iFppppii)
-GO(XDrawPoint, iFpppii)
-GO(XDrawPoints, iFppppii)
+GO(XDrawPoint, iFpLpii)
+GO(XDrawPoints, iFpLppii)
GO(XDrawRectangle, iFpppiiuu)
GO(XDrawRectangles, iFppppi)
-GO(XDrawSegments, iFppppi)
-GO(XDrawString, iFpppiipi)
-GO(XDrawString16, iFpppiipi)
-//GO(XDrawText
-//GO(XDrawText16
+GO(XDrawSegments, iFpLppi)
+GO(XDrawString, iFpLpiipi)
+GO(XDrawString16, iFpLpiipi)
+GO(XDrawText, iFpLpiipi)
+GO(XDrawText16, iFpLpiipi)
GO(_XEatData, vFpL)
GO(_XEatDataWords, vFpL)
//GO(XEHeadOfExtensionList
@@ -305,7 +305,7 @@ GO(XEmptyRegion, iFp)
GO(XEnableAccessControl, vFp)
GO(_XEnq, vFpp)
GO(XEqualRegion, iFpp)
-// _XError
+//GO(_XError,
DATAB(_XErrorFunction, sizeof(void*))
//GO(XESetBeforeFlush
GOM(XESetCloseDisplay, pFEpip)
@@ -323,25 +323,25 @@ GOM(XESetEventToWire, pFEpip)
//GO(XESetWireToError
GOM(XESetWireToEvent, pFEpip)
//GO(XESetWireToEventCookie
-//GO(XEventMaskOfScreen
+GO(XEventMaskOfScreen, lFp)
GO(XEventsQueued, iFpi)
-// _XEventsQueued
-// _Xevent_to_mask // type r
-// _XEventToWire
+//GO(_XEventsQueued,
+//GO(_Xevent_to_mask // type r,
+//GO(_XEventToWire,
GO(XExtendedMaxRequestSize, lFp)
GO(XExtentsOfFontSet, pFp)
-// _XF86BigfontFreeFontMetrics
-// _XF86LoadQueryLocaleFont
-//GO(XFetchBuffer
-//GO(XFetchBytes
-// _XFetchEventCookie
+//GO(_XF86BigfontFreeFontMetrics,
+//GO(_XF86LoadQueryLocaleFont,
+GO(XFetchBuffer, pFppi)
+GO(XFetchBytes, pFpp)
+//GO(_XFetchEventCookie,
GO(XFetchName, iFppp)
-GO(XFillArc, iFpppiiuuii)
-//GO(XFillArcs
-GO(XFillPolygon, iFppppiii)
-GO(XFillRectangle, iFpppiiuu)
-GO(XFillRectangles, iFppppi)
-GO(XFilterEvent, iFpp)
+GO(XFillArc, iFpLpiiuuii)
+GO(XFillArcs, iFpLppi)
+GO(XFillPolygon, iFpLppiii)
+GO(XFillRectangle, iFpLpiiuu)
+GO(XFillRectangles, iFpLppi)
+GO(XFilterEvent, iFpL)
GO(XFindContext, iFpLip)
//GO(XFindOnExtensionList
GO(XFlush, iFp)
@@ -351,15 +351,15 @@ GO(_XFlushGCCache, vFpp)
GO(XFontsOfFontSet, iFppp)
GO(XForceScreenSaver, iFpi)
GO(XFree, iFp)
-// _XFreeAtomTable
+//GO(_XFreeAtomTable,
GO(XFreeColormap, iFpp)
-GO(XFreeColors, iFpppiL)
-GO(XFreeCursor, iFpp)
+GO(XFreeColors, iFpLpiL)
+GO(XFreeCursor, iFpL)
DATAB(_XFreeDisplayLock_fn, sizeof(void*))
-// _XFreeDisplayStructure
-// _XFreeEventCookies
+//GO(_XFreeDisplayStructure,
+//GO(_XFreeEventCookies,
GO(XFreeEventData, vFpp)
-// _XFreeExtData
+//GO(_XFreeExtData,
GO(XFreeExtensionList, iFp)
GO(XFreeFont, iFpp)
GO(XFreeFontInfo, iFppi)
@@ -369,39 +369,39 @@ GO(XFreeFontSet, vFpp)
GO(XFreeGC, iFpp)
GO(XFreeModifiermap, iFp)
DATAB(_XFreeMutex_fn, sizeof(void*))
-GO(XFreePixmap, iFpp)
+GO(XFreePixmap, iFpL)
GO(XFreeStringList, vFp)
-// _XFreeTemp
-// _XFreeX11XCBStructure
-GO(XGContextFromGC, pFp)
+//GO(_XFreeTemp,
+//GO(_XFreeX11XCBStructure,
+GO(XGContextFromGC, LFp)
GO(XGeometry, iFpippuuuiipppp)
GO(_XGetAsyncData, vFpppiiii)
-// _XGetAsyncReply
-GO(XGetAtomName, pFpp)
+GO(_XGetAsyncReply, pFppppiii)
+GO(XGetAtomName, pFpL)
GO(XGetAtomNames, iFppip)
-// _XGetBitsPerPixel
+//GO(_XGetBitsPerPixel,
GO(XGetClassHint, iFppp)
-GO(XGetCommand, iFpppp)
+GO(XGetCommand, iFpLpp)
GO(XGetDefault, pFppp)
GO(XGetErrorDatabaseText, iFpppppi)
GO(XGetErrorText, iFpipi)
GO(XGetEventData, iFpp)
GO(XGetFontPath, pFpp)
-GO(XGetFontProperty, iFppp)
+GO(XGetFontProperty, iFpLp)
GO(XGetGCValues, iFppLp)
-GO(XGetGeometry, iFppppppppp)
-// _XGetHostname
-GO(XGetIconName, iFppp)
-//GO(XGetIconSizes
+GO(XGetGeometry, iFpLppppppp)
+GO(_XGetHostname, iFpi)
+GO(XGetIconName, iFpLp)
+GO(XGetIconSizes, iFpLpp)
GO(XGetICValues, pFpppppppppp) // use varargs...
GOM(XGetImage, pFEppiiuuLi) // return an XImage with callbacks that needs wrapping
GO(XGetIMValues, pFppppppp) // use varargs
GO(XGetInputFocus, iFppp)
GO(XGetKeyboardControl, iFpp)
-GO(XGetKeyboardMapping, pFppip)
-// _XGetLCValues
+GO(XGetKeyboardMapping, pFpCip)
+//GO(_XGetLCValues,
GO(XGetModifierMapping, pFp)
-GO(XGetMotionEvents, pFppLLp)
+GO(XGetMotionEvents, pFpLLLp)
GO(XGetNormalHints, iFppp)
GO(XGetOCValues, pFpppppppppp) // use varargs
GO(XGetOMValues, pFp)
@@ -410,33 +410,33 @@ GO(dummy_XGetPixel, LFpii) // for the wrapper
GO(XGetPointerControl, iFpppp)
GO(XGetPointerMapping, iFppi)
GO(_XGetRequest, pFpuL)
-GO(XGetRGBColormaps, iFppppp)
-// _XGetScanlinePad
+GO(XGetRGBColormaps, iFpLppL)
+//GO(_XGetScanlinePad,
GO(XGetScreenSaver, iFppppp)
-GO(XGetSelectionOwner, pFpp)
+GO(XGetSelectionOwner, LFpL)
//GO(XGetSizeHints
-//GO(XGetStandardColormap
+GO(XGetStandardColormap, iFpLpL)
GOM(XGetSubImage, pFEppiiuuuipii)
-GO(XGetTextProperty, iFpppp)
-GO(XGetTransientForHint, iFppp)
+GO(XGetTextProperty, iFpLpL)
+GO(XGetTransientForHint, iFpLp)
GO(XGetVisualInfo, pFplpp)
GO(XGetWindowAttributes, iFppp)
-// _XGetWindowAttributes
-GO(XGetWindowProperty, iFpppllipppppp)
+//GO(_XGetWindowAttributes,
+GO(XGetWindowProperty, iFpLLlliLppppp)
//GO(XGetWMClientMachine
-GO(XGetWMColormapWindows, iFpppp)
-GO(XGetWMHints, pFpp)
+GO(XGetWMColormapWindows, iFpLpp)
+GO(XGetWMHints, pFpL)
GO(XGetWMIconName, iFppp)
-GO(XGetWMName, iFppp)
-GO(XGetWMNormalHints, iFpppp)
-//GO(XGetWMProtocols
-GO(XGetWMSizeHints, iFppppp)
+GO(XGetWMName, iFpLp)
+GO(XGetWMNormalHints, iFpLpp)
+GO(XGetWMProtocols, iFpLpp)
+GO(XGetWMSizeHints, iFpLppL)
//GO(XGetZoomHints
DATAB(_Xglobal_lock, sizeof(void*))
-GO(XGrabButton, iFpuupiuiipp)
-GO(XGrabKey, iFpiupiii)
-GO(XGrabKeyboard, iFppuiiL)
-GO(XGrabPointer, iFppiuiippL)
+GO(XGrabButton, iFpuuLiuiiLL)
+GO(XGrabKey, iFpiuLiii)
+GO(XGrabKeyboard, iFpLiiiL)
+GO(XGrabPointer, iFpLiuiiLLL)
GO(XGrabServer, iFp)
DATAB(_XHeadOfDisplayList, sizeof(void*))
GO(XHeightMMOfScreen, iFp)
@@ -445,56 +445,56 @@ DATAB(_Xi18n_lock, sizeof(void*))
GO(XIconifyWindow, iFppi)
GOM(XIfEvent, iFEpppp)
GO(XImageByteOrder, iFp)
-// _XIMCompileResourceList
-// _XimGetCharCode
-// _XimGetLocaleCode
-// _XimLookupMBText
-// _XimLookupUTF8Text
-// _XimLookupWCText
+//GO(_XIMCompileResourceList,
+//GO(_XimGetCharCode,
+//GO(_XimGetLocaleCode,
+//GO(_XimLookupMBText,
+//GO(_XimLookupUTF8Text,
+//GO(_XimLookupWCText,
GO(XIMOfIC, pFp)
-// _XimXTransBytesReadable
-// _XimXTransClose
-// _XimXTransCloseForCloning
-// _XimXTransConnect
-// _XimXTransDisconnect
-// _XimXTransFreeConnInfo
-// _XimXTransGetConnectionNumber
-// _XimXTransGetHostname
-// _XimXTransGetMyAddr
-// _XimXTransGetPeerAddr
-// _XimXTransIsLocal
-// _XimXTransOpenCLTSClient
-// _XimXTransOpenCOTSClient
-// _XimXTransRead
-// _XimXTransReadv
-// _XimXTransSetOption
+//GO(_XimXTransBytesReadable,
+//GO(_XimXTransClose,
+//GO(_XimXTransCloseForCloning,
+//GO(_XimXTransConnect,
+//GO(_XimXTransDisconnect,
+//GO(_XimXTransFreeConnInfo,
+//GO(_XimXTransGetConnectionNumber,
+//GO(_XimXTransGetHostname,
+//GO(_XimXTransGetMyAddr,
+//GO(_XimXTransGetPeerAddr,
+//GO(_XimXTransIsLocal,
+//GO(_XimXTransOpenCLTSClient,
+//GO(_XimXTransOpenCOTSClient,
+//GO(_XimXTransRead,
+//GO(_XimXTransReadv,
+//GO(_XimXTransSetOption,
DATA(_XimXTransSocketINET6Funcs, sizeof(void*))
DATA(_XimXTransSocketINETFuncs, sizeof(void*))
DATA(_XimXTransSocketLocalFuncs, sizeof(void*))
DATA(_XimXTransSocketTCPFuncs, sizeof(void*))
DATA(_XimXTransSocketUNIXFuncs, sizeof(void*))
-// _XimXTransWrite
-// _XimXTransWritev
-// _XInitDefaultIM
-// _XInitDefaultOM
+//GO(_XimXTransWrite,
+//GO(_XimXTransWritev,
+//GO(_XInitDefaultIM,
+//GO(_XInitDefaultOM,
DATAB(_XInitDisplayLock_fn, sizeof(void*))
-// _XInitDynamicIM
-// _XInitDynamicOM
+//GO(_XInitDynamicIM,
+//GO(_XInitDynamicOM,
GO(XInitExtension, pFpp)
GOM(XInitImage, iFEp)
-// _XInitImageFuncPtrs
-// _XInitKeysymDB
+//GO(_XInitImageFuncPtrs,
+//GO(_XInitKeysymDB,
GO(XInitThreads, iFv)
-//GO(XInsertModifiermapEntry
+GO(XInsertModifiermapEntry, pFpCi)
GO(XInstallColormap, iFpp)
GO(XInternalConnectionNumbers, iFppp)
-GO(XInternAtom, pFppi)
+GO(XInternAtom, LFppi)
GO(XInternAtoms, iFppiip)
GO(XIntersectRegion, iFppp)
GO(_XIOError, iFp)
DATAB(_XIOErrorFunction, sizeof(void*))
-// _XIsEventCookie
-//GO(XkbAddDeviceLedInfo
+//GO(_XIsEventCookie,
+GO(XkbAddDeviceLedInfo, pFpuu)
//GO(XkbAddGeomColor
//GO(XkbAddGeomDoodad
//GO(XkbAddGeomKey
@@ -507,11 +507,11 @@ DATAB(_XIOErrorFunction, sizeof(void*))
//GO(XkbAddGeomRow
//GO(XkbAddGeomSection
//GO(XkbAddGeomShape
-//GO(XkbAddKeyType
+GO(XkbAddKeyType, pFpLiii)
//GO(XkbAllocClientMap
-//GO(XkbAllocCompatMap
-//GO(XkbAllocControls
-//GO(XkbAllocDeviceInfo
+GO(XkbAllocCompatMap, iFpuu)
+GO(XkbAllocControls, iFpu)
+GO(XkbAllocDeviceInfo, pFuuu)
//GO(XkbAllocGeomColors
//GO(XkbAllocGeomDoodads
//GO(XkbAllocGeometry
@@ -527,38 +527,38 @@ DATAB(_XIOErrorFunction, sizeof(void*))
//GO(XkbAllocGeomSectionDoodads
//GO(XkbAllocGeomSections
//GO(XkbAllocGeomShapes
-//GO(XkbAllocIndicatorMaps
+GO(XkbAllocIndicatorMaps, iFp)
GO(XkbAllocKeyboard, pFv)
-//GO(XkbAllocNames
+GO(XkbAllocNames, iFpuii)
//GO(XkbAllocServerMap
-//GO(XkbApplyCompatMapToKey
-//GO(XkbApplyVirtualModChanges
-//GO(XkbBell
-//GO(XkbBellEvent
-//GO(XkbChangeDeviceInfo
+GO(XkbApplyCompatMapToKey, iFpCp)
+GO(XkbApplyVirtualModChanges, iFpup)
+GO(XkbBell, iFppip)
+GO(XkbBellEvent, iFpLiL)
+GO(XkbChangeDeviceInfo, iFppp)
//GO(XkbChangeEnabledControls
-//GO(XkbChangeKeycodeRange
-//GO(XkbChangeMap
-//GO(XkbChangeNames
-//GO(XkbChangeTypesOfKey
-//GO(XkbComputeEffectiveMap
+GO(XkbChangeKeycodeRange, iFpiip)
+GO(XkbChangeMap, iFppp)
+GO(XkbChangeNames, iFppp)
+GO(XkbChangeTypesOfKey, iFpiiupp)
+GO(XkbComputeEffectiveMap, iFppp)
//GO(XkbComputeRowBounds
//GO(XkbComputeSectionBounds
//GO(XkbComputeShapeBounds
//GO(XkbComputeShapeTop
-// _XkbCopyFromReadBuffer
-//GO(XkbCopyKeyType
-//GO(XkbCopyKeyTypes
+//GO(_XkbCopyFromReadBuffer,
+GO(XkbCopyKeyType, iFpp)
+GO(XkbCopyKeyTypes, iFppi)
//GO(XkbDeviceBell
-//GO(XkbDeviceBellEvent
+GO(XkbDeviceBellEvent, iFpLiiiiL)
//GO(XkbFindOverlayForKey
-//GO(XkbForceBell
-//GO(XkbForceDeviceBell
+GO(XkbForceBell, iFpi)
+GO(XkbForceDeviceBell, iFpiiii)
GO(XkbFreeClientMap, vFpui)
//GO(XkbFreeCompatMap
-//GO(XkbFreeComponentList
+GO(XkbFreeComponentList, vFp)
//GO(XkbFreeControls
-//GO(XkbFreeDeviceInfo
+GO(XkbFreeDeviceInfo, vFpui)
//GO(XkbFreeGeomColors
//GO(XkbFreeGeomDoodads
//GO(XkbFreeGeometry
@@ -573,21 +573,21 @@ GO(XkbFreeClientMap, vFpui)
//GO(XkbFreeGeomRows
//GO(XkbFreeGeomSections
//GO(XkbFreeGeomShapes
-//GO(XkbFreeIndicatorMaps
+GO(XkbFreeIndicatorMaps, vFp)
GO(XkbFreeKeyboard, vFpui)
GO(XkbFreeNames, vFpui)
-// _XkbFreeReadBuffer
+//GO(_XkbFreeReadBuffer,
//GO(XkbFreeServerMap
DATA(_XkbGetAtomNameFunc, sizeof(void*))
//GO(XkbGetAutoRepeatRate
-//GO(XkbGetAutoResetControls
-// _XkbGetCharset
+GO(XkbGetAutoResetControls, iFppp)
+//GO(_XkbGetCharset,
//GO(XkbGetCompatMap
-//GO(XkbGetControls
-// _XkbGetConverters
-//GO(XkbGetDetectableAutoRepeat
-//GO(XkbGetDeviceButtonActions
-//GO(XkbGetDeviceInfo
+GO(XkbGetControls, iFpLp)
+//GO(_XkbGetConverters,
+GO(XkbGetDetectableAutoRepeat, iFpp)
+GO(XkbGetDeviceButtonActions, iFppiuu)
+GO(XkbGetDeviceInfo, pFpuuuu)
//GO(XkbGetDeviceInfoChanges
//GO(XkbGetDeviceLedInfo
//GO(XkbGetGeometry
@@ -596,180 +596,180 @@ DATA(_XkbGetAtomNameFunc, sizeof(void*))
//GO(XkbGetKeyActions
//GO(XkbGetKeyBehaviors
GO(XkbGetKeyboard, pFpuu)
-//GO(XkbGetKeyboardByName
+GO(XkbGetKeyboardByName, pFpupuui)
//GO(XkbGetKeyExplicitComponents
//GO(XkbGetKeyModifierMap
//GO(XkbGetKeySyms
//GO(XkbGetKeyTypes
-//GO(XkbGetKeyVirtualModMap
+GO(XkbGetKeyVirtualModMap, iFpuup)
GO(XkbGetMap, pFpuu)
//GO(XkbGetMapChanges
-//GO(XkbGetNamedDeviceIndicator
+GO(XkbGetNamedDeviceIndicator, iFpuuuLpppp)
//GO(XkbGetNamedGeometry
-GO(XkbGetNamedIndicator, iFpuppppp)
+GO(XkbGetNamedIndicator, iFpLpppp)
GO(XkbGetNames, iFpup)
-//GO(XkbGetPerClientControls
-// _XkbGetReadBufferCountedString
-// _XkbGetReadBufferPtr
+GO(XkbGetPerClientControls, iFpp)
+//GO(_XkbGetReadBufferCountedString,
+//GO(_XkbGetReadBufferPtr,
GO(XkbGetState, iFpup)
GO(XkbGetUpdatedMap, iFpup)
//GO(XkbGetVirtualMods
-//GO(XkbGetXlibControls
-GO(XkbIgnoreExtension, iFp)
-//GO(XkbInitCanonicalKeyTypes
-// _XkbInitReadBuffer
+GO(XkbGetXlibControls, uFp)
+GO(XkbIgnoreExtension, iFi)
+GO(XkbInitCanonicalKeyTypes, iFpui)
+//GO(_XkbInitReadBuffer,
DATA(_XkbInternAtomFunc, sizeof(void*))
-GO(XkbKeycodeToKeysym, LFpuuu)
-GO(XkbKeysymToModifiers, uFpp)
-//GO(XkbKeyTypesForCoreSymbols
-//GO(XkbLatchGroup
-//GO(XkbLatchModifiers
+GO(XkbKeycodeToKeysym, LFpCii)
+GO(XkbKeysymToModifiers, uFpL)
+GO(XkbKeyTypesForCoreSymbols, iFpipupp)
+GO(XkbLatchGroup, iFpuu)
+GO(XkbLatchModifiers, iFpuuu)
GO(XkbLibraryVersion, iFpp)
-//GO(XkbListComponents
+GO(XkbListComponents, pFpupp)
//GO(XkbLockGroup
//GO(XkbLockModifiers
-//GO(XkbLookupKeyBinding
-GO(XkbLookupKeySym, iFpuupp)
-//GO(XkbNoteControlsChanges
-// _XkbNoteCoreMapChanges
-//GO(XkbNoteDeviceChanges
-//GO(XkbNoteMapChanges
-//GO(XkbNoteNameChanges
-//GO(XkbOpenDisplay
-// _XkbPeekAtReadBuffer
+GO(XkbLookupKeyBinding, iFpLupip)
+GO(XkbLookupKeySym, iFpCupp)
+GO(XkbNoteControlsChanges, vFppu)
+//GO(_XkbNoteCoreMapChanges,
+GO(XkbNoteDeviceChanges, vFppu)
+GO(XkbNoteMapChanges, vFppu)
+GO(XkbNoteNameChanges, vFppu)
+GO(XkbOpenDisplay, pFpppppp)
+//GO(_XkbPeekAtReadBuffer,
GO(XkbQueryExtension, iFpppppp)
-// _XkbReadBufferCopyKeySyms
-// _XkbReadCopyKeySyms
-// _XkbReadGetCompatMapReply
-// _XkbReadGetGeometryReply
-// _XkbReadGetIndicatorMapReply
-// _XkbReadGetMapReply
-// _XkbReadGetNamesReply
-//GO(XkbRefreshKeyboardMapping
-// _XkbReloadDpy
-//GO(XkbResizeDeviceButtonActions
-//GO(XkbResizeKeyActions
-//GO(XkbResizeKeySyms
-//GO(XkbResizeKeyType
+//GO(_XkbReadBufferCopyKeySyms,
+//GO(_XkbReadCopyKeySyms,
+//GO(_XkbReadGetCompatMapReply,
+//GO(_XkbReadGetGeometryReply,
+//GO(_XkbReadGetIndicatorMapReply,
+//GO(_XkbReadGetMapReply,
+//GO(_XkbReadGetNamesReply,
+GO(XkbRefreshKeyboardMapping, iFp)
+//GO(_XkbReloadDpy,
+GO(XkbResizeDeviceButtonActions, iFpu)
+GO(XkbResizeKeyActions, pFpii)
+GO(XkbResizeKeySyms, pFpii)
+GO(XkbResizeKeyType, iFpiiii)
GO(XkbSelectEventDetails, iFpuuLL)
GO(XkbSelectEvents, iFpuLL)
//GO(XkbSetAtomFuncs
//GO(XkbSetAutoRepeatRate
-//GO(XkbSetAutoResetControls
-//GO(XkbSetCompatMap
+GO(XkbSetAutoResetControls, iFpupp)
+GO(XkbSetCompatMap, iFpupi)
//GO(XkbSetControlslib
-//GO(XkbSetDebuggingFlags
+GO(XkbSetDebuggingFlags, iFpuupuupp)
GO(XkbSetDetectableAutoRepeat, iFpip)
-//GO(XkbSetDeviceButtonActions
-//GO(XkbSetDeviceInfo
-//GO(XkbSetDeviceLedInfo
+GO(XkbSetDeviceButtonActions, iFppuu)
+GO(XkbSetDeviceInfo, iFpup)
+GO(XkbSetDeviceLedInfo, iFppuuu)
//GO(XkbSetGeometry
-//GO(XkbSetIgnoreLockMods
+GO(XkbSetIgnoreLockMods, iFpuuuuu)
//GO(XkbSetIndicatorMap
-//GO(XkbSetMap
-//GO(XkbSetNamedDeviceIndicator
-//GO(XkbSetNamedIndicator
-//GO(XkbSetNames
+GO(XkbSetMap, iFpup)
+GO(XkbSetNamedDeviceIndicator, iFpuuuLiiip)
+GO(XkbSetNamedIndicator, iFpLiiip)
+GO(XkbSetNames, iFpuuup)
GO(XkbSetPerClientControls, iFpup)
//GO(XkbSetServerInternalMods
-//GO(XkbSetXlibControls
-// _XkbSkipReadBufferData
-//GO(XkbToControl
+GO(XkbSetXlibControls, uFpuu)
+//GO(_XkbSkipReadBufferData,
+GO(XkbToControl, CFC)
//GO(XkbTranslateKey
-GO(XkbTranslateKeyCode, iFpuupp)
+GO(XkbTranslateKeyCode, iFpCupp)
GO(XkbTranslateKeySym, iFppupip)
-//GO(XkbUpdateActionVirtualMods
-//GO(XkbUpdateKeyTypeVirtualMods
-//GO(XkbUpdateMapFromCore
+GO(XkbUpdateActionVirtualMods, iFppu)
+GO(XkbUpdateKeyTypeVirtualMods, vFppup)
+GO(XkbUpdateMapFromCore, iFpCiipp)
GO(XkbUseExtension, iFppp)
-//GO(XkbVirtualModsToReal
-// _XkbWriteCopyKeySyms
-//GO(XkbXlibControlsImplemented
-GO(XKeycodeToKeysym, pFppi)
-// _XKeycodeToKeysym
-// _XKeyInitialize
-GO(XKeysymToKeycode, uFpp)
-// _XKeysymToKeycode
-// _XKeysymToModifiers
-GO(XKeysymToString, pFp)
-// _XkeyTable // type r
+GO(XkbVirtualModsToReal, iFpup)
+//GO(_XkbWriteCopyKeySyms,
+GO(XkbXlibControlsImplemented, uFv)
+GO(XKeycodeToKeysym, LFpCi)
+//GO(_XKeycodeToKeysym,
+//GO(_XKeyInitialize,
+GO(XKeysymToKeycode, CFpL)
+//GO(_XKeysymToKeycode,
+//GO(_XKeysymToModifiers,
+GO(XKeysymToString, pFL)
+//GO(_XkeyTable // type r,
GO(XKillClient, iFpL)
GO(XLastKnownRequestProcessed, LFp)
-// _XlcAddCharSet
-// _XlcAddCT
-// _XlcAddGB18030LocaleConverters
-// _XlcAddLoader
-// _XlcAddUtf8Converters
-// _XlcAddUtf8LocaleConverters
-// _XlcCloseConverter
-// _XlcCompareISOLatin1
-// _XlcCompileResourceList
-// _XlcConvert
-// _XlcCopyFromArg
-// _XlcCopyToArg
-// _XlcCountVaList
-// _XlcCreateDefaultCharSet
-// _XlcCreateLC
-// _XlcCreateLocaleDataBase
-// _XlcCurrentLC
-// _XlcDbg_printValue
-// _XlcDefaultMapModifiers
-// _XlcDeInitLoader
-// _XlcDestroyLC
-// _XlcDestroyLocaleDataBase
-// _XlcDynamicLoad
-// _XlcFileName
+//GO(_XlcAddCharSet,
+//GO(_XlcAddCT,
+//GO(_XlcAddGB18030LocaleConverters,
+//GO(_XlcAddLoader,
+//GO(_XlcAddUtf8Converters,
+//GO(_XlcAddUtf8LocaleConverters,
+//GO(_XlcCloseConverter,
+//GO(_XlcCompareISOLatin1,
+//GO(_XlcCompileResourceList,
+//GO(_XlcConvert,
+//GO(_XlcCopyFromArg,
+//GO(_XlcCopyToArg,
+//GO(_XlcCountVaList,
+//GO(_XlcCreateDefaultCharSet,
+//GO(_XlcCreateLC,
+//GO(_XlcCreateLocaleDataBase,
+//GO(_XlcCurrentLC,
+//GO(_XlcDbg_printValue,
+//GO(_XlcDefaultMapModifiers,
+//GO(_XlcDeInitLoader,
+//GO(_XlcDestroyLC,
+//GO(_XlcDestroyLocaleDataBase,
+//GO(_XlcDynamicLoad,
+//GO(_XlcFileName,
DATA(_XlcGenericMethods, sizeof(void*))
-// _XlcGetCharSet
-// _XlcGetCharSetWithSide
-// _XlcGetCSValues
-// _XlcGetLocaleDataBase
-// _XlcGetResource
-// _XlcGetValues
-// _XlcInitCTInfo
-// _XlcInitLoader
-// _XlcLocaleDirName
-// _XlcLocaleLibDirName
-// _XlcMapOSLocaleName
-// _Xlcmbstoutf8
-// _Xlcmbstowcs
-// _Xlcmbtowc
-// _XlcNCompareISOLatin1
-// _XlcOpenConverter
-// _XlcParseCharSet
-// _XlcParse_scopemaps
+//GO(_XlcGetCharSet,
+//GO(_XlcGetCharSetWithSide,
+//GO(_XlcGetCSValues,
+//GO(_XlcGetLocaleDataBase,
+//GO(_XlcGetResource,
+//GO(_XlcGetValues,
+//GO(_XlcInitCTInfo,
+//GO(_XlcInitLoader,
+//GO(_XlcLocaleDirName,
+//GO(_XlcLocaleLibDirName,
+//GO(_XlcMapOSLocaleName,
+//GO(_Xlcmbstoutf8,
+//GO(_Xlcmbstowcs,
+//GO(_Xlcmbtowc,
+//GO(_XlcNCompareISOLatin1,
+//GO(_XlcOpenConverter,
+//GO(_XlcParseCharSet,
+//GO(_XlcParse_scopemaps,
DATA(_XlcPublicMethods, sizeof(void*))
-// _XlcRemoveLoader
-// _XlcResetConverter
-// _XlcResolveI18NPath
-// _XlcResolveLocaleName
-// _XlcSetConverter
-// _XlcSetValues
-// _XlcValidModSyntax
-// _XlcVaToArgList
-// _Xlcwcstombs
-// _Xlcwctomb
+//GO(_XlcRemoveLoader,
+//GO(_XlcResetConverter,
+//GO(_XlcResolveI18NPath,
+//GO(_XlcResolveLocaleName,
+//GO(_XlcSetConverter,
+//GO(_XlcSetValues,
+//GO(_XlcValidModSyntax,
+//GO(_XlcVaToArgList,
+//GO(_Xlcwcstombs,
+//GO(_Xlcwctomb,
GO(XListDepths, pFpip)
GO(XListExtensions, pFpp)
GO(XListFonts, pFppip)
GO(XListFontsWithInfo, pFppipp)
GO(XListHosts, pFppp)
-//GO(XListInstalledColormaps
+GO(XListInstalledColormaps, pFpLp)
GO(XListPixmapFormats, pFpp)
-GO(XListProperties, pFppp)
-GO(XLoadFont, pFpp)
+GO(XListProperties, pFpLp)
+GO(XLoadFont, LFpp)
GO(XLoadQueryFont, pFpp)
// xlocaledir
-//GO(XLocaleOfFontSet
+GO(XLocaleOfFontSet, pFp)
GO(XLocaleOfIM, pFp)
GO(XLocaleOfOM, pFp)
GO(XLockDisplay, vFp)
DATAB(_XLockMutex_fn, sizeof(void*))
-GO(XLookupColor, iFppppp)
-GO(XLookupKeysym, pFpi)
-// _XLookupKeysym
+GO(XLookupColor, iFpLppp)
+GO(XLookupKeysym, LFpi)
+//GO(_XLookupKeysym,
GO(XLookupString, iFppipp)
-// _XLookupString
+//GO(_XLookupString,
GO(XLowerWindow, iFpp)
GO(XMapRaised, iFpp)
GO(XMapSubwindows, iFpp)
@@ -781,37 +781,37 @@ GO(XMaxRequestSize, iFp)
//GO(XmbDrawImageString
GO(XmbDrawString, vFppppiipi)
//GO(XmbDrawText
-// _Xmblen
+GO(_Xmblen, iFpi)
GO(XmbLookupString, iFpppipp)
GO(XmbResetIC, pFp)
GO(XmbSetWMProperties, vFpppppippp)
-// _Xmbstoutf8
-// _Xmbstowcs
+//GO(_Xmbstoutf8,
+//GO(_Xmbstowcs,
GO(XmbTextEscapement, iFppi)
GO(XmbTextExtents, iFppipp)
GO(XmbTextListToTextProperty, iFppiip)
-// _XmbTextListToTextProperty
+//GO(_XmbTextListToTextProperty,
//GO(XmbTextPerCharExtents
GO(XmbTextPropertyToTextList, iFpppp)
-// _XmbTextPropertyToTextList
-// _Xmbtowc
+//GO(_XmbTextPropertyToTextList,
+GO(_Xmbtowc, iFppi)
//GO(XMinCmapsOfScreen
-GO(XMoveResizeWindow, iFppiiuu)
-GO(XMoveWindow, iFppii)
-//GO(XNewModifiermap
+GO(XMoveResizeWindow, iFpLiiuu)
+GO(XMoveWindow, iFpLii)
+GO(XNewModifiermap, pFi)
GO(XNextEvent, iFpp)
GO(XNextRequest, LFp)
GO(XNoOp, iFp)
-// _XNoticeCreateBitmap
-// _XNoticePutBitmap
+//GO(_XNoticeCreateBitmap,
+//GO(_XNoticePutBitmap,
GO(XOffsetRegion, iFpii)
GO(XOMOfOC, pFp)
GOM(XOpenDisplay, pFEp)
GO(XOpenIM, pFpppp)
-// _XOpenLC
+//GO(_XOpenLC,
GO(XOpenOM, pFpppp)
-// _XParseBaseFontNameList
-GO(XParseColor, iFpppp)
+//GO(_XParseBaseFontNameList,
+GO(XParseColor, iFpLpp)
GO(XParseGeometry, iFppppp)
GO(XPeekEvent, iFpp)
GOM(XPeekIfEvent, iFEpppp)
@@ -819,63 +819,63 @@ GO(XPending, iFp)
//GO(Xpermalloc
GO(XPlanesOfScreen, iFp)
GO(XPointInRegion, iFpp)
-// _XPollfdCacheAdd
-// _XPollfdCacheDel
-// _XPollfdCacheInit
+//GO(_XPollfdCacheAdd,
+//GO(_XPollfdCacheDel,
+//GO(_XPollfdCacheInit,
GO(XPolygonRegion, pFpii)
GO(XProcessInternalConnection, vFpi)
-// _XProcessInternalConnection
-// _XProcessWindowAttributes
+//GO(_XProcessInternalConnection,
+//GO(_XProcessWindowAttributes,
GO(XProtocolRevision, iFp)
GO(XProtocolVersion, iFp)
GO(XPutBackEvent, iFpp)
-// _XPutBackEvent
+//GO(_XPutBackEvent,
GOM(XPutImage, iFEppppiiiiuu)
//GO(XPutPixel
GO(XQLength, iFp)
GO(XQueryBestCursor, iFppuupp)
-//GO(XQueryBestSize
+GO(XQueryBestSize, iFpiLuupp)
//GO(XQueryBestStipple
-//GO(XQueryBestTile
+GO(XQueryBestTile, iFpLuupp)
GO(XQueryColor, iFppp)
GO(XQueryColors, iFpppi)
GOM(XQueryExtension, iFEppppp)
GO(XQueryFont, pFpL)
GO(XQueryKeymap, iFpp)
-GO(XQueryPointer, iFppppppppp)
+GO(XQueryPointer, iFpLppppppp)
GO(XQueryTextExtents, iFpLpipppp)
GO(XQueryTextExtents16, iFpLpipppp)
-GO(XQueryTree, pFpppppp)
+GO(XQueryTree, iFpLpppp)
GO(XRaiseWindow, iFpp)
GO(_XRead, iFppi)
-//GO(XReadBitmapFile
-//GO(XReadBitmapFileData
-// _XReadEvents
+GO(XReadBitmapFile, iFpLpppppp)
+GO(XReadBitmapFileData, iFpppppp)
+GO(_XReadEvents, vFp)
GO(_XReadPad, vFppi)
-GO(XRebindKeysym, iFpppipi)
-GO(XRecolorCursor, iFpppp)
-GO(XReconfigureWMWindow, iFppiup)
+GO(XRebindKeysym, iFpLpipi)
+GO(XRecolorCursor, iFpLpp)
+GO(XReconfigureWMWindow, iFpLiup)
GO(XRectInRegion, iFpiiuu)
GO(XRefreshKeyboardMapping, iFp)
-// _XRefreshKeyboardMapping
-// _XRegisterFilterByMask
-// _XRegisterFilterByType
+//GO(_XRefreshKeyboardMapping,
+//GO(_XRegisterFilterByMask,
+//GO(_XRegisterFilterByType,
GOM(XRegisterIMInstantiateCallback, iFEpppppp)
-// _XRegisterInternalConnection
+//GO(_XRegisterInternalConnection,
GOM(XRemoveConnectionWatch, iFEppp)
//GO(XRemoveFromSaveSet
-GO(XRemoveHost, vFpp)
-GO(XRemoveHosts, vFppi)
-GO(XReparentWindow, iFpppii)
+GO(XRemoveHost, iFpp)
+GO(XRemoveHosts, iFppi)
+GO(XReparentWindow, iFpLLii)
GO(_XReply, iFppii)
GO(XResetScreenSaver, iFp)
-GO(XResizeWindow, iFppuu)
+GO(XResizeWindow, iFpLuu)
GO(XResourceManagerString, pFp)
GO(XRestackWindows, iFppi)
-// _XReverse_Bytes
+//GO(_XReverse_Bytes,
GO(XrmCombineDatabase, vFppi)
GO(XrmCombineFileDatabase, iFppi)
-// _XrmDefaultInitParseInfo
+//GO(_XrmDefaultInitParseInfo,
GO(XrmDestroyDatabase, vFp)
//GOM(XrmEnumerateDatabase
GO(XrmGetDatabase, pFp)
@@ -883,8 +883,8 @@ GO(XrmGetFileDatabase, pFp)
GO(XrmGetResource, iFppppp)
GO(XrmGetStringDatabase, pFp)
GO(XrmInitialize, vFv)
-// _XrmInitParseInfo
-// _XrmInternalStringToQuark
+//GO(_XrmInitParseInfo,
+//GO(_XrmInternalStringToQuark,
//GO(XrmLocaleOfDatabase
//GO(XrmMergeDatabases
//GO(XrmParseCommand
@@ -904,189 +904,189 @@ GO(XrmInitialize, vFv)
//GO(XrmStringToQuark
//GO(XrmStringToQuarkList
GO(XrmUniqueQuark, iFv) //typedef int XrmQuark, *XrmQuarkList;
-GO(XRootWindow, pFpi)
-GO(XRootWindowOfScreen, pFp)
+GO(XRootWindow, LFpi)
+GO(XRootWindowOfScreen, LFp)
GO(XRotateBuffers, iFpi)
-GO(XRotateWindowProperties, iFpppii)
+GO(XRotateWindowProperties, iFpLpii)
GO(XSaveContext, iFpLip)
GO(XScreenCount, iFp)
GO(XScreenNumberOfScreen, iFp)
GO(XScreenOfDisplay, pFpi)
-// _XScreenOfWindow
-//GO(XScreenResourceString
-GO(XSelectInput, iFppi)
+//GO(_XScreenOfWindow,
+GO(XScreenResourceString, pFp)
+GO(XSelectInput, iFpLl)
GO(_XSend, vFppi)
-GO(XSendEvent, uFppiip)
+GO(XSendEvent, iFpLilp)
GO(XServerVendor, pFp)
GO(XSetAccessControl, vFpi)
GOM(XSetAfterFunction, pFEpp)
GO(XSetArcMode, iFppi)
-//GO(XSetAuthorization
+GO(XSetAuthorization, vFpipi)
GO(XSetBackground, iFppL)
-GO(XSetClassHint, iFppp)
+GO(XSetClassHint, iFpLp)
GO(XSetClipMask, iFppp)
GO(XSetClipOrigin, iFppii)
GO(XSetClipRectangles, iFppiipii)
-// _XSetClipRectangles
+//GO(_XSetClipRectangles,
GO(XSetCloseDownMode, iFpi)
-GO(XSetCommand, iFpppi)
+GO(XSetCommand, iFpLpi)
GO(XSetDashes, iFppipi)
GOM(XSetErrorHandler, pFEp)
GO(XSetFillRule, iFppi)
GO(XSetFillStyle, iFppp)
-GO(XSetFont, iFppp)
+GO(XSetFont, iFppL)
GO(XSetFontPath, iFppi)
GO(XSetForeground, iFppL)
GO(XSetFunction, iFppi)
GO(XSetGraphicsExposures, iFppi)
GO(XSetICFocus, vFp)
GO(XSetIconName, iFppp)
-//GO(XSetIconSizes
+GO(XSetIconSizes, iFpLpi)
GOM(XSetICValues, pFEpV) // use vaarg
-// _XSetImage
+//GO(_XSetImage,
GOM(XSetIMValues, pFEpV) // use vaarg
-GO(XSetInputFocus, iFppiL)
+GO(XSetInputFocus, iFpLiL)
GOM(XSetIOErrorHandler, pFEp)
GO(_XSetLastRequestRead, uFpp)
GO(XSetLineAttributes, iFppuiii)
GO(XSetLocaleModifiers, pFp)
-//GO(XSetModifierMapping
+GO(XSetModifierMapping, iFpp)
GO(XSetNormalHints, iFpppp)
GO(XSetOCValues, pFpppppppppppppppp) // use vaarg
GO(XSetOMValues, pFp)
-//GO(XSetPlaneMask
-//GO(XSetPointerMapping
+GO(XSetPlaneMask, iFppL)
+GO(XSetPointerMapping, iFppi)
GO(XSetRegion, iFppp)
-//GO(XSetRGBColormaps
+GO(XSetRGBColormaps, vFpLpiL)
GO(XSetScreenSaver, iFpiiii)
-GO(XSetSelectionOwner, iFpppL)
-//GO(XSetSizeHints
-//GO(XSetStandardColormap
-GO(XSetStandardProperties, iFpppppppp)
-//GO(XSetState
+GO(XSetSelectionOwner, iFpLLL)
+GO(XSetSizeHints, iFpLpL)
+GO(XSetStandardColormap, vFpLpL)
+GO(XSetStandardProperties, iFpLppLpip)
+GO(XSetState, iFppLLiL)
GO(XSetStipple, iFppp)
GO(XSetSubwindowMode, iFppi)
-GO(XSetTextProperty, vFpppp)
-GO(XSetTile, iFppp)
-GO(XSetTransientForHint, iFppp)
+GO(XSetTextProperty, vFpLpL)
+GO(XSetTile, iFppL)
+GO(XSetTransientForHint, iFpLL)
GO(XSetTSOrigin, iFppii)
GO(XSetWindowBackground, iFppu)
GO(XSetWindowBackgroundPixmap, iFppp)
-//GO(XSetWindowBorder
-//GO(XSetWindowBorderPixmap
-GO(XSetWindowBorderWidth, iFppu)
-GO(XSetWindowColormap, iFppp)
+GO(XSetWindowBorder, iFpLL)
+GO(XSetWindowBorderPixmap, iFpLL)
+GO(XSetWindowBorderWidth, iFpLu)
+GO(XSetWindowColormap, iFpLL)
GO(XSetWMClientMachine, vFppp)
-GO(XSetWMColormapWindows, iFpppi)
-GO(XSetWMHints, iFppp)
+GO(XSetWMColormapWindows, iFpLpi)
+GO(XSetWMHints, iFpLp)
GO(XSetWMIconName, vFppp)
-GO(XSetWMName, vFppp)
-GO(XSetWMNormalHints, iFppp)
-GO(XSetWMProperties, vFpppppippp)
-GO(XSetWMProtocols, iFpppi)
-GO(XSetWMSizeHints, vFpppu)
-//GO(XSetZoomHints
+GO(XSetWMName, vFpLp)
+GO(XSetWMNormalHints, vFpLp)
+GO(XSetWMProperties, vFpLpppippp)
+GO(XSetWMProtocols, iFpLpi)
+GO(XSetWMSizeHints, vFpLpL)
+GO(XSetZoomHints, iFpLp)
GO(XShrinkRegion, iFpii)
-//GO(XStoreBuffer
-//GO(XStoreBytes
-GO(XStoreColor, iFppp)
-GO(XStoreColors, iFpppi)
-// _XStoreEventCookie
-GO(XStoreName, iFppp)
-//GO(XStoreNamedColor
+GO(XStoreBuffer, iFppii)
+GO(XStoreBytes, iFppi)
+GO(XStoreColor, iFpLp)
+GO(XStoreColors, iFpLpi)
+//GO(_XStoreEventCookie,
+GO(XStoreName, iFpLp)
+GO(XStoreNamedColor, iFpLpLi)
GO(XStringListToTextProperty, iFpip)
-GO(XStringToKeysym, pFp)
+GO(XStringToKeysym, LFp)
//GOM(XSubImage, pFEpiiuu) // need unbridging
GO(dummy_XSubImage, pFpiiuu) // for the wrapper
GO(XSubtractRegion, iFppp)
GO(XSupportsLocale, iFv)
-GO(XSync, iFpu)
+GO(XSync, iFpi)
GOM(XSynchronize, pFEpi)
GO(XTextExtents, iFppipppp)
GO(XTextExtents16, iFppipppp)
-// _XTextHeight
-// _XTextHeight16
-//GO(XTextPropertyToStringList
+GO(_XTextHeight, iFppi)
+GO(_XTextHeight16, iFppi)
+GO(XTextPropertyToStringList, iFppp)
GO(XTextWidth, iFppi)
GO(XTextWidth16, iFppi)
DATAB(_Xthread_self_fn, sizeof(void*))
-GO(XTranslateCoordinates, iFpppiippp)
-// _XTranslateKey
-// _XTranslateKeySym
-// _XTryShapeBitmapCursor
+GO(XTranslateCoordinates, iFpLLiippp)
+//GO(_XTranslateKey,
+//GO(_XTranslateKeySym,
+//GO(_XTryShapeBitmapCursor,
GO(XUndefineCursor, iFpp)
-//GO(XUngrabButton
-GO(XUngrabKey, iFpiup)
+GO(XUngrabButton, iFpuuL)
+GO(XUngrabKey, iFpiuL)
GO(XUngrabKeyboard, iFpL)
GO(XUngrabPointer, iFpL)
GO(XUngrabServer, iFp)
-GO(XUninstallColormap, iFpp)
+GO(XUninstallColormap, iFpL)
GO(XUnionRectWithRegion, iFppp)
GO(XUnionRegion, iFppp)
-// _XUnknownCopyEventCookie
-// _XUnknownNativeEvent
-// _XUnknownWireEvent
-// _XUnknownWireEventCookie
-GO(XUnloadFont, iFpp)
+//GO(_XUnknownCopyEventCookie,
+//GO(_XUnknownNativeEvent,
+//GO(_XUnknownWireEvent,
+//GO(_XUnknownWireEventCookie,
+GO(XUnloadFont, iFpL)
GO(XUnlockDisplay, vFp)
DATAB(_XUnlockMutex_fn, sizeof(void*))
GO(XUnmapSubwindows, iFpp)
-GO(XUnmapWindow, iFpp)
-// _XUnregisterFilter
+GO(XUnmapWindow, iFpL)
+//GO(_XUnregisterFilter,
GOM(XUnregisterIMInstantiateCallback, iFEpppppp)
-// _XUnregisterInternalConnection
-// _XUnresolveColor
+//GO(_XUnregisterInternalConnection,
+//GO(_XUnresolveColor,
GO(XUnsetICFocus, vFp)
-// _XUpdateAtomCache
-// _XUpdateGCCache
-//GO(Xutf8DrawImageString
+//GO(_XUpdateAtomCache,
+//GO(_XUpdateGCCache,
+GO(Xutf8DrawImageString, vFpLppiipi)
GO(Xutf8DrawString, vFppppiipi)
-//GO(Xutf8DrawText
-GO(Xutf8LookupString, iFLppipp)
-GO(Xutf8ResetIC, pFL)
-GO(Xutf8SetWMProperties, vFpppppippp)
-//GO(Xutf8TextEscapement
+GO(Xutf8DrawText, vFpLpiipi)
+GO(Xutf8LookupString, iFpppipp)
+GO(Xutf8ResetIC, pFp)
+GO(Xutf8SetWMProperties, vFpLpppippp)
+GO(Xutf8TextEscapement, iFppi)
GO(Xutf8TextExtents, iFppipp)
GO(Xutf8TextListToTextProperty, iFppiup)
-// _Xutf8TextListToTextProperty
-//GO(Xutf8TextPerCharExtents
+//GO(_Xutf8TextListToTextProperty,
+GO(Xutf8TextPerCharExtents, iFppippippp)
GO(Xutf8TextPropertyToTextList, iFpppp)
-// _Xutf8TextPropertyToTextList
+//GO(_Xutf8TextPropertyToTextList,
GOM(XVaCreateNestedList, pFEiV)
GO(XVendorRelease, iFp)
-// _XVIDtoVisual
+//GO(_XVIDtoVisual,
GO(XVisualIDFromVisual, LFp)
-GO(XWarpPointer, iFpppiiuuii)
-//GO(XwcDrawImageString
+GO(XWarpPointer, iFpLLiiuuii)
+GO(XwcDrawImageString, vFpLppiipi)
GO(XwcDrawString, vFppppiipi)
-//GO(XwcDrawText
+GO(XwcDrawText, vFpLpiipi)
GO(XwcFreeStringList, vFp)
-// _XwcFreeStringList
+//GO(_XwcFreeStringList,
GO(XwcLookupString, iFpppipp)
-//GO(XwcResetIC
-// _Xwcscmp
-// _Xwcscpy
-// _Xwcslen
-// _Xwcsncmp
-// _Xwcsncpy
-// _Xwcstombs
+GO(XwcResetIC, pFp)
+//GO(_Xwcscmp,
+//GO(_Xwcscpy,
+//GO(_Xwcslen,
+//GO(_Xwcsncmp,
+//GO(_Xwcsncpy,
+//GO(_Xwcstombs,
GO(XwcTextEscapement, iFppi)
GO(XwcTextExtents, iFppipp)
-GO(XwcTextListToTextProperty, iFppiip)
-// _XwcTextListToTextProperty
-//GO(XwcTextPerCharExtents
+GO(XwcTextListToTextProperty, iFppiup)
+//GO(_XwcTextListToTextProperty,
+GO(XwcTextPerCharExtents, iFppippippp)
GO(XwcTextPropertyToTextList, iFpppp)
-// _XwcTextPropertyToTextList
-// _Xwctomb
-//GO(XWhitePixel
-//GO(XWhitePixelOfScreen
+//GO(_XwcTextPropertyToTextList,
+GO(_Xwctomb, iFpu)
+GO(XWhitePixel, LFpi)
+GO(XWhitePixelOfScreen, LFp)
//GO(XWidthMMOfScreen
GO(XWidthOfScreen, iFp)
-GO(XWindowEvent, iFpplp)
+GO(XWindowEvent, iFpLlp)
GO(_XWireToEvent, iFppp)
GO(XWithdrawWindow, iFppi)
-//GO(XWMGeometry
-//GO(XWriteBitmapFile
+GO(XWMGeometry, iFpippupppppp)
+GO(XWriteBitmapFile, iFppLuuii)
GO(XXorRegion, iFppp)
GO(_XData32, iFppu)
diff --git a/src/wrapped/wrappedlibxau.c b/src/wrapped/wrappedlibxau.c
index 7537eb0..7537eb0 100755..100644
--- a/src/wrapped/wrappedlibxau.c
+++ b/src/wrapped/wrappedlibxau.c
diff --git a/src/wrapped/wrappedlibxau_private.h b/src/wrapped/wrappedlibxau_private.h
index fae289d..fae289d 100755..100644
--- a/src/wrapped/wrappedlibxau_private.h
+++ b/src/wrapped/wrappedlibxau_private.h
diff --git a/src/wrapped/wrappedlibxcb.c b/src/wrapped/wrappedlibxcb.c
index d3798d4..d3798d4 100755..100644
--- a/src/wrapped/wrappedlibxcb.c
+++ b/src/wrapped/wrappedlibxcb.c
diff --git a/src/wrapped/wrappedlibxcb_private.h b/src/wrapped/wrappedlibxcb_private.h
index 470624e..10988e2 100755..100644
--- a/src/wrapped/wrappedlibxcb_private.h
+++ b/src/wrapped/wrappedlibxcb_private.h
@@ -148,7 +148,7 @@ GO(xcb_create_gc_checked, pFpuuup)
GO(xcb_create_glyph_cursor, pFpuuuWWWWWWWW)
//GO(xcb_create_glyph_cursor_checked,
GO(xcb_create_pixmap, pFpCuuWW)
-//GO(xcb_create_pixmap_checked,
+GO(xcb_create_pixmap_checked, pFpCuuWW)
GO(xcb_create_window, pFpCuuwwWWWWuup)
//GO(xcb_create_window_aux,
//GO(xcb_create_window_aux_checked,
@@ -460,7 +460,7 @@ GO(xcb_poly_segment, pFpuuup)
//GO(xcb_poly_text_8_sizeof,
GO(xcb_popcount, iFu)
GO(xcb_prefetch_extension_data, vFpp)
-//GO(xcb_prefetch_maximum_request_length,
+GO(xcb_prefetch_maximum_request_length, vFp)
GO(xcb_put_image, pFpCuuWWwwCCup)
//GO(xcb_put_image_checked,
//GO(xcb_put_image_data,
@@ -533,7 +533,7 @@ GO(xcb_screen_next, vFp)
//GO(xcb_segment_next,
GO(xcb_send_event, pFpCpup)
GO(xcb_send_event_checked, pFpCpup)
-//GO(xcb_send_fd,
+GO(xcb_send_fd, vFpi)
GO(xcb_send_request, uFpipp)
GO(xcb_send_request64, UFpipp)
GO(xcb_send_request_with_fds, uFpippup)
@@ -622,7 +622,7 @@ GO(xcb_setup_roots_length, iFp)
//GO(xcb_str_name_end,
//GO(xcb_str_name_length,
//GO(xcb_str_next,
-//GO(xcb_str_sizeof,
+GO(xcb_str_sizeof, iFp)
//GO(xcb_sumof,
//GO(xcb_take_socket,
//GO(xcb_timecoord_end,
diff --git a/src/wrapped/wrappedlibxcbdri2.c b/src/wrapped/wrappedlibxcbdri2.c
index 4745c51..4745c51 100755..100644
--- a/src/wrapped/wrappedlibxcbdri2.c
+++ b/src/wrapped/wrappedlibxcbdri2.c
diff --git a/src/wrapped/wrappedlibxcbdri2_private.h b/src/wrapped/wrappedlibxcbdri2_private.h
index d9efcec..313c209 100755..100644
--- a/src/wrapped/wrappedlibxcbdri2_private.h
+++ b/src/wrapped/wrappedlibxcbdri2_private.h
@@ -2,8 +2,6 @@
#error meh!
#endif
-//%S x my_xcb_cookie_t u
-
//GO(xcb_dri2_attach_format_end,
//GO(xcb_dri2_attach_format_next,
GO(xcb_dri2_authenticate, pFpuu)
diff --git a/src/wrapped/wrappedlibxcbdri3.c b/src/wrapped/wrappedlibxcbdri3.c
index a0a8542..a0a8542 100755..100644
--- a/src/wrapped/wrappedlibxcbdri3.c
+++ b/src/wrapped/wrappedlibxcbdri3.c
diff --git a/src/wrapped/wrappedlibxcbdri3_private.h b/src/wrapped/wrappedlibxcbdri3_private.h
index 2490657..b46a1be 100755..100644
--- a/src/wrapped/wrappedlibxcbdri3_private.h
+++ b/src/wrapped/wrappedlibxcbdri3_private.h
@@ -41,7 +41,7 @@ GO(xcb_dri3_open, pFpuu)
GO(xcb_dri3_open_reply, pFpup)
GO(xcb_dri3_open_reply_fds, pFpp)
//GO(xcb_dri3_open_unchecked,
-//GO(xcb_dri3_pixmap_from_buffer,
+GO(xcb_dri3_pixmap_from_buffer, pFpuuuWWWCCi)
GO(xcb_dri3_pixmap_from_buffer_checked, pFpuuuWWWCCi)
//GO(xcb_dri3_pixmap_from_buffers,
//GO(xcb_dri3_pixmap_from_buffers_checked,
diff --git a/src/wrapped/wrappedlibxcbimage.c b/src/wrapped/wrappedlibxcbimage.c
index 906e5eb..906e5eb 100755..100644
--- a/src/wrapped/wrappedlibxcbimage.c
+++ b/src/wrapped/wrappedlibxcbimage.c
diff --git a/src/wrapped/wrappedlibxcbimage_private.h b/src/wrapped/wrappedlibxcbimage_private.h
index 0127ba2..0127ba2 100755..100644
--- a/src/wrapped/wrappedlibxcbimage_private.h
+++ b/src/wrapped/wrappedlibxcbimage_private.h
diff --git a/src/wrapped/wrappedlibxcbkeysyms.c b/src/wrapped/wrappedlibxcbkeysyms.c
index 909c904..909c904 100755..100644
--- a/src/wrapped/wrappedlibxcbkeysyms.c
+++ b/src/wrapped/wrappedlibxcbkeysyms.c
diff --git a/src/wrapped/wrappedlibxcbkeysyms_private.h b/src/wrapped/wrappedlibxcbkeysyms_private.h
index 0a1b0a5..0a1b0a5 100755..100644
--- a/src/wrapped/wrappedlibxcbkeysyms_private.h
+++ b/src/wrapped/wrappedlibxcbkeysyms_private.h
diff --git a/src/wrapped/wrappedlibxcbrandr.c b/src/wrapped/wrappedlibxcbrandr.c
index 0b4387e..0b4387e 100755..100644
--- a/src/wrapped/wrappedlibxcbrandr.c
+++ b/src/wrapped/wrappedlibxcbrandr.c
diff --git a/src/wrapped/wrappedlibxcbrandr_private.h b/src/wrapped/wrappedlibxcbrandr_private.h
index 860da1b..47a9c4c 100755..100644
--- a/src/wrapped/wrappedlibxcbrandr_private.h
+++ b/src/wrapped/wrappedlibxcbrandr_private.h
@@ -88,12 +88,12 @@ GO(xcb_randr_get_crtc_info_unchecked, pFpppu)
//GO(xcb_randr_get_crtc_transform_reply,
//GO(xcb_randr_get_crtc_transform_sizeof,
//GO(xcb_randr_get_crtc_transform_unchecked,
-//GO(xcb_randr_get_monitors,
-//GO(xcb_randr_get_monitors_monitors_iterator,
-//GO(xcb_randr_get_monitors_monitors_length,
-//GO(xcb_randr_get_monitors_reply,
-//GO(xcb_randr_get_monitors_sizeof,
-//GO(xcb_randr_get_monitors_unchecked,
+GO(xcb_randr_get_monitors, pFppuC)
+GO(xcb_randr_get_monitors_monitors_iterator, pFpp)
+GO(xcb_randr_get_monitors_monitors_length, iFp)
+GO(xcb_randr_get_monitors_reply, pFpup)
+GO(xcb_randr_get_monitors_sizeof, iFp)
+GO(xcb_randr_get_monitors_unchecked, pFppuC)
GO(xcb_randr_get_output_info, pFpppu)
//GO(xcb_randr_get_output_info_clones,
//GO(xcb_randr_get_output_info_clones_end,
@@ -217,14 +217,14 @@ DATA(xcb_randr_id, 8)
//GO(xcb_randr_list_provider_properties_unchecked,
//GO(xcb_randr_mode_end,
//GO(xcb_randr_mode_info_end,
-//GO(xcb_randr_mode_info_next,
+GO(xcb_randr_mode_info_next, vFp)
//GO(xcb_randr_mode_next,
-//GO(xcb_randr_monitor_info_end,
-//GO(xcb_randr_monitor_info_next,
-//GO(xcb_randr_monitor_info_outputs,
-//GO(xcb_randr_monitor_info_outputs_end,
-//GO(xcb_randr_monitor_info_outputs_length,
-//GO(xcb_randr_monitor_info_sizeof,
+GO(xcb_randr_monitor_info_end, pFpp)
+GO(xcb_randr_monitor_info_next, vFp)
+GO(xcb_randr_monitor_info_outputs, pFp)
+GO(xcb_randr_monitor_info_outputs_end, pFpp)
+GO(xcb_randr_monitor_info_outputs_length, iFp)
+GO(xcb_randr_monitor_info_sizeof, iFp)
//GO(xcb_randr_notify_data_end,
//GO(xcb_randr_notify_data_next,
//GO(xcb_randr_output_change_end,
diff --git a/src/wrapped/wrappedlibxcbshape.c b/src/wrapped/wrappedlibxcbshape.c
index 3dc9c69..3dc9c69 100755..100644
--- a/src/wrapped/wrappedlibxcbshape.c
+++ b/src/wrapped/wrappedlibxcbshape.c
diff --git a/src/wrapped/wrappedlibxcbshape_private.h b/src/wrapped/wrappedlibxcbshape_private.h
index 61f405b..e46fada 100755..100644
--- a/src/wrapped/wrappedlibxcbshape_private.h
+++ b/src/wrapped/wrappedlibxcbshape_private.h
@@ -4,11 +4,11 @@
GO(xcb_shape_combine, pFpuuupwwp)
GO(xcb_shape_combine_checked, pFpuuupwwp)
-//GO(xcb_shape_get_rectangles,
-//GO(xcb_shape_get_rectangles_rectangles,
+GO(xcb_shape_get_rectangles, pFppi)
+GO(xcb_shape_get_rectangles_rectangles, pFp)
//GO(xcb_shape_get_rectangles_rectangles_iterator,
-//GO(xcb_shape_get_rectangles_rectangles_length,
-//GO(xcb_shape_get_rectangles_reply,
+GO(xcb_shape_get_rectangles_rectangles_length, iFp)
+GO(xcb_shape_get_rectangles_reply, pFpup)
//GO(xcb_shape_get_rectangles_sizeof,
//GO(xcb_shape_get_rectangles_unchecked,
DATA(xcb_shape_id, 8)
@@ -29,7 +29,7 @@ GO(xcb_shape_mask_checked, pFpuuuwwu)
GO(xcb_shape_query_version, pFp)
GO(xcb_shape_query_version_reply, pFppp)
GO(xcb_shape_query_version_unchecked, pFp)
-//GO(xcb_shape_rectangles,
+GO(xcb_shape_rectangles, pFpiiCpWWup)
//GO(xcb_shape_rectangles_checked,
//GO(xcb_shape_rectangles_rectangles,
//GO(xcb_shape_rectangles_rectangles_iterator,
diff --git a/src/wrapped/wrappedlibxcbshm.c b/src/wrapped/wrappedlibxcbshm.c
index 218304c..218304c 100755..100644
--- a/src/wrapped/wrappedlibxcbshm.c
+++ b/src/wrapped/wrappedlibxcbshm.c
diff --git a/src/wrapped/wrappedlibxcbshm_private.h b/src/wrapped/wrappedlibxcbshm_private.h
index cf6de17..cf6de17 100755..100644
--- a/src/wrapped/wrappedlibxcbshm_private.h
+++ b/src/wrapped/wrappedlibxcbshm_private.h
diff --git a/src/wrapped/wrappedlibxcbxfixes.c b/src/wrapped/wrappedlibxcbxfixes.c
index e41c3b8..e41c3b8 100755..100644
--- a/src/wrapped/wrappedlibxcbxfixes.c
+++ b/src/wrapped/wrappedlibxcbxfixes.c
diff --git a/src/wrapped/wrappedlibxcbxfixes_private.h b/src/wrapped/wrappedlibxcbxfixes_private.h
index f54d762..e17787d 100755..100644
--- a/src/wrapped/wrappedlibxcbxfixes_private.h
+++ b/src/wrapped/wrappedlibxcbxfixes_private.h
@@ -91,12 +91,12 @@ GO(xcb_xfixes_query_version_unchecked, pFpuu)
//GO(xcb_xfixes_select_cursor_input_checked,
GO(xcb_xfixes_select_selection_input, pFppppu)
GO(xcb_xfixes_select_selection_input_checked, pFppppu)
-//GO(xcb_xfixes_set_cursor_name,
-//GO(xcb_xfixes_set_cursor_name_checked,
-//GO(xcb_xfixes_set_cursor_name_name,
-//GO(xcb_xfixes_set_cursor_name_name_end,
-//GO(xcb_xfixes_set_cursor_name_name_length,
-//GO(xcb_xfixes_set_cursor_name_sizeof,
+GO(xcb_xfixes_set_cursor_name, pFppWp)
+GO(xcb_xfixes_set_cursor_name_checked, pFppWp)
+GO(xcb_xfixes_set_cursor_name_name, pFp)
+GO(xcb_xfixes_set_cursor_name_name_end, pFp)
+GO(xcb_xfixes_set_cursor_name_name_length, iFp)
+GO(xcb_xfixes_set_cursor_name_sizeof, iFp)
//GO(xcb_xfixes_set_gc_clip_region,
//GO(xcb_xfixes_set_gc_clip_region_checked,
//GO(xcb_xfixes_set_picture_clip_region,
diff --git a/src/wrapped/wrappedlibxcbxtest.c b/src/wrapped/wrappedlibxcbxtest.c
index b08fb35..b08fb35 100755..100644
--- a/src/wrapped/wrappedlibxcbxtest.c
+++ b/src/wrapped/wrappedlibxcbxtest.c
diff --git a/src/wrapped/wrappedlibxcbxtest_private.h b/src/wrapped/wrappedlibxcbxtest_private.h
index 2772570..2772570 100755..100644
--- a/src/wrapped/wrappedlibxcbxtest_private.h
+++ b/src/wrapped/wrappedlibxcbxtest_private.h
diff --git a/src/wrapped/wrappedlibxcomposite.c b/src/wrapped/wrappedlibxcomposite.c
index bb0394b..bb0394b 100755..100644
--- a/src/wrapped/wrappedlibxcomposite.c
+++ b/src/wrapped/wrappedlibxcomposite.c
diff --git a/src/wrapped/wrappedlibxcomposite_private.h b/src/wrapped/wrappedlibxcomposite_private.h
index 9c52d04..9c52d04 100755..100644
--- a/src/wrapped/wrappedlibxcomposite_private.h
+++ b/src/wrapped/wrappedlibxcomposite_private.h
diff --git a/src/wrapped/wrappedlibxcursor.c b/src/wrapped/wrappedlibxcursor.c
index 749d2a0..749d2a0 100755..100644
--- a/src/wrapped/wrappedlibxcursor.c
+++ b/src/wrapped/wrappedlibxcursor.c
diff --git a/src/wrapped/wrappedlibxcursor_private.h b/src/wrapped/wrappedlibxcursor_private.h
index 493b933..493b933 100755..100644
--- a/src/wrapped/wrappedlibxcursor_private.h
+++ b/src/wrapped/wrappedlibxcursor_private.h
diff --git a/src/wrapped/wrappedlibxdamage.c b/src/wrapped/wrappedlibxdamage.c
index 6f10e7f..6f10e7f 100755..100644
--- a/src/wrapped/wrappedlibxdamage.c
+++ b/src/wrapped/wrappedlibxdamage.c
diff --git a/src/wrapped/wrappedlibxdamage_private.h b/src/wrapped/wrappedlibxdamage_private.h
index 00fa99f..00fa99f 100755..100644
--- a/src/wrapped/wrappedlibxdamage_private.h
+++ b/src/wrapped/wrappedlibxdamage_private.h
diff --git a/src/wrapped/wrappedlibxdmcp.c b/src/wrapped/wrappedlibxdmcp.c
index c320caa..c320caa 100755..100644
--- a/src/wrapped/wrappedlibxdmcp.c
+++ b/src/wrapped/wrappedlibxdmcp.c
diff --git a/src/wrapped/wrappedlibxdmcp_private.h b/src/wrapped/wrappedlibxdmcp_private.h
index d583108..d583108 100755..100644
--- a/src/wrapped/wrappedlibxdmcp_private.h
+++ b/src/wrapped/wrappedlibxdmcp_private.h
diff --git a/src/wrapped/wrappedlibxext.c b/src/wrapped/wrappedlibxext.c
index efc2fba..245b65c 100755..100644
--- a/src/wrapped/wrappedlibxext.c
+++ b/src/wrapped/wrappedlibxext.c
@@ -56,7 +56,7 @@ GO(4)
static uintptr_t my_exterrorhandle_fct_##A = 0; \
static int my_exterrorhandle_##A(void* display, void* ext_name, void* reason) \
{ \
- return RunFunction(my_context, my_exterrorhandle_fct_##A, 3, display, ext_name, reason); \
+ return RunFunctionFmt(my_exterrorhandle_fct_##A, "ppp", display, ext_name, reason); \
}
SUPER()
#undef GO
@@ -83,6 +83,248 @@ static void* reverse_exterrorhandleFct(void* fct)
#undef GO
return (void*)AddBridge(my_lib->w.bridge, iFppp, fct, 0, NULL);
}
+// create_gc ...
+#define GO(A) \
+static uintptr_t my_create_gc_fct_##A = 0; \
+static int my_create_gc_##A(void* a, uint32_t b, void* c) \
+{ \
+ return RunFunctionFmt(my_create_gc_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_create_gc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_create_gc_fct_##A == (uintptr_t)fct) return my_create_gc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_create_gc_fct_##A == 0) {my_create_gc_fct_##A = (uintptr_t)fct; return my_create_gc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext create_gc callback\n");
+ return NULL;
+}
+// copy_gc ...
+#define GO(A) \
+static uintptr_t my_copy_gc_fct_##A = 0; \
+static int my_copy_gc_##A(void* a, uint32_t b, void* c) \
+{ \
+ return RunFunctionFmt(my_copy_gc_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_copy_gc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_copy_gc_fct_##A == (uintptr_t)fct) return my_copy_gc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_copy_gc_fct_##A == 0) {my_copy_gc_fct_##A = (uintptr_t)fct; return my_copy_gc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext copy_gc callback\n");
+ return NULL;
+}
+// flush_gc ...
+#define GO(A) \
+static uintptr_t my_flush_gc_fct_##A = 0; \
+static int my_flush_gc_##A(void* a, uint32_t b, void* c) \
+{ \
+ return RunFunctionFmt(my_flush_gc_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_flush_gc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_flush_gc_fct_##A == (uintptr_t)fct) return my_flush_gc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_flush_gc_fct_##A == 0) {my_flush_gc_fct_##A = (uintptr_t)fct; return my_flush_gc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext flush_gc callback\n");
+ return NULL;
+}
+// free_gc ...
+#define GO(A) \
+static uintptr_t my_free_gc_fct_##A = 0; \
+static int my_free_gc_##A(void* a, uint32_t b, void* c) \
+{ \
+ return RunFunctionFmt(my_free_gc_fct_##A, "pup", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_free_gc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_free_gc_fct_##A == (uintptr_t)fct) return my_free_gc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_free_gc_fct_##A == 0) {my_free_gc_fct_##A = (uintptr_t)fct; return my_free_gc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext free_gc callback\n");
+ return NULL;
+}
+// create_font ...
+#define GO(A) \
+static uintptr_t my_create_font_fct_##A = 0; \
+static int my_create_font_##A(void* a, void* b, void* c) \
+{ \
+ return RunFunctionFmt(my_create_font_fct_##A, "ppp", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_create_font_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_create_font_fct_##A == (uintptr_t)fct) return my_create_font_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_create_font_fct_##A == 0) {my_create_font_fct_##A = (uintptr_t)fct; return my_create_font_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext create_font callback\n");
+ return NULL;
+}
+// free_font ...
+#define GO(A) \
+static uintptr_t my_free_font_fct_##A = 0; \
+static int my_free_font_##A(void* a, void* b, void* c) \
+{ \
+ return RunFunctionFmt(my_free_font_fct_##A, "ppp", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_free_font_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_free_font_fct_##A == (uintptr_t)fct) return my_free_font_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_free_font_fct_##A == 0) {my_free_font_fct_##A = (uintptr_t)fct; return my_free_font_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext free_font callback\n");
+ return NULL;
+}
+// close_display ...
+#define GO(A) \
+static uintptr_t my_close_display_fct_##A = 0; \
+static int my_close_display_##A(void* a, void* b) \
+{ \
+ return RunFunctionFmt(my_close_display_fct_##A, "pp", a, b);\
+}
+SUPER()
+#undef GO
+static void* find_close_display_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_close_display_fct_##A == (uintptr_t)fct) return my_close_display_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_close_display_fct_##A == 0) {my_close_display_fct_##A = (uintptr_t)fct; return my_close_display_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext close_display callback\n");
+ return NULL;
+}
+// wire_to_event ...
+#define GO(A) \
+static uintptr_t my_wire_to_event_fct_##A = 0; \
+static int my_wire_to_event_##A(void* a, void* b, void* c) \
+{ \
+ return RunFunctionFmt(my_wire_to_event_fct_##A, "ppp", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_wire_to_event_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_wire_to_event_fct_##A == (uintptr_t)fct) return my_wire_to_event_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_wire_to_event_fct_##A == 0) {my_wire_to_event_fct_##A = (uintptr_t)fct; return my_wire_to_event_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext wire_to_event callback\n");
+ return NULL;
+}
+// event_to_wire ...
+#define GO(A) \
+static uintptr_t my_event_to_wire_fct_##A = 0; \
+static int my_event_to_wire_##A(void* a, void* b, void* c) \
+{ \
+ return RunFunctionFmt(my_event_to_wire_fct_##A, "ppp", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_event_to_wire_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_event_to_wire_fct_##A == (uintptr_t)fct) return my_event_to_wire_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_event_to_wire_fct_##A == 0) {my_event_to_wire_fct_##A = (uintptr_t)fct; return my_event_to_wire_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext event_to_wire callback\n");
+ return NULL;
+}
+// error ...
+#define GO(A) \
+static uintptr_t my_error_fct_##A = 0; \
+static int my_error_##A(void* a, void* b, void* c, int* d) \
+{ \
+ return RunFunctionFmt(my_error_fct_##A, "pppp", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_error_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_error_fct_##A == (uintptr_t)fct) return my_error_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_error_fct_##A == 0) {my_error_fct_##A = (uintptr_t)fct; return my_error_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext error callback\n");
+ return NULL;
+}
+// error_string ...
+#define GO(A) \
+static uintptr_t my_error_string_fct_##A = 0; \
+static int my_error_string_##A(void* a, int b, void* c, void* d, int e) \
+{ \
+ return RunFunctionFmt(my_error_string_fct_##A, "pippi", a, b, c, d, e); \
+}
+SUPER()
+#undef GO
+static void* find_error_string_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_error_string_fct_##A == (uintptr_t)fct) return my_error_string_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_error_string_fct_##A == 0) {my_error_string_fct_##A = (uintptr_t)fct; return my_error_string_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libXext error_string callback\n");
+ return NULL;
+}
#undef SUPER
@@ -123,81 +365,10 @@ EXPORT void* my_XSetExtensionErrorHandler(x64emu_t* emu, void* handler)
return reverse_exterrorhandleFct(my->XSetExtensionErrorHandler(find_exterrorhandle_Fct(handler)));
}
-static box64context_t *context = NULL;
-static uintptr_t my_hook_create_gc_fnc = 0;
-static uintptr_t my_hook_copy_gc_fnc = 0;
-static uintptr_t my_hook_flush_gc_fnc = 0;
-static uintptr_t my_hook_free_gc_fnc = 0;
-static uintptr_t my_hook_create_font_fnc = 0;
-static uintptr_t my_hook_free_font_fnc = 0;
-static uintptr_t my_hook_close_display_fnc = 0;
-static uintptr_t my_hook_wire_to_event_fnc = 0;
-static uintptr_t my_hook_event_to_wire_fnc = 0;
-static uintptr_t my_hook_error_fnc = 0;
-static uintptr_t my_hook_error_string_fnc = 0;
-static int my_hook_create_gc(void* a, uint32_t b, void* c) {
- if(my_hook_create_gc_fnc)
- return (int)RunFunction(context, my_hook_create_gc_fnc, 3, a, b, c);
- return 0;
-}
-static int my_hook_copy_gc(void* a, uint32_t b, void* c) {
- if(my_hook_copy_gc_fnc)
- return (int)RunFunction(context, my_hook_copy_gc_fnc, 3, a, b, c);
- return 0;
-}
-static int my_hook_flush_gc(void* a, uint32_t b, void* c) {
- if(my_hook_flush_gc_fnc)
- return (int)RunFunction(context, my_hook_flush_gc_fnc, 3, a, b, c);
- return 0;
-}
-static int my_hook_free_gc(void* a, uint32_t b, void* c) {
- if(my_hook_free_gc_fnc)
- return (int)RunFunction(context, my_hook_free_gc_fnc, 3, a, b, c);
- return 0;
-}
-static int my_hook_create_font(void* a, void* b, void* c) {
- if(my_hook_create_font_fnc)
- return (int)RunFunction(context, my_hook_create_font_fnc, 3, a, b, c);
- return 0;
-}
-static int my_hook_free_font(void* a, void* b, void* c) {
- if(my_hook_free_font_fnc)
- return (int)RunFunction(context, my_hook_free_font_fnc, 3, a, b, c);
- return 0;
-}
-static int my_hook_close_display(void* a, void* b) {
- if(my_hook_close_display_fnc)
- return (int)RunFunction(context, my_hook_close_display_fnc, 2, a, b);
- return 0;
-}
-static int my_hook_wire_to_event(void* a, void* b, void* c) {
- if(my_hook_wire_to_event_fnc)
- return (int)RunFunction(context, my_hook_wire_to_event_fnc, 3, a, b, c);
- return 0;
-}
-static int my_hook_event_to_wire(void* a, void* b, void* c) {
- if(my_hook_event_to_wire_fnc)
- return (int)RunFunction(context, my_hook_event_to_wire_fnc, 3, a, b, c);
- return 0;
-}
-static int my_hook_error(void* a, void* b, void* c, int* d) {
- if(my_hook_error_fnc)
- return (int)RunFunction(context, my_hook_error_fnc, 4, a, b, c, d);
- return 0;
-}
-static char* my_hook_error_string(void* a, int b, void* c, void* d, int e) {
- if(my_hook_error_string_fnc)
- return (char*)RunFunction(context, my_hook_error_string_fnc, 5, a, b, c, d, e);
- return 0;
-}
-
EXPORT void* my_XextAddDisplay(x64emu_t* emu, void* extinfo, void* dpy, void* extname, my_XExtensionHooks* hooks, int nevents, void* data)
{
- if(!context)
- context = emu->context;
-
my_XExtensionHooks natives = {0};
- #define GO(A) if(hooks->A) {my_hook_##A##_fnc = (uintptr_t)hooks->A; natives.A = my_hook_##A;}
+ #define GO(A) natives.A = find_##A##_Fct(hooks->A);
GO(create_gc)
GO(copy_gc)
GO(flush_gc)
diff --git a/src/wrapped/wrappedlibxext_private.h b/src/wrapped/wrappedlibxext_private.h
index 2e2ac8e..2e2ac8e 100755..100644
--- a/src/wrapped/wrappedlibxext_private.h
+++ b/src/wrapped/wrappedlibxext_private.h
diff --git a/src/wrapped/wrappedlibxfixes.c b/src/wrapped/wrappedlibxfixes.c
index 6ee42f8..6ee42f8 100755..100644
--- a/src/wrapped/wrappedlibxfixes.c
+++ b/src/wrapped/wrappedlibxfixes.c
diff --git a/src/wrapped/wrappedlibxfixes_private.h b/src/wrapped/wrappedlibxfixes_private.h
index b388944..b388944 100755..100644
--- a/src/wrapped/wrappedlibxfixes_private.h
+++ b/src/wrapped/wrappedlibxfixes_private.h
diff --git a/src/wrapped/wrappedlibxft.c b/src/wrapped/wrappedlibxft.c
index b779f93..b779f93 100755..100644
--- a/src/wrapped/wrappedlibxft.c
+++ b/src/wrapped/wrappedlibxft.c
diff --git a/src/wrapped/wrappedlibxft_private.h b/src/wrapped/wrappedlibxft_private.h
index 0c00da9..843213b 100755..100644
--- a/src/wrapped/wrappedlibxft_private.h
+++ b/src/wrapped/wrappedlibxft_private.h
@@ -6,9 +6,9 @@
//GO(XftCharFontSpecRender,
//GO(XftCharIndex,
//GO(XftCharSpecRender,
-//GO(XftColorAllocName,
+GO(XftColorAllocName, iFppupp)
//GO(XftColorAllocValue,
-//GO(XftColorFree,
+GO(XftColorFree, vFppup)
//GO(XftDefaultHasRender,
//GO(XftDefaultSet,
//GO(XftDefaultSubstitute,
@@ -19,27 +19,27 @@ GO(XftDrawChange, vFpp)
GO(XftDrawCreate, pFpppp)
//GO(XftDrawCreateAlpha,
//GO(XftDrawCreateBitmap,
-//GO(XftDrawDestroy,
+GO(XftDrawDestroy, vFp)
//GO(XftDrawDisplay,
//GO(XftDrawDrawable,
//GO(XftDrawGlyphFontSpec,
//GO(XftDrawGlyphs,
//GO(XftDrawGlyphSpec,
//GO(XftDrawPicture,
-//GO(XftDrawRect,
+GO(XftDrawRect, vFppiiuu)
GO(XftDrawSetClip, iFpp)
//GO(XftDrawSetClipRectangles,
//GO(XftDrawSetSubwindowMode,
//GO(XftDrawSrcPicture,
-//GO(XftDrawString16,
+GO(XftDrawString16, vFpppiipi)
GO(XftDrawString32, vFpppiipi)
//GO(XftDrawString8,
//GO(XftDrawStringUtf16,
//GO(XftDrawStringUtf8,
//GO(XftDrawVisual,
//GO(XftFontCheckGlyph,
-//GO(XftFontClose,
-//GO(XftFontCopy,
+GO(XftFontClose, vFpp)
+GO(XftFontCopy, pFpp)
//GO(XftFontInfoCreate,
//GO(XftFontInfoDestroy,
//GO(XftFontInfoEqual,
@@ -63,7 +63,7 @@ GO(XftFontOpenXlfd, pFpip)
//GO(XftLockFace,
//GO(XftNameParse,
GO(XftNameUnparse, iFppi)
-//GO(XftTextExtents16,
+GO(XftTextExtents16, vFpppip)
GO(XftTextExtents32, vFpppip)
//GO(XftTextExtents8,
//GO(XftTextExtentsUtf16,
diff --git a/src/wrapped/wrappedlibxi.c b/src/wrapped/wrappedlibxi.c
index 0d2d065..0d2d065 100755..100644
--- a/src/wrapped/wrappedlibxi.c
+++ b/src/wrapped/wrappedlibxi.c
diff --git a/src/wrapped/wrappedlibxi_private.h b/src/wrapped/wrappedlibxi_private.h
index 4b81a2d..6e10da5 100755..100644
--- a/src/wrapped/wrappedlibxi_private.h
+++ b/src/wrapped/wrappedlibxi_private.h
@@ -38,7 +38,7 @@ GO(XIBarrierReleasePointer, vFpipp)
GO(XIBarrierReleasePointers, vFppi)
//GO(XIChangeHierarchy,
GO(XIChangeProperty, vFpippiipi)
-//GO(XIDefineCursor,
+GO(XIDefineCursor, iFpipp)
GO(XIDeleteProperty, vFpip)
GO(XIFreeDeviceInfo, vFp)
GO(XIGetClientPointer, iFppp)
@@ -58,7 +58,7 @@ GO(XIQueryVersion, iFppp)
GO(XISelectEvents, iFpppi)
GO(XISetClientPointer, iFppi)
//GO(XISetFocus,
-//GO(XIUndefineCursor,
+GO(XIUndefineCursor, iFpip)
GO(XIUngrabButton, iFpiipip)
GO(XIUngrabDevice, iFpiL)
//GO(XIUngrabEnter,
diff --git a/src/wrapped/wrappedlibxmu.c b/src/wrapped/wrappedlibxmu.c
index 225f682..225f682 100755..100644
--- a/src/wrapped/wrappedlibxmu.c
+++ b/src/wrapped/wrappedlibxmu.c
diff --git a/src/wrapped/wrappedlibxmu_private.h b/src/wrapped/wrappedlibxmu_private.h
index 931574d..931574d 100755..100644
--- a/src/wrapped/wrappedlibxmu_private.h
+++ b/src/wrapped/wrappedlibxmu_private.h
diff --git a/src/wrapped/wrappedlibxpm.c b/src/wrapped/wrappedlibxpm.c
index b978082..b978082 100755..100644
--- a/src/wrapped/wrappedlibxpm.c
+++ b/src/wrapped/wrappedlibxpm.c
diff --git a/src/wrapped/wrappedlibxpm_private.h b/src/wrapped/wrappedlibxpm_private.h
index fc71b02..fc71b02 100755..100644
--- a/src/wrapped/wrappedlibxpm_private.h
+++ b/src/wrapped/wrappedlibxpm_private.h
diff --git a/src/wrapped/wrappedlibxrandr.c b/src/wrapped/wrappedlibxrandr.c
index b74cca0..b74cca0 100755..100644
--- a/src/wrapped/wrappedlibxrandr.c
+++ b/src/wrapped/wrappedlibxrandr.c
diff --git a/src/wrapped/wrappedlibxrandr_private.h b/src/wrapped/wrappedlibxrandr_private.h
index c8f198b..c8f198b 100755..100644
--- a/src/wrapped/wrappedlibxrandr_private.h
+++ b/src/wrapped/wrappedlibxrandr_private.h
diff --git a/src/wrapped/wrappedlibxrender.c b/src/wrapped/wrappedlibxrender.c
index ff2c218..ff2c218 100755..100644
--- a/src/wrapped/wrappedlibxrender.c
+++ b/src/wrapped/wrappedlibxrender.c
diff --git a/src/wrapped/wrappedlibxrender_private.h b/src/wrapped/wrappedlibxrender_private.h
index 5c25670..5c25670 100755..100644
--- a/src/wrapped/wrappedlibxrender_private.h
+++ b/src/wrapped/wrappedlibxrender_private.h
diff --git a/src/wrapped/wrappedlibxss.c b/src/wrapped/wrappedlibxss.c
index 00c00b9..00c00b9 100755..100644
--- a/src/wrapped/wrappedlibxss.c
+++ b/src/wrapped/wrappedlibxss.c
diff --git a/src/wrapped/wrappedlibxss_private.h b/src/wrapped/wrappedlibxss_private.h
index d345f04..d345f04 100755..100644
--- a/src/wrapped/wrappedlibxss_private.h
+++ b/src/wrapped/wrappedlibxss_private.h
diff --git a/src/wrapped/wrappedlibxt.c b/src/wrapped/wrappedlibxt.c
index 6177ae8..6a7180f 100755..100644
--- a/src/wrapped/wrappedlibxt.c
+++ b/src/wrapped/wrappedlibxt.c
@@ -39,7 +39,7 @@ GO(7)
static uintptr_t my_Event_fct_##A = 0; \
static void my_Event_##A(void* w, void* data, void* event) \
{ \
- RunFunction(my_context, my_Event_fct_##A, 3, w, data, event);\
+ RunFunctionFmt(my_Event_fct_##A, "ppp", w, data, event);\
}
SUPER()
#undef GO
@@ -61,7 +61,7 @@ static void* findEventFct(void* fct)
static uintptr_t my_WorkProc_fct_##A = 0; \
static int my_WorkProc_##A(void* p) \
{ \
- return (int)RunFunction(my_context, my_WorkProc_fct_##A, 1, p);\
+ return (int)RunFunctionFmt(my_WorkProc_fct_##A, "p", p);\
}
SUPER()
#undef GO
@@ -83,7 +83,7 @@ static void* findWorkProcFct(void* fct)
static uintptr_t my_InputCallback_fct_##A = 0; \
static void my_InputCallback_##A(void* p, void* s, void* id) \
{ \
- RunFunction(my_context, my_InputCallback_fct_##A, 3, p, s, id); \
+ RunFunctionFmt(my_InputCallback_fct_##A, "ppp", p, s, id); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedlibxt_private.h b/src/wrapped/wrappedlibxt_private.h
index 68139c5..68139c5 100755..100644
--- a/src/wrapped/wrappedlibxt_private.h
+++ b/src/wrapped/wrappedlibxt_private.h
diff --git a/src/wrapped/wrappedlibxtst.c b/src/wrapped/wrappedlibxtst.c
index eaec1de..4ae3a68 100755..100644
--- a/src/wrapped/wrappedlibxtst.c
+++ b/src/wrapped/wrappedlibxtst.c
@@ -36,7 +36,7 @@ GO(4)
static uintptr_t my_XRecordInterceptProc_fct_##A = 0; \
static void my_XRecordInterceptProc_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_XRecordInterceptProc_fct_##A, 2, a, b); \
+ RunFunctionFmt(my_XRecordInterceptProc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedlibxtst_private.h b/src/wrapped/wrappedlibxtst_private.h
index ce15425..ce15425 100755..100644
--- a/src/wrapped/wrappedlibxtst_private.h
+++ b/src/wrapped/wrappedlibxtst_private.h
diff --git a/src/wrapped/wrappedlibxxf86vm.c b/src/wrapped/wrappedlibxxf86vm.c
index 3f24e95..3f24e95 100755..100644
--- a/src/wrapped/wrappedlibxxf86vm.c
+++ b/src/wrapped/wrappedlibxxf86vm.c
diff --git a/src/wrapped/wrappedlibxxf86vm_private.h b/src/wrapped/wrappedlibxxf86vm_private.h
index b418072..b418072 100755..100644
--- a/src/wrapped/wrappedlibxxf86vm_private.h
+++ b/src/wrapped/wrappedlibxxf86vm_private.h
diff --git a/src/wrapped/wrappedlibz.c b/src/wrapped/wrappedlibz.c
index 8d3ebb7..4613c47 100755..100644
--- a/src/wrapped/wrappedlibz.c
+++ b/src/wrapped/wrappedlibz.c
@@ -34,7 +34,7 @@ GO(4)
static uintptr_t my_alloc_fct_##A = 0; \
static void* my_alloc_##A(void* opaque, uint32_t items, uint32_t size) \
{ \
- return (void*)RunFunction(my_context, my_alloc_fct_##A, 3, opaque, items, size); \
+ return (void*)RunFunctionFmt(my_alloc_fct_##A, "puu", opaque, items, size); \
}
SUPER()
#undef GO
@@ -51,12 +51,22 @@ static void* find_alloc_Fct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for zlib alloc callback\n");
return NULL;
}
+static void* reverse_alloc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my_alloc_##A == fct) return (void*)my_alloc_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, pFpuu, fct, 0, NULL);
+}
// free ...
#define GO(A) \
static uintptr_t my_free_fct_##A = 0; \
static void my_free_##A(void* opaque, void* address) \
{ \
- RunFunction(my_context, my_free_fct_##A, 2, opaque, address); \
+ RunFunctionFmt(my_free_fct_##A, "pp", opaque, address); \
}
SUPER()
#undef GO
@@ -73,10 +83,20 @@ static void* find_free_Fct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for zlib free callback\n");
return NULL;
}
+static void* reverse_free_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my_free_##A == fct) return (void*)my_free_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, vFpp, fct, 0, NULL);
+}
#undef SUPER
typedef struct z_stream_s {
- void *next_in;
+ void *next_in;
uint32_t avail_in;
uintptr_t total_in;
void *next_out;
@@ -85,11 +105,11 @@ typedef struct z_stream_s {
char *msg;
void *state;
void* zalloc;
- void* zfree;
+ void* zfree;
void* opaque;
int32_t data_type;
- uintptr_t adler;
- uintptr_t reserved;
+ uintptr_t adler;
+ uintptr_t reserved;
} z_stream;
static void wrapper_stream_z(x64emu_t* emu, void* str)
@@ -99,28 +119,41 @@ static void wrapper_stream_z(x64emu_t* emu, void* str)
stream->zalloc = find_alloc_Fct(stream->zalloc);
stream->zfree = find_free_Fct(stream->zfree);
}
+static void unwrapper_stream_z(x64emu_t* emu, void* str)
+{
+ (void)emu;
+ z_stream *stream = (z_stream*)str;
+ stream->zalloc = reverse_alloc_Fct(stream->zalloc);
+ stream->zfree = reverse_free_Fct(stream->zfree);
+}
EXPORT int my_inflateInit_(x64emu_t* emu, void* str, void* version, int size)
{
wrapper_stream_z(emu, str);
- return my->inflateInit_(str, version, size);
+ int ret = my->inflateInit_(str, version, size);
+ unwrapper_stream_z(emu, str);
+ return ret;
}
EXPORT int my_inflateInit2_(x64emu_t* emu, void* str, int windowBits, void* version, int stream_size)
{
wrapper_stream_z(emu, str);
- return my->inflateInit2_(str, windowBits, version, stream_size);
+ int ret = my->inflateInit2_(str, windowBits, version, stream_size);
+ unwrapper_stream_z(emu, str);
+ return ret;
}
-EXPORT int my_inflateBackInit_(x64emu_t* emu, void* strm, int windowBits, void *window, void* version, int size)
+EXPORT int my_inflateBackInit_(x64emu_t* emu, void* str, int windowBits, void *window, void* version, int size)
{
- wrapper_stream_z(emu, strm);
- return my->inflateBackInit_(strm, windowBits, window, version, size);
+ wrapper_stream_z(emu, str);
+ int ret = my->inflateBackInit_(str, windowBits, window, version, size);
+ unwrapper_stream_z(emu, str);
+ return ret;
}
-// TODO: remove this?
EXPORT int my_inflateEnd(x64emu_t* emu, void* str)
{
+ wrapper_stream_z(emu, str);
int r = my->inflateEnd(str);
return r;
}
@@ -128,18 +161,23 @@ EXPORT int my_inflateEnd(x64emu_t* emu, void* str)
EXPORT int my_deflateInit_(x64emu_t* emu, void* str, int level, void* version, int stream_size)
{
wrapper_stream_z(emu, str);
- return my->deflateInit_(str, level, version, stream_size);
+ int ret = my->deflateInit_(str, level, version, stream_size);
+ unwrapper_stream_z(emu, str);
+ return ret;
}
EXPORT int my_deflateInit2_(x64emu_t* emu, void* str, int level, int method, int windowBits, int memLevel, int strategy, void* version, int stream_size)
{
wrapper_stream_z(emu, str);
- return my->deflateInit2_(str, level, method, windowBits, memLevel, strategy, version, stream_size);
+ int ret = my->deflateInit2_(str, level, method, windowBits, memLevel, strategy, version, stream_size);
+ unwrapper_stream_z(emu, str);
+ return ret;
}
// TODO: remove this?
EXPORT int my_deflateEnd(x64emu_t* emu, void* str)
{
+ wrapper_stream_z(emu, str);
int r = my->deflateEnd(str);
return r;
}
@@ -147,8 +185,9 @@ EXPORT int my_deflateEnd(x64emu_t* emu, void* str)
EXPORT int my_inflate(x64emu_t* emu, void* str, int flush)
{
wrapper_stream_z(emu, str);
- return my->inflate(str, flush);
- //TODO: should unwrap the stream
+ int ret = my->inflate(str, flush);
+ unwrapper_stream_z(emu, str);
+ return ret;
}
diff --git a/src/wrapped/wrappedlzma.c b/src/wrapped/wrappedlzma.c
index 638a38d..8592037 100755..100644
--- a/src/wrapped/wrappedlzma.c
+++ b/src/wrapped/wrappedlzma.c
@@ -64,7 +64,7 @@ GO(4)
static uintptr_t my_alloc_fct_##A = 0; \
static void* my_alloc_##A(void* opaque, size_t items, size_t size) \
{ \
- return (void*)RunFunction(my_context, my_alloc_fct_##A, 3, opaque, items, size);\
+ return (void*)RunFunctionFmt(my_alloc_fct_##A, "pLL", opaque, items, size);\
}
SUPER()
#undef GO
@@ -81,12 +81,22 @@ static void* find_alloc_Fct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for zlib alloc callback\n");
return NULL;
}
+static void* reverse_alloc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my_alloc_##A == fct) return (void*)my_alloc_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, pFpuu, fct, 0, NULL);
+}
// free ...
#define GO(A) \
static uintptr_t my_free_fct_##A = 0; \
static void my_free_##A(void* opaque, void* address) \
{ \
- RunFunction(my_context, my_free_fct_##A, 2, opaque, address); \
+ RunFunctionFmt(my_free_fct_##A, "pp", opaque, address); \
}
SUPER()
#undef GO
@@ -103,101 +113,143 @@ static void* find_free_Fct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for zlib free callback\n");
return NULL;
}
+static void* reverse_free_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my_free_##A == fct) return (void*)my_free_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, vFpp, fct, 0, NULL);
+}
#undef SUPER
-static void wrap_alloc_struct(lzma_allocator_t* dst, lzma_allocator_t* src)
+static void wrap_alloc_struct(lzma_allocator_t* a)
+{
+ if(!a)
+ return;
+ a->alloc = find_alloc_Fct(a->alloc);
+ a->free = find_free_Fct(a->free);
+
+}
+static void unwrap_alloc_struct(lzma_allocator_t* a)
{
- if(!src)
+ if(!a)
return;
- dst->opaque = src->opaque;
- dst->alloc = find_alloc_Fct(src->alloc);
- dst->free = find_free_Fct(src->free);
-
+ a->alloc = reverse_alloc_Fct(a->alloc);
+ a->free = reverse_free_Fct(a->free);
+
}
EXPORT int my_lzma_index_buffer_decode(x64emu_t* emu, void* i, void* memlimit, lzma_allocator_t* alloc, void* in_, void* in_pos, size_t in_size)
{
- lzma_allocator_t allocator = {0};
- wrap_alloc_struct(&allocator, alloc);
- return my->lzma_index_buffer_decode(i, memlimit, alloc?&allocator:NULL, in_, in_pos, in_size);
+ wrap_alloc_struct(alloc);
+ int ret = my->lzma_index_buffer_decode(i, memlimit, alloc, in_, in_pos, in_size);
+ unwrap_alloc_struct(alloc);
+ return ret;
}
EXPORT void my_lzma_index_end(x64emu_t* emu, void* i, lzma_allocator_t* alloc)
{
- lzma_allocator_t allocator = {0};
- wrap_alloc_struct(&allocator, alloc);
- return my->lzma_index_end(i,alloc?&allocator:NULL);
+ wrap_alloc_struct(alloc);
+ my->lzma_index_end(i,alloc);
+ unwrap_alloc_struct(alloc);
}
EXPORT int my_lzma_stream_buffer_decode(x64emu_t* emu, void* memlimit, uint32_t flags, lzma_allocator_t* alloc, void* in_, void* in_pos, size_t in_size, void* out_, void* out_pos, size_t out_size)
{
- lzma_allocator_t allocator = {0};
- wrap_alloc_struct(&allocator, alloc);
- return my->lzma_stream_buffer_decode(memlimit, flags, alloc?&allocator:NULL, in_, in_pos, in_size, out_, out_pos, out_size);
+ wrap_alloc_struct(alloc);
+ int ret = my->lzma_stream_buffer_decode(memlimit, flags, alloc, in_, in_pos, in_size, out_, out_pos, out_size);
+ unwrap_alloc_struct(alloc);
+ return ret;
}
EXPORT int my_lzma_stream_decoder(x64emu_t* emu, lzma_stream_t* stream, uint64_t memlimit, uint32_t flags)
{
- // not restoring the allocator after, so lzma_code and lzma_end can be used without "GOM" wrapping
- if(stream->allocator)
- wrap_alloc_struct(stream->allocator, stream->allocator);
- return my->lzma_stream_decoder(stream, memlimit, flags);
+ wrap_alloc_struct(stream->allocator);
+ int ret = my->lzma_stream_decoder(stream, memlimit, flags);
+ unwrap_alloc_struct(stream->allocator);
+ return ret;
}
EXPORT int my_lzma_stream_encoder(x64emu_t* emu, lzma_stream_t* stream, void* filters, int check)
{
- // not restoring the allocator after, so lzma_code and lzma_end can be used without "GOM" wrapping
- if(stream->allocator)
- wrap_alloc_struct(stream->allocator, stream->allocator);
- return my->lzma_stream_encoder(stream, filters, check);
+ wrap_alloc_struct(stream->allocator);
+ int ret = my->lzma_stream_encoder(stream, filters, check);
+ unwrap_alloc_struct(stream->allocator);
+ return ret;
}
EXPORT int my_lzma_easy_encoder(x64emu_t* emu, lzma_stream_t* stream, uint32_t precheck, uint32_t check)
{
- // not restoring the allocator after, so lzma_code and lzma_end can be used without "GOM" wrapping
- if(stream->allocator)
- wrap_alloc_struct(stream->allocator, stream->allocator);
- return my->lzma_easy_encoder(stream, precheck, check);
+ wrap_alloc_struct(stream->allocator);
+ int ret = my->lzma_easy_encoder(stream, precheck, check);
+ unwrap_alloc_struct(stream->allocator);
+ return ret;
}
EXPORT int my_lzma_raw_encoder(x64emu_t* emu, lzma_stream_t* stream, void* filters)
{
- // not restoring the allocator after, so lzma_code and lzma_end can be used without "GOM" wrapping
- if(stream->allocator)
- wrap_alloc_struct(stream->allocator, stream->allocator);
- return my->lzma_raw_encoder(stream, filters);
+ wrap_alloc_struct(stream->allocator);
+ int ret = my->lzma_raw_encoder(stream, filters);
+ unwrap_alloc_struct(stream->allocator);
+ return ret;
}
EXPORT int my_lzma_raw_decoder(x64emu_t* emu, lzma_stream_t* stream, void* filters)
{
- // not restoring the allocator after, so lzma_code and lzma_end can be used without "GOM" wrapping
- if(stream->allocator)
- wrap_alloc_struct(stream->allocator, stream->allocator);
- return my->lzma_raw_decoder(stream, filters);
+ wrap_alloc_struct(stream->allocator);
+ int ret = my->lzma_raw_decoder(stream, filters);
+ unwrap_alloc_struct(stream->allocator);
+ return ret;
}
EXPORT int my_lzma_properties_decode(x64emu_t* emu, void* filters, lzma_allocator_t* allocator, void* props, size_t size)
{
- lzma_allocator_t alloc = {0};
- wrap_alloc_struct(&alloc, allocator);
- return my->lzma_properties_decode(filters, &alloc, props, size);
+ wrap_alloc_struct(allocator);
+ int ret = my->lzma_properties_decode(filters, allocator, props, size);
+ unwrap_alloc_struct(allocator);
+ return ret;
}
EXPORT int my_lzma_alone_decoder(x64emu_t* emu, lzma_stream_t* stream, uint64_t memlimit)
{
- // not restoring the allocator after, so lzma_code and lzma_end can be used without "GOM" wrapping
- if(stream->allocator)
- wrap_alloc_struct(stream->allocator, stream->allocator);
- return my->lzma_alone_decoder(stream, memlimit);
+ wrap_alloc_struct(stream->allocator);
+ int ret = my->lzma_alone_decoder(stream, memlimit);
+ unwrap_alloc_struct(stream->allocator);
+ return ret;
}
EXPORT int my_lzma_alone_encoder(x64emu_t* emu, lzma_stream_t* stream, void* options)
{
- // not restoring the allocator after, so lzma_code and lzma_end can be used without "GOM" wrapping
- if(stream->allocator)
- wrap_alloc_struct(stream->allocator, stream->allocator);
- return my->lzma_alone_encoder(stream, options);
+ wrap_alloc_struct(stream->allocator);
+ int ret = my->lzma_alone_encoder(stream, options);
+ unwrap_alloc_struct(stream->allocator);
+ return ret;
+}
+
+EXPORT int my_lzma_stream_encoder_mt(x64emu_t* emu, lzma_stream_t* stream, void* options)
+{
+ wrap_alloc_struct(stream->allocator);
+ int ret = my->lzma_stream_encoder_mt(stream, options);
+ unwrap_alloc_struct(stream->allocator);
+ return ret;
+}
+
+EXPORT int my_lzma_code(x64emu_t* emu, lzma_stream_t* stream, int a)
+{
+ wrap_alloc_struct(stream->allocator);
+ int ret = my->lzma_code(stream, a);
+ unwrap_alloc_struct(stream->allocator);
+ return ret;
+}
+
+EXPORT void my_lzma_end(x64emu_t* emu, lzma_stream_t* stream)
+{
+ wrap_alloc_struct(stream->allocator);
+ my->lzma_end(stream);
}
#define CUSTOM_INIT \
diff --git a/src/wrapped/wrappedlzma_private.h b/src/wrapped/wrappedlzma_private.h
index 3b82a07..6f8b476 100755..100644
--- a/src/wrapped/wrappedlzma_private.h
+++ b/src/wrapped/wrappedlzma_private.h
@@ -5,34 +5,34 @@
GOM(lzma_alone_decoder, iFEpU)
GOM(lzma_alone_encoder, iFEpp)
GO(lzma_auto_decoder, iFpUu)
-//GO(lzma_block_buffer_bound,
+GO(lzma_block_buffer_bound, LFL)
//GO(lzma_block_buffer_decode,
//GO(lzma_block_buffer_encode,
-//GO(lzma_block_compressed_size,
+GO(lzma_block_compressed_size, uFpL)
//GO(lzma_block_decoder,
//GO(lzma_block_encoder,
//GO(lzma_block_header_decode,
-//GO(lzma_block_header_encode,
-//GO(lzma_block_header_size,
-//GO(lzma_block_total_size,
-//GO(lzma_block_uncomp_encode,
+GO(lzma_block_header_encode, uFpp)
+GO(lzma_block_header_size, uFp)
+GO(lzma_block_total_size, LFp)
+GO(lzma_block_uncomp_encode, uFppLppL)
//GO(lzma_block_unpadded_size,
-GO(lzma_check_is_supported, iFi)
-//GO(lzma_check_size,
-GO(lzma_code, iFpi)
-//GO(lzma_cputhreads,
-//GO(lzma_crc32,
-//GO(lzma_crc64,
+GO(lzma_check_is_supported, CFu)
+GO(lzma_check_size, uFu)
+GOM(lzma_code, iFEpi)
+GO(lzma_cputhreads, uFv)
+GO(lzma_crc32, uFpLu)
+GO(lzma_crc64, LFpLL)
//GO(lzma_easy_buffer_encode,
-//GO(lzma_easy_decoder_memusage,
+GO(lzma_easy_decoder_memusage, LFu)
GOM(lzma_easy_encoder, iFEpui)
//GO(lzma_easy_encoder_memusage,
-GO(lzma_end, vFp)
-//GO(lzma_filter_decoder_is_supported,
+GOM(lzma_end, vFEp)
+GO(lzma_filter_decoder_is_supported, CFL)
//GO(lzma_filter_encoder_is_supported,
//GO(lzma_filter_flags_decode,
-//GO(lzma_filter_flags_encode,
-//GO(lzma_filter_flags_size,
+GO(lzma_filter_flags_encode, uFpppL)
+GO(lzma_filter_flags_size, uFpp)
//GO(lzma_filters_copy,
//GO(lzma_filters_update,
GO(lzma_get_check, iFp)
@@ -40,47 +40,47 @@ GO(lzma_get_check, iFp)
//GO(lzma_index_append,
//GO(lzma_index_block_count,
GOM(lzma_index_buffer_decode, iFEpppppL)
-//GO(lzma_index_buffer_encode,
+GO(lzma_index_buffer_encode, uFpppL)
//GO(lzma_index_cat,
-//GO(lzma_index_checks,
+GO(lzma_index_checks, uFp)
//GO(lzma_index_decoder,
//GO(lzma_index_dup,
//GO(lzma_index_encoder,
GOM(lzma_index_end, vFEpp)
//GO(lzma_index_file_size,
-//GO(lzma_index_hash_append,
-//GO(lzma_index_hash_decode,
+GO(lzma_index_hash_append, uFpLL)
+GO(lzma_index_hash_decode, uFpppL)
//GO(lzma_index_hash_end,
//GO(lzma_index_hash_init,
-//GO(lzma_index_hash_size,
+GO(lzma_index_hash_size, LFp)
//GO(lzma_index_init,
-//GO(lzma_index_iter_init,
-//GO(lzma_index_iter_locate,
-//GO(lzma_index_iter_next,
-//GO(lzma_index_iter_rewind,
-//GO(lzma_index_memusage,
-//GO(lzma_index_memused,
+GO(lzma_index_iter_init, vFpp)
+GO(lzma_index_iter_locate, CFpL)
+GO(lzma_index_iter_next, CFpu)
+GO(lzma_index_iter_rewind, vFp)
+GO(lzma_index_memusage, LFLL)
+GO(lzma_index_memused, LFp)
GO(lzma_index_size, UFp)
//GO(lzma_index_stream_count,
-//GO(lzma_index_stream_flags,
-//GO(lzma_index_stream_padding,
+GO(lzma_index_stream_flags, uFpp)
+GO(lzma_index_stream_padding, uFpL)
//GO(lzma_index_stream_size,
//GO(lzma_index_total_size,
-GO(lzma_index_uncompressed_size, UFp)
-GO(lzma_lzma_preset, iFpu)
+GO(lzma_index_uncompressed_size, LFp)
+GO(lzma_lzma_preset, CFpu)
//GO(lzma_memlimit_get,
//GO(lzma_memlimit_set,
-//GO(lzma_memusage,
-//GO(lzma_mf_is_supported,
-//GO(lzma_mode_is_supported,
-//GO(lzma_physmem,
+GO(lzma_memusage, UFp)
+GO(lzma_mf_is_supported, CFu)
+GO(lzma_mode_is_supported, CFu)
+GO(lzma_physmem, LFv)
GOM(lzma_properties_decode, iFEpppL)
-GO(lzma_properties_encode, iFpp)
+GO(lzma_properties_encode, uFpp)
GO(lzma_properties_size, iFpp)
//GO(lzma_raw_buffer_decode,
//GO(lzma_raw_buffer_encode,
GOM(lzma_raw_decoder, iFEpp)
-//GO(lzma_raw_decoder_memusage,
+GO(lzma_raw_decoder_memusage, LFp)
GOM(lzma_raw_encoder, iFEpp)
//GO(lzma_raw_encoder_memusage,
//GO(lzma_stream_buffer_bound,
@@ -88,15 +88,15 @@ GOM(lzma_stream_buffer_decode, iFEpupppLppL)
//GO(lzma_stream_buffer_encode,
GOM(lzma_stream_decoder, iFEpUi)
GOM(lzma_stream_encoder, iFEppi)
-//GO(lzma_stream_encoder_mt,
-//GO(lzma_stream_encoder_mt_memusage,
-//GO(lzma_stream_flags_compare,
-GO(lzma_stream_footer_decode, iFpp)
-//GO(lzma_stream_footer_encode,
+GOM(lzma_stream_encoder_mt, iFEpp)
+GO(lzma_stream_encoder_mt_memusage, LFp)
+GO(lzma_stream_flags_compare, uFpp)
+GO(lzma_stream_footer_decode, uFpp)
+GO(lzma_stream_footer_encode, uFpp)
//GO(lzma_stream_header_decode,
//GO(lzma_stream_header_encode,
//GO(lzma_version_number,
-//GO(lzma_version_string,
-//GO(lzma_vli_decode,
-//GO(lzma_vli_encode,
-//GO(lzma_vli_size,
+GO(lzma_version_string, pFv)
+GO(lzma_vli_decode, uFppppL)
+GO(lzma_vli_encode, uFLpppL)
+GO(lzma_vli_size, uFL)
diff --git a/src/wrapped/wrappedmpg123.c b/src/wrapped/wrappedmpg123.c
index 80d80cc..5b95749 100755..100644
--- a/src/wrapped/wrappedmpg123.c
+++ b/src/wrapped/wrappedmpg123.c
@@ -38,7 +38,7 @@ GO(4)
static uintptr_t my_r_read_fct_##A = 0; \
static ssize_t my_r_read_##A(void* a, void* b, size_t n) \
{ \
- return (ssize_t)RunFunction(my_context, my_r_read_fct_##A, 3, a, b, n); \
+ return (ssize_t)RunFunctionFmt(my_r_read_fct_##A, "ppL", a, b, n); \
}
SUPER()
#undef GO
@@ -60,7 +60,7 @@ static void* find_r_read_Fct(void* fct)
static uintptr_t my_r_lseek_fct_##A = 0; \
static int64_t my_r_lseek_##A(void* a, int64_t b, int n) \
{ \
- return (int64_t)RunFunction(my_context, my_r_lseek_fct_##A, 3, a, b, n); \
+ return (int64_t)RunFunctionFmt(my_r_lseek_fct_##A, "pIi", a, b, n); \
}
SUPER()
#undef GO
@@ -82,7 +82,7 @@ static void* find_r_lseek_Fct(void* fct)
static uintptr_t my_cleanup_fct_##A = 0; \
static void my_cleanup_##A(void* a) \
{ \
- RunFunction(my_context, my_cleanup_fct_##A, 1, a); \
+ RunFunctionFmt(my_cleanup_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -107,11 +107,6 @@ EXPORT int my_mpg123_replace_reader_handle(x64emu_t* emu, void* mh, void* r_read
return my->mpg123_replace_reader_handle(mh, find_r_read_Fct(r_read), find_r_lseek_Fct(r_lseek), find_cleanup_Fct(cleanup));
}
-EXPORT int my_mpg123_replace_reader_handle_32(x64emu_t* emu, void* mh, void* r_read, void* r_lseek, void* cleanup)
-{
- return my->mpg123_replace_reader_handle_32(mh, find_r_read_Fct(r_read), find_r_lseek_Fct(r_lseek), find_cleanup_Fct(cleanup));
-}
-
EXPORT int my_mpg123_replace_reader_handle_64(x64emu_t* emu, void* mh, void* r_read, void* r_lseek, void* cleanup)
{
return my->mpg123_replace_reader_handle_64(mh, find_r_read_Fct(r_read), find_r_lseek_Fct(r_lseek), find_cleanup_Fct(cleanup));
diff --git a/src/wrapped/wrappedmpg123_private.h b/src/wrapped/wrappedmpg123_private.h
index 9633cae..76d94aa 100755..100644
--- a/src/wrapped/wrappedmpg123_private.h
+++ b/src/wrapped/wrappedmpg123_private.h
@@ -4,136 +4,118 @@
//GO(mpg123_add_string,
//GO(mpg123_add_substring,
-//GO(mpg123_chomp_string,
-//GO(mpg123_clip,
+GO(mpg123_chomp_string, iFp)
+GO(mpg123_clip, lFp)
GO(mpg123_close, iFp)
//GO(mpg123_copy_string,
-//GO(mpg123_current_decoder,
-//GO(mpg123_decode,
+GO(mpg123_current_decoder, pFp)
+GO(mpg123_decode, iFppLpLp)
GO(mpg123_decode_frame, iFpppp)
-GO(mpg123_decode_frame_32, iFpppp)
GO(mpg123_decode_frame_64, iFpppp)
-GO(mpg123_decoder, iFppLpLp)
+GO(mpg123_decoder, iFpp)
//GO(mpg123_decoders,
GO(mpg123_delete, vFp)
-//GO(mpg123_delete_pars,
-//GO(mpg123_enc_from_id3,
+GO(mpg123_delete_pars, vFp)
+GO(mpg123_enc_from_id3, iFC)
GO(mpg123_encodings, vFpp)
GO(mpg123_encsize, iFi)
-//GO(mpg123_eq,
+GO(mpg123_eq, iFpiid)
GO(mpg123_errcode, iFp)
GO(mpg123_exit, vFv)
GO(mpg123_feature, iFi)
+GO(mpg123_feature2, iFi)
GO(mpg123_feed, iFppL)
-GO(mpg123_feedseek, IFpIip) // Warning, off_t is 64bits!
-GO(mpg123_feedseek_32, IFpIip)
+GO(mpg123_feedseek, lFplip)
GO(mpg123_feedseek_64, IFpIip)
-//GO(mpg123_fmt,
-//GO(mpg123_fmt_all,
-//GO(mpg123_fmt_none,
-//GO(mpg123_fmt_support,
+GO(mpg123_fmt, iFplii)
+GO(mpg123_fmt_all, iFp)
+GO(mpg123_fmt_none, iFp)
+GO(mpg123_fmt_support, iFpli)
GO(mpg123_format, iFplii)
GO(mpg123_format_all, iFp)
GO(mpg123_format_none, iFp)
GO(mpg123_format_support, iFpli)
GO(mpg123_framebyframe_decode, iFpppp)
-GO(mpg123_framebyframe_decode_32, iFpppp)
GO(mpg123_framebyframe_decode_64, iFpppp)
GO(mpg123_framebyframe_next, iFp)
GO(mpg123_framedata, iFpppp)
GO(mpg123_framelength, IFp)
-GO(mpg123_framelength_32, IFp)
GO(mpg123_framelength_64, IFp)
GO(mpg123_framepos, IFp)
-GO(mpg123_framepos_32, IFp)
GO(mpg123_framepos_64, IFp)
-//GO(mpg123_free_string,
-//GO(mpg123_geteq,
+GO(mpg123_free_string, vFp)
+GO(mpg123_geteq, dFpii)
GO(mpg123_getformat, iFpppp)
GO(mpg123_getformat2, iFppppi)
-//GO(mpg123_getpar,
+GO(mpg123_getpar, iFpipp)
GO(mpg123_getparam, iFpipp)
-//GO(mpg123_getstate,
-//GO(mpg123_getvolume,
-//GO(mpg123_grow_string,
-//GO(mpg123_icy,
-//GO(mpg123_icy2utf8,
-//GO(mpg123_id3,
+GO(mpg123_getparam2, iFpipp)
+GO(mpg123_getstate, iFpipp)
+GO(mpg123_getvolume, iFpppp)
+GO(mpg123_grow_string, iFpL)
+GO(mpg123_icy, iFpp)
+GO(mpg123_icy2utf8, pFp)
+GO(mpg123_id3, iFppp)
GO(mpg123_index, iFpppp)
-GO(mpg123_index_32, iFpppp)
GO(mpg123_index_64, iFpppp)
-//GO(mpg123_info,
+GO(mpg123_info, iFpp)
GO(mpg123_init, iFv)
//GO(mpg123_init_string,
-GO(mpg123_length, IFp)
-GO(mpg123_length_32, IFp)
+GO(mpg123_length, lFp)
GO(mpg123_length_64, IFp)
-//GO(mpg123_meta_check,
-//GO(mpg123_meta_free,
+GO(mpg123_meta_check, iFp)
+GO(mpg123_meta_free, vFp)
GO(mpg123_new, pFpp)
-//GO(mpg123_new_pars,
+GO(mpg123_new_pars, pFp)
GO(mpg123_open, iFpp)
-GO(mpg123_open_32, iFpp)
GO(mpg123_open_64, iFpp)
GO(mpg123_open_fd, iFpi)
-GO(mpg123_open_fd_32, iFpi)
GO(mpg123_open_fd_64, iFpi)
GO(mpg123_open_feed, iFp)
GO(mpg123_open_handle, iFpp)
-GO(mpg123_open_handle_32, iFpp)
GO(mpg123_open_handle_64, iFpp)
-//GO(mpg123_outblock,
-//GO(mpg123_par,
+GO(mpg123_outblock, LFp)
+GO(mpg123_par, iFpild)
GO(mpg123_param, iFpild)
-//GO(mpg123_parnew,
+GO(mpg123_param2, iFpild)
+GO(mpg123_parnew, pFppp)
GO(mpg123_plain_strerror, pFi)
-GO(mpg123_position, iFpIIpppp)
-GO(mpg123_position_32, iFpIIpppp)
+GO(mpg123_position, iFpllpppp)
GO(mpg123_position_64, iFpIIpppp)
GO(mpg123_rates, vFpp)
-GO(mpg123_read, iFppp)
-//GO(mpg123_replace_buffer,
+GO(mpg123_read, iFppLp)
+GO(mpg123_replace_buffer, iFppL)
//GO(mpg123_replace_reader,
-//GO(mpg123_replace_reader_32,
//GO(mpg123_replace_reader_64,
GOM(mpg123_replace_reader_handle, iFEpppp)
-GOM(mpg123_replace_reader_handle_32, iFEpppp)
GOM(mpg123_replace_reader_handle_64, iFEpppp)
//GO(mpg123_reset_eq,
//GO(mpg123_resize_string,
-//GO(mpg123_safe_buffer,
+GO(mpg123_safe_buffer, LFv)
//GO(mpg123_scan,
GO(mpg123_seek, IFpIi)
-GO(mpg123_seek_32, IFpIi)
GO(mpg123_seek_64, IFpIi)
-GO(mpg123_seek_frame, IFpIi)
-GO(mpg123_seek_frame_32, IFpIi)
+GO(mpg123_seek_frame, lFpli)
GO(mpg123_seek_frame_64, IFpIi)
-GO(mpg123_set_filesize, iFpI)
-GO(mpg123_set_filesize_32, iFpI)
+GO(mpg123_set_filesize, iFpl)
GO(mpg123_set_filesize_64, iFpI)
-GO(mpg123_set_index, iFppIL)
-GO(mpg123_set_index_32, iFppIL)
+GO(mpg123_set_index, iFpplL)
GO(mpg123_set_index_64, iFppIL)
-//GO(mpg123_set_string,
-//GO(mpg123_set_substring,
+GO(mpg123_set_string, iFpp)
+GO(mpg123_set_substring, iFppLL)
//GO(mpg123_spf,
-//GO(mpg123_store_utf8,
+GO(mpg123_store_utf8, iFpipL)
GO(mpg123_strerror, pFp)
-//GO(mpg123_strlen,
-//GO(mpg123_supported_decoders,
+GO(mpg123_strlen, LFpi)
+GO(mpg123_supported_decoders, pFv)
GO(mpg123_tell, IFp)
-GO(mpg123_tell_32, IFp)
GO(mpg123_tell_64, IFp)
GO(mpg123_tellframe, IFp)
-GO(mpg123_tellframe_32, IFp)
GO(mpg123_tellframe_64, IFp)
GO(mpg123_tell_stream, IFp)
-GO(mpg123_tell_stream_32, IFp)
GO(mpg123_tell_stream_64, IFp)
-GO(mpg123_timeframe, IFpd)
-GO(mpg123_timeframe_32, IFpd)
+GO(mpg123_timeframe, lFpd)
GO(mpg123_timeframe_64, IFpd)
-//GO(mpg123_tpf,
+GO(mpg123_tpf, dFp)
//GO(mpg123_volume,
-//GO(mpg123_volume_change,
+GO(mpg123_volume_change, iFpd)
diff --git a/src/wrapped/wrappednsl.c b/src/wrapped/wrappednsl.c
index fd2c287..fd2c287 100755..100644
--- a/src/wrapped/wrappednsl.c
+++ b/src/wrapped/wrappednsl.c
diff --git a/src/wrapped/wrappednsl_private.h b/src/wrapped/wrappednsl_private.h
index f0c538b..f0c538b 100755..100644
--- a/src/wrapped/wrappednsl_private.h
+++ b/src/wrapped/wrappednsl_private.h
diff --git a/src/wrapped/wrappednspr4.c b/src/wrapped/wrappednspr4.c
index 07240fc..07240fc 100755..100644
--- a/src/wrapped/wrappednspr4.c
+++ b/src/wrapped/wrappednspr4.c
diff --git a/src/wrapped/wrappednspr4_private.h b/src/wrapped/wrappednspr4_private.h
index 9a02d1c..47100da 100755..100644
--- a/src/wrapped/wrappednspr4_private.h
+++ b/src/wrapped/wrappednspr4_private.h
@@ -2,117 +2,119 @@
#error Meh....
#endif
+// typedef PRUint32 PRIntervalTime;
+
//GO(GetExecutionEnvironment,
//GO(libVersionPoint,
//GO(LL_MaxInt,
//GO(LL_MaxUint,
//GO(LL_MinInt,
-//GO(LL_Zero,
+GO(LL_Zero, lFv)
//GO(PR_Abort,
//GO(PR_Accept,
//GO(PR_AcceptRead,
-//GO(PR_Access,
+GO(PR_Access, iFpu)
//GO(PR_AddToCounter,
//GO(PR_AddWaitFileDesc,
//GO(PR_AllocFileDesc,
-//GO(PR_Assert,
-//GO(PR_AssertCurrentThreadInMonitor,
-//GO(PR_AssertCurrentThreadOwnsLock,
-//GO(PR_AtomicAdd,
-//GO(PR_AtomicDecrement,
+GO(PR_Assert, vFppi)
+GO(PR_AssertCurrentThreadInMonitor, vFp)
+GO(PR_AssertCurrentThreadOwnsLock, vFp)
+GO(PR_AtomicAdd, iFpi)
+GO(PR_AtomicDecrement, iFp)
//GO(PR_AtomicIncrement,
//GO(PR_AtomicSet,
-//GO(PR_AttachSharedMemory,
+GO(PR_AttachSharedMemory, pFpi)
//GO(PR_AttachThread,
//GO(PR_Available,
//GO(PR_Available64,
//GO(PR_Bind,
//GO(PR_BlockClockInterrupts,
//GO(PR_BlockInterrupt,
-//GO(PR_Calloc,
+GO(PR_Calloc, pFuu)
//GO(PR_CallOnce,
//GO(PR_CallOnceWithArg,
//GO(PR_CancelJob,
//GO(PR_CancelWaitFileDesc,
//GO(PR_CancelWaitGroup,
//GO(PR_CeilingLog2,
-//GO(PR_CEnterMonitor,
+GO(PR_CEnterMonitor, pFp)
//GO(PR_CExitMonitor,
//GO(PR_ChangeFileDescNativeHandle,
-//GO(PR_Cleanup,
+GO(PR_Cleanup, iFv)
//GO(PR_ClearInterrupt,
//GO(PR_ClearThreadGCAble,
GO(PR_Close, iFp)
-//GO(PR_CloseDir,
-//GO(PR_CloseFileMap,
-//GO(PR_CloseSemaphore,
-//GO(PR_CloseSharedMemory,
+GO(PR_CloseDir, iFp)
+GO(PR_CloseFileMap, iFp)
+GO(PR_CloseSemaphore, iFp)
+GO(PR_CloseSharedMemory, iFp)
//GO(PR_CNotify,
-//GO(PR_CNotifyAll,
-//GO(PR_cnvtf,
+GO(PR_CNotifyAll, iFp)
+GO(PR_cnvtf, vFpiid)
//GO(PR_Connect,
//GO(PR_ConnectContinue,
-//GO(PR_ConvertIPv4AddrToIPv6,
+GO(PR_ConvertIPv4AddrToIPv6, vFup)
//GO(PR_CreateAlarm,
//GO(PR_CreateCounter,
//GO(PR_CreateFileMap,
//GO(PR_CreateIOLayer,
//GO(PR_CreateIOLayerStub,
-//GO(PR_CreateMWaitEnumerator,
+GO(PR_CreateMWaitEnumerator, pFp)
//GO(PR_CreateOrderedLock,
-//GO(PR_CreatePipe,
-//GO(PR_CreateProcess,
-//GO(PR_CreateProcessDetached,
+GO(PR_CreatePipe, iFpp)
+GO(PR_CreateProcess, pFpppp)
+GO(PR_CreateProcessDetached, iFpppp)
//GO(PR_CreateSocketPollFd,
-//GO(PR_CreateStack,
+GO(PR_CreateStack, pFp)
//GO(PR_CreateThread,
//GO(PR_CreateThreadGCAble,
-//GO(PR_CreateThreadPool,
-//GO(PR_CreateTrace,
-//GO(PR_CreateWaitGroup,
+GO(PR_CreateThreadPool, pFiiu)
+GO(PR_CreateTrace, pFppp)
+GO(PR_CreateWaitGroup, pFi)
//GO(PR_CSetOnMonitorRecycle,
-//GO(PR_CWait,
+GO(PR_CWait, iFpu)
//GO(PR_DecrementCounter,
//GO(PR_Delete,
//GO(PR_DeleteSemaphore,
-//GO(PR_DeleteSharedMemory,
+GO(PR_DeleteSharedMemory, iFp)
//GO(PR_DestroyAlarm,
-//GO(PR_DestroyCondVar,
+GO(PR_DestroyCondVar, vFp)
//GO(PR_DestroyCounter,
//GO(PR_DestroyLock,
//GO(PR_DestroyMonitor,
-//GO(PR_DestroyMWaitEnumerator,
+GO(PR_DestroyMWaitEnumerator, iFp)
//GO(PR_DestroyOrderedLock,
//GO(PR_DestroyPollableEvent,
-//GO(PR_DestroyProcessAttr,
+GO(PR_DestroyProcessAttr, vFp)
//GO(PR_DestroyRWLock,
//GO(PR_DestroySem,
//GO(PR_DestroySocketPollFd,
-//GO(PR_DestroyStack,
-//GO(PR_DestroyTrace,
-//GO(PR_DestroyWaitGroup,
+GO(PR_DestroyStack, iFp)
+GO(PR_DestroyTrace, vFp)
+GO(PR_DestroyWaitGroup, iFp)
//GO(PR_DetachProcess,
-//GO(PR_DetachSharedMemory,
+GO(PR_DetachSharedMemory, iFpp)
GO(PR_DetachThread, vFv)
//GO(PR_DisableClockInterrupts,
-//GO(PR_dtoa,
-//GO(PR_DuplicateEnvironment,
+GO(PR_dtoa, iFdiippppL)
+GO(PR_DuplicateEnvironment, pFv)
GO(PR_EmulateAcceptRead, iFppppiu)
GO(PR_EmulateSendFile, iFppiu)
//GO(PR_EnableClockInterrupts,
//GO(PR_EnterMonitor,
-//GO(PR_EnumerateAddrInfo,
-//GO(PR_EnumerateHostEnt,
+GO(PR_EnumerateAddrInfo, pFppWp)
+GO(PR_EnumerateHostEnt, iFipWp)
//GO(PR_EnumerateThreads,
//GO(PR_EnumerateWaitGroup,
//GO(PR_ErrorInstallCallback,
-//GO(PR_ErrorInstallTable,
-//GO(PR_ErrorLanguages,
-//GO(PR_ErrorToName,
-//GO(PR_ErrorToString,
+GO(PR_ErrorInstallTable, iFp)
+GO(PR_ErrorLanguages, pFv)
+GO(PR_ErrorToName, pFi)
+GO(PR_ErrorToString, pFiu)
//GO(PR_ExitMonitor,
//GO(PR_ExplodeTime,
-//GO(PR_ExportFileMapAsString,
+GO(PR_ExportFileMapAsString, iFpLp)
//GO(PR_FD_CLR,
//GO(PR_FD_ISSET,
//GO(PR_FD_NCLR,
@@ -121,29 +123,29 @@ GO(PR_EmulateSendFile, iFppiu)
//GO(PR_FD_SET,
//GO(PR_FD_ZERO,
//GO(PR_FileDesc2NativeHandle,
-//GO(PR_FindFunctionSymbol,
-//GO(PR_FindFunctionSymbolAndLibrary,
+GO(PR_FindFunctionSymbol, pFpp)
+GO(PR_FindFunctionSymbolAndLibrary, pFpp)
//GO(PR_FindNextCounterQname,
//GO(PR_FindNextCounterRname,
-//GO(PR_FindNextTraceQname,
-//GO(PR_FindNextTraceRname,
-//GO(PR_FindSymbol,
-//GO(PR_FindSymbolAndLibrary,
-//GO(PR_FloorLog2,
-//GO(PR_FormatTime,
-//GO(PR_FormatTimeUSEnglish,
+GO(PR_FindNextTraceQname, pFp)
+GO(PR_FindNextTraceRname, pFpp)
+GO(PR_FindSymbol, pFpp)
+GO(PR_FindSymbolAndLibrary, pFpp)
+GO(PR_FloorLog2, iFu)
+GO(PR_FormatTime, uFpipp)
+GO(PR_FormatTimeUSEnglish, uFpupp)
//GO(PR_fprintf,
//GO(PR_FPrintZoneStats,
-//GO(PR_Free,
-//GO(PR_FreeAddrInfo,
+GO(PR_Free, vFp)
+GO(PR_FreeAddrInfo, vFp)
//GO(PR_FreeLibraryName,
-//GO(PR_GetAddrInfoByName,
-//GO(PR_GetCanonNameFromAddrInfo,
+GO(PR_GetAddrInfoByName, pFpWi)
+GO(PR_GetCanonNameFromAddrInfo, pFp)
//GO(PR_GetConnectStatus,
//GO(PR_GetCounter,
//GO(PR_GetCounterHandleFromName,
//GO(PR_GetCounterNameFromHandle,
-//GO(PR_GetCurrentThread,
+GO(PR_GetCurrentThread, pFv)
//GO(PR_GetDefaultIOMethods,
//GO(PR_GetDescType,
//GO(PR_GetDirectorySeparator,
@@ -151,88 +153,88 @@ GO(PR_EmulateSendFile, iFppiu)
//GO(PR_GetEnv,
//GO(PR_GetEnvSecure,
GO(PR_GetError, iFv)
-//GO(PR_GetErrorText,
-//GO(PR_GetErrorTextLength,
-//GO(PR_GetFileInfo,
-//GO(PR_GetFileInfo64,
+GO(PR_GetErrorText, iFp)
+GO(PR_GetErrorTextLength, iFv)
+GO(PR_GetFileInfo, iFpp)
+GO(PR_GetFileInfo64, iFpp)
//GO(PR_GetFileMethods,
//GO(PR_GetGCRegisters,
-//GO(PR_GetHostByAddr,
-//GO(PR_GetHostByName,
+GO(PR_GetHostByAddr, iFppip)
+GO(PR_GetHostByName, iFppip)
//GO(PR_GetIdentitiesLayer,
//GO(PR_GetInheritedFD,
//GO(PR_GetInheritedFileMap,
-//GO(PR_GetIPNodeByName,
+GO(PR_GetIPNodeByName, iFpWipip)
//GO(PR_GetLayersIdentity,
//GO(PR_GetLibraryFilePathname,
-//GO(PR_GetLibraryName,
-//GO(PR_GetLibraryPath,
+GO(PR_GetLibraryName, pFpp)
+GO(PR_GetLibraryPath, pFv)
//GO(PR_GetMemMapAlignment,
//GO(PR_GetMonitorEntryCount,
-//GO(PR_GetNameForIdentity,
-//GO(PR_GetNumberOfProcessors,
+GO(PR_GetNameForIdentity, pFi)
+GO(PR_GetNumberOfProcessors, iFv)
//GO(PR_GetOpenFileInfo,
//GO(PR_GetOpenFileInfo64,
-//GO(PR_GetOSError,
+GO(PR_GetOSError, iFv)
//GO(PR_GetPageShift,
//GO(PR_GetPageSize,
-//GO(PR_GetPathSeparator,
+GO(PR_GetPathSeparator, cFv)
//GO(PR_GetPeerName,
-//GO(PR_GetPhysicalMemorySize,
+GO(PR_GetPhysicalMemorySize, LFv)
//GO(PR_GetPipeMethods,
-//GO(PR_GetProtoByName,
-//GO(PR_GetProtoByNumber,
-//GO(PR_GetRandomNoise,
+GO(PR_GetProtoByName, iFppip)
+GO(PR_GetProtoByNumber, iFipip)
+GO(PR_GetRandomNoise, LFpL)
//GO(PR_GetSocketOption,
//GO(PR_GetSockName,
//GO(PR_GetSP,
//GO(PR_GetSpecialFD,
//GO(PR_GetStackSpaceLeft,
//GO(PR_GetSysfdTableMax,
-//GO(PR_GetSystemInfo,
+GO(PR_GetSystemInfo, iFupu)
//GO(PR_GetTCPMethods,
//GO(PR_GetThreadAffinityMask,
//GO(PR_GetThreadID,
-//GO(PR_GetThreadName,
-//GO(PR_GetThreadPriority,
-//GO(PR_GetThreadPrivate,
-//GO(PR_GetThreadScope,
-//GO(PR_GetThreadState,
-//GO(PR_GetThreadType,
-//GO(PR_GetTraceEntries,
-//GO(PR_GetTraceHandleFromName,
-//GO(PR_GetTraceNameFromHandle,
-//GO(PR_GetTraceOption,
+GO(PR_GetThreadName, pFp)
+GO(PR_GetThreadPriority, uFp)
+GO(PR_GetThreadPrivate, pFu)
+GO(PR_GetThreadScope, uFp)
+GO(PR_GetThreadState, uFp)
+GO(PR_GetThreadType, uFp)
+GO(PR_GetTraceEntries, iFpip)
+GO(PR_GetTraceHandleFromName, pFpp)
+GO(PR_GetTraceNameFromHandle, vFpppp)
+GO(PR_GetTraceOption, vFup)
//GO(PR_GetUDPMethods,
-//GO(PR_GetUniqueIdentity,
-//GO(PR_GetVersion,
+GO(PR_GetUniqueIdentity, iFp)
+GO(PR_GetVersion, pFv)
//GO(PR_GMTParameters,
-//GO(PR_htonl,
-//GO(PR_htonll,
-//GO(PR_htons,
-//GO(PR_ImplodeTime,
+GO(PR_htonl, uFu)
+GO(PR_htonll, LFL)
+GO(PR_htons, WFW)
+GO(PR_ImplodeTime, lFp)
//GO(PR_ImportFile,
-//GO(PR_ImportFileMapFromString,
+GO(PR_ImportFileMapFromString, pFp)
//GO(PR_ImportPipe,
GO(PR_ImportTCPSocket, pFi)
//GO(PR_ImportUDPSocket,
//GO(PR_IncrementCounter,
-GO(PR_Init, vFiii)
+GO(PR_Init, vFuuu)
//GO(PR_Initialize,
GO(PR_Initialized, iFv)
-//GO(PR_InitializeNetAddr,
-//GO(PR_Interrupt,
-//GO(PR_IntervalNow,
-//GO(PR_IntervalToMicroseconds,
-//GO(PR_IntervalToMilliseconds,
+GO(PR_InitializeNetAddr, iFuWp)
+GO(PR_Interrupt, iFp)
+GO(PR_IntervalNow, uFv)
+GO(PR_IntervalToMicroseconds, uFu)
+GO(PR_IntervalToMilliseconds, uFu)
//GO(PR_IntervalToSeconds,
-//GO(PR_IsNetAddrType,
-//GO(PR_JoinJob,
+GO(PR_IsNetAddrType, iFpu)
+GO(PR_JoinJob, iFp)
//GO(PR_JoinThread,
-//GO(PR_JoinThreadPool,
-//GO(PR_KillProcess,
+GO(PR_JoinThreadPool, iFp)
+GO(PR_KillProcess, iFp)
//GO(PR_Listen,
-//GO(PR_LoadLibrary,
+//GO(PR_LoadLibrary, pFp) // needs wrapping
//GO(PR_LoadLibraryWithFlags,
//GO(PR_LoadStaticLibrary,
//GO(PR_LocalTimeParameters,
@@ -241,46 +243,46 @@ GO(PR_Initialized, iFv)
//GO(PR_LockOrderedLock,
//GO(PR_LogFlush,
//GO(PR_LogPrint,
-//GO(PR_MakeDir,
-//GO(PR_Malloc,
-//GO(PR_MemMap,
-//GO(PR_MemUnmap,
-//GO(PR_MicrosecondsToInterval,
+GO(PR_MakeDir, iFpi)
+GO(PR_Malloc, pFu)
+//GO(PR_MemMap, pFplu) // needs wrapping
+//GO(PR_MemUnmap, iFpu) // needs wrapping
+GO(PR_MicrosecondsToInterval, uFu)
//GO(PR_MillisecondsToInterval,
//GO(PR_MkDir,
-//GO(PR_NetAddrToString,
-//GO(PR_NewCondVar,
-//GO(PR_NewLock,
-//GO(PR_NewLogModule,
-//GO(PR_NewMonitor,
+GO(PR_NetAddrToString, iFppu)
+GO(PR_NewCondVar, pFp)
+GO(PR_NewLock, pFv)
+GO(PR_NewLogModule, pFp)
+GO(PR_NewMonitor, pFv)
//GO(PR_NewNamedMonitor,
//GO(PR_NewPollableEvent,
-//GO(PR_NewProcessAttr,
-//GO(PR_NewRWLock,
+GO(PR_NewProcessAttr, pFv)
+GO(PR_NewRWLock, pFup)
//GO(PR_NewSem,
//GO(PR_NewTCPSocket,
-//GO(PR_NewTCPSocketPair,
+GO(PR_NewTCPSocketPair, iFp)
//GO(PR_NewThreadPrivateIndex,
//GO(PR_NewUDPSocket,
//GO(PR_NormalizeTime,
//GO(PR_Notify,
-//GO(PR_NotifyAll,
-//GO(PR_NotifyAllCondVar,
+GO(PR_NotifyAll, iFp)
+GO(PR_NotifyAllCondVar, iFp)
//GO(PR_NotifyCondVar,
-GO(PR_Now, pFv)
+GO(PR_Now, lFv)
//GO(PR_ntohl,
//GO(PR_ntohll,
//GO(PR_ntohs,
//GO(PR_Open,
-//GO(PR_OpenAnonFileMap,
-//GO(PR_OpenDir,
+GO(PR_OpenAnonFileMap, pFpLu)
+GO(PR_OpenDir, pFp)
//GO(PR_OpenFile,
-//GO(PR_OpenSemaphore,
-//GO(PR_OpenSharedMemory,
+GO(PR_OpenSemaphore, pFpiiu)
+GO(PR_OpenSharedMemory, pFpLii)
//GO(PR_OpenTCPSocket,
//GO(PR_OpenUDPSocket,
-//GO(PR_ParseTimeString,
-//GO(PR_ParseTimeStringToExplodedTime,
+GO(PR_ParseTimeString, iFpip)
+GO(PR_ParseTimeStringToExplodedTime, iFpip)
//GO(PRP_DestroyNakedCondVar,
//GO(PRP_NakedBroadcast,
//GO(PRP_NakedNotify,
@@ -290,9 +292,9 @@ GO(PR_Now, pFv)
//GO(PR_PopIOLayer,
//GO(PR_PostSem,
//GO(PR_PostSemaphore,
-//GO(PR_ProcessAttrSetCurrentDirectory,
+GO(PR_ProcessAttrSetCurrentDirectory, iFpp)
//GO(PR_ProcessAttrSetInheritableFD,
-//GO(PR_ProcessAttrSetInheritableFileMap,
+GO(PR_ProcessAttrSetInheritableFileMap, iFppp)
//GO(PR_ProcessAttrSetStdioRedirect,
//GO(PR_ProcessExit,
//GO(PRP_TryLock,
@@ -305,18 +307,18 @@ GO(PR_Now, pFv)
//GO(PR_QueueJob_Timer,
//GO(PR_QueueJob_Write,
GO(PR_Read, iFppi)
-//GO(PR_ReadDir,
-//GO(PR_Realloc,
-//GO(PR_RecordTraceEntries,
+GO(PR_ReadDir, pFpu)
+GO(PR_Realloc, pFpu)
+GO(PR_RecordTraceEntries, vFv)
//GO(PR_Recv,
//GO(PR_RecvFrom,
-//GO(PR_Rename,
+GO(PR_Rename, iFpp)
//GO(PR_ResetAlarm,
//GO(PR_ResetProcessAttr,
//GO(PR_ResumeAll,
//GO(PR_RmDir,
//GO(PR_RWLock_Rlock,
-//GO(PR_RWLock_Unlock,
+GO(PR_RWLock_Unlock, vFp)
//GO(PR_RWLock_Wlock,
//GO(PR_ScanStackPointers,
//GO(PR_SecondsToInterval,
@@ -327,18 +329,18 @@ GO(PR_Read, iFppi)
//GO(PR_SendFile,
//GO(PR_SendTo,
//GO(PR_SetAlarm,
-//GO(PR_SetConcurrency,
+GO(PR_SetConcurrency, vFu)
//GO(PR_SetCounter,
//GO(PR_SetCurrentThreadName,
//GO(PR_SetEnv,
-//GO(PR_SetError,
-//GO(PR_SetErrorText,
-//GO(PR_SetFDCacheSize,
+GO(PR_SetError, vFii)
+GO(PR_SetErrorText, vFip)
+GO(PR_SetFDCacheSize, iFii)
//GO(PR_SetFDInheritable,
//GO(PR_SetLibraryPath,
-//GO(PR_SetLogBuffering,
-//GO(PR_SetLogFile,
-//GO(PR_SetNetAddr,
+GO(PR_SetLogBuffering, vFi)
+GO(PR_SetLogFile, iFp)
+GO(PR_SetNetAddr, iFuWWp)
//GO(PR_SetPollableEvent,
GO(PR_SetSocketOption, iFpp)
//GO(PR_SetStdioRedirect,
@@ -346,24 +348,24 @@ GO(PR_SetSocketOption, iFpp)
//GO(PR_SetThreadAffinityMask,
//GO(PR_SetThreadDumpProc,
//GO(PR_SetThreadGCAble,
-//GO(PR_SetThreadPriority,
-//GO(PR_SetThreadPrivate,
+GO(PR_SetThreadPriority, vFpu)
+GO(PR_SetThreadPrivate, iFup)
//GO(PR_SetThreadRecycleMode,
//GO(PR_SetTraceOption,
//GO(PR_Shutdown,
//GO(PR_ShutdownThreadPool,
-//GO(PR_Sleep,
+GO(PR_Sleep, iFu)
//GO(PR_smprintf,
-//GO(PR_smprintf_free,
+GO(PR_smprintf_free, vFp)
//GO(PR_snprintf,
//GO(PR_Socket,
//GO(PR_sprintf_append,
//GO(PR_sscanf,
-//GO(PR_StackPop,
-//GO(PR_StackPush,
+GO(PR_StackPop, pFp)
+GO(PR_StackPush, vFpp)
//GO(PR_Stat,
-//GO(PR_StringToNetAddr,
-//GO(PR_strtod,
+GO(PR_StringToNetAddr, iFpp)
+GO(PR_strtod, dFpp)
//GO(PR_SubtractFromCounter,
//GO(PR_SuspendAll,
//GO(PR_sxprintf,
@@ -371,27 +373,27 @@ GO(PR_SetSocketOption, iFpp)
//GO(PR_SyncMemMap,
//GO(_pr_test_ipv6_socket,
//GO(PR_ThreadScanStackPointers,
-//GO(PR_TicksPerSecond,
+GO(PR_TicksPerSecond, uFv)
//GO(PR_TLockFile,
-//GO(PR_Trace,
+GO(PR_Trace, vFpuuuuuuuu)
//GO(PR_TransmitFile,
//GO(PR_UnblockClockInterrupts,
//GO(PR_UnblockInterrupt,
-//GO(PR_UnloadLibrary,
-//GO(PR_Unlock,
+GO(PR_UnloadLibrary, iFp)
+GO(PR_Unlock, iFp)
//GO(PR_UnlockFile,
//GO(PR_UnlockOrderedLock,
//GO(PR_USPacificTimeParameters,
//GO(PR_VersionCheck,
//GO(PR_vfprintf,
-//GO(PR_vsmprintf,
-//GO(PR_vsnprintf,
-//GO(PR_vsprintf_append,
+GO(PR_vsmprintf, pFpp)
+GO(PR_vsnprintf, uFpupp)
+GO(PR_vsprintf_append, pFppp)
//GO(PR_vsxprintf,
-//GO(PR_Wait,
-//GO(PR_WaitCondVar,
+GO(PR_Wait, iFpu)
+GO(PR_WaitCondVar, iFpu)
//GO(PR_WaitForPollableEvent,
-//GO(PR_WaitProcess,
+GO(PR_WaitProcess, iFpp)
//GO(PR_WaitRecvReady,
//GO(PR_WaitSem,
//GO(PR_WaitSemaphore,
diff --git a/src/wrapped/wrappednss3.c b/src/wrapped/wrappednss3.c
index 2b10bb4..e64ac39 100755..100644
--- a/src/wrapped/wrappednss3.c
+++ b/src/wrapped/wrappednss3.c
@@ -37,7 +37,7 @@ GO(4)
static uintptr_t my_PK11PasswordFunc_fct_##A = 0; \
static void* my_PK11PasswordFunc_##A(void* a, int b, void* c) \
{ \
- return (void*)RunFunction(my_context, my_PK11PasswordFunc_fct_##A, 3, a, b, c); \
+ return (void*)RunFunctionFmt(my_PK11PasswordFunc_fct_##A, "pip", a, b, c); \
}
SUPER()
#undef GO
@@ -60,7 +60,7 @@ static void* find_PK11PasswordFunc_Fct(void* fct)
static uintptr_t my_CERT_StringFromCertFcn_fct_##A = 0; \
static void* my_CERT_StringFromCertFcn_##A(void* a) \
{ \
- return (void*)RunFunction(my_context, my_CERT_StringFromCertFcn_fct_##A, 1, a); \
+ return (void*)RunFunctionFmt(my_CERT_StringFromCertFcn_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -92,7 +92,7 @@ static void* reverse_CERT_StringFromCertFcn_Fct(library_t* lib, void* fct)
static uintptr_t my_CERTChainVerifyCallbackFunc_fct_##A = 0; \
static int my_CERTChainVerifyCallbackFunc_##A(void* a, void* b, void* c) \
{ \
- return (int)RunFunction(my_context, my_CERTChainVerifyCallbackFunc_fct_##A, 3, a, b, c); \
+ return (int)RunFunctionFmt(my_CERTChainVerifyCallbackFunc_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -119,6 +119,28 @@ static void* reverse_CERTChainVerifyCallbackFunc_Fct(library_t* lib, void* fct)
#undef GO
return (void*)AddBridge(lib->w.bridge, iFppp, fct, 0, NULL);
}
+// PORTCharConversionWSwapFunc ...
+#define GO(A) \
+static uintptr_t my_PORTCharConversionWSwapFunc_fct_##A = 0; \
+static int my_PORTCharConversionWSwapFunc_##A(int a, void* b, uint32_t c, void* d, uint32_t e, void* f, int g) \
+{ \
+ return (int)RunFunctionFmt(my_PORTCharConversionWSwapFunc_fct_##A, "ipupupi", a, b, c, d, e, f, g); \
+}
+SUPER()
+#undef GO
+static void* find_PORTCharConversionWSwapFunc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_PORTCharConversionWSwapFunc_fct_##A == (uintptr_t)fct) return my_PORTCharConversionWSwapFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_PORTCharConversionWSwapFunc_fct_##A == 0) {my_PORTCharConversionWSwapFunc_fct_##A = (uintptr_t)fct; return my_PORTCharConversionWSwapFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for nss3 PORTCharConversionWSwapFunc callback\n");
+ return NULL;
+}
#undef SUPER
@@ -179,6 +201,11 @@ EXPORT int my_CERT_PKIXVerifyCert(x64emu_t* emu, void* cert, int64_t usages, my_
return ret;
}
+EXPORT void my_PORT_SetUCS2_ASCIIConversionFunction(x64emu_t* emu, void* f)
+{
+ my->PORT_SetUCS2_ASCIIConversionFunction(find_PORTCharConversionWSwapFunc_Fct(f));
+}
+
#define CUSTOM_INIT \
getMy(lib);
diff --git a/src/wrapped/wrappednss3_private.h b/src/wrapped/wrappednss3_private.h
index bbe3dba..4571086 100755..100644
--- a/src/wrapped/wrappednss3_private.h
+++ b/src/wrapped/wrappednss3_private.h
@@ -7,291 +7,291 @@
// CK_ATTRIBUTE_TYPE is type ULong
// SECOidTag is an enum
-//GO(ATOB_AsciiToData,
-//GO(ATOB_ConvertAsciiToItem,
+GO(ATOB_AsciiToData, pFpp)
+GO(ATOB_ConvertAsciiToItem, iFpp)
//GO(BTOA_ConvertItemToAscii,
-//GO(BTOA_DataToAscii,
-//GO(CERT_AddCertToListHead,
+GO(BTOA_DataToAscii, pFpu)
+GO(CERT_AddCertToListHead, iFpp)
//GO(CERT_AddCertToListSorted,
-//GO(CERT_AddCertToListTail,
-//GO(CERT_AddExtension,
-//GO(CERT_AddExtensionByOID,
+GO(CERT_AddCertToListTail, iFpp)
+GO(CERT_AddExtension, iFpipii)
+GO(CERT_AddExtensionByOID, iFpppii)
//GO(CERT_AddOCSPAcceptableResponses,
-//GO(CERT_AddOKDomainName,
-//GO(CERT_AddRDN,
+GO(CERT_AddOKDomainName, iFpp)
+GO(CERT_AddRDN, iFpp)
//GO(__CERT_AddTempCertToPerm,
-//GO(CERT_AllocCERTRevocationFlags,
-//GO(CERT_AsciiToName,
+GO(CERT_AllocCERTRevocationFlags, pFuuuu)
+GO(CERT_AsciiToName, pFp)
//GO(CERT_CacheCRL,
-//GO(CERT_CacheOCSPResponseFromSideChannel,
-//GO(CERT_CertChainFromCert,
+GO(CERT_CacheOCSPResponseFromSideChannel, iFpplpp)
+GO(CERT_CertChainFromCert, pFpui)
//DATA(CERT_CertificateRequestTemplate,
DATA(CERT_CertificateTemplate, 480)
-//GO(CERT_CertListFromCert,
+GO(CERT_CertListFromCert, pFp)
//GO(CERT_CertTimesValid,
-//GO(CERT_ChangeCertTrust,
-//GO(CERT_CheckCertUsage,
-GO(CERT_CheckCertValidTimes, iFpIi)
-//GO(CERT_CheckNameSpace,
-//GO(CERT_CheckOCSPStatus,
-//GO(CERT_ClearOCSPCache,
+GO(CERT_ChangeCertTrust, iFppp)
+GO(CERT_CheckCertUsage, iFpC)
+GO(CERT_CheckCertValidTimes, uFpli)
+GO(CERT_CheckNameSpace, iFppp)
+GO(CERT_CheckOCSPStatus, iFpplp)
+GO(CERT_ClearOCSPCache, iFv)
//GO(__CERT_ClosePermCertDB,
-//GO(CERT_CompareAVA,
-//GO(CERT_CompareCerts,
-//GO(CERT_CompareName,
+GO(CERT_CompareAVA, iFpp)
+GO(CERT_CompareCerts, iFpp)
+GO(CERT_CompareName, iFpp)
//GO(CERT_CompareValidityTimes,
-//GO(CERT_CompleteCRLDecodeEntries,
-//GO(CERT_CopyName,
-//GO(CERT_CopyRDN,
-//GO(CERT_CreateAVA,
-//GO(CERT_CreateCertificate,
-//GO(CERT_CreateCertificateRequest,
-//GO(CERT_CreateEncodedOCSPErrorResponse,
-//GO(CERT_CreateEncodedOCSPSuccessResponse,
+GO(CERT_CompleteCRLDecodeEntries, iFp)
+GO(CERT_CopyName, iFppp)
+GO(CERT_CopyRDN, iFppp)
+GO(CERT_CreateAVA, pFpuip)
+GO(CERT_CreateCertificate, pFLppp)
+GO(CERT_CreateCertificateRequest, pFppp)
+GO(CERT_CreateEncodedOCSPErrorResponse, pFpi)
+GO(CERT_CreateEncodedOCSPSuccessResponse, pFppilpp)
//GO(CERT_CreateName,
-//GO(CERT_CreateOCSPCertID,
-//GO(CERT_CreateOCSPRequest,
+GO(CERT_CreateOCSPCertID, pFpl)
+GO(CERT_CreateOCSPRequest, pFplip)
//GO(CERT_CreateOCSPSingleResponseGood,
-//GO(CERT_CreateOCSPSingleResponseRevoked,
-//GO(CERT_CreateOCSPSingleResponseUnknown,
+GO(CERT_CreateOCSPSingleResponseRevoked, pFpplplp)
+GO(CERT_CreateOCSPSingleResponseUnknown, pFpplp)
//GO(CERT_CreateRDN,
-GO(CERT_CreateSubjectCertList, pFpppIi)
-GO(CERT_CreateValidity, pFII)
-//GO(CERT_CRLCacheRefreshIssuer,
+GO(CERT_CreateSubjectCertList, pFpppli)
+GO(CERT_CreateValidity, pFll)
+GO(CERT_CRLCacheRefreshIssuer, vFpp)
//DATA(CERT_CrlTemplate,
GO(CERT_DecodeAltNameExtension, pFpp)
-//GO(CERT_DecodeAuthInfoAccessExtension,
-//GO(CERT_DecodeAuthKeyID,
+GO(CERT_DecodeAuthInfoAccessExtension, pFpp)
+GO(CERT_DecodeAuthKeyID, pFpp)
GO(CERT_DecodeAVAValue, pFp)
-//GO(CERT_DecodeBasicConstraintValue,
+GO(CERT_DecodeBasicConstraintValue, iFpp)
GO(CERT_DecodeCertificatePoliciesExtension, pFp)
-//GO(CERT_DecodeCRLDistributionPoints,
+GO(CERT_DecodeCRLDistributionPoints, pFpp)
//GO(__CERT_DecodeDERCertificate,
-//GO(CERT_DecodeDERCrl,
-//GO(CERT_DecodeDERCrlWithFlags,
-//GO(CERT_DecodeGeneralName,
-//GO(CERT_DecodeNameConstraintsExtension,
-//GO(CERT_DecodeOCSPRequest,
-//GO(CERT_DecodeOCSPResponse,
-//GO(CERT_DecodeOidSequence,
-//GO(CERT_DecodePrivKeyUsagePeriodExtension,
-//GO(CERT_DecodeTrustString,
-//GO(CERT_DecodeUserNotice,
-//GO(CERT_DerNameToAscii,
-//GO(CERT_DestroyCertArray,
+GO(CERT_DecodeDERCrl, pFppi)
+GO(CERT_DecodeDERCrlWithFlags, pFppii)
+GO(CERT_DecodeGeneralName, pFppp)
+GO(CERT_DecodeNameConstraintsExtension, pFpp)
+GO(CERT_DecodeOCSPRequest, pFp)
+GO(CERT_DecodeOCSPResponse, pFp)
+GO(CERT_DecodeOidSequence, pFp)
+GO(CERT_DecodePrivKeyUsagePeriodExtension, pFpp)
+GO(CERT_DecodeTrustString, iFpp)
+GO(CERT_DecodeUserNotice, pFp)
+GO(CERT_DerNameToAscii, pFp)
+GO(CERT_DestroyCertArray, vFpu)
GO(CERT_DestroyCertificate, vFp)
GO(CERT_DestroyCertificateList, vFp)
GO(CERT_DestroyCertificatePoliciesExtension, vFp)
GO(CERT_DestroyCertificateRequest, vFp)
GO(CERT_DestroyCertList, vFp)
-//GO(CERT_DestroyCERTRevocationFlags,
-//GO(CERT_DestroyName,
-//GO(CERT_DestroyOCSPCertID,
-//GO(CERT_DestroyOCSPRequest,
-//GO(CERT_DestroyOCSPResponse,
-//GO(CERT_DestroyOidSequence,
-//GO(CERT_DestroyUserNotice,
+GO(CERT_DestroyCERTRevocationFlags, vFp)
+GO(CERT_DestroyName, vFp)
+GO(CERT_DestroyOCSPCertID, iFp)
+GO(CERT_DestroyOCSPRequest, vFp)
+GO(CERT_DestroyOCSPResponse, vFp)
+GO(CERT_DestroyOidSequence, vFp)
+GO(CERT_DestroyUserNotice, vFp)
GO(CERT_DestroyValidity, vFp)
//GO(CERT_DisableOCSPChecking,
-//GO(CERT_DisableOCSPDefaultResponder,
-//GO(CERT_DistNamesFromCertList,
+GO(CERT_DisableOCSPDefaultResponder, iFp)
+GO(CERT_DistNamesFromCertList, pFp)
GO(CERT_DupCertificate, pFp)
-//GO(CERT_DupCertList,
-//GO(CERT_DupDistNames,
+GO(CERT_DupCertList, pFp)
+GO(CERT_DupDistNames, pFp)
//GO(CERT_EnableOCSPChecking,
//GO(CERT_EnableOCSPDefaultResponder,
-//GO(CERT_EncodeAltNameExtension,
-//GO(CERT_EncodeAndAddBitStrExtension,
-//GO(CERT_EncodeAuthKeyID,
-//GO(CERT_EncodeBasicConstraintValue,
-//GO(CERT_EncodeCertPoliciesExtension,
-//GO(CERT_EncodeCRLDistributionPoints,
-//GO(CERT_EncodeGeneralName,
-//GO(CERT_EncodeInfoAccessExtension,
-//GO(CERT_EncodeInhibitAnyExtension,
+GO(CERT_EncodeAltNameExtension, iFppp)
+GO(CERT_EncodeAndAddBitStrExtension, iFpipi)
+GO(CERT_EncodeAuthKeyID, iFppp)
+GO(CERT_EncodeBasicConstraintValue, iFppp)
+GO(CERT_EncodeCertPoliciesExtension, iFppp)
+GO(CERT_EncodeCRLDistributionPoints, iFppp)
+GO(CERT_EncodeGeneralName, pFppp)
+GO(CERT_EncodeInfoAccessExtension, iFppp)
+GO(CERT_EncodeInhibitAnyExtension, iFppp)
//GO(CERT_EncodeNameConstraintsExtension,
-//GO(CERT_EncodeNoticeReference,
-//GO(CERT_EncodeOCSPRequest,
-//GO(CERT_EncodePolicyConstraintsExtension,
-//GO(CERT_EncodePolicyMappingExtension,
-//GO(CERT_EncodeSubjectKeyID,
-//GO(CERT_EncodeUserNotice,
+GO(CERT_EncodeNoticeReference, iFppp)
+GO(CERT_EncodeOCSPRequest, pFppp)
+GO(CERT_EncodePolicyConstraintsExtension, iFppp)
+GO(CERT_EncodePolicyMappingExtension, iFppp)
+GO(CERT_EncodeSubjectKeyID, iFppp)
+GO(CERT_EncodeUserNotice, iFppp)
GO(CERT_ExtractPublicKey, pFp)
-//GO(CERT_FilterCertListByCANames,
-//GO(CERT_FilterCertListByUsage,
-//GO(CERT_FilterCertListForUserCerts,
-//GO(CERT_FindCertByDERCert,
-//GO(CERT_FindCertByIssuerAndSN,
-//GO(CERT_FindCertByIssuerAndSNCX,
-//GO(CERT_FindCertByName,
+GO(CERT_FilterCertListByCANames, iFpipu)
+GO(CERT_FilterCertListByUsage, iFpui)
+GO(CERT_FilterCertListForUserCerts, iFp)
+GO(CERT_FindCertByDERCert, pFpp)
+GO(CERT_FindCertByIssuerAndSN, pFpp)
+GO(CERT_FindCertByIssuerAndSNCX, pFppp)
+GO(CERT_FindCertByName, pFpp)
//GO(CERT_FindCertByNickname,
-//GO(CERT_FindCertByNicknameOrEmailAddr,
-//GO(CERT_FindCertByNicknameOrEmailAddrCX,
-//GO(CERT_FindCertByNicknameOrEmailAddrForUsage,
-//GO(CERT_FindCertByNicknameOrEmailAddrForUsageCX,
+GO(CERT_FindCertByNicknameOrEmailAddr, pFpp)
+GO(CERT_FindCertByNicknameOrEmailAddrCX, pFppp)
+GO(CERT_FindCertByNicknameOrEmailAddrForUsage, pFppu)
+GO(CERT_FindCertByNicknameOrEmailAddrForUsageCX, pFppup)
//GO(CERT_FindCertBySubjectKeyID,
-GO(CERT_FindCertExtension, iFppp)
-//GO(CERT_FindCertIssuer,
-//GO(CERT_FindCRLEntryReasonExten,
-//GO(CERT_FindCRLNumberExten,
+GO(CERT_FindCertExtension, iFpip)
+GO(CERT_FindCertIssuer, pFplu)
+GO(CERT_FindCRLEntryReasonExten, iFpp)
+GO(CERT_FindCRLNumberExten, iFppp)
//GO(CERT_FindKeyUsageExtension,
-//GO(CERT_FindNameConstraintsExten,
-//GO(CERT_FindSMimeProfile,
-//GO(CERT_FindSubjectKeyIDExtension,
-//GO(CERT_FindUserCertByUsage,
-//GO(CERT_FindUserCertsByUsage,
-//GO(CERT_FinishCertificateRequestAttributes,
-//GO(CERT_FinishExtensions,
-//GO(CERT_ForcePostMethodForOCSP,
-//GO(CERT_FormatName,
-//GO(CERT_FreeDistNames,
-//GO(CERT_FreeNicknames,
-//GO(CERT_GenTime2FormattedAscii,
-GO(CERT_GetAVATag, iFp)
-//GO(CERT_GetCertChainFromCert,
+GO(CERT_FindNameConstraintsExten, iFppp)
+GO(CERT_FindSMimeProfile, pFp)
+GO(CERT_FindSubjectKeyIDExtension, iFpp)
+GO(CERT_FindUserCertByUsage, pFppuip)
+GO(CERT_FindUserCertsByUsage, pFpuiip)
+GO(CERT_FinishCertificateRequestAttributes, iFp)
+GO(CERT_FinishExtensions, iFp)
+GO(CERT_ForcePostMethodForOCSP, iFi)
+GO(CERT_FormatName, pFp)
+GO(CERT_FreeDistNames, vFp)
+GO(CERT_FreeNicknames, vFp)
+GO(CERT_GenTime2FormattedAscii, pFlp)
+GO(CERT_GetAVATag, uFp)
+GO(CERT_GetCertChainFromCert, pFplu)
GO(CERT_GetCertEmailAddress, pFp)
-//GO(CERT_GetCertificateDer,
-//GO(CERT_GetCertificateNames,
-//GO(CERT_GetCertificateRequestExtensions,
-//GO(CERT_GetCertIsPerm,
-//GO(CERT_GetCertIssuerAndSN,
+GO(CERT_GetCertificateDer, iFpp)
+GO(CERT_GetCertificateNames, pFpp)
+GO(CERT_GetCertificateRequestExtensions, iFpp)
+GO(CERT_GetCertIsPerm, iFpp)
+GO(CERT_GetCertIssuerAndSN, pFpp)
//GO(CERT_GetCertIsTemp,
-//GO(CERT_GetCertKeyType,
-//GO(CERT_GetCertNicknames,
-//GO(CERT_GetCertTimes,
+GO(CERT_GetCertKeyType, uFp)
+GO(CERT_GetCertNicknames, pFpip)
+GO(CERT_GetCertTimes, iFppp)
GO(CERT_GetCertTrust, iFpp)
GO(CERT_GetCertUid, pFp)
-//GO(CERT_GetClassicOCSPDisabledPolicy,
+GO(CERT_GetClassicOCSPDisabledPolicy, pFv)
//GO(CERT_GetClassicOCSPEnabledHardFailurePolicy,
//GO(CERT_GetClassicOCSPEnabledSoftFailurePolicy,
GO(CERT_GetCommonName, pFp)
-//GO(CERT_GetConstrainedCertificateNames,
+GO(CERT_GetConstrainedCertificateNames, pFppi)
GO(CERT_GetCountryName, pFp)
-//GO(CERT_GetDBContentVersion,
+GO(CERT_GetDBContentVersion, iFp)
GO(CERT_GetDefaultCertDB, pFv)
GO(CERT_GetDomainComponentName, pFp)
-//GO(CERT_GetEncodedOCSPResponse,
-//GO(CERT_GetFirstEmailAddress,
-//GO(CERT_GetGeneralNameTypeFromString,
-//GO(CERT_GetImposedNameConstraints,
+GO(CERT_GetEncodedOCSPResponse, pFppplippp)
+GO(CERT_GetFirstEmailAddress, pFp)
+GO(CERT_GetGeneralNameTypeFromString, uFp)
+GO(CERT_GetImposedNameConstraints, iFpp)
GO(CERT_GetLocalityName, pFp)
-//GO(CERT_GetNextEmailAddress,
+GO(CERT_GetNextEmailAddress, pFpp)
GO(CERT_GetNextGeneralName, pFp)
//GO(CERT_GetNextNameConstraint,
-//GO(CERT_GetOCSPAuthorityInfoAccessLocation,
-//GO(CERT_GetOCSPResponseStatus,
-//GO(CERT_GetOCSPStatusForCertID,
-//GO(CERT_GetOidString,
+GO(CERT_GetOCSPAuthorityInfoAccessLocation, pFp)
+GO(CERT_GetOCSPResponseStatus, iFp)
+GO(CERT_GetOCSPStatusForCertID, iFppppl)
+GO(CERT_GetOidString, pFp)
GO(CERT_GetOrgName, pFp)
GO(CERT_GetOrgUnitName, pFp)
//GO(CERT_GetPKIXVerifyNistRevocationPolicy,
-//GO(CERT_GetPrevGeneralName,
-//GO(CERT_GetPrevNameConstraint,
+GO(CERT_GetPrevGeneralName, pFp)
+GO(CERT_GetPrevNameConstraint, pFp)
//GO(CERT_GetSlopTime,
-//GO(CERT_GetSSLCACerts,
+GO(CERT_GetSSLCACerts, pFp)
GO(CERT_GetStateName, pFp)
-//GO(CERT_GetSubjectNameDigest,
+GO(CERT_GetSubjectNameDigest, pFppup)
//GO(CERT_GetSubjectPublicKeyDigest,
//GO(CERT_GetUsePKIXForValidation,
-//GO(CERT_GetValidDNSPatternsFromCert,
-//GO(CERT_Hexify,
+GO(CERT_GetValidDNSPatternsFromCert, pFp)
+GO(CERT_Hexify, pFpi)
//GO(CERT_ImportCAChain,
-//GO(CERT_ImportCAChainTrusted,
-//GO(CERT_ImportCerts,
-//GO(CERT_ImportCRL,
-//GO(CERT_IsCACert,
-//GO(CERT_IsCADERCert,
-//GO(CERT_IsRootDERCert,
+GO(CERT_ImportCAChainTrusted, iFpiu)
+GO(CERT_ImportCerts, iFpuuppiip)
+GO(CERT_ImportCRL, pFpppip)
+GO(CERT_IsCACert, iFpp)
+GO(CERT_IsCADERCert, iFpp)
+GO(CERT_IsRootDERCert, iFp)
//DATA(CERT_IssuerAndSNTemplate,
//GO(CERT_IsUserCert,
//GO(CERT_KeyFromDERCrl,
-//GO(CERT_MakeCANickname,
-//GO(CERT_MergeExtensions,
+GO(CERT_MakeCANickname, pFp)
+GO(CERT_MergeExtensions, iFpp)
DATA(CERT_NameTemplate, 4*sizeof(void*))
//GO(CERT_NameToAscii,
-//GO(CERT_NameToAsciiInvertible,
-//GO(CERT_NewCertList,
+GO(CERT_NameToAsciiInvertible, pFpu)
+GO(CERT_NewCertList, pFv)
//GO(__CERT_NewTempCertificate,
GO(CERT_NewTempCertificate, pFpppii)
-//GO(CERT_NicknameStringsFromCertList,
-//GO(CERT_OCSPCacheSettings,
-//GO(CERT_OpenCertDBFilename,
+GO(CERT_NicknameStringsFromCertList, pFppp)
+GO(CERT_OCSPCacheSettings, iFiuu)
+GO(CERT_OpenCertDBFilename, iFppi)
GOM(CERT_PKIXVerifyCert, iFEpIppp)
-//GO(CERT_PostOCSPRequest,
+GO(CERT_PostOCSPRequest, pFppp)
GOM(CERT_RegisterAlternateOCSPAIAInfoCallBack, iFEpp)
-//GO(CERT_RemoveCertListNode,
-//GO(CERT_RFC1485_EscapeAndQuote,
-//GO(CERT_SaveSMimeProfile,
+GO(CERT_RemoveCertListNode, vFp)
+GO(CERT_RFC1485_EscapeAndQuote, iFpipi)
+GO(CERT_SaveSMimeProfile, iFppp)
//DATA(CERT_SequenceOfCertExtensionTemplate,
-//GO(CERT_SetOCSPDefaultResponder,
-//GO(CERT_SetOCSPFailureMode,
-//GO(CERT_SetOCSPTimeout,
+GO(CERT_SetOCSPDefaultResponder, iFppp)
+GO(CERT_SetOCSPFailureMode, iFu)
+GO(CERT_SetOCSPTimeout, iFu)
//DATA(CERT_SetOfSignedCrlTemplate,
-//GO(CERT_SetSlopTime,
-//GO(CERT_SetUsePKIXForValidation,
+GO(CERT_SetSlopTime, iFi)
+GO(CERT_SetUsePKIXForValidation, iFi)
//DATA(CERT_SignedCrlTemplate,
DATA(CERT_SignedDataTemplate, 160)
-//GO(CERT_StartCertExtensions,
-//GO(CERT_StartCertificateRequestAttributes,
-//GO(CERT_StartCRLEntryExtensions,
-//GO(CERT_StartCRLExtensions,
+GO(CERT_StartCertExtensions, pFp)
+GO(CERT_StartCertificateRequestAttributes, pFp)
+GO(CERT_StartCRLEntryExtensions, pFpp)
+GO(CERT_StartCRLExtensions, pFp)
//DATA(CERT_SubjectPublicKeyInfoTemplate,
//DATA(CERT_TimeChoiceTemplate, //R type
//GO(__CERT_TraversePermCertsForNickname,
//GO(__CERT_TraversePermCertsForSubject,
-//GO(CERT_UncacheCRL,
+GO(CERT_UncacheCRL, iFpp)
//GO(CERT_VerifyCACertForUsage,
-//GO(CERT_VerifyCert,
-//GO(CERT_VerifyCertificate,
-//GO(CERT_VerifyCertificateNow,
-//GO(CERT_VerifyCertName,
-//GO(CERT_VerifyCertNow,
-//GO(CERT_VerifyOCSPResponseSignature,
-//GO(CERT_VerifySignedData,
-//GO(CERT_VerifySignedDataWithPublicKey,
-//GO(CERT_VerifySignedDataWithPublicKeyInfo,
-//GO(DER_AsciiToTime,
+GO(CERT_VerifyCert, iFpp)
+GO(CERT_VerifyCertificate, iFppillppp)
+GO(CERT_VerifyCertificateNow, iFppilpp)
+GO(CERT_VerifyCertName, iFpp)
+GO(CERT_VerifyCertNow, iFppiup)
+GO(CERT_VerifyOCSPResponseSignature, iFppppp)
+GO(CERT_VerifySignedData, iFpplp)
+GO(CERT_VerifySignedDataWithPublicKey, iFppp)
+GO(CERT_VerifySignedDataWithPublicKeyInfo, iFppp)
+GO(DER_AsciiToTime, iFpp)
GO(DER_DecodeTimeChoice, iFpp)
-//GO(DER_Encode,
-//GO(DER_EncodeTimeChoice,
+GO(DER_Encode, iFpppp)
+GO(DER_EncodeTimeChoice, iFppl)
//GO(DER_GeneralizedDayToAscii,
//GO(DER_GeneralizedTimeToTime,
-//GO(DER_GetInteger,
-//GO(DER_Lengths,
-//GO(DER_TimeChoiceDayToAscii,
-//GO(DER_TimeToGeneralizedTime,
+GO(DER_GetInteger, lFp)
+GO(DER_Lengths, iFppp)
+GO(DER_TimeChoiceDayToAscii, pFp)
+GO(DER_TimeToGeneralizedTime, iFpl)
//GO(DER_TimeToGeneralizedTimeArena,
//GO(DER_TimeToUTCTime,
//GO(DER_UTCDayToAscii,
//GO(DER_UTCTimeToAscii,
//GO(DER_UTCTimeToTime,
-//GO(DSAU_DecodeDerSig,
-//GO(DSAU_DecodeDerSigToLen,
-//GO(DSAU_EncodeDerSig,
-//GO(DSAU_EncodeDerSigWithLen,
-//GO(HASH_Begin,
+GO(DSAU_DecodeDerSig, pFp)
+GO(DSAU_DecodeDerSigToLen, pFpu)
+GO(DSAU_EncodeDerSig, iFpp)
+GO(DSAU_EncodeDerSigWithLen, iFppu)
+GO(HASH_Begin, vFp)
//GO(HASH_Clone,
-//GO(HASH_Create,
-//GO(HASH_Destroy,
-//GO(HASH_End,
-//GO(HASH_GetHashObject,
-//GO(HASH_GetHashObjectByOidTag,
-//GO(HASH_GetHashOidTagByHashType,
-//GO(HASH_GetHashTypeByOidTag,
+GO(HASH_Create, pFi)
+GO(HASH_Destroy, vFp)
+GO(HASH_End, vFpppu)
+GO(HASH_GetHashObject, pFu)
+GO(HASH_GetHashObjectByOidTag, pFu)
+GO(HASH_GetHashOidTagByHashType, uFu)
+GO(HASH_GetHashTypeByOidTag, uFu)
//GO(HASH_GetType,
-GO(HASH_HashBuf, iFippu)
-//GO(HASH_ResultLen,
-//GO(HASH_ResultLenByOidTag,
-//GO(HASH_ResultLenContext,
-//GO(HASH_Update,
-//GO(NSSBase64_DecodeBuffer,
+GO(HASH_HashBuf, iFuppu)
+GO(HASH_ResultLen, uFu)
+GO(HASH_ResultLenByOidTag, uFu)
+GO(HASH_ResultLenContext, uFp)
+GO(HASH_Update, vFppu)
+GO(NSSBase64_DecodeBuffer, pFpppu)
//GO(NSSBase64Decoder_Create,
-//GO(NSSBase64Decoder_Destroy,
-//GO(NSSBase64Decoder_Update,
-//GO(NSSBase64_EncodeItem,
+GO(NSSBase64Decoder_Destroy, iFpi)
+GO(NSSBase64Decoder_Update, iFppu)
+GO(NSSBase64_EncodeItem, pFppup)
//GO(NSSBase64Encoder_Create,
-//GO(NSSBase64Encoder_Destroy,
-//GO(NSSBase64Encoder_Update,
+GO(NSSBase64Encoder_Destroy, iFpi)
+GO(NSSBase64Encoder_Update, iFppu)
//GO(nss_DumpCertificateCacheInfo,
//GO(NSS_Get_CERT_CertificateRequestTemplate,
//GO(NSS_Get_CERT_CertificateTemplate,
@@ -316,7 +316,7 @@ GO(HASH_HashBuf, iFippu)
//GO(NSS_Get_SECKEY_PointerToEncryptedPrivateKeyInfoTemplate,
//GO(NSS_Get_SECKEY_PointerToPrivateKeyInfoTemplate,
//GO(NSS_Get_SECKEY_PrivateKeyInfoTemplate,
-//GO(NSS_Get_SECKEY_RSAPSSParamsTemplate,
+GO(NSS_Get_SECKEY_RSAPSSParamsTemplate, pFpi)
//GO(NSS_Get_SECKEY_RSAPublicKeyTemplate,
//GO(NSS_Get_SEC_NullTemplate,
//GO(NSS_Get_SEC_ObjectIDTemplate,
@@ -328,14 +328,14 @@ GO(HASH_HashBuf, iFippu)
//GO(NSS_Get_SEC_SignedCertificateTemplate,
//GO(NSS_Get_SEC_UTCTimeTemplate,
//GO(NSS_Get_SEC_UTF8StringTemplate,
-//GO(NSS_Get_sgn_DigestInfoTemplate,
-//GO(NSS_GetVersion,
+GO(NSS_Get_sgn_DigestInfoTemplate, pFpi)
+GO(NSS_GetVersion, pFv)
//GO(NSS_Init,
-//GO(NSS_InitContext,
-//GO(NSS_Initialize,
+GO(NSS_InitContext, pFpppppu)
+GO(NSS_Initialize, iFppppu)
//GO(__nss_InitLock,
GO(NSS_InitReadWrite, iFp)
-//GO(NSS_InitWithMerge,
+GO(NSS_InitWithMerge, iFpppppppppu)
GO(NSS_IsInitialized, iFv)
GO(NSS_NoDB_Init, iFp)
//GO(NSS_OptionGet,
@@ -343,186 +343,186 @@ GO(NSS_NoDB_Init, iFp)
//GO(NSS_PutEnv,
//GO(NSS_RegisterShutdown,
//GO(NSSRWLock_Destroy,
-//GO(NSSRWLock_HaveWriteLock,
+GO(NSSRWLock_HaveWriteLock, iFp)
//GO(NSSRWLock_LockRead,
//GO(NSSRWLock_LockWrite,
-//GO(NSSRWLock_New,
+GO(NSSRWLock_New, pFup)
//GO(NSSRWLock_UnlockRead,
-//GO(NSSRWLock_UnlockWrite,
+GO(NSSRWLock_UnlockWrite, vFp)
//GO(NSS_Shutdown,
-//GO(NSS_ShutdownContext,
+GO(NSS_ShutdownContext, iFp)
//GO(NSS_UnregisterShutdown,
GO(NSS_VersionCheck, iFp)
//GO(__PBE_CreateContext,
-//GO(PBE_CreateContext,
+GO(PBE_CreateContext, pFuuppuu)
//GO(__PBE_DestroyContext,
-//GO(PBE_DestroyContext,
+GO(PBE_DestroyContext, vFp)
//GO(__PBE_GenerateBits,
-//GO(PBE_GenerateBits,
-//GO(PK11_AlgtagToMechanism,
+GO(PBE_GenerateBits, pFp)
+GO(PK11_AlgtagToMechanism, LFu)
GO(PK11_Authenticate, iFpip)
-//GO(PK11_BlockData,
-//GO(PK11_ChangePW,
+GO(PK11_BlockData, pFpL)
+GO(PK11_ChangePW, iFppp)
//GO(PK11_CheckSSOPassword,
GO(PK11_CheckUserPassword, iFpp)
GO(PK11_CipherOp, iFpppipi)
-//GO(PK11_CloneContext,
-//GO(PK11_ConfigurePKCS11,
-//GO(PK11_ConvertSessionPrivKeyToTokenPrivKey,
-//GO(PK11_ConvertSessionSymKeyToTokenSymKey,
-//GO(PK11_CopySymKeyForSigning,
-//GO(PK11_CopyTokenPrivKeyToSessionPrivKey,
+GO(PK11_CloneContext, pFp)
+GO(PK11_ConfigurePKCS11, vFppppppppii)
+GO(PK11_ConvertSessionPrivKeyToTokenPrivKey, pFpp)
+GO(PK11_ConvertSessionSymKeyToTokenSymKey, pFpp)
+GO(PK11_CopySymKeyForSigning, pFpL)
+GO(PK11_CopyTokenPrivKeyToSessionPrivKey, pFpp)
//GO(__PK11_CreateContextByRawKey,
-GO(PK11_CreateContextBySymKey, pFiipp)
-//GO(PK11_CreateDigestContext,
-//GO(PK11_CreateGenericObject,
+GO(PK11_CreateContextBySymKey, pFLLpp)
+GO(PK11_CreateDigestContext, pFu)
+GO(PK11_CreateGenericObject, pFppii)
//GO(PK11_CreateManagedGenericObject,
-//GO(PK11_CreateMergeLog,
-//GO(PK11_CreatePBEAlgorithmID,
-//GO(PK11_CreatePBEParams,
-//GO(PK11_CreatePBEV2AlgorithmID,
+GO(PK11_CreateMergeLog, pFv)
+GO(PK11_CreatePBEAlgorithmID, pFuip)
+GO(PK11_CreatePBEParams, pFppu)
+GO(PK11_CreatePBEV2AlgorithmID, pFuuuiip)
//GO(PK11_Decrypt,
GO(PK11_DeleteTokenCertAndKey, iFpp)
-//GO(PK11_DeleteTokenPrivateKey,
-//GO(PK11_DeleteTokenPublicKey,
+GO(PK11_DeleteTokenPrivateKey, iFpi)
+GO(PK11_DeleteTokenPublicKey, iFp)
//GO(PK11_DeleteTokenSymKey,
-//GO(PK11_DEREncodePublicKey,
-//GO(PK11_Derive,
-//GO(PK11_DeriveWithFlags,
-//GO(PK11_DeriveWithFlagsPerm,
-//GO(PK11_DeriveWithTemplate,
+GO(PK11_DEREncodePublicKey, pFp)
+GO(PK11_Derive, pFpLpLLi)
+GO(PK11_DeriveWithFlags, pFpLpLLiL)
+GO(PK11_DeriveWithFlagsPerm, pFpLpLLiLi)
+GO(PK11_DeriveWithTemplate, pFpLpLLipui)
GO(PK11_DestroyContext, vFpi)
-//GO(PK11_DestroyGenericObject,
-//GO(PK11_DestroyGenericObjects,
-//GO(PK11_DestroyMergeLog,
+GO(PK11_DestroyGenericObject, iFp)
+GO(PK11_DestroyGenericObjects, uFp)
+GO(PK11_DestroyMergeLog, vFp)
GO(PK11_DestroyObject, iFpL)
-//GO(PK11_DestroyPBEParams,
+GO(PK11_DestroyPBEParams, vFp)
GO(PK11_DestroyTokenObject, iFpL)
//GO(PK11_DigestBegin,
-//GO(PK11_DigestFinal,
-//GO(PK11_DigestKey,
-//GO(PK11_DigestOp,
-//GO(PK11_DoesMechanism,
-//GO(PK11_Encrypt,
-//GO(PK11_ExportDERPrivateKeyInfo,
-//GO(PK11_ExportEncryptedPrivateKeyInfo,
-//GO(PK11_ExportEncryptedPrivKeyInfo,
-//GO(PK11_ExportPrivateKeyInfo,
-//GO(PK11_ExportPrivKeyInfo,
-//GO(PK11_ExtractKeyValue,
+GO(PK11_DigestFinal, iFpppu)
+GO(PK11_DigestKey, iFpp)
+GO(PK11_DigestOp, iFppu)
+GO(PK11_DoesMechanism, iFpL)
+GO(PK11_Encrypt, iFpLpppupu)
+GO(PK11_ExportDERPrivateKeyInfo, pFpp)
+GO(PK11_ExportEncryptedPrivateKeyInfo, pFpuppip)
+GO(PK11_ExportEncryptedPrivKeyInfo, pFpuppip)
+GO(PK11_ExportPrivateKeyInfo, pFpp)
+GO(PK11_ExportPrivKeyInfo, pFpp)
+GO(PK11_ExtractKeyValue, iFp)
GO(PK11_Finalize, iFp)
-//GO(PK11_FindBestKEAMatch,
-//GO(PK11_FindCertAndKeyByRecipientList,
-//GO(PK11_FindCertAndKeyByRecipientListNew,
-//GO(PK11_FindCertByIssuerAndSN,
-//GO(PK11_FindCertFromDERCert,
+GO(PK11_FindBestKEAMatch, pFpp)
+GO(PK11_FindCertAndKeyByRecipientList, pFppppp)
+GO(PK11_FindCertAndKeyByRecipientListNew, iFpp)
+GO(PK11_FindCertByIssuerAndSN, pFppp)
+GO(PK11_FindCertFromDERCert, pFppp)
GO(PK11_FindCertFromDERCertItem, pFppp)
//GO(PK11_FindCertFromNickname,
-//GO(PK11_FindCertFromURI,
-//GO(PK11_FindCertInSlot,
+GO(PK11_FindCertFromURI, pFpp)
+GO(PK11_FindCertInSlot, LFppp)
//GO(PK11_FindCertsFromEmailAddress,
-//GO(PK11_FindCertsFromNickname,
+GO(PK11_FindCertsFromNickname, pFpp)
//GO(PK11_FindCertsFromURI,
-GO(PK11_FindFixedKey, pFpipp)
-//GO(PK11_FindGenericObjects,
+GO(PK11_FindFixedKey, pFpLpp)
+GO(PK11_FindGenericObjects, pFpL)
GO(PK11_FindKeyByAnyCert, pFpp)
GO(PK11_FindKeyByDERCert, pFppp)
GO(PK11_FindKeyByKeyID, pFppp)
GO(PK11_FindPrivateKeyFromCert, pFppp)
-//GO(PK11_FindRawCertsWithSubject,
+GO(PK11_FindRawCertsWithSubject, iFppp)
//GO(PK11_FindSlotByName,
-//GO(PK11_FindSlotsByNames,
-//GO(PK11_FortezzaHasKEA,
-//GO(PK11_FortezzaMapSig,
+GO(PK11_FindSlotsByNames, pFpppi)
+GO(PK11_FortezzaHasKEA, iFp)
+GO(PK11_FortezzaMapSig, uFu)
GO(PK11_FreeSlot, vFp)
GO(PK11_FreeSlotList, vFp)
-//GO(PK11_FreeSlotListElement,
+GO(PK11_FreeSlotListElement, iFpp)
GO(PK11_FreeSymKey, vFp)
-//GO(PK11_GenerateFortezzaIV,
+GO(PK11_GenerateFortezzaIV, iFppi)
GO(PK11_GenerateKeyPair, pFpLppiip)
-//GO(PK11_GenerateKeyPairWithFlags,
-//GO(PK11_GenerateKeyPairWithOpFlags,
-//GO(PK11_GenerateNewParam,
-//GO(PK11_GenerateRandom,
-//GO(PK11_GenerateRandomOnSlot,
-//GO(PK11_GetAllSlotsForCert,
+GO(PK11_GenerateKeyPairWithFlags, pFpLppup)
+GO(PK11_GenerateKeyPairWithOpFlags, pFpLppuLLp)
+GO(PK11_GenerateNewParam, pFLp)
+GO(PK11_GenerateRandom, iFpi)
+GO(PK11_GenerateRandomOnSlot, iFppi)
+GO(PK11_GetAllSlotsForCert, pFpp)
GO(PK11_GetAllTokens, pFLiip)
-//GO(PK11_GetBestKeyLength,
-//GO(PK11_GetBestSlot,
-//GO(PK11_GetBestSlotMultiple,
-//GO(PK11_GetBestSlotMultipleWithAttributes,
-//GO(PK11_GetBestSlotWithAttributes,
-//GO(PK11_GetBestWrapMechanism,
+GO(PK11_GetBestKeyLength, iFpL)
+GO(PK11_GetBestSlot, pFLp)
+GO(PK11_GetBestSlotMultiple, pFpup)
+GO(PK11_GetBestSlotMultipleWithAttributes, pFpppup)
+GO(PK11_GetBestSlotWithAttributes, pFLLup)
+GO(PK11_GetBestWrapMechanism, LFp)
GO(PK11_GetBlockSize, iFLp)
-//GO(PK11_GetCertFromPrivateKey,
-//GO(PK11_GetCertsMatchingPrivateKey,
-//GO(PK11_GetCurrentWrapIndex,
-//GO(PK11_GetDefaultArray,
-//GO(PK11_GetDefaultFlags,
-//GO(PK11_GetDisabledReason,
+GO(PK11_GetCertFromPrivateKey, pFp)
+GO(PK11_GetCertsMatchingPrivateKey, pFp)
+GO(PK11_GetCurrentWrapIndex, iFp)
+GO(PK11_GetDefaultArray, pFp)
+GO(PK11_GetDefaultFlags, LFp)
+GO(PK11_GetDisabledReason, uFp)
GO(PK11_GetFirstSafe, pFp)
GO(PK11_GetInternalKeySlot, pFv)
-//GO(PK11_GetInternalSlot,
+GO(PK11_GetInternalSlot, pFv)
//GO(PK11_GetIVLength,
//GO(__PK11_GetKeyData,
-//GO(PK11_GetKeyData,
+GO(PK11_GetKeyData, pFp)
//GO(PK11_GetKeyGen,
-//GO(PK11_GetKeyLength,
-//GO(PK11_GetKeyStrength,
-//GO(PK11_GetKeyType,
-//GO(PK11_GetLowLevelKeyIDForCert,
-//GO(PK11_GetLowLevelKeyIDForPrivateKey,
-//GO(PK11_GetMechanism,
+GO(PK11_GetKeyLength, uFp)
+GO(PK11_GetKeyStrength, uFpp)
+GO(PK11_GetKeyType, LFLL)
+GO(PK11_GetLowLevelKeyIDForCert, pFppp)
+GO(PK11_GetLowLevelKeyIDForPrivateKey, pFp)
+GO(PK11_GetMechanism, LFp)
//GO(PK11_GetMinimumPwdLength,
//GO(PK11_GetModInfo,
-//GO(PK11_GetModule,
-//GO(PK11_GetModuleID,
+GO(PK11_GetModule, pFp)
+GO(PK11_GetModuleID, LFp)
//GO(PK11_GetModuleURI,
-//GO(PK11_GetNextGenericObject,
+GO(PK11_GetNextGenericObject, pFp)
GO(PK11_GetNextSafe, pFppi)
GO(PK11_GetNextSymKey, pFp)
-//GO(PK11_GetPadMechanism,
-//GO(PK11_GetPBECryptoMechanism,
-//GO(PK11_GetPBEIV,
-//GO(PK11_GetPQGParamsFromPrivateKey,
-//GO(PK11_GetPrevGenericObject,
+GO(PK11_GetPadMechanism, LFL)
+GO(PK11_GetPBECryptoMechanism, LFppp)
+GO(PK11_GetPBEIV, pFpp)
+GO(PK11_GetPQGParamsFromPrivateKey, pFp)
+GO(PK11_GetPrevGenericObject, pFp)
GO(PK11_GetPrivateKeyNickname, pFp)
//GO(PK11_GetPrivateModulusLen,
-//GO(PK11_GetPublicKeyNickname,
-//GO(PK11_GetSlotFromKey,
-//GO(PK11_GetSlotFromPrivateKey,
-//GO(PK11_GetSlotID,
-//GO(PK11_GetSlotInfo,
+GO(PK11_GetPublicKeyNickname, pFp)
+GO(PK11_GetSlotFromKey, pFp)
+GO(PK11_GetSlotFromPrivateKey, pFp)
+GO(PK11_GetSlotID, LFp)
+GO(PK11_GetSlotInfo, iFpp)
GO(PK11_GetSlotName, pFp)
-//GO(PK11_GetSlotPWValues,
+GO(PK11_GetSlotPWValues, vFppp)
//GO(PK11_GetSlotSeries,
-//GO(PK11_GetSymKeyHandle,
-//GO(PK11_GetSymKeyNickname,
-//GO(PK11_GetSymKeyType,
+GO(PK11_GetSymKeyHandle, LFp)
+GO(PK11_GetSymKeyNickname, pFp)
+GO(PK11_GetSymKeyType, LFp)
//GO(PK11_GetSymKeyUserData,
-//GO(PK11_GetTokenInfo,
+GO(PK11_GetTokenInfo, iFpp)
GO(PK11_GetTokenName, pFp)
//GO(PK11_GetTokenURI,
-//GO(PK11_GetWindow,
-//GO(PK11_GetWrapKey,
-//GO(PK11_HasAttributeSet,
-//GO(PK11_HashBuf,
-//GO(PK11_HasRootCerts,
+GO(PK11_GetWindow, pFp)
+GO(PK11_GetWrapKey, pFpiLip)
+GO(PK11_HasAttributeSet, CFpLLi)
+GO(PK11_HashBuf, iFuppi)
+GO(PK11_HasRootCerts, iFp)
GO(PK11_ImportCert, iFppLpi)
-//GO(PK11_ImportCertForKey,
-//GO(PK11_ImportCertForKeyToSlot,
-//GO(PK11_ImportCRL,
-//GO(PK11_ImportDERCert,
-//GO(PK11_ImportDERCertForKey,
-//GO(PK11_ImportDERPrivateKeyInfo,
+GO(PK11_ImportCertForKey, pFppp)
+GO(PK11_ImportCertForKeyToSlot, iFpppip)
+GO(PK11_ImportCRL, pFpppipipi)
+GO(PK11_ImportDERCert, iFppLpi)
+GO(PK11_ImportDERCertForKey, pFppp)
+GO(PK11_ImportDERPrivateKeyInfo, iFppppiiup)
GO(PK11_ImportDERPrivateKeyInfoAndReturnKey, iFppppiiupp)
-//GO(PK11_ImportEncryptedPrivateKeyInfo,
-//GO(PK11_ImportEncryptedPrivateKeyInfoAndReturnKey,
-//GO(PK11_ImportPrivateKeyInfo,
-//GO(PK11_ImportPrivateKeyInfoAndReturnKey,
-//GO(PK11_ImportPublicKey,
-//GO(PK11_ImportSymKey,
-//GO(PK11_ImportSymKeyWithFlags,
+GO(PK11_ImportEncryptedPrivateKeyInfo, iFpppppiiuup)
+GO(PK11_ImportEncryptedPrivateKeyInfoAndReturnKey, iFpppppiiuupp)
+GO(PK11_ImportPrivateKeyInfo, iFppppiiup)
+GO(PK11_ImportPrivateKeyInfoAndReturnKey, iFppppiiupp)
+GO(PK11_ImportPublicKey, LFppi)
+GO(PK11_ImportSymKey, pFpLuLpp)
+GO(PK11_ImportSymKeyWithFlags, pFpLuLpLip)
GO(PK11_InitPin, iFppp)
//GO(PK11_IsDisabled,
GO(PK11_IsFIPS, iFv)
@@ -531,251 +531,251 @@ GO(PK11_IsHW, iFp)
GO(PK11_IsInternal, iFp)
GO(PK11_IsInternalKeySlot, iFp)
GO(PK11_IsLoggedIn, iFpp)
-//GO(PK11_IsPresent,
+GO(PK11_IsPresent, iFp)
GO(PK11_IsReadOnly, iFp)
GO(PK11_IsRemovable, iFp)
-//GO(PK11_IVFromParam,
+GO(PK11_IVFromParam, pFLpp)
GO(PK11_KeyForCertExists, pFppp)
-//GO(PK11_KeyForDERCertExists,
-//GO(PK11_KeyGen,
-//GO(PK11_KeyGenWithTemplate,
-//GO(PK11_LinkGenericObject,
-GO(PK11_ListCerts, pFip)
+GO(PK11_KeyForDERCertExists, pFppp)
+GO(PK11_KeyGen, pFpLpip)
+GO(PK11_KeyGenWithTemplate, pFpLLppup)
+GO(PK11_LinkGenericObject, iFpp)
+GO(PK11_ListCerts, pFup)
GO(PK11_ListCertsInSlot, pFp)
GO(PK11_ListFixedKeysInSlot, pFppp)
-//GO(PK11_ListPrivateKeysInSlot,
-//GO(PK11_ListPrivKeysInSlot,
-//GO(PK11_ListPublicKeysInSlot,
-//GO(PK11_LoadPrivKey,
+GO(PK11_ListPrivateKeysInSlot, pFp)
+GO(PK11_ListPrivKeysInSlot, pFppp)
+GO(PK11_ListPublicKeysInSlot, pFpp)
+GO(PK11_LoadPrivKey, pFpppii)
//GO(PK11_Logout,
//GO(PK11_LogoutAll,
GO(PK11_MakeIDFromPubKey, pFp)
-//GO(PK11_MakeKEAPubKey,
-//GO(PK11_MapPBEMechanismToCryptoMechanism,
-//GO(PK11_MapSignKeyType,
-//GO(PK11_MechanismToAlgtag,
-//GO(PK11_MergeTokens,
-//GO(PK11_MoveSymKey,
+GO(PK11_MakeKEAPubKey, pFpi)
+GO(PK11_MapPBEMechanismToCryptoMechanism, LFpppi)
+GO(PK11_MapSignKeyType, LFu)
+GO(PK11_MechanismToAlgtag, uFL)
+GO(PK11_MergeTokens, iFppppp)
+GO(PK11_MoveSymKey, pFpLLip)
GO(PK11_NeedLogin, iFp)
//GO(PK11_NeedPWInit,
GO(PK11_NeedUserInit, iFp)
GO(PK11_ParamFromAlgid, pFp)
-//GO(PK11_ParamFromIV,
-//GO(PK11_ParamToAlgid,
-//GO(PK11_PBEKeyGen,
-//GO(PK11_PQG_DestroyParams,
-//GO(PK11_PQG_DestroyVerify,
-//GO(PK11_PQG_GetBaseFromParams,
-//GO(PK11_PQG_GetCounterFromVerify,
-//GO(PK11_PQG_GetHFromVerify,
+GO(PK11_ParamFromIV, pFLp)
+GO(PK11_ParamToAlgid, iFuppp)
+GO(PK11_PBEKeyGen, pFpppip)
+GO(PK11_PQG_DestroyParams, vFp)
+GO(PK11_PQG_DestroyVerify, vFp)
+GO(PK11_PQG_GetBaseFromParams, iFpp)
+GO(PK11_PQG_GetCounterFromVerify, uFp)
+GO(PK11_PQG_GetHFromVerify, iFpp)
//GO(PK11_PQG_GetPrimeFromParams,
//GO(PK11_PQG_GetSeedFromVerify,
//GO(PK11_PQG_GetSubPrimeFromParams,
-//GO(PK11_PQG_NewParams,
-//GO(PK11_PQG_NewVerify,
-//GO(PK11_PQG_ParamGen,
-//GO(PK11_PQG_ParamGenSeedLen,
-//GO(PK11_PQG_ParamGenV2,
-//GO(PK11_PQG_VerifyParams,
-//GO(PK11_PrivDecrypt,
-//GO(PK11_PrivDecryptPKCS1,
+GO(PK11_PQG_NewParams, pFppp)
+GO(PK11_PQG_NewVerify, pFupp)
+GO(PK11_PQG_ParamGen, iFupp)
+GO(PK11_PQG_ParamGenSeedLen, iFuupp)
+GO(PK11_PQG_ParamGenV2, iFuuupp)
+GO(PK11_PQG_VerifyParams, iFppp)
+GO(PK11_PrivDecrypt, iFpLpppupu)
+GO(PK11_PrivDecryptPKCS1, iFpppupu)
//GO(PK11_ProtectedAuthenticationPath,
//GO(PK11_PubDecryptRaw,
-//GO(PK11_PubDerive,
-//GO(PK11_PubDeriveWithKDF,
-//GO(PK11_PubEncrypt,
-//GO(PK11_PubEncryptPKCS1,
+GO(PK11_PubDerive, pFppippLLLip)
+GO(PK11_PubDeriveWithKDF, pFppippLLLiLpp)
+GO(PK11_PubEncrypt, iFpLpppupup)
+GO(PK11_PubEncryptPKCS1, iFpppup)
//GO(PK11_PubEncryptRaw,
-//GO(PK11_PubUnwrapSymKey,
+GO(PK11_PubUnwrapSymKey, pFppLLi)
//GO(PK11_PubUnwrapSymKeyWithFlags,
-//GO(PK11_PubUnwrapSymKeyWithFlagsPerm,
-//GO(PK11_PubWrapSymKey,
-//GO(PK11_RandomUpdate,
-//GO(PK11_RawPBEKeyGen,
+GO(PK11_PubUnwrapSymKeyWithFlagsPerm, pFppLLiLi)
+GO(PK11_PubWrapSymKey, iFLppp)
+GO(PK11_RandomUpdate, iFpL)
+GO(PK11_RawPBEKeyGen, pFpLppip)
GO(PK11_ReadRawAttribute, iFipLp)
GO(PK11_ReferenceSlot, pFp)
//GO(PK11_ReferenceSymKey,
//GO(PK11_ResetToken,
-//GO(PK11_RestoreContext,
-//GO(PK11_SaveContext,
-//GO(PK11_SaveContextAlloc,
-//GO(PK11SDR_Decrypt,
-//GO(PK11SDR_Encrypt,
+GO(PK11_RestoreContext, iFppi)
+GO(PK11_SaveContext, iFpppi)
+GO(PK11_SaveContextAlloc, pFppup)
+GO(PK11SDR_Decrypt, iFppp)
+GO(PK11SDR_Encrypt, iFpppp)
//GO(PK11_SeedRandom,
-//GO(__PK11_SetCertificateNickname,
-//GO(PK11_SetFortezzaHack,
+GO(__PK11_SetCertificateNickname, iFpp)
+GO(PK11_SetFortezzaHack, vFp)
GOM(PK11_SetPasswordFunc, vFEp)
GO(PK11_SetPrivateKeyNickname, iFpp)
GO(PK11_SetPublicKeyNickname, iFpp)
-//GO(PK11_SetSlotPWValues,
-//GO(PK11_SetSymKeyNickname,
+GO(PK11_SetSlotPWValues, vFpii)
+GO(PK11_SetSymKeyNickname, iFpp)
//GO(PK11_SetSymKeyUserData,
-//GO(PK11_SetWrapKey,
+GO(PK11_SetWrapKey, vFpip)
GO(PK11_Sign, iFppp)
GO(PK11_SignatureLen, iFp)
-//GO(PK11_SignWithMechanism,
-//GO(PK11_SignWithSymKey,
-//GO(PK11_SymKeyFromHandle,
-GO(PK11_TokenExists, iFi)
-//GO(PK11_TokenKeyGen,
-//GO(PK11_TokenKeyGenWithFlags,
+GO(PK11_SignWithMechanism, iFpLppp)
+GO(PK11_SignWithSymKey, iFpLppp)
+GO(PK11_SymKeyFromHandle, pFppuLLip)
+GO(PK11_TokenExists, iFL)
+GO(PK11_TokenKeyGen, pFpLpipip)
+GO(PK11_TokenKeyGenWithFlags, pFpLpipLup)
//GO(PK11_TokenRefresh,
//GO(PK11_TraverseCertsForNicknameInSlot,
//GO(PK11_TraverseCertsForSubjectInSlot,
//GO(PK11_TraverseSlotCerts,
//GO(PK11_UnconfigurePKCS11,
//GO(PK11_UnlinkGenericObject,
-//GO(PK11_UnwrapPrivKey,
-//GO(PK11_UnwrapSymKey,
-//GO(PK11_UnwrapSymKeyWithFlags,
-//GO(PK11_UnwrapSymKeyWithFlagsPerm,
-//GO(PK11_UpdateSlotAttribute,
+GO(PK11_UnwrapPrivKey, pFppLppppiiLpip)
+GO(PK11_UnwrapSymKey, pFpLppLLi)
+GO(PK11_UnwrapSymKeyWithFlags, pFpLppLLiL)
+GO(PK11_UnwrapSymKeyWithFlagsPerm, pFpLppLLiLi)
+GO(PK11_UpdateSlotAttribute, iFppi)
//GO(PK11_UserDisableSlot,
//GO(PK11_UserEnableSlot,
-//GO(PK11_Verify,
-//GO(PK11_VerifyKeyOK,
-//GO(PK11_VerifyRecover,
-//GO(PK11_VerifyWithMechanism,
-//GO(PK11_WaitForTokenEvent,
-//GO(PK11_WrapPrivKey,
-//GO(PK11_WrapSymKey,
-GO(PK11_WriteRawAttribute, iFipLp)
-//GO(PORT_Alloc,
-//GO(PORT_ArenaAlloc,
-//GO(PORT_ArenaGrow,
-//GO(PORT_ArenaMark,
+GO(PK11_Verify, iFpppp)
+GO(PK11_VerifyKeyOK, iFp)
+GO(PK11_VerifyRecover, iFpppp)
+GO(PK11_VerifyWithMechanism, iFpLpppp)
+GO(PK11_WaitForTokenEvent, uFpuuui)
+GO(PK11_WrapPrivKey, iFpppLppp)
+GO(PK11_WrapSymKey, iFLpppp)
+GO(PK11_WriteRawAttribute, iFupLp)
+GO(PORT_Alloc, pFL)
+GO(PORT_ArenaAlloc, pFpL)
+GO(PORT_ArenaGrow, pFppLL)
+GO(PORT_ArenaMark, pFp)
//GO(PORT_ArenaRelease,
-//GO(PORT_ArenaStrdup,
-//GO(PORT_ArenaUnmark,
-//GO(PORT_ArenaZAlloc,
+GO(PORT_ArenaStrdup, pFpp)
+GO(PORT_ArenaUnmark, vFpp)
+GO(PORT_ArenaZAlloc, pFpL)
GO(PORT_Free, vFp)
GO(PORT_FreeArena, vFpi)
GO(PORT_GetError, iFv)
GO(PORT_NewArena, pFL)
-//GO(PORT_Realloc,
-//GO(PORT_SetError,
-//GO(PORT_SetUCS2_ASCIIConversionFunction,
-//GO(PORT_SetUCS2_UTF8ConversionFunction,
+GO(PORT_Realloc, pFpL)
+GO(PORT_SetError, vFi)
+GOM(PORT_SetUCS2_ASCIIConversionFunction, vFEp)
+GO(PORT_SetUCS2_UTF8ConversionFunction, vFi)
//GO(PORT_SetUCS4_UTF8ConversionFunction,
-//GO(PORT_Strdup,
-//GO(PORT_UCS2_ASCIIConversion,
-//GO(PORT_UCS2_UTF8Conversion,
-//GO(PORT_ZAlloc,
-//GO(PORT_ZFree,
+GO(PORT_Strdup, pFp)
+GO(PORT_UCS2_ASCIIConversion, iFipupupi)
+GO(PORT_UCS2_UTF8Conversion, iFipupup)
+GO(PORT_ZAlloc, pFL)
+GO(PORT_ZFree, vFpL)
//GO(RSA_FormatBlock,
DATA(SEC_AnyTemplate, 4*sizeof(void*)) //R type
-//GO(SEC_ASN1Decode,
+GO(SEC_ASN1Decode, iFppppl)
GO(SEC_ASN1DecodeInteger, iFpp)
GO(SEC_ASN1DecodeItem, iFpppp)
-//GO(SEC_ASN1DecoderAbort,
+GO(SEC_ASN1DecoderAbort, vFpi)
//GO(SEC_ASN1DecoderClearFilterProc,
-//GO(SEC_ASN1DecoderClearNotifyProc,
-//GO(SEC_ASN1DecoderFinish,
+GO(SEC_ASN1DecoderClearNotifyProc, vFp)
+GO(SEC_ASN1DecoderFinish, iFp)
//GO(SEC_ASN1DecoderSetFilterProc,
//GO(SEC_ASN1DecoderSetNotifyProc,
-//GO(SEC_ASN1DecoderStart,
-//GO(SEC_ASN1DecoderUpdate,
+GO(SEC_ASN1DecoderStart, pFppp)
+GO(SEC_ASN1DecoderUpdate, iFppL)
//GO(SEC_ASN1Encode,
-//GO(SEC_ASN1EncodeInteger,
-//GO(SEC_ASN1EncodeItem,
-//GO(SEC_ASN1EncoderAbort,
+GO(SEC_ASN1EncodeInteger, pFppl)
+GO(SEC_ASN1EncodeItem, pFpppp)
+GO(SEC_ASN1EncoderAbort, vFpi)
//GO(SEC_ASN1EncoderClearNotifyProc,
//GO(SEC_ASN1EncoderClearStreaming,
-//GO(SEC_ASN1EncoderClearTakeFromBuf,
+GO(SEC_ASN1EncoderClearTakeFromBuf, vFp)
//GO(SEC_ASN1EncoderFinish,
//GO(SEC_ASN1EncoderSetNotifyProc,
//GO(SEC_ASN1EncoderSetStreaming,
//GO(SEC_ASN1EncoderSetTakeFromBuf,
//GO(SEC_ASN1EncoderStart,
-//GO(SEC_ASN1EncoderUpdate,
-//GO(SEC_ASN1EncodeUnsignedInteger,
-//GO(SEC_ASN1LengthLength,
+GO(SEC_ASN1EncoderUpdate, iFppL)
+GO(SEC_ASN1EncodeUnsignedInteger, pFppL)
+GO(SEC_ASN1LengthLength, iFL)
DATA(SEC_BitStringTemplate, 4*sizeof(void*)) //R type
DATA(SEC_BMPStringTemplate, 4*sizeof(void*)) //R type
//DATA(SEC_BooleanTemplate, //R type
GO(SEC_CertNicknameConflict, iFppp)
-//GO(SEC_CheckCrlTimes,
-//GO(SEC_CreateSignatureAlgorithmParameters,
+GO(SEC_CheckCrlTimes, uFpl)
+GO(SEC_CreateSignatureAlgorithmParameters, pFppuupp)
GO(SEC_DeletePermCertificate, iFp)
//GO(SEC_DeletePermCRL,
-GO(SEC_DerSignData, iFpppipi)
-//GO(SEC_DerSignDataWithAlgorithmID,
-//GO(SEC_DestroyCrl,
-//GO(SEC_DupCrl,
-//GO(SEC_FindCrlByDERCert,
+GO(SEC_DerSignData, iFpppipu)
+GO(SEC_DerSignDataWithAlgorithmID, iFpppipp)
+GO(SEC_DestroyCrl, iFp)
+GO(SEC_DupCrl, pFp)
+GO(SEC_FindCrlByDERCert, pFppi)
//GO(SEC_FindCrlByName,
//DATA(SEC_GeneralizedTimeTemplate, //R type
-//GO(SEC_GetCrlTimes,
+GO(SEC_GetCrlTimes, iFppp)
//GO(SEC_GetRegisteredHttpClient,
-//GO(SEC_GetSignatureAlgorithmOidTag,
+GO(SEC_GetSignatureAlgorithmOidTag, uFuu)
DATA(SEC_IA5StringTemplate, 4*sizeof(void*)) //R type
//DATA(SEC_IntegerTemplate, //R type
-//GO(SECITEM_AllocItem,
-//GO(SECITEM_ArenaDupItem,
-//GO(SECITEM_CompareItem,
-//GO(SECITEM_CopyItem,
+GO(SECITEM_AllocItem, pFppu)
+GO(SECITEM_ArenaDupItem, pFpp)
+GO(SECITEM_CompareItem, iFpp)
+GO(SECITEM_CopyItem, iFppp)
//GO(SECITEM_DupItem,
GO(SECITEM_FreeItem, iFpi)
-//GO(SECITEM_ItemsAreEqual,
-//GO(SECITEM_ZfreeItem,
-//GO(SECKEY_AddPrivateKeyToListTail,
-//GO(SECKEY_BigIntegerBitLength,
-//GO(SECKEY_CacheStaticFlags,
-//GO(SECKEY_ConvertToPublicKey,
-//GO(SECKEY_CopyEncryptedPrivateKeyInfo,
-//GO(SECKEY_CopyPrivateKey,
-//GO(SECKEY_CopyPrivateKeyInfo,
-//GO(SECKEY_CopyPublicKey,
-//GO(SECKEY_CopySubjectPublicKeyInfo,
-//GO(SECKEY_CreateDHPrivateKey,
-//GO(SECKEY_CreateECPrivateKey,
-//GO(SECKEY_CreateRSAPrivateKey,
-//GO(SECKEY_CreateSubjectPublicKeyInfo,
-//GO(SECKEY_DecodeDERSubjectPublicKeyInfo,
-//GO(SECKEY_DestroyEncryptedPrivateKeyInfo,
-//GO(SECKEY_DestroyPrivateKey,
-//GO(SECKEY_DestroyPrivateKeyInfo,
-//GO(SECKEY_DestroyPrivateKeyList,
+GO(SECITEM_ItemsAreEqual, iFpp)
+GO(SECITEM_ZfreeItem, vFpi)
+GO(SECKEY_AddPrivateKeyToListTail, iFpp)
+GO(SECKEY_BigIntegerBitLength, uFp)
+GO(SECKEY_CacheStaticFlags, iFp)
+GO(SECKEY_ConvertToPublicKey, pFp)
+GO(SECKEY_CopyEncryptedPrivateKeyInfo, iFppp)
+GO(SECKEY_CopyPrivateKey, pFp)
+GO(SECKEY_CopyPrivateKeyInfo, iFppp)
+GO(SECKEY_CopyPublicKey, pFp)
+GO(SECKEY_CopySubjectPublicKeyInfo, iFppp)
+GO(SECKEY_CreateDHPrivateKey, pFppp)
+GO(SECKEY_CreateECPrivateKey, pFppp)
+GO(SECKEY_CreateRSAPrivateKey, pFipp)
+GO(SECKEY_CreateSubjectPublicKeyInfo, pFp)
+GO(SECKEY_DecodeDERSubjectPublicKeyInfo, pFp)
+GO(SECKEY_DestroyEncryptedPrivateKeyInfo, vFpi)
+GO(SECKEY_DestroyPrivateKey, vFp)
+GO(SECKEY_DestroyPrivateKeyInfo, vFpi)
+GO(SECKEY_DestroyPrivateKeyList, vFp)
GO(SECKEY_DestroyPublicKey, vFp)
-//GO(SECKEY_DestroyPublicKeyList,
-//GO(SECKEY_DestroySubjectPublicKeyInfo,
+GO(SECKEY_DestroyPublicKeyList, vFp)
+GO(SECKEY_DestroySubjectPublicKeyInfo, vFp)
//DATA(SECKEY_DSAPublicKeyTemplate, //R type
-//GO(SECKEY_ECParamsToBasePointOrderLen,
+GO(SECKEY_ECParamsToBasePointOrderLen, iFp)
//GO(SECKEY_ECParamsToKeySize,
-//GO(SECKEY_EncodeDERSubjectPublicKeyInfo,
+GO(SECKEY_EncodeDERSubjectPublicKeyInfo, pFp)
DATA(SECKEY_EncryptedPrivateKeyInfoTemplate, 128)
-//GO(SECKEY_ExtractPublicKey,
-//GO(SECKEY_GetPrivateKeyType,
-//GO(SECKEY_GetPublicKeyType,
+GO(SECKEY_ExtractPublicKey, pFp)
+GO(SECKEY_GetPrivateKeyType, uFp)
+GO(SECKEY_GetPublicKeyType, uFp)
//GO(SECKEY_HashPassword,
-//GO(SECKEY_ImportDERPublicKey,
-//GO(SECKEY_NewPrivateKeyList,
+GO(SECKEY_ImportDERPublicKey, pFpL)
+GO(SECKEY_NewPrivateKeyList, pFv)
//DATA(SECKEY_PointerToEncryptedPrivateKeyInfoTemplate,
//DATA(SECKEY_PointerToPrivateKeyInfoTemplate,
DATA(SECKEY_PrivateKeyInfoTemplate, 192)
//GO(SECKEY_PublicKeyStrength,
GO(SECKEY_PublicKeyStrengthInBits, uFp)
-//GO(SECKEY_RemovePrivateKeyListNode,
+GO(SECKEY_RemovePrivateKeyListNode, vFp)
//DATA(SECKEY_RSAPSSParamsTemplate,
//DATA(SECKEY_RSAPublicKeyTemplate, //R type
-//GO(SECKEY_SignatureLen,
-//GO(SECKEY_UpdateCertPQG,
-//GO(SEC_LookupCrls,
-//GO(SECMOD_AddNewModule,
-//GO(SECMOD_AddNewModuleEx,
+GO(SECKEY_SignatureLen, uFp)
+GO(SECKEY_UpdateCertPQG, iFp)
+GO(SEC_LookupCrls, iFppi)
+GO(SECMOD_AddNewModule, iFppLL)
+GO(SECMOD_AddNewModuleEx, iFppLLpp)
//GO(SECMOD_CancelWait,
-//GO(SECMOD_CanDeleteInternalModule,
+GO(SECMOD_CanDeleteInternalModule, iFv)
//GO(SECMOD_CloseUserDB,
//GO(SECMOD_CreateModule,
//GO(SECMOD_CreateModuleEx,
//GO(SECMOD_DeleteInternalModule,
-//GO(SECMOD_DeleteModule,
+GO(SECMOD_DeleteModule, iFpp)
//GO(SECMOD_DeleteModuleEx,
GO(SECMOD_DestroyModule, vFp)
//GO(SECMOD_FindModule,
//GO(SECMOD_FindSlot,
//GO(SECMOD_FreeModuleSpecList,
-//GO(SECMOD_GetDBModuleList,
+GO(SECMOD_GetDBModuleList, pFv)
//GO(SECMOD_GetDeadModuleList,
//GO(SECMOD_GetDefaultModDBFlag,
GO(SECMOD_GetDefaultModuleList, pFv)
@@ -787,13 +787,13 @@ GO(SECMOD_GetReadLock, vFp)
//GO(SECMOD_HasRemovableSlots,
//GO(SECMOD_HasRootCerts,
//GO(SECMOD_InternaltoPubMechFlags,
-//GO(SECMOD_IsModulePresent,
+GO(SECMOD_IsModulePresent, iFL)
//GO(SECMOD_LoadModule,
GO(SECMOD_LoadUserModule, pFppi)
-//GO(SECMOD_LookupSlot,
+GO(SECMOD_LookupSlot, pFLL)
//GO(SECMOD_OpenNewSlot,
GO(SECMOD_OpenUserDB, pFp)
-//GO(SECMOD_PubCipherFlagstoInternal,
+GO(SECMOD_PubCipherFlagstoInternal, LFL)
//GO(SECMOD_PubMechFlagstoInternal,
//GO(SECMOD_ReferenceModule,
GO(SECMOD_ReleaseReadLock, vFp)
@@ -802,60 +802,60 @@ GO(SECMOD_ReleaseReadLock, vFp)
//GO(SECMOD_UpdateModule,
//GO(SECMOD_UpdateSlotList,
//GO(SECMOD_WaitForAnyTokenEvent,
-//GO(SEC_NewCrl,
+GO(SEC_NewCrl, pFpppi)
//DATA(SEC_NullTemplate, //R type
//DATA(SEC_ObjectIDTemplate, //R type
DATA(SEC_OctetStringTemplate, 4*sizeof(void*)) //R type
-GO(SECOID_AddEntry, iFp)
+GO(SECOID_AddEntry, uFp)
DATA(SECOID_AlgorithmIDTemplate, 16*sizeof(void*)) //R type
-//GO(SECOID_CompareAlgorithmID,
-//GO(SECOID_CopyAlgorithmID,
-//GO(SECOID_DestroyAlgorithmID,
-//GO(SECOID_FindOID,
-//GO(SECOID_FindOIDByTag,
-GO(SECOID_FindOIDTag, iFp)
-//GO(SECOID_FindOIDTagDescription,
-//GO(SECOID_GetAlgorithmTag,
-//GO(SECOID_SetAlgorithmID,
-//GO(SEC_PKCS5GetCryptoAlgorithm,
-//GO(SEC_PKCS5GetIV,
-//GO(SEC_PKCS5GetKeyLength,
-//GO(SEC_PKCS5GetPBEAlgorithm,
-//GO(SEC_PKCS5IsAlgorithmPBEAlg,
-//GO(SEC_PKCS5IsAlgorithmPBEAlgTag,
+GO(SECOID_CompareAlgorithmID, iFpp)
+GO(SECOID_CopyAlgorithmID, iFppp)
+GO(SECOID_DestroyAlgorithmID, vFpi)
+GO(SECOID_FindOID, pFp)
+GO(SECOID_FindOIDByTag, pFu)
+GO(SECOID_FindOIDTag, uFp)
+GO(SECOID_FindOIDTagDescription, pFu)
+GO(SECOID_GetAlgorithmTag, uFp)
+GO(SECOID_SetAlgorithmID, iFppup)
+GO(SEC_PKCS5GetCryptoAlgorithm, uFp)
+GO(SEC_PKCS5GetIV, pFppi)
+GO(SEC_PKCS5GetKeyLength, iFp)
+GO(SEC_PKCS5GetPBEAlgorithm, uFui)
+GO(SEC_PKCS5IsAlgorithmPBEAlg, iFp)
+GO(SEC_PKCS5IsAlgorithmPBEAlgTag, iFu)
//DATA(SEC_PointerToAnyTemplate,
//DATA(SEC_PointerToOctetStringTemplate,
GO(SEC_QuickDERDecodeItem, iFpppp)
GO(SEC_RegisterDefaultHttpClient, iFp)
//DATA(SEC_SetOfAnyTemplate,
-//GO(SEC_SignData,
-//GO(SEC_SignDataWithAlgorithmID,
+GO(SEC_SignData, iFppipu)
+GO(SEC_SignDataWithAlgorithmID, iFppipp)
//DATA(SEC_SignedCertificateTemplate,
//DATA(SEC_UTCTimeTemplate, //R type
DATA(SEC_UTF8StringTemplate, 4*sizeof(void*)) //R type
-//GO(SGN_Begin,
-//GO(SGN_CompareDigestInfo,
-//GO(SGN_CopyDigestInfo,
-//GO(SGN_CreateDigestInfo,
-//GO(SGN_DestroyContext,
-//GO(SGN_DestroyDigestInfo,
-//GO(SGN_Digest,
+GO(SGN_Begin, iFp)
+GO(SGN_CompareDigestInfo, iFpp)
+GO(SGN_CopyDigestInfo, iFppp)
+GO(SGN_CreateDigestInfo, pFupu)
+GO(SGN_DestroyContext, vFpi)
+GO(SGN_DestroyDigestInfo, vFp)
+GO(SGN_Digest, iFpupp)
//DATA(sgn_DigestInfoTemplate,
-//GO(SGN_End,
-//GO(SGN_NewContext,
-//GO(SGN_NewContextWithAlgorithmID,
-//GO(SGN_Update,
+GO(SGN_End, iFpp)
+GO(SGN_NewContext, pFup)
+GO(SGN_NewContextWithAlgorithmID, pFpp)
+GO(SGN_Update, iFppu)
//GO(VFY_Begin,
-//GO(VFY_CreateContext,
-//GO(VFY_CreateContextDirect,
-//GO(VFY_CreateContextWithAlgorithmID,
-//GO(VFY_DestroyContext,
-//GO(VFY_End,
-//GO(VFY_EndWithSignature,
-//GO(VFY_Update,
-//GO(VFY_VerifyData,
-//GO(VFY_VerifyDataDirect,
-//GO(VFY_VerifyDataWithAlgorithmID,
-//GO(VFY_VerifyDigest,
-//GO(VFY_VerifyDigestDirect,
-//GO(VFY_VerifyDigestWithAlgorithmID,
+GO(VFY_CreateContext, pFppup)
+GO(VFY_CreateContextDirect, pFppuupp)
+GO(VFY_CreateContextWithAlgorithmID, pFppppp)
+GO(VFY_DestroyContext, vFpi)
+GO(VFY_End, iFp)
+GO(VFY_EndWithSignature, iFpp)
+GO(VFY_Update, iFppu)
+GO(VFY_VerifyData, iFpippup)
+GO(VFY_VerifyDataDirect, iFpippuupp)
+GO(VFY_VerifyDataWithAlgorithmID, iFpippppp)
+GO(VFY_VerifyDigest, iFpppup)
+GO(VFY_VerifyDigestDirect, iFpppuup)
+GO(VFY_VerifyDigestWithAlgorithmID, iFppppup)
diff --git a/src/wrapped/wrappednssutil3.c b/src/wrapped/wrappednssutil3.c
index 7a88495..7a88495 100755..100644
--- a/src/wrapped/wrappednssutil3.c
+++ b/src/wrapped/wrappednssutil3.c
diff --git a/src/wrapped/wrappednssutil3_private.h b/src/wrapped/wrappednssutil3_private.h
index aa81982..aa81982 100755..100644
--- a/src/wrapped/wrappednssutil3_private.h
+++ b/src/wrapped/wrappednssutil3_private.h
diff --git a/src/wrapped/wrappedopenal.c b/src/wrapped/wrappedopenal.c
index 96cc1bb..01b8c8e 100755..100644
--- a/src/wrapped/wrappedopenal.c
+++ b/src/wrapped/wrappedopenal.c
@@ -38,7 +38,7 @@ GO(4)
static uintptr_t my_Request_fct_##A = 0; \
static void my_Request_##A(int32_t a, int32_t b) \
{ \
- RunFunction(my_context, my_Request_fct_##A, 2, a, b); \
+ RunFunctionFmt(my_Request_fct_##A, "ii", a, b); \
}
SUPER()
#undef GO
@@ -113,7 +113,7 @@ void freeALProcWrapper(box64context_t* context)
context->almymap = NULL;
}
-EXPORT void* my_alGetProcAddress(x64emu_t* emu, void* name)
+EXPORT void* my_alGetProcAddress(x64emu_t* emu, void* name)
{
khint_t k;
const char* rname = (const char*)name;
@@ -130,7 +130,7 @@ EXPORT void* my_alGetProcAddress(x64emu_t* emu, void* name)
strcpy(tmp, "my_");
strcat(tmp, rname);
symbol = dlsym(emu->context->box64lib, tmp);
- } else
+ } else
symbol = my->alGetProcAddress(name);
if(!symbol)
return NULL; // easy
@@ -138,7 +138,7 @@ EXPORT void* my_alGetProcAddress(x64emu_t* emu, void* name)
uintptr_t ret = CheckBridged(emu->context->system, symbol);
if(ret)
return (void*)ret; // already bridged
- // get wrapper
+ // get wrapper
k = kh_get(symbolmap, emu->context->alwrappers, rname);
if(k==kh_end(emu->context->alwrappers)) {
printf_log(LOG_INFO, "Warning, no wrapper for %s\n", rname);
@@ -166,14 +166,14 @@ EXPORT void* my_alcGetProcAddress(x64emu_t* emu, void* device, void* name)
strcpy(tmp, "my_");
strcat(tmp, rname);
symbol = dlsym(emu->context->box64lib, tmp);
- } else
+ } else
symbol = my->alcGetProcAddress(device, name);
if(!symbol)
return NULL; // easy
uintptr_t ret = CheckBridged(emu->context->system, symbol);
if(ret)
return (void*)ret; // already bridged
- // get wrapper
+ // get wrapper
k = kh_get(symbolmap, emu->context->alwrappers, rname);
if(k==kh_end(emu->context->alwrappers)) {
printf_log(LOG_INFO, "Warning, no wrapper for %s\n", rname);
diff --git a/src/wrapped/wrappedopenal_private.h b/src/wrapped/wrappedopenal_private.h
index c138559..b0749c1 100755..100644
--- a/src/wrapped/wrappedopenal_private.h
+++ b/src/wrapped/wrappedopenal_private.h
@@ -14,12 +14,12 @@ GO(alGetBooleanv,vFip)
GO(alGetIntegerv,vFip)
GO(alGetFloatv,vFip)
GO(alGetDoublev,vFip)
-GO(alGetBoolean,iFi)
+GO(alGetBoolean, CFi)
GO(alGetInteger,iFi)
GO(alGetFloat,fFi)
GO(alGetDouble,dFi)
GO(alGetError,iFv)
-GO(alIsExtensionPresent,cFp)
+GO(alIsExtensionPresent, CFp)
GOM(alGetProcAddress,pFEp)
GO(alGetEnumValue,iFp)
GO(alListenerf,vFif)
@@ -61,7 +61,7 @@ GO(alSourceQueueBuffers,vFuip)
GO(alSourceUnqueueBuffers,vFuip)
GO(alGenBuffers,vFip)
GO(alDeleteBuffers,vFip)
-GO(alIsBuffer,cFu)
+GO(alIsBuffer, CFu)
GO(alBufferData,vFuipii)
GO(alBufferf,vFuif)
GO(alBuffer3f,vFuifff)
@@ -77,7 +77,7 @@ GO(alGetBuffer3i,vFuippp)
GO(alGetBufferiv,vFuip)
GO(alcCreateContext,pFpp)
-GO(alcMakeContextCurrent,iFp)
+GO(alcMakeContextCurrent, CFp)
GO(alcProcessContext,vFp)
GO(alcSuspendContext,vFp)
GO(alcDestroyContext,vFp)
@@ -86,26 +86,26 @@ GO(alcGetContextsDevice,pFp)
GO(alcOpenDevice,pFp)
GO(alcCloseDevice,iFp)
GO(alcGetError,iFp)
-GO(alcIsExtensionPresent,cFpp)
+GO(alcIsExtensionPresent, CFpp)
GOM(alcGetProcAddress,pFEpp)
GO(alcGetEnumValue,iFpp)
GO(alcGetString,pFpi)
GO(alcGetIntegerv,vFpiip)
GO(alcCaptureOpenDevice,pFpuii)
-GO(alcCaptureCloseDevice,iFp)
+GO(alcCaptureCloseDevice, CFp)
GO(alcCaptureStart,vFp)
GO(alcCaptureStop,vFp)
GO(alcCaptureSamples,vFppi)
GO(alcGetThreadContext, pFv)
-GO(alcSetThreadContext, iFp)
+GO(alcSetThreadContext, CFp)
GO(alcLoopbackOpenDeviceSOFT, pFp)
-GO(alcIsRenderFormatSupportedSOFT, cFpiii)
+GO(alcIsRenderFormatSupportedSOFT, CFpiii)
GO(alcRenderSamplesSOFT, vFppi)
GO(alcDevicePauseSOFT, vFp)
GO(alcDeviceResumeSOFT, vFp)
GO(alcGetStringiSOFT, pFpii)
-GO(alcResetDeviceSOFT, iFpp)
+GO(alcResetDeviceSOFT, CFpp)
GO(alcGetInteger64vSOFT, vFpiip)
GO(alBufferDataStatic,vFiipii)
@@ -115,15 +115,15 @@ GOM(alRequestFoldbackStop,vFEv)
GO(alBufferSamplesSOFT,vFuuiiiip)
GO(alBufferSubSamplesSOFT,vFuiiiip)
GO(alGetBufferSamplesSOFT,vFuiiiip)
-GO(alIsBufferFormatSupportedSOFT,cFi)
+GO(alIsBufferFormatSupportedSOFT, CFi)
GO(alSourcedSOFT,vFuid)
GO(alSource3dSOFT,vFuiddd)
GO(alSourcedvSOFT,vFuip)
GO(alGetSourcedSOFT,vFuip)
GO(alGetSource3dSOFT,vFuippp)
GO(alGetSourcedvSOFT,vFuip)
-GO(alSourcei64SOFT,vFuiI)
-GO(alSource3i64SOFT,vFuiIII)
+GO(alSourcei64SOFT, vFuil)
+GO(alSource3i64SOFT, vFuilll)
GO(alSourcei64vSOFT,vFuip)
GO(alGetSourcei64SOFT,vFuip)
GO(alGetSource3i64SOFT,vFuippp)
@@ -156,7 +156,7 @@ GO(alGetFilterf,vFuip)
GO(alGetFilterfv,vFuip)
GO(alGenAuxiliaryEffectSlots,vFip)
GO(alDeleteAuxiliaryEffectSlots,vFip)
-GO(alIsAuxiliaryEffectSlot,cFu)
+GO(alIsAuxiliaryEffectSlot, CFu)
GO(alAuxiliaryEffectSloti,vFuii)
GO(alAuxiliaryEffectSlotiv,vFuip)
GO(alAuxiliaryEffectSlotf,vFuif)
diff --git a/src/wrapped/wrappedpango.c b/src/wrapped/wrappedpango.c
index dc0ccf4..438ab7d 100755..100644
--- a/src/wrapped/wrappedpango.c
+++ b/src/wrapped/wrappedpango.c
@@ -46,17 +46,17 @@ static my_PangoAttrClass_t my_PangoAttrClass_struct_##A = {0}; \
static uintptr_t my_PangoAttrClass_copy_##A = 0; \
static void* my_PangoAttrClass_copyfct##A(void* attr) \
{ \
- return (void*)RunFunction(my_context, my_PangoAttrClass_copy_##A, 1, attr); \
+ return (void*)RunFunctionFmt(my_PangoAttrClass_copy_##A, "p", attr); \
} \
static uintptr_t my_PangoAttrClass_del_##A = 0; \
static void my_PangoAttrClass_delfct##A(void* attr) \
{ \
- RunFunction(my_context, my_PangoAttrClass_del_##A, 1, attr);\
+ RunFunctionFmt(my_PangoAttrClass_del_##A, "p", attr);\
} \
static uintptr_t my_PangoAttrClass_equal_##A = 0; \
static int my_PangoAttrClass_equalfct##A(void* a, void* b) \
{ \
- return (int)RunFunction(my_context, my_PangoAttrClass_equal_##A, 2, a, b);\
+ return (int)RunFunctionFmt(my_PangoAttrClass_equal_##A, "pp", a, b);\
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedpango_private.h b/src/wrapped/wrappedpango_private.h
index b472a4a..db3b905 100755..100644
--- a/src/wrapped/wrappedpango_private.h
+++ b/src/wrapped/wrappedpango_private.h
@@ -45,30 +45,30 @@ GO(pango_attr_stretch_new, pFi)
GO(pango_attr_strikethrough_color_new, pFWWW)
GO(pango_attr_strikethrough_new, pFi)
GO(pango_attr_style_new, pFi)
-GO(pango_attr_type_get_name, pFp)
+GO(pango_attr_type_get_name, pFu)
GO(pango_attr_type_get_type, iFv)
-GO(pango_attr_type_register, iFp)
+GO(pango_attr_type_register, uFp)
GO(pango_attr_underline_color_new, pFWWW)
GO(pango_attr_underline_new, pFi)
GO(pango_attr_variant_new, pFi)
GO(pango_attr_weight_new, pFi)
-//GO(pango_bidi_type_for_unichar,
+GO(pango_bidi_type_for_unichar, uFu)
//GO(pango_bidi_type_get_type,
//GO(pango_break,
GO(pango_color_copy, pFp)
GO(pango_color_free, vFp)
GO(pango_color_get_type, iFv)
GO(pango_color_parse, iFpp)
-//GO(pango_color_to_string,
+GO(pango_color_to_string, pFp)
GO(pango_config_key_get, pFp)
//GO(pango_config_key_get_system,
GO(pango_context_changed, vFp)
-GO(pango_context_get_base_dir, iFp)
+GO(pango_context_get_base_dir, uFp)
GO(pango_context_get_base_gravity, iFp)
GO(pango_context_get_font_description, pFp)
GO(pango_context_get_font_map, pFp)
-GO(pango_context_get_gravity, iFp)
-GO(pango_context_get_gravity_hint, iFp)
+GO(pango_context_get_gravity, uFp)
+GO(pango_context_get_gravity_hint, uFp)
GO(pango_context_get_language, pFp)
GO(pango_context_get_matrix, pFp)
GO(pango_context_get_metrics, pFppp)
@@ -78,33 +78,33 @@ GO(pango_context_list_families, vFppp)
GO(pango_context_load_font, pFpp)
GO(pango_context_load_fontset, pFppp)
GO(pango_context_new, pFv)
-GO(pango_context_set_base_dir, vFpi)
-GO(pango_context_set_base_gravity, vFpi)
+GO(pango_context_set_base_dir, vFpu)
+GO(pango_context_set_base_gravity, vFpu)
GO(pango_context_set_font_description, vFpp)
GO(pango_context_set_font_map, vFpp)
-GO(pango_context_set_gravity_hint, vFpi)
+GO(pango_context_set_gravity_hint, vFpu)
GO(pango_context_set_language, vFpp)
GO(pango_context_set_matrix, vFpp)
-//GO(pango_coverage_copy,
-//GO(pango_coverage_from_bytes,
-//GO(pango_coverage_get,
+GO(pango_coverage_copy, pFp)
+GO(pango_coverage_from_bytes, pFpi)
+GO(pango_coverage_get, uFpi)
//GO(pango_coverage_level_get_type,
-//GO(pango_coverage_max,
-//GO(pango_coverage_new,
+GO(pango_coverage_max, vFpp)
+GO(pango_coverage_new, pFv)
//GO(pango_coverage_ref,
-//GO(pango_coverage_set,
-//GO(pango_coverage_to_bytes,
+GO(pango_coverage_set, vFpiu)
+GO(pango_coverage_to_bytes, vFppp)
//GO(pango_coverage_unref,
-//GO(pango_default_break,
+GO(pango_default_break, vFpippi)
//GO(pango_direction_get_type,
GO(pango_ellipsize_mode_get_type, lFv)
//GO(pango_engine_get_type,
//GO(pango_engine_lang_get_type,
//GO(pango_engine_shape_get_type,
GO(pango_extents_to_pixels, vFpp)
-//GO(pango_find_base_dir,
+GO(pango_find_base_dir, uFpi)
//GO(pango_find_map,
-//GO(pango_find_paragraph_boundary,
+GO(pango_find_paragraph_boundary, vFpipp)
GO(pango_font_describe, pFp)
GO(pango_font_describe_with_absolute_size, pFp)
GO(pango_font_description_better_match, iFppp)
@@ -114,15 +114,15 @@ GO(pango_font_description_equal, iFpp)
GO(pango_font_description_free, vFp)
GO(pango_font_description_from_string, pFp)
GO(pango_font_description_get_family, pFp)
-GO(pango_font_description_get_gravity, iFp)
-GO(pango_font_description_get_set_fields, iFp)
+GO(pango_font_description_get_gravity, uFp)
+GO(pango_font_description_get_set_fields, uFp)
GO(pango_font_description_get_size, iFp)
GO(pango_font_description_get_size_is_absolute, iFp)
-GO(pango_font_description_get_stretch, iFp)
-GO(pango_font_description_get_style, iFp)
+GO(pango_font_description_get_stretch, uFp)
+GO(pango_font_description_get_style, uFp)
GO(pango_font_description_get_type, iFv)
-GO(pango_font_description_get_variant, vFpi)
-GO(pango_font_description_get_weight, iFp)
+GO(pango_font_description_get_variant, uFp)
+GO(pango_font_description_get_weight, uFp)
GO(pango_font_description_hash, uFp)
GO(pango_font_description_merge, vFppi)
GO(pango_font_description_merge_static, vFppi)
@@ -130,16 +130,16 @@ GO(pango_font_description_new, pFv)
GO(pango_font_description_set_absolute_size, vFpd)
GO(pango_font_description_set_family, vFpp)
GO(pango_font_description_set_family_static, vFpp)
-GO(pango_font_description_set_gravity, vFpi)
+GO(pango_font_description_set_gravity, vFpu)
GO(pango_font_description_set_size, vFpi)
-GO(pango_font_description_set_stretch, vFpi)
-GO(pango_font_description_set_style, vFpi)
-GO(pango_font_description_set_variant, vFpi)
-GO(pango_font_description_set_weight, vFpi)
+GO(pango_font_description_set_stretch, vFpu)
+GO(pango_font_description_set_style, vFpu)
+GO(pango_font_description_set_variant, vFpu)
+GO(pango_font_description_set_weight, vFpu)
GO(pango_font_descriptions_free, vFpi)
GO(pango_font_description_to_filename, pFp)
GO(pango_font_description_to_string, pFp)
-GO(pango_font_description_unset_fields, vFpi)
+GO(pango_font_description_unset_fields, vFpu)
GO(pango_font_face_describe, pFp)
GO(pango_font_face_get_face_name, pFp)
GO(pango_font_face_get_type, iFv)
@@ -152,7 +152,7 @@ GO(pango_font_family_list_faces, vFppp)
GO(pango_font_find_shaper, pFppu)
GO(pango_font_get_coverage, pFpp)
GO(pango_font_get_font_map, pFp)
-GO(pango_font_get_glyph_extents, vFpppp)
+GO(pango_font_get_glyph_extents, vFpupp)
GO(pango_font_get_metrics, pFpp)
GO(pango_font_get_type, iFv)
GO(pango_font_map_create_context, pFp)
@@ -179,13 +179,13 @@ GO(pango_font_metrics_unref, vFp)
GO(pango_fontset_get_font, pFpu)
GO(pango_fontset_get_metrics, pFp)
//GO(pango_fontset_get_type,
-//GO(pango_fontset_simple_append,
+GO(pango_fontset_simple_append, vFpp)
//GO(pango_fontset_simple_get_type,
-//GO(pango_fontset_simple_new,
-//GO(pango_fontset_simple_size,
+GO(pango_fontset_simple_new, pFp)
+GO(pango_fontset_simple_size, iFp)
//GO(pango_get_lib_subdirectory,
-//GO(pango_get_log_attrs,
-//GO(pango_get_mirror_char,
+GO(pango_get_log_attrs, vFpiippi)
+GO(pango_get_mirror_char, iFup)
//GO(pango_get_sysconf_subdirectory,
GO(pango_glyph_item_apply_attrs, pFppp)
GO(pango_glyph_item_copy, pFp)
@@ -212,20 +212,20 @@ GO(pango_glyph_string_index_to_x, vFppipiip)
GO(pango_glyph_string_new, pFv)
GO(pango_glyph_string_set_size, vFpi)
GO(pango_glyph_string_x_to_index, vFppipipp)
-//GO(pango_gravity_get_for_matrix,
-//GO(pango_gravity_get_for_script,
-//GO(pango_gravity_get_for_script_and_width,
+GO(pango_gravity_get_for_matrix, uFp)
+GO(pango_gravity_get_for_script, uFiuu)
+GO(pango_gravity_get_for_script_and_width, uFiiuu)
GO(pango_gravity_get_type, iFv)
//GO(pango_gravity_hint_get_type,
-//GO(pango_gravity_to_rotation,
-//GO(pango_is_zero_width,
-//GO(pango_item_copy,
-//GO(pango_item_free,
+GO(pango_gravity_to_rotation, dFu)
+GO(pango_is_zero_width, iFu)
+GO(pango_item_copy, pFp)
+GO(pango_item_free, vFp)
//GO(pango_item_get_type,
-//GO(pango_itemize,
-//GO(pango_itemize_with_base_dir,
-//GO(pango_item_new,
-//GO(pango_item_split,
+GO(pango_itemize, pFppiipp)
+GO(pango_itemize_with_base_dir, pFpupiipp)
+GO(pango_item_new, pFv)
+GO(pango_item_split, pFpii)
GO(pango_language_from_string, pFp)
GO(pango_language_get_default, pFv)
GO(pango_language_get_sample_string, pFp)
@@ -236,14 +236,14 @@ GO(pango_language_matches, iFpp)
GO(pango_language_to_string, pFp)
GO(pango_layout_context_changed, vFp)
GO(pango_layout_copy, pFp)
-GO(pango_layout_get_alignment, iFp)
+GO(pango_layout_get_alignment, uFp)
GO(pango_layout_get_attributes, pFp)
GO(pango_layout_get_auto_dir, iFp)
GO(pango_layout_get_baseline, iFp)
GO(pango_layout_get_character_count, iFp)
GO(pango_layout_get_context, pFp)
GO(pango_layout_get_cursor_pos, vFpipp)
-GO(pango_layout_get_ellipsize, iFp)
+GO(pango_layout_get_ellipsize, uFp)
GO(pango_layout_get_extents, vFppp)
GO(pango_layout_get_font_description, pFp)
GO(pango_layout_get_height, iFp)
@@ -268,7 +268,7 @@ GO(pango_layout_get_text, pFp)
GO(pango_layout_get_type, iFv)
GO(pango_layout_get_unknown_glyphs_count, iFp)
GO(pango_layout_get_width, iFp)
-GO(pango_layout_get_wrap, iFp)
+GO(pango_layout_get_wrap, uFp)
GO(pango_layout_index_to_line_x, vFpiipp)
GO(pango_layout_index_to_pos, vFpip)
GO(pango_layout_is_ellipsized, iFp)
@@ -304,10 +304,10 @@ GO(pango_layout_line_unref, vFp)
GO(pango_layout_line_x_to_index, iFpipp)
GO(pango_layout_move_cursor_visually, vFpiiiipp)
GO(pango_layout_new, pFp)
-GO(pango_layout_set_alignment, vFpi)
+GO(pango_layout_set_alignment, vFpu)
GO(pango_layout_set_attributes, vFpp)
GO(pango_layout_set_auto_dir, vFpi)
-GO(pango_layout_set_ellipsize, vFpi)
+GO(pango_layout_set_ellipsize, vFpu)
GO(pango_layout_set_font_description, vFpp)
GO(pango_layout_set_height, vFpi)
GO(pango_layout_set_indent, vFpi)
@@ -319,13 +319,13 @@ GO(pango_layout_set_spacing, vFpi)
GO(pango_layout_set_tabs, vFpp)
GO(pango_layout_set_text, vFppi)
GO(pango_layout_set_width, vFpi)
-GO(pango_layout_set_wrap, vFpi)
+GO(pango_layout_set_wrap, vFpu)
GO(pango_layout_xy_to_index, iFpiipp)
-//GO(pango_log2vis_get_embedding_levels,
+GO(pango_log2vis_get_embedding_levels, pFpip)
//GO(pango_lookup_aliases,
//GO(pango_map_get_engine,
//GO(pango_map_get_engines,
-//GO(pango_markup_parser_finish,
+GO(pango_markup_parser_finish, iFppppp)
GO(pango_markup_parser_new, pFu)
GO(pango_matrix_concat, vFpp)
GO(pango_matrix_copy, pFp)
@@ -341,34 +341,34 @@ GO(pango_matrix_transform_point, vFppp)
GO(pango_matrix_transform_rectangle, vFpp)
GO(pango_matrix_translate, vFpdd)
//GO(pango_module_register,
-//GO(pango_parse_enum,
+GO(pango_parse_enum, iFLppip)
GO(pango_parse_markup, iFpiupppp)
-//GO(pango_parse_stretch,
-//GO(pango_parse_style,
-//GO(pango_parse_variant,
-//GO(pango_parse_weight,
-//GO(pango_quantize_line_geometry,
+GO(pango_parse_stretch, iFppi)
+GO(pango_parse_style, iFppi)
+GO(pango_parse_variant, iFppi)
+GO(pango_parse_weight, iFppi)
+GO(pango_quantize_line_geometry, vFpp)
GO(pango_read_line, iFpp)
//GO(pango_renderer_activate,
-//GO(pango_renderer_deactivate,
-//GO(pango_renderer_draw_error_underline,
-//GO(pango_renderer_draw_glyph,
-//GO(pango_renderer_draw_glyph_item,
-//GO(pango_renderer_draw_glyphs,
-//GO(pango_renderer_draw_layout,
-//GO(pango_renderer_draw_layout_line,
-//GO(pango_renderer_draw_rectangle,
-//GO(pango_renderer_draw_trapezoid,
-//GO(pango_renderer_get_color,
-//GO(pango_renderer_get_layout,
-//GO(pango_renderer_get_layout_line,
-//GO(pango_renderer_get_matrix,
-//GO(pango_renderer_get_type,
-//GO(pango_renderer_part_changed,
-//GO(pango_renderer_set_color,
-//GO(pango_renderer_set_matrix,
+GO(pango_renderer_deactivate, vFp)
+GO(pango_renderer_draw_error_underline, vFpiiii)
+GO(pango_renderer_draw_glyph, vFppudd)
+GO(pango_renderer_draw_glyph_item, vFpppii)
+GO(pango_renderer_draw_glyphs, vFpppii)
+GO(pango_renderer_draw_layout, vFppii)
+GO(pango_renderer_draw_layout_line, vFppii)
+GO(pango_renderer_draw_rectangle, vFpuiiii)
+GO(pango_renderer_draw_trapezoid, vFpudddddd)
+GO(pango_renderer_get_color, pFpu)
+GO(pango_renderer_get_layout, pFp)
+GO(pango_renderer_get_layout_line, pFp)
+GO(pango_renderer_get_matrix, pFp)
+GO(pango_renderer_get_type, LFv)
+GO(pango_renderer_part_changed, vFpu)
+GO(pango_renderer_set_color, vFpup)
+GO(pango_renderer_set_matrix, vFpp)
//GO(pango_render_part_get_type,
-//GO(pango_reorder_items,
+GO(pango_reorder_items, pFp)
GO(pango_scan_int, iFpp)
GO(pango_scan_string, iFpp)
GO(pango_scan_word, iFpp)
@@ -379,8 +379,8 @@ GO(pango_script_iter_free, vFp)
GO(pango_script_iter_get_range, vFpppp)
GO(pango_script_iter_new, pFpi)
GO(pango_script_iter_next, iFp)
-//GO(pango_shape,
-//GO(pango_shape_full,
+GO(pango_shape, vFpipp)
+GO(pango_shape_full, vFpipipp)
GO(pango_skip_space, iFp)
GO(pango_split_file_list, pFp)
GO(pango_stretch_get_type, iFv)
@@ -396,10 +396,10 @@ GO(pango_tab_array_get_type, iFv)
GO(pango_tab_array_new, pFii)
GO(pango_tab_array_new_with_positions, pFiiiippppppppppppppp) //vaarg
GO(pango_tab_array_resize, vFpi)
-GO(pango_tab_array_set_tab, vFpiii)
+GO(pango_tab_array_set_tab, vFpiui)
GO(pango_trim_string, pFp)
GO(pango_underline_get_type, iFv)
-GO(pango_unichar_direction, iFu)
+GO(pango_unichar_direction, uFu)
GO(pango_units_from_double, iFd)
GO(pango_units_to_double, dFi)
GO(pango_variant_get_type, pFv)
diff --git a/src/wrapped/wrappedpangocairo.c b/src/wrapped/wrappedpangocairo.c
index d1b2017..d1b2017 100755..100644
--- a/src/wrapped/wrappedpangocairo.c
+++ b/src/wrapped/wrappedpangocairo.c
diff --git a/src/wrapped/wrappedpangocairo_private.h b/src/wrapped/wrappedpangocairo_private.h
index 946e195..a39d0b9 100755..100644
--- a/src/wrapped/wrappedpangocairo_private.h
+++ b/src/wrapped/wrappedpangocairo_private.h
@@ -14,14 +14,14 @@ GO(pango_cairo_error_underline_path, vFpdddd)
GO(pango_cairo_fc_font_get_type, iFv)
GO(pango_cairo_fc_font_map_get_type, iFv)
GO(pango_cairo_font_get_scaled_font, pFp)
-GO(pango_cairo_font_get_type, iFv)
+GO(pango_cairo_font_get_type, LFv)
GO(pango_cairo_font_map_create_context, pFp)
GO(pango_cairo_font_map_get_default, pFv)
-GO(pango_cairo_font_map_get_font_type, iFp)
+GO(pango_cairo_font_map_get_font_type, uFp)
GO(pango_cairo_font_map_get_resolution, dFp)
GO(pango_cairo_font_map_get_type, iFv)
GO(pango_cairo_font_map_new, pFv)
-GO(pango_cairo_font_map_new_for_font_type, pFi)
+GO(pango_cairo_font_map_new_for_font_type, pFu)
GO(pango_cairo_font_map_set_default, vFp)
GO(pango_cairo_font_map_set_resolution, vFpd)
GO(pango_cairo_glyph_string_path, vFppp)
diff --git a/src/wrapped/wrappedpangoft2.c b/src/wrapped/wrappedpangoft2.c
index 3a9838b..3a9838b 100755..100644
--- a/src/wrapped/wrappedpangoft2.c
+++ b/src/wrapped/wrappedpangoft2.c
diff --git a/src/wrapped/wrappedpangoft2_private.h b/src/wrapped/wrappedpangoft2_private.h
index 03f7b30..0d12f7f 100755..100644
--- a/src/wrapped/wrappedpangoft2_private.h
+++ b/src/wrapped/wrappedpangoft2_private.h
@@ -39,7 +39,7 @@ GO(pango_ft2_font_get_kerning, iFpuu)
GO(pango_ft2_font_get_type, iFv)
GO(pango_ft2_font_map_create_context, pFp)
GO(pango_ft2_font_map_for_display, pFv)
-GO(pango_ft2_font_map_get_type, iFv)
+GO(pango_ft2_font_map_get_type, LFv)
GO(pango_ft2_font_map_new, pFv)
//GOM(pango_ft2_font_map_set_default_substitute, vFEpBpB)
GO(pango_ft2_font_map_set_resolution, vFpdd)
diff --git a/src/wrapped/wrappedplc4.c b/src/wrapped/wrappedplc4.c
index 1f6e779..1f6e779 100755..100644
--- a/src/wrapped/wrappedplc4.c
+++ b/src/wrapped/wrappedplc4.c
diff --git a/src/wrapped/wrappedplc4_private.h b/src/wrapped/wrappedplc4_private.h
index ae4adee..ae4adee 100755..100644
--- a/src/wrapped/wrappedplc4_private.h
+++ b/src/wrapped/wrappedplc4_private.h
diff --git a/src/wrapped/wrappedplds4.c b/src/wrapped/wrappedplds4.c
index f3a94af..f3a94af 100755..100644
--- a/src/wrapped/wrappedplds4.c
+++ b/src/wrapped/wrappedplds4.c
diff --git a/src/wrapped/wrappedplds4_private.h b/src/wrapped/wrappedplds4_private.h
index ccf0049..ccf0049 100755..100644
--- a/src/wrapped/wrappedplds4_private.h
+++ b/src/wrapped/wrappedplds4_private.h
diff --git a/src/wrapped/wrappedpng16.c b/src/wrapped/wrappedpng16.c
index 22bb9e5..290162b 100755..100644
--- a/src/wrapped/wrappedpng16.c
+++ b/src/wrapped/wrappedpng16.c
@@ -41,7 +41,7 @@ GO(3)
static uintptr_t my_user_write_fct_##A = 0; \
static void my_user_write_##A(void* png_ptr, void* data, int32_t length) \
{ \
- RunFunction(my_context, my_user_write_fct_##A, 3, png_ptr, data, length);\
+ RunFunctionFmt(my_user_write_fct_##A, "ppi", png_ptr, data, length);\
}
SUPER()
#undef GO
@@ -63,7 +63,7 @@ static void* finduser_writeFct(void* fct)
static uintptr_t my_user_flush_fct_##A = 0; \
static void my_user_flush_##A(void* png_ptr) \
{ \
- RunFunction(my_context, my_user_flush_fct_##A, 1, png_ptr);\
+ RunFunctionFmt(my_user_flush_fct_##A, "p", png_ptr);\
}
SUPER()
#undef GO
@@ -85,7 +85,7 @@ static void* finduser_flushFct(void* fct)
static uintptr_t my_user_read_fct_##A = 0; \
static void my_user_read_##A(void* png_ptr, void* data, int32_t length) \
{ \
- RunFunction(my_context, my_user_read_fct_##A, 3, png_ptr, data, length);\
+ RunFunctionFmt(my_user_read_fct_##A, "ppi", png_ptr, data, length);\
}
SUPER()
#undef GO
@@ -107,7 +107,7 @@ static void* finduser_readFct(void* fct)
static uintptr_t my_error_fct_##A = 0; \
static void my_error_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_error_fct_##A, 2, a, b);\
+ RunFunctionFmt(my_error_fct_##A, "pp", a, b);\
}
SUPER()
#undef GO
@@ -129,7 +129,7 @@ static void* finderrorFct(void* fct)
static uintptr_t my_warning_fct_##A = 0; \
static void my_warning_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_warning_fct_##A, 2, a, b);\
+ RunFunctionFmt(my_warning_fct_##A, "pp", a, b);\
}
SUPER()
#undef GO
@@ -151,7 +151,7 @@ static void* findwarningFct(void* fct)
static uintptr_t my_malloc_fct_##A = 0; \
static void my_malloc_##A(void* a, unsigned long b) \
{ \
- RunFunction(my_context, my_malloc_fct_##A, 2, a, b);\
+ RunFunctionFmt(my_malloc_fct_##A, "pL", a, b);\
}
SUPER()
#undef GO
@@ -173,7 +173,7 @@ static void* findmallocFct(void* fct)
static uintptr_t my_free_fct_##A = 0; \
static void my_free_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_free_fct_##A, 2, a, b);\
+ RunFunctionFmt(my_free_fct_##A, "pp", a, b);\
}
SUPER()
#undef GO
@@ -196,7 +196,7 @@ static void* findfreeFct(void* fct)
static uintptr_t my_progressive_info_fct_##A = 0; \
static void my_progressive_info_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_progressive_info_fct_##A, 2, a, b);\
+ RunFunctionFmt(my_progressive_info_fct_##A, "pp", a, b);\
}
SUPER()
#undef GO
@@ -219,7 +219,7 @@ static void* findprogressive_infoFct(void* fct)
static uintptr_t my_progressive_end_fct_##A = 0; \
static void my_progressive_end_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_progressive_end_fct_##A, 2, a, b);\
+ RunFunctionFmt(my_progressive_end_fct_##A, "pp", a, b);\
}
SUPER()
#undef GO
@@ -242,7 +242,7 @@ static void* findprogressive_endFct(void* fct)
static uintptr_t my_progressive_row_fct_##A = 0; \
static void my_progressive_row_##A(void* a, void* b, uint32_t c, int d) \
{ \
- RunFunction(my_context, my_progressive_row_fct_##A, 4, a, b, c, d);\
+ RunFunctionFmt(my_progressive_row_fct_##A, "ppui", a, b, c, d);\
}
SUPER()
#undef GO
@@ -266,7 +266,7 @@ static void* findprogressive_rowFct(void* fct)
static uintptr_t my_user_transform_fct_##A = 0; \
static void my_user_transform_##A(void* ptr, void* row, void* data) \
{ \
- RunFunction(my_context, my_user_transform_fct_##A, 3, ptr, row, data);\
+ RunFunctionFmt(my_user_transform_fct_##A, "ppp", ptr, row, data);\
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedpng16_private.h b/src/wrapped/wrappedpng16_private.h
index 3a7e4d5..0891d45 100755..100644
--- a/src/wrapped/wrappedpng16_private.h
+++ b/src/wrapped/wrappedpng16_private.h
@@ -87,6 +87,7 @@ GO(png_set_cHRM, vFppdddddddd)
GO(png_permit_mng_features, uFpu)
GO(png_set_keep_unknown_chunks, vFpipi)
GO(png_set_oFFs, vFppiii)
+GO(png_set_option, iFpii)
GO(png_get_libpng_ver, pFp)
GO(png_get_text, uFpppp)
GO(png_set_sBIT, vFppp)
diff --git a/src/wrapped/wrappedpulse.c b/src/wrapped/wrappedpulse.c
index 02233aa..f5ec5d4 100755..100644
--- a/src/wrapped/wrappedpulse.c
+++ b/src/wrapped/wrappedpulse.c
@@ -49,7 +49,7 @@ typedef void (*vFipippV_t)(int, void*, int, void*, void*, va_list);
#else
typedef void (*vFipippV_t)(int, void*, int, void*, void*, void*);
#endif
- GO(pa_log_level_meta, vFipippV_t)
+ GO(pa_log_level_meta, vFipippV_t)
#endif
#define ADDED_FUNCTIONS() \
@@ -91,7 +91,7 @@ GO(15) \
static uintptr_t my_free_fct_##A = 0; \
static void my_free_##A(void* data) \
{ \
- RunFunction(my_context, my_free_fct_##A, 1, data);\
+ RunFunctionFmt(my_free_fct_##A, "p", data);\
}
SUPER()
#undef GO
@@ -113,7 +113,7 @@ static void* findFreeFct(void* fct)
static uintptr_t my_free_api_fct_##A = 0; \
static void my_free_api_##A(my_pa_mainloop_api_t* api, void* p, void* data) \
{ \
- RunFunction(my_context, my_free_api_fct_##A, 3, api, p, data);\
+ RunFunctionFmt(my_free_api_fct_##A, "ppp", api, p, data);\
}
SUPER()
#undef GO
@@ -136,7 +136,7 @@ static uintptr_t my_io_event_fct_##A = 0; \
static void my_io_event_##A(my_pa_mainloop_api_t* api, void* e, int fd, int events, void* data) \
{ \
if(api==my_mainloop_orig) api=my_mainloop_ref; \
- RunFunction(my_context, my_io_event_fct_##A, 5, api, e, fd, events, data); \
+ RunFunctionFmt(my_io_event_fct_##A, "ppiip", api, e, fd, events, data); \
}
SUPER()
#undef GO
@@ -159,7 +159,7 @@ static uintptr_t my_time_event_fct_##A = 0; \
static void my_time_event_##A(my_pa_mainloop_api_t* api, void* e, void* tv, void* data) \
{ \
if(api==my_mainloop_orig) api=my_mainloop_ref; \
- RunFunction(my_context, my_time_event_fct_##A, 4, api, e, tv, data); \
+ RunFunctionFmt(my_time_event_fct_##A, "pppp", api, e, tv, data); \
}
SUPER()
#undef GO
@@ -183,7 +183,7 @@ static uintptr_t my_defer_event_fct_##A = 0; \
static void my_defer_event_##A(my_pa_mainloop_api_t* api, void* e, void* data) \
{ \
if(api==my_mainloop_orig) api=my_mainloop_ref; \
- RunFunction(my_context, my_defer_event_fct_##A, 3, api, e, data); \
+ RunFunctionFmt(my_defer_event_fct_##A, "ppp", api, e, data); \
}
SUPER()
#undef GO
@@ -206,7 +206,7 @@ static void* findDeferEventFct(void* fct)
static uintptr_t my_poll_fct_##A = 0; \
static int my_poll_##A(void* ufds, unsigned long nfds, int timeout, void* data) \
{ \
- return (int)RunFunction(my_context, my_poll_fct_##A, 4, ufds, nfds, timeout, data); \
+ return (int)RunFunctionFmt(my_poll_fct_##A, "pLip", ufds, nfds, timeout, data); \
}
SUPER()
#undef GO
@@ -229,7 +229,7 @@ static uintptr_t my_signal_fct_##A = 0; \
static void my_signal_##A(my_pa_mainloop_api_t* api, void* e, int sig, void *data) \
{ \
if(api==my_mainloop_orig) api=my_mainloop_ref; \
- RunFunction(my_context, my_signal_fct_##A, 4, api, e, sig, data); \
+ RunFunctionFmt(my_signal_fct_##A, "ppip", api, e, sig, data); \
}
SUPER()
#undef GO
@@ -252,7 +252,7 @@ static uintptr_t my_signal_destroy_fct_##A = 0; \
static void my_signal_destroy_##A(my_pa_mainloop_api_t* api, void* e, void *data) \
{ \
if(api==my_mainloop_orig) api=my_mainloop_ref; \
- RunFunction(my_context, my_signal_destroy_fct_##A, 3, api, e, data); \
+ RunFunctionFmt(my_signal_destroy_fct_##A, "ppp", api, e, data); \
}
SUPER()
#undef GO
@@ -275,7 +275,7 @@ static void* find_signal_destroy_Fct(void* fct)
static uintptr_t my_prefork_fct_##A = 0; \
static void my_prefork_##A() \
{ \
- RunFunction(my_context, my_prefork_fct_##A, 0); \
+ RunFunctionFmt(my_prefork_fct_##A, ""); \
}
SUPER()
#undef GO
@@ -297,7 +297,7 @@ static void* find_prefork_Fct(void* fct)
static uintptr_t my_postfork_fct_##A = 0; \
static void my_postfork_##A() \
{ \
- RunFunction(my_context, my_postfork_fct_##A, 0);\
+ RunFunctionFmt(my_postfork_fct_##A, "");\
}
SUPER()
#undef GO
@@ -319,7 +319,7 @@ static void* find_postfork_Fct(void* fct)
static uintptr_t my_atfork_fct_##A = 0; \
static void my_atfork_##A() \
{ \
- RunFunction(my_context, my_atfork_fct_##A, 0); \
+ RunFunctionFmt(my_atfork_fct_##A, ""); \
}
SUPER()
#undef GO
@@ -342,7 +342,7 @@ static void* find_atfork_Fct(void* fct)
static uintptr_t my_state_context_fct_##A = 0; \
static void my_state_context_##A(void* context, void* data) \
{ \
- RunFunction(my_context, my_state_context_fct_##A, 2, context, data); \
+ RunFunctionFmt(my_state_context_fct_##A, "pp", context, data); \
}
SUPER()
#undef GO
@@ -364,7 +364,7 @@ static void* find_state_context_Fct(void* fct)
static uintptr_t my_notify_context_fct_##A = 0; \
static void my_notify_context_##A(void* context, void* data) \
{ \
- RunFunction(my_context, my_notify_context_fct_##A, 2, context, data); \
+ RunFunctionFmt(my_notify_context_fct_##A, "pp", context, data); \
}
SUPER()
#undef GO
@@ -386,7 +386,7 @@ static void* find_notify_context_Fct(void* fct)
static uintptr_t my_success_context_fct_##A = 0; \
static void my_success_context_##A(void* context, int success, void* data) \
{ \
- RunFunction(my_context, my_success_context_fct_##A, 3, context, success, data); \
+ RunFunctionFmt(my_success_context_fct_##A, "pip", context, success, data); \
}
SUPER()
#undef GO
@@ -408,7 +408,7 @@ static void* find_success_context_Fct(void* fct)
static uintptr_t my_event_context_fct_##A = 0; \
static void my_event_context_##A(void* context, void* name, void* p, void* data) \
{ \
- RunFunction(my_context, my_event_context_fct_##A, 4, context, name, p, data); \
+ RunFunctionFmt(my_event_context_fct_##A, "pppp", context, name, p, data); \
}
SUPER()
#undef GO
@@ -430,7 +430,7 @@ static void* find_event_context_Fct(void* fct)
static uintptr_t my_module_info_fct_##A = 0; \
static void my_module_info_##A(void* context, void* i, int eol, void* data) \
{ \
- RunFunction(my_context, my_module_info_fct_##A, 4, context, i, eol, data); \
+ RunFunctionFmt(my_module_info_fct_##A, "ppip", context, i, eol, data); \
}
SUPER()
#undef GO
@@ -452,7 +452,7 @@ static void* find_module_info_Fct(void* fct)
static uintptr_t my_server_info_fct_##A = 0; \
static void my_server_info_##A(void* context, void* i, void* data) \
{ \
- RunFunction(my_context, my_server_info_fct_##A, 3, context, i, data); \
+ RunFunctionFmt(my_server_info_fct_##A, "ppp", context, i, data); \
}
SUPER()
#undef GO
@@ -474,7 +474,7 @@ static void* find_server_info_Fct(void* fct)
static uintptr_t my_client_info_fct_##A = 0; \
static void my_client_info_##A(void* context, void* i, int eol, void* data) \
{ \
- RunFunction(my_context, my_client_info_fct_##A, 4, context, i, eol, data); \
+ RunFunctionFmt(my_client_info_fct_##A, "ppip", context, i, eol, data); \
}
SUPER()
#undef GO
@@ -496,7 +496,7 @@ static void* find_client_info_Fct(void* fct)
static uintptr_t my_context_index_fct_##A = 0; \
static void my_context_index_##A(void* context, uint32_t idx, void* data) \
{ \
- RunFunction(my_context, my_context_index_fct_##A, 3, context, idx, data); \
+ RunFunctionFmt(my_context_index_fct_##A, "pup", context, idx, data); \
}
SUPER()
#undef GO
@@ -518,7 +518,7 @@ static void* find_context_index_Fct(void* fct)
static uintptr_t my_subscribe_context_fct_##A = 0; \
static void my_subscribe_context_##A(void* context, int evt, uint32_t idx, void* data) \
{ \
- RunFunction(my_context, my_subscribe_context_fct_##A, 4, context, evt, idx, data); \
+ RunFunctionFmt(my_subscribe_context_fct_##A, "piup", context, evt, idx, data); \
}
SUPER()
#undef GO
@@ -541,7 +541,7 @@ static void* find_subscribe_context_Fct(void* fct)
static uintptr_t my_stream_state_fct_##A = 0; \
static void my_stream_state_##A(void* s, void* data) \
{ \
- RunFunction(my_context, my_stream_state_fct_##A, 2, s, data); \
+ RunFunctionFmt(my_stream_state_fct_##A, "pp", s, data); \
}
SUPER()
#undef GO
@@ -563,7 +563,7 @@ static void* find_stream_state_Fct(void* fct)
static uintptr_t my_stream_success_fct_##A = 0; \
static void my_stream_success_##A(void* s, int success, void* data) \
{ \
- RunFunction(my_context, my_stream_success_fct_##A, 3, s, success, data); \
+ RunFunctionFmt(my_stream_success_fct_##A, "pip", s, success, data); \
}
SUPER()
#undef GO
@@ -585,7 +585,7 @@ static void* find_stream_success_Fct(void* fct)
static uintptr_t my_stream_notify_fct_##A = 0; \
static void my_stream_notify_##A(void* s, void* data) \
{ \
- RunFunction(my_context, my_stream_notify_fct_##A, 2, s, data); \
+ RunFunctionFmt(my_stream_notify_fct_##A, "pp", s, data); \
}
SUPER()
#undef GO
@@ -607,7 +607,7 @@ static void* find_stream_notify_Fct(void* fct)
static uintptr_t my_stream_event_fct_##A = 0; \
static void my_stream_event_##A(void* s, void* name, void* pl, void* data) \
{ \
- RunFunction(my_context, my_stream_event_fct_##A, 4, s, name, pl, data); \
+ RunFunctionFmt(my_stream_event_fct_##A, "pppp", s, name, pl, data); \
}
SUPER()
#undef GO
@@ -629,7 +629,7 @@ static void* find_stream_event_Fct(void* fct)
static uintptr_t my_stream_request_fct_##A = 0; \
static void my_stream_request_##A(void* s, size_t nbytes, void* data) \
{ \
- RunFunction(my_context, my_stream_request_fct_##A, 3, s, nbytes, data); \
+ RunFunctionFmt(my_stream_request_fct_##A, "pLp", s, nbytes, data); \
}
SUPER()
#undef GO
@@ -651,7 +651,7 @@ static void* find_stream_request_Fct(void* fct)
static uintptr_t my_device_restore_read_device_formats_fct_##A = 0; \
static void my_device_restore_read_device_formats_##A(void* a, void* b, int c, void* d) \
{ \
- RunFunction(my_context, my_device_restore_read_device_formats_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_device_restore_read_device_formats_fct_##A, "ppip", a, b, c, d); \
}
SUPER()
#undef GO
@@ -673,7 +673,7 @@ static void* find_device_restore_read_device_formats_Fct(void* fct)
static uintptr_t my_card_info_fct_##A = 0; \
static void my_card_info_##A(void* a, void* b, int c, void* d) \
{ \
- RunFunction(my_context, my_card_info_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_card_info_fct_##A, "ppip", a, b, c, d); \
}
SUPER()
#undef GO
@@ -695,7 +695,7 @@ static void* find_card_info_Fct(void* fct)
static uintptr_t my_source_output_info_fct_##A = 0; \
static void my_source_output_info_##A(void* a, void* b, int c, void* d) \
{ \
- RunFunction(my_context, my_source_output_info_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_source_output_info_fct_##A, "ppip", a, b, c, d); \
}
SUPER()
#undef GO
@@ -717,7 +717,7 @@ static void* find_source_output_info_Fct(void* fct)
static uintptr_t my_device_restore_subscribe_fct_##A = 0; \
static void my_device_restore_subscribe_##A(void* a, int b, uint32_t c, void* d) \
{ \
- RunFunction(my_context, my_device_restore_subscribe_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_device_restore_subscribe_fct_##A, "piup", a, b, c, d); \
}
SUPER()
#undef GO
@@ -830,7 +830,7 @@ static void* my_io_new(void* api, int fd, int events, void* cb, void *userdata)
if(cb)
b = AddCheckBridge(bridge, vFppiip, cb, 0, NULL);
if(api==my_mainloop_orig) api=my_mainloop_ref; // need emulated version
- return (void*)RunFunction(my_context, (uintptr_t)my_mainloop_ref->io_new, 5, api, fd, events, b, userdata);
+ return (void*)RunFunctionFmt((uintptr_t)my_mainloop_ref->io_new, "piipp", api, fd, events, b, userdata);
}
static void my_io_enable(void* e, int events)
{
@@ -839,7 +839,7 @@ static void my_io_enable(void* e, int events)
if(fnc)
return ((vFpi_t)fnc)(e, events);
- RunFunction(my_context, (uintptr_t)my_mainloop_ref->io_enable, 2, e, events);
+ RunFunctionFmt((uintptr_t)my_mainloop_ref->io_enable, "pi", e, events);
}
static void my_io_free(void* e)
{
@@ -848,7 +848,7 @@ static void my_io_free(void* e)
if(fnc)
return ((vFp_t)fnc)(e);
- RunFunction(my_context, (uintptr_t)my_mainloop_ref->io_free, 1, e);
+ RunFunctionFmt((uintptr_t)my_mainloop_ref->io_free, "p", e);
}
static void my_io_set_destroy(void* e, void* cb)
{
@@ -864,7 +864,7 @@ static void my_io_set_destroy(void* e, void* cb)
if(!b)
b = AddBridge(bridge, vFppp, cb, 0, NULL);
}
- RunFunction(my_context, (uintptr_t)my_mainloop_ref->io_set_destroy, 2, e, b);
+ RunFunctionFmt((uintptr_t)my_mainloop_ref->io_set_destroy, "pp", e, b);
}
static void* my_time_new(void* api, void* tv, void* cb, void* data)
@@ -882,7 +882,7 @@ static void* my_time_new(void* api, void* tv, void* cb, void* data)
if(cb)
b = AddCheckBridge(bridge, vFpppp, cb, 0, NULL);
if(api==my_mainloop_orig) api=my_mainloop_ref; // need emulated version
- return (void*)RunFunction(my_context, (uintptr_t)my_mainloop_ref->time_new, 4, api, tv, b, data);
+ return (void*)RunFunctionFmt((uintptr_t)my_mainloop_ref->time_new, "pppp", api, tv, b, data);
}
static void my_time_restart(void* e, void* tv)
{
@@ -891,7 +891,7 @@ static void my_time_restart(void* e, void* tv)
if(fnc)
return ((vFpp_t)fnc)(e, tv);
- RunFunction(my_context, (uintptr_t)my_mainloop_ref->time_restart, 2, e, tv);
+ RunFunctionFmt((uintptr_t)my_mainloop_ref->time_restart, "pp", e, tv);
}
static void my_time_free(void* e)
{
@@ -900,7 +900,7 @@ static void my_time_free(void* e)
if(fnc)
return ((vFp_t)fnc)(e);
- RunFunction(my_context, (uintptr_t)my_mainloop_ref->time_free, 1, e);
+ RunFunctionFmt((uintptr_t)my_mainloop_ref->time_free, "p", e);
}
static void my_time_set_destroy(void* e, void* cb)
{
@@ -913,13 +913,21 @@ static void my_time_set_destroy(void* e, void* cb)
uintptr_t b = 0;
if(cb)
b = AddCheckBridge(bridge, vFppp, cb, 0, NULL);
- RunFunction(my_context, (uintptr_t)my_mainloop_ref->time_set_destroy, 2, e, b);
+ RunFunctionFmt((uintptr_t)my_mainloop_ref->time_set_destroy, "pp", e, b);
}
static void* my_defer_new(void* api, void* cb, void* data)
{
uintptr_t b = (uintptr_t)cb;
- void* fnc = GetNativeFnc((uintptr_t)my_mainloop_ref->defer_new);
+ static void* old_defer_new = NULL;
+ static void* old_fnc = NULL;
+ void* fnc = NULL;
+ if(old_defer_new == my_mainloop_ref->defer_new)
+ fnc = old_fnc;
+ else {
+ old_fnc = fnc = GetNativeFnc((uintptr_t)my_mainloop_ref->defer_new);
+ old_defer_new = my_mainloop_ref->defer_new;
+ }
if(fnc) {
if(api==my_mainloop_ref) api=my_mainloop_orig; // need native version
if(fnc==native_defer_new) fnc=my_mainloop_native.defer_new;
@@ -934,7 +942,7 @@ static void* my_defer_new(void* api, void* cb, void* data)
b = AddBridge(bridge, vFppp, cb, 0, NULL);
}
if(api==my_mainloop_orig) api=my_mainloop_ref; // need emulated version
- return (void*)RunFunction(my_context, (uintptr_t)my_mainloop_ref->defer_new, 3, api, b, data);
+ return (void*)RunFunctionFmt((uintptr_t)my_mainloop_ref->defer_new, "ppp", api, b, data);
}
static void my_defer_enable(void* e, int b)
{
@@ -943,7 +951,7 @@ static void my_defer_enable(void* e, int b)
if(fnc)
return ((vFpi_t)fnc)(e, b);
- RunFunction(my_context, (uintptr_t)my_mainloop_ref->defer_enable, 2, e, b);
+ RunFunctionFmt((uintptr_t)my_mainloop_ref->defer_enable, "pi", e, b);
}
static void my_defer_free(void* e)
{
@@ -952,7 +960,7 @@ static void my_defer_free(void* e)
if(fnc)
return ((vFp_t)fnc)(e);
- RunFunction(my_context, (uintptr_t)my_mainloop_ref->defer_free, 1, e);
+ RunFunctionFmt((uintptr_t)my_mainloop_ref->defer_free, "p", e);
}
static void my_defer_set_destroy(void* e, void* cb)
{
@@ -965,7 +973,7 @@ static void my_defer_set_destroy(void* e, void* cb)
uintptr_t b = 0;
if(cb)
b = AddCheckBridge(bridge, vFppp, cb, 0, NULL);
- RunFunction(my_context, (uintptr_t)my_mainloop_ref->defer_set_destroy, 2, e, b);
+ RunFunctionFmt((uintptr_t)my_mainloop_ref->defer_set_destroy, "pp", e, b);
}
static void my_quit(void* api, int retval)
@@ -978,7 +986,7 @@ static void my_quit(void* api, int retval)
}
if(api==my_mainloop_orig) api=my_mainloop_ref; // need emulated version
- RunFunction(my_context, (uintptr_t)my_mainloop_ref->quit, 2, api, retval);
+ RunFunctionFmt((uintptr_t)my_mainloop_ref->quit, "pi", api, retval);
}
static void bridgeMainloopAPI(bridge_t* bridge, my_pa_mainloop_api_t* api)
diff --git a/src/wrapped/wrappedpulse_private.h b/src/wrapped/wrappedpulse_private.h
index 9bc75bd..bceeaac 100755..100644
--- a/src/wrapped/wrappedpulse_private.h
+++ b/src/wrapped/wrappedpulse_private.h
@@ -6,18 +6,18 @@ GO(pa_ascii_filter, pFp)
GO(pa_ascii_valid, pFp)
GO(pa_bytes_per_second, LFp)
GO(pa_bytes_snprint, pFpLu)
-GO(pa_bytes_to_usec, UFUp)
+GO(pa_bytes_to_usec, LFLp)
GO(pa_channel_map_can_balance, iFp)
GO(pa_channel_map_can_fade, iFp)
GO(pa_channel_map_compatible, iFpp)
GO(pa_channel_map_equal, iFpp)
GO(pa_channel_map_init, pFp)
GO(pa_channel_map_init_auto, pFpui)
-GO(pa_channel_map_init_extend, pFpui)
+GO(pa_channel_map_init_extend, pFpuu)
GO(pa_channel_map_init_mono, pFp)
GO(pa_channel_map_init_stereo, pFp)
GO(pa_channel_map_parse, pFpp)
-GO(pa_channel_map_snprint, pFpup)
+GO(pa_channel_map_snprint, pFpLp)
GO(pa_channel_map_superset, iFpp)
GO(pa_channel_map_to_name, pFp)
GO(pa_channel_map_to_pretty_name, pFp)
@@ -58,7 +58,7 @@ GOM(pa_context_get_source_info_by_name, pFEpppp)
GOM(pa_context_get_source_info_list, pFEppp)
GOM(pa_context_get_source_output_info, pFEpupp)
GOM(pa_context_get_source_output_info_list, pFEppp)
-GO(pa_context_get_state, iFp)
+GO(pa_context_get_state, uFp)
GO(pa_context_is_local, iFp)
GO(pa_context_is_pending, iFp)
//GO(pa_context_kill_client,
@@ -158,22 +158,22 @@ GO(pa_mainloop_quit, vFpi)
GO(pa_mainloop_run, iFpp)
GOM(pa_mainloop_set_poll_func, vFEppp) //B is typedef int(*pa_poll_func) (struct pollfd *ufds, unsigned long nfds, int timeout, void *userdata)
GO(pa_mainloop_wakeup, vFp)
-//GO(pa_msleep,
+GO(pa_msleep, iFL)
GO(pa_operation_cancel, vFp)
-GO(pa_operation_get_state, iFp)
+GO(pa_operation_get_state, uFp)
GO(pa_operation_ref, pFp)
GO(pa_operation_unref, vFp)
GO(pa_parse_sample_format, iFp)
GO(pa_path_get_filename, pFp)
-//GO(pa_proplist_clear,
-//GO(pa_proplist_contains,
-//GO(pa_proplist_copy,
+GO(pa_proplist_clear, vFp)
+GO(pa_proplist_contains, iFpp)
+GO(pa_proplist_copy, pFp)
GO(pa_proplist_free, vFp)
-//GO(pa_proplist_from_string,
-//GO(pa_proplist_get,
+GO(pa_proplist_from_string, pFp)
+GO(pa_proplist_get, iFpppp)
GO(pa_proplist_gets, pFpp)
-//GO(pa_proplist_isempty,
-//GO(pa_proplist_iterate,
+GO(pa_proplist_isempty, iFp)
+GO(pa_proplist_iterate, pFpp)
GO(pa_proplist_new, pFv)
GO(pa_proplist_set, iFpppL)
GOM(pa_proplist_setf, iFEpppV)
@@ -183,10 +183,10 @@ GO(pa_proplist_to_string, pFp)
GO(pa_proplist_to_string_sep, pFpp)
GO(pa_proplist_unset, iFpp)
GO(pa_proplist_unset_many, iFpp)
-GO(pa_proplist_update, vFpip)
+GO(pa_proplist_update, vFpup)
GO(pa_sample_format_to_string, pFi)
GO(pa_sample_size, LFp)
-GO(pa_sample_size_of_format, LFp)
+GO(pa_sample_size_of_format, LFi)
GO(pa_sample_spec_equal, iFpp)
GO(pa_sample_spec_init, pFp)
GO(pa_sample_spec_snprint, pFpLp)
@@ -196,8 +196,8 @@ GO(pa_signal_free, vFp)
GOM(pa_signal_init, iFEp)
GOM(pa_signal_new, pFEipp)
GOM(pa_signal_set_destroy, vFEpp)
-GO(pa_stream_connect_playback, iFpppipp)
-GO(pa_stream_connect_record, iFpppi)
+GO(pa_stream_connect_playback, iFpppupp)
+GO(pa_stream_connect_record, iFpppu)
GO(pa_stream_connect_upload, iFpL)
GOM(pa_stream_cork, pFEpipp)
GO(pa_stream_disconnect, iFp)
@@ -214,7 +214,7 @@ GO(pa_stream_get_index, uFp)
GO(pa_stream_get_latency, iFppp)
GO(pa_stream_get_monitor_stream, uFp)
GO(pa_stream_get_sample_spec, pFp)
-GO(pa_stream_get_state, iFp)
+GO(pa_stream_get_state, uFp)
GO(pa_stream_get_time, iFpp)
GO(pa_stream_get_timing_info, pFp)
GO(pa_stream_is_corked, iFp)
@@ -255,7 +255,7 @@ GO(pa_sw_volume_divide, uFuu)
GO(pa_sw_volume_from_dB, uFd)
GO(pa_sw_volume_from_linear, uFd)
GO(pa_sw_volume_multiply, uFuu)
-GO(pa_sw_volume_snprint_dB, pFpuu)
+GO(pa_sw_volume_snprint_dB, pFpLu)
GO(pa_sw_volume_to_dB, dFu)
GO(pa_sw_volume_to_linear, dFu)
GO(pa_threaded_mainloop_accept, vFp)
@@ -273,11 +273,11 @@ GO(pa_threaded_mainloop_wait, vFp)
GO(pa_timeval_add, pFpU)
GO(pa_timeval_age, UFp)
GO(pa_timeval_cmp, iFpp)
-GO(pa_timeval_diff, UFpp)
-GO(pa_timeval_load, UFp)
-GO(pa_timeval_store, pFpU)
+GO(pa_timeval_diff, LFpp)
+GO(pa_timeval_load, LFp)
+GO(pa_timeval_store, pFpL)
GO(pa_timeval_sub, pFpU)
-GO(pa_usec_to_bytes, uFUp)
+GO(pa_usec_to_bytes, LFLp)
GO(pa_utf8_filter, pFp)
GO(pa_utf8_to_locale, pFp)
GO(pa_utf8_valid, pFp)
@@ -294,4 +294,4 @@ GO(pa_stream_begin_write, iFppp) // 0.9.16+
GO(pa_stream_cancel_write, iFp) // 0.9.16+
GO(dummy_io_new, pFpiipp) // dumy function to create Wrapper
-GO(dummy_io_new2, vFppiip) // and another one \ No newline at end of file
+GO(dummy_io_new2, vFppiip) // and another one
diff --git a/src/wrapped/wrappedpulsesimple.c b/src/wrapped/wrappedpulsesimple.c
index 1fd5681..1fd5681 100755..100644
--- a/src/wrapped/wrappedpulsesimple.c
+++ b/src/wrapped/wrappedpulsesimple.c
diff --git a/src/wrapped/wrappedpulsesimple_private.h b/src/wrapped/wrappedpulsesimple_private.h
index fb602d8..fb602d8 100755..100644
--- a/src/wrapped/wrappedpulsesimple_private.h
+++ b/src/wrapped/wrappedpulsesimple_private.h
diff --git a/src/wrapped/wrappedsdl1.c b/src/wrapped/wrappedsdl1.c
index 4ebfb31..50f3e1b 100755..100644
--- a/src/wrapped/wrappedsdl1.c
+++ b/src/wrapped/wrappedsdl1.c
@@ -73,7 +73,7 @@ GO(4)
static uintptr_t my_AudioCallback_fct_##A = 0; \
static void my_AudioCallback_##A(void *userdata, uint8_t *stream, int32_t len) \
{ \
- RunFunction(my_context, my_AudioCallback_fct_##A, 3, userdata, stream, len); \
+ RunFunctionFmt(my_AudioCallback_fct_##A, "pCi", userdata, stream, len); \
}
SUPER()
#undef GO
@@ -95,7 +95,7 @@ static void* find_AudioCallback_Fct(void* fct)
static uintptr_t my_TimerCallback_fct_##A = 0; \
static uint32_t my_TimerCallback_##A(uint32_t interval, void *userdata) \
{ \
- return (uint32_t)RunFunction(my_context, my_TimerCallback_fct_##A, 2, interval, userdata); \
+ return (uint32_t)RunFunctionFmt(my_TimerCallback_fct_##A, "up", interval, userdata); \
}
SUPER()
#undef GO
@@ -117,7 +117,7 @@ static void* find_TimerCallback_Fct(void* fct)
static uintptr_t my_EvtFilter_fct_##A = 0; \
static int my_EvtFilter_##A(void* p) \
{ \
- return RunFunction(my_context, my_EvtFilter_fct_##A, 1, p); \
+ return RunFunctionFmt(my_EvtFilter_fct_##A, "p", p); \
}
SUPER()
#undef GO
@@ -350,7 +350,7 @@ EXPORT void my_SDL_KillThread(x64emu_t* emu, void* p)
my->SDL_KillThread(p);
}
-EXPORT void* my_SDL_GL_GetProcAddress(x64emu_t* emu, void* name)
+EXPORT void* my_SDL_GL_GetProcAddress(x64emu_t* emu, void* name)
{
khint_t k;
const char* rname = (const char*)name;
diff --git a/src/wrapped/wrappedsdl1_private.h b/src/wrapped/wrappedsdl1_private.h
index 35e0e78..1130b4b 100755..100644
--- a/src/wrapped/wrappedsdl1_private.h
+++ b/src/wrapped/wrappedsdl1_private.h
@@ -1,4 +1,6 @@
-#if defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error Meh...
+#endif
// _fini
// _init
@@ -38,8 +40,8 @@ GO(SDL_DisplayFormatAlpha, pFp)
GO(SDL_DisplayYUVOverlay, iFpp)
GO(SDL_EnableKeyRepeat, iFii)
GO(SDL_EnableUNICODE, iFi)
-GO(SDL_Error, vFi)
-GO(SDL_EventState, uFui)
+GO(SDL_Error, vFu)
+GO(SDL_EventState, CFCi)
GO(SDL_FillRect, iFppu)
GO(SDL_Flip, iFp)
GO(SDL_FreeCursor, vFp)
@@ -54,20 +56,20 @@ GO(SDL_GL_SetAttribute, iFui)
GO(SDL_GL_SwapBuffers, vFv)
GO(SDL_GL_Unlock, vFv)
GO(SDL_GL_UpdateRects, vFip)
-GO(SDL_GetAppState, uFv)
+GO(SDL_GetAppState, CFv)
GO(SDL_GetClipRect, vFpp)
GO(SDL_GetCursor, pFv)
GO(SDL_GetError, pFv)
GOM(SDL_GetEventFilter, pFEv)
GO(SDL_GetGammaRamp, iFppp)
-GO(SDL_GetKeyName, pFi)
+GO(SDL_GetKeyName, pFu)
GO(SDL_GetKeyRepeat, vFpp)
GO(SDL_GetKeyState, pFp)
-GO(SDL_GetModState, iFv)
+GO(SDL_GetModState, uFv)
GO(SDL_GetMouseState, uFpp)
GO(SDL_GetRGB, vFupppp)
GO(SDL_GetRGBA, vFuppppp)
-GO(SDL_GetRelativeMouseState, uFpp)
+GO(SDL_GetRelativeMouseState, CFpp)
GO(SDL_GetThreadID, uFp)
GO(SDL_GetTicks, uFv)
GO(SDL_GetVideoInfo, pFv)
@@ -86,9 +88,9 @@ GO(SDL_InitQuickDraw, vFp)
GO(SDL_InitSubSystem, iFu)
GO(SDL_JoystickClose, vFp)
GO(SDL_JoystickEventState, iFi)
-GO(SDL_JoystickGetAxis, iFpi)
+GO(SDL_JoystickGetAxis, wFpi)
GO(SDL_JoystickGetBall, iFpipp)
-GO(SDL_JoystickGetButton, uFpi)
+GO(SDL_JoystickGetButton, CFpi)
GO(SDL_JoystickGetHat, uFpi)
GO(SDL_JoystickIndex, iFp)
GO(SDL_JoystickName, pFi)
@@ -108,10 +110,10 @@ GOM(SDL_LoadObject, pFEp)
GO(SDL_LockSurface, iFp)
GO(SDL_LockYUVOverlay, iFp)
GO(SDL_LowerBlit, iFpppp)
-GO(SDL_MapRGB, uFpuuu)
-GO(SDL_MapRGBA, uFpuuuu)
+GO(SDL_MapRGB, uFpCCC)
+GO(SDL_MapRGBA, uFpCCCC)
GO(SDL_NumJoysticks, iFv)
-GO(SDL_PeepEvents, iFpiiu)
+GO(SDL_PeepEvents, iFpiuu)
GO(SDL_PollEvent, iFp)
GO(SDL_PumpEvents, vFv)
GO(SDL_PushEvent, iFp)
@@ -135,8 +137,8 @@ GO(SDL_SemTryWait, iFp)
GO(SDL_SemValue, uFp)
GO(SDL_SemWait, iFp)
GO(SDL_SemWaitTimeout, iFpu)
-GO(SDL_SetAlpha, iFpuu)
-GO(SDL_SetClipRect, iFpp)
+GO(SDL_SetAlpha, iFpuC)
+GO(SDL_SetClipRect, uFpp)
GO(SDL_SetColorKey, iFpuu)
GO(SDL_SetColors, iFppii)
GO(SDL_SetCursor, vFp)
@@ -144,7 +146,7 @@ GO(SDL_SetError, vFpppppp) // use ..., so putting arbitrary number of argum
GOM(SDL_SetEventFilter, vFEp)
GO(SDL_SetGamma, iFfff)
GO(SDL_SetGammaRamp, iFppp)
-GO(SDL_SetModState, vFi)
+GO(SDL_SetModState, vFu)
GO(SDL_SetModuleHandle, vFp)
GO(SDL_SetPalette, iFpipii)
GOM(SDL_SetTimer, iFEup)
@@ -156,7 +158,7 @@ GOM(SDL_UnloadObject, vFEp)
GO(SDL_UnlockSurface, vFp)
GO(SDL_UnlockYUVOverlay, vFp)
GO(SDL_UnregisterApp, vFv)
-GO(SDL_UpdateRect, vFpiiii)
+GO(SDL_UpdateRect, vFpiiuu)
GO(SDL_UpdateRects, vFpip)
GO(SDL_UpperBlit, iFpppp)
GO(SDL_VideoDriverName, pFpi)
@@ -182,18 +184,18 @@ GOM(SDL_WriteLE64, uFEpU)
GO(SDL_framerateDelay, uFp)
GO(SDL_getFramecount, iFp)
GO(SDL_getFramerate, iFp)
-GO(SDL_iconv, uFppppp)
+GO(SDL_iconv, LFppppp)
GO(SDL_iconv_close, iFp)
GO(SDL_iconv_open, pFpp)
-GO(SDL_iconv_string, pFpppu)
+GO(SDL_iconv_string, pFpppL)
GO(SDL_initFramerate, vFp)
-GO(SDL_lltoa, pFIpi)
-GO(SDL_ltoa, pFipi)
+GO(SDL_lltoa, pFlpi)
+GO(SDL_ltoa, pFlpi)
GO(SDL_main, iFip)
GO(SDL_memcmp, iFppu)
GO(SDL_mutexP, iFp)
GO(SDL_mutexV, iFp)
-GO(SDL_revcpy, pFppu)
+GO(SDL_revcpy, pFppL)
GO(SDL_setFramerate, iFpu)
GO(SDL_snprintf, iFpupppppp) // use ...
GO(SDL_sscanf, iFppppppp) // use ...
@@ -201,7 +203,7 @@ GO(SDL_strcasecmp, iFpp)
GO(SDL_strchr, pFpi)
GO(SDL_strcmp, iFpp)
GO(SDL_strdup, pFp)
-GO(SDL_strlcat, uFppu)
+GO(SDL_strlcat, LFppL)
GO(SDL_strlcpy, uFppu)
GO(SDL_strlen, uFp)
GO(SDL_strlwr, pFp)
@@ -216,23 +218,21 @@ GO(SDL_strtoll, IFppi)
GO(SDL_strtoul, uFppi)
GO(SDL_strtoull, UFppi)
GO(SDL_strupr, pFp)
-GO(SDL_ulltoa, pFUpi)
-GO(SDL_ultoa, pFupi)
+GO(SDL_ulltoa, pFLpi)
+GO(SDL_ultoa, pFLpi)
GO(SDL_vsnprintf, iFpupV)
GOM(SDL_OpenAudio, iFEpp)
GO(SDL_LockAudio, vFv)
GO(SDL_UnlockAudio, vFv)
GO(SDL_PauseAudio, vFi)
-GO(SDL_GetAudioStatus, iFv)
+GO(SDL_GetAudioStatus, uFv)
GO(SDL_LoadWAV, pFpppp)
GO(SDL_FreeWAV, vFp)
GOM(SDL_LoadWAV_RW, pFEpippp)
-GO(SDL_BuildAudioCVT, iFpuuiuui)
+GO(SDL_BuildAudioCVT, iFpWCiWCi)
GO(SDL_ConvertAudio, iFp)
GO(SDL_AudioInit, iFp)
GO(SDL_AudioQuit, vFv) // should free callback
GO(SDL_MixAudio, vFppui)
GO(SDL_CloseAudio, vFv) // should free callback
GO(SDL_AudioDriverName, pFpi)
-
-#endif \ No newline at end of file
diff --git a/src/wrapped/wrappedsdl1image.c b/src/wrapped/wrappedsdl1image.c
index 66eda2c..ad405d9 100755..100644
--- a/src/wrapped/wrappedsdl1image.c
+++ b/src/wrapped/wrappedsdl1image.c
@@ -24,7 +24,7 @@ const char* sdl1imageName = "libSDL_image-1.2.so.0";
#include "wrappercallback.h"
-#define GO(A) \
+#define GO(A) \
void EXPORT *my_##A(x64emu_t* emu, void* a) \
{ \
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); \
diff --git a/src/wrapped/wrappedsdl1image_private.h b/src/wrapped/wrappedsdl1image_private.h
index 8617d69..c336bc9 100755..100644
--- a/src/wrapped/wrappedsdl1image_private.h
+++ b/src/wrapped/wrappedsdl1image_private.h
@@ -1,4 +1,6 @@
-#if defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error Meh...
+#endif
GO(IMG_Init,iFi)
GO(IMG_InvertAlpha,iFi)
@@ -37,5 +39,3 @@ GO(IMG_isWEBP,iFp)
GO(IMG_isXCF,iFp)
GO(IMG_isXPM,iFp)
GO(IMG_isXV,iFp)
-
-#endif \ No newline at end of file
diff --git a/src/wrapped/wrappedsdl1mixer.c b/src/wrapped/wrappedsdl1mixer.c
index 9538aac..d9287be 100755..100644
--- a/src/wrapped/wrappedsdl1mixer.c
+++ b/src/wrapped/wrappedsdl1mixer.c
@@ -37,7 +37,7 @@ GO(4)
static uintptr_t my_EffectFunc_fct_##A = 0; \
static void my_EffectFunc_##A(int chan, void *stream, int len, void *udata) \
{ \
- RunFunction(my_context, my_EffectFunc_fct_##A, 4, chan, stream, len, udata); \
+ RunFunctionFmt(my_EffectFunc_fct_##A, "ipip", chan, stream, len, udata); \
}
SUPER()
#undef GO
@@ -61,7 +61,7 @@ static void* find_EffectFunc_Fct(void* fct)
static uintptr_t my_EffectDone_fct_##A = 0; \
static void my_EffectDone_##A(int chan, void *udata) \
{ \
- RunFunction(my_context, my_EffectDone_fct_##A, 2, chan, udata); \
+ RunFunctionFmt(my_EffectDone_fct_##A, "ip", chan, udata); \
}
SUPER()
#undef GO
@@ -85,7 +85,7 @@ static void* find_EffectDone_Fct(void* fct)
static uintptr_t my_MixFunc_fct_##A = 0; \
static void my_MixFunc_##A(void *udata, uint8_t *stream, int len) \
{ \
- RunFunction(my_context, my_MixFunc_fct_##A, 3, udata, stream, len); \
+ RunFunctionFmt(my_MixFunc_fct_##A, "ppi", udata, stream, len); \
}
SUPER()
#undef GO
@@ -109,7 +109,7 @@ static void* find_MixFunc_Fct(void* fct)
static uintptr_t my_ChannelFinished_fct_##A = 0; \
static void my_ChannelFinished_##A(int channel) \
{ \
- RunFunction(my_context, my_ChannelFinished_fct_##A, 1, channel); \
+ RunFunctionFmt(my_ChannelFinished_fct_##A, "i", channel); \
}
SUPER()
#undef GO
@@ -133,7 +133,7 @@ static void* find_ChannelFinished_Fct(void* fct)
static uintptr_t my_MusicFinished_fct_##A = 0; \
static void my_MusicFinished_##A() \
{ \
- RunFunction(my_context, my_MusicFinished_fct_##A, 0); \
+ RunFunctionFmt(my_MusicFinished_fct_##A, ""); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedsdl1mixer_private.h b/src/wrapped/wrappedsdl1mixer_private.h
index 3cca15a..730da35 100755..100644
--- a/src/wrapped/wrappedsdl1mixer_private.h
+++ b/src/wrapped/wrappedsdl1mixer_private.h
@@ -1,4 +1,6 @@
-#if defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error Meh...
+#endif
GO(Mix_AllocateChannels,iFi)
GOM(Mix_ChannelFinished,vFEp)
@@ -11,15 +13,15 @@ GO(Mix_FadeInMusicPos,iFpiid)
GO(Mix_FadeOutChannel,iFii)
GO(Mix_FadeOutGroup,iFii)
GO(Mix_FadeOutMusic,iFi)
-GO(Mix_FadingChannel,iFi)
-GO(Mix_FadingMusic,iFv)
+GO(Mix_FadingChannel, uFi)
+GO(Mix_FadingMusic, uFv)
GO(Mix_FreeChunk,vFp)
GO(Mix_FreeMusic,vFp)
GO(Mix_GetChunk,pFi)
GO(Mix_GetChunkDecoder,pFi)
GO(Mix_GetMusicDecoder,pFi)
GO(Mix_GetMusicHookData,pFv)
-GO(Mix_GetMusicType,iFp)
+GO(Mix_GetMusicType, uFp)
GO(Mix_GetNumChunkDecoders,iFv)
GO(Mix_GetNumMusicDecoders,iFv)
GO(Mix_GetSoundFonts,pFv)
@@ -41,7 +43,7 @@ GO(Mix_LoadMUS,pFp)
GOM(Mix_LoadMUSType_RW,pFEpii)
GOM(Mix_LoadMUS_RW,pFEp)
GOM(Mix_LoadWAV_RW,pFEpi)
-GO(Mix_OpenAudio,iFiuii)
+GO(Mix_OpenAudio, iFiWii)
GO(Mix_Pause,vFi)
GO(Mix_PauseMusic,vFv)
GO(Mix_Paused,iFi)
@@ -59,11 +61,11 @@ GO(Mix_ReserveChannels,iFi)
GO(Mix_Resume,vFi)
GO(Mix_ResumeMusic,vFv)
GO(Mix_RewindMusic,vFv)
-GO(Mix_SetDistance,iFiu)
+GO(Mix_SetDistance, iFiC)
GO(Mix_SetMusicCMD,iFp)
GO(Mix_SetMusicPosition,iFd)
-GO(Mix_SetPanning,iFiuu)
-GO(Mix_SetPosition,iFiiu)
+GO(Mix_SetPanning, iFiCC)
+GO(Mix_SetPosition, iFiwC)
GOM(Mix_SetPostMix,vFEpp)
GO(Mix_SetReverseStereo,iFii)
GO(Mix_SetSoundFonts,iFp)
@@ -73,5 +75,3 @@ GOM(Mix_UnregisterEffect,iFEip)
GO(Mix_Volume,iFii)
GO(Mix_VolumeChunk,iFpi)
GO(Mix_VolumeMusic,iFi)
-
-#endif \ No newline at end of file
diff --git a/src/wrapped/wrappedsdl1net.c b/src/wrapped/wrappedsdl1net.c
index ee16dbe..ee16dbe 100755..100644
--- a/src/wrapped/wrappedsdl1net.c
+++ b/src/wrapped/wrappedsdl1net.c
diff --git a/src/wrapped/wrappedsdl1net_private.h b/src/wrapped/wrappedsdl1net_private.h
index 6986d4d..29bcd05 100755..100644
--- a/src/wrapped/wrappedsdl1net_private.h
+++ b/src/wrapped/wrappedsdl1net_private.h
@@ -42,4 +42,4 @@ GO(SDLNet_UDP_SetPacketLoss, vFpi)
GO(SDLNet_UDP_Unbind, vFpi)
GO(SDLNet_Write16, vFWp)
GO(SDLNet_Write32, vFup)
-GO(SDLNet_version, pFv) \ No newline at end of file
+GO(SDLNet_version, pFv)
diff --git a/src/wrapped/wrappedsdl1sound.c b/src/wrapped/wrappedsdl1sound.c
index e77d2a0..e77d2a0 100755..100644
--- a/src/wrapped/wrappedsdl1sound.c
+++ b/src/wrapped/wrappedsdl1sound.c
diff --git a/src/wrapped/wrappedsdl1sound_private.h b/src/wrapped/wrappedsdl1sound_private.h
index 1efad54..1efad54 100755..100644
--- a/src/wrapped/wrappedsdl1sound_private.h
+++ b/src/wrapped/wrappedsdl1sound_private.h
diff --git a/src/wrapped/wrappedsdl1ttf.c b/src/wrapped/wrappedsdl1ttf.c
index d0bb80c..d0bb80c 100755..100644
--- a/src/wrapped/wrappedsdl1ttf.c
+++ b/src/wrapped/wrappedsdl1ttf.c
diff --git a/src/wrapped/wrappedsdl1ttf_private.h b/src/wrapped/wrappedsdl1ttf_private.h
index a115d99..825e5d6 100755..100644
--- a/src/wrapped/wrappedsdl1ttf_private.h
+++ b/src/wrapped/wrappedsdl1ttf_private.h
@@ -8,21 +8,21 @@ GO(TTF_FontAscent, iFp)
GO(TTF_FontDescent, iFp)
GO(TTF_FontFaceFamilyName, pFp)
GO(TTF_FontFaceIsFixedWidth, iFp)
-GO(TTF_FontFaces, iFp)
+GO(TTF_FontFaces, lFp)
GO(TTF_FontFaceStyleName, pFp)
GO(TTF_FontHeight, iFp)
GO(TTF_FontLineSkip, iFp)
GO(TTF_GetFontHinting, iFp)
GO(TTF_GetFontKerning, iFp)
-GO(TTF_GetFontKerningSize, iFp)
+GO(TTF_GetFontKerningSize, iFpii)
GO(TTF_GetFontOutline, iFp)
GO(TTF_GetFontStyle, iFp)
-GO(TTF_GlyphIsProvided, iFpu)
-GO(TTF_GlyphMetrics, iFpuppppp)
+GO(TTF_GlyphIsProvided, iFpW)
+GO(TTF_GlyphMetrics, iFpWppppp)
GO(TTF_Init, iFv)
GO(TTF_Linked_Version, pFv)
GO(TTF_OpenFont, pFpi)
-GO(TTF_OpenFontIndex, pFpii)
+GO(TTF_OpenFontIndex, pFpil)
GOM(TTF_OpenFontIndexRW, pFEpiii)
GOM(TTF_OpenFontRW, pFEpii)
GO(TTF_Quit, vFv)
diff --git a/src/wrapped/wrappedsdl2.c b/src/wrapped/wrappedsdl2.c
index 2e665e9..8f0710f 100755..100644
--- a/src/wrapped/wrappedsdl2.c
+++ b/src/wrapped/wrappedsdl2.c
@@ -104,7 +104,7 @@ GO(4)
static uintptr_t my_Timer_fct_##A = 0; \
static uint64_t my_Timer_##A(uint64_t a, void* b) \
{ \
- return (uint64_t)RunFunction(my_context, my_Timer_fct_##A, 2, a, b); \
+ return (uint64_t)RunFunctionFmt(my_Timer_fct_##A, "Up", a, b); \
}
SUPER()
#undef GO
@@ -121,14 +121,14 @@ static void* find_Timer_Fct(void* fct)
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for SDL2 Timer callback\n");
return NULL;
-
+
}
// AudioCallback
#define GO(A) \
static uintptr_t my_AudioCallback_fct_##A = 0; \
static void my_AudioCallback_##A(void* a, void* b, int c) \
{ \
- RunFunction(my_context, my_AudioCallback_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_AudioCallback_fct_##A, "ppi", a, b, c); \
}
SUPER()
#undef GO
@@ -145,14 +145,14 @@ static void* find_AudioCallback_Fct(void* fct)
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for SDL2 AudioCallback callback\n");
return NULL;
-
+
}
// eventfilter
#define GO(A) \
static uintptr_t my_eventfilter_fct_##A = 0; \
static int my_eventfilter_##A(void* userdata, void* event) \
{ \
- return (int)RunFunction(my_context, my_eventfilter_fct_##A, 2, userdata, event); \
+ return (int)RunFunctionFmt(my_eventfilter_fct_##A, "pp", userdata, event); \
}
SUPER()
#undef GO
@@ -169,7 +169,7 @@ static void* find_eventfilter_Fct(void* fct)
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for SDL2 eventfilter callback\n");
return NULL;
-
+
}
static void* reverse_eventfilter_Fct(void* fct)
{
@@ -187,7 +187,7 @@ static void* reverse_eventfilter_Fct(void* fct)
static uintptr_t my_LogOutput_fct_##A = 0; \
static void my_LogOutput_##A(void* a, int b, int c, void* d) \
{ \
- RunFunction(my_context, my_LogOutput_fct_##A, 4, a, b, c, d); \
+ RunFunctionFmt(my_LogOutput_fct_##A, "piip", a, b, c, d); \
}
SUPER()
#undef GO
@@ -552,7 +552,7 @@ static int get_sdl_priv(x64emu_t* emu, const char *sym_str, void **w, void **f)
}
#define GOS(sym, _w) GOM(sym, _w)
#define DATA
-
+
if(0);
#include "wrappedsdl2_private.h"
@@ -570,7 +570,7 @@ int EXPORT my2_SDL_DYNAPI_entry(x64emu_t* emu, uint32_t version, uintptr_t *tabl
uintptr_t tab[tablesize];
int r = my->SDL_DYNAPI_entry(version, tab, tablesize);
(void)r;
-
+
#define SDL_DYNAPI_PROC(ret, sym, args, parms, ...) \
if (i < tablesize) { \
void *w = NULL; \
@@ -646,7 +646,7 @@ EXPORT void my2_SDL_Log(x64emu_t* emu, void* fmt, void *b) {
my->SDL_LogMessageV(0, 3, fmt, VARARGS);
}
-EXPORT void* my2_SDL_GL_GetProcAddress(x64emu_t* emu, void* name)
+EXPORT void* my2_SDL_GL_GetProcAddress(x64emu_t* emu, void* name)
{
khint_t k;
const char* rname = (const char*)name;
@@ -667,7 +667,7 @@ static uintptr_t dtor_emu[nb_once] = {0};
static void tls_dtor_callback(int n, void* a)
{
if(dtor_emu[n]) {
- RunFunction(my_context, dtor_emu[n], 1, a);
+ RunFunctionFmt(dtor_emu[n], "p", a);
}
}
#define GO(N) \
diff --git a/src/wrapped/wrappedsdl2_private.h b/src/wrapped/wrappedsdl2_private.h
index 7670c4a..6696fab 100755..100644
--- a/src/wrapped/wrappedsdl2_private.h
+++ b/src/wrapped/wrappedsdl2_private.h
@@ -24,14 +24,14 @@ GO(SDL_atanf, fFf)
GO(SDL_atof, dFp)
GO(SDL_atoi, iFp)
GO(SDL_AtomicAdd, iFpi)
-GO(SDL_AtomicCAS, iFpii)
-GO(SDL_AtomicCASPtr, iFppp)
+GO(SDL_AtomicCAS, uFpii)
+GO(SDL_AtomicCASPtr, uFppp)
GO(SDL_AtomicGet, iFp)
GO(SDL_AtomicGetPtr, pFp)
GO(SDL_AtomicLock, vFp)
GO(SDL_AtomicSet, iFpi)
GO(SDL_AtomicSetPtr, pFpp)
-GO(SDL_AtomicTryLock, iFp)
+GO(SDL_AtomicTryLock, uFp)
GO(SDL_AtomicUnlock, vFp)
GO(SDL_AudioInit, iFp)
GO(SDL_AudioQuit, vFv)
@@ -40,18 +40,18 @@ GO(SDL_AudioStreamClear, vFp)
GO(SDL_AudioStreamFlush, iFp)
GO(SDL_AudioStreamGet, iFppi)
GO(SDL_AudioStreamPut, iFppi)
-GO(SDL_BuildAudioCVT, iFpuuiuui)
+GO(SDL_BuildAudioCVT, iFpWCiWCi)
GO(SDL_CalculateGammaRamp, vFfp)
-GO(SDL_calloc, pFuu)
-GO(SDL_CaptureMouse, iFi)
+GO(SDL_calloc, pFLL)
+GO(SDL_CaptureMouse, iFu)
GO(SDL_ceil, dFd)
GO(SDL_ceilf, fFf)
GO(SDL_ClearError, vFv)
GO(SDL_ClearHints, vFv)
GO(SDL_ClearQueuedAudio, vFu)
GO(SDL_CloseAudio, vFv)
-GO(SDL_CloseAudioDevice, vFi)
-GO(SDL_ComposeCustomBlendMode, iFiiiiii)
+GO(SDL_CloseAudioDevice, vFu)
+GO(SDL_ComposeCustomBlendMode, uFuuuuuu)
GO(SDL_CondBroadcast, iFp)
GO(SDL_CondSignal, iFp)
GO(SDL_CondWait, iFpp)
@@ -99,8 +99,8 @@ GO(SDL_DisableScreenSaver, vFv)
GO(SDL_DuplicateSurface, pFp)
GOM(SDL_DYNAPI_entry, iFEupu)
GO(SDL_EnableScreenSaver, vFv)
-GO(SDL_EnclosePoints, iFpipp)
-GO(SDL_Error, iFi)
+GO(SDL_EnclosePoints, uFpipp)
+GO(SDL_Error, iFu)
GO(SDL_EventState, CFui)
GO(SDL_exp, dFd)
GO(SDL_expf, fFf)
@@ -130,12 +130,12 @@ GO(SDL_GameControllerEventState, iFi)
GO(SDL_GameControllerFromInstanceID, pFi)
GO(SDL_GameControllerFromPlayerIndex, pFi)
GO(SDL_GameControllerGetAttached, iFp)
-GO(SDL_GameControllerGetAxis, iFpi)
-GO(SDL_GameControllerGetAxisFromString, uFp)
+GO(SDL_GameControllerGetAxis, wFpi)
+GO(SDL_GameControllerGetAxisFromString, iFp)
GO(SDL_GameControllerGetBindForAxis, HFpi)
GO(SDL_GameControllerGetBindForButton, HFpi)
-GO(SDL_GameControllerGetButton, uFpi)
-GO(SDL_GameControllerGetButtonFromString, uFp)
+GO(SDL_GameControllerGetButton, CFpi)
+GO(SDL_GameControllerGetButtonFromString, iFp)
GO(SDL_GameControllerGetJoystick, pFp)
GO(SDL_GameControllerGetNumTouchpads, iFp)
GO(SDL_GameControllerGetNumTouchpadFingers, iFpi)
@@ -144,15 +144,15 @@ GO(SDL_GameControllerGetProduct, WFp)
GO(SDL_GameControllerGetProductVersion, WFp)
GO(SDL_GameControllerGetSensorData, iFpipi)
GO(SDL_GameControllerGetSerial, pFp)
-GO(SDL_GameControllerGetStringForAxis, pFp)
-GO(SDL_GameControllerGetStringForButton, pFu)
+GO(SDL_GameControllerGetStringForAxis, pFi)
+GO(SDL_GameControllerGetStringForButton, pFi)
GO(SDL_GameControllerGetTouchpadFinger, iFpiipppp)
-GO(SDL_GameControllerGetType, iFp)
+GO(SDL_GameControllerGetType, uFp)
GO(SDL_GameControllerGetVendor, WFp)
-GO(SDL_GameControllerHasButton, iFpi)
+GO(SDL_GameControllerHasButton, uFpi)
GO(SDL_GameControllerHasLED, iFp)
GO(SDL_GameControllerHasSensor, iFpi)
-GO(SDL_GameControllerIsSensorEnabled, iFpi)
+GO(SDL_GameControllerIsSensorEnabled, uFpi)
GO(SDL_GameControllerMapping, pFp)
GO(SDL_GameControllerMappingForDeviceIndex, pFi)
GO(SDL_GameControllerMappingForGUID, pFpp)
@@ -165,16 +165,16 @@ GO(SDL_GameControllerRumble, iFpWWu)
GO(SDL_GameControllerRumbleTriggers, iFpWWu)
GO(SDL_GameControllerSetLED, iFpCCC)
GO(SDL_GameControllerSetPlayerIndex, vFpi)
-GO(SDL_GameControllerSetSensorEnabled, iFpii)
-GO(SDL_GameControllerTypeForIndex, iFi)
+GO(SDL_GameControllerSetSensorEnabled, iFpiu)
+GO(SDL_GameControllerTypeForIndex, uFi)
GO(SDL_GameControllerUpdate, vFv)
// SDL_GetAssertionHandler
GO(SDL_GetAssertionReport, pFv)
GO(SDL_GetAudioDeviceName, pFii)
-GO(SDL_GetAudioDeviceStatus, iFi)
+GO(SDL_GetAudioDeviceStatus, uFu)
GO(SDL_GetAudioDriver, pFi)
GO(SDL_GetAudioDeviceSpec, iFiip)
-GO(SDL_GetAudioStatus, iFv)
+GO(SDL_GetAudioStatus, uFv)
GOM(SDL_GetBasePath, pFEv)
GO(SDL_GetClipboardText, pFv)
GO(SDL_GetClipRect, vFpp)
@@ -193,7 +193,7 @@ GO(SDL_GetDisplayBounds, iFip)
GO(SDL_GetDisplayDPI, iFippp)
GO(SDL_GetDisplayMode, iFiip)
GO(SDL_GetDisplayName, pFi)
-GO(SDL_GetDisplayOrientation, iFi)
+GO(SDL_GetDisplayOrientation, uFi)
GO(SDL_GetDisplayUsableBounds, iFip)
GO(SDL_getenv, pFp)
GO(SDL_GetError, pFv)
@@ -201,15 +201,15 @@ GOM(SDL_GetEventFilter, iFEpp)
GO(SDL_GetGlobalMouseState, uFpp)
GO(SDL_GetGrabbedWindow, pFv)
GO(SDL_GetHint, pFp)
-GO(SDL_GetHintBoolean, iFpi)
+GO(SDL_GetHintBoolean, uFpu)
GOM(SDL_GetJoystickGUIDInfo, vFGppp)
GO(SDL_GetKeyboardFocus, pFv)
GO(SDL_GetKeyboardState, pFp)
-GO(SDL_GetKeyFromName, pFp)
-GO(SDL_GetKeyFromScancode, uFu)
-GO(SDL_GetKeyName, pFu)
-GO(SDL_GetMemoryFunctions, iFpi)
-GO(SDL_GetModState, pFv)
+GO(SDL_GetKeyFromName, iFp)
+GO(SDL_GetKeyFromScancode, iFu)
+GO(SDL_GetKeyName, pFi)
+GO(SDL_GetMemoryFunctions, vFpppp)
+GO(SDL_GetModState, uFv)
GO(SDL_GetMouseFocus, pFv)
GO(SDL_GetMouseState, uFpp)
GO(SDL_GetNumAllocations, iFv)
@@ -222,13 +222,13 @@ GO(SDL_GetNumTouchFingers, iFu)
GO(SDL_GetNumVideoDisplays, iFv)
GO(SDL_GetNumVideoDrivers, iFv)
GO(SDL_GetPerformanceCounter, UFv)
-GO(SDL_GetPerformanceFrequency, UFv)
+GO(SDL_GetPerformanceFrequency, LFv)
GO(SDL_GetPixelFormatName, pFu)
GO(SDL_GetPlatform, pFv)
-GO(SDL_GetPowerInfo, iFpp)
+GO(SDL_GetPowerInfo, uFpp)
GO(SDL_GetPreferredLocales, pFv)
GO(SDL_GetPrefPath, pFpp)
-GO(SDL_GetQueuedAudioSize, uFi)
+GO(SDL_GetQueuedAudioSize, uFu)
GO(SDL_GetRelativeMouseMode, iFv)
GO(SDL_GetRelativeMouseState, uFpp)
GO(SDL_GetRenderDrawBlendMode, iFpp)
@@ -242,8 +242,8 @@ GO(SDL_GetRevision, pFv)
GO(SDL_GetRevisionNumber, iFv)
GO(SDL_GetRGB, vFupppp)
GO(SDL_GetRGBA, vFuppppp)
-GO(SDL_GetScancodeFromKey, uFu)
-GO(SDL_GetScancodeFromName, iFp)
+GO(SDL_GetScancodeFromKey, uFi)
+GO(SDL_GetScancodeFromName, uFp)
GO(SDL_GetScancodeName, pFu)
GO(SDL_GetShapedWindowMode, iFpp)
GO(SDL_GetSurfaceAlphaMod, iFpp)
@@ -256,9 +256,9 @@ GO(SDL_GetTextureColorMod, iFpppp)
GO(SDL_GetThreadID, LFp)
GO(SDL_GetThreadName, pFp)
GO(SDL_GetTicks, uFv)
-GO(SDL_GetTouchDevice, uFi)
-GO(SDL_GetTouchDeviceType, iFi)
-GO(SDL_GetTouchFinger, pFui)
+GO(SDL_GetTouchDevice, lFi)
+GO(SDL_GetTouchDeviceType, iFl)
+GO(SDL_GetTouchFinger, pFli)
GO(SDL_GetVersion, vFp)
GO(SDL_GetVideoDriver, pFi)
GO(SDL_GetWindowBordersSize, iFppppp)
@@ -280,8 +280,8 @@ GO(SDL_GetWindowSize, vFppp)
GO(SDL_GetWindowSurface, pFp)
GO(SDL_GetWindowTitle, pFp)
GO(SDL_GetWindowWMInfo, iFpp)
-GO(SDL_GetYUVConversionMode, iFv)
-GO(SDL_GetYUVConversionModeForResolution, iFii)
+GO(SDL_GetYUVConversionMode, uFv)
+GO(SDL_GetYUVConversionModeForResolution, uFii)
GO(SDL_GL_BindTexture, iFppp)
GO(SDL_GL_CreateContext, pFp)
GO(SDL_GL_DeleteContext, vFp)
@@ -333,10 +333,10 @@ GOM(SDL_HasAVX, iFv)
GOM(SDL_HasAVX2, iFv)
GOM(SDL_HasAVX512F, iFv)
GO(SDL_HasClipboardText, iFv)
-GO(SDL_HasColorKey, iFv)
-GO(SDL_HasEvent, iFv)
-GO(SDL_HasEvents, iFv)
-GO(SDL_HasIntersection, iFpp)
+GO(SDL_HasColorKey, uFp)
+GO(SDL_HasEvent, uFu)
+GO(SDL_HasEvents, uFuu)
+GO(SDL_HasIntersection, uFpp)
GOM(SDL_HasMMX, iFv)
GOM(SDL_HasNEON, iFv)
GOM(SDL_HasRDTSC, iFv)
@@ -353,15 +353,15 @@ GO(SDL_iconv_open, pFpp)
GO(SDL_iconv_string, pFpppL)
GO(SDL_Init, iFu)
GO(SDL_InitSubSystem, iFu)
-GO(SDL_IntersectRect, iFppp)
-GO(SDL_IntersectRectAndLine, iFppppp)
+GO(SDL_IntersectRect, uFppp)
+GO(SDL_IntersectRectAndLine, uFppppp)
GO(SDL_isdigit, iFi)
-GO(SDL_IsGameController, iFi)
-GO(SDL_IsScreenKeyboardShown, iFp)
+GO(SDL_IsGameController, uFi)
+GO(SDL_IsScreenKeyboardShown, uFp)
GO(SDL_IsScreenSaverEnabled, iFv)
-GO(SDL_IsShapedWindow, iFp)
+GO(SDL_IsShapedWindow, uFp)
GO(SDL_isspace, iFi)
-GO(SDL_IsTablet, iFv)
+GO(SDL_IsTablet, uFv)
GO(SDL_IsTextInputActive, iFv)
GO(SDL_itoa, pFipi)
GO(SDL_JoystickClose, vFp)
@@ -369,8 +369,8 @@ GO(SDL_JoystickCurrentPowerLevel, iFp)
GO(SDL_JoystickEventState, iFi)
GO(SDL_JoystickFromInstanceID, pFi)
GO(SDL_JoystickGetAttached, iFp)
-GO(SDL_JoystickGetAxis, iFpi)
-GO(SDL_JoystickGetAxisInitialState, iFpip)
+GO(SDL_JoystickGetAxis, wFpi)
+GO(SDL_JoystickGetAxisInitialState, uFpip)
GO(SDL_JoystickGetBall, iFpipp)
GO(SDL_JoystickGetButton, CFpi)
GO(SDL_JoystickGetDeviceGUID, HFi) // return a struct that is "uint8_t data[16]"
@@ -378,7 +378,7 @@ GO(SDL_JoystickGetDeviceInstanceID, iFi)
GO(SDL_JoystickGetDevicePlayerIndex, iFi)
GO(SDL_JoystickGetDeviceProduct, WFi)
GO(SDL_JoystickGetDeviceProductVersion, WFi)
-GO(SDL_JoystickGetDeviceType, iFi)
+GO(SDL_JoystickGetDeviceType, uFi)
GO(SDL_JoystickGetDeviceVendor, WFi)
GO(SDL_JoystickGetGUID, HFp)
GO(SDL_JoystickGetGUIDFromString, HFp)
@@ -387,7 +387,7 @@ GO(SDL_JoystickGetHat, CFpi)
GO(SDL_JoystickGetPlayerIndex, iFp)
GO(SDL_JoystickGetProduct, WFp)
GO(SDL_JoystickGetProductVersion, WFp)
-GO(SDL_JoystickGetType, iFp)
+GO(SDL_JoystickGetType, uFp)
GO(SDL_JoystickGetVendor, WFp)
GO(SDL_JoystickInstanceID, iFp)
GO(SDL_JoystickIsHaptic, iFp)
@@ -400,8 +400,8 @@ GO(SDL_JoystickNumHats, iFp)
GO(SDL_JoystickOpen, pFi)
GO(SDL_JoystickRumble, iFpWWu)
GO(SDL_JoystickUpdate, vFv)
-GO(SDL_LinuxSetThreadPriority, iFIi)
-GO(SDL_lltoa, pFIpi)
+GO(SDL_LinuxSetThreadPriority, iFli)
+GO(SDL_lltoa, pFlpi)
GOM(SDL_LoadBMP_RW, pFEpi)
GO(SDL_LoadDollarTemplates, iFip)
GO(SDL_LoadFile, pFpp)
@@ -424,7 +424,7 @@ GOM(SDL_LogDebug, vFEipV)
GOM(SDL_LogError, vFEipV)
GO(SDL_logf, fFf)
GOM(SDL_LogGetOutputFunction, vFEpp)
-GO(SDL_LogGetPriority, iFi)
+GO(SDL_LogGetPriority, uFi)
GOM(SDL_LogInfo, vFEipV)
GO2(SDL_LogMessage, vFiupV, SDL_LogMessageV)
GO(SDL_LogMessageV, vFiupV)
@@ -436,32 +436,32 @@ GOM(SDL_LogVerbose, vFEipV)
GOM(SDL_LogWarn, vFEipV)
GO(SDL_LowerBlit, iFpppp)
GO(SDL_LowerBlitScaled, iFpppp)
-GO(SDL_ltoa, pFlp)
-GO(SDL_malloc, pFu)
+GO(SDL_ltoa, pFlpi)
+GO(SDL_malloc, pFL)
GO(SDL_MapRGB, uFpCCC)
GO(SDL_MapRGBA, uFpCCCC)
GO(SDL_MasksToPixelFormatEnum, uFiuuuu)
GO(SDL_MaximizeWindow, vFp)
-GO(SDL_memcmp, iFppu)
+GO(SDL_memcmp, iFppL)
GO(SDL_memcpy, pFppu)
GO(SDL_memmove, pFppu)
GO(SDL_MemoryBarrierAcquireFunction, vFv)
GO(SDL_MemoryBarrierReleaseFunction, vFv)
-GO(SDL_memset, pFpiu)
+GO(SDL_memset, pFpiL)
GO(SDL_MinimizeWindow, vFp)
GO(SDL_MixAudio, vFppui)
GO(SDL_MixAudioFormat, vFppWui)
GO(SDL_MouseIsHaptic, iFv)
-GO(SDL_NewAudioStream, pFiCiiCi)
+GO(SDL_NewAudioStream, pFWCiWCi)
GO(SDL_NumHaptics, iFv)
GO(SDL_NumJoysticks, iFv)
GO(SDL_NumSensors, iFv)
GOM(SDL_OpenAudio, iFEpp)
GOM(SDL_OpenAudioDevice, iFEpippi)
GO(SDL_PauseAudio, vFi)
-GO(SDL_PauseAudioDevice, vFii)
-GO(SDL_PeepEvents, iFpiiuu)
-GO(SDL_PixelFormatEnumToMasks, iFuppppp)
+GO(SDL_PauseAudioDevice, vFui)
+GO(SDL_PeepEvents, iFpiuuu)
+GO(SDL_PixelFormatEnumToMasks, uFuppppp)
GO(SDL_PollEvent, iFp)
GO(SDL_pow, dFdd)
GO(SDL_powf, fFff)
@@ -469,7 +469,7 @@ GO(SDL_PumpEvents, vFv)
GO(SDL_PushEvent, iFp)
GO2(SDL_qsort, vFEpuup, my_qsort)
GO(SDL_QueryTexture, iFppppp)
-GO(SDL_QueueAudio, iFipu)
+GO(SDL_QueueAudio, iFupu)
GO(SDL_Quit, vFv)
GO(SDL_QuitSubSystem, vFu)
GO(SDL_RaiseWindow, vFp)
@@ -480,13 +480,13 @@ GOM(SDL_ReadLE16, uFEp)
GOM(SDL_ReadLE32, uFEp)
GOM(SDL_ReadLE64, UFEp)
GOM(SDL_ReadU8, uFEp)
-GO(SDL_realloc, pFpu)
-GO(SDL_RecordGesture, iFi)
+GO(SDL_realloc, pFpL)
+GO(SDL_RecordGesture, iFl)
GO(SDL_RegisterEvents, uFi)
GOM(SDL_RemoveTimer, iFEp)
GO(SDL_RenderClear, iFp)
GO(SDL_RenderCopy, iFpppp)
-GO(SDL_RenderCopyEx, iFppppdpi)
+GO(SDL_RenderCopyEx, iFppppdpu)
// SDL_RenderCopyExF
// SDL_RenderCopyF
GO(SDL_RenderDrawLine, iFpiiii)
@@ -513,11 +513,11 @@ GO(SDL_RenderGetLogicalSize, vFppp)
// SDL_RenderGetMetalLayer
GO(SDL_RenderGetScale, vFppp)
GO(SDL_RenderGetViewport, vFpp)
-GO(SDL_RenderIsClipEnabled, iFp)
+GO(SDL_RenderIsClipEnabled, uFp)
GO(SDL_RenderPresent, vFp)
GO(SDL_RenderReadPixels, iFppupi)
GO(SDL_RenderSetClipRect, iFpp)
-GO(SDL_RenderSetIntegerScale, iFpi)
+GO(SDL_RenderSetIntegerScale, iFpu)
GO(SDL_RenderSetLogicalSize, iFpii)
GO(SDL_RenderSetScale, iFpff)
GO(SDL_RenderSetViewport, iFpp)
@@ -533,8 +533,8 @@ GOM(SDL_RWFromMem, pFEpi)
GOM(SDL_SaveAllDollarTemplates, iFEp)
GOM(SDL_SaveBMP_RW, iFEppi)
GOM(SDL_SaveDollarTemplate, iFEip)
-GO(SDL_scalbn, dFdl)
-GO(SDL_scalbnf, fFfl)
+GO(SDL_scalbn, dFdi)
+GO(SDL_scalbnf, fFfi)
GO(SDL_SemPost, iFp)
GO(SDL_SemTryWait, iFp)
GO(SDL_SemValue, uFp)
@@ -555,17 +555,17 @@ GO(SDL_SemWaitTimeout, iFpu)
// SDL_SensorUpdate
// SDL_SetAssertionHandler
GO(SDL_SetClipboardText, iFp)
-GO(SDL_SetClipRect, iFpp)
+GO(SDL_SetClipRect, uFpp)
GO(SDL_SetColorKey, iFpiu)
GO(SDL_SetCursor, vFp)
GO(SDL_setenv, iFppi)
GO(SDL_SetError, iFppppp) // it use ..., so putarbitrary 4 args
GOM(SDL_SetEventFilter, vFEpp)
-GO(SDL_SetHint, iFpp)
-GO(SDL_SetHintWithPriority, iFppi)
+GO(SDL_SetHint, uFpp)
+GO(SDL_SetHintWithPriority, uFppu)
GO(SDL_SetMainReady, vFv)
// SDL_SetMemoryFunctions
-GO(SDL_SetModState, vFi)
+GO(SDL_SetModState, vFu)
GO(SDL_SetPaletteColors, iFppii)
// SDL_SetPixelFormatPalette
GO(SDL_SetRelativeMouseMode, iFi)
@@ -623,24 +623,24 @@ GO(SDL_strcasecmp, iFpp)
GO(SDL_strchr, pFpi)
GO(SDL_strcmp, iFpp)
GO(SDL_strdup, pFp)
-GO(SDL_strlcat, uFppu)
+GO(SDL_strlcat, LFppL)
GO(SDL_strlcpy, uFppu)
GO(SDL_strlen, uFp)
GO(SDL_strlwr, pFp)
-GO(SDL_strncasecmp, iFppu)
+GO(SDL_strncasecmp, iFppL)
GO(SDL_strncmp, iFppu)
GO(SDL_strrchr, pFpi)
GO(SDL_strrev, pFp)
GO(SDL_strstr, pFpp)
GO(SDL_strtod, dFpp)
-GO(SDL_strtol, iFppi)
-GO(SDL_strtoll, IFppi)
-GO(SDL_strtoul, uFppi)
-GO(SDL_strtoull, UFppi)
+GO(SDL_strtol, lFppi)
+GO(SDL_strtoll, lFppi)
+GO(SDL_strtoul, LFppi)
+GO(SDL_strtoull, LFppi)
GO(SDL_strupr, pFp)
GO(SDL_tan, dFd)
GO(SDL_tanf, fFf)
-GO(SDL_ThreadID, uFv)
+GO(SDL_ThreadID, LFv)
GO(SDL_TLSCreate, uFv)
GO(SDL_TLSGet, pFu)
GOM(SDL_TLSSet, iFEupp)
@@ -648,8 +648,8 @@ GO(SDL_tolower, iFi)
GO(SDL_toupper, iFi)
GO(SDL_TryLockMutex, iFp)
GO(SDL_uitoa, pFupi)
-GO(SDL_ulltoa, pFUpi)
-GO(SDL_ultoa, pFupi)
+GO(SDL_ulltoa, pFLpi)
+GO(SDL_ultoa, pFLpi)
GO(SDL_UnionRect, vFppp)
GOM(SDL_UnloadObject, vFEp)
GO(SDL_UnlockAudio, vFv)
@@ -686,7 +686,7 @@ GO(SDL_WasInit, uFu)
// SDL_wcsdup
// SDL_wcslcat
// SDL_wcslcpy
-GO(SDL_wcslen, uFp)
+GO(SDL_wcslen, LFp)
GOM(SDL_WriteBE16, uFEpW)
GOM(SDL_WriteBE32, uFEpu)
GOM(SDL_WriteBE64, uFEpU)
diff --git a/src/wrapped/wrappedsdl2image.c b/src/wrapped/wrappedsdl2image.c
index de520da..290d315 100755..100644
--- a/src/wrapped/wrappedsdl2image.c
+++ b/src/wrapped/wrappedsdl2image.c
@@ -24,7 +24,7 @@ const char* sdl2imageName = "libSDL2_image-2.0.so.0";
#include "wrappercallback.h"
-#define GO(A) \
+#define GO(A) \
EXPORT void *my2_##A(x64emu_t* emu, void* a) \
{ \
SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); \
diff --git a/src/wrapped/wrappedsdl2image_private.h b/src/wrapped/wrappedsdl2image_private.h
index 7c4af99..fac7878 100755..100644
--- a/src/wrapped/wrappedsdl2image_private.h
+++ b/src/wrapped/wrappedsdl2image_private.h
@@ -1,4 +1,6 @@
-#if defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error Meh!
+#endif
DATA(__data_start, 4)
DATA(_edata, 4)
@@ -55,7 +57,7 @@ GOM(IMG_LoadTextureTyped_RW, pFEppip)
// IMG_QuitWEBP
// IMG_SaveJPG
// IMG_SaveJPG_RW
-GO(IMG_SavePNG, iFppi)
+GO(IMG_SavePNG, iFpp)
GOM(IMG_SavePNG_RW, iFEppi)
// _init
DATA(nsvg__colors, 4)
@@ -65,5 +67,3 @@ DATA(nsvg__colors, 4)
// nsvgParse
// nsvg__parseXML
// nsvgRasterize
-
-#endif \ No newline at end of file
diff --git a/src/wrapped/wrappedsdl2mixer.c b/src/wrapped/wrappedsdl2mixer.c
index 8bf9c4d..56a2a0e 100755..100644
--- a/src/wrapped/wrappedsdl2mixer.c
+++ b/src/wrapped/wrappedsdl2mixer.c
@@ -42,7 +42,7 @@ GO(4)
static uintptr_t my_EffectFunc_fct_##A = 0; \
static void my_EffectFunc_##A(int chan, void *stream, int len, void *udata) \
{ \
- RunFunction(my_context, my_EffectFunc_fct_##A, 4, chan, stream, len, udata); \
+ RunFunctionFmt(my_EffectFunc_fct_##A, "ipip", chan, stream, len, udata); \
}
SUPER()
#undef GO
@@ -66,7 +66,7 @@ static void* find_EffectFunc_Fct(void* fct)
static uintptr_t my_EffectDone_fct_##A = 0; \
static void my_EffectDone_##A(int chan, void *udata) \
{ \
- RunFunction(my_context, my_EffectDone_fct_##A, 2, chan, udata); \
+ RunFunctionFmt(my_EffectDone_fct_##A, "ip", chan, udata); \
}
SUPER()
#undef GO
@@ -90,7 +90,7 @@ static void* find_EffectDone_Fct(void* fct)
static uintptr_t my_MixFunc_fct_##A = 0; \
static void my_MixFunc_##A(void *udata, uint8_t *stream, int len) \
{ \
- RunFunction(my_context, my_MixFunc_fct_##A, 3, udata, stream, len); \
+ RunFunctionFmt(my_MixFunc_fct_##A, "ppi", udata, stream, len); \
}
SUPER()
#undef GO
@@ -114,7 +114,7 @@ static void* find_MixFunc_Fct(void* fct)
static uintptr_t my_ChannelFinished_fct_##A = 0; \
static void my_ChannelFinished_##A(int channel) \
{ \
- RunFunction(my_context, my_ChannelFinished_fct_##A, 1, channel); \
+ RunFunctionFmt(my_ChannelFinished_fct_##A, "i", channel); \
}
SUPER()
#undef GO
@@ -138,7 +138,7 @@ static void* find_ChannelFinished_Fct(void* fct)
static uintptr_t my_MusicFinished_fct_##A = 0; \
static void my_MusicFinished_##A() \
{ \
- RunFunction(my_context, my_MusicFinished_fct_##A, 0); \
+ RunFunctionFmt(my_MusicFinished_fct_##A, ""); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedsdl2mixer_private.h b/src/wrapped/wrappedsdl2mixer_private.h
index db332fe..796e691 100755..100644
--- a/src/wrapped/wrappedsdl2mixer_private.h
+++ b/src/wrapped/wrappedsdl2mixer_private.h
@@ -17,15 +17,15 @@ GO(Mix_FadeInMusicPos,iFpiid)
GO(Mix_FadeOutChannel,iFii)
GO(Mix_FadeOutGroup,iFii)
GO(Mix_FadeOutMusic,iFi)
-GO(Mix_FadingChannel,iFi)
-GO(Mix_FadingMusic,iFv)
+GO(Mix_FadingChannel, uFi)
+GO(Mix_FadingMusic, uFv)
GO(Mix_FreeChunk,vFp)
GO(Mix_FreeMusic,vFp)
GO(Mix_GetChunk,pFi)
GO(Mix_GetChunkDecoder,pFi)
GO(Mix_GetMusicDecoder,pFi)
GO(Mix_GetMusicHookData,pFv)
-GO(Mix_GetMusicType,iFp)
+GO(Mix_GetMusicType, uFp)
GO(Mix_GetNumChunkDecoders,iFv)
GO(Mix_GetNumMusicDecoders,iFv)
GO(Mix_GetSoundFonts,pFv)
@@ -48,8 +48,8 @@ GO(Mix_LoadMUS,pFp)
GOM(Mix_LoadMUSType_RW,pFEpii)
GOM(Mix_LoadMUS_RW,pFEpi)
GOM(Mix_LoadWAV_RW,pFEpi)
-GO(Mix_OpenAudio,iFiuii)
-GO(Mix_OpenAudioDevice, iFiuiipi)
+GO(Mix_OpenAudio, iFiWii)
+GO(Mix_OpenAudioDevice, iFiWiipi)
GO(Mix_Pause,vFi)
GO(Mix_PauseMusic,vFv)
GO(Mix_Paused,iFi)
@@ -67,10 +67,10 @@ GO(Mix_ReserveChannels,iFi)
GO(Mix_Resume,vFi)
GO(Mix_ResumeMusic,vFv)
GO(Mix_RewindMusic,vFv)
-GO(Mix_SetDistance,iFiu)
+GO(Mix_SetDistance, iFiC)
GO(Mix_SetMusicCMD,iFp)
GO(Mix_SetMusicPosition,iFd)
-GO(Mix_SetPanning,iFiuu)
+GO(Mix_SetPanning, iFiCC)
GO(Mix_SetPosition,iFiwC)
GOM(MinorityMix_SetPosition, iFEiw)
GOM(Mix_SetPostMix,vFEpp)
diff --git a/src/wrapped/wrappedsdl2net.c b/src/wrapped/wrappedsdl2net.c
index 7009e4b..7009e4b 100755..100644
--- a/src/wrapped/wrappedsdl2net.c
+++ b/src/wrapped/wrappedsdl2net.c
diff --git a/src/wrapped/wrappedsdl2net_private.h b/src/wrapped/wrappedsdl2net_private.h
index 6986d4d..29bcd05 100755..100644
--- a/src/wrapped/wrappedsdl2net_private.h
+++ b/src/wrapped/wrappedsdl2net_private.h
@@ -42,4 +42,4 @@ GO(SDLNet_UDP_SetPacketLoss, vFpi)
GO(SDLNet_UDP_Unbind, vFpi)
GO(SDLNet_Write16, vFWp)
GO(SDLNet_Write32, vFup)
-GO(SDLNet_version, pFv) \ No newline at end of file
+GO(SDLNet_version, pFv)
diff --git a/src/wrapped/wrappedsdl2ttf.c b/src/wrapped/wrappedsdl2ttf.c
index b0075b3..b0075b3 100755..100644
--- a/src/wrapped/wrappedsdl2ttf.c
+++ b/src/wrapped/wrappedsdl2ttf.c
diff --git a/src/wrapped/wrappedsdl2ttf_private.h b/src/wrapped/wrappedsdl2ttf_private.h
index cb08016..0da9134 100755..100644
--- a/src/wrapped/wrappedsdl2ttf_private.h
+++ b/src/wrapped/wrappedsdl2ttf_private.h
@@ -2,27 +2,27 @@
#error Meh!
#endif
-GO(TTF_ByteSwappedUNICODE, vFi)
+GO(TTF_ByteSwappedUNICODE, vFu)
GO(TTF_CloseFont, vFp)
GO(TTF_FontAscent, iFp)
GO(TTF_FontDescent, iFp)
GO(TTF_FontFaceFamilyName, pFp)
GO(TTF_FontFaceIsFixedWidth, iFp)
-GO(TTF_FontFaces, iFp)
+GO(TTF_FontFaces, lFp)
GO(TTF_FontFaceStyleName, pFp)
GO(TTF_FontHeight, iFp)
GO(TTF_FontLineSkip, iFp)
GO(TTF_GetFontHinting, iFp)
GO(TTF_GetFontKerning, iFp)
-GO(TTF_GetFontKerningSize, iFp)
+GO(TTF_GetFontKerningSize, iFpii)
GO(TTF_GetFontOutline, iFp)
GO(TTF_GetFontStyle, iFp)
-GO(TTF_GlyphIsProvided, iFpu)
-GO(TTF_GlyphMetrics, iFpuppppp)
+GO(TTF_GlyphIsProvided, iFpW)
+GO(TTF_GlyphMetrics, iFpWppppp)
GO(TTF_Init, iFv)
GO(TTF_Linked_Version, pFv)
GO(TTF_OpenFont, pFpi)
-GO(TTF_OpenFontIndex, pFpii)
+GO(TTF_OpenFontIndex, pFpil)
GOM(TTF_OpenFontIndexRW, pFEpiii)
GOM(TTF_OpenFontRW, pFEpii)
GO(TTF_Quit, vFv)
diff --git a/src/wrapped/wrappedsecret1.c b/src/wrapped/wrappedsecret1.c
index d3597a1..d3597a1 100755..100644
--- a/src/wrapped/wrappedsecret1.c
+++ b/src/wrapped/wrappedsecret1.c
diff --git a/src/wrapped/wrappedsecret1_private.h b/src/wrapped/wrappedsecret1_private.h
index df7d74b..df7d74b 100755..100644
--- a/src/wrapped/wrappedsecret1_private.h
+++ b/src/wrapped/wrappedsecret1_private.h
diff --git a/src/wrapped/wrappedselinux.c b/src/wrapped/wrappedselinux.c
index 9e58f20..9e58f20 100755..100644
--- a/src/wrapped/wrappedselinux.c
+++ b/src/wrapped/wrappedselinux.c
diff --git a/src/wrapped/wrappedselinux_private.h b/src/wrapped/wrappedselinux_private.h
index 94a4f73..94a4f73 100755..100644
--- a/src/wrapped/wrappedselinux_private.h
+++ b/src/wrapped/wrappedselinux_private.h
diff --git a/src/wrapped/wrappedsmime3.c b/src/wrapped/wrappedsmime3.c
index a9eea34..858c16b 100755..100644
--- a/src/wrapped/wrappedsmime3.c
+++ b/src/wrapped/wrappedsmime3.c
@@ -39,7 +39,7 @@ GO(4)
static uintptr_t my_SECKEYGetPasswordKey_fct_##A = 0; \
static void* my_SECKEYGetPasswordKey_##A(void* a, void* b) \
{ \
- return (void*)RunFunction(my_context, my_SECKEYGetPasswordKey_fct_##A, 2, a, b);\
+ return (void*)RunFunctionFmt(my_SECKEYGetPasswordKey_fct_##A, "pp", a, b);\
}
SUPER()
#undef GO
@@ -62,7 +62,7 @@ static void* find_SECKEYGetPasswordKey_Fct(void* fct)
static uintptr_t my_digestOpenFn_fct_##A = 0; \
static int my_digestOpenFn_##A(void* a, int b) \
{ \
- return RunFunction(my_context, my_digestOpenFn_fct_##A, 2, a, b); \
+ return RunFunctionFmt(my_digestOpenFn_fct_##A, "pi", a, b); \
}
SUPER()
#undef GO
@@ -85,7 +85,7 @@ static void* find_digestOpenFn_Fct(void* fct)
static uintptr_t my_digestCloseFn_fct_##A = 0; \
static int my_digestCloseFn_##A(void* a, int b) \
{ \
- return RunFunction(my_context, my_digestCloseFn_fct_##A, 2, a, b); \
+ return RunFunctionFmt(my_digestCloseFn_fct_##A, "pi", a, b); \
}
SUPER()
#undef GO
@@ -108,7 +108,7 @@ static void* find_digestCloseFn_Fct(void* fct)
static uintptr_t my_digestIOFn_fct_##A = 0; \
static int my_digestIOFn_##A(void* a, void* b, unsigned long c) \
{ \
- return RunFunction(my_context, my_digestIOFn_fct_##A, 3, a, b, c); \
+ return RunFunctionFmt(my_digestIOFn_fct_##A, "ppL", a, b, c); \
}
SUPER()
#undef GO
@@ -131,7 +131,7 @@ static void* find_digestIOFn_Fct(void* fct)
static uintptr_t my_SEC_PKCS12NicknameCollisionCallback_fct_##A = 0; \
static void* my_SEC_PKCS12NicknameCollisionCallback_##A(void* a, void* b, void* c) \
{ \
- return (void*)RunFunction(my_context, my_SEC_PKCS12NicknameCollisionCallback_fct_##A, 3, a, b, c); \
+ return (void*)RunFunctionFmt(my_SEC_PKCS12NicknameCollisionCallback_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -151,10 +151,10 @@ static void* find_SEC_PKCS12NicknameCollisionCallback_Fct(void* fct)
// SEC_PKCS12EncoderOutputCallback ...
#define GO(A) \
-static uintptr_t my_SEC_PKCS12EncoderOutputCallback_fct_##A = 0; \
-static void my_SEC_PKCS12EncoderOutputCallback_##A(void* a, void* b, unsigned long c) \
-{ \
- RunFunction(my_context, my_SEC_PKCS12EncoderOutputCallback_fct_##A, 3, a, b, c); \
+static uintptr_t my_SEC_PKCS12EncoderOutputCallback_fct_##A = 0; \
+static void my_SEC_PKCS12EncoderOutputCallback_##A(void* a, void* b, unsigned long c) \
+{ \
+ RunFunctionFmt(my_SEC_PKCS12EncoderOutputCallback_fct_##A, "ppL", a, b, c); \
}
SUPER()
#undef GO
@@ -177,7 +177,7 @@ static void* find_SEC_PKCS12EncoderOutputCallback_Fct(void* fct)
static uintptr_t my_NSSCMSContentCallback_fct_##A = 0; \
static void my_NSSCMSContentCallback_##A(void* a, void* b, unsigned long c) \
{ \
- RunFunction(my_context, my_NSSCMSContentCallback_fct_##A, 3, a, b, c); \
+ RunFunctionFmt(my_NSSCMSContentCallback_fct_##A, "ppL", a, b, c); \
}
SUPER()
#undef GO
@@ -200,7 +200,7 @@ static void* find_NSSCMSContentCallback_Fct(void* fct)
static uintptr_t my_PK11PasswordFunc_fct_##A = 0; \
static void* my_PK11PasswordFunc_##A(void* a, int b, void* c) \
{ \
- return (void*)RunFunction(my_context, my_PK11PasswordFunc_fct_##A, 3, a, b, c); \
+ return (void*)RunFunctionFmt(my_PK11PasswordFunc_fct_##A, "pip", a, b, c); \
}
SUPER()
#undef GO
@@ -223,7 +223,7 @@ static void* find_PK11PasswordFunc_Fct(void* fct)
static uintptr_t my_NSSCMSGetDecryptKeyCallback_fct_##A = 0; \
static void* my_NSSCMSGetDecryptKeyCallback_##A(void* a, void* b) \
{ \
- return (void*)RunFunction(my_context, my_NSSCMSGetDecryptKeyCallback_fct_##A, 2, a, b); \
+ return (void*)RunFunctionFmt(my_NSSCMSGetDecryptKeyCallback_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -241,6 +241,29 @@ static void* find_NSSCMSGetDecryptKeyCallback_Fct(void* fct)
return NULL;
}
+// CERTImportCertificateFunc ...
+#define GO(A) \
+static uintptr_t my_CERTImportCertificateFunc_fct_##A = 0; \
+static int my_CERTImportCertificateFunc_##A(void* a, void* b, int c) \
+{ \
+ return (int)RunFunctionFmt(my_CERTImportCertificateFunc_fct_##A, "ppi", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_CERTImportCertificateFunc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_CERTImportCertificateFunc_fct_##A == (uintptr_t)fct) return my_CERTImportCertificateFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_CERTImportCertificateFunc_fct_##A == 0) {my_CERTImportCertificateFunc_fct_##A = (uintptr_t)fct; return my_CERTImportCertificateFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for smime3 CERTImportCertificateFunc callback\n");
+ return NULL;
+}
+
#undef SUPER
EXPORT void my_SEC_PKCS12CreateExportContext(x64emu_t* emu, void* f, void* pwfnarg, void* slot, void* wincx)
@@ -248,7 +271,7 @@ EXPORT void my_SEC_PKCS12CreateExportContext(x64emu_t* emu, void* f, void* pwfna
my->SEC_PKCS12CreateExportContext(find_SECKEYGetPasswordKey_Fct(f), pwfnarg, slot, wincx);
}
-EXPORT void* my_SEC_PKCS12DecoderStart(x64emu_t* emu, void* item, void* slot, void* wincx, void* dOpen, void* dClose,
+EXPORT void* my_SEC_PKCS12DecoderStart(x64emu_t* emu, void* item, void* slot, void* wincx, void* dOpen, void* dClose,
void* dRead, void* dWrite, void* dArg)
{
return my->SEC_PKCS12DecoderStart(item, slot, wincx, find_digestOpenFn_Fct(dOpen), find_digestCloseFn_Fct(dClose),
@@ -274,6 +297,11 @@ EXPORT void* my_NSS_CMSEncoder_Start(x64emu_t* emu, void* cmsg, void* outputf, v
find_NSSCMSGetDecryptKeyCallback_Fct(decryptcb), decryptarg, detached, items);
}
+EXPORT int my_CERT_DecodeCertPackage(x64emu_t* emu, void* cert, int len, void* f, void* data)
+{
+ return my->CERT_DecodeCertPackage(cert, len, find_CERTImportCertificateFunc_Fct(f), data);
+}
+
#define CUSTOM_INIT \
getMy(lib);
diff --git a/src/wrapped/wrappedsmime3_private.h b/src/wrapped/wrappedsmime3_private.h
index 1bf39ae..f4e3bd8 100755..100644
--- a/src/wrapped/wrappedsmime3_private.h
+++ b/src/wrapped/wrappedsmime3_private.h
@@ -4,7 +4,7 @@
//GO(CERT_ConvertAndDecodeCertificate,
//GO(CERT_DecodeCertFromPackage,
-//GO(CERT_DecodeCertPackage,
+GOM(CERT_DecodeCertPackage, iFEpipp)
//GO(NSS_CMSContentInfo_GetBulkKey,
//GO(NSS_CMSContentInfo_GetBulkKeySize,
//GO(NSS_CMSContentInfo_GetContent,
diff --git a/src/wrapped/wrappedsmpeg.c b/src/wrapped/wrappedsmpeg.c
index cc552ba..c2bac56 100755..100644
--- a/src/wrapped/wrappedsmpeg.c
+++ b/src/wrapped/wrappedsmpeg.c
@@ -38,7 +38,7 @@ GO(4)
static uintptr_t my_dispcallback_fct_##A = 0; \
static void my_dispcallback_##A(void* dst, int32_t x, int32_t y, unsigned int w, unsigned int h)\
{ \
- RunFunction(my_context, my_dispcallback_fct_##A, 5, dst, x, y, w, h); \
+ RunFunctionFmt(my_dispcallback_fct_##A, "piiuu", dst, x, y, w, h); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedsmpeg2.c b/src/wrapped/wrappedsmpeg2.c
index c95f0ba..e285c21 100755..100644
--- a/src/wrapped/wrappedsmpeg2.c
+++ b/src/wrapped/wrappedsmpeg2.c
@@ -38,7 +38,7 @@ GO(4)
static uintptr_t my_dispcallback_fct_##A = 0; \
static void my_dispcallback_##A(void* data, void* frame) \
{ \
- RunFunction(my_context, my_dispcallback_fct_##A, 2, data, frame); \
+ RunFunctionFmt(my_dispcallback_fct_##A, "pp", data, frame); \
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedsmpeg2_private.h b/src/wrapped/wrappedsmpeg2_private.h
index e94bf48..e94bf48 100755..100644
--- a/src/wrapped/wrappedsmpeg2_private.h
+++ b/src/wrapped/wrappedsmpeg2_private.h
diff --git a/src/wrapped/wrappedsmpeg_private.h b/src/wrapped/wrappedsmpeg_private.h
index b06b958..b06b958 100755..100644
--- a/src/wrapped/wrappedsmpeg_private.h
+++ b/src/wrapped/wrappedsmpeg_private.h
diff --git a/src/wrapped/wrappedssl3.c b/src/wrapped/wrappedssl3.c
index 45bf1a0..45bf1a0 100755..100644
--- a/src/wrapped/wrappedssl3.c
+++ b/src/wrapped/wrappedssl3.c
diff --git a/src/wrapped/wrappedssl3_private.h b/src/wrapped/wrappedssl3_private.h
index 174b4c1..174b4c1 100755..100644
--- a/src/wrapped/wrappedssl3_private.h
+++ b/src/wrapped/wrappedssl3_private.h
diff --git a/src/wrapped/wrappedtbbbind.c b/src/wrapped/wrappedtbbbind.c
new file mode 100644
index 0000000..997438e
--- /dev/null
+++ b/src/wrapped/wrappedtbbbind.c
@@ -0,0 +1,54 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "debug.h"
+#include "myalign.h"
+#include "callback.h"
+#include "emu/x64emu_private.h"
+
+// Fake the lib for now, don't load it
+const char* tbbbindName = "libtbbbind_2_5.so";
+#define LIBNAME tbbbind
+
+EXPORT void my___TBB_internal_initialize_system_topology(size_t group, void* numa_code, void* numa_list, void* core_type, void* core_list)
+{ }
+
+EXPORT void* my___TBB_internal_allocate_binding_handler(int slot_num, int numa_id, int core_type_id, int max_threads_per_core)
+{
+ // dummy
+ return NULL;
+}
+
+EXPORT void my___TBB_internal_apply_affinity(void* handler, int slot)
+{ }
+
+EXPORT void my___TBB_internal_deallocate_binding_handler(void* handler)
+{ }
+
+EXPORT void my___TBB_internal_destroy_system_topology()
+{ }
+
+int getNCpu();
+EXPORT int my___TBB_internal_get_default_concurrency(int numa_id, int core_type, int max_threads_per_core)
+{
+ return getNCpu();
+}
+
+EXPORT void my___TBB_internal_restore_affinity(void* handler, int slot)
+{ }
+
+// this preinit basically open "box64" as dlopen
+#define PRE_INIT\
+ lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \
+ if(0)
+
+#include "wrappedlib_init.h"
diff --git a/src/wrapped/wrappedtbbbind_private.h b/src/wrapped/wrappedtbbbind_private.h
new file mode 100644
index 0000000..9df20a3
--- /dev/null
+++ b/src/wrapped/wrappedtbbbind_private.h
@@ -0,0 +1,14 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error Meh...
+#endif
+
+GOM(__TBB_internal_allocate_binding_handler, pFiiii) //%%noE
+GOM(__TBB_internal_apply_affinity, vFpi) //%%noE
+GOM(__TBB_internal_deallocate_binding_handler, vFp) //%%noE
+GOM(__TBB_internal_destroy_system_topology, vFv) //%%noE
+GOM(__TBB_internal_get_default_concurrency, iFiii) //%%noE
+GOM(__TBB_internal_initialize_system_topology, vFLpppp) //%%noE
+GOM(__TBB_internal_restore_affinity, vFpi) //%%noE
+//GO(_ZN3tbb6detail2r115runtime_warningEPKcz,
+//DATA(_ZN3tbb6detail2r115system_topology12instance_ptrE,
+//GO(_ZN3tbb6detail2r117assertion_failureEPKciS3_S3_,
diff --git a/src/wrapped/wrappedtcmallocminimal.c b/src/wrapped/wrappedtcmallocminimal.c
index 4f179cf..4f179cf 100755..100644
--- a/src/wrapped/wrappedtcmallocminimal.c
+++ b/src/wrapped/wrappedtcmallocminimal.c
diff --git a/src/wrapped/wrappedtcmallocminimal_private.h b/src/wrapped/wrappedtcmallocminimal_private.h
index b1f6b1e..b1f6b1e 100755..100644
--- a/src/wrapped/wrappedtcmallocminimal_private.h
+++ b/src/wrapped/wrappedtcmallocminimal_private.h
diff --git a/src/wrapped/wrappedudev0.c b/src/wrapped/wrappedudev0.c
index 47d650f..4f2182a 100755..100644
--- a/src/wrapped/wrappedudev0.c
+++ b/src/wrapped/wrappedudev0.c
@@ -41,7 +41,7 @@ static uintptr_t my_log_fn_fct_##A = 0;
static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, x64_va_list_t args) \
{ \
CONVERT_VALIST(args) \
- RunFunction(my_context, my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS); \
+ RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS); \
}
#else
#define GO(A) \
@@ -49,7 +49,7 @@ static uintptr_t my_log_fn_fct_##A = 0;
static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, x64_va_list_t args) \
{ \
CREATE_VALIST_FROM_VALIST(args, thread_get_emu()->scratch); \
- RunFunction(my_context, my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS); \
+ RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS); \
}
#endif
SUPER()
diff --git a/src/wrapped/wrappedudev0_private.h b/src/wrapped/wrappedudev0_private.h
index 57c999e..57c999e 100755..100644
--- a/src/wrapped/wrappedudev0_private.h
+++ b/src/wrapped/wrappedudev0_private.h
diff --git a/src/wrapped/wrappedudev1.c b/src/wrapped/wrappedudev1.c
index 6c30a14..a82b61c 100755..100644
--- a/src/wrapped/wrappedudev1.c
+++ b/src/wrapped/wrappedudev1.c
@@ -41,7 +41,7 @@ static uintptr_t my_log_fn_fct_##A = 0;
static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, x64_va_list_t args) \
{ \
CONVERT_VALIST(args) \
- RunFunction(my_context, my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS); \
+ RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS); \
}
#else
#define GO(A) \
@@ -49,7 +49,7 @@ static uintptr_t my_log_fn_fct_##A = 0;
static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, x64_va_list_t args) \
{ \
CREATE_VALIST_FROM_VALIST(args, thread_get_emu()->scratch); \
- RunFunction(my_context, my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS); \
+ RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS); \
}
#endif
SUPER()
diff --git a/src/wrapped/wrappedudev1_private.h b/src/wrapped/wrappedudev1_private.h
index 3a6f1d9..3a6f1d9 100755..100644
--- a/src/wrapped/wrappedudev1_private.h
+++ b/src/wrapped/wrappedudev1_private.h
diff --git a/src/wrapped/wrappedutil.c b/src/wrapped/wrappedutil.c
index 3c2442a..3c2442a 100755..100644
--- a/src/wrapped/wrappedutil.c
+++ b/src/wrapped/wrappedutil.c
diff --git a/src/wrapped/wrappedvorbisfile.c b/src/wrapped/wrappedvorbisfile.c
index ad285fe..411a3ee 100755..100644
--- a/src/wrapped/wrappedvorbisfile.c
+++ b/src/wrapped/wrappedvorbisfile.c
@@ -49,9 +49,9 @@ GO(7)
// read
#define GO(A) \
static uintptr_t my_read_fct_##A = 0; \
-static unsigned long my_read_##A(void* ptr, unsigned long size, unsigned long nmemb, void* datasource) \
+static unsigned long my_read_##A(void* ptr, unsigned long size, unsigned long nmemb, void* datasource) \
{ \
- return RunFunction(my_context, my_read_fct_##A, 4, ptr, size, nmemb, datasource);\
+ return RunFunctionFmt(my_read_fct_##A, "pLLp", ptr, size, nmemb, datasource); \
}
SUPER()
#undef GO
@@ -73,7 +73,7 @@ static void* findreadFct(void* fct)
static uintptr_t my_seek_fct_##A = 0; \
static int my_seek_##A(void* ptr, int64_t offset, int whence) \
{ \
- return (int)RunFunction(my_context, my_seek_fct_##A, 3, ptr, offset, whence);\
+ return (int)RunFunctionFmt(my_seek_fct_##A, "pIi", ptr, offset, whence);\
}
SUPER()
#undef GO
@@ -95,7 +95,7 @@ static void* findseekFct(void* fct)
static uintptr_t my_close_fct_##A = 0; \
static int my_close_##A(void* ptr) \
{ \
- return (int)RunFunction(my_context, my_close_fct_##A, 1, ptr);\
+ return (int)RunFunctionFmt(my_close_fct_##A, "p", ptr);\
}
SUPER()
#undef GO
@@ -117,7 +117,7 @@ static void* findcloseFct(void* fct)
static uintptr_t my_tell_fct_##A = 0; \
static long my_tell_##A(void* ptr) \
{ \
- return (long)RunFunction(my_context, my_tell_fct_##A, 1, ptr);\
+ return (long)RunFunctionFmt(my_tell_fct_##A, "p", ptr);\
}
SUPER()
#undef GO
diff --git a/src/wrapped/wrappedvorbisfile_private.h b/src/wrapped/wrappedvorbisfile_private.h
index d721324..d721324 100755..100644
--- a/src/wrapped/wrappedvorbisfile_private.h
+++ b/src/wrapped/wrappedvorbisfile_private.h
diff --git a/src/wrapped/wrappedvulkan.c b/src/wrapped/wrappedvulkan.c
index b90747c..8cba577 100755..100644
--- a/src/wrapped/wrappedvulkan.c
+++ b/src/wrapped/wrappedvulkan.c
@@ -53,7 +53,7 @@ static void* resolveSymbol(x64emu_t* emu, void* symbol, const char* rname)
printf_dlsym(LOG_DEBUG, "%p\n", (void*)ret);
return (void*)ret; // already bridged
}
- // get wrapper
+ // get wrapper
khint_t k = kh_get(symbolmap, emu->context->vkwrappers, rname);
if(k==kh_end(emu->context->vkwrappers) && strstr(rname, "KHR")==NULL) {
// try again, adding KHR at the end if not present
@@ -74,7 +74,7 @@ static void* resolveSymbol(x64emu_t* emu, void* symbol, const char* rname)
return (void*)ret;
}
-EXPORT void* my_vkGetDeviceProcAddr(x64emu_t* emu, void* device, void* name)
+EXPORT void* my_vkGetDeviceProcAddr(x64emu_t* emu, void* device, void* name)
{
khint_t k;
const char* rname = (const char*)name;
@@ -84,8 +84,8 @@ EXPORT void* my_vkGetDeviceProcAddr(x64emu_t* emu, void* device, void* name)
fillVulkanProcWrapper(emu->context);
k = kh_get(symbolmap, emu->context->vkmymap, rname);
int is_my = (k==kh_end(emu->context->vkmymap))?0:1;
- void* symbol;
- if(is_my) {
+ void* symbol = my->vkGetDeviceProcAddr(device, name);
+ if(symbol && is_my) { // only wrap if symbol exist
// try again, by using custom "my_" now...
char tmp[200];
strcpy(tmp, "my_");
@@ -95,8 +95,7 @@ EXPORT void* my_vkGetDeviceProcAddr(x64emu_t* emu, void* device, void* name)
#define GO(A, W) if(!strcmp(rname, #A)) my->A = (W)my->vkGetDeviceProcAddr(device, name);
SUPER()
#undef GO
- } else
- symbol = my->vkGetDeviceProcAddr(device, name);
+ }
if(!symbol) {
printf_dlsym(LOG_DEBUG, "%p\n", NULL);
return NULL; // easy
@@ -104,7 +103,7 @@ EXPORT void* my_vkGetDeviceProcAddr(x64emu_t* emu, void* device, void* name)
return resolveSymbol(emu, symbol, rname);
}
-EXPORT void* my_vkGetInstanceProcAddr(x64emu_t* emu, void* instance, void* name)
+EXPORT void* my_vkGetInstanceProcAddr(x64emu_t* emu, void* instance, void* name)
{
khint_t k;
const char* rname = (const char*)name;
@@ -192,10 +191,10 @@ GO(4)
// Allocation ...
#define GO(A) \
-static uintptr_t my_Allocation_fct_##A = 0; \
-static void* my_Allocation_##A(void* a, size_t b, size_t c, int d) \
-{ \
- return (void*)RunFunction(my_context, my_Allocation_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_Allocation_fct_##A = 0; \
+static void* my_Allocation_##A(void* a, size_t b, size_t c, int d) \
+{ \
+ return (void*)RunFunctionFmt(my_Allocation_fct_##A, "pLLi", a, b, c, d); \
}
SUPER()
#undef GO
@@ -214,10 +213,10 @@ static void* find_Allocation_Fct(void* fct)
}
// Reallocation ...
#define GO(A) \
-static uintptr_t my_Reallocation_fct_##A = 0; \
-static void* my_Reallocation_##A(void* a, void* b, size_t c, size_t d, int e) \
-{ \
- return (void*)RunFunction(my_context, my_Reallocation_fct_##A, 5, a, b, c, d, e); \
+static uintptr_t my_Reallocation_fct_##A = 0; \
+static void* my_Reallocation_##A(void* a, void* b, size_t c, size_t d, int e) \
+{ \
+ return (void*)RunFunctionFmt(my_Reallocation_fct_##A, "ppLLi", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -239,7 +238,7 @@ static void* find_Reallocation_Fct(void* fct)
static uintptr_t my_Free_fct_##A = 0; \
static void my_Free_##A(void* a, void* b) \
{ \
- RunFunction(my_context, my_Free_fct_##A, 2, a, b); \
+ RunFunctionFmt(my_Free_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -258,10 +257,10 @@ static void* find_Free_Fct(void* fct)
}
// InternalAllocNotification ...
#define GO(A) \
-static uintptr_t my_InternalAllocNotification_fct_##A = 0; \
-static void my_InternalAllocNotification_##A(void* a, size_t b, int c, int d) \
-{ \
- RunFunction(my_context, my_InternalAllocNotification_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_InternalAllocNotification_fct_##A = 0; \
+static void my_InternalAllocNotification_##A(void* a, size_t b, int c, int d) \
+{ \
+ RunFunctionFmt(my_InternalAllocNotification_fct_##A, "pLii", a, b, c, d); \
}
SUPER()
#undef GO
@@ -280,10 +279,10 @@ static void* find_InternalAllocNotification_Fct(void* fct)
}
// InternalFreeNotification ...
#define GO(A) \
-static uintptr_t my_InternalFreeNotification_fct_##A = 0; \
-static void my_InternalFreeNotification_##A(void* a, size_t b, int c, int d) \
-{ \
- RunFunction(my_context, my_InternalFreeNotification_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_InternalFreeNotification_fct_##A = 0; \
+static void my_InternalFreeNotification_##A(void* a, size_t b, int c, int d) \
+{ \
+ RunFunctionFmt(my_InternalFreeNotification_fct_##A, "pLii", a, b, c, d); \
}
SUPER()
#undef GO
@@ -302,10 +301,10 @@ static void* find_InternalFreeNotification_Fct(void* fct)
}
// DebugReportCallbackEXT ...
#define GO(A) \
-static uintptr_t my_DebugReportCallbackEXT_fct_##A = 0; \
-static int my_DebugReportCallbackEXT_##A(int a, int b, uint64_t c, size_t d, int e, void* f, void* g, void* h) \
-{ \
- return RunFunction(my_context, my_DebugReportCallbackEXT_fct_##A, 8, a, b, c, d, e, f, g, h); \
+static uintptr_t my_DebugReportCallbackEXT_fct_##A = 0; \
+static int my_DebugReportCallbackEXT_##A(int a, int b, uint64_t c, size_t d, int e, void* f, void* g, void* h) \
+{ \
+ return RunFunctionFmt(my_DebugReportCallbackEXT_fct_##A, "iiULippp", a, b, c, d, e, f, g, h); \
}
SUPER()
#undef GO
@@ -618,7 +617,7 @@ EXPORT void my_vkGetPhysicalDeviceMemoryProperties(x64emu_t* emu, void* device,
my->vkGetPhysicalDeviceMemoryProperties(device, pProps);
}
-EXPORT void my_vkCmdPipelineBarrier(x64emu_t* emu, void* device, int src, int dst, int dep,
+EXPORT void my_vkCmdPipelineBarrier(x64emu_t* emu, void* device, int src, int dst, int dep,
uint32_t barrierCount, void* pBarriers, uint32_t bufferCount, void* pBuffers, uint32_t imageCount, void* pImages)
{
my->vkCmdPipelineBarrier(device, src, dst, dep, barrierCount, pBarriers, bufferCount, pBuffers, imageCount, pImages);
@@ -632,12 +631,12 @@ typedef struct my_VkDebugReportCallbackCreateInfoEXT_s {
void* pUserData;
} my_VkDebugReportCallbackCreateInfoEXT_t;
-EXPORT int my_vkCreateDebugReportCallbackEXT(x64emu_t* emu, void* instance,
- my_VkDebugReportCallbackCreateInfoEXT_t* create,
+EXPORT int my_vkCreateDebugReportCallbackEXT(x64emu_t* emu, void* instance,
+ my_VkDebugReportCallbackCreateInfoEXT_t* create,
my_VkAllocationCallbacks_t* alloc, void* callback)
{
my_VkDebugReportCallbackCreateInfoEXT_t dbg = *create;
- my_VkAllocationCallbacks_t my_alloc;
+ my_VkAllocationCallbacks_t my_alloc;
dbg.pfnCallback = find_DebugReportCallbackEXT_Fct(dbg.pfnCallback);
return my->vkCreateDebugReportCallbackEXT(instance, &dbg, find_VkAllocationCallbacks(&my_alloc, alloc), callback);
}
@@ -648,4 +647,4 @@ EXPORT int my_vkDestroyDebugReportCallbackEXT(x64emu_t* emu, void* instance, voi
return my->vkDestroyDebugReportCallbackEXT(instance, callback, find_VkAllocationCallbacks(&my_alloc, alloc));
}
-CREATE(vkCreateHeadlessSurfaceEXT) \ No newline at end of file
+CREATE(vkCreateHeadlessSurfaceEXT)
diff --git a/src/wrapped/wrappedvulkan_private.h b/src/wrapped/wrappedvulkan_private.h
index 873f857..96ee093 100755..100644
--- a/src/wrapped/wrappedvulkan_private.h
+++ b/src/wrapped/wrappedvulkan_private.h
@@ -197,7 +197,7 @@ GO(vkGetPhysicalDeviceExternalFenceProperties, vFppp)
GO(vkGetPhysicalDeviceExternalSemaphoreProperties, vFppp)
GO(vkGetPhysicalDeviceFeatures2, vFpp)
GO(vkGetPhysicalDeviceFormatProperties2, vFpip)
-GO(vkGetPhysicalDeviceImageFormatProperties2, vFppp)
+GO(vkGetPhysicalDeviceImageFormatProperties2, iFppp)
GO(vkGetPhysicalDeviceMemoryProperties2, vFpp)
GO(vkGetPhysicalDeviceProperties2, vFpp)
GO(vkGetPhysicalDeviceQueueFamilyProperties2, vFppp) //VkQueueFamilyProperties2 seems OK
@@ -804,4 +804,28 @@ GO(vkCmdSetSampleMaskEXT, vFpip)
GO(vkCmdSetShadingRateImageEnableNV, vFpi)
GO(vkCmdSetTessellationDomainOriginEXT, vFpi)
GO(vkCmdSetViewportSwizzleNV, vFpuup)
-GO(vkCmdSetViewportWScalingEnableNV, vFpi) \ No newline at end of file
+GO(vkCmdSetViewportWScalingEnableNV, vFpi)
+
+// VK_KHR_external_memory_win32
+GO(vkGetMemoryWin32HandleKHR, iFppp)
+GO(vkGetMemoryWin32HandlePropertiesKHR, iFpipp)
+
+// VK_EXT_swapchain_maintenance1
+GO(vkReleaseSwapchainImagesEXT, iFpp)
+
+// VK_VALVE_descriptor_set_host_mapping
+GO(vkGetDescriptorSetHostMappingVALVE, vFppp)
+GO(vkGetDescriptorSetLayoutHostMappingInfoVALVE, vFppp)
+
+// VK_EXT_descriptor_buffer
+GO(vkCmdBindDescriptorBufferEmbeddedSamplersEXT, vFppUu)
+GO(vkCmdBindDescriptorBuffersEXT, vFpup)
+GO(vkCmdSetDescriptorBufferOffsetsEXT, vFppUuupp)
+GO(vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT, vFppp)
+GO(vkGetBufferOpaqueCaptureDescriptorDataEXT, vFppp)
+GO(vkGetDescriptorEXT, vFppLp)
+GO(vkGetDescriptorSetLayoutBindingOffsetEXT, vFpUup)
+GO(vkGetDescriptorSetLayoutSizeEXT, vFpUp)
+GO(vkGetImageOpaqueCaptureDescriptorDataEXT, vFppp)
+GO(vkGetImageViewOpaqueCaptureDescriptorDataEXT, vFppp)
+GO(vkGetSamplerOpaqueCaptureDescriptorDataEXT, vFppp)
diff --git a/src/wrapped/wrappedwaylandclient_private.h b/src/wrapped/wrappedwaylandclient_private.h
index fc2aeef..1d54f28 100644
--- a/src/wrapped/wrappedwaylandclient_private.h
+++ b/src/wrapped/wrappedwaylandclient_private.h
@@ -28,11 +28,11 @@ GO(wl_display_get_fd, iFp)
//GO(wl_display_get_protocol_error,
//DATA(wl_display_interface,
GO(wl_display_prepare_read, iFp)
-//GO(wl_display_prepare_read_queue,
+GO(wl_display_prepare_read_queue, iFpp)
GO(wl_display_read_events, iFp)
GO(wl_display_roundtrip, iFp)
//GO(wl_display_roundtrip_queue,
-//GO(wl_event_queue_destroy,
+GO(wl_event_queue_destroy, vFp)
//DATA(wl_keyboard_interface,
//GO(wl_list_empty,
//GO(wl_list_init,
@@ -44,28 +44,28 @@ GO(wl_display_roundtrip, iFp)
//DATA(wl_output_interface,
//DATA(wl_pointer_interface,
//GO(wl_proxy_add_dispatcher,
-//GO(wl_proxy_add_listener,
+GO(wl_proxy_add_listener, iFppp)
GO(wl_proxy_create, pFpp)
-//GO(wl_proxy_create_wrapper,
+GO(wl_proxy_create_wrapper, pFp)
GO(wl_proxy_destroy, vFp)
//GO(wl_proxy_get_class,
-//GO(wl_proxy_get_id,
-//GO(wl_proxy_get_listener,
+GO(wl_proxy_get_id, uFp)
+GO(wl_proxy_get_listener, pFp)
//GO(wl_proxy_get_tag,
-//GO(wl_proxy_get_user_data,
-//GO(wl_proxy_get_version,
+GO(wl_proxy_get_user_data, pFp)
+GO(wl_proxy_get_version, uFp)
//GO(wl_proxy_marshal,
//GO(wl_proxy_marshal_array,
-//GO(wl_proxy_marshal_array_constructor,
-//GO(wl_proxy_marshal_array_constructor_versioned,
+GO(wl_proxy_marshal_array_constructor, pFpupp)
+GO(wl_proxy_marshal_array_constructor_versioned, pFpuppu)
//GO(wl_proxy_marshal_array_flags,
//GO(wl_proxy_marshal_constructor,
//GO(wl_proxy_marshal_constructor_versioned,
//GO(wl_proxy_marshal_flags,
-//GO(wl_proxy_set_queue,
+GO(wl_proxy_set_queue, vFpp)
//GO(wl_proxy_set_tag,
-//GO(wl_proxy_set_user_data,
-//GO(wl_proxy_wrapper_destroy,
+GO(wl_proxy_set_user_data, vFpp)
+GO(wl_proxy_wrapper_destroy, vFp)
DATA(wl_region_interface, 40)
DATA(wl_registry_interface, 40)
DATA(wl_seat_interface, 40)
diff --git a/src/wrapped/wrappedxinerama.c b/src/wrapped/wrappedxinerama.c
index fed2403..fed2403 100755..100644
--- a/src/wrapped/wrappedxinerama.c
+++ b/src/wrapped/wrappedxinerama.c
diff --git a/src/wrapped/wrappedxinerama_private.h b/src/wrapped/wrappedxinerama_private.h
index ddc9c29..ddc9c29 100755..100644
--- a/src/wrapped/wrappedxinerama_private.h
+++ b/src/wrapped/wrappedxinerama_private.h
diff --git a/src/wrapped/wrappedxkbcommon_private.h b/src/wrapped/wrappedxkbcommon_private.h
index 1ab0c0c..6d4a3dc 100644
--- a/src/wrapped/wrappedxkbcommon_private.h
+++ b/src/wrapped/wrappedxkbcommon_private.h
@@ -20,7 +20,7 @@ GO(xkb_compose_table_unref, vFp)
//GO(xkb_context_get_log_level,
//GO(xkb_context_get_log_verbosity,
GO(xkb_context_get_user_data, pFp)
-//GO(xkb_context_include_path_append,
+GO(xkb_context_include_path_append, iFpp)
//GO(xkb_context_include_path_append_default,
//GO(xkb_context_include_path_clear,
//GO(xkb_context_include_path_get,
@@ -49,7 +49,7 @@ GO(xkb_keymap_mod_get_index, uFpp)
GO(xkb_keymap_mod_get_name, pFpu)
GO(xkb_keymap_new_from_buffer, pFppLii)
//GO(xkb_keymap_new_from_file,
-//GO(xkb_keymap_new_from_names,
+GO(xkb_keymap_new_from_names, pFppi)
GO(xkb_keymap_new_from_string, pFppii)
GO(xkb_keymap_num_layouts, uFp)
GO(xkb_keymap_num_layouts_for_key, uFpu)
diff --git a/src/wrapped/wrappedxkbcommonx11.c b/src/wrapped/wrappedxkbcommonx11.c
index 04f945e..04f945e 100755..100644
--- a/src/wrapped/wrappedxkbcommonx11.c
+++ b/src/wrapped/wrappedxkbcommonx11.c
diff --git a/src/wrapped/wrappedxkbcommonx11_private.h b/src/wrapped/wrappedxkbcommonx11_private.h
index 3971945..3971945 100755..100644
--- a/src/wrapped/wrappedxkbcommonx11_private.h
+++ b/src/wrapped/wrappedxkbcommonx11_private.h
diff --git a/src/wrapped/wrappedxml2.c b/src/wrapped/wrappedxml2.c
index 271edfd..cb7aef3 100755..100644
--- a/src/wrapped/wrappedxml2.c
+++ b/src/wrapped/wrappedxml2.c
@@ -3,6 +3,7 @@
#include <string.h>
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <dlfcn.h>
+#include <stdarg.h>
#include "wrappedlibs.h"
@@ -15,6 +16,7 @@
#include "box64context.h"
#include "librarian.h"
#include "callback.h"
+#include "myalign.h"
const char* xml2Name =
#ifdef ANDROID
@@ -34,7 +36,7 @@ EXPORT uintptr_t my_xmlMemStrdup = 0;
void my_wrap_xmlFree(void* p)
{
if(my_xmlFree){
- RunFunction(my_context, my_xmlFree, 1, p);
+ RunFunctionFmt(my_xmlFree, "p", p);
return;
}
free(p);
@@ -42,21 +44,21 @@ void my_wrap_xmlFree(void* p)
void* my_wrap_xmlMalloc(size_t s)
{
if(my_xmlMalloc)
- return (void*)RunFunction(my_context, my_xmlMalloc, 1, s);
+ return (void*)RunFunctionFmt(my_xmlMalloc, "L", s);
else
return malloc(s);
}
void* my_wrap_xmlRealloc(void* p, size_t s)
{
if(my_xmlRealloc)
- return (void*)RunFunction(my_context, my_xmlRealloc, 2, p, s);
+ return (void*)RunFunctionFmt(my_xmlRealloc, "pL", p, s);
else
return realloc(p, s);
}
void* my_wrap_xmlMemStrdup(void* p)
{
if(my_xmlMemStrdup)
- return (void*)RunFunction(my_context, my_xmlMemStrdup, 1, p);
+ return (void*)RunFunctionFmt(my_xmlMemStrdup, "p", p);
else
return strdup(p);
}
@@ -96,10 +98,10 @@ GO(9)
// xmlHashCopier ...
#define GO(A) \
-static uintptr_t my_xmlHashCopier_fct_##A = 0; \
-static void* my_xmlHashCopier_##A(void* a, void* b) \
-{ \
- return (void*)RunFunction(my_context, my_xmlHashCopier_fct_##A, 2, a, b); \
+static uintptr_t my_xmlHashCopier_fct_##A = 0; \
+static void* my_xmlHashCopier_##A(void* a, void* b) \
+{ \
+ return (void*)RunFunctionFmt(my_xmlHashCopier_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -118,10 +120,10 @@ static void* find_xmlHashCopier_Fct(void* fct)
}
// xmlHashDeallocator ...
#define GO(A) \
-static uintptr_t my_xmlHashDeallocator_fct_##A = 0; \
-static void my_xmlHashDeallocator_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_xmlHashDeallocator_fct_##A, 2, a, b); \
+static uintptr_t my_xmlHashDeallocator_fct_##A = 0; \
+static void my_xmlHashDeallocator_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_xmlHashDeallocator_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -140,10 +142,10 @@ static void* find_xmlHashDeallocator_Fct(void* fct)
}
// xmlHashScanner ...
#define GO(A) \
-static uintptr_t my_xmlHashScanner_fct_##A = 0; \
-static void my_xmlHashScanner_##A(void* a, void* b, void* c) \
-{ \
- RunFunction(my_context, my_xmlHashScanner_fct_##A, 3, a, b, c); \
+static uintptr_t my_xmlHashScanner_fct_##A = 0; \
+static void my_xmlHashScanner_##A(void* a, void* b, void* c) \
+{ \
+ RunFunctionFmt(my_xmlHashScanner_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -162,10 +164,10 @@ static void* find_xmlHashScanner_Fct(void* fct)
}
// xmlHashScannerFull ...
#define GO(A) \
-static uintptr_t my_xmlHashScannerFull_fct_##A = 0; \
-static void my_xmlHashScannerFull_##A(void* a, void* b, void* c, void* c2, void* c3)\
-{ \
- RunFunction(my_context, my_xmlHashScannerFull_fct_##A, 5, a, b, c, c2, c3); \
+static uintptr_t my_xmlHashScannerFull_fct_##A = 0; \
+static void my_xmlHashScannerFull_##A(void* a, void* b, void* c, void* c2, void* c3) \
+{ \
+ RunFunctionFmt(my_xmlHashScannerFull_fct_##A, "ppppp", a, b, c, c2, c3);\
}
SUPER()
#undef GO
@@ -184,10 +186,10 @@ static void* find_xmlHashScannerFull_Fct(void* fct)
}
// xmlCharEncodingInputFunc ...
#define GO(A) \
-static uintptr_t my_xmlCharEncodingInputFunc_fct_##A = 0; \
-static int my_xmlCharEncodingInputFunc_##A(void* a, void* b, void* c, void* d) \
-{ \
- return RunFunction(my_context, my_xmlCharEncodingInputFunc_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_xmlCharEncodingInputFunc_fct_##A = 0; \
+static int my_xmlCharEncodingInputFunc_##A(void* a, void* b, void* c, void* d) \
+{ \
+ return RunFunctionFmt(my_xmlCharEncodingInputFunc_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -206,10 +208,10 @@ static void* find_xmlCharEncodingInputFunc_Fct(void* fct)
}
// xmlCharEncodingOutputFunc ...
#define GO(A) \
-static uintptr_t my_xmlCharEncodingOutputFunc_fct_##A = 0; \
-static int my_xmlCharEncodingOutputFunc_##A(void* a, void* b, void* c, void* d) \
-{ \
- return RunFunction(my_context, my_xmlCharEncodingOutputFunc_fct_##A, 4, a, b, c, d);\
+static uintptr_t my_xmlCharEncodingOutputFunc_fct_##A = 0; \
+static int my_xmlCharEncodingOutputFunc_##A(void* a, void* b, void* c, void* d) \
+{ \
+ return RunFunctionFmt(my_xmlCharEncodingOutputFunc_fct_##A, "pppp", a, b, c, d);\
}
SUPER()
#undef GO
@@ -228,10 +230,10 @@ static void* find_xmlCharEncodingOutputFunc_Fct(void* fct)
}
// xmlOutputWriteCallback ...
#define GO(A) \
-static uintptr_t my_xmlOutputWriteCallback_fct_##A = 0; \
-static int my_xmlOutputWriteCallback_##A(void* a, void* b, int c) \
-{ \
- return RunFunction(my_context, my_xmlOutputWriteCallback_fct_##A, 3, a, b, c); \
+static uintptr_t my_xmlOutputWriteCallback_fct_##A = 0; \
+static int my_xmlOutputWriteCallback_##A(void* a, void* b, int c) \
+{ \
+ return RunFunctionFmt(my_xmlOutputWriteCallback_fct_##A, "ppi", a, b, c); \
}
SUPER()
#undef GO
@@ -250,10 +252,10 @@ static void* find_xmlOutputWriteCallback_Fct(void* fct)
}
// xmlOutputCloseCallback ...
#define GO(A) \
-static uintptr_t my_xmlOutputCloseCallback_fct_##A = 0; \
-static int my_xmlOutputCloseCallback_##A(void* a) \
-{ \
- return RunFunction(my_context, my_xmlOutputCloseCallback_fct_##A, 1, a); \
+static uintptr_t my_xmlOutputCloseCallback_fct_##A = 0; \
+static int my_xmlOutputCloseCallback_##A(void* a) \
+{ \
+ return RunFunctionFmt(my_xmlOutputCloseCallback_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -272,10 +274,10 @@ static void* find_xmlOutputCloseCallback_Fct(void* fct)
}
// xmlInputMatchCallback ...
#define GO(A) \
-static uintptr_t my_xmlInputMatchCallback_fct_##A = 0; \
-static int my_xmlInputMatchCallback_##A(void* a) \
-{ \
- return RunFunction(my_context, my_xmlInputMatchCallback_fct_##A, 1, a); \
+static uintptr_t my_xmlInputMatchCallback_fct_##A = 0; \
+static int my_xmlInputMatchCallback_##A(void* a) \
+{ \
+ return RunFunctionFmt(my_xmlInputMatchCallback_fct_##A, "p", a);\
}
SUPER()
#undef GO
@@ -294,10 +296,10 @@ static void* find_xmlInputMatchCallback_Fct(void* fct)
}
// xmlInputOpenCallback ...
#define GO(A) \
-static uintptr_t my_xmlInputOpenCallback_fct_##A = 0; \
-static void* my_xmlInputOpenCallback_##A(void* a) \
-{ \
- return (void*)RunFunction(my_context, my_xmlInputOpenCallback_fct_##A, 1, a); \
+static uintptr_t my_xmlInputOpenCallback_fct_##A = 0; \
+static void* my_xmlInputOpenCallback_##A(void* a) \
+{ \
+ return (void*)RunFunctionFmt(my_xmlInputOpenCallback_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -316,10 +318,10 @@ static void* find_xmlInputOpenCallback_Fct(void* fct)
}
// xmlInputReadCallback ...
#define GO(A) \
-static uintptr_t my_xmlInputReadCallback_fct_##A = 0; \
-static int my_xmlInputReadCallback_##A(void* a, void* b, int c) \
-{ \
- return RunFunction(my_context, my_xmlInputReadCallback_fct_##A, 3, a, b, c); \
+static uintptr_t my_xmlInputReadCallback_fct_##A = 0; \
+static int my_xmlInputReadCallback_##A(void* a, void* b, int c) \
+{ \
+ return RunFunctionFmt(my_xmlInputReadCallback_fct_##A, "ppi", a, b, c); \
}
SUPER()
#undef GO
@@ -338,10 +340,10 @@ static void* find_xmlInputReadCallback_Fct(void* fct)
}
// xmlInputCloseCallback ...
#define GO(A) \
-static uintptr_t my_xmlInputCloseCallback_fct_##A = 0; \
-static int my_xmlInputCloseCallback_##A(void* a) \
-{ \
- return RunFunction(my_context, my_xmlInputCloseCallback_fct_##A, 1, a); \
+static uintptr_t my_xmlInputCloseCallback_fct_##A = 0; \
+static int my_xmlInputCloseCallback_##A(void* a) \
+{ \
+ return RunFunctionFmt(my_xmlInputCloseCallback_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -363,7 +365,7 @@ static void* find_xmlInputCloseCallback_Fct(void* fct)
static uintptr_t my_xmlSchemaValidityErrorFunc_fct_##A = 0; \
static void my_xmlSchemaValidityErrorFunc_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g, void* h, void* i) \
{ \
- RunFunction(my_context, my_xmlSchemaValidityErrorFunc_fct_##A, 9, a, b, c, d, e, f, g, h, i); \
+ RunFunctionFmt(my_xmlSchemaValidityErrorFunc_fct_##A, "ppppppppp", a, b, c, d, e, f, g, h, i); \
}
SUPER()
#undef GO
@@ -385,7 +387,7 @@ static void* find_xmlSchemaValidityErrorFunc_Fct(void* fct)
static uintptr_t my_xmlSchemaValidityWarningFunc_fct_##A = 0; \
static void my_xmlSchemaValidityWarningFunc_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g, void* h, void* i) \
{ \
- RunFunction(my_context, my_xmlSchemaValidityWarningFunc_fct_##A, 9, a, b, c, d, e, f, g, h, i); \
+ RunFunctionFmt(my_xmlSchemaValidityWarningFunc_fct_##A, "ppppppppp", a, b, c, d, e, f, g, h, i); \
}
SUPER()
#undef GO
@@ -402,34 +404,12 @@ static void* find_xmlSchemaValidityWarningFunc_Fct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlSchemaValidityWarningFunc callback\n");
return NULL;
}
-// xmlStructuredErrorFunc ...
-#define GO(A) \
-static uintptr_t my_xmlStructuredErrorFunc_fct_##A = 0; \
-static void my_xmlStructuredErrorFunc_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_xmlStructuredErrorFunc_fct_##A, 2, a, b); \
-}
-SUPER()
-#undef GO
-static void* find_xmlStructuredErrorFunc_Fct(void* fct)
-{
- if(!fct) return fct;
- if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
- #define GO(A) if(my_xmlStructuredErrorFunc_fct_##A == (uintptr_t)fct) return my_xmlStructuredErrorFunc_##A;
- SUPER()
- #undef GO
- #define GO(A) if(my_xmlStructuredErrorFunc_fct_##A == 0) {my_xmlStructuredErrorFunc_fct_##A = (uintptr_t)fct; return my_xmlStructuredErrorFunc_##A; }
- SUPER()
- #undef GO
- printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlStructuredErrorFunc callback\n");
- return NULL;
-}
// xmlXPathFunction ...
#define GO(A) \
-static uintptr_t my_xmlXPathFunction_fct_##A = 0; \
-static void my_xmlXPathFunction_##A(void* a, int b) \
-{ \
- RunFunction(my_context, my_xmlXPathFunction_fct_##A, 2, a, b); \
+static uintptr_t my_xmlXPathFunction_fct_##A = 0; \
+static void my_xmlXPathFunction_##A(void* a, int b) \
+{ \
+ RunFunctionFmt(my_xmlXPathFunction_fct_##A, "pi", a, b);\
}
SUPER()
#undef GO
@@ -448,10 +428,10 @@ static void* find_xmlXPathFunction_Fct(void* fct)
}
// internalSubsetSAXFunc ...
#define GO(A) \
-static uintptr_t my_internalSubsetSAXFunc_fct_##A = 0; \
-static void my_internalSubsetSAXFunc_##A(void* a, void* b, void* c, void* d) \
-{ \
- RunFunction(my_context, my_internalSubsetSAXFunc_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_internalSubsetSAXFunc_fct_##A = 0; \
+static void my_internalSubsetSAXFunc_##A(void* a, void* b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_internalSubsetSAXFunc_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -470,10 +450,10 @@ static void* find_internalSubsetSAXFunc_Fct(void* fct)
}
// isStandaloneSAXFunc ...
#define GO(A) \
-static uintptr_t my_isStandaloneSAXFunc_fct_##A = 0; \
-static int my_isStandaloneSAXFunc_##A(void* a) \
-{ \
- return RunFunction(my_context, my_isStandaloneSAXFunc_fct_##A, 1, a); \
+static uintptr_t my_isStandaloneSAXFunc_fct_##A = 0; \
+static int my_isStandaloneSAXFunc_##A(void* a) \
+{ \
+ return RunFunctionFmt(my_isStandaloneSAXFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -492,10 +472,10 @@ static void* find_isStandaloneSAXFunc_Fct(void* fct)
}
// hasInternalSubsetSAXFunc ...
#define GO(A) \
-static uintptr_t my_hasInternalSubsetSAXFunc_fct_##A = 0; \
-static int my_hasInternalSubsetSAXFunc_##A(void* a) \
-{ \
- return RunFunction(my_context, my_hasInternalSubsetSAXFunc_fct_##A, 1, a); \
+static uintptr_t my_hasInternalSubsetSAXFunc_fct_##A = 0; \
+static int my_hasInternalSubsetSAXFunc_##A(void* a) \
+{ \
+ return RunFunctionFmt(my_hasInternalSubsetSAXFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -514,10 +494,10 @@ static void* find_hasInternalSubsetSAXFunc_Fct(void* fct)
}
// hasExternalSubsetSAXFunc ...
#define GO(A) \
-static uintptr_t my_hasExternalSubsetSAXFunc_fct_##A = 0; \
-static int my_hasExternalSubsetSAXFunc_##A(void* a) \
-{ \
- return RunFunction(my_context, my_hasExternalSubsetSAXFunc_fct_##A, 1, a); \
+static uintptr_t my_hasExternalSubsetSAXFunc_fct_##A = 0; \
+static int my_hasExternalSubsetSAXFunc_##A(void* a) \
+{ \
+ return RunFunctionFmt(my_hasExternalSubsetSAXFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -536,10 +516,10 @@ static void* find_hasExternalSubsetSAXFunc_Fct(void* fct)
}
// resolveEntitySAXFunc ...
#define GO(A) \
-static uintptr_t my_resolveEntitySAXFunc_fct_##A = 0; \
-static void* my_resolveEntitySAXFunc_##A(void* a, void* b, void* c) \
-{ \
- return (void*)RunFunction(my_context, my_resolveEntitySAXFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_resolveEntitySAXFunc_fct_##A = 0; \
+static void* my_resolveEntitySAXFunc_##A(void* a, void* b, void* c) \
+{ \
+ return (void*)RunFunctionFmt(my_resolveEntitySAXFunc_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -558,10 +538,10 @@ static void* find_resolveEntitySAXFunc_Fct(void* fct)
}
// getEntitySAXFunc ...
#define GO(A) \
-static uintptr_t my_getEntitySAXFunc_fct_##A = 0; \
-static void* my_getEntitySAXFunc_##A(void* a, void* b) \
-{ \
- return (void*)RunFunction(my_context, my_getEntitySAXFunc_fct_##A, 2, a, b); \
+static uintptr_t my_getEntitySAXFunc_fct_##A = 0; \
+static void* my_getEntitySAXFunc_##A(void* a, void* b) \
+{ \
+ return (void*)RunFunctionFmt(my_getEntitySAXFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -580,10 +560,10 @@ static void* find_getEntitySAXFunc_Fct(void* fct)
}
// entityDeclSAXFunc ...
#define GO(A) \
-static uintptr_t my_entityDeclSAXFunc_fct_##A = 0; \
-static void my_entityDeclSAXFunc_##A(void* a, void* b, int c, void* d, void* e, void* f)\
-{ \
- RunFunction(my_context, my_entityDeclSAXFunc_fct_##A, 6, a, b, c, d, e, f); \
+static uintptr_t my_entityDeclSAXFunc_fct_##A = 0; \
+static void my_entityDeclSAXFunc_##A(void* a, void* b, int c, void* d, void* e, void* f) \
+{ \
+ RunFunctionFmt(my_entityDeclSAXFunc_fct_##A, "ppippp", a, b, c, d, e, f); \
}
SUPER()
#undef GO
@@ -602,10 +582,10 @@ static void* find_entityDeclSAXFunc_Fct(void* fct)
}
// notationDeclSAXFunc ...
#define GO(A) \
-static uintptr_t my_notationDeclSAXFunc_fct_##A = 0; \
-static void my_notationDeclSAXFunc_##A(void* a, void* b, void* c, void* d) \
-{ \
- RunFunction(my_context, my_notationDeclSAXFunc_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_notationDeclSAXFunc_fct_##A = 0; \
+static void my_notationDeclSAXFunc_##A(void* a, void* b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_notationDeclSAXFunc_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -627,7 +607,7 @@ static void* find_notationDeclSAXFunc_Fct(void* fct)
static uintptr_t my_attributeDeclSAXFunc_fct_##A = 0; \
static void my_attributeDeclSAXFunc_##A(void* a, void* b, void* c, int d, int e, void* f, void* g) \
{ \
- RunFunction(my_context, my_attributeDeclSAXFunc_fct_##A, 7, a, b, c, d, e, f, g); \
+ RunFunctionFmt(my_attributeDeclSAXFunc_fct_##A, "pppiipp", a, b, c, d, e, f, g); \
}
SUPER()
#undef GO
@@ -646,10 +626,10 @@ static void* find_attributeDeclSAXFunc_Fct(void* fct)
}
// elementDeclSAXFunc ...
#define GO(A) \
-static uintptr_t my_elementDeclSAXFunc_fct_##A = 0; \
-static void my_elementDeclSAXFunc_##A(void* a, void* b, int c, void* d) \
-{ \
- RunFunction(my_context, my_elementDeclSAXFunc_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_elementDeclSAXFunc_fct_##A = 0; \
+static void my_elementDeclSAXFunc_##A(void* a, void* b, int c, void* d) \
+{ \
+ RunFunctionFmt(my_elementDeclSAXFunc_fct_##A, "ppip", a, b, c, d); \
}
SUPER()
#undef GO
@@ -668,10 +648,10 @@ static void* find_elementDeclSAXFunc_Fct(void* fct)
}
// unparsedEntityDeclSAXFunc ...
#define GO(A) \
-static uintptr_t my_unparsedEntityDeclSAXFunc_fct_##A = 0; \
-static void my_unparsedEntityDeclSAXFunc_##A(void* a, void* b, void* c, void* d, void* e) \
-{ \
- RunFunction(my_context, my_unparsedEntityDeclSAXFunc_fct_##A, 5, a, b, c, d, e); \
+static uintptr_t my_unparsedEntityDeclSAXFunc_fct_##A = 0; \
+static void my_unparsedEntityDeclSAXFunc_##A(void* a, void* b, void* c, void* d, void* e) \
+{ \
+ RunFunctionFmt(my_unparsedEntityDeclSAXFunc_fct_##A, "ppppp", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -690,10 +670,10 @@ static void* find_unparsedEntityDeclSAXFunc_Fct(void* fct)
}
// setDocumentLocatorSAXFunc ...
#define GO(A) \
-static uintptr_t my_setDocumentLocatorSAXFunc_fct_##A = 0; \
-static void my_setDocumentLocatorSAXFunc_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_setDocumentLocatorSAXFunc_fct_##A, 2, a, b); \
+static uintptr_t my_setDocumentLocatorSAXFunc_fct_##A = 0; \
+static void my_setDocumentLocatorSAXFunc_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_setDocumentLocatorSAXFunc_fct_##A, "pp", a, b);\
}
SUPER()
#undef GO
@@ -712,10 +692,10 @@ static void* find_setDocumentLocatorSAXFunc_Fct(void* fct)
}
// startDocumentSAXFunc ...
#define GO(A) \
-static uintptr_t my_startDocumentSAXFunc_fct_##A = 0; \
-static void my_startDocumentSAXFunc_##A(void* a) \
-{ \
- RunFunction(my_context, my_startDocumentSAXFunc_fct_##A, 1, a); \
+static uintptr_t my_startDocumentSAXFunc_fct_##A = 0; \
+static void my_startDocumentSAXFunc_##A(void* a) \
+{ \
+ RunFunctionFmt(my_startDocumentSAXFunc_fct_##A, "p", a);\
}
SUPER()
#undef GO
@@ -734,10 +714,10 @@ static void* find_startDocumentSAXFunc_Fct(void* fct)
}
// endDocumentSAXFunc ...
#define GO(A) \
-static uintptr_t my_endDocumentSAXFunc_fct_##A = 0; \
-static void my_endDocumentSAXFunc_##A(void* a) \
-{ \
- RunFunction(my_context, my_endDocumentSAXFunc_fct_##A, 1, a); \
+static uintptr_t my_endDocumentSAXFunc_fct_##A = 0; \
+static void my_endDocumentSAXFunc_##A(void* a) \
+{ \
+ RunFunctionFmt(my_endDocumentSAXFunc_fct_##A, "p", a); \
}
SUPER()
#undef GO
@@ -756,10 +736,10 @@ static void* find_endDocumentSAXFunc_Fct(void* fct)
}
// startElementSAXFunc ...
#define GO(A) \
-static uintptr_t my_startElementSAXFunc_fct_##A = 0; \
-static void my_startElementSAXFunc_##A(void* a, void* b, void* c) \
-{ \
- RunFunction(my_context, my_startElementSAXFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_startElementSAXFunc_fct_##A = 0; \
+static void my_startElementSAXFunc_##A(void* a, void* b, void* c) \
+{ \
+ RunFunctionFmt(my_startElementSAXFunc_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -778,10 +758,10 @@ static void* find_startElementSAXFunc_Fct(void* fct)
}
// endElementSAXFunc ...
#define GO(A) \
-static uintptr_t my_endElementSAXFunc_fct_##A = 0; \
-static void my_endElementSAXFunc_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_endElementSAXFunc_fct_##A, 2, a, b); \
+static uintptr_t my_endElementSAXFunc_fct_##A = 0; \
+static void my_endElementSAXFunc_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_endElementSAXFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -800,10 +780,10 @@ static void* find_endElementSAXFunc_Fct(void* fct)
}
// referenceSAXFunc ...
#define GO(A) \
-static uintptr_t my_referenceSAXFunc_fct_##A = 0; \
-static void my_referenceSAXFunc_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_referenceSAXFunc_fct_##A, 2, a, b); \
+static uintptr_t my_referenceSAXFunc_fct_##A = 0; \
+static void my_referenceSAXFunc_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_referenceSAXFunc_fct_##A, "pp", a, b);\
}
SUPER()
#undef GO
@@ -822,10 +802,10 @@ static void* find_referenceSAXFunc_Fct(void* fct)
}
// charactersSAXFunc ...
#define GO(A) \
-static uintptr_t my_charactersSAXFunc_fct_##A = 0; \
-static void my_charactersSAXFunc_##A(void* a, void* b, int c) \
-{ \
- RunFunction(my_context, my_charactersSAXFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_charactersSAXFunc_fct_##A = 0; \
+static void my_charactersSAXFunc_##A(void* a, void* b, int c) \
+{ \
+ RunFunctionFmt(my_charactersSAXFunc_fct_##A, "ppi", a, b, c); \
}
SUPER()
#undef GO
@@ -844,10 +824,10 @@ static void* find_charactersSAXFunc_Fct(void* fct)
}
// ignorableWhitespaceSAXFunc ...
#define GO(A) \
-static uintptr_t my_ignorableWhitespaceSAXFunc_fct_##A = 0; \
-static void my_ignorableWhitespaceSAXFunc_##A(void* a, void* b, int c) \
-{ \
- RunFunction(my_context, my_ignorableWhitespaceSAXFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_ignorableWhitespaceSAXFunc_fct_##A = 0; \
+static void my_ignorableWhitespaceSAXFunc_##A(void* a, void* b, int c) \
+{ \
+ RunFunctionFmt(my_ignorableWhitespaceSAXFunc_fct_##A, "ppi", a, b, c); \
}
SUPER()
#undef GO
@@ -866,10 +846,10 @@ static void* find_ignorableWhitespaceSAXFunc_Fct(void* fct)
}
// processingInstructionSAXFunc ...
#define GO(A) \
-static uintptr_t my_processingInstructionSAXFunc_fct_##A = 0; \
-static void my_processingInstructionSAXFunc_##A(void* a, void* b, void* c) \
-{ \
- RunFunction(my_context, my_processingInstructionSAXFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_processingInstructionSAXFunc_fct_##A = 0; \
+static void my_processingInstructionSAXFunc_##A(void* a, void* b, void* c) \
+{ \
+ RunFunctionFmt(my_processingInstructionSAXFunc_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -888,10 +868,10 @@ static void* find_processingInstructionSAXFunc_Fct(void* fct)
}
// commentSAXFunc ...
#define GO(A) \
-static uintptr_t my_commentSAXFunc_fct_##A = 0; \
-static void my_commentSAXFunc_##A(void* a, void* b) \
-{ \
- RunFunction(my_context, my_commentSAXFunc_fct_##A, 2, a, b); \
+static uintptr_t my_commentSAXFunc_fct_##A = 0; \
+static void my_commentSAXFunc_##A(void* a, void* b) \
+{ \
+ RunFunctionFmt(my_commentSAXFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -910,10 +890,10 @@ static void* find_commentSAXFunc_Fct(void* fct)
}
// warningSAXFunc ...
#define GO(A) \
-static uintptr_t my_warningSAXFunc_fct_##A = 0; \
-static void my_warningSAXFunc_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g, void* h, void* i, void* j)\
-{ \
- RunFunction(my_context, my_warningSAXFunc_fct_##A, 10, a, b, c, d, e, f, g, h, i, j); \
+static uintptr_t my_warningSAXFunc_fct_##A = 0; \
+static void my_warningSAXFunc_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g, void* h, void* i, void* j) \
+{ \
+ RunFunctionFmt(my_warningSAXFunc_fct_##A, "pppppppppp", a, b, c, d, e, f, g, h, i, j); \
}
SUPER()
#undef GO
@@ -932,10 +912,10 @@ static void* find_warningSAXFunc_Fct(void* fct) // this one have a VAArg
}
// errorSAXFunc ...
#define GO(A) \
-static uintptr_t my_errorSAXFunc_fct_##A = 0; \
-static void my_errorSAXFunc_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g, void* h, void* i, void* j)\
-{ \
- RunFunction(my_context, my_errorSAXFunc_fct_##A, 10, a, b, c, d, e, f, g, h, i, j); \
+static uintptr_t my_errorSAXFunc_fct_##A = 0; \
+static void my_errorSAXFunc_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g, void* h, void* i, void* j) \
+{ \
+ RunFunctionFmt(my_errorSAXFunc_fct_##A, "pppppppppp", a, b, c, d, e, f, g, h, i, j); \
}
SUPER()
#undef GO
@@ -954,10 +934,10 @@ static void* find_errorSAXFunc_Fct(void* fct) // this one have a VAArg
}
// fatalErrorSAXFunc ...
#define GO(A) \
-static uintptr_t my_fatalErrorSAXFunc_fct_##A = 0; \
-static void my_fatalErrorSAXFunc_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g, void* h, void* i, void* j)\
-{ \
- RunFunction(my_context, my_fatalErrorSAXFunc_fct_##A, 10, a, b, c, d, e, f, g, h, i, j); \
+static uintptr_t my_fatalErrorSAXFunc_fct_##A = 0; \
+static void my_fatalErrorSAXFunc_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g, void* h, void* i, void* j) \
+{ \
+ RunFunctionFmt(my_fatalErrorSAXFunc_fct_##A, "pppppppppp", a, b, c, d, e, f, g, h, i, j); \
}
SUPER()
#undef GO
@@ -976,10 +956,10 @@ static void* find_fatalErrorSAXFunc_Fct(void* fct) // this one have a VAArg
}
// getParameterEntitySAXFunc ...
#define GO(A) \
-static uintptr_t my_getParameterEntitySAXFunc_fct_##A = 0; \
-static void* my_getParameterEntitySAXFunc_##A(void* a, void* b) \
-{ \
- return (void*)RunFunction(my_context, my_getParameterEntitySAXFunc_fct_##A, 2, a, b); \
+static uintptr_t my_getParameterEntitySAXFunc_fct_##A = 0; \
+static void* my_getParameterEntitySAXFunc_##A(void* a, void* b) \
+{ \
+ return (void*)RunFunctionFmt(my_getParameterEntitySAXFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
@@ -998,10 +978,10 @@ static void* find_getParameterEntitySAXFunc_Fct(void* fct) // this one have a VA
}
// cdataBlockSAXFunc ...
#define GO(A) \
-static uintptr_t my_cdataBlockSAXFunc_fct_##A = 0; \
-static void my_cdataBlockSAXFunc_##A(void* a, void* b, int c) \
-{ \
- RunFunction(my_context, my_cdataBlockSAXFunc_fct_##A, 3, a, b, c); \
+static uintptr_t my_cdataBlockSAXFunc_fct_##A = 0; \
+static void my_cdataBlockSAXFunc_##A(void* a, void* b, int c) \
+{ \
+ RunFunctionFmt(my_cdataBlockSAXFunc_fct_##A, "ppi", a, b, c); \
}
SUPER()
#undef GO
@@ -1020,10 +1000,10 @@ static void* find_cdataBlockSAXFunc_Fct(void* fct) // this one have a VAArg
}
// externalSubsetSAXFunc ...
#define GO(A) \
-static uintptr_t my_externalSubsetSAXFunc_fct_##A = 0; \
-static void my_externalSubsetSAXFunc_##A(void* a, void* b, void* c, void* d) \
-{ \
- RunFunction(my_context, my_externalSubsetSAXFunc_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_externalSubsetSAXFunc_fct_##A = 0; \
+static void my_externalSubsetSAXFunc_##A(void* a, void* b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_externalSubsetSAXFunc_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -1045,7 +1025,7 @@ static void* find_externalSubsetSAXFunc_Fct(void* fct) // this one have a VAArg
static uintptr_t my_xmlSAX2StartElementNs_fct_##A = 0; \
static void my_xmlSAX2StartElementNs_##A(void* a, void* b, void* c, void* d, int e, void* f, int g, int h, void* i) \
{ \
- RunFunction(my_context, my_xmlSAX2StartElementNs_fct_##A, 9, a, b, c, d, e, f, g, h, i); \
+ RunFunctionFmt(my_xmlSAX2StartElementNs_fct_##A, "ppppipiip", a, b, c, d, e, f, g, h, i); \
}
SUPER()
#undef GO
@@ -1064,10 +1044,10 @@ static void* find_xmlSAX2StartElementNs_Fct(void* fct) // this one have a VAArg
}
// xmlSAX2EndElementNs ...
#define GO(A) \
-static uintptr_t my_xmlSAX2EndElementNs_fct_##A = 0; \
-static void my_xmlSAX2EndElementNs_##A(void* a, void* b, void* c, void* d) \
-{ \
- RunFunction(my_context, my_xmlSAX2EndElementNs_fct_##A, 4, a, b, c, d); \
+static uintptr_t my_xmlSAX2EndElementNs_fct_##A = 0; \
+static void my_xmlSAX2EndElementNs_##A(void* a, void* b, void* c, void* d) \
+{ \
+ RunFunctionFmt(my_xmlSAX2EndElementNs_fct_##A, "pppp", a, b, c, d); \
}
SUPER()
#undef GO
@@ -1087,10 +1067,10 @@ static void* find_xmlSAX2EndElementNs_Fct(void* fct) // this one have a VAArg
// xmlExternalEntityLoader
#define GO(A) \
-static uintptr_t my_xmlExternalEntityLoader_fct_##A = 0; \
-static void* my_xmlExternalEntityLoader_##A(void* a, void* b, void* c) \
-{ \
- return (void*)RunFunction(my_context, my_xmlExternalEntityLoader_fct_##A, 3, a, b, c); \
+static uintptr_t my_xmlExternalEntityLoader_fct_##A = 0; \
+static void* my_xmlExternalEntityLoader_##A(void* a, void* b, void* c) \
+{ \
+ return (void*)RunFunctionFmt(my_xmlExternalEntityLoader_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
@@ -1119,6 +1099,146 @@ static void* reverse_xmlExternalEntityLoaderFct(void* fct)
}
+// xmlGenericErrorFunc
+#define GO(A) \
+static uintptr_t my_xmlGenericErrorFunc_fct_##A = 0; \
+static void my_xmlGenericErrorFunc_##A(void* a, const char* fmt, ...) \
+{ \
+ char buf[4096]; \
+ va_list args; \
+ va_start(args, fmt); \
+ vsnprintf(buf, 4096, fmt, args); \
+ va_end(args); \
+ RunFunctionFmt(my_xmlGenericErrorFunc_fct_##A, "pp", a, buf); \
+}
+SUPER()
+#undef GO
+static void* find_xmlGenericErrorFunc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_xmlGenericErrorFunc_fct_##A == (uintptr_t)fct) return my_xmlGenericErrorFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_xmlGenericErrorFunc_fct_##A == 0) {my_xmlGenericErrorFunc_fct_##A = (uintptr_t)fct; return my_xmlGenericErrorFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlGenericErrorFunc callback\n");
+ return NULL;
+}
+static void* reverse_xmlGenericErrorFunc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my_xmlGenericErrorFunc_##A == fct) return (void*)my_xmlGenericErrorFunc_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, vFpp, fct, 0, "xmlGenericErrorFunc_callback");
+}
+
+// xmlStructuredErrorFunc
+#define GO(A) \
+static uintptr_t my_xmlStructuredErrorFunc_fct_##A = 0; \
+static void my_xmlStructuredErrorFunc_##A(void* a, const char* b) \
+{ \
+ RunFunctionFmt(my_xmlStructuredErrorFunc_fct_##A, "pp", a, b); \
+}
+SUPER()
+#undef GO
+static void* find_xmlStructuredErrorFunc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_xmlStructuredErrorFunc_fct_##A == (uintptr_t)fct) return my_xmlStructuredErrorFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_xmlStructuredErrorFunc_fct_##A == 0) {my_xmlStructuredErrorFunc_fct_##A = (uintptr_t)fct; return my_xmlStructuredErrorFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlStructuredErrorFunc callback\n");
+ return NULL;
+}
+static void* reverse_xmlStructuredErrorFunc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(CheckBridged(my_lib->w.bridge, fct))
+ return (void*)CheckBridged(my_lib->w.bridge, fct);
+ #define GO(A) if(my_xmlStructuredErrorFunc_##A == fct) return (void*)my_xmlStructuredErrorFunc_fct_##A;
+ SUPER()
+ #undef GO
+ return (void*)AddBridge(my_lib->w.bridge, vFpp, fct, 0, "xmlStructuredErrorFunc_callback");
+}
+
+// xmlOutputMatchCallback ...
+#define GO(A) \
+static uintptr_t my_xmlOutputMatchCallback_fct_##A = 0; \
+static int my_xmlOutputMatchCallback_##A(void* a) \
+{ \
+ return (int)RunFunctionFmt(my_xmlOutputMatchCallback_fct_##A, "p", a); \
+}
+SUPER()
+#undef GO
+static void* find_xmlOutputMatchCallback_Fct(void* fct) // this one have a VAArg
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_xmlOutputMatchCallback_fct_##A == (uintptr_t)fct) return my_xmlOutputMatchCallback_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_xmlOutputMatchCallback_fct_##A == 0) {my_xmlOutputMatchCallback_fct_##A = (uintptr_t)fct; return my_xmlOutputMatchCallback_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlOutputMatchCallback callback\n");
+ return NULL;
+}
+
+// xmlOutputOpenCallback ...
+#define GO(A) \
+static uintptr_t my_xmlOutputOpenCallback_fct_##A = 0; \
+static void* my_xmlOutputOpenCallback_##A(void* a) \
+{ \
+ return (void*)RunFunctionFmt(my_xmlOutputOpenCallback_fct_##A, "p", a); \
+}
+SUPER()
+#undef GO
+static void* find_xmlOutputOpenCallback_Fct(void* fct) // this one have a VAArg
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_xmlOutputOpenCallback_fct_##A == (uintptr_t)fct) return my_xmlOutputOpenCallback_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_xmlOutputOpenCallback_fct_##A == 0) {my_xmlOutputOpenCallback_fct_##A = (uintptr_t)fct; return my_xmlOutputOpenCallback_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlOutputOpenCallback callback\n");
+ return NULL;
+}
+
+// xmlTextReaderErrorFunc ...
+#define GO(A) \
+static uintptr_t my_xmlTextReaderErrorFunc_fct_##A = 0; \
+static void my_xmlTextReaderErrorFunc_##A(void* a, void* b, int c, void* d) \
+{ \
+ RunFunctionFmt(my_xmlTextReaderErrorFunc_fct_##A, "ppip", a, b, c, d); \
+}
+SUPER()
+#undef GO
+static void* find_xmlTextReaderErrorFunc_Fct(void* fct) // this one have a VAArg
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_xmlTextReaderErrorFunc_fct_##A == (uintptr_t)fct) return my_xmlTextReaderErrorFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_xmlTextReaderErrorFunc_fct_##A == 0) {my_xmlTextReaderErrorFunc_fct_##A = (uintptr_t)fct; return my_xmlTextReaderErrorFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlTextReaderErrorFunc callback\n");
+ return NULL;
+}
+
#undef SUPER
EXPORT void* my_xmlHashCopy(x64emu_t* emu, void* table, void* f)
@@ -1317,6 +1437,59 @@ EXPORT void* my_xmlCreateIOParserCtxt(x64emu_t* emu, my_xmlSAXHandler_t** p, voi
return ret;
}
+EXPORT void* my___xmlGenericError(x64emu_t* emu)
+{
+ return reverse_xmlGenericErrorFunc_Fct(my->__xmlGenericError());
+}
+
+EXPORT void* my___xmlStructuredError(x64emu_t* emu)
+{
+ return reverse_xmlStructuredErrorFunc_Fct(my->__xmlStructuredError());
+}
+
+EXPORT void my_xmlSetGenericErrorFunc(x64emu_t* emu, void* ctx, void* f)
+{
+ my->xmlSetGenericErrorFunc(ctx, find_xmlGenericErrorFunc_Fct(f));
+}
+
+EXPORT void my_xmlSetStructuredErrorFunc(x64emu_t* emu, void* ctx, void* f)
+{
+ my->xmlSetStructuredErrorFunc(ctx, find_xmlStructuredErrorFunc_Fct(f));
+}
+
+EXPORT int my_xmlRegisterOutputCallbacks(x64emu_t* emu, void* match, void* open, void* write, void* close)
+{
+ return my->xmlRegisterOutputCallbacks(find_xmlOutputMatchCallback_Fct(match), find_xmlOutputOpenCallback_Fct(open), find_xmlOutputWriteCallback_Fct(write), find_xmlOutputCloseCallback_Fct(close));
+}
+
+EXPORT int my_xmlTextWriterWriteVFormatAttribute(x64emu_t* emu, void* writer, void* name, void* fmt, x64_va_list_t b)
+{
+ #ifdef CONVERT_VALIST
+ CONVERT_VALIST(b);
+ #else
+ myStackAlignValist(emu, (const char*)fmt, emu->scratch, b);
+ PREPARE_VALIST;
+ #endif
+ return my->xmlTextWriterWriteVFormatAttribute(writer, name, fmt, VARARGS);
+}
+
+EXPORT int my_xmlTextWriterWriteFormatAttribute(x64emu_t* emu, void* writer, void* name, void* fmt, void* b)
+{
+ myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2);
+ PREPARE_VALIST;
+ return my->xmlTextWriterWriteVFormatAttribute(writer, name, fmt, VARARGS);
+}
+
+EXPORT void* my_xmlReaderForIO(void *emu, void * ioread, void * ioclose, void * ioctx, char * URL, char * encoding, int options)
+{
+ return my->xmlReaderForIO(find_xmlInputReadCallback_Fct(ioread), find_xmlInputCloseCallback_Fct(ioclose), ioctx, URL, encoding, options);
+}
+
+EXPORT void my_xmlTextReaderSetErrorHandler(x64emu_t* emu, void* reader, void* f, void* arg)
+{
+ my->xmlTextReaderSetErrorHandler(reader, find_xmlTextReaderErrorFunc_Fct(f), arg);
+}
+
#define CUSTOM_INIT \
getMy(lib);
diff --git a/src/wrapped/wrappedxml2_private.h b/src/wrapped/wrappedxml2_private.h
index bb0c185..4a43dac 100755..100644
--- a/src/wrapped/wrappedxml2_private.h
+++ b/src/wrapped/wrappedxml2_private.h
@@ -164,7 +164,7 @@ GO(xmlBufferWriteCHAR, vFpp)
GO(xmlBufferWriteQuotedString, vFpp)
GO(xmlBuildQName, pFpppi)
GO(xmlBuildRelativeURI, pFpp)
-//GO(xmlBuildURI,
+GO(xmlBuildURI, pFpp)
GO(xmlByteConsumed, lFp)
//GO(xmlC14NDocDumpMemory,
//GO(xmlC14NDocSave,
@@ -190,7 +190,7 @@ GO(xmlByteConsumed, lFp)
//GO(xmlCatalogResolveURI,
//GO(xmlCatalogSetDebug,
//GO(xmlCatalogSetDefaultPrefer,
-//GO(xmlCatalogSetDefaults,
+GO(xmlCatalogSetDefaults, vFi)
GO(xmlCharEncCloseFunc, iFp)
GO(xmlCharEncFirstLine, iFppp)
//GO(xmlCharEncFirstLineInt,
@@ -361,14 +361,14 @@ GO(xmlFreePropList, vFp)
GO(xmlFreeRefTable, vFp)
//GO(xmlFreeRMutex,
//GO(xmlFreeStreamCtxt,
-//GO(xmlFreeTextReader,
-//GO(xmlFreeTextWriter,
+GO(xmlFreeTextReader, vFp)
+GO(xmlFreeTextWriter, vFp)
//GO(xmlFreeURI,
GO(xmlFreeValidCtxt, vFp)
//GO(xmlGcMemGet,
//GO(xmlGcMemSetup,
-//GO(__xmlGenericError,
-//GO(__xmlGenericErrorContext,
+GOM(__xmlGenericError, pFEv)
+GO(__xmlGenericErrorContext, pFv)
//GO(xmlGenericErrorDefaultFunc,
GO(xmlGetBufferAllocationScheme, iFv)
GO(xmlGetCharEncodingHandler, pFp)
@@ -434,7 +434,7 @@ GOM(xmlHashUpdateEntry3, iFEpppppp)
GO(xmlHasFeature, iFi)
GO(xmlHasNsProp, pFppp)
GO(xmlHasProp, pFpp)
-//GO(__xmlIndentTreeOutput,
+GO(__xmlIndentTreeOutput, pFv)
GO(xmlInitCharEncodingHandlers, vFv)
GO(xmlInitializeDict, iFv)
GO(xmlInitGlobals, vFv)
@@ -622,7 +622,7 @@ GO(xmlNewTextLen, pFpi)
//GO(xmlNewTextWriter,
//GO(xmlNewTextWriterDoc,
//GO(xmlNewTextWriterFilename,
-//GO(xmlNewTextWriterMemory,
+GO(xmlNewTextWriterMemory, pFpi)
//GO(xmlNewTextWriterPushParser,
//GO(xmlNewTextWriterTree,
GO(xmlNewValidCtxt, pFv)
@@ -776,8 +776,8 @@ GO(xmlReadDoc, pFpppi)
//GO(xmlReaderForDoc,
//GO(xmlReaderForFd,
//GO(xmlReaderForFile,
-//GO(xmlReaderForIO,
-//GO(xmlReaderForMemory,
+GOM(xmlReaderForIO, pFEpppppi)
+GO(xmlReaderForMemory, pFpippi)
//GO(xmlReaderNewDoc,
//GO(xmlReaderNewFd,
//GO(xmlReaderNewFile,
@@ -811,7 +811,7 @@ GO(xmlRegisterHTTPPostCallbacks, vFv)
GOM(xmlRegisterInputCallbacks, iFEpppp)
//GOM(xmlRegisterNodeDefault, BFEB)
//GO(__xmlRegisterNodeDefaultValue,
-//GOM(xmlRegisterOutputCallbacks, iFEBBBB)
+GOM(xmlRegisterOutputCallbacks, iFEpppp)
//GO(xmlRegNewExecCtxt,
//GO(xmlRelaxNGCleanupTypes,
//GO(xmlRelaxNGDump,
@@ -851,8 +851,8 @@ GO(xmlSaveFile, iFpp)
GO(xmlSaveFileEnc, iFppp)
GO(xmlSaveFileTo, iFppp)
GO(xmlSaveFlush, iFp)
-//GO(xmlSaveFormatFile,
-//GO(xmlSaveFormatFileEnc,
+GO(xmlSaveFormatFile, iFppi)
+GO(xmlSaveFormatFileEnc, iFpppi)
//GO(xmlSaveFormatFileTo,
//GO(__xmlSaveNoEmptyTags,
//GOM(xmlSaveSetAttrEscape, iFEpB)
@@ -988,12 +988,12 @@ GO(xmlSetCompressMode, vFi)
GO(xmlSetDocCompressMode, vFpi)
GOM(xmlSetExternalEntityLoader, vFEp)
GO(xmlSetFeature, iFppp)
-//GO(xmlSetGenericErrorFunc,
+GOM(xmlSetGenericErrorFunc, vFEpp)
GO(xmlSetListDoc, vFpp)
GO(xmlSetNs, vFpp)
GO(xmlSetNsProp, pFpppp)
GO(xmlSetProp, pFppp)
-//GO(xmlSetStructuredErrorFunc,
+GOM(xmlSetStructuredErrorFunc, vFEpp)
GO(xmlSetTreeDoc, vFpp)
GO(xmlSetupParserForBuffer, vFppp)
//GO(__xmlSimpleError,
@@ -1031,7 +1031,7 @@ GO2(xmlStrPrintf, iFpipV, xmlStrVPrintf)
GO(xmlStrQEqual, iFppp)
GO(xmlStrstr, pFpp)
GO(xmlStrsub, pFpii)
-//GO(__xmlStructuredError,
+GOM(__xmlStructuredError, pFEv)
//GO(__xmlStructuredErrorContext,
GO(xmlStrVPrintf, iFpipp)
GO(xmlSubstituteEntitiesDefault, iFi)
@@ -1047,19 +1047,19 @@ GO(xmlTextMerge, pFpp)
//GO(xmlTextReaderClose,
//GO(xmlTextReaderConstBaseUri,
//GO(xmlTextReaderConstEncoding,
-//GO(xmlTextReaderConstLocalName,
-//GO(xmlTextReaderConstName,
+GO(xmlTextReaderConstLocalName, pFp)
+GO(xmlTextReaderConstName, pFp)
//GO(xmlTextReaderConstNamespaceUri,
//GO(xmlTextReaderConstPrefix,
//GO(xmlTextReaderConstString,
-//GO(xmlTextReaderConstValue,
+GO(xmlTextReaderConstValue, pFp)
//GO(xmlTextReaderConstXmlLang,
//GO(xmlTextReaderConstXmlVersion,
//GO(xmlTextReaderCurrentDoc,
//GO(xmlTextReaderCurrentNode,
//GO(xmlTextReaderDepth,
//GO(xmlTextReaderExpand,
-//GO(xmlTextReaderGetAttribute,
+GO(xmlTextReaderGetAttribute, pFpp)
//GO(xmlTextReaderGetAttributeNo,
//GO(xmlTextReaderGetAttributeNs,
//GO(xmlTextReaderGetErrorHandler,
@@ -1067,33 +1067,33 @@ GO(xmlTextMerge, pFpp)
//GO(xmlTextReaderGetParserLineNumber,
//GO(xmlTextReaderGetParserProp,
//GO(xmlTextReaderGetRemainder,
-//GO(xmlTextReaderHasAttributes,
+GO(xmlTextReaderHasAttributes, iFp)
//GO(xmlTextReaderHasValue,
//GO(xmlTextReaderIsDefault,
-//GO(xmlTextReaderIsEmptyElement,
-//GO(xmlTextReaderIsNamespaceDecl,
+GO(xmlTextReaderIsEmptyElement, iFp)
+GO(xmlTextReaderIsNamespaceDecl, iFp)
//GO(xmlTextReaderIsValid,
//GO(xmlTextReaderLocalName,
//GO(xmlTextReaderLocatorBaseURI,
//GO(xmlTextReaderLocatorLineNumber,
-//GO(xmlTextReaderLookupNamespace,
+GO(xmlTextReaderLookupNamespace, pFpp)
//GO(xmlTextReaderMoveToAttribute,
//GO(xmlTextReaderMoveToAttributeNo,
//GO(xmlTextReaderMoveToAttributeNs,
-//GO(xmlTextReaderMoveToElement,
-//GO(xmlTextReaderMoveToFirstAttribute,
-//GO(xmlTextReaderMoveToNextAttribute,
+GO(xmlTextReaderMoveToElement, iFp)
+GO(xmlTextReaderMoveToFirstAttribute, iFp)
+GO(xmlTextReaderMoveToNextAttribute, iFp)
//GO(xmlTextReaderName,
//GO(xmlTextReaderNamespaceUri,
//GO(xmlTextReaderNext,
//GO(xmlTextReaderNextSibling,
-//GO(xmlTextReaderNodeType,
+GO(xmlTextReaderNodeType, iFp)
//GO(xmlTextReaderNormalization,
//GO(xmlTextReaderPrefix,
//GO(xmlTextReaderPreserve,
//GO(xmlTextReaderPreservePattern,
//GO(xmlTextReaderQuoteChar,
-//GO(xmlTextReaderRead,
+GO(xmlTextReaderRead, iFp)
//GO(xmlTextReaderReadAttributeValue,
//GO(xmlTextReaderReadInnerXml,
//GO(xmlTextReaderReadOuterXml,
@@ -1103,7 +1103,7 @@ GO(xmlTextMerge, pFpp)
//GO(xmlTextReaderRelaxNGValidate,
//GO(xmlTextReaderSchemaValidate,
//GO(xmlTextReaderSchemaValidateCtxt,
-//GO(xmlTextReaderSetErrorHandler,
+GOM(xmlTextReaderSetErrorHandler, vFEppp)
//GO(xmlTextReaderSetParserProp,
//GO(xmlTextReaderSetSchema,
//GO(xmlTextReaderSetStructuredErrorHandler,
@@ -1114,32 +1114,32 @@ GO(xmlTextMerge, pFpp)
//GO(xmlTextWriterEndAttribute,
//GO(xmlTextWriterEndCDATA,
//GO(xmlTextWriterEndComment,
-//GO(xmlTextWriterEndDocument,
+GO(xmlTextWriterEndDocument, iFp)
//GO(xmlTextWriterEndDTD,
//GO(xmlTextWriterEndDTDAttlist,
//GO(xmlTextWriterEndDTDElement,
//GO(xmlTextWriterEndDTDEntity,
-//GO(xmlTextWriterEndElement,
+GO(xmlTextWriterEndElement, iFp)
//GO(xmlTextWriterEndPI,
//GO(xmlTextWriterFlush,
//GO(xmlTextWriterFullEndElement,
-//GO(xmlTextWriterSetIndent,
+GO(xmlTextWriterSetIndent, iFpi)
//GO(xmlTextWriterSetIndentString,
//GO(xmlTextWriterStartAttribute,
//GO(xmlTextWriterStartAttributeNS,
//GO(xmlTextWriterStartCDATA,
//GO(xmlTextWriterStartComment,
-//GO(xmlTextWriterStartDocument,
+GO(xmlTextWriterStartDocument, iFpppp)
//GO(xmlTextWriterStartDTD,
//GO(xmlTextWriterStartDTDAttlist,
//GO(xmlTextWriterStartDTDElement,
//GO(xmlTextWriterStartDTDEntity,
-//GO(xmlTextWriterStartElement,
+GO(xmlTextWriterStartElement, iFpp)
//GO(xmlTextWriterStartElementNS,
//GO(xmlTextWriterStartPI,
-//GO(xmlTextWriterWriteAttribute,
+GO(xmlTextWriterWriteAttribute, iFppp)
//GO(xmlTextWriterWriteAttributeNS,
-//GO(xmlTextWriterWriteBase64,
+GO(xmlTextWriterWriteBase64, iFppii)
//GO(xmlTextWriterWriteBinHex,
//GO(xmlTextWriterWriteCDATA,
//GO(xmlTextWriterWriteComment,
@@ -1153,7 +1153,7 @@ GO(xmlTextMerge, pFpp)
//GO(xmlTextWriterWriteDTDNotation,
//GO(xmlTextWriterWriteElement,
//GO(xmlTextWriterWriteElementNS,
-//GO(xmlTextWriterWriteFormatAttribute,
+GOM(xmlTextWriterWriteFormatAttribute, iFEpppV)
//GO(xmlTextWriterWriteFormatAttributeNS,
//GO(xmlTextWriterWriteFormatCDATA,
//GO(xmlTextWriterWriteFormatComment,
@@ -1169,8 +1169,8 @@ GO(xmlTextMerge, pFpp)
//GO(xmlTextWriterWritePI,
//GO(xmlTextWriterWriteRaw,
//GO(xmlTextWriterWriteRawLen,
-//GO(xmlTextWriterWriteString,
-//GO(xmlTextWriterWriteVFormatAttribute,
+GO(xmlTextWriterWriteString, iFpp)
+GOM(xmlTextWriterWriteVFormatAttribute, iFEpppA)
//GO(xmlTextWriterWriteVFormatAttributeNS,
//GO(xmlTextWriterWriteVFormatCDATA,
//GO(xmlTextWriterWriteVFormatComment,
diff --git a/src/wrapped/wrappedxslt.c b/src/wrapped/wrappedxslt.c
index 41e6863..ad145b2 100755..100644
--- a/src/wrapped/wrappedxslt.c
+++ b/src/wrapped/wrappedxslt.c
@@ -40,10 +40,10 @@ GO(4)
// xmlXPathFunction ...
#define GO(A) \
-static uintptr_t my_xmlXPathFunction_fct_##A = 0; \
-static void my_xmlXPathFunction_##A(void* a, int b) \
-{ \
- RunFunction(my_context, my_xmlXPathFunction_fct_##A, 2, a, b); \
+static uintptr_t my_xmlXPathFunction_fct_##A = 0; \
+static void my_xmlXPathFunction_##A(void* a, int b) \
+{ \
+ RunFunctionFmt(my_xmlXPathFunction_fct_##A, "pi", a, b); \
}
SUPER()
#undef GO
@@ -62,10 +62,10 @@ static void* find_xmlXPathFunction_Fct(void* fct)
}
// xsltDocLoaderFunc ...
#define GO(A) \
-static uintptr_t my_xsltDocLoaderFunc_fct_##A = 0; \
-static void* my_xsltDocLoaderFunc_##A(void* a, void* b, int c, void* d, int e) \
-{ \
- return (void*)RunFunction(my_context, my_xsltDocLoaderFunc_fct_##A, 5, a, b, c, d, e); \
+static uintptr_t my_xsltDocLoaderFunc_fct_##A = 0; \
+static void* my_xsltDocLoaderFunc_##A(void* a, void* b, int c, void* d, int e) \
+{ \
+ return (void*)RunFunctionFmt(my_xsltDocLoaderFunc_fct_##A, "ppipi", a, b, c, d, e); \
}
SUPER()
#undef GO
@@ -82,7 +82,50 @@ static void* find_xsltDocLoaderFunc_Fct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for libxslt xsltDocLoaderFunc callback\n");
return NULL;
}
-
+// xsltSecurityCheck ...
+#define GO(A) \
+static uintptr_t my_xsltSecurityCheck_fct_##A = 0; \
+static int my_xsltSecurityCheck_##A(void* a, void* b, void* c) \
+{ \
+ return (int)RunFunctionFmt(my_xsltSecurityCheck_fct_##A, "ppp", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_xsltSecurityCheck_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_xsltSecurityCheck_fct_##A == (uintptr_t)fct) return my_xsltSecurityCheck_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_xsltSecurityCheck_fct_##A == 0) {my_xsltSecurityCheck_fct_##A = (uintptr_t)fct; return my_xsltSecurityCheck_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libxslt xsltSecurityCheck callback\n");
+ return NULL;
+}
+// xsltSortFunc ...
+#define GO(A) \
+static uintptr_t my_xsltSortFunc_fct_##A = 0; \
+static void my_xsltSortFunc_##A(void* a, void* b, int c) \
+{ \
+ RunFunctionFmt(my_xsltSortFunc_fct_##A, "ppi", a, b, c); \
+}
+SUPER()
+#undef GO
+static void* find_xsltSortFunc_Fct(void* fct)
+{
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_xsltSortFunc_fct_##A == (uintptr_t)fct) return my_xsltSortFunc_##A;
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_xsltSortFunc_fct_##A == 0) {my_xsltSortFunc_fct_##A = (uintptr_t)fct; return my_xsltSortFunc_##A; }
+ SUPER()
+ #undef GO
+ printf_log(LOG_NONE, "Warning, no more slot for libxslt xsltSortFunc callback\n");
+ return NULL;
+}
#undef SUPER
EXPORT int my_xsltRegisterExtModuleFunction(x64emu_t* emu, void* name, void* URI, void* f)
@@ -95,6 +138,21 @@ EXPORT void my_xsltSetLoaderFunc(x64emu_t* emu, void* f)
my->xsltSetLoaderFunc(find_xsltDocLoaderFunc_Fct(f));
}
+EXPORT int my_xsltRegisterExtFunction(x64emu_t* emu, void* ctx, void* name, void* uri, void* f)
+{
+ return my->xsltRegisterExtFunction(ctx, name, uri, find_xmlXPathFunction_Fct(f));
+}
+
+EXPORT int my_xsltSetSecurityPrefs(x64emu_t* emu, void* sec, void* option, void* f)
+{
+ return my->xsltSetSecurityPrefs(sec, option, find_xsltSecurityCheck_Fct(f));
+}
+
+EXPORT void my_xsltSetCtxtSortFunc(x64emu_t* emu, void* ctx, void* handler)
+{
+ return my->xsltSetCtxtSortFunc(ctx, find_xsltSortFunc_Fct(handler));
+}
+
#define CUSTOM_INIT \
getMy(lib);
diff --git a/src/wrapped/wrappedxslt_private.h b/src/wrapped/wrappedxslt_private.h
index f769d94..24c3db7 100755..100644
--- a/src/wrapped/wrappedxslt_private.h
+++ b/src/wrapped/wrappedxslt_private.h
@@ -56,7 +56,7 @@ GO(xsltDocumentSortFunction, vFp)
GO(xsltDoSortFunction, vFppi)
GO(xsltElement, vFpppp)
//GO(xsltElementAvailableFunction,
-//GO(xsltEvalAttrValueTemplate,
+GO(xsltEvalAttrValueTemplate, pFpppp)
GO(xsltEvalAVT, pFppp)
GO(xsltEvalGlobalVariables, iFp)
GO(xsltEvalOneUserParam, iFppp)
@@ -180,7 +180,7 @@ GO(xsltRegisterAllElement, vFp)
GO(xsltRegisterAllExtras, vFv)
//GO(xsltRegisterAllFunctions,
//GOM(xsltRegisterExtElement, iFEpppB)
-//GOM(xsltRegisterExtFunction, iFEpppB)
+GOM(xsltRegisterExtFunction, iFEpppp)
//GOM(xsltRegisterExtModule, iFEpBB)
//GOM(xsltRegisterExtModuleElement, iFEppBB)
//GOM(xsltRegisterExtModuleFull, iFEpBBBB)
@@ -207,14 +207,14 @@ GO(xsltSecurityAllow, iFppp)
GO(xsltSecurityForbid, iFppp)
GO(xsltSetCtxtParseOptions, iFpi)
GO(xsltSetCtxtSecurityPrefs, iFpp)
-//GOM(xsltSetCtxtSortFunc, vFEpB)
+GOM(xsltSetCtxtSortFunc, vFEpp)
//GOM(xsltSetDebuggerCallbacks, iFip)
GO(xsltSetDebuggerStatus, vFi)
GO(xsltSetDefaultSecurityPrefs, vFp)
//GOM(xsltSetGenericDebugFunc, vFEpB)
//GOM(xsltSetGenericErrorFunc, vFEpB)
GOM(xsltSetLoaderFunc, vFEp)
-//GOM(xsltSetSecurityPrefs, iFEppB)
+GOM(xsltSetSecurityPrefs, iFEppp)
//GOM(xsltSetSortFunc, vFEp)
//GO(MxsltSetTransformErrorFunc, vFEppB)
GO(xsltSetXIncludeDefault, vFi)
diff --git a/system/box64.box64rc b/system/box64.box64rc
index 746665f..ae2dfba 100644
--- a/system/box64.box64rc
+++ b/system/box64.box64rc
@@ -7,7 +7,6 @@
#
[3dSen.x86_64]
BOX64_DYNAREC_BLEEDING_EDGE=0 # avoid the use of STRONGMEM for much better performances
-BOX64_DYNAREC_HOTPAGE=0 # disabling hotpage seems to give better performances here
[7z]
# Those are safe to use on 7z and give a bit of a boost
@@ -26,12 +25,6 @@ BOX64_DYNAREC_CALLRET=1
[chrome]
BOX64_MALLOC_HACK=2
-[dav1d]
-# Speed hacks (those 3 gives ~10% speedup)
-BOX64_DYNAREC_SAFEFLAGS=0
-BOX64_DYNAREC_BIGBLOCK=2
-BOX64_DYNAREC_CALLRET=1
-
[deadcells]
BOX64_PREFER_EMULATED=1
@@ -51,6 +44,7 @@ BOX64_DYNAREC_SAFEFLAGS=0
BOX64_DYNAREC_BIGBLOCK=2
BOX64_DYNAREC_FORWARD=1024
BOX64_DYNAREC_CALLRET=1
+BOX64_DYNAREC_FASTROUND=0
[heroic]
BOX64_NOSANDBOX=1
@@ -58,6 +52,9 @@ BOX64_MALLOC_HACK=2
# this is to save some memory
BOX64_DYNAREC_BIGBLOCK=0
+[LotCG.x86_64]
+BOX64_DYNAREC_FASTROUND=0
+
[nacl_helper]
BOX64_MALLOC_HACK=1
@@ -66,11 +63,21 @@ BOX64_EMULATED_LIBS=libopenal.so.1
BOX64_DYNAREC_SAFEFLAGS=0
BOX64_DYNAREC_BIGBLOCK=3
BOX64_DYNAREC_FORWARD=1024
-BOX64_DYNAREC_CALLRET=1
+#BOX64_DYNAREC_CALLRET=1 #New jmpbuf handling tend to break this optim!
[pressure-vessel-wrap]
BOX64_NOGTK=1
+[ProjectZomboid64]
+# This one is still a bit unstable. This might help, but will also slowdown emulation
+BOX64_DYNAREC_STRONGMEM=2
+BOX64_DYNAREC_SAFEFLAGS=2
+BOX64_DYNAREC_JVM=0
+
+[Soma.bin.x86_64]
+# This is needed or the physics engine will not behave correctly
+BOX64_DYNAREC_FASTROUND=0
+
[steam]
BOX64_CRASHHANDLER=1
BOX64_EMULATED_LIBS=libudev.so.0
@@ -90,6 +97,9 @@ BOX64_DYNAREC_BIGBLOCK=0
[steam-runtime-check-requirements]
BOX64_EXIT=1
+[steam-runtime-launcher-service]
+BOX64_NOGTK=1
+
[Torchlight2.bin.x86_64]
# Those are safe to use on 7z and give a bit of a boost
BOX64_DYNAREC_SAFEFLAGS=0
@@ -97,6 +107,10 @@ BOX64_DYNAREC_BIGBLOCK=2
BOX64_DYNAREC_FORWARD=512
BOX64_DYNAREC_CALLRET=1
+[weixin]
+BOX64_MALLOC_HACK=2
+BOX64_NOSANDBOX=1
+
#
# Wine process
#
diff --git a/system/box64.conf.cmake b/system/box64.conf.cmake
index 7dbdc5d..7dbdc5d 100755..100644
--- a/system/box64.conf.cmake
+++ b/system/box64.conf.cmake
diff --git a/tests/benchfloat.c b/tests/benchfloat.c
index 93b8207..93b8207 100755..100644
--- a/tests/benchfloat.c
+++ b/tests/benchfloat.c
diff --git a/tests/ref17.txt b/tests/ref17.txt
index 97e5ea8..865dabc 100644
--- a/tests/ref17.txt
+++ b/tests/ref17.txt
@@ -489,9 +489,9 @@ mulsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2
subsd(1 2 , 1 2 ) = 0 2
subsd(1 2 , 0 -2 ) = 1 2
subsd(1 2 , inf -inf ) = -inf 2
-subsd(1 2 , 0x7ff8000000000000 -0 ) = 0xfff8000000000000 2
-subsd(0 -2 , 0x7ff8000000000000 -0 ) = 0xfff8000000000000 -2
-subsd(inf -inf , 0x7ff8000000000000 -0 ) = 0xfff8000000000000 -inf
+subsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2
+subsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2
+subsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf
subsd(1 2 , 2 1 ) = -1 2
subsd(1 2 , -2 0 ) = 3 2
subsd(1 2 , -inf inf ) = inf 2
@@ -532,5 +532,9 @@ maxsd(1 2 , 2 1 ) = 2 2
maxsd(1 2 , -2 0 ) = 1 2
maxsd(1 2 , -inf inf ) = 1 2
maxsd(1 2 , -0 0x7ff8000000000000 ) = 1 2
-maxsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2
-maxsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2
+maxsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2
+maxsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2
+cvtps2pd(1 2 3 -4 ) = 0x1 0x2 0x3 0xfffffffc
+cvtps2pd(0 -2 -10 0.5 ) = 0x0 0xfffffffe 0xfffffff6 0x0
+cvtps2pd(inf -inf -inf 1 ) = 0x80000000 0x80000000 0x80000000 0x1
+cvtps2pd(nan -0 nan inf ) = 0x80000000 0x0 0x80000000 0x80000000
diff --git a/tests/ref22.txt b/tests/ref22.txt
index 0b90c20..9538e7a 100644
--- a/tests/ref22.txt
+++ b/tests/ref22.txt
@@ -1,222 +1,1224 @@
FUCOMI 0x0 0x4082c00000000000 --C
FUCOMPP 0x0 0x4082c00000000000 --C
-FRNDINT 0x0 => 0x0
-FRNDINT 0x4082c00000000000 => 0x4082c00000000000
-FISTP 0x0 => word: 0
-FISTP 0x4082c00000000000 => word: 258
-FISTP 0x0 => long: 0
-FISTP 0x4082c00000000000 => long: 258
-FISTP 0x0 => quad: 0
-FISTP 0x4082c00000000000 => quad: 258
+Rounding 0
+ FRNDINT 0x0 => 0x0
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FISTP 0x0 => word: 0
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x0 => long: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x0 => quad: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x0 => word: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x0 => long: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x0 => quad: 0
+ FISTTP 0x4082c00000000000 => quad: 258
+Rounding 1
+ FRNDINT 0x0 => 0x0
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FISTP 0x0 => word: 0
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x0 => long: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x0 => quad: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x0 => word: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x0 => long: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x0 => quad: 0
+ FISTTP 0x4082c00000000000 => quad: 258
+Rounding 2
+ FRNDINT 0x0 => 0x0
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FISTP 0x0 => word: 0
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x0 => long: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x0 => quad: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x0 => word: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x0 => long: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x0 => quad: 0
+ FISTTP 0x4082c00000000000 => quad: 258
FUCOMI 0x4082c00000000000 0x0 ---
FUCOMPP 0x4082c00000000000 0x0 ---
-FRNDINT 0x4082c00000000000 => 0x4082c00000000000
-FRNDINT 0x0 => 0x0
-FISTP 0x4082c00000000000 => word: 258
-FISTP 0x0 => word: 0
-FISTP 0x4082c00000000000 => long: 258
-FISTP 0x0 => long: 0
-FISTP 0x4082c00000000000 => quad: 258
-FISTP 0x0 => quad: 0
+Rounding 0
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FRNDINT 0x0 => 0x0
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x0 => word: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x0 => long: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTP 0x0 => quad: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x0 => word: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x0 => long: 0
+ FISTTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x0 => quad: 0
+Rounding 1
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FRNDINT 0x0 => 0x0
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x0 => word: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x0 => long: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTP 0x0 => quad: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x0 => word: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x0 => long: 0
+ FISTTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x0 => quad: 0
+Rounding 2
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FRNDINT 0x0 => 0x0
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x0 => word: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x0 => long: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTP 0x0 => quad: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x0 => word: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x0 => long: 0
+ FISTTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x0 => quad: 0
FUCOMI 0x8000000000000000 0x4082c00000000000 --C
FUCOMPP 0x8000000000000000 0x4082c00000000000 --C
-FRNDINT 0x8000000000000000 => 0x8000000000000000
-FRNDINT 0x4082c00000000000 => 0x4082c00000000000
-FISTP 0x8000000000000000 => word: 0
-FISTP 0x4082c00000000000 => word: 258
-FISTP 0x8000000000000000 => long: 0
-FISTP 0x4082c00000000000 => long: 258
-FISTP 0x8000000000000000 => quad: 0
-FISTP 0x4082c00000000000 => quad: 258
+Rounding 0
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x8000000000000000 => quad: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x8000000000000000 => quad: 0
+ FISTTP 0x4082c00000000000 => quad: 258
+Rounding 1
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x8000000000000000 => quad: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x8000000000000000 => quad: 0
+ FISTTP 0x4082c00000000000 => quad: 258
+Rounding 2
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x8000000000000000 => quad: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x8000000000000000 => quad: 0
+ FISTTP 0x4082c00000000000 => quad: 258
FUCOMI 0x4082c00000000000 0x8000000000000000 ---
FUCOMPP 0x4082c00000000000 0x8000000000000000 ---
-FRNDINT 0x4082c00000000000 => 0x4082c00000000000
-FRNDINT 0x8000000000000000 => 0x8000000000000000
-FISTP 0x4082c00000000000 => word: 258
-FISTP 0x8000000000000000 => word: 0
-FISTP 0x4082c00000000000 => long: 258
-FISTP 0x8000000000000000 => long: 0
-FISTP 0x4082c00000000000 => quad: 258
-FISTP 0x8000000000000000 => quad: 0
+Rounding 0
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTP 0x8000000000000000 => quad: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x8000000000000000 => quad: 0
+Rounding 1
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTP 0x8000000000000000 => quad: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x8000000000000000 => quad: 0
+Rounding 2
+ FRNDINT 0x4082c00000000000 => 0x4082c00000000000
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FISTP 0x4082c00000000000 => word: 258
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x4082c00000000000 => long: 258
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x4082c00000000000 => quad: 258
+ FISTP 0x8000000000000000 => quad: 0
+ FISTTP 0x4082c00000000000 => word: 258
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x4082c00000000000 => long: 258
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x4082c00000000000 => quad: 258
+ FISTTP 0x8000000000000000 => quad: 0
FUCOMI 0x8000000000000000 0x0 Z--
FUCOMPP 0x8000000000000000 0x0 Z--
-FRNDINT 0x8000000000000000 => 0x8000000000000000
-FRNDINT 0x0 => 0x0
-FISTP 0x8000000000000000 => word: 0
-FISTP 0x0 => word: 0
-FISTP 0x8000000000000000 => long: 0
-FISTP 0x0 => long: 0
-FISTP 0x8000000000000000 => quad: 0
-FISTP 0x0 => quad: 0
+Rounding 0
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FRNDINT 0x0 => 0x0
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x0 => word: 0
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x0 => long: 0
+ FISTP 0x8000000000000000 => quad: 0
+ FISTP 0x0 => quad: 0
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x0 => word: 0
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x0 => long: 0
+ FISTTP 0x8000000000000000 => quad: 0
+ FISTTP 0x0 => quad: 0
+Rounding 1
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FRNDINT 0x0 => 0x0
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x0 => word: 0
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x0 => long: 0
+ FISTP 0x8000000000000000 => quad: 0
+ FISTP 0x0 => quad: 0
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x0 => word: 0
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x0 => long: 0
+ FISTTP 0x8000000000000000 => quad: 0
+ FISTTP 0x0 => quad: 0
+Rounding 2
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FRNDINT 0x0 => 0x0
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x0 => word: 0
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x0 => long: 0
+ FISTP 0x8000000000000000 => quad: 0
+ FISTP 0x0 => quad: 0
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x0 => word: 0
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x0 => long: 0
+ FISTTP 0x8000000000000000 => quad: 0
+ FISTTP 0x0 => quad: 0
FUCOMI 0x0 0x8000000000000000 Z--
FUCOMPP 0x0 0x8000000000000000 Z--
-FRNDINT 0x0 => 0x0
-FRNDINT 0x8000000000000000 => 0x8000000000000000
-FISTP 0x0 => word: 0
-FISTP 0x8000000000000000 => word: 0
-FISTP 0x0 => long: 0
-FISTP 0x8000000000000000 => long: 0
-FISTP 0x0 => quad: 0
-FISTP 0x8000000000000000 => quad: 0
+Rounding 0
+ FRNDINT 0x0 => 0x0
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FISTP 0x0 => word: 0
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x0 => long: 0
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x0 => quad: 0
+ FISTP 0x8000000000000000 => quad: 0
+ FISTTP 0x0 => word: 0
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x0 => long: 0
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x0 => quad: 0
+ FISTTP 0x8000000000000000 => quad: 0
+Rounding 1
+ FRNDINT 0x0 => 0x0
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FISTP 0x0 => word: 0
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x0 => long: 0
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x0 => quad: 0
+ FISTP 0x8000000000000000 => quad: 0
+ FISTTP 0x0 => word: 0
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x0 => long: 0
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x0 => quad: 0
+ FISTTP 0x8000000000000000 => quad: 0
+Rounding 2
+ FRNDINT 0x0 => 0x0
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FISTP 0x0 => word: 0
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x0 => long: 0
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x0 => quad: 0
+ FISTP 0x8000000000000000 => quad: 0
+ FISTTP 0x0 => word: 0
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x0 => long: 0
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x0 => quad: 0
+ FISTTP 0x8000000000000000 => quad: 0
+FUCOMI 0x40dfffc000000000 0x40e0002000000000 --C
+FUCOMPP 0x40dfffc000000000 0x40e0002000000000 --C
+Rounding 0
+ FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000
+ FRNDINT 0x40e0002000000000 => 0x40e0002000000000
+ FISTP 0x40dfffc000000000 => word: 7fff
+ FISTP 0x40e0002000000000 => word: 8000
+ FISTP 0x40dfffc000000000 => long: 7fff
+ FISTP 0x40e0002000000000 => long: 8001
+ FISTP 0x40dfffc000000000 => quad: 7fff
+ FISTP 0x40e0002000000000 => quad: 8001
+ FISTTP 0x40dfffc000000000 => word: 7fff
+ FISTTP 0x40e0002000000000 => word: 8000
+ FISTTP 0x40dfffc000000000 => long: 7fff
+ FISTTP 0x40e0002000000000 => long: 8001
+ FISTTP 0x40dfffc000000000 => quad: 7fff
+ FISTTP 0x40e0002000000000 => quad: 8001
+Rounding 1
+ FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000
+ FRNDINT 0x40e0002000000000 => 0x40e0002000000000
+ FISTP 0x40dfffc000000000 => word: 7fff
+ FISTP 0x40e0002000000000 => word: 8000
+ FISTP 0x40dfffc000000000 => long: 7fff
+ FISTP 0x40e0002000000000 => long: 8001
+ FISTP 0x40dfffc000000000 => quad: 7fff
+ FISTP 0x40e0002000000000 => quad: 8001
+ FISTTP 0x40dfffc000000000 => word: 7fff
+ FISTTP 0x40e0002000000000 => word: 8000
+ FISTTP 0x40dfffc000000000 => long: 7fff
+ FISTTP 0x40e0002000000000 => long: 8001
+ FISTTP 0x40dfffc000000000 => quad: 7fff
+ FISTTP 0x40e0002000000000 => quad: 8001
+Rounding 2
+ FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000
+ FRNDINT 0x40e0002000000000 => 0x40e0002000000000
+ FISTP 0x40dfffc000000000 => word: 7fff
+ FISTP 0x40e0002000000000 => word: 8000
+ FISTP 0x40dfffc000000000 => long: 7fff
+ FISTP 0x40e0002000000000 => long: 8001
+ FISTP 0x40dfffc000000000 => quad: 7fff
+ FISTP 0x40e0002000000000 => quad: 8001
+ FISTTP 0x40dfffc000000000 => word: 7fff
+ FISTTP 0x40e0002000000000 => word: 8000
+ FISTTP 0x40dfffc000000000 => long: 7fff
+ FISTTP 0x40e0002000000000 => long: 8001
+ FISTTP 0x40dfffc000000000 => quad: 7fff
+ FISTTP 0x40e0002000000000 => quad: 8001
+FUCOMI 0x40e0002000000000 0x40dfffc000000000 ---
+FUCOMPP 0x40e0002000000000 0x40dfffc000000000 ---
+Rounding 0
+ FRNDINT 0x40e0002000000000 => 0x40e0002000000000
+ FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000
+ FISTP 0x40e0002000000000 => word: 8000
+ FISTP 0x40dfffc000000000 => word: 7fff
+ FISTP 0x40e0002000000000 => long: 8001
+ FISTP 0x40dfffc000000000 => long: 7fff
+ FISTP 0x40e0002000000000 => quad: 8001
+ FISTP 0x40dfffc000000000 => quad: 7fff
+ FISTTP 0x40e0002000000000 => word: 8000
+ FISTTP 0x40dfffc000000000 => word: 7fff
+ FISTTP 0x40e0002000000000 => long: 8001
+ FISTTP 0x40dfffc000000000 => long: 7fff
+ FISTTP 0x40e0002000000000 => quad: 8001
+ FISTTP 0x40dfffc000000000 => quad: 7fff
+Rounding 1
+ FRNDINT 0x40e0002000000000 => 0x40e0002000000000
+ FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000
+ FISTP 0x40e0002000000000 => word: 8000
+ FISTP 0x40dfffc000000000 => word: 7fff
+ FISTP 0x40e0002000000000 => long: 8001
+ FISTP 0x40dfffc000000000 => long: 7fff
+ FISTP 0x40e0002000000000 => quad: 8001
+ FISTP 0x40dfffc000000000 => quad: 7fff
+ FISTTP 0x40e0002000000000 => word: 8000
+ FISTTP 0x40dfffc000000000 => word: 7fff
+ FISTTP 0x40e0002000000000 => long: 8001
+ FISTTP 0x40dfffc000000000 => long: 7fff
+ FISTTP 0x40e0002000000000 => quad: 8001
+ FISTTP 0x40dfffc000000000 => quad: 7fff
+Rounding 2
+ FRNDINT 0x40e0002000000000 => 0x40e0002000000000
+ FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000
+ FISTP 0x40e0002000000000 => word: 8000
+ FISTP 0x40dfffc000000000 => word: 7fff
+ FISTP 0x40e0002000000000 => long: 8001
+ FISTP 0x40dfffc000000000 => long: 7fff
+ FISTP 0x40e0002000000000 => quad: 8001
+ FISTP 0x40dfffc000000000 => quad: 7fff
+ FISTTP 0x40e0002000000000 => word: 8000
+ FISTTP 0x40dfffc000000000 => word: 7fff
+ FISTTP 0x40e0002000000000 => long: 8001
+ FISTTP 0x40dfffc000000000 => long: 7fff
+ FISTTP 0x40e0002000000000 => quad: 8001
+ FISTTP 0x40dfffc000000000 => quad: 7fff
+FUCOMI 0xc0e0002000000000 0xc0dfffc000000000 --C
+FUCOMPP 0xc0e0002000000000 0xc0dfffc000000000 --C
+Rounding 0
+ FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000
+ FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000
+ FISTP 0xc0e0002000000000 => word: 8000
+ FISTP 0xc0dfffc000000000 => word: 8001
+ FISTP 0xc0e0002000000000 => long: ffff7fff
+ FISTP 0xc0dfffc000000000 => long: ffff8001
+ FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+ FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+ FISTTP 0xc0e0002000000000 => word: 8000
+ FISTTP 0xc0dfffc000000000 => word: 8001
+ FISTTP 0xc0e0002000000000 => long: ffff7fff
+ FISTTP 0xc0dfffc000000000 => long: ffff8001
+ FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+ FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+Rounding 1
+ FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000
+ FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000
+ FISTP 0xc0e0002000000000 => word: 8000
+ FISTP 0xc0dfffc000000000 => word: 8001
+ FISTP 0xc0e0002000000000 => long: ffff7fff
+ FISTP 0xc0dfffc000000000 => long: ffff8001
+ FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+ FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+ FISTTP 0xc0e0002000000000 => word: 8000
+ FISTTP 0xc0dfffc000000000 => word: 8001
+ FISTTP 0xc0e0002000000000 => long: ffff7fff
+ FISTTP 0xc0dfffc000000000 => long: ffff8001
+ FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+ FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+Rounding 2
+ FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000
+ FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000
+ FISTP 0xc0e0002000000000 => word: 8000
+ FISTP 0xc0dfffc000000000 => word: 8001
+ FISTP 0xc0e0002000000000 => long: ffff7fff
+ FISTP 0xc0dfffc000000000 => long: ffff8001
+ FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+ FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+ FISTTP 0xc0e0002000000000 => word: 8000
+ FISTTP 0xc0dfffc000000000 => word: 8001
+ FISTTP 0xc0e0002000000000 => long: ffff7fff
+ FISTTP 0xc0dfffc000000000 => long: ffff8001
+ FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+ FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+FUCOMI 0xc0dfffc000000000 0xc0e0002000000000 ---
+FUCOMPP 0xc0dfffc000000000 0xc0e0002000000000 ---
+Rounding 0
+ FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000
+ FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000
+ FISTP 0xc0dfffc000000000 => word: 8001
+ FISTP 0xc0e0002000000000 => word: 8000
+ FISTP 0xc0dfffc000000000 => long: ffff8001
+ FISTP 0xc0e0002000000000 => long: ffff7fff
+ FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+ FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+ FISTTP 0xc0dfffc000000000 => word: 8001
+ FISTTP 0xc0e0002000000000 => word: 8000
+ FISTTP 0xc0dfffc000000000 => long: ffff8001
+ FISTTP 0xc0e0002000000000 => long: ffff7fff
+ FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+ FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+Rounding 1
+ FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000
+ FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000
+ FISTP 0xc0dfffc000000000 => word: 8001
+ FISTP 0xc0e0002000000000 => word: 8000
+ FISTP 0xc0dfffc000000000 => long: ffff8001
+ FISTP 0xc0e0002000000000 => long: ffff7fff
+ FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+ FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+ FISTTP 0xc0dfffc000000000 => word: 8001
+ FISTTP 0xc0e0002000000000 => word: 8000
+ FISTTP 0xc0dfffc000000000 => long: ffff8001
+ FISTTP 0xc0e0002000000000 => long: ffff7fff
+ FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+ FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+Rounding 2
+ FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000
+ FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000
+ FISTP 0xc0dfffc000000000 => word: 8001
+ FISTP 0xc0e0002000000000 => word: 8000
+ FISTP 0xc0dfffc000000000 => long: ffff8001
+ FISTP 0xc0e0002000000000 => long: ffff7fff
+ FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+ FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff
+ FISTTP 0xc0dfffc000000000 => word: 8001
+ FISTTP 0xc0e0002000000000 => word: 8000
+ FISTTP 0xc0dfffc000000000 => long: ffff8001
+ FISTTP 0xc0e0002000000000 => long: ffff7fff
+ FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001
+ FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff
FUCOMI 0x8000000000000000 0x3ff0000000000000 --C
FUCOMPP 0x8000000000000000 0x3ff0000000000000 --C
-FRNDINT 0x8000000000000000 => 0x8000000000000000
-FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
-FISTP 0x8000000000000000 => word: 0
-FISTP 0x3ff0000000000000 => word: 1
-FISTP 0x8000000000000000 => long: 0
-FISTP 0x3ff0000000000000 => long: 1
-FISTP 0x8000000000000000 => quad: 0
-FISTP 0x3ff0000000000000 => quad: 1
+Rounding 0
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x8000000000000000 => quad: 0
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x8000000000000000 => quad: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
+Rounding 1
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x8000000000000000 => quad: 0
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x8000000000000000 => quad: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
+Rounding 2
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x8000000000000000 => quad: 0
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x8000000000000000 => quad: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
FUCOMI 0x3ff0000000000000 0x8000000000000000 ---
FUCOMPP 0x3ff0000000000000 0x8000000000000000 ---
-FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
-FRNDINT 0x8000000000000000 => 0x8000000000000000
-FISTP 0x3ff0000000000000 => word: 1
-FISTP 0x8000000000000000 => word: 0
-FISTP 0x3ff0000000000000 => long: 1
-FISTP 0x8000000000000000 => long: 0
-FISTP 0x3ff0000000000000 => quad: 1
-FISTP 0x8000000000000000 => quad: 0
+Rounding 0
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTP 0x8000000000000000 => quad: 0
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x8000000000000000 => quad: 0
+Rounding 1
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTP 0x8000000000000000 => quad: 0
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x8000000000000000 => quad: 0
+Rounding 2
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FRNDINT 0x8000000000000000 => 0x8000000000000000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x8000000000000000 => word: 0
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x8000000000000000 => long: 0
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTP 0x8000000000000000 => quad: 0
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x8000000000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x8000000000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x8000000000000000 => quad: 0
FUCOMI 0x3ff0000000000000 0x3fe89d9000000000 ---
FUCOMPP 0x3ff0000000000000 0x3fe89d9000000000 ---
-FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
-FRNDINT 0x3fe89d9000000000 => 0x0
-FISTP 0x3ff0000000000000 => word: 1
-FISTP 0x3fe89d9000000000 => word: 0
-FISTP 0x3ff0000000000000 => long: 1
-FISTP 0x3fe89d9000000000 => long: 0
-FISTP 0x3ff0000000000000 => quad: 1
-FISTP 0x3fe89d9000000000 => quad: 0
+Rounding 0
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FRNDINT 0x3fe89d9000000000 => 0x3ff0000000000000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x3fe89d9000000000 => word: 1
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x3fe89d9000000000 => long: 1
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTP 0x3fe89d9000000000 => quad: 1
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x3fe89d9000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x3fe89d9000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x3fe89d9000000000 => quad: 0
+Rounding 1
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FRNDINT 0x3fe89d9000000000 => 0x0
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x3fe89d9000000000 => word: 0
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x3fe89d9000000000 => long: 0
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTP 0x3fe89d9000000000 => quad: 0
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x3fe89d9000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x3fe89d9000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x3fe89d9000000000 => quad: 0
+Rounding 2
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FRNDINT 0x3fe89d9000000000 => 0x3ff0000000000000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x3fe89d9000000000 => word: 1
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x3fe89d9000000000 => long: 1
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTP 0x3fe89d9000000000 => quad: 1
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x3fe89d9000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x3fe89d9000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x3fe89d9000000000 => quad: 0
FUCOMI 0x3fe89d9000000000 0x3ff0000000000000 --C
FUCOMPP 0x3fe89d9000000000 0x3ff0000000000000 --C
-FRNDINT 0x3fe89d9000000000 => 0x0
-FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
-FISTP 0x3fe89d9000000000 => word: 0
-FISTP 0x3ff0000000000000 => word: 1
-FISTP 0x3fe89d9000000000 => long: 0
-FISTP 0x3ff0000000000000 => long: 1
-FISTP 0x3fe89d9000000000 => quad: 0
-FISTP 0x3ff0000000000000 => quad: 1
+Rounding 0
+ FRNDINT 0x3fe89d9000000000 => 0x3ff0000000000000
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FISTP 0x3fe89d9000000000 => word: 1
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x3fe89d9000000000 => long: 1
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x3fe89d9000000000 => quad: 1
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x3fe89d9000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x3fe89d9000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x3fe89d9000000000 => quad: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
+Rounding 1
+ FRNDINT 0x3fe89d9000000000 => 0x0
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FISTP 0x3fe89d9000000000 => word: 0
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x3fe89d9000000000 => long: 0
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x3fe89d9000000000 => quad: 0
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x3fe89d9000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x3fe89d9000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x3fe89d9000000000 => quad: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
+Rounding 2
+ FRNDINT 0x3fe89d9000000000 => 0x3ff0000000000000
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FISTP 0x3fe89d9000000000 => word: 1
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x3fe89d9000000000 => long: 1
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x3fe89d9000000000 => quad: 1
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x3fe89d9000000000 => word: 0
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x3fe89d9000000000 => long: 0
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x3fe89d9000000000 => quad: 0
+ FISTTP 0x3ff0000000000000 => quad: 1
FUCOMI 0x3ff0000000000000 0x7ff0000000000000 --C
FUCOMPP 0x3ff0000000000000 0x7ff0000000000000 --C
-FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
-FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
-FISTP 0x3ff0000000000000 => word: 1
-FISTP 0x7ff0000000000000 => word: 8000
-FISTP 0x3ff0000000000000 => long: 1
-FISTP 0x7ff0000000000000 => long: 80000000
-FISTP 0x3ff0000000000000 => quad: 1
-FISTP 0x7ff0000000000000 => quad: 8000000000000000
+Rounding 0
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
+Rounding 1
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
+Rounding 2
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
FUCOMI 0x7ff0000000000000 0x3ff0000000000000 ---
FUCOMPP 0x7ff0000000000000 0x3ff0000000000000 ---
-FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
-FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
-FISTP 0x7ff0000000000000 => word: 8000
-FISTP 0x3ff0000000000000 => word: 1
-FISTP 0x7ff0000000000000 => long: 80000000
-FISTP 0x3ff0000000000000 => long: 1
-FISTP 0x7ff0000000000000 => quad: 8000000000000000
-FISTP 0x3ff0000000000000 => quad: 1
+Rounding 0
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0x3ff0000000000000 => quad: 1
+Rounding 1
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0x3ff0000000000000 => quad: 1
+Rounding 2
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0x3ff0000000000000 => word: 1
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0x3ff0000000000000 => long: 1
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTP 0x3ff0000000000000 => quad: 1
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0x3ff0000000000000 => word: 1
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0x3ff0000000000000 => long: 1
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0x3ff0000000000000 => quad: 1
FUCOMI 0xfff0000000000000 0x7ff0000000000000 --C
FUCOMPP 0xfff0000000000000 0x7ff0000000000000 --C
-FRNDINT 0xfff0000000000000 => 0xfff0000000000000
-FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
-FISTP 0xfff0000000000000 => word: 8000
-FISTP 0x7ff0000000000000 => word: 8000
-FISTP 0xfff0000000000000 => long: 80000000
-FISTP 0x7ff0000000000000 => long: 80000000
-FISTP 0xfff0000000000000 => quad: 8000000000000000
-FISTP 0x7ff0000000000000 => quad: 8000000000000000
+Rounding 0
+ FRNDINT 0xfff0000000000000 => 0xfff0000000000000
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FISTP 0xfff0000000000000 => word: 8000
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0xfff0000000000000 => long: 80000000
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0xfff0000000000000 => quad: 8000000000000000
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0xfff0000000000000 => word: 8000
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0xfff0000000000000 => long: 80000000
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0xfff0000000000000 => quad: 8000000000000000
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
+Rounding 1
+ FRNDINT 0xfff0000000000000 => 0xfff0000000000000
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FISTP 0xfff0000000000000 => word: 8000
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0xfff0000000000000 => long: 80000000
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0xfff0000000000000 => quad: 8000000000000000
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0xfff0000000000000 => word: 8000
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0xfff0000000000000 => long: 80000000
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0xfff0000000000000 => quad: 8000000000000000
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
+Rounding 2
+ FRNDINT 0xfff0000000000000 => 0xfff0000000000000
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FISTP 0xfff0000000000000 => word: 8000
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0xfff0000000000000 => long: 80000000
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0xfff0000000000000 => quad: 8000000000000000
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0xfff0000000000000 => word: 8000
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0xfff0000000000000 => long: 80000000
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0xfff0000000000000 => quad: 8000000000000000
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
FUCOMI 0x7ff0000000000000 0xfff0000000000000 ---
FUCOMPP 0x7ff0000000000000 0xfff0000000000000 ---
-FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
-FRNDINT 0xfff0000000000000 => 0xfff0000000000000
-FISTP 0x7ff0000000000000 => word: 8000
-FISTP 0xfff0000000000000 => word: 8000
-FISTP 0x7ff0000000000000 => long: 80000000
-FISTP 0xfff0000000000000 => long: 80000000
-FISTP 0x7ff0000000000000 => quad: 8000000000000000
-FISTP 0xfff0000000000000 => quad: 8000000000000000
+Rounding 0
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FRNDINT 0xfff0000000000000 => 0xfff0000000000000
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0xfff0000000000000 => word: 8000
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0xfff0000000000000 => long: 80000000
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTP 0xfff0000000000000 => quad: 8000000000000000
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0xfff0000000000000 => word: 8000
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0xfff0000000000000 => long: 80000000
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0xfff0000000000000 => quad: 8000000000000000
+Rounding 1
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FRNDINT 0xfff0000000000000 => 0xfff0000000000000
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0xfff0000000000000 => word: 8000
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0xfff0000000000000 => long: 80000000
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTP 0xfff0000000000000 => quad: 8000000000000000
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0xfff0000000000000 => word: 8000
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0xfff0000000000000 => long: 80000000
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0xfff0000000000000 => quad: 8000000000000000
+Rounding 2
+ FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000
+ FRNDINT 0xfff0000000000000 => 0xfff0000000000000
+ FISTP 0x7ff0000000000000 => word: 8000
+ FISTP 0xfff0000000000000 => word: 8000
+ FISTP 0x7ff0000000000000 => long: 80000000
+ FISTP 0xfff0000000000000 => long: 80000000
+ FISTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTP 0xfff0000000000000 => quad: 8000000000000000
+ FISTTP 0x7ff0000000000000 => word: 8000
+ FISTTP 0xfff0000000000000 => word: 8000
+ FISTTP 0x7ff0000000000000 => long: 80000000
+ FISTTP 0xfff0000000000000 => long: 80000000
+ FISTTP 0x7ff0000000000000 => quad: 8000000000000000
+ FISTTP 0xfff0000000000000 => quad: 8000000000000000
FUCOMI 0x3ff0002ca0000000 0xaeff000025000000 ---
FUCOMPP 0x3ff0002ca0000000 0xaeff000025000000 ---
-FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000
-FRNDINT 0xaeff000025000000 => 0x8000000000000000
-FISTP 0x3ff0002ca0000000 => word: 1
-FISTP 0xaeff000025000000 => word: 0
-FISTP 0x3ff0002ca0000000 => long: 1
-FISTP 0xaeff000025000000 => long: 0
-FISTP 0x3ff0002ca0000000 => quad: 1
-FISTP 0xaeff000025000000 => quad: 0
+Rounding 0
+ FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000
+ FRNDINT 0xaeff000025000000 => 0x8000000000000000
+ FISTP 0x3ff0002ca0000000 => word: 1
+ FISTP 0xaeff000025000000 => word: 0
+ FISTP 0x3ff0002ca0000000 => long: 1
+ FISTP 0xaeff000025000000 => long: 0
+ FISTP 0x3ff0002ca0000000 => quad: 1
+ FISTP 0xaeff000025000000 => quad: 0
+ FISTTP 0x3ff0002ca0000000 => word: 1
+ FISTTP 0xaeff000025000000 => word: 0
+ FISTTP 0x3ff0002ca0000000 => long: 1
+ FISTTP 0xaeff000025000000 => long: 0
+ FISTTP 0x3ff0002ca0000000 => quad: 1
+ FISTTP 0xaeff000025000000 => quad: 0
+Rounding 1
+ FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000
+ FRNDINT 0xaeff000025000000 => 0xbff0000000000000
+ FISTP 0x3ff0002ca0000000 => word: 1
+ FISTP 0xaeff000025000000 => word: ffff
+ FISTP 0x3ff0002ca0000000 => long: 1
+ FISTP 0xaeff000025000000 => long: ffffffff
+ FISTP 0x3ff0002ca0000000 => quad: 1
+ FISTP 0xaeff000025000000 => quad: ffffffffffffffff
+ FISTTP 0x3ff0002ca0000000 => word: 1
+ FISTTP 0xaeff000025000000 => word: 0
+ FISTTP 0x3ff0002ca0000000 => long: 1
+ FISTTP 0xaeff000025000000 => long: 0
+ FISTTP 0x3ff0002ca0000000 => quad: 1
+ FISTTP 0xaeff000025000000 => quad: 0
+Rounding 2
+ FRNDINT 0x3ff0002ca0000000 => 0x4000000000000000
+ FRNDINT 0xaeff000025000000 => 0x8000000000000000
+ FISTP 0x3ff0002ca0000000 => word: 2
+ FISTP 0xaeff000025000000 => word: 0
+ FISTP 0x3ff0002ca0000000 => long: 2
+ FISTP 0xaeff000025000000 => long: 0
+ FISTP 0x3ff0002ca0000000 => quad: 2
+ FISTP 0xaeff000025000000 => quad: 0
+ FISTTP 0x3ff0002ca0000000 => word: 1
+ FISTTP 0xaeff000025000000 => word: 0
+ FISTTP 0x3ff0002ca0000000 => long: 1
+ FISTTP 0xaeff000025000000 => long: 0
+ FISTTP 0x3ff0002ca0000000 => quad: 1
+ FISTTP 0xaeff000025000000 => quad: 0
FUCOMI 0xaeff000025000000 0x3ff0002ca0000000 --C
FUCOMPP 0xaeff000025000000 0x3ff0002ca0000000 --C
-FRNDINT 0xaeff000025000000 => 0x8000000000000000
-FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000
-FISTP 0xaeff000025000000 => word: 0
-FISTP 0x3ff0002ca0000000 => word: 1
-FISTP 0xaeff000025000000 => long: 0
-FISTP 0x3ff0002ca0000000 => long: 1
-FISTP 0xaeff000025000000 => quad: 0
-FISTP 0x3ff0002ca0000000 => quad: 1
+Rounding 0
+ FRNDINT 0xaeff000025000000 => 0x8000000000000000
+ FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000
+ FISTP 0xaeff000025000000 => word: 0
+ FISTP 0x3ff0002ca0000000 => word: 1
+ FISTP 0xaeff000025000000 => long: 0
+ FISTP 0x3ff0002ca0000000 => long: 1
+ FISTP 0xaeff000025000000 => quad: 0
+ FISTP 0x3ff0002ca0000000 => quad: 1
+ FISTTP 0xaeff000025000000 => word: 0
+ FISTTP 0x3ff0002ca0000000 => word: 1
+ FISTTP 0xaeff000025000000 => long: 0
+ FISTTP 0x3ff0002ca0000000 => long: 1
+ FISTTP 0xaeff000025000000 => quad: 0
+ FISTTP 0x3ff0002ca0000000 => quad: 1
+Rounding 1
+ FRNDINT 0xaeff000025000000 => 0xbff0000000000000
+ FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000
+ FISTP 0xaeff000025000000 => word: ffff
+ FISTP 0x3ff0002ca0000000 => word: 1
+ FISTP 0xaeff000025000000 => long: ffffffff
+ FISTP 0x3ff0002ca0000000 => long: 1
+ FISTP 0xaeff000025000000 => quad: ffffffffffffffff
+ FISTP 0x3ff0002ca0000000 => quad: 1
+ FISTTP 0xaeff000025000000 => word: 0
+ FISTTP 0x3ff0002ca0000000 => word: 1
+ FISTTP 0xaeff000025000000 => long: 0
+ FISTTP 0x3ff0002ca0000000 => long: 1
+ FISTTP 0xaeff000025000000 => quad: 0
+ FISTTP 0x3ff0002ca0000000 => quad: 1
+Rounding 2
+ FRNDINT 0xaeff000025000000 => 0x8000000000000000
+ FRNDINT 0x3ff0002ca0000000 => 0x4000000000000000
+ FISTP 0xaeff000025000000 => word: 0
+ FISTP 0x3ff0002ca0000000 => word: 2
+ FISTP 0xaeff000025000000 => long: 0
+ FISTP 0x3ff0002ca0000000 => long: 2
+ FISTP 0xaeff000025000000 => quad: 0
+ FISTP 0x3ff0002ca0000000 => quad: 2
+ FISTTP 0xaeff000025000000 => word: 0
+ FISTTP 0x3ff0002ca0000000 => word: 1
+ FISTTP 0xaeff000025000000 => long: 0
+ FISTTP 0x3ff0002ca0000000 => long: 1
+ FISTTP 0xaeff000025000000 => quad: 0
+ FISTTP 0x3ff0002ca0000000 => quad: 1
FUCOMI 0x3ff0000050000000 0xc082c00000000000 ---
FUCOMPP 0x3ff0000050000000 0xc082c00000000000 ---
-FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000
-FRNDINT 0xc082c00000000000 => 0xc082c00000000000
-FISTP 0x3ff0000050000000 => word: 1
-FISTP 0xc082c00000000000 => word: fda8
-FISTP 0x3ff0000050000000 => long: 1
-FISTP 0xc082c00000000000 => long: fffffda8
-FISTP 0x3ff0000050000000 => quad: 1
-FISTP 0xc082c00000000000 => quad: fffffffffffffda8
+Rounding 0
+ FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000
+ FRNDINT 0xc082c00000000000 => 0xc082c00000000000
+ FISTP 0x3ff0000050000000 => word: 1
+ FISTP 0xc082c00000000000 => word: fda8
+ FISTP 0x3ff0000050000000 => long: 1
+ FISTP 0xc082c00000000000 => long: fffffda8
+ FISTP 0x3ff0000050000000 => quad: 1
+ FISTP 0xc082c00000000000 => quad: fffffffffffffda8
+ FISTTP 0x3ff0000050000000 => word: 1
+ FISTTP 0xc082c00000000000 => word: fda8
+ FISTTP 0x3ff0000050000000 => long: 1
+ FISTTP 0xc082c00000000000 => long: fffffda8
+ FISTTP 0x3ff0000050000000 => quad: 1
+ FISTTP 0xc082c00000000000 => quad: fffffffffffffda8
+Rounding 1
+ FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000
+ FRNDINT 0xc082c00000000000 => 0xc082c00000000000
+ FISTP 0x3ff0000050000000 => word: 1
+ FISTP 0xc082c00000000000 => word: fda8
+ FISTP 0x3ff0000050000000 => long: 1
+ FISTP 0xc082c00000000000 => long: fffffda8
+ FISTP 0x3ff0000050000000 => quad: 1
+ FISTP 0xc082c00000000000 => quad: fffffffffffffda8
+ FISTTP 0x3ff0000050000000 => word: 1
+ FISTTP 0xc082c00000000000 => word: fda8
+ FISTTP 0x3ff0000050000000 => long: 1
+ FISTTP 0xc082c00000000000 => long: fffffda8
+ FISTTP 0x3ff0000050000000 => quad: 1
+ FISTTP 0xc082c00000000000 => quad: fffffffffffffda8
+Rounding 2
+ FRNDINT 0x3ff0000050000000 => 0x4000000000000000
+ FRNDINT 0xc082c00000000000 => 0xc082c00000000000
+ FISTP 0x3ff0000050000000 => word: 2
+ FISTP 0xc082c00000000000 => word: fda8
+ FISTP 0x3ff0000050000000 => long: 2
+ FISTP 0xc082c00000000000 => long: fffffda8
+ FISTP 0x3ff0000050000000 => quad: 2
+ FISTP 0xc082c00000000000 => quad: fffffffffffffda8
+ FISTTP 0x3ff0000050000000 => word: 1
+ FISTTP 0xc082c00000000000 => word: fda8
+ FISTTP 0x3ff0000050000000 => long: 1
+ FISTTP 0xc082c00000000000 => long: fffffda8
+ FISTTP 0x3ff0000050000000 => quad: 1
+ FISTTP 0xc082c00000000000 => quad: fffffffffffffda8
FUCOMI 0xc082c00000000000 0x3ff0000050000000 --C
FUCOMPP 0xc082c00000000000 0x3ff0000050000000 --C
-FRNDINT 0xc082c00000000000 => 0xc082c00000000000
-FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000
-FISTP 0xc082c00000000000 => word: fda8
-FISTP 0x3ff0000050000000 => word: 1
-FISTP 0xc082c00000000000 => long: fffffda8
-FISTP 0x3ff0000050000000 => long: 1
-FISTP 0xc082c00000000000 => quad: fffffffffffffda8
-FISTP 0x3ff0000050000000 => quad: 1
+Rounding 0
+ FRNDINT 0xc082c00000000000 => 0xc082c00000000000
+ FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000
+ FISTP 0xc082c00000000000 => word: fda8
+ FISTP 0x3ff0000050000000 => word: 1
+ FISTP 0xc082c00000000000 => long: fffffda8
+ FISTP 0x3ff0000050000000 => long: 1
+ FISTP 0xc082c00000000000 => quad: fffffffffffffda8
+ FISTP 0x3ff0000050000000 => quad: 1
+ FISTTP 0xc082c00000000000 => word: fda8
+ FISTTP 0x3ff0000050000000 => word: 1
+ FISTTP 0xc082c00000000000 => long: fffffda8
+ FISTTP 0x3ff0000050000000 => long: 1
+ FISTTP 0xc082c00000000000 => quad: fffffffffffffda8
+ FISTTP 0x3ff0000050000000 => quad: 1
+Rounding 1
+ FRNDINT 0xc082c00000000000 => 0xc082c00000000000
+ FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000
+ FISTP 0xc082c00000000000 => word: fda8
+ FISTP 0x3ff0000050000000 => word: 1
+ FISTP 0xc082c00000000000 => long: fffffda8
+ FISTP 0x3ff0000050000000 => long: 1
+ FISTP 0xc082c00000000000 => quad: fffffffffffffda8
+ FISTP 0x3ff0000050000000 => quad: 1
+ FISTTP 0xc082c00000000000 => word: fda8
+ FISTTP 0x3ff0000050000000 => word: 1
+ FISTTP 0xc082c00000000000 => long: fffffda8
+ FISTTP 0x3ff0000050000000 => long: 1
+ FISTTP 0xc082c00000000000 => quad: fffffffffffffda8
+ FISTTP 0x3ff0000050000000 => quad: 1
+Rounding 2
+ FRNDINT 0xc082c00000000000 => 0xc082c00000000000
+ FRNDINT 0x3ff0000050000000 => 0x4000000000000000
+ FISTP 0xc082c00000000000 => word: fda8
+ FISTP 0x3ff0000050000000 => word: 2
+ FISTP 0xc082c00000000000 => long: fffffda8
+ FISTP 0x3ff0000050000000 => long: 2
+ FISTP 0xc082c00000000000 => quad: fffffffffffffda8
+ FISTP 0x3ff0000050000000 => quad: 2
+ FISTTP 0xc082c00000000000 => word: fda8
+ FISTTP 0x3ff0000050000000 => word: 1
+ FISTTP 0xc082c00000000000 => long: fffffda8
+ FISTTP 0x3ff0000050000000 => long: 1
+ FISTTP 0xc082c00000000000 => quad: fffffffffffffda8
+ FISTTP 0x3ff0000050000000 => quad: 1
FUCOMI 0x0 0x7ff8000000000001 ZPC
FUCOMPP 0x0 0x7ff8000000000001 ZPC
-FRNDINT 0x0 => 0x0
-FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
-FISTP 0x0 => word: 0
-FISTP 0x7ff8000000000001 => word: 8000
-FISTP 0x0 => long: 0
-FISTP 0x7ff8000000000001 => long: 80000000
-FISTP 0x0 => quad: 0
-FISTP 0x7ff8000000000001 => quad: 8000000000000000
+Rounding 0
+ FRNDINT 0x0 => 0x0
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FISTP 0x0 => word: 0
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x0 => long: 0
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x0 => quad: 0
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x0 => word: 0
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x0 => long: 0
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x0 => quad: 0
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+Rounding 1
+ FRNDINT 0x0 => 0x0
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FISTP 0x0 => word: 0
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x0 => long: 0
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x0 => quad: 0
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x0 => word: 0
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x0 => long: 0
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x0 => quad: 0
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+Rounding 2
+ FRNDINT 0x0 => 0x0
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FISTP 0x0 => word: 0
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x0 => long: 0
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x0 => quad: 0
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x0 => word: 0
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x0 => long: 0
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x0 => quad: 0
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
FUCOMI 0x7ff8000000000001 0x0 ZPC
FUCOMPP 0x7ff8000000000001 0x0 ZPC
-FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
-FRNDINT 0x0 => 0x0
-FISTP 0x7ff8000000000001 => word: 8000
-FISTP 0x0 => word: 0
-FISTP 0x7ff8000000000001 => long: 80000000
-FISTP 0x0 => long: 0
-FISTP 0x7ff8000000000001 => quad: 8000000000000000
-FISTP 0x0 => quad: 0
+Rounding 0
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FRNDINT 0x0 => 0x0
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x0 => word: 0
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x0 => long: 0
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTP 0x0 => quad: 0
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x0 => word: 0
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x0 => long: 0
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x0 => quad: 0
+Rounding 1
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FRNDINT 0x0 => 0x0
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x0 => word: 0
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x0 => long: 0
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTP 0x0 => quad: 0
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x0 => word: 0
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x0 => long: 0
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x0 => quad: 0
+Rounding 2
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FRNDINT 0x0 => 0x0
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x0 => word: 0
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x0 => long: 0
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTP 0x0 => quad: 0
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x0 => word: 0
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x0 => long: 0
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x0 => quad: 0
FUCOMI 0x7ff8000000000001 0x7ff8000000000001 ZPC
FUCOMPP 0x7ff8000000000001 0x7ff8000000000001 ZPC
-FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
-FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
-FISTP 0x7ff8000000000001 => word: 8000
-FISTP 0x7ff8000000000001 => word: 8000
-FISTP 0x7ff8000000000001 => long: 80000000
-FISTP 0x7ff8000000000001 => long: 80000000
-FISTP 0x7ff8000000000001 => quad: 8000000000000000
-FISTP 0x7ff8000000000001 => quad: 8000000000000000
+Rounding 0
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+Rounding 1
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+Rounding 2
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
FUCOMI 0x7ff8000000000001 0x7ff8000000000001 ZPC
FUCOMPP 0x7ff8000000000001 0x7ff8000000000001 ZPC
-FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
-FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
-FISTP 0x7ff8000000000001 => word: 8000
-FISTP 0x7ff8000000000001 => word: 8000
-FISTP 0x7ff8000000000001 => long: 80000000
-FISTP 0x7ff8000000000001 => long: 80000000
-FISTP 0x7ff8000000000001 => quad: 8000000000000000
-FISTP 0x7ff8000000000001 => quad: 8000000000000000
+Rounding 0
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+Rounding 1
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+Rounding 2
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => word: 8000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => long: 80000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => word: 8000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => long: 80000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
+ FISTTP 0x7ff8000000000001 => quad: 8000000000000000
Done
diff --git a/tests/test05.c b/tests/test05.c
index c6a4e67..c6a4e67 100755..100644
--- a/tests/test05.c
+++ b/tests/test05.c
diff --git a/tests/test08.c b/tests/test08.c
index f5f5bce..f5f5bce 100755..100644
--- a/tests/test08.c
+++ b/tests/test08.c
diff --git a/tests/test09.c b/tests/test09.c
index e4a5605..dadff21 100755..100644
--- a/tests/test09.c
+++ b/tests/test09.c
@@ -1,5 +1,6 @@
#include <stdio.h>
-#include <sys/types.h>
+#include <sys/types.h>
+#include <sys/wait.h>
#include <unistd.h>
void forkexample()
@@ -9,7 +10,7 @@ void forkexample()
if (fork() == 0)
printf("Child has x = %d\n", ++x);
else {
- usleep(20000);
+ wait(NULL);
printf("Parent has x = %d\n", --x);
}
}
@@ -17,4 +18,4 @@ int main()
{
forkexample();
return 0;
-} \ No newline at end of file
+}
diff --git a/tests/test12.c b/tests/test12.c
index 4892a10..4892a10 100755..100644
--- a/tests/test12.c
+++ b/tests/test12.c
diff --git a/tests/test14.c b/tests/test14.c
index 65702be..65702be 100755..100644
--- a/tests/test14.c
+++ b/tests/test14.c
diff --git a/tests/test17.c b/tests/test17.c
index 385b624..632d13c 100644
--- a/tests/test17.c
+++ b/tests/test17.c
@@ -1,5 +1,6 @@
-// build with gcc -march=corei7 -O2 -g -msse -msse2 test17.c -o test17
+// build with gcc -O0 -g -msse -msse2 -mssse3 -msse4.1 test17.c -o test17
// and -m32 for 32bits version
+#include <inttypes.h>
#include <string.h>
#include <stdio.h>
#include <stddef.h>
@@ -141,7 +142,7 @@ void print_32(v128 v) {
}
void print_64(v128 v) {
for(int i=0; i<2; ++i)
- printf("0x%llx ", v.u64[i]);
+ printf("0x%"PRIx64" ", v.u64[i]);
}
#define print_128 print_64
void print_ps(v128 v) {
@@ -154,7 +155,7 @@ void print_ps(v128 v) {
void print_pd(v128 v) {
for(int i=0; i<2; ++i)
if(isnan(v.d64[i]))
- printf("0x%llx ", v.u64[i]);
+ printf("0x%"PRIx64" ", v.u64[i]);
else
printf("%g ", v.d64[i]);
}
@@ -163,7 +164,7 @@ void print_pd(v128 v) {
int main(int argc, const char** argv)
{
float a, b;
- uint64_t flags;
+ uint32_t flags;
uint32_t maxf = 0x7f7fffff;
uint32_t minf = 0xff7fffff;
uint32_t r;
@@ -171,40 +172,40 @@ int main(int argc, const char** argv)
#define GO1(A, N) \
a = 1.0f; b = 2.0f; \
flags = A(a, b); \
-printf(N " %f, %f => 0x%lx\n", a, b, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \
flags = A(b, a); \
-printf(N " %f, %f => 0x%lx\n", b, a, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \
b = INFINITY; \
flags = A(a, b); \
-printf(N " %f, %f => 0x%lx\n", a, b, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \
flags = A(b, a); \
-printf(N " %f, %f => 0x%lx\n", b, a, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \
b = -INFINITY; \
flags = A(a, b); \
-printf(N " %f, %f => 0x%lx\n", a, b, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \
flags = A(b, a); \
-printf(N " %f, %f => 0x%lx\n", b, a, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \
b = NAN; \
flags = A(a, b); \
-printf(N " %f, %f => 0x%lx\n", a, b, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \
flags = A(b, a); \
-printf(N " %f, %f => 0x%lx\n", b, a, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \
b = a; \
flags = A(a, b); \
-printf(N " %f, %f => 0x%lx\n", a, b, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \
flags = A(b, a); \
-printf(N " %f, %f => 0x%lx\n", b, a, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \
a = b = INFINITY; \
flags = A(a, b); \
-printf(N " %f, %f => 0x%lx\n", a, b, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \
a = -INFINITY; \
flags = A(a, b); \
-printf(N " %f, %f => 0x%lx\n", a, b, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \
flags = A(b, a); \
-printf(N " %f, %f => 0x%lx\n", b, a, flags); \
+printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \
a = b = NAN; \
flags = A(a, b); \
-printf(N " %f, %f => 0x%lx\n", a, b, flags);
+printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags);
#define GO2(A, N) \
a = 1.0f; b = 2.0f; \
@@ -353,6 +354,10 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r);
printf("%s(", #C); print_ps(A1); \
printf(", "); print_ps(A2); \
printf(", %d) = ", I); print_ps(a128); printf("\n");
+ #define GO1ps2dq(A, C, A1) \
+ a128.mm = _mm_##A##_epi32(A1.mf); \
+ printf("%s(", #C); print_ps(A1); \
+ printf(") = "); print_32(a128); printf("\n");
#define MULITGO2pd(A, B) \
GO2pd(A, B, a128_pd, b128_pd) \
@@ -378,6 +383,12 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r);
GO2ps(A, B, c128_ps, d128_ps) \
GO2ps(A, B, d128_ps, d128_ps)
+ #define MULTIGO1ps2dq(A, B) \
+ GO1ps2dq(A, B, a128_ps) \
+ GO1ps2dq(A, B, b128_ps) \
+ GO1ps2dq(A, B, c128_ps) \
+ GO1ps2dq(A, B, d128_ps)
+
#define MULITGO2Cps(A, B, I) \
GO2Cps(A, B, a128_ps, b128_ps, I) \
GO2Cps(A, B, b128_ps, c128_ps, I) \
@@ -577,7 +588,7 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r);
MULITGO2ps(min, minps)
MULITGO2ps(div, divps)
MULITGO2ps(max, maxps)
-// MULITGO2Cps(cmp, cmpps, 0) // use avx for some reason
+ //MULITGO2Cps(cmp, cmpps, 0) // use avx for some reason
MULITGO2Cps(shuffle, shufps, 0)
MULITGO2Cps(shuffle, shufps, 0x15)
MULITGO2Cps(shuffle, shufps, 0xff)
@@ -589,6 +600,7 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r);
MULTIGO2sd(min, minsd)
MULTIGO2sd(div, divsd)
MULTIGO2sd(max, maxsd)
+ MULTIGO1ps2dq(cvtps, cvtps2pd)
return 0;
}
diff --git a/tests/test18.c b/tests/test18.c
index 395c2ef..4ed5591 100644
--- a/tests/test18.c
+++ b/tests/test18.c
@@ -1,3 +1,4 @@
+// build with gcc -march=corei7 -O2 -g -maes -mpclmul test18.c -o test18
#include <stdio.h>
#include <stdint.h>
#include <wmmintrin.h>
diff --git a/tests/test22.c b/tests/test22.c
index 68bd41c..da0d05f 100644
--- a/tests/test22.c
+++ b/tests/test22.c
@@ -5,6 +5,8 @@
#include <stdint.h>
#include <math.h>
+// Build with `gcc -march=core2 -mfpmath=387 -O2 test22.c -o test22`
+
#if defined(__x86_64__)
uint64_t _fucomip_(double a, double b)
{
@@ -30,7 +32,7 @@ uint64_t _fucompp_(double a, double b)
:"=a" (ret):"m"(a), "m"(b):"cc");
return ret;
}
-uint64_t _fistpw_(double a)
+uint64_t _fistpw_(double a, uint8_t rd)
{
uint16_t ret;
uint16_t t1, t2;
@@ -38,15 +40,31 @@ uint64_t _fistpw_(double a)
"fldl %1\n"
"fstcw %2\n"
"mov %2, %%ax\n"
- "mov $0x0c, %%ah\n"
+ "mov %4, %%ah\n"
"mov %%ax, %3\n"
"fldcw %3\n"
"fistp %0\n"
"fldcw %2\n"
- :"=m" (ret):"m"(a), "m"(t1), "m"(t2):"cc");
+ :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc");
return ret;
}
-uint64_t _fistpl_(double a)
+uint64_t _fisttpw_(double a, uint8_t rd)
+{
+ uint16_t ret;
+ uint16_t t1, t2;
+ asm volatile (
+ "fldl %1\n"
+ "fstcw %2\n"
+ "mov %2, %%ax\n"
+ "mov %4, %%ah\n"
+ "mov %%ax, %3\n"
+ "fldcw %3\n"
+ "fisttp %0\n"
+ "fldcw %2\n"
+ :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc");
+ return ret;
+}
+uint64_t _fistpl_(double a, uint8_t rd)
{
uint32_t ret;
uint16_t t1, t2;
@@ -54,15 +72,31 @@ uint64_t _fistpl_(double a)
"fldl %1\n"
"fstcw %2\n"
"mov %2, %%ax\n"
- "mov $0x0c, %%ah\n"
+ "mov %4, %%ah\n"
"mov %%ax, %3\n"
"fldcw %3\n"
"fistpl %0\n"
"fldcw %2\n"
- :"=m" (ret):"m"(a), "m"(t1), "m"(t2):"cc");
+ :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc");
return ret;
}
-uint64_t _fistpq_(double a)
+uint64_t _fisttpl_(double a, uint8_t rd)
+{
+ uint32_t ret;
+ uint16_t t1, t2;
+ asm volatile (
+ "fldl %1\n"
+ "fstcw %2\n"
+ "mov %2, %%ax\n"
+ "mov %4, %%ah\n"
+ "mov %%ax, %3\n"
+ "fldcw %3\n"
+ "fisttpl %0\n"
+ "fldcw %2\n"
+ :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc");
+ return ret;
+}
+uint64_t _fistpq_(double a, uint8_t rd)
{
uint64_t ret;
uint16_t t1, t2;
@@ -70,15 +104,31 @@ uint64_t _fistpq_(double a)
"fldl %1\n"
"fstcw %2\n"
"mov %2, %%ax\n"
- "mov $0x0c, %%ah\n"
+ "mov %4, %%ah\n"
"mov %%ax, %3\n"
"fldcw %3\n"
"fistpq %0\n"
"fldcw %2\n"
- :"=m" (ret):"m"(a), "m"(t1), "m"(t2):"cc");
+ :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc");
+ return ret;
+}
+uint64_t _fisttpq_(double a, uint8_t rd)
+{
+ uint64_t ret;
+ uint16_t t1, t2;
+ asm volatile (
+ "fldl %1\n"
+ "fstcw %2\n"
+ "mov %2, %%ax\n"
+ "mov %4, %%ah\n"
+ "mov %%ax, %3\n"
+ "fldcw %3\n"
+ "fisttpq %0\n"
+ "fldcw %2\n"
+ :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc");
return ret;
}
-uint64_t _frndint_(double a)
+uint64_t _frndint_(double a, uint8_t rd)
{
uint64_t ret;
uint16_t t1, t2;
@@ -86,13 +136,13 @@ uint64_t _frndint_(double a)
"fldl %1\n"
"fstcw %2\n"
"mov %2, %%ax\n"
- "mov $0x0c, %%ah\n"
+ "mov %4, %%ah\n"
"mov %%ax, %3\n"
"fldcw %3\n"
"frndint\n"
"fstpl %0\n"
"fldcw %2\n"
- :"=m" (ret):"m"(a), "m"(t1), "m"(t2):"cc");
+ :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc");
return ret;
}
#endif
@@ -107,6 +157,8 @@ int main(int argc, const char** argv)
{0x0, 0x4082c00000000000LL},
{0x8000000000000000LL, 0x4082c00000000000LL},
{0x8000000000000000LL, 0x0},
+ {0x40dfffc000000000LL, 0x40e0002000000000LL}, // 0x7fff and 0x8001 as double
+ {0xc0e0002000000000LL, 0xc0dfffc000000000LL}, // -0x8001 and -0x7fff as double
{0x8000000000000000LL, 0x3ff0000000000000LL},
{0x3ff0000000000000LL, 0x3fe89d9000000000LL},
{0x3ff0000000000000LL, 0x7ff0000000000000LL},
@@ -133,14 +185,23 @@ int main(int argc, const char** argv)
za = (flags>>(8+6))&1?'Z':'-';
pa = (flags>>(8+2))&1?'P':'-';
printf("%c%c%c\n", za, pa, ca);
- printf("FRNDINT 0x%llx => 0x%llx\n", *(uint64_t*)&a, _frndint_(a));
- printf("FRNDINT 0x%llx => 0x%llx\n", *(uint64_t*)&b, _frndint_(b));
- printf("FISTP 0x%llx => word: %x\n", *(uint64_t*)&a, _fistpw_(a));
- printf("FISTP 0x%llx => word: %x\n", *(uint64_t*)&b, _fistpw_(b));
- printf("FISTP 0x%llx => long: %x\n", *(uint64_t*)&a, _fistpl_(a));
- printf("FISTP 0x%llx => long: %x\n", *(uint64_t*)&b, _fistpl_(b));
- printf("FISTP 0x%llx => quad: %llx\n", *(uint64_t*)&a, _fistpq_(a));
- printf("FISTP 0x%llx => quad: %llx\n", *(uint64_t*)&b, _fistpq_(b));
+ for(int rd=0; rd<3; ++rd) {
+ printf("Rounding %d\n", rd);
+ printf(" FRNDINT 0x%llx => 0x%llx\n", *(uint64_t*)&a, _frndint_(a, rd<<2));
+ printf(" FRNDINT 0x%llx => 0x%llx\n", *(uint64_t*)&b, _frndint_(b, rd<<2));
+ printf(" FISTP 0x%llx => word: %x\n", *(uint64_t*)&a, _fistpw_(a, rd<<2));
+ printf(" FISTP 0x%llx => word: %x\n", *(uint64_t*)&b, _fistpw_(b, rd<<2));
+ printf(" FISTP 0x%llx => long: %x\n", *(uint64_t*)&a, _fistpl_(a, rd<<2));
+ printf(" FISTP 0x%llx => long: %x\n", *(uint64_t*)&b, _fistpl_(b, rd<<2));
+ printf(" FISTP 0x%llx => quad: %llx\n", *(uint64_t*)&a, _fistpq_(a, rd<<2));
+ printf(" FISTP 0x%llx => quad: %llx\n", *(uint64_t*)&b, _fistpq_(b, rd<<2));
+ printf(" FISTTP 0x%llx => word: %x\n", *(uint64_t*)&a, _fisttpw_(a, rd<<2));
+ printf(" FISTTP 0x%llx => word: %x\n", *(uint64_t*)&b, _fisttpw_(b, rd<<2));
+ printf(" FISTTP 0x%llx => long: %x\n", *(uint64_t*)&a, _fisttpl_(a, rd<<2));
+ printf(" FISTTP 0x%llx => long: %x\n", *(uint64_t*)&b, _fisttpl_(b, rd<<2));
+ printf(" FISTTP 0x%llx => quad: %llx\n", *(uint64_t*)&a, _fisttpq_(a, rd<<2));
+ printf(" FISTTP 0x%llx => quad: %llx\n", *(uint64_t*)&b, _fisttpq_(b, rd<<2));
+ }
}
printf("\nDone\n");
}
diff --git a/wrapperhelper/CMakeLists.txt b/wrapperhelper/CMakeLists.txt
new file mode 100644
index 0000000..3ab9cf1
--- /dev/null
+++ b/wrapperhelper/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.10)
+project("helper")
+find_package(Clang REQUIRED CONFIG)
+
+add_executable(helper main.cpp gen.cpp)
+target_include_directories(helper SYSTEM PUBLIC ${CLANG_INCLUDE_DIRS})
+target_link_libraries(helper PUBLIC clang-cpp LLVM)
diff --git a/wrapperhelper/README.md b/wrapperhelper/README.md
new file mode 100644
index 0000000..1edd4db
--- /dev/null
+++ b/wrapperhelper/README.md
@@ -0,0 +1,99 @@
+# Wrapper helper
+
+**WARNING: There are still many problems with this tool. Please do NOT submit code generated directly by the tool, you should only use it as a preliminary reference.**
+
+
+This tool is based on libclangtooling.
+
+It parses the AST of the library header files, generating the required structures of the wrapping library, including:
+- structure definitions,
+- export function signatures,
+- callback function wrapping,
+etc. Of course, this cannot completely automate everything, it can only be used as a reference.
+
+At the same time, this tool is also quite rough, and may even have errors.
+
+## Build
+
+```
+sudo apt install libclang-14-dev
+cd wrapperhelper
+mkdir build; cd build; cmake ..
+make
+```
+
+## Usage:
+
+ helper <filename> <libname> [guest_triple] [host_triple] -- <clang_flags>
+ <filename> : set the header file to be parsed
+ <libname> : set libname required for wrapping func
+ [guest_triple]: set guest triple: can be arm32/arm64/x86/x64, default is x64
+ [host_triple] : set host triple: can be arm32/arm64/x86/x64, default is arm64
+ -- : mandatory
+ <clang_flags> : extra compiler flags
+
+### Usage example:
+
+`./helper /usr/include/jpeglib.h libjpeg x64 arm64 -- -I /usr/lib/gcc/x86_*/12.2.0/include --include /usr/lib/gcc/x86_*/12.2.0/include/stddef.h --include /usr/include/stdio.h`
+
+You would see an output similar to the files `src/wrapped/wrappedlibjpeg.c` and `src/wrapped/wrappedlibjpeg_private.h`, should they exist.
+
+If there are multiple header files to process, write them into a custom header file as input.
+
+### Output sample
+
+Using the command above, we get the following (trimmed) files:
+
+In `wrappedlibjpeg_private.h`:
+```c
+...
+GO(jpeg_quality_scaling, iFi)
+...
+GOM(jpeg_destroy, vFEp)
+...
+```
+
+In `wrappedlibjpeg.c`:
+```c
+...
+typedef struct jpeg_source_mgr {
+ void *next_input_byte;
+ unsigned long bytes_in_buffer;
+ vFp_t init_source;
+ iFp_t fill_input_buffer;
+ vFpI_t skip_input_data;
+ iFpi_t resync_to_restart;
+ vFp_t term_source;
+} jpeg_source_mgr, *jpeg_source_mgr_ptr;
+...
+#define GO(A) \
+static uintptr_t my_term_source_fct_##A = 0; \
+void my_term_source_##A(struct jpeg_decompress_struct * a0) { \
+ return RunFunction(my_context, my_term_source_fct_##A, 1, a0); \
+}
+SUPER()
+#undef GO
+static void* findterm_sourceFct(void* fct) {
+ if(!fct) return fct;
+ if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
+ #define GO(A) if(my_term_source_fct_##A == (uintptr_t)fct) return my_term_source_##A;}
+ SUPER()
+ #undef GO
+ #define GO(A) if(my_term_source_fct_##A == 0) {my_term_source_fct_##A = (uintptr_t)fct;return my_term_source_##A;}
+ SUPER()
+ #undef GO
+ return NULL;
+}
+...
+EXPORT int my_jpeg_quality_scaling(void *emu, int quality) {
+ libjpeg_my_t *my = (libjpeg_my_t*)my_lib->priv.w.p2;
+ my->jpeg_quality_scaling(quality);
+}
+...
+EXPORT void my_jpeg_destroy(void *emu, struct jpeg_common_struct * cinfo) {
+ // WARN: This function's arg has a structure ptr which is special, may need to wrap it for the host
+ libjpeg_my_t *my = (libjpeg_my_t*)my_lib->priv.w.p2;
+ my->jpeg_destroy(cinfo);
+}
+...
+```
diff --git a/wrapperhelper/ast.h b/wrapperhelper/ast.h
new file mode 100644
index 0000000..2746d98
--- /dev/null
+++ b/wrapperhelper/ast.h
@@ -0,0 +1,189 @@
+#pragma once
+#include <clang/AST/ASTConsumer.h>
+#include <clang/AST/Attr.h>
+#include <clang/AST/Decl.h>
+#include <clang/AST/Type.h>
+#include <clang/Tooling/Tooling.h>
+#include <clang/Tooling/CompilationDatabase.h>
+#include <clang/AST/RecursiveASTVisitor.h>
+#include <clang/Frontend/FrontendAction.h>
+#include <clang/Frontend/CompilerInstance.h>
+#include <clang/Tooling/CommonOptionsParser.h>
+
+#include <ios>
+#include <llvm/Support/Casting.h>
+
+#include <cstddef>
+#include <fstream>
+#include <memory>
+#include <string>
+#include <iostream>
+#include <vector>
+#include <cstring>
+#include <map>
+
+#include "gen.h"
+#include "utils.h"
+
+static void ParseParameter(clang::ASTContext* AST, WrapperGenerator* Gen, clang::QualType ParmType, FuncInfo* Func) {
+ using namespace clang;
+ (void)AST; (void)Func;
+ if (ParmType->isFunctionPointerType()) {
+ auto ProtoType = ParmType->getPointeeType()->getAs<FunctionProtoType>();
+ for (unsigned i = 0; i < ProtoType->getNumParams(); i++) {
+ ParseParameter(AST, Gen, ProtoType->getParamType(i), Func);
+ }
+ } else if (ParmType->isPointerType()) {
+ auto PointeeType = ParmType->getPointeeType();
+ if (PointeeType->isRecordType()) {
+ if (Gen->records.find(StripTypedef(PointeeType)) == Gen->records.end()) {
+ auto Record = &Gen->records[StripTypedef(PointeeType)];
+ if (PointeeType->isUnionType()) {
+ Record->is_union = true;
+ }
+ Record->type = StripTypedef(PointeeType);
+ Record->decl = PointeeType->getAs<RecordType>()->getDecl();
+ Record->type_name = Record->decl->getIdentifier() ? Record->decl->getIdentifier()->getName().str() : "<null identifier>";
+ }
+ } else if (PointeeType->isPointerType()) {
+ PointeeType = PointeeType->getPointeeType();
+ if (PointeeType->isRecordType()) {
+ if (Gen->records.find(StripTypedef(PointeeType)) == Gen->records.end()) {
+ auto Record = &Gen->records[StripTypedef(PointeeType)];
+ if (PointeeType->isUnionType()) {
+ Record->is_union = true;
+ }
+
+ Record->type = StripTypedef(PointeeType);
+ Record->decl = PointeeType->getAs<RecordType>()->getDecl();
+ Record->type_name = Record->decl->getIdentifier() ? Record->decl->getIdentifier()->getName().str() : "<null identifier>";
+ }
+ }
+ }
+ } else if (ParmType->isRecordType()) {
+ if (Gen->records.find(StripTypedef(ParmType)) == Gen->records.end()) {
+ auto Record = &Gen->records[StripTypedef(ParmType)];
+ if (ParmType->isUnionType()) {
+ Record->is_union = true;
+ }
+ Record->type = StripTypedef(ParmType);
+ Record->decl = ParmType->getAs<RecordType>()->getDecl();
+ Record->type_name = Record->decl->getIdentifier() ? Record->decl->getIdentifier()->getName().str() : "<null identifier>";
+ }
+ }
+}
+
+static void ParseFunction(clang::ASTContext* AST, WrapperGenerator* Gen, clang::FunctionDecl* Decl) {
+ using namespace clang;
+ auto Type = Decl->getType().getTypePtr();
+ auto FuncInfo = &Gen->funcs[Type];
+ FuncInfo->type = Type;
+ FuncInfo->func_name = Decl->getNameAsString();
+ FuncInfo->decl = Decl;
+ FuncInfo->callback_args.resize(Decl->getNumParams());
+ if (Decl->getAttr<WeakRefAttr>()) {
+ FuncInfo->is_weak = true;
+ }
+ if (Decl->isVariadic()) {
+ FuncInfo->is_variadaic = true;
+ }
+ for (unsigned i = 0; i < Decl->getNumParams(); i++) {
+ auto ParmDecl = Decl->getParamDecl(i);
+ if (ParmDecl->getType()->isFunctionPointerType()) {
+ FuncInfo->callback_args[i] = ParmDecl->getType().getTypePtr();
+ FuncInfo->has_callback_arg = true;
+ } else {
+ FuncInfo->callback_args[i] = nullptr;
+ }
+ ParseParameter(AST, Gen, ParmDecl->getType(), FuncInfo);
+ }
+}
+
+class MyASTVisitor : public clang::RecursiveASTVisitor<MyASTVisitor> {
+public:
+ MyASTVisitor(clang::ASTContext* ctx) : Ctx(ctx) {}
+ MyASTVisitor(clang::ASTContext* ctx, WrapperGenerator* gen) : Ctx(ctx), Gen(gen) {}
+
+ bool VisitFunctionDecl(clang::FunctionDecl* Decl) {
+ ParseFunction(Ctx, Gen, Decl);
+ return true;
+ }
+private:
+ clang::ASTContext* Ctx;
+ WrapperGenerator* Gen;
+};
+
+class MyASTConsumer : public clang::ASTConsumer {
+public:
+ MyASTConsumer(clang::ASTContext* Context, const std::string& libname, const std::string& host_triple, const std::string& guest_triple)
+ : Visitor(Context, &Generator) {
+ Generator.Init(libname, host_triple, guest_triple);
+ }
+ void HandleTranslationUnit(clang::ASTContext &Ctx) override {
+ Visitor.TraverseDecl(Ctx.getTranslationUnitDecl());
+ std::cout << "--------------- Libclangtooling parse complete -----------------\n";
+ Generator.Prepare(&Ctx);
+ std::cout << "--------------- Generator prepare complete -----------------\n";
+ std::ofstream FuncDeclFile("wrapped" + Generator.libname + "_private.h", std::ios::out);
+ FuncDeclFile << Generator.GenFuncDeclare(&Ctx);
+ FuncDeclFile.close();
+ std::ofstream FuncDefineFile("wrapped" + Generator.libname + ".c", std::ios::out);
+ FuncDefineFile << "#include <stdio.h>\n"
+ "#include <stdlib.h>\n"
+ "#include <string.h>\n"
+ "#define _GNU_SOURCE /* See feature_test_macros(7) */\n"
+ "#include <dlfcn.h>\n"
+ "\n"
+ "#include \"wrappedlibs.h\"\n"
+ "\n"
+ "#include \"debug.h\"\n"
+ "#include \"wrapper.h\"\n"
+ "#include \"bridge.h\"\n"
+ "#include \"x64emu.h\"\n"
+ "#include \"box64context.h\"\n"
+ "\n"
+ "const char* " + Generator.libname + "Name = \"" + Generator.libname + "\";\n"
+ "#define LIBNAME " + Generator.libname + "\n"
+ "\n"
+ "#define ADDED_FUNCTIONS() \\\n"
+ "\n"
+ "#include \"generated/wrapped" + Generator.libname + "types.h\"\n";
+ FuncDefineFile << Generator.GenRecordDeclare(&Ctx);
+ FuncDefineFile << Generator.GenRecordConvert(&Ctx);
+ FuncDefineFile << Generator.GenCallbackWrap(&Ctx);
+ FuncDefineFile << Generator.GenFuncDefine(&Ctx);
+ FuncDefineFile.close();
+ std::cout << "--------------- Generator gen complete -----------------\n";
+ }
+private:
+ MyASTVisitor Visitor;
+ WrapperGenerator Generator;
+};
+
+class MyGenAction : public clang::ASTFrontendAction {
+public:
+ MyGenAction(const std::string& libname, const std::string& host_triple, const std::string& guest_triple) :
+ libname(libname), host_triple(host_triple), guest_triple(guest_triple) {}
+ std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(clang::CompilerInstance& Compiler, clang::StringRef file) override {
+ (void)file;
+ return std::make_unique<MyASTConsumer>(&Compiler.getASTContext(), libname, host_triple, guest_triple);
+ }
+private:
+ std::string libname;
+ std::string host_triple;
+ std::string guest_triple;
+};
+
+class MyFrontendActionFactory : public clang::tooling::FrontendActionFactory {
+public:
+ MyFrontendActionFactory(const std::string& libname, const std::string& host_triple, const std::string& guest_triple) :
+ libname(libname), host_triple(host_triple), guest_triple(guest_triple) {}
+private:
+ std::unique_ptr<clang::FrontendAction> create() override {
+ return std::make_unique<MyGenAction>(libname, host_triple, guest_triple);
+ }
+private:
+ std::string libname;
+ std::string host_triple;
+ std::string guest_triple;
+};
diff --git a/wrapperhelper/gen.cpp b/wrapperhelper/gen.cpp
new file mode 100644
index 0000000..743474c
--- /dev/null
+++ b/wrapperhelper/gen.cpp
@@ -0,0 +1,1059 @@
+#include "gen.h"
+#include "utils.h"
+#include <clang/AST/ASTContext.h>
+#include <clang/AST/Decl.h>
+#include <clang/AST/Type.h>
+#include <clang/Basic/LLVM.h>
+
+using namespace clang;
+using namespace clang::tooling;
+
+static std::vector<uint64_t> GetRecordFieldOff(const std::string& Code, const std::string& Triple) {
+ std::vector<uint64_t> FieldOff;
+ std::vector<std::string> Args = {"-target", Triple};
+ std::unique_ptr<clang::ASTUnit> AST = clang::tooling::buildASTFromCodeWithArgs(Code, Args);
+ auto& Ctx = AST->getASTContext();
+ auto TranslateDecl = Ctx.getTranslationUnitDecl();
+ for (const auto& Decl : TranslateDecl->decls()) {
+ if (const auto RecordDecl = clang::dyn_cast<clang::RecordDecl>(Decl)) {
+ auto& RecordLayout = Ctx.getASTRecordLayout(RecordDecl);
+ for (unsigned i = 0; i < RecordLayout.getFieldCount(); i++) {
+ FieldOff.push_back(RecordLayout.getFieldOffset(i) / 8);
+ }
+ break;
+ }
+ }
+ return FieldOff;
+}
+
+static uint64_t GetRecordSize(const std::string& Code, const std::string& Triple) {
+ std::vector<std::string> Args = {"-target", Triple};
+ std::unique_ptr<ASTUnit> AST = buildASTFromCodeWithArgs(Code, Args);
+ auto& Ctx = AST->getASTContext();
+ auto TranslateDecl = Ctx.getTranslationUnitDecl();
+ for (const auto& Decl : TranslateDecl->decls()) {
+ if (const auto recordDecl = dyn_cast<RecordDecl>(Decl)) {
+ return Ctx.getTypeSize(recordDecl->getTypeForDecl()) / 8;
+ }
+ }
+ return 0;
+}
+
+static CharUnits::QuantityType GetRecordAlign(const std::string& Code, const std::string& Triple) {
+ std::vector<std::string> Args = {"-target", Triple};
+ std::unique_ptr<ASTUnit> AST = buildASTFromCodeWithArgs(Code, Args);
+ auto& Ctx = AST->getASTContext();
+ auto TranslateDecl = Ctx.getTranslationUnitDecl();
+ for (const auto& Decl : TranslateDecl->decls()) {
+ if (const auto recordDecl = dyn_cast<RecordDecl>(Decl)) {
+ auto& RecordLayout = Ctx.getASTRecordLayout(recordDecl);
+ for (unsigned i = 0; i < RecordLayout.getFieldCount(); i++) {
+ return RecordLayout.getAlignment().getQuantity() / 8;
+ }
+ break;
+ }
+ }
+ return 0;
+}
+
+static uint64_t GetTypeSize(const Type* Type, const std::string& Triple) {
+ std::string Code = Type->getCanonicalTypeInternal().getAsString() + " dummy;";
+ std::vector<std::string> Args = {"-target", Triple};
+ std::unique_ptr<ASTUnit> AST = buildASTFromCodeWithArgs(Code, Args);
+ auto& Ctx = AST->getASTContext();
+ auto TranslateDecl = Ctx.getTranslationUnitDecl();
+ for (const auto& Decl : TranslateDecl->decls()) {
+ if (const auto varDecl = dyn_cast<VarDecl>(Decl)) {
+ return Ctx.getTypeSize(varDecl->getType()) / 8;
+ }
+ }
+ return 0;
+}
+
+static std::string TypeToSig(ASTContext* Ctx, const Type* Type) {
+ if (Type->isBuiltinType()) {
+ switch (Type->getAs<clang::BuiltinType>()->getKind()) {
+ case clang::BuiltinType::Kind::Void:
+ return "v";
+ case clang::BuiltinType::Kind::Bool:
+ return "i";
+ case clang::BuiltinType::Kind::Char_U:
+ return "C";
+ case clang::BuiltinType::Kind::Char_S:
+ return "c";
+ case clang::BuiltinType::Kind::Char8:
+ return "c";
+ case clang::BuiltinType::Kind::UChar:
+ return "C";
+ case clang::BuiltinType::Kind::SChar:
+ return "c";
+ case clang::BuiltinType::Kind::WChar_U:
+ return "W";
+ case clang::BuiltinType::Kind::UShort:
+ return "W";
+ case clang::BuiltinType::Kind::WChar_S:
+ return "w";
+ case clang::BuiltinType::Kind::Char16:
+ return "w";
+ case clang::BuiltinType::Kind::Short:
+ return "w";
+ case clang::BuiltinType::Kind::UInt:
+ return "u";
+ case clang::BuiltinType::Kind::Char32:
+ return "i";
+ case clang::BuiltinType::Kind::Int:
+ return "i";
+ case clang::BuiltinType::Kind::ULong:
+ return "L";
+ case clang::BuiltinType::Kind::Long:
+ return "l";
+ case clang::BuiltinType::Kind::ULongLong:
+ return "U";
+ case clang::BuiltinType::Kind::LongLong:
+ return "I";
+ case clang::BuiltinType::Kind::UInt128:
+ return "H";
+ case clang::BuiltinType::Kind::Int128:
+ return "H";
+ case clang::BuiltinType::Kind::Float:
+ return "f";
+ case clang::BuiltinType::Kind::Double:
+ return "d";
+ case clang::BuiltinType::Kind::LongDouble:
+ return "D";
+ case clang::BuiltinType::Kind::NullPtr:
+ return "p"; // nullptr_t
+ default:
+ std::cout << "Unsupported BuiltinType: " << Type->getCanonicalTypeInternal().getAsString() << std::endl;
+ }
+ } else {
+ if (Type->isPointerType()) {
+ return "p";
+ } else if (Type->isVoidType()) {
+ return "v";
+ } else if (Type->isUnsignedIntegerOrEnumerationType()) {
+ switch(Ctx->getTypeSizeInChars(Type).getQuantity()) {
+ case 1:
+ return "C";
+ case 2:
+ return "W";
+ case 4:
+ return "u";
+ case 8:
+ return "U";
+ default:
+ std::cout << "Unsupported UnsignedInteger Type: " << Type->getCanonicalTypeInternal().getAsString() << std::endl;
+ }
+ } else if (Type->isSignedIntegerOrEnumerationType()) {
+ switch(Ctx->getTypeSizeInChars(Type).getQuantity()) {
+ case 1:
+ return "c";
+ case 2:
+ return "w";
+ case 4:
+ return "i";
+ case 8:
+ return "I";
+ default:
+ std::cout << "Unsupported SignedInteger Type: " << Type->getCanonicalTypeInternal().getAsString() << std::endl;
+ }
+ } else if (Type->isCharType()) {
+ return "c";
+ } else if (Type->isFloatingType()) {
+ switch(Ctx->getTypeSizeInChars(Type).getQuantity()) {
+ case 4:
+ return "f";
+ case 8:
+ return "d";
+ case 16:
+ return "D";
+ default:
+ std::cout << "Unsupported Floating Type: " << Type->getCanonicalTypeInternal().getAsString()
+ << " (quantity = " << Ctx->getTypeSizeInChars(Type).getQuantity() << ")" << std::endl;
+ }
+ } else {
+ std::cout << "Unsupported Type: " << Type->getCanonicalTypeInternal().getAsString() << std::endl;
+ }
+ }
+ return "?";
+}
+
+// Prepare for generation, collect the structures and functions that need to be prcessed
+void WrapperGenerator::Prepare(ASTContext *Ctx) {
+ for (const auto &func_pair : funcs) {
+ for (auto Type : func_pair.second.callback_args) {
+ if (Type && Type->isTypedefNameType()) {
+ callbacks[StripTypedef(Type->getPointeeType())] =
+ Type->getAs<TypedefType>()->getDecl()->getNameAsString();
+ } else if (Type) {
+ callbacks[StripTypedef(Type->getPointeeType())] =
+ GetFuncSig(Ctx, Type->getPointeeType().getTypePtr()) + "_t";
+ }
+ }
+ }
+ std::vector<const Type *> Types;
+ for (const auto &record_pair : records) {
+ Types.push_back(record_pair.first);
+ }
+ for (auto type : Types) {
+ std::set<const Type*> Visited{type};
+ bool Special = false;
+ ParseRecordRecursive(Ctx, type, Special, Visited);
+ }
+ for (auto it = records.begin(); it != records.end();) {
+ if (!it->second.is_special) {
+ it = records.erase(it);
+ } else {
+ for (auto field : it->second.callback_fields) {
+ if (field->isTypedefNameType()) {
+ callbacks[StripTypedef(field->getPointeeType())] =
+ field->getAs<TypedefType>()->getDecl()->getNameAsString();
+ } else {
+ callbacks[StripTypedef(field->getPointeeType())] =
+ GetFuncSig(Ctx, field->getPointeeType().getTypePtr()) + "_t";
+ }
+ }
+ ++it;
+ }
+ }
+ for (auto &func_pair : funcs) {
+ for (unsigned i = 0; i < func_pair.second.decl->getNumParams(); i++) {
+ auto ParamDecl = func_pair.second.decl->getParamDecl(i);
+ auto ParamType = ParamDecl->getType();
+ if (ParamType->isPointerType() &&
+ ParamType->getPointeeType()->isRecordType()) {
+ if (records.find(StripTypedef(ParamType->getPointeeType())) !=
+ records.end()) {
+ func_pair.second.has_special_arg = true;
+ break;
+ }
+ } else if (ParamType->isRecordType()) {
+ if (records.find(StripTypedef(ParamType)) != records.end()) {
+ func_pair.second.has_special_arg = true;
+ break;
+ }
+ }
+ }
+ auto RetType = func_pair.second.decl->getReturnType();
+ if (RetType->isPointerType() && RetType->getPointeeType()->isRecordType()) {
+ if (records.find(StripTypedef(RetType->getPointeeType())) !=
+ records.end()) {
+ func_pair.second.has_special_ret = true;
+ }
+ } else if (RetType->isRecordType()) {
+ if (records.find(StripTypedef(RetType)) != records.end()) {
+ func_pair.second.has_special_ret = true;
+ }
+ }
+ }
+}
+
+// Gen callback typedef
+std::string WrapperGenerator::GenCallbackTypeDefs(ASTContext *Ctx) {
+ (void)Ctx;
+ std::string res;
+ for (auto callback : callbacks) {
+ auto Type = callback.first;
+ auto Definition = GetFuncDefinition(Type);
+ res += "typedef " + Definition.ret_str + "(*" + callback.second + ")(";
+ for (int i = 0; i < Definition.arg_size - 1; i++) {
+ res += Definition.arg_types_str[i] + Definition.arg_names[i] + ", ";
+ }
+ if (Definition.arg_size) {
+ res += Definition.arg_types_str[Definition.arg_size - 1] + Definition.arg_names[Definition.arg_size - 1];
+ }
+ res += ");\n";
+ }
+ return res;
+}
+
+// Gen function declare
+std::string WrapperGenerator::GenDeclare(ASTContext *Ctx,
+ const FuncInfo &Func) {
+ std::string res;
+ std::string sig = GetFuncSig(Ctx, Func);
+ res += "GO";
+ if (Func.is_weak) {
+ res += "W";
+ }
+ if (sig.find('E') != std::string::npos) {
+ res += "M";
+ }
+ res += "(" + Func.func_name + ", " + sig + ")\n";
+ ;
+ return res;
+}
+
+// Gen structure declare
+std::string WrapperGenerator::GenDeclare(ASTContext *Ctx,
+ const RecordInfo &Record) {
+ (void)Ctx;
+ std::string RecordStr;
+ std::string PreDecl;
+ RecordStr += "\ntypedef ";
+ RecordStr +=
+ (Record.is_union ? "union " : "struct ") + Record.type_name + " {\n";
+ for (const auto &Field : Record.decl->fields()) {
+ auto Type = Field->getType();
+ std::string Name = Field->getNameAsString();
+ RecordStr += " ";
+ if (Type->isFunctionPointerType()) {
+ auto FuncType = StripTypedef(Type->getPointeeType());
+ if (callbacks.count(FuncType)) {
+ std::string FieldStr = callbacks[FuncType];
+ FieldStr += " ";
+ FieldStr += Name;
+ RecordStr += FieldStr;
+ } else {
+ std::cout << "Err: FuncPtr(" << Record.type_name << "." << Name << ") is not supported\n";
+ }
+ } else if (Type->isPointerType()) {
+ auto PointeeType = Type->getPointeeType();
+ if (PointeeType->isRecordType()) {
+ if (records.count(PointeeType.getTypePtr())) {
+ std::string FieldStr = records[PointeeType.getTypePtr()].type_name;
+ FieldStr += "_ptr ";
+ FieldStr += Name;
+ RecordStr += FieldStr;
+ } else {
+ RecordStr += "void *" + Name;
+ }
+ } else {
+ RecordStr += "void *" + Name;
+ }
+ } else if (Type->isRecordType()) {
+ if (records.count(Type.getTypePtr())) {
+ std::string FieldStr = records[Type.getTypePtr()].type_name;
+ FieldStr += " ";
+ FieldStr += Name;
+ RecordStr += FieldStr;
+ } else {
+ RecordStr += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl);
+ }
+ } else {
+ RecordStr += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl);
+ }
+ RecordStr += ";\n";
+ }
+ RecordStr += "} ";
+ RecordStr += Record.type_name + ", *" + Record.type_name + "_ptr;\n";
+ return RecordStr;
+}
+
+std::string WrapperGenerator::GenCallbackWrap(ASTContext *Ctx,
+ const FuncInfo &Func) {
+ (void)Ctx;
+ std::string res;
+
+ for (unsigned i = 0; i < Func.decl->getNumParams(); i++) {
+ auto ParamType = Func.decl->getParamDecl(i)->getType();
+ if (ParamType->isFunctionPointerType()) {
+
+ auto PointeeType = ParamType->getPointeeType();
+ auto Definition = GetFuncDefinition(PointeeType.getTypePtr());
+ std::string my_funcname =
+ std::string("my_") + Func.decl->getParamDecl(i)->getNameAsString();
+ std::string funcname = Func.decl->getParamDecl(i)->getNameAsString();
+ res += "\n#define GO(A) \\\n"
+ "static uintptr_t " + my_funcname + "_fct_##A = 0; \\\n" +
+ Definition.ret_str + " " + my_funcname + "(";
+ int arg_size = Definition.arg_names.size();
+ if (arg_size) {
+ for (int i = 0; i < arg_size - 1; i++) {
+ res += Definition.arg_types_str[i] + " " + Definition.arg_names[i] + ", ";
+ }
+ res += Definition.arg_types_str[arg_size - 1] + " " + Definition.arg_names[arg_size - 1];
+ }
+ res += ") { \\\n"
+ " return RunFunction(my_context, " + my_funcname + "_fct_##A" + ", " + std::to_string(arg_size);
+ for (int i = 0; i < arg_size; i++) {
+ res += ", " + Definition.arg_names[i];
+ }
+ res += "); \\\n"
+ "}\n"
+ "SUPER()\n"
+ "#undef GO\n"
+ "static void* find" + funcname + "Fct(void* fct) {\n"
+ " if (!fct) return fct;\n"
+ " if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);\n"
+ " #define GO(A) if (" + my_funcname + "_fct_##A == (uintptr_t)fct) return " + my_funcname + "_##A;\n"
+ " SUPER()\n"
+ " #undef GO\n"
+ " #define GO(A) if (" + my_funcname + "_fct_##A == 0) { " + my_funcname + "_fct_##A = (uintptr_t)fct; return " + my_funcname + "_##A; }\n"
+ " SUPER()\n"
+ " #undef GO\n"
+ " return NULL;\n"
+ "}\n";
+ }
+ }
+ return res;
+}
+
+std::string WrapperGenerator::GenCallbackWrap(ASTContext *Ctx,
+ const RecordInfo &Struct) {
+ (void)Ctx;
+ std::string res;
+ for (const auto &field : Struct.decl->fields()) {
+ auto FieldType = field->getType();
+ if (FieldType->isFunctionPointerType()) {
+ auto PointeeType = FieldType->getPointeeType();
+ auto Definition = GetFuncDefinition(PointeeType.getTypePtr());
+ std::string my_funcname = std::string("my_") + field->getNameAsString();
+ std::string funcname = field->getNameAsString();
+ res += "\n#define GO(A) \\\n"
+ "static uintptr_t " + my_funcname + "_fct_##A = 0; \\\n" +
+ Definition.ret_str + " " + my_funcname + "_##A(";
+ int arg_size = Definition.arg_names.size();
+ if (arg_size) {
+ for (int i = 0; i < arg_size - 1; i++) {
+ res += Definition.arg_types_str[i] + " " + Definition.arg_names[i] + ", ";
+ }
+ res += Definition.arg_types_str[arg_size - 1] + " " + Definition.arg_names[arg_size - 1];
+ }
+ res += ") { \\\n"
+ " return RunFunction(my_context, " + my_funcname + "_fct_##A" + ", " + std::to_string(arg_size);
+ for (int i = 0; i < arg_size; i++) {
+ res += ", " + Definition.arg_names[i];
+ }
+ res += "); \\\n"
+ "}\n"
+ "SUPER()\n"
+ "#undef GO\n"
+ "static void* find" + funcname + "Fct(void* fct) {\n"
+ " if(!fct) return fct;\n"
+ " if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);\n"
+ " #define GO(A) if(" + my_funcname + "_fct_##A == (uintptr_t)fct) return " + my_funcname + "_##A;}\n"
+ " SUPER()\n"
+ " #undef GO\n"
+ " #define GO(A) if(" + my_funcname + "_fct_##A == 0) {" + my_funcname + "_fct_##A = (uintptr_t)fct;" + "return " + my_funcname + "_##A;}\n"
+ " SUPER()\n"
+ " #undef GO\n"
+ " return NULL;\n"
+ "}\n";
+ }
+ }
+ return res;
+}
+
+std::string WrapperGenerator::GenDefine(ASTContext *Ctx,
+ const FuncInfo &Func) {
+ std::string res;
+ auto Definition = GetFuncDefinition(Func.decl);
+ std::string Sig = GetFuncSig(Ctx, Func.type);
+ res += "\nEXPORT " + Definition.ret_str + "my_" + Func.func_name + "(";
+ if (Sig.find('E')) {
+ res += "void *emu, ";
+ }
+ int arg_size = Definition.arg_names.size();
+ if (arg_size) {
+ for (int i = 0; i < arg_size - 1; i++) {
+ if (Definition.arg_types[i]->isPointerType()) {
+ auto PointeeType = Definition.arg_types[i]->getPointeeType();
+ if (records.count(PointeeType.getTypePtr())) {
+ res +=
+ Definition.arg_types[i]->getCanonicalTypeInternal().getAsString();
+ } else {
+ res += Definition.arg_types_str[i];
+ }
+ } else {
+ res += Definition.arg_types_str[i];
+ }
+ res += " " + Definition.arg_names[i] + ", ";
+ }
+ if (Definition.arg_types[arg_size - 1]->isPointerType()) {
+ auto PointeeType = Definition.arg_types[arg_size - 1]->getPointeeType();
+ if (records.count(PointeeType.getTypePtr())) {
+ res += Definition.arg_types[arg_size - 1]
+ ->getCanonicalTypeInternal()
+ .getAsString();
+ } else {
+ res += Definition.arg_types_str[arg_size - 1];
+ }
+ } else {
+ res += Definition.arg_types_str[arg_size - 1];
+ }
+ res += " ";
+ res += Definition.arg_names[arg_size - 1];
+ }
+ res += ") {\n";
+ if (Func.has_special_arg) {
+ res += " // WARN: This function's arg has a structure ptr which is "
+ "special, may need to wrap it for the host\n";
+
+ } else if (Func.has_special_ret) {
+ res += " // WARN: This function's ret is a structure ptr which is "
+ "special, may need to wrap it for the guest\n";
+ }
+ if (Func.has_callback_arg) {
+ res += " " + my_lib_type + " *my = " + "(" + my_lib_type + "*)" +
+ my_lib + "->priv.w.p2;\n"
+ " my->" + Func.func_name + "(";
+ if (arg_size) {
+ for (int i = 0; i < arg_size - 1; i++) {
+ if (Func.callback_args[i]) {
+ if (!Func.callback_args[i]->isTypedefNameType()) {
+ res +=
+ "find" + Func.func_name + "_arg" + std::to_string(i) + "Fct";
+ } else {
+ res += "find" +
+ Func.callback_args[i]
+ ->getAs<TypedefType>()
+ ->getDecl()
+ ->getNameAsString() +
+ "Fct";
+ }
+ res += "(" + Definition.arg_names[i] + ")";
+ } else {
+ res += Definition.arg_names[i];
+ }
+ res += ", ";
+ }
+ if (Func.callback_args[arg_size - 1]) {
+ if (!Func.callback_args[arg_size - 1]->isTypedefNameType()) {
+ res += "find" + Func.func_name + "_arg" +
+ std::to_string(arg_size - 1) + "Fct";
+ } else {
+ res += "find" +
+ Func.callback_args[arg_size - 1]
+ ->getAs<TypedefType>()
+ ->getDecl()
+ ->getNameAsString() +
+ "Fct";
+ }
+ res += "(" + Definition.arg_names[arg_size - 1] + ")";
+ } else {
+ res += Definition.arg_names[arg_size - 1];
+ }
+ res += ")\n";
+ }
+ } else {
+ res += " " + my_lib_type + " *my = (" + my_lib_type + "*)" + my_lib + "->priv.w.p2;\n"
+ " my->" + Func.func_name + "(";
+ if (arg_size) {
+ for (int i = 0; i < arg_size - 1; i++) {
+ res += Definition.arg_names[i] + ", ";
+ }
+ res += Definition.arg_names[arg_size - 1];
+ }
+ res += ");\n";
+ }
+
+ res += "}\n";
+ return res;
+}
+
+std::string WrapperGenerator::GenDeclareDiffTriple(
+ ASTContext *Ctx, const RecordInfo &Record,
+ const std::string &GuestTriple, const std::string &HostTriple) {
+ (void)Ctx;
+ std::string GuestRecord;
+ std::string HostRecord;
+ std::string PreDecl;
+ std::vector<uint64_t> GuestFieldOff;
+ std::vector<uint64_t> HostFieldOff;
+ GuestRecord += "typedef ";
+ HostRecord += "typedef ";
+ GuestRecord +=
+ (Record.is_union ? "union " : "struct ") + Record.type_name + " {\n";
+ HostRecord += (Record.is_union ? "union " : "struct ") +
+ std::string("host_") + Record.type_name + " {\n";
+ auto OffDiff = GetRecordFieldOffDiff(Record.type, GuestTriple, HostTriple,
+ GuestFieldOff, HostFieldOff);
+ uint64_t GuestRecordSize = GetRecordSize(Record.type, GuestTriple);
+ uint64_t HostRecordSize = GetRecordSize(Record.type, HostTriple);
+ uint64_t SizeDiff = GuestRecordSize - HostRecordSize;
+ int FieldIndex = 0;
+ std::set<FieldDecl *> AlignDiffFields;
+ for (const auto &Field : Record.decl->fields()) {
+ if (OffDiff[FieldIndex] == 0) {
+ FieldIndex++;
+ continue;
+ }
+ std::string Name = Field->getNameAsString();
+ if (OffDiff[FieldIndex] != SizeDiff) {
+ auto Diff = OffDiff[FieldIndex];
+ AlignDiffFields.insert(Field);
+ for (size_t i = FieldIndex; i < OffDiff.size(); i++) {
+ if (OffDiff[i] == Diff) {
+ OffDiff[i] = 0;
+ } else {
+ break;
+ }
+ }
+ } else {
+ AlignDiffFields.insert(Field);
+ break;
+ }
+ FieldIndex++;
+ }
+ for (const auto &Field : Record.decl->fields()) {
+ auto Type = Field->getType();
+ std::string Name = Field->getNameAsString();
+ GuestRecord += " ";
+ HostRecord += " ";
+ if (AlignDiffFields.find(Field) != AlignDiffFields.end()) {
+ auto typeSize = GetTypeSize(StripTypedef(Field->getType()), guest_triple);
+ switch (typeSize) {
+ // FIXME: should test more case in different triple
+ case 4: GuestRecord += "int " + Name ; break;
+ case 8: GuestRecord += "int " + Name + "[2]"; break;
+ default:
+ std::cout << "Err: unknown type size " << typeSize << std::endl;
+ break;
+ }
+ HostRecord += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl);
+ } else if (Type->isFunctionPointerType()) {
+ auto FuncType = StripTypedef(Type->getPointeeType());
+ if (callbacks.count(FuncType)) {
+ std::string FieldStr = callbacks[FuncType];
+ FieldStr += " ";
+ FieldStr += Name;
+ GuestRecord += FieldStr;
+ HostRecord += FieldStr;
+ } else {
+ std::cout << "Err: FuncPtr(" << Record.type_name << "." << Name << ") is not supported" << std::endl;
+ }
+ } else if (Type->isPointerType()) {
+ auto PointeeType = Type->getPointeeType();
+ if (PointeeType->isRecordType()) {
+ if (records.count(PointeeType.getTypePtr())) {
+ std::string FieldStr = records[PointeeType.getTypePtr()].type_name;
+ FieldStr += "_ptr " + Name;
+ GuestRecord += FieldStr;
+ HostRecord += "host_" + FieldStr;
+ } else {
+ GuestRecord += "void *" + Name;
+ HostRecord += "void *" + Name;
+ }
+ } else {
+ GuestRecord += "void *" + Name;
+ HostRecord += "void *" + Name;
+ }
+ } else if (Type->isRecordType()) {
+ if (records.count(Type.getTypePtr())) {
+ std::string FieldStr = records[Type.getTypePtr()].type_name;
+ FieldStr += " " + Name;
+ GuestRecord += FieldStr;
+ HostRecord += "host_" + FieldStr;
+ } else {
+ GuestRecord += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl);
+ HostRecord += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl);
+ }
+ } else {
+ HostRecord += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl);
+ GuestRecord += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl);
+ }
+ GuestRecord += ";\n";
+ HostRecord += ";\n";
+ }
+ GuestRecord += "} " + Record.type_name + ", *" + Record.type_name + "_ptr;\n";
+ HostRecord += "} host_" + Record.type_name + ", *host_" + Record.type_name + "_ptr;\n";
+ return GuestRecord + HostRecord;
+}
+
+// Gen record convert function between host and guest
+std::string WrapperGenerator::GenRecordConvert(const RecordInfo &Record) {
+ std::string res;
+ if (Record.guest_size != Record.host_size) {
+ auto RecordDecl = Record.decl;
+ std::vector<uint64_t> GuestFieldOff;
+ std::vector<uint64_t> HostFieldOff;
+ auto OffDiff = GetRecordFieldOffDiff(Record.type, guest_triple, host_triple,
+ GuestFieldOff, HostFieldOff);
+ int FieldIndex = 0;
+ std::vector<FieldDecl *> AlignDiffFields;
+ uint64_t SizeDiff = Record.guest_size - Record.host_size;
+ for (const auto &Field : RecordDecl->fields()) {
+ if (OffDiff[FieldIndex] == 0) {
+ FieldIndex++;
+ continue;
+ }
+ if (OffDiff[FieldIndex] != SizeDiff) {
+ auto Diff = OffDiff[FieldIndex];
+ AlignDiffFields.push_back(Field);
+ for (size_t i = FieldIndex; i < OffDiff.size(); i++) {
+ if (OffDiff[i] == Diff) {
+ OffDiff[i] = 0;
+ } else {
+ break;
+ }
+ }
+ } else {
+ AlignDiffFields.push_back(Field);
+ break;
+ }
+ FieldIndex++;
+ }
+ if (!AlignDiffFields.size()) {
+ return res;
+ }
+ res += "void g2h_" + Record.type_name + "(" + "struct host_" + Record.type_name + " *d, struct " + Record.type_name + " *s) {\n";
+ std::string body = " memcpy(d, s, offsetof(struct " + Record.type_name +
+ ", " + AlignDiffFields[0]->getNameAsString() + "));\n";
+ std::string offstr = "offsetof(struct " + Record.type_name + ", " +
+ AlignDiffFields[0]->getNameAsString() + ")";
+ for (size_t i = 0; i < AlignDiffFields.size() - 1; i++) {
+ body += " memcpy(d->" + AlignDiffFields[i]->getNameAsString() + ", " +
+ "s->" + AlignDiffFields[i]->getNameAsString() + ", " +
+ "offsetof(struct " + Record.type_name + ", " +
+ AlignDiffFields[i + 1]->getNameAsString() + ") - " + offstr +
+ ");\n";
+ offstr = "offsetof(struct " + Record.type_name + ", " +
+ AlignDiffFields[i + 1]->getNameAsString() + ")";
+ }
+ body += " memcpy(d->" +
+ AlignDiffFields[AlignDiffFields.size() - 1]->getNameAsString() +
+ ", " + "s->" +
+ AlignDiffFields[AlignDiffFields.size() - 1]->getNameAsString() +
+ ", " + std::to_string(GetRecordSize(Record.type, guest_triple)) +
+ " - " + offstr + ");\n";
+ res += body + "}\n";
+
+ res += "void h2g_" + Record.type_name + "(struct " + Record.type_name + " *d, " + "struct host_" + Record.type_name + " *s) {\n";
+ res += body;
+ res += "}\n";
+ }
+ return res;
+}
+
+void WrapperGenerator::ParseRecordRecursive(
+ ASTContext *Ctx, const Type *type, bool &Special,
+ std::set<const Type *> &Visited) {
+ auto recordType = type->getAs<RecordType>();
+ auto RecordDecl = recordType->getDecl();
+ for (const auto &field : RecordDecl->fields()) {
+ auto FieldType = field->getType();
+ if (FieldType->isFunctionPointerType()) {
+ auto Record = &records[type];
+ Record->callback_fields.push_back(field->getType().getTypePtr());
+ // Record->type_name =
+ Special = true;
+ } else if (FieldType->isPointerType() &&
+ FieldType->getPointeeType()->isRecordType()) {
+ auto FieldRecordType = StripTypedef(FieldType->getPointeeType());
+ if (Visited.find(FieldRecordType) != Visited.end())
+ continue;
+ Visited.insert(FieldRecordType);
+ bool _Special = false;
+ ParseRecordRecursive(Ctx, FieldRecordType, _Special, Visited);
+ if (_Special)
+ Special = true;
+ } else if (FieldType->isRecordType()) {
+ auto FieldRecordType = StripTypedef(FieldType);
+ if (Visited.find(FieldRecordType) != Visited.end())
+ continue;
+ Visited.insert(FieldRecordType);
+ bool _Special = false;
+ ParseRecordRecursive(Ctx, FieldRecordType, _Special, Visited);
+ if (_Special)
+ Special = true;
+ }
+ }
+ uint64_t GuestSize = GetRecordSize(type, guest_triple);
+ uint64_t HostSize = GetRecordSize(type, host_triple);
+
+ auto Record = &records[type];
+ if (GuestSize != HostSize) {
+ Special = 1;
+ }
+ if (type->isUnionType()) {
+ Record->is_union = true;
+ }
+ if (!Record->decl) {
+ Record->type = type;
+ Record->decl = RecordDecl;
+ if (RecordDecl->getIdentifier())
+ Record->type_name = RecordDecl->getIdentifier()->getName().str();
+ }
+ Record->guest_size = GuestSize;
+ Record->host_size = HostSize;
+ if (Record->type_name.empty()) {
+ Record->is_special = false;
+ } else
+ Record->is_special = Special;
+}
+
+// Type to String
+std::string WrapperGenerator::TypeStringify(const Type *Type,
+ FieldDecl *FieldDecl,
+ ParmVarDecl *ParmDecl,
+ std::string& PreDecl,
+ std::string indent,
+ std::string Name) {
+ std::string res;
+ std::string name = FieldDecl
+ ? FieldDecl->getNameAsString()
+ : (ParmDecl ? ParmDecl->getNameAsString() : Name);
+ if (Type->isPointerType()) {
+ auto PointeeType = Type->getPointeeType();
+ if (PointeeType->isBuiltinType()) {
+ res +=
+ StripTypedef(PointeeType)->getCanonicalTypeInternal().getAsString();
+ } else if (PointeeType->isRecordType()) {
+ if (records.find(StripTypedef(PointeeType)) != records.end() &&
+ records[StripTypedef(PointeeType)].is_special) {
+ res += (PointeeType->isUnionType() ? "union " : "struct ") + records[StripTypedef(PointeeType)].type_name;
+ } else {
+ res += "void";
+ }
+ } else {
+ res += "void";
+ }
+ res += " *" + name;
+ } else if (Type->isEnumeralType()) {
+ res += "int " + name;
+ } else if (Type->isRecordType()) {
+ if (records.find(StripTypedef(Type->getCanonicalTypeInternal())) !=
+ records.end() &&
+ records[StripTypedef(Type->getCanonicalTypeInternal())].is_special) {
+ res += Type->isUnionType() ? "union " : "struct ";
+ res += records[StripTypedef(Type->getCanonicalTypeInternal())].type_name;
+ res += " ";
+ } else {
+ res += AnonRecordDecl(Type->getAs<RecordType>(), PreDecl, indent + " ");
+ }
+ res += name;
+ } else if (Type->isConstantArrayType()) {
+ auto ArrayType =
+ dyn_cast<ConstantArrayType>(Type->getAsArrayTypeUnsafe());
+ int EleSize = ArrayType->getSize().getZExtValue();
+ if (ArrayType->getElementType()->isPointerType()) {
+ res += "void *";
+ } else if (ArrayType->getElementType()->isEnumeralType()) {
+ res += "int ";
+ } else if (ArrayType->getElementType()->isRecordType()) {
+ auto RecordType = ArrayType->getElementType()->getAs<clang::RecordType>();
+ auto RecordDecl = RecordType->getDecl();
+ if (RecordDecl->isCompleteDefinition()) {
+ auto& Ctx = RecordDecl->getDeclContext()->getParentASTContext();
+ PreDecl += "#include \"";
+ PreDecl += GetDeclHeaderFile(Ctx, RecordDecl);
+ PreDecl += "\"";
+ PreDecl += "\n";
+ }
+ res += StripTypedef(ArrayType->getElementType())
+ ->getCanonicalTypeInternal()
+ .getAsString();
+ } else {
+ res += StripTypedef(ArrayType->getElementType())
+ ->getCanonicalTypeInternal()
+ .getAsString();
+ }
+ res += " ";
+ res += name;
+ res += "[";
+ res += std::to_string(EleSize);
+ res += "]";
+ } else {
+ res += StripTypedef(Type->getCanonicalTypeInternal())
+ ->getCanonicalTypeInternal()
+ .getAsString();
+ res += " ";
+ res += name;
+ }
+ return indent + res;
+}
+
+// Type to String, less detail
+std::string WrapperGenerator::SimpleTypeStringify(const Type *Type,
+ FieldDecl *FieldDecl,
+ ParmVarDecl *ParmDecl,
+ std::string indent,
+ std::string Name) {
+ std::string res;
+ std::string name = FieldDecl
+ ? FieldDecl->getNameAsString()
+ : (ParmDecl ? ParmDecl->getNameAsString() : Name);
+ if (Type->isPointerType()) {
+ res += "void *" + name;
+ } else if (Type->isEnumeralType()) {
+ res += "int ";
+ res += name;
+ } else if (Type->isRecordType()) {
+ if (records.find(StripTypedef(Type->getCanonicalTypeInternal())) !=
+ records.end()) {
+ res += Type->isUnionType() ? "union " : "struct ";
+ res += records[StripTypedef(Type->getCanonicalTypeInternal())].type_name;
+ res += " ";
+ } else {
+ res += SimpleAnonRecordDecl(Type->getAs<RecordType>(), indent);
+ }
+ res += name;
+ } else if (Type->isConstantArrayType()) {
+ auto ArrayType =
+ dyn_cast<ConstantArrayType>(Type->getAsArrayTypeUnsafe());
+ int EleSize = ArrayType->getSize().getZExtValue();
+ if (ArrayType->getElementType()->isPointerType()) {
+ res += "void *";
+ } else {
+ res += StripTypedef(ArrayType->getElementType())
+ ->getCanonicalTypeInternal()
+ .getAsString();
+ }
+ res += " ";
+ res += name;
+ res += "[";
+ res += std::to_string(EleSize);
+ res += "]";
+ } else {
+ res += StripTypedef(Type->getCanonicalTypeInternal())
+ ->getCanonicalTypeInternal()
+ .getAsString();
+ res += " ";
+ res += name;
+ }
+ return indent + res;
+}
+
+std::string WrapperGenerator::AnonRecordDecl(const RecordType *Type, std::string& PreDecl, std::string indent) {
+ auto RecordDecl = Type->getDecl();
+ std::string res;
+ res += Type->isUnionType() ? "union {\n" : "struct {\n";
+ for (const auto &field : RecordDecl->fields()) {
+ auto FieldType = field->getType();
+ res += TypeStringify(StripTypedef(FieldType), field, nullptr, PreDecl, indent + " ");
+ res += ";\n";
+ }
+ res += indent + "} ";
+ return res;
+}
+
+std::string
+WrapperGenerator::SimpleAnonRecordDecl(const RecordType *Type, std::string indent) {
+ auto RecordDecl = Type->getDecl();
+ std::string res;
+ res += Type->isUnionType() ? "union {\n" : "struct {\n";
+ for (const auto &field : RecordDecl->fields()) {
+ auto FieldType = field->getType();
+ res += SimpleTypeStringify(StripTypedef(FieldType), field, nullptr, indent + " ");
+ res += ";\n";
+ }
+ res += indent + "} ";
+ return res;
+}
+
+// Get func info from FunctionType
+FuncDefinition WrapperGenerator::GetFuncDefinition(const Type *Type) {
+ FuncDefinition res;
+ std::string PreDecl;
+ auto ProtoType = Type->getAs<FunctionProtoType>();
+ res.ret = StripTypedef(ProtoType->getReturnType());
+ res.ret_str =
+ TypeStringify(StripTypedef(ProtoType->getReturnType()), nullptr, nullptr, PreDecl);
+ for (unsigned i = 0; i < ProtoType->getNumParams(); i++) {
+ auto ParamType = ProtoType->getParamType(i);
+ res.arg_types.push_back(StripTypedef(ParamType));
+ res.arg_types_str.push_back(
+ TypeStringify(StripTypedef(ParamType), nullptr, nullptr, PreDecl));
+ res.arg_names.push_back(std::string("a") + std::to_string(i));
+ }
+ if (ProtoType->isVariadic()) {
+ res.is_variadaic = true;
+ }
+ res.arg_size = ProtoType->getNumParams();
+ return res;
+}
+
+// Get funcdecl info from FunctionDecl
+FuncDefinition WrapperGenerator::GetFuncDefinition(FunctionDecl *Decl) {
+ FuncDefinition res;
+ std::string PreDecl;
+ auto RetType = Decl->getReturnType();
+ res.ret = RetType.getTypePtr();
+ res.ret_str = TypeStringify(StripTypedef(RetType), nullptr, nullptr, PreDecl);
+ for (unsigned i = 0; i < Decl->getNumParams(); i++) {
+ auto ParamDecl = Decl->getParamDecl(i);
+ auto ParamType = ParamDecl->getType();
+ res.arg_types.push_back(ParamType.getTypePtr());
+ res.arg_types_str.push_back(
+ TypeStringify(StripTypedef(ParamType), nullptr, nullptr, PreDecl));
+ res.arg_names.push_back(ParamDecl->getNameAsString());
+ }
+ if (Decl->isVariadic()) {
+ res.is_variadaic = true;
+ }
+ return res;
+}
+
+// Get the offset diff between two different triple
+std::vector<uint64_t> WrapperGenerator::GetRecordFieldOffDiff(
+ const Type *Type, const std::string &GuestTriple,
+ const std::string &HostTriple, std::vector<uint64_t> &GuestFieldOff,
+ std::vector<uint64_t> &HostFieldOff) {
+ std::string PreDecl;
+ std::string Code = TypeStringify(Type, nullptr, nullptr, PreDecl, "", "dummy;");
+ std::vector<uint64_t> OffsetDiff;
+ GuestFieldOff = GetRecordFieldOff(Code, GuestTriple);
+ HostFieldOff = GetRecordFieldOff(Code, HostTriple);
+ if (GuestFieldOff.size() != HostFieldOff.size()) {
+ // Should not happen
+ std::cout << "Greater field offsets in guest than in host" << std::endl;
+ return OffsetDiff;
+ }
+ for (size_t i = 0; i < GuestFieldOff.size(); i++) {
+ OffsetDiff.push_back(GuestFieldOff[i] - HostFieldOff[i]);
+ }
+ return OffsetDiff;
+}
+
+// Get the size under a specific triple
+uint64_t WrapperGenerator::GetRecordSize(const Type *Type,
+ const std::string &Triple) {
+ std::string PreDecl;
+ std::string Code = TypeStringify(Type, nullptr, nullptr, PreDecl, "", "dummy;");
+ auto Size = ::GetRecordSize(PreDecl + Code, Triple);
+ return Size;
+}
+
+// Get the align under a specific triple
+CharUnits::QuantityType WrapperGenerator::GetRecordAlign(const Type *Type,
+ const std::string &Triple) {
+ std::string PreDecl{};
+ std::string Code = TypeStringify(Type, nullptr, nullptr, PreDecl, "", "dummy;");
+ return ::GetRecordAlign(PreDecl + Code, Triple);
+}
+
+// Generate the func sig by type, used for export func
+std::string WrapperGenerator::GetFuncSig(ASTContext *CTX,
+ const FuncInfo &Func) {
+ std::string sig;
+ auto Decl = Func.decl;
+ auto Type = Decl->getType().getTypePtr();
+ auto ProtoType = Type->getAs<FunctionProtoType>();
+ auto RetType = ProtoType->getReturnType();
+
+ sig += TypeToSig(CTX, RetType.getTypePtr());
+ sig += "F";
+ if (Func.has_special_arg || Func.has_special_ret || Func.has_callback_arg) {
+ sig += "E";
+ }
+ if (ProtoType->getNumParams()) {
+ for (unsigned i = 0; i < ProtoType->getNumParams(); i++) {
+ sig += TypeToSig(CTX, ProtoType->getParamType(i).getTypePtr());
+ }
+ } else {
+ sig += "v";
+ }
+ if (Decl->isVariadic()) {
+ sig += "VV";
+ }
+ return sig;
+}
+
+// Generate the func sig by type, used for callbacks
+std::string WrapperGenerator::GetFuncSig(ASTContext *CTX,
+ const Type *Type) {
+ std::string sig;
+ auto ProtoType = Type->getAs<FunctionProtoType>();
+ auto RetType = ProtoType->getReturnType();
+ sig += TypeToSig(CTX, RetType.getTypePtr());
+ sig += "F";
+ if (ProtoType->getNumParams()) {
+ for (unsigned i = 0; i < ProtoType->getNumParams(); i++) {
+ sig += TypeToSig(CTX, ProtoType->getParamType(i).getTypePtr());
+ }
+ } else {
+ sig += "v";
+ }
+ return sig;
+}
diff --git a/wrapperhelper/gen.h b/wrapperhelper/gen.h
new file mode 100644
index 0000000..55ecd20
--- /dev/null
+++ b/wrapperhelper/gen.h
@@ -0,0 +1,144 @@
+#pragma once
+#include <clang/AST/ASTContext.h>
+#include <clang/AST/Type.h>
+#include <cstdint>
+#include <string>
+#include <vector>
+#include <set>
+
+struct FuncDefinition {
+ std::vector<const clang::Type*> arg_types;
+ std::vector<std::string> arg_types_str;
+ std::vector<std::string> arg_names;
+ const clang::Type* ret;
+ std::string ret_str;
+ int arg_size;
+ bool is_variadaic;
+};
+
+struct FuncInfo {
+ const clang::Type* type;
+ clang::FunctionDecl* decl;
+ std::string func_name;
+ bool is_weak;
+ bool is_variadaic;
+ bool has_special_arg;
+ bool has_special_ret;
+ bool has_callback_arg;
+ std::vector<const clang::Type*> callback_args;
+};
+
+struct RecordInfo {
+ const clang::Type* type;
+ clang::RecordDecl* decl;
+ std::string type_name;
+ bool is_union;
+ bool is_special;
+
+ uint64_t guest_size;
+ uint64_t host_size;
+ std::vector<const clang::Type*> callback_fields;
+};
+
+struct ObjectInfo {
+ const clang::Type* type;
+ std::string object_name;
+};
+
+struct WrapperGenerator {
+
+ void Init(const std::string& libname, const std::string& host_triple, const std::string& guest_triple) {
+ this->host_triple = host_triple;
+ this->guest_triple = guest_triple;
+ this->libname = libname;
+ this->my_lib_type = libname + "_my_t";
+ this->my_lib = "my_lib";
+ }
+
+ void Prepare(clang::ASTContext* Ctx);
+
+ std::string GenCallbackTypeDefs(clang::ASTContext* Ctx);
+
+ std::string GenFuncDeclare(clang::ASTContext* Ctx) {
+ std::string res{};
+ for (const auto& func : funcs) {
+ res += GenDeclare(Ctx, func.second);
+ }
+ return res;
+ }
+ std::string GenRecordDeclare(clang::ASTContext* Ctx) {
+ std::string res{};
+ for (const auto& st : records) {
+ if (st.second.host_size == st.second.guest_size)
+ res += GenDeclare(Ctx, st.second);
+ else {
+ res += GenDeclareDiffTriple(Ctx, st.second, guest_triple, host_triple);
+ }
+ }
+ return res;
+ }
+
+ std::string GenFuncDefine(clang::ASTContext* Ctx) {
+ std::string res{};
+ for (const auto& func : funcs) {
+ res += GenDefine(Ctx, func.second);
+ }
+ return res;
+ }
+
+ std::string GenCallbackWrap(clang::ASTContext* Ctx) {
+ std::string res{};
+ for (const auto& func : funcs) {
+ res += GenCallbackWrap(Ctx, func.second);
+ }
+ for (const auto& st : records) {
+ res += GenCallbackWrap(Ctx, st.second);
+ }
+ return res;
+ }
+
+ std::string GenRecordConvert(clang::ASTContext* Ctx) {
+ (void)Ctx;
+ std::string res;
+ for (const auto& record : records) {
+ if (record.second.host_size != record.second.guest_size) {
+ res += GenRecordConvert(record.second);
+ }
+ }
+ return res;
+ }
+
+ std::map<const clang::Type*, FuncInfo> funcs;
+ std::map<const clang::Type*, RecordInfo> records;
+ std::map<const clang::Type*, ObjectInfo> objects;
+
+ std::map<const clang::Type*, std::string> callbacks;
+
+ std::string host_triple;
+ std::string guest_triple;
+ std::string libname;
+ std::string my_lib_type;
+ std::string my_lib;
+private:
+ std::string GenRecordConvert(const RecordInfo& Record);
+ std::string GenDeclare(clang::ASTContext* Ctx, const FuncInfo& Func);
+ std::string GenDefine(clang::ASTContext* Ctx, const FuncInfo& Func);
+ std::string GenCallbackWrap(clang::ASTContext* Ctx, const FuncInfo& Func);
+ std::string GenDeclareDiffTriple(clang::ASTContext* Ctx, const RecordInfo& Record, const std::string& GuestTriple, const std::string& HostTriple);
+ std::string GenDeclare(clang::ASTContext* Ctx, const RecordInfo& Struct);
+ std::string GenCallbackWrap(clang::ASTContext* Ctx, const RecordInfo& Struct);
+
+ void ParseRecordRecursive(clang::ASTContext* Ctx, const clang::Type* Type, bool& Special, std::set<const clang::Type*>& Visited);
+ std::string TypeStringify(const clang::Type* Type, clang::FieldDecl* FieldDecl, clang::ParmVarDecl* ParmDecl, std::string& PreDecl, std::string indent = "", std::string Name = "");
+ std::string SimpleTypeStringify(const clang::Type* Type, clang::FieldDecl* FieldDecl, clang::ParmVarDecl* ParmDecl, std::string indent = "", std::string Name = "");
+ std::string AnonRecordDecl(const clang::RecordType* Type, std::string& PreDecl, std::string indent);
+ std::string SimpleAnonRecordDecl(const clang::RecordType* Type, std::string indent);
+ FuncDefinition GetFuncDefinition(const clang::Type* Type);
+ FuncDefinition GetFuncDefinition(clang::FunctionDecl* Decl);
+ uint64_t GetRecordSize(const clang::Type* Type, const std::string& Triple);
+ std::vector<uint64_t> GetRecordFieldOffDiff(const clang::Type* Type, const std::string& GuestTriple, const std::string& HostTriple, std::vector<uint64_t>& GuestFieldOff, std::vector<uint64_t>& HostFieldOff);
+ clang::CharUnits::QuantityType GetRecordAlign(const clang::Type* Type, const std::string& Triple);
+
+ std::string GetFuncSig(clang::ASTContext* CTX, const FuncInfo& Decl);
+ std::string GetFuncSig(clang::ASTContext* CTX, const clang::Type* Type);
+};
diff --git a/wrapperhelper/main.cpp b/wrapperhelper/main.cpp
new file mode 100644
index 0000000..b5a18a1
--- /dev/null
+++ b/wrapperhelper/main.cpp
@@ -0,0 +1,69 @@
+#include "ast.h"
+#include "utils.h"
+
+static void dump_usage() {
+ std::string Usage = R"usage(
+ usage: command <filename> <libname> [guest_triple] [host_triple] -- <clang_flags>
+ <filename> : set the header file to be parsed
+ <libname> : set libname required for wrapping func
+ [guest_triple]: set guest triple: can be arm32/arm64/x86/x64, default is x64
+ [host_triple] : set host triple: can be arm32/arm64/x86/x64, default is arm64
+ -- : mandatory
+ <clang_flags> : extra compiler flags
+ )usage";
+ std::cerr << Usage << std::endl;
+}
+
+std::string parse_triple(const char* arg) {
+ if (strcmp(arg, "x86") == 0) {
+ return "i386-pc-linux-gnu";
+ } else if (strcmp(arg, "x64") == 0) {
+ return "x86_64-pc-linux-gnu";
+ } else if (strcmp(arg, "arm32") == 0) {
+ return "armv7-unknown-linux-gnueabihf";
+ } else if (strcmp(arg, "arm64") == 0) {
+ return "aarch64-unknown-linux-gnu";
+ } else {
+ std::cerr << "Invalid triple: '" << arg << "'\n";
+ dump_usage();
+ return "";
+ }
+}
+
+int main(int argc, const char* argv[]) {
+ if (argc < 4) {
+ dump_usage();
+ return 0;
+ }
+ std::string libname = argv[2];
+ std::string guest_triple = parse_triple("x64");
+ std::string host_triple = parse_triple("arm64");
+ if (argc >= 5) {
+ guest_triple = parse_triple(argv[3]);
+ }
+ if (argc >= 6) {
+ host_triple = parse_triple(argv[4]);
+ }
+ bool has_necessary_tag = false;
+ for (int i = 0; i < argc; i++) {
+ if (strcmp(argv[i], "--") == 0) {
+ has_necessary_tag = true;
+ break;
+ }
+ }
+ if (!has_necessary_tag) {
+ std::cerr << "Please add '--' after the triples" << std::endl;
+ dump_usage();
+ return 0;
+ }
+ std::string err;
+ auto compile_db = clang::tooling::FixedCompilationDatabase::loadFromCommandLine(argc, argv, err);
+ clang::tooling::ClangTool Tool(*compile_db, {argv[1]});
+ Tool.appendArgumentsAdjuster([&guest_triple](const clang::tooling::CommandLineArguments &args, clang::StringRef) {
+ clang::tooling::CommandLineArguments adjusted_args = args;
+ adjusted_args.push_back(std::string{"-target"});
+ adjusted_args.push_back(guest_triple);
+ return adjusted_args;
+ });
+ return Tool.run(std::make_unique<MyFrontendActionFactory>(libname, host_triple, guest_triple).get());
+}
diff --git a/wrapperhelper/utils.h b/wrapperhelper/utils.h
new file mode 100644
index 0000000..06acbb7
--- /dev/null
+++ b/wrapperhelper/utils.h
@@ -0,0 +1,33 @@
+#pragma once
+#include <clang/AST/ASTContext.h>
+#include <clang/AST/Decl.h>
+#include <clang/AST/Type.h>
+#include <clang/Tooling/Tooling.h>
+#include <clang/AST/RecordLayout.h>
+#include <clang/AST/Decl.h>
+
+#include <llvm/ADT/Triple.h>
+#include <llvm/Support/Casting.h>
+
+#include <cstddef>
+#include <cstring>
+#include <iostream>
+
+static const clang::Type* StripTypedef(clang::QualType type) {
+ if (type->isTypedefNameType()) {
+ return StripTypedef(type->getAs<clang::TypedefType>()->getDecl()->getUnderlyingType());
+ } else {
+ return type.getTypePtr();
+ }
+}
+
+// FIXME: Need to support other triple except default target triple
+static std::string GetDeclHeaderFile(clang::ASTContext& Ctx, clang::Decl* Decl) {
+ const auto& SourceManager = Ctx.getSourceManager();
+ const clang::FileID FileID = SourceManager.getFileID(Decl->getBeginLoc());
+ const clang::FileEntry *FileEntry = SourceManager.getFileEntryForID(FileID);
+ if (FileEntry) {
+ return FileEntry->getName().str();
+ }
+ return "";
+} \ No newline at end of file