├── headers └── mono │ ├── metadata │ ├── pal-ios.h │ ├── null-gc-handles.h │ ├── marshal-ilgen.h │ ├── mono-config-internals.h │ ├── sgen-mono-ilgen.h │ ├── w32file-internals.h │ ├── attach.h │ ├── mono-config-dirs.h │ ├── icalls.h │ ├── w32file-win32-internals.h │ ├── environment.h │ ├── mono-hash-internals.h │ ├── w32semaphore.h │ ├── appdomain-icalls.h │ ├── runtime.h │ ├── marshal-windows-internals.h │ ├── console-win32-internals.h │ ├── sgen-mono.h │ ├── rand.h │ ├── icall-windows-internals.h │ ├── console-io.h │ ├── method-builder-internals.h │ ├── string-icalls.h │ ├── object-forward.h │ ├── w32handle-namespace.h │ ├── property-bag.h │ ├── threadpool-io.h │ ├── security.h │ ├── w32mutex.h │ ├── sgen-toggleref.h │ ├── number-ms.h │ ├── external-only.h │ ├── mono-perfcounters.h │ ├── class-abi-details.h │ ├── threadpool-worker.h │ ├── dynamic-stream-internals.h │ ├── filewatcher.h │ ├── threadpool.h │ ├── image-internals.h │ ├── method-builder-ilgen-internals.h │ ├── mono-conc-hash.h │ ├── mono-basic-block.h │ ├── w32event.h │ ├── fdhandle.h │ ├── marshal-internals.h │ ├── callspec.h │ ├── remoting.h │ ├── mono-security-windows-internals.h │ ├── mempool.h │ ├── coree-internals.h │ ├── mono-config.h │ ├── wrapper-types.h │ ├── mono-mlist.h │ ├── debug-mono-ppdb.h │ ├── mono-endian.h │ ├── coree.h │ ├── tokentype.h │ ├── cominterop-win32-internals.h │ ├── method-builder.h │ ├── file-mmap.h │ ├── custom-attrs-internals.h │ ├── w32process-unix-internals.h │ ├── lock-tracer.h │ ├── dynamic-image-internals.h │ ├── verify.h │ ├── opcodes.h │ ├── loaded-images-internals.h │ ├── locales.h │ ├── w32process-internals.h │ └── mono-hash.h │ ├── version.txt │ ├── utils │ ├── jemalloc │ │ ├── .gitignore │ │ ├── SUBMODULES.json │ │ └── Makefile.am │ ├── mono-utils-debug.h │ ├── mono-forward.h │ ├── mono-uri.h │ ├── mono-hwcap-sparc.h │ ├── mono-stdlib.h │ ├── strenc-internals.h │ ├── mono-proclib-windows-internals.h │ ├── mono-dl-windows-internals.h │ ├── parse.h │ ├── mono-path.h │ ├── mono-once.h │ ├── mono-mmap-windows-internals.h │ ├── mono-embed.h │ ├── bsearch.h │ ├── mono-errno.h │ ├── mono-string.h │ ├── mono-forward-internal.h │ ├── ward.h │ ├── mono-rand.h │ ├── mono-mmap-internals.h │ ├── strenc.h │ ├── mono-experiments.h │ ├── memfuncs.h │ ├── mono-logger.h │ ├── mono-networkinterfaces.h │ ├── mono-jemalloc.h │ ├── mono-property-hash.h │ ├── mono-threads-debug.h │ ├── mono-poll.h │ ├── json.h │ ├── mono-io-portability.h │ ├── os-event.h │ ├── mono-conc-hashtable.h │ ├── mono-dl-fallback.h │ ├── mono-coop-semaphore.h │ ├── mach-support.h │ ├── mono-utility-thread.h │ ├── gc_wrapper.h │ ├── lock-free-array-queue.h │ ├── mono-experiments.def │ ├── w32api.h │ ├── mono-os-wait.h │ ├── mono-merp.h │ ├── mono-time.h │ ├── mono-machine.h │ ├── mono-value-hash.h │ ├── mono-dl.h │ ├── mono-codeman.h │ ├── mono-complex.h │ └── mono-hwcap.h │ ├── signal.h │ ├── dis │ ├── dis-cil.h │ ├── meta.h │ ├── util.h │ ├── declsec.h │ └── dump.h │ ├── config.h │ ├── eglib-config.h │ ├── eglib │ ├── gmodule-win32-internals.h │ └── gmodule.h │ ├── vita.h │ ├── native │ ├── pal_config.h │ ├── pal-android.h │ ├── pal-icalls.h │ └── mono-native-platform.h │ ├── profiler │ ├── helper.h │ └── aot.h │ ├── zlib │ └── inffast.h │ ├── mini │ ├── lldb.h │ ├── llvm-runtime.h │ ├── trace.h │ ├── THIRD-PARTY-NOTICES.TXT │ ├── mini-windows.h │ ├── tasklets.h │ ├── mini-gc.h │ ├── tiered.h │ ├── mini-arch.h │ ├── seq-points.h │ ├── interp │ │ └── interp.h │ ├── regalloc.h │ ├── dwarfwriter.h │ ├── llvm-jit.h │ ├── mini-amd64-gsharedvt.h │ ├── cfgdump.h │ ├── aot-compiler.h │ ├── debugger-agent.h │ ├── debugger-state-machine.h │ ├── mini-llvm.h │ └── optflags-def.h │ ├── sgen │ ├── sgen-major-copy-object.h │ ├── sgen-pointer-queue.h │ ├── sgen-tagged-pointer.h │ ├── sgen-archdep.h │ └── sgen-layout-stats.h │ └── btls │ ├── btls-key.h │ ├── btls-error.h │ ├── btls-x509-revoked.h │ ├── btls-x509-lookup-mono.h │ ├── btls-x509-chain.h │ ├── btls-pkcs12.h │ ├── btls-x509-store.h │ ├── btls-x509-crl.h │ ├── btls-bio.h │ ├── btls-util.h │ └── btls-x509-lookup.h ├── VMLVita2D ├── VMLVita2D.h ├── VMLVita2D.vcxproj.user ├── VMLVita2D.vcxproj.filters ├── main.c └── Vita2D.cs ├── VitaMonoLoader ├── VMLCoreAssemblies.h ├── VitaMonoLoader.vcxproj.user ├── VML.h └── VitaMonoLoader.vcxproj.filters ├── VML_Sample1 ├── VML_Sample1.vcxproj.user ├── Sample1.cs └── VML_Sample1.vcxproj.filters ├── VML_Sample2 ├── VML_Sample2.vcxproj.user ├── Sample2.cs └── VML_Sample2.vcxproj.filters ├── vitasdk_compat └── VitaMonoLoader.yml ├── .gitignore └── README.md /headers/mono/metadata/pal-ios.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /headers/mono/version.txt: -------------------------------------------------------------------------------- 1 | 6.12.0.181 -------------------------------------------------------------------------------- /headers/mono/utils/jemalloc/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | /jemalloc 4 | -------------------------------------------------------------------------------- /headers/mono/signal.h: -------------------------------------------------------------------------------- 1 | #ifndef __MONO_FAKE_SIGNAL_H__ 2 | #define __MONO_FAKE_SIGNAL_H__ 3 | 4 | #endif -------------------------------------------------------------------------------- /VMLVita2D/VMLVita2D.h: -------------------------------------------------------------------------------- 1 | #ifndef _VML_VITA2D_H_ 2 | #define _VML_VITA2D_H_ 3 | 4 | void VMLVita2DRegister(); 5 | 6 | #endif -------------------------------------------------------------------------------- /headers/mono/dis/dis-cil.h: -------------------------------------------------------------------------------- 1 | void disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContainer *container); 2 | -------------------------------------------------------------------------------- /VitaMonoLoader/VMLCoreAssemblies.h: -------------------------------------------------------------------------------- 1 | #ifndef _VML_CORE_ASSEMBLIES_H_ 2 | #define _VML_CORE_ASSEMBLIES_H_ 3 | 4 | void VMLCoreAssembliesRegister(); 5 | 6 | #endif -------------------------------------------------------------------------------- /VMLVita2D/VMLVita2D.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /VML_Sample1/VML_Sample1.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /VML_Sample2/VML_Sample2.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /VML_Sample1/Sample1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | 4 | public class Program 5 | { 6 | public static int Main() 7 | { 8 | return 123; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /VitaMonoLoader/VitaMonoLoader.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /headers/mono/metadata/null-gc-handles.h: -------------------------------------------------------------------------------- 1 | #ifndef __METADATA_NULL_GC_HANDLES_H__ 2 | #define __METADATA_NULL_GC_HANDLES_H__ 3 | 4 | void 5 | null_gc_handles_init (void); 6 | 7 | #endif /* __METADATA_NULL_GC_HANDLES_H__ */ 8 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-utils-debug.h: -------------------------------------------------------------------------------- 1 | /* mono-utils-debug.h 2 | * 3 | * Copyright 2018 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | 7 | gboolean 8 | mono_is_usermode_native_debugger_present (void); 9 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-forward.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * (C) 2018 Microsoft, Inc. 5 | * 6 | */ 7 | #ifndef _MONO_UTILS_FORWARD_ 8 | #define _MONO_UTILS_FORWARD_ 9 | 10 | typedef struct _MonoDomain MonoDomain; 11 | typedef struct _MonoJitInfo MonoJitInfo; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-uri.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_URI_H 6 | #define __MONO_URI_H 7 | #include 8 | #include 9 | 10 | MONO_API gchar * mono_escape_uri_string (const gchar *string); 11 | 12 | #endif /* __MONO_URI_H */ 13 | 14 | -------------------------------------------------------------------------------- /headers/mono/config.h: -------------------------------------------------------------------------------- 1 | #ifndef __MONO_CONFIG_H__ 2 | #define __MONO_CONFIG_H__ 3 | 4 | #define TARGET_ARM 5 | #define ARM_FPU_VFP_HARD 6 | 7 | #define HANDLE SceUID 8 | #define BOOL int 9 | #define SEMAPHORE_ALL_ACCESS 0 10 | 11 | #define pid_t SceUID 12 | #define siginfo_t int 13 | 14 | #endif -------------------------------------------------------------------------------- /headers/mono/utils/mono-hwcap-sparc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_UTILS_HWCAP_SPARC_H__ 6 | #define __MONO_UTILS_HWCAP_SPARC_H__ 7 | 8 | #include "mono/utils/mono-hwcap.h" 9 | 10 | extern gboolean mono_hwcap_sparc_is_v9; 11 | 12 | #endif /* __MONO_UTILS_HWCAP_SPARC_H__ */ 13 | -------------------------------------------------------------------------------- /vitasdk_compat/VitaMonoLoader.yml: -------------------------------------------------------------------------------- 1 | modules: 2 | VitaMonoLoader: 3 | nid: 0 4 | libraries: 5 | VitaMonoLoader: 6 | nid: 0x8A67DAA7 7 | functions: 8 | VMLInitialize: 0x238EA12F 9 | VMLRegisterAssembly: 0x5AEA7231 10 | VMLRunMain: 0x7A91557D 11 | -------------------------------------------------------------------------------- /headers/mono/dis/meta.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | -------------------------------------------------------------------------------- /headers/mono/eglib-config.h: -------------------------------------------------------------------------------- 1 | #ifndef __MONO_EGLIB_CONFIG_H__ 2 | #define __MONO_EGLIB_CONFIG_H__ 3 | 4 | #include 5 | 6 | #define G_GNUC_NORETURN 7 | #define G_GNUC_UNUSED 8 | typedef size_t gsize; 9 | typedef int32_t gssize; 10 | typedef int32_t GPid; 11 | typedef int32_t clockid_t; 12 | 13 | #endif -------------------------------------------------------------------------------- /headers/mono/utils/mono-stdlib.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_FILE_H 6 | #define __MONO_FILE_H 7 | 8 | #ifdef HAVE_MKSTEMP 9 | #include 10 | #define mono_mkstemp(a) mkstemp(a) 11 | #else 12 | int mono_mkstemp (char *templ); 13 | #endif 14 | 15 | #endif /* __MONO_FILE_H */ 16 | 17 | -------------------------------------------------------------------------------- /headers/mono/utils/strenc-internals.h: -------------------------------------------------------------------------------- 1 | #ifndef _MONO_STRENC_INTERNALS_H_ 2 | #define _MONO_STRENC_INTERNALS_H_ 3 | 4 | #include 5 | #include 6 | 7 | gchar *mono_unicode_to_external_checked (const gunichar2 *uni, MonoError *err); 8 | 9 | #endif /* _MONO_STRENC_INTERNALS_H_ */ 10 | -------------------------------------------------------------------------------- /headers/mono/utils/jemalloc/SUBMODULES.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "jemalloc", 4 | "url": "https://github.com/mono/jemalloc.git", 5 | "rev": "896ed3a8b3f41998d4fb4d625d30ac63ef2d51fb", 6 | "remote-branch": "origin/master", 7 | "branch": "master", 8 | "directory": "jemalloc" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /headers/mono/metadata/marshal-ilgen.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2018 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_MARSHAL_ILGEN_H__ 7 | #define __MONO_MARSHAL_ILGEN_H__ 8 | 9 | MONO_API void 10 | mono_marshal_ilgen_init (void); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /headers/mono/dis/util.h: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | int code; 3 | const char *str; 4 | } dis_map_t; 5 | 6 | const char *map (guint32 code, dis_map_t *table); 7 | const char *flags (guint32 code, dis_map_t *table); 8 | void hex_dump (const char *buffer, int base, int count); 9 | char* data_dump (const char *data, int len, const char* prefix); 10 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-config-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_METADATA_CONFIG_INTERNALS_H__ 6 | #define __MONO_METADATA_CONFIG_INTERNALS_H__ 7 | 8 | #include "mono/metadata/mono-config.h" 9 | 10 | void 11 | mono_config_for_assembly_internal (MonoImage *assembly); 12 | 13 | #endif /* __MONO_METADATA_CONFIG_INTERNALS_H__ */ 14 | -------------------------------------------------------------------------------- /headers/mono/eglib/gmodule-win32-internals.h: -------------------------------------------------------------------------------- 1 | #ifndef __G_MODULE_WINDOWS_INTERNALS_H__ 2 | #define __G_MODULE_WINDOWS_INTERNALS_H__ 3 | 4 | #include 5 | #include 6 | 7 | #ifdef G_OS_WIN32 8 | #include 9 | 10 | gpointer 11 | w32_find_symbol (const gchar *symbol_name); 12 | #endif /* G_OS_WIN32 */ 13 | #endif /* __G_MODULE_WINDOWS_INTERNALS_H__ */ 14 | -------------------------------------------------------------------------------- /headers/mono/metadata/sgen-mono-ilgen.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2018 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_SGEN_MONO_ILGEN_H__ 7 | #define __MONO_SGEN_MONO_ILGEN_H__ 8 | 9 | #include "config.h" 10 | 11 | MONO_API void 12 | mono_sgen_mono_ilgen_init (void); 13 | #endif 14 | -------------------------------------------------------------------------------- /headers/mono/vita.h: -------------------------------------------------------------------------------- 1 | #ifndef __MONO_VITA_H__ 2 | #define __MONO_VITA_H__ 3 | 4 | typedef struct MonoMainThreadParam { 5 | char *name; 6 | void *entry; 7 | unsigned int stackSize; 8 | unsigned int cpuAffinity; 9 | unsigned int priority; 10 | } MonoMainThreadParam; 11 | 12 | void MonoCreateMainThread(MonoMainThreadParam *param); 13 | 14 | void mono_thread_pool_cleanup(); 15 | 16 | #endif -------------------------------------------------------------------------------- /headers/mono/metadata/w32file-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef _MONO_METADATA_W32FILE_INTERNALS_H_ 7 | #define _MONO_METADATA_W32FILE_INTERNALS_H_ 8 | 9 | #include 10 | #include 11 | 12 | #endif /* _MONO_METADATA_W32FILE_INTERNALS_H_ */ 13 | -------------------------------------------------------------------------------- /headers/mono/native/pal_config.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define MONO 1 4 | /* clock_gettime () is found by configure on Apple builds, but its only present from ios 10, macos 10.12, tvos 10 and watchos 3 */ 5 | #if defined (TARGET_WASM) || defined (TARGET_IOS) || defined (TARGET_OSX) || defined (TARGET_WATCHOS) || defined (TARGET_TVOS) 6 | #undef HAVE_CLOCK_MONOTONIC 7 | #undef HAVE_CLOCK_MONOTONIC_COARSE 8 | #endif 9 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-proclib-windows-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_UTILS_PROCLIB_WINDOWS_H__ 6 | #define __MONO_UTILS_PROCLIB_WINDOWS_H__ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef HOST_WIN32 12 | #include 13 | #include "mono/utils/mono-proclib.h" 14 | 15 | #endif /* HOST_WIN32 */ 16 | #endif /* __MONO_UTILS_PROCLIB_WINDOWS_H__ */ 17 | 18 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-dl-windows-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_UTILS_DL_WINDOWS_H__ 6 | #define __MONO_UTILS_DL_WINDOWS_H__ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef HOST_WIN32 12 | #include "mono/utils/mono-dl.h" 13 | 14 | void* 15 | mono_dl_lookup_symbol_in_process (const char *symbol_name); 16 | #endif /* HOST_WIN32 */ 17 | #endif /* __MONO_UTILS_DL_WINDOWS_H__ */ 18 | 19 | -------------------------------------------------------------------------------- /headers/mono/utils/parse.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Parsing for GC options. 4 | * 5 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 6 | */ 7 | 8 | #ifndef __MONO_UTILS_PARSE_H__ 9 | #define __MONO_UTILS_PARSE_H__ 10 | 11 | #include 12 | #include 13 | 14 | gboolean mono_gc_parse_environment_string_extract_number (const char *str, size_t *out); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-path.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_PATH_H 6 | #define __MONO_PATH_H 7 | 8 | #include 9 | #include 10 | 11 | MONO_API gchar *mono_path_resolve_symlinks (const char *path); 12 | MONO_API gchar *mono_path_canonicalize (const char *path); 13 | gboolean mono_path_filename_in_basedir (const char *filename, const char *basedir); 14 | 15 | #endif /* __MONO_PATH_H */ 16 | 17 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-once.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_ONCE_H__ 6 | #define __MONO_ONCE_H__ 7 | 8 | #include "mono-lazy-init.h" 9 | 10 | typedef mono_lazy_init_t mono_once_t; 11 | 12 | #define MONO_ONCE_INIT MONO_LAZY_INIT_STATUS_NOT_INITIALIZED 13 | 14 | static inline void 15 | mono_once (mono_once_t *once, void (*once_init) (void)) 16 | { 17 | mono_lazy_initialize (once, once_init); 18 | } 19 | 20 | #endif /* __MONO_ONCE_H__ */ 21 | -------------------------------------------------------------------------------- /headers/mono/metadata/attach.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_ATTACH_H__ 6 | #define __MONO_ATTACH_H__ 7 | 8 | #include 9 | #include 10 | 11 | void 12 | mono_attach_parse_options (char *options); 13 | 14 | void 15 | mono_attach_init (void); 16 | 17 | gboolean 18 | mono_attach_start (void); 19 | 20 | void 21 | mono_attach_maybe_start (void); 22 | 23 | void 24 | mono_attach_cleanup (void); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-config-dirs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_CONFIG_INTERNAL_H__ 6 | #define __MONO_CONFIG_INTERNAL_H__ 7 | 8 | #include 9 | #include 10 | 11 | const char* 12 | mono_config_get_assemblies_dir (void); 13 | 14 | const char* 15 | mono_config_get_cfg_dir (void); 16 | 17 | const char* 18 | mono_config_get_bin_dir (void); 19 | 20 | const char* 21 | mono_config_get_reloc_lib_dir (void); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-mmap-windows-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_UTILS_MMAP_WINDOWS_H__ 6 | #define __MONO_UTILS_MMAP_WINDOWS_H__ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef HOST_WIN32 12 | #include "mono/utils/mono-mmap.h" 13 | #include "mono/utils/mono-mmap-internals.h" 14 | 15 | int 16 | mono_mmap_win_prot_from_flags (int flags); 17 | #endif /* HOST_WIN32 */ 18 | #endif /* __MONO_UTILS_MMAP_WINDOWS_H__ */ 19 | 20 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-embed.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_EMBED_H__ 6 | #define __MONO_EMBED_H__ 7 | 8 | #include 9 | 10 | /* 11 | * This is a fallback for platform symbol loading functionality. 12 | */ 13 | typedef struct { 14 | const char *name; 15 | void *addr; 16 | } MonoDlMapping; 17 | 18 | MONO_API void mono_dl_register_library (const char *name, MonoDlMapping *mappings); 19 | 20 | #endif /* __MONO_EMBED_H__ */ 21 | -------------------------------------------------------------------------------- /headers/mono/profiler/helper.h: -------------------------------------------------------------------------------- 1 | #ifndef __MONO_PROFHELPER_H__ 2 | #define __MONO_PROFHELPER_H__ 3 | 4 | #ifndef HOST_WIN32 5 | #include 6 | #endif 7 | #ifdef HOST_WIN32 8 | #include 9 | #endif 10 | 11 | void mono_profhelper_add_to_fd_set (fd_set *set, int fd, int *max_fd); 12 | void mono_profhelper_close_socket_fd (int fd); 13 | void mono_profhelper_setup_command_server (int *server_socket, int *command_port, const char* profiler_name); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /headers/mono/utils/bsearch.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_BSEARCH_H__ 6 | #define __MONO_BSEARCH_H__ 7 | 8 | #include 9 | 10 | #include "mono/utils/mono-compiler.h" 11 | 12 | typedef int (* BinarySearchComparer) (const void *key, const void *member); 13 | 14 | void * 15 | mono_binary_search ( 16 | const void *key, 17 | const void *array, 18 | size_t array_length, 19 | size_t member_size, 20 | BinarySearchComparer comparer); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-errno.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Access the native error code 4 | * 5 | * Author: 6 | * Alexander Kyte (alkyte@microsoft.com) 7 | * 8 | * (C) 2018 Microsoft, Inc. 9 | * 10 | */ 11 | 12 | #ifndef __MONO_ERRNO_H__ 13 | #define __MONO_ERRNO_H__ 14 | 15 | #include 16 | 17 | // Enough indirection to do something else here, or log 18 | inline static void 19 | mono_set_errno (int errno_val) 20 | { 21 | errno = errno_val; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-string.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __UTILS_MONO_STRING_H__ 6 | #define __UTILS_MONO_STRING_H__ 7 | #include 8 | /* 9 | * This definition is used to we remember later to implement this properly 10 | * 11 | * Currently we merely call into the ascii comparison, but we should be 12 | * instead doing case folding and comparing the result. 13 | */ 14 | #define mono_utf8_strcasecmp g_ascii_strcasecmp 15 | 16 | #endif /* __UTILS_MONO_STRING_H__ */ 17 | -------------------------------------------------------------------------------- /headers/mono/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /headers/mono/metadata/icalls.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_METADATA_ICALLS_H__ 6 | #define __MONO_METADATA_ICALLS_H__ 7 | 8 | #include 9 | 10 | #ifdef ENABLE_ICALL_EXPORT 11 | #define ICALL_EXPORT MONO_API 12 | #define ICALL_EXTERN_C G_EXTERN_C 13 | #else 14 | /* Can't be static as icall.c defines icalls referenced by icall-tables.c */ 15 | #define ICALL_EXPORT /* nothing */ 16 | #define ICALL_EXTERN_C /* nothing */ 17 | #endif 18 | 19 | #endif // __MONO_METADATA_ICALLS_H__ 20 | -------------------------------------------------------------------------------- /headers/mono/metadata/w32file-win32-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef _MONO_METADATA_W32FILE_WIN32_INTERNALS_H_ 7 | #define _MONO_METADATA_W32FILE_WIN32_INTERNALS_H_ 8 | 9 | #include 10 | #include 11 | 12 | #ifdef HOST_WIN32 13 | #include "mono/metadata/w32file.h" 14 | #include "mono/metadata/w32file-internals.h" 15 | #endif /* HOST_WIN32 */ 16 | #endif /* _MONO_METADATA_W32FILE_WIN32_INTERNALS_H_ */ 17 | -------------------------------------------------------------------------------- /headers/mono/metadata/environment.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * System.Environment support internal calls 4 | * 5 | * Author: 6 | * Dick Porter (dick@ximian.com) 7 | * 8 | * (C) 2002 Ximian, Inc 9 | */ 10 | 11 | #ifndef _MONO_METADATA_ENVIRONMENT_H_ 12 | #define _MONO_METADATA_ENVIRONMENT_H_ 13 | 14 | #include 15 | 16 | MONO_BEGIN_DECLS 17 | 18 | MONO_API int32_t mono_environment_exitcode_get (void); 19 | MONO_API void mono_environment_exitcode_set (int32_t value); 20 | 21 | MONO_END_DECLS 22 | 23 | #endif /* _MONO_METADATA_ENVIRONMENT_H_ */ 24 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-hash-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_G_HASH_INTERNALS_H__ 6 | #define __MONO_G_HASH_INTERNALS_H__ 7 | 8 | #include "mono/metadata/mono-hash.h" 9 | #include "mono/metadata/mono-gc.h" 10 | 11 | MonoGHashTable * 12 | mono_g_hash_table_new_type_internal (GHashFunc hash_func, GEqualFunc key_equal_func, MonoGHashGCType type, MonoGCRootSource source, void *key, const char *msg); 13 | 14 | void 15 | mono_g_hash_table_insert_internal (MonoGHashTable *h, gpointer k, gpointer v); 16 | 17 | #endif /* __MONO_G_HASH_INTERNALS_H__ */ 18 | -------------------------------------------------------------------------------- /headers/mono/metadata/w32semaphore.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_W32SEMAPHORE_H_ 6 | #define _MONO_METADATA_W32SEMAPHORE_H_ 7 | 8 | #include 9 | #include 10 | #include "object.h" 11 | #include "w32handle-namespace.h" 12 | #include 13 | 14 | void 15 | mono_w32semaphore_init (void); 16 | 17 | typedef struct MonoW32HandleNamedSemaphore MonoW32HandleNamedSemaphore; 18 | 19 | MonoW32HandleNamespace* 20 | mono_w32semaphore_get_namespace (MonoW32HandleNamedSemaphore *semaphore); 21 | 22 | #endif /* _MONO_METADATA_W32SEMAPHORE_H_ */ 23 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-forward-internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * (C) 2018 Microsoft, Inc. 5 | * 6 | */ 7 | #ifndef _MONO_UTILS_FORWARD_INTERNAL_ 8 | #define _MONO_UTILS_FORWARD_INTERNAL_ 9 | 10 | #include "mono-forward.h" 11 | 12 | typedef struct MonoAotModule MonoAotModule; 13 | typedef struct MonoHandleStack MonoHandleStack; 14 | typedef struct MonoJitTlsData MonoJitTlsData; 15 | typedef struct MonoLMF MonoLMF; 16 | typedef struct MonoTrampInfo MonoTrampInfo; 17 | typedef struct _MonoInternalThread MonoInternalThread; 18 | typedef struct _SgenThreadInfo SgenThreadInfo; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /headers/mono/metadata/appdomain-icalls.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Appdomain-related icalls. 4 | * Copyright 2016 Microsoft 5 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 6 | */ 7 | 8 | #ifndef __MONO_METADATA_APPDOMAIN_ICALLS_H__ 9 | #define __MONO_METADATA_APPDOMAIN_ICALLS_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "reflection-internals.h" 16 | 17 | #endif /*__MONO_METADATA_APPDOMAIN_ICALLS_H__*/ 18 | -------------------------------------------------------------------------------- /headers/mono/metadata/runtime.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Runtime functions 4 | * 5 | * Author: 6 | * Jonathan Pryor 7 | * 8 | * (C) 2010 Novell, Inc. 9 | */ 10 | 11 | #ifndef _MONO_METADATA_RUNTIME_H_ 12 | #define _MONO_METADATA_RUNTIME_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | gboolean mono_runtime_try_shutdown (void); 20 | 21 | void mono_runtime_init_tls (void); 22 | 23 | MONO_PROFILER_API char* mono_runtime_get_aotid (void); 24 | 25 | #endif /* _MONO_METADATA_RUNTIME_H_ */ 26 | 27 | 28 | -------------------------------------------------------------------------------- /headers/mono/utils/ward.h: -------------------------------------------------------------------------------- 1 | #ifndef WARD_H 2 | #define WARD_H 3 | 4 | /* 5 | * Ward is a static analysis tool that can be used to check for the presense of 6 | * a certain class of bugs in C code. 7 | * 8 | * See https://github.com/evincarofautumn/Ward#annotating-your-code for the Ward 9 | * permission annotations syntax. 10 | * 11 | * The Mono permissions are defined in 12 | * https://github.com/evincarofautumn/Ward/blob/prod/mono.config 13 | */ 14 | #if defined(__WARD__) 15 | #define MONO_PERMIT(...) __attribute__ ((ward (__VA_ARGS__))) 16 | #else 17 | #define MONO_PERMIT(...) /*empty*/ 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /headers/mono/metadata/marshal-windows-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METADATA_MARSHAL_WINDOWS_INTERNALS_H__ 7 | #define __MONO_METADATA_MARSHAL_WINDOWS_INTERNALS_H__ 8 | 9 | #include 10 | #include 11 | 12 | #ifdef HOST_WIN32 13 | #include "mono/metadata/marshal.h" 14 | #include "mono/metadata/marshal-internals.h" 15 | #include "mono/metadata/exception.h" 16 | #endif /* HOST_WIN32 */ 17 | 18 | #endif /* __MONO_METADATA_MARSHAL_WINDOWS_INTERNALS_H__ */ 19 | -------------------------------------------------------------------------------- /headers/mono/metadata/console-win32-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_CONSOLE_WIN32_INTERNALS_H__ 7 | #define __MONO_CONSOLE_WIN32_INTERNALS_H__ 8 | 9 | #include 10 | #include 11 | 12 | #include "mono/metadata/object.h" 13 | #include "mono/metadata/object-internals.h" 14 | #include "mono/utils/mono-error.h" 15 | #include "mono/utils/mono-error-internals.h" 16 | #include 17 | 18 | #endif /* __MONO_CONSOLE_WIN32_INTERNALS_H__ */ 19 | 20 | -------------------------------------------------------------------------------- /headers/mono/mini/lldb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_XDEBUG_LLDB_H__ 6 | #define __MONO_XDEBUG_LLDB_H__ 7 | 8 | #include "config.h" 9 | #include "mini.h" 10 | 11 | void mono_lldb_init (const char *options); 12 | 13 | void mono_lldb_save_method_info (MonoCompile *cfg); 14 | 15 | void mono_lldb_save_trampoline_info (MonoTrampInfo *info); 16 | 17 | void mono_lldb_remove_method (MonoDomain *domain, MonoMethod *method, MonoJitDynamicMethodInfo *info); 18 | 19 | void mono_lldb_save_specific_trampoline_info (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, gpointer code, guint32 code_len); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /headers/mono/mini/llvm-runtime.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Runtime support for llvm generated code 4 | * 5 | * Authors: 6 | * Zoltan Varga (vargaz@gmail.com) 7 | * 8 | * (C) 2015 Xamarin, Inc. 9 | */ 10 | 11 | #ifndef __MONO_LLVM_RUNTIME_H__ 12 | #define __MONO_LLVM_RUNTIME_H__ 13 | 14 | #include 15 | 16 | G_BEGIN_DECLS 17 | 18 | typedef void (*MonoLLVMInvokeCallback) (void *arg); 19 | 20 | void 21 | mono_llvm_cpp_throw_exception (void); 22 | 23 | void 24 | mono_llvm_cpp_catch_exception (MonoLLVMInvokeCallback cb, gpointer arg, gboolean *out_thrown); 25 | 26 | G_END_DECLS 27 | 28 | #endif /* __MONO_LLVM_RUNTIME_H__ */ 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /headers/mono/mini/trace.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_TRACE_H__ 6 | #define __MONO_TRACE_H__ 7 | #include 8 | #include "mono/utils/mono-compiler.h" 9 | #include "mono/metadata/icalls.h" 10 | 11 | ICALL_EXTERN_C 12 | void 13 | mono_trace_enter_method (MonoMethod *method, MonoJitInfo *ji, MonoProfilerCallContext *ctx); 14 | 15 | ICALL_EXTERN_C 16 | void 17 | mono_trace_leave_method (MonoMethod *method, MonoJitInfo *ji, MonoProfilerCallContext *ctx); 18 | 19 | void mono_trace_enable (gboolean enable); 20 | gboolean mono_trace_is_enabled (void); 21 | gboolean mono_trace_eval_exception (MonoClass *klass); 22 | 23 | #endif /* __MONO_TRACE_H__ */ 24 | -------------------------------------------------------------------------------- /headers/mono/metadata/sgen-mono.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2018 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_SGEN_MONO_H__ 7 | #define __MONO_SGEN_MONO_H__ 8 | 9 | #define MONO_SGEN_MONO_CALLBACKS_VERSION 1 10 | 11 | typedef struct { 12 | int version; 13 | void (*emit_nursery_check) (MonoMethodBuilder *mb, gboolean is_concurrent); 14 | void (*emit_managed_allocator) (MonoMethodBuilder *mb, gboolean slowpath, gboolean profiler, int atype); 15 | } MonoSgenMonoCallbacks; 16 | 17 | void 18 | mono_install_sgen_mono_callbacks (MonoSgenMonoCallbacks *cb); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /headers/mono/metadata/rand.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * System.Security.Cryptography.RNGCryptoServiceProvider support 4 | * 5 | * Author: 6 | * Mark Crichton (crichton@gimp.org) 7 | * Sebastien Pouliot (sebastien@ximian.com) 8 | * 9 | * (C) 2001 Ximian, Inc. 10 | * Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) 11 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 12 | */ 13 | 14 | #ifndef _MONO_METADATA_RAND_H_ 15 | #define _MONO_METADATA_RAND_H_ 16 | 17 | #include 18 | #include 19 | #include "mono/utils/mono-compiler.h" 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-rand.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_UTILS_RAND_H_ 6 | #define _MONO_UTILS_RAND_H_ 7 | 8 | #include 9 | 10 | #include "mono-compiler.h" 11 | #include "mono-error.h" 12 | 13 | gboolean 14 | mono_rand_open (void); 15 | 16 | gpointer 17 | mono_rand_init (const guchar *seed, gssize seed_size); 18 | 19 | gboolean 20 | mono_rand_try_get_bytes (gpointer *handle, guchar *buffer, gssize buffer_size, MonoError *error); 21 | 22 | gboolean 23 | mono_rand_try_get_uint32 (gpointer *handle, guint32 *val, guint32 min, guint32 max, MonoError *error); 24 | 25 | void 26 | mono_rand_close (gpointer handle); 27 | 28 | #endif /* _MONO_UTILS_RAND_H_ */ 29 | -------------------------------------------------------------------------------- /headers/mono/metadata/icall-windows-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METADATA_ICALL_WINDOWS_INTERNALS_H__ 7 | #define __MONO_METADATA_ICALL_WINDOWS_INTERNALS_H__ 8 | 9 | #include 10 | #include 11 | 12 | #ifdef HOST_WIN32 13 | #include "mono/metadata/icall-internals.h" 14 | #include "mono/metadata/object.h" 15 | #include "mono/metadata/object-internals.h" 16 | #include "mono/metadata/class.h" 17 | #include "mono/metadata/class-internals.h" 18 | #endif /* HOST_WIN32 */ 19 | #endif /* __MONO_METADATA_ICALL_WINDOWS_INTERNALS_H__ */ 20 | -------------------------------------------------------------------------------- /VitaMonoLoader/VML.h: -------------------------------------------------------------------------------- 1 | #ifndef _VML_H_ 2 | #define _VML_H_ 3 | 4 | #include 5 | 6 | #ifdef VML_BUILD 7 | #define VML_EXPORT __declspec(dllexport) 8 | #else 9 | #define VML_EXPORT 10 | #endif 11 | 12 | 13 | typedef void(*VMLRootDomainEntry)(); 14 | 15 | typedef struct VMLInitOptParam { 16 | unsigned int stackSize; 17 | unsigned int cpuAffinity; 18 | unsigned int priority; 19 | bool monoVerboseDebug; 20 | } VMLInitOptParam; 21 | 22 | VML_EXPORT int VMLInitialize(VMLRootDomainEntry domainEntry, VMLInitOptParam *pOptParam); 23 | 24 | VML_EXPORT int VMLRunMain(const char *sMainDllPath, void **ppMainAotAssemblyInfo); 25 | 26 | VML_EXPORT int VMLRegisterAssembly(void **ppAotAssemblyInfo); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /headers/mono/metadata/console-io.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Console IO internal calls 4 | * 5 | * Author: 6 | * Gonzalo Paniagua Javier (gonzalo@ximian.com) 7 | * 8 | * Copyright (c) 2005 Novell, Inc. (http://www.novell.com) 9 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 10 | */ 11 | 12 | #ifndef _MONO_METADATA_CONSOLEIO_H 13 | #define _MONO_METADATA_CONSOLEIO_H 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | void mono_console_init (void); 23 | void mono_console_handle_async_ops (void); 24 | 25 | #endif /* _MONO_METADATA_CONSOLEIO_H */ 26 | -------------------------------------------------------------------------------- /headers/mono/metadata/method-builder-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2018 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METHOD_BUILDER_INTERNALS_H__ 7 | #define __MONO_METHOD_BUILDER_INTERNALS_H__ 8 | 9 | #include "config.h" 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | /* noilgen version */ 18 | struct _MonoMethodBuilder { 19 | MonoMethod *method; 20 | gchar *name; 21 | gboolean no_dup_name; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /headers/mono/metadata/string-icalls.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_CLI_STRING_ICALLS_H_ 6 | #define _MONO_CLI_STRING_ICALLS_H_ 7 | 8 | /* 9 | * string-icalls.h: String internal calls for the corlib 10 | * 11 | * Author: 12 | * Patrik Torstensson (patrik.torstensson@labs2.com) 13 | * 14 | * (C) 2001 Ximian, Inc. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include "mono/utils/mono-compiler.h" 21 | #include 22 | 23 | ICALL_EXPORT 24 | void 25 | ves_icall_System_String_ctor_RedirectToCreateString (void); 26 | 27 | ICALL_EXPORT 28 | int 29 | ves_icall_System_String_GetLOSLimit (void); 30 | 31 | #endif /* _MONO_CLI_STRING_ICALLS_H_ */ 32 | -------------------------------------------------------------------------------- /VML_Sample2/Sample2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | 4 | public class Program 5 | { 6 | public static int Main() 7 | { 8 | Vita2D.Init(); 9 | Vita2D.SetClearColor(Vita2D.RGBA8(150, 150, 150, 255)); 10 | int pgf = Vita2D.LoadDefaultPGF(); 11 | 12 | while (true) 13 | { 14 | Vita2D.StartDrawing(); 15 | Vita2D.ClearScreen(); 16 | 17 | Vita2D.DrawRectangle(680, 350, 100, 150, Vita2D.RGBA8(0, 0, 255, 255)); 18 | Vita2D.PGFDrawText(pgf, 480, 272, Vita2D.RGBA8(0, 255, 0, 255), 1, "Hello from C# Vita2D!"); 19 | 20 | Vita2D.EndDrawing(); 21 | Vita2D.SwapBuffers(); 22 | } 23 | 24 | return 123; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /headers/mono/metadata/object-forward.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Forward declarations of opaque types, and typedefs thereof. 5 | * 6 | */ 7 | 8 | #ifndef __MONO_OBJECT_FORWARD_H__ 9 | #define __MONO_OBJECT_FORWARD_H__ 10 | 11 | #include 12 | 13 | typedef struct _MonoClass MonoClass; 14 | typedef struct _MonoImage MonoImage; 15 | typedef struct _MonoMethod MonoMethod; 16 | 17 | typedef struct _MonoObject MONO_RT_MANAGED_ATTR MonoObject; 18 | typedef struct _MonoException MONO_RT_MANAGED_ATTR MonoException; 19 | typedef struct _MonoReflectionAssembly MONO_RT_MANAGED_ATTR MonoReflectionAssembly; 20 | typedef struct _MonoReflectionTypeBuilder MONO_RT_MANAGED_ATTR MonoReflectionTypeBuilder; 21 | 22 | #endif /* __MONO_OBJECT_FORWARD_H__ */ 23 | -------------------------------------------------------------------------------- /headers/mono/metadata/w32handle-namespace.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_W32HANDLE_NAMESPACE_H_ 6 | #define _MONO_METADATA_W32HANDLE_NAMESPACE_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include "mono/metadata/w32handle.h" 12 | 13 | #define MONO_W32HANDLE_NAMESPACE_MAX_PATH 260 14 | 15 | typedef struct { 16 | gchar name [MONO_W32HANDLE_NAMESPACE_MAX_PATH + 1]; 17 | } MonoW32HandleNamespace; 18 | 19 | void 20 | mono_w32handle_namespace_init (void); 21 | 22 | void 23 | mono_w32handle_namespace_lock (void); 24 | 25 | void 26 | mono_w32handle_namespace_unlock (void); 27 | 28 | gpointer 29 | mono_w32handle_namespace_search_handle (MonoW32Type type, const gchar *name); 30 | 31 | #endif /* _MONO_METADATA_W32HANDLE_NAMESPACE_H_ */ 32 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-mmap-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Internal virtual memory stuff. 4 | * 5 | * Copyright (C) 2014 Xamarin Inc 6 | * 7 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 8 | */ 9 | 10 | #ifndef __MONO_UTILS_MMAP_INTERNAL_H__ 11 | #define __MONO_UTILS_MMAP_INTERNAL_H__ 12 | 13 | #include "mono-compiler.h" 14 | 15 | void * 16 | mono_malloc_shared_area (int pid); 17 | 18 | char* 19 | mono_aligned_address (char *mem, size_t size, size_t alignment); 20 | 21 | void 22 | mono_account_mem (MonoMemAccountType type, ssize_t size); 23 | 24 | gboolean 25 | mono_valloc_can_alloc (size_t size); 26 | 27 | void 28 | mono_valloc_set_limit (size_t size); 29 | 30 | #endif /* __MONO_UTILS_MMAP_INTERNAL_H__ */ 31 | -------------------------------------------------------------------------------- /headers/mono/dis/declsec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * declsec.h: Support for the new declarative security attribute 3 | * metadata format (2.0) 4 | * 5 | * Author: 6 | * Sebastien Pouliot 7 | * 8 | * Copyright (C) 2005 Novell, Inc (http://www.novell.com) 9 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 10 | */ 11 | 12 | #ifndef __MONODIS_DECLSEC_H__ 13 | #define __MONODIS_DECLSEC_H__ 14 | 15 | #define MONO_DECLSEC_FORMAT_20 0x2E 16 | 17 | #define MONO_DECLSEC_FIELD 0x53 18 | #define MONO_DECLSEC_PROPERTY 0x54 19 | #define MONO_DECLSEC_ENUM 0x55 20 | 21 | #define MONO_TYPE_SYSTEM_TYPE 0x50 22 | 23 | char* dump_declsec_entry20 (MonoImage *m, const char* p, const char *indent); 24 | 25 | #endif /* __MONODIS_DECLSEC_H__ */ 26 | -------------------------------------------------------------------------------- /headers/mono/metadata/property-bag.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Linearizable property bag. 4 | * 5 | * Authors: 6 | * Rodrigo Kumpera (kumpera@gmail.com) 7 | * 8 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 9 | */ 10 | #ifndef __MONO_METADATA_PROPERTY_BAG_H__ 11 | #define __MONO_METADATA_PROPERTY_BAG_H__ 12 | 13 | #include 14 | 15 | typedef struct _MonoPropertyBagItem MonoPropertyBagItem; 16 | 17 | struct _MonoPropertyBagItem { 18 | MonoPropertyBagItem *next; 19 | int tag; 20 | }; 21 | 22 | typedef struct { 23 | MonoPropertyBagItem *head; 24 | } MonoPropertyBag; 25 | 26 | void* mono_property_bag_get (MonoPropertyBag *bag, int tag); 27 | void* mono_property_bag_add (MonoPropertyBag *bag, void *value); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /headers/mono/metadata/threadpool-io.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_THREADPOOL_IO_H_ 6 | #define _MONO_METADATA_THREADPOOL_IO_H_ 7 | 8 | #include 9 | #include 10 | 11 | #ifndef ENABLE_NETCORE 12 | 13 | #include 14 | #include 15 | 16 | typedef struct _MonoIOSelectorJob MonoIOSelectorJob; 17 | 18 | TYPED_HANDLE_DECL (MonoIOSelectorJob); 19 | 20 | ICALL_EXPORT 21 | void 22 | ves_icall_System_IOSelector_Remove (gpointer handle); 23 | 24 | void 25 | mono_threadpool_io_remove_socket (int fd); 26 | void 27 | mono_threadpool_io_remove_domain_jobs (MonoDomain *domain); 28 | void 29 | mono_threadpool_io_cleanup (void); 30 | 31 | #endif /* ENABLE_NETCORE */ 32 | 33 | #endif /* _MONO_METADATA_THREADPOOL_IO_H_ */ 34 | -------------------------------------------------------------------------------- /headers/mono/metadata/security.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Security internal calls 4 | * 5 | * Author: 6 | * Sebastien Pouliot 7 | * 8 | * (C) 2004 Novell (http://www.novell.com) 9 | */ 10 | 11 | 12 | #ifndef _MONO_METADATA_SECURITY_H_ 13 | #define _MONO_METADATA_SECURITY_H_ 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "reflection-internals.h" 23 | 24 | /* System.Security.Principal.WindowsIdentity */ 25 | gpointer 26 | mono_security_principal_windows_identity_get_current_token (MonoError *error); 27 | 28 | #endif /* _MONO_METADATA_SECURITY_H_ */ 29 | -------------------------------------------------------------------------------- /headers/mono/native/pal-android.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * System.Native PAL internal calls (Android) 4 | * Adapter code between the Mono runtime and the CoreFX Platform Abstraction Layer (PAL) 5 | * Copyright 2018 Microsoft 6 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 7 | */ 8 | 9 | #include "pal_compiler.h" 10 | 11 | /** 12 | * Reads the number of bytes specified into the provided buffer from the specified, opened file descriptor. 13 | * 14 | * Returns the number of bytes read on success; otherwise, -1 is returned an errno is set. 15 | * 16 | * Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info 17 | */ 18 | DLLEXPORT int32_t SystemNative_Read(intptr_t fd, void* buffer, int32_t bufferSize); 19 | -------------------------------------------------------------------------------- /headers/mono/utils/strenc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * string encoding conversions 4 | * 5 | * Author: 6 | * Dick Porter (dick@ximian.com) 7 | * 8 | * (C) 2003 Ximian, Inc. 9 | */ 10 | 11 | #ifndef _MONO_STRENC_H_ 12 | #define _MONO_STRENC_H_ 1 13 | 14 | #include 15 | #include 16 | 17 | MONO_API gunichar2 *mono_unicode_from_external (const gchar *in, gsize *bytes); 18 | MONO_API gchar *mono_utf8_from_external (const gchar *in); 19 | MONO_API gchar *mono_unicode_to_external (const gunichar2 *uni); 20 | MONO_API gboolean mono_utf8_validate_and_len (const gchar *source, glong* oLength, const gchar** oEnd); 21 | MONO_API gboolean mono_utf8_validate_and_len_with_bounds (const gchar *source, glong max_bytes, glong* oLength, const gchar** oEnd); 22 | 23 | #endif /* _MONO_STRENC_H_ */ 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.la 22 | *.lo 23 | 24 | # Shared objects (inc. Windows DLLs) 25 | *.dll 26 | *.so 27 | *.so.* 28 | *.dylib 29 | 30 | # Executables 31 | *.exe 32 | *.out 33 | *.app 34 | *.i*86 35 | *.x86_64 36 | *.hex 37 | 38 | # Debug files 39 | *.dSYM/ 40 | *.su 41 | *.idb 42 | *.pdb 43 | 44 | # Kernel Module Compile Results 45 | *.mod* 46 | *.cmd 47 | .tmp_versions/ 48 | modules.order 49 | Module.symvers 50 | Mkfile.old 51 | dkms.conf 52 | 53 | # VDS 54 | *.vs 55 | eboot.bin 56 | eboot2.bin 57 | param.sfo 58 | param2.sfo 59 | PSVita_Debug 60 | PSVita_Release 61 | VMLCoreAssemblies 62 | CONTENTS -------------------------------------------------------------------------------- /headers/mono/metadata/w32mutex.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_W32MUTEX_H_ 6 | #define _MONO_METADATA_W32MUTEX_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include "object.h" 12 | #include "object-internals.h" 13 | #include "w32handle-namespace.h" 14 | #include 15 | 16 | void 17 | mono_w32mutex_init (void); 18 | 19 | ICALL_EXPORT 20 | MonoBoolean 21 | ves_icall_System_Threading_Mutex_ReleaseMutex_internal (gpointer handle); 22 | 23 | typedef struct MonoW32HandleNamedMutex MonoW32HandleNamedMutex; 24 | 25 | MonoW32HandleNamespace* 26 | mono_w32mutex_get_namespace (MonoW32HandleNamedMutex *mutex); 27 | 28 | #ifndef HOST_WIN32 29 | void 30 | mono_w32mutex_abandon (MonoInternalThread *internal); 31 | #endif 32 | 33 | #endif /* _MONO_METADATA_W32MUTEX_H_ */ 34 | -------------------------------------------------------------------------------- /headers/mono/mini/THIRD-PARTY-NOTICES.TXT: -------------------------------------------------------------------------------- 1 | Mono uses third-party libraries or other resources that may be 2 | distributed under licenses different than the Mono software. 3 | 4 | Attributions and license notices for test cases originally authored by 5 | third parties can be found in the respective test directories. 6 | 7 | In the event that we accidentally failed to list a required notice, please 8 | bring it to our attention. Post an issue or email us: 9 | 10 | dotnet@microsoft.com 11 | 12 | The attached notices are provided for information only. 13 | 14 | License notice for Southern Storm Software 15 | ------------------------------------------ 16 | 17 | GPL: Copyright (C) 2001 Southern Storm Software, Pty Ltd. 18 | 19 | Use: https://github.com/mono/mono/blob/23e6f6f4b58d72800f4e27fa29a6b58806ff475f/mono/mini/bench.cs#L65 20 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-experiments.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MONO_EXPERIMENTS_H_ 3 | #define _MONO_EXPERIMENTS_H_ 4 | 5 | #include 6 | 7 | #include "mono/utils/mono-lazy-init.h" 8 | 9 | 10 | extern mono_lazy_init_t mono_experiments_enabled_init; 11 | 12 | extern guint8 mono_experiments_enabled_table[]; 13 | 14 | void mono_experiments_initialize_table (void); 15 | 16 | static inline gboolean 17 | mono_experiment_enabled (int experiment_id) { 18 | mono_lazy_initialize (&mono_experiments_enabled_init, mono_experiments_initialize_table); 19 | return !!mono_experiments_enabled_table[experiment_id]; 20 | } 21 | 22 | typedef enum MonoExperimentId { 23 | #define EXPERIMENT(id,ghurl) MONO_EXPERIMENT_ ## id , 24 | #include "mono-experiments.def" 25 | #undef EXPERIMENT 26 | MONO_EXPERIMENT_NUM_EXPERIMENTS 27 | } MonoExperimentId; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /headers/mono/sgen/sgen-major-copy-object.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Object copying in the major collectors. 4 | * 5 | * Copyright 2001-2003 Ximian, Inc 6 | * Copyright 2003-2010 Novell, Inc. 7 | * Copyright (C) 2012 Xamarin Inc 8 | * 9 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 10 | */ 11 | 12 | #define collector_pin_object(obj, queue) do { \ 13 | if (sgen_ptr_in_nursery (obj)) { \ 14 | sgen_pin_object (obj, queue); \ 15 | } else { \ 16 | g_assert (objsize <= SGEN_MAX_SMALL_OBJ_SIZE); \ 17 | pin_major_object (obj, queue); \ 18 | } \ 19 | } while (0) 20 | 21 | #define COLLECTOR_SERIAL_ALLOC_FOR_PROMOTION sgen_minor_collector.alloc_for_promotion 22 | #define COLLECTOR_PARALLEL_ALLOC_FOR_PROMOTION sgen_minor_collector.alloc_for_promotion_par 23 | 24 | #include "sgen-copy-object.h" 25 | -------------------------------------------------------------------------------- /headers/mono/metadata/sgen-toggleref.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * toggleref support for sgen 4 | * 5 | * Copyright 2011 Xamarin, Inc. 6 | * 7 | * Author: 8 | * Rodrigo Kumpera (kumpera@gmail.com) 9 | * 10 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 11 | */ 12 | 13 | #ifndef _MONO_SGEN_TOGGLEREF_H_ 14 | #define _MONO_SGEN_TOGGLEREF_H_ 15 | 16 | #include 17 | 18 | /* GC toggle ref support */ 19 | 20 | typedef enum { 21 | MONO_TOGGLE_REF_DROP, 22 | MONO_TOGGLE_REF_STRONG, 23 | MONO_TOGGLE_REF_WEAK 24 | } MonoToggleRefStatus; 25 | 26 | MONO_API void mono_gc_toggleref_register_callback (MonoToggleRefStatus (*proccess_toggleref) (MonoObject *obj)); 27 | MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_toggleref_add (MonoObject *object, mono_bool strong_ref); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /headers/mono/utils/memfuncs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Our own bzero/memmove. 4 | * 5 | * Copyright (C) 2015 Xamarin Inc 6 | * 7 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 8 | */ 9 | 10 | #ifndef __MONO_UTILS_MEMFUNCS_H__ 11 | #define __MONO_UTILS_MEMFUNCS_H__ 12 | 13 | #include 14 | #include 15 | 16 | /* 17 | These functions must be used when it's possible that either destination is not 18 | word aligned or size is not a multiple of word size. 19 | */ 20 | void mono_gc_bzero_atomic (void *dest, size_t size); 21 | void mono_gc_bzero_aligned (void *dest, size_t size); 22 | void mono_gc_memmove_atomic (void *dest, const void *src, size_t size); 23 | void mono_gc_memmove_aligned (void *dest, const void *src, size_t size); 24 | guint64 mono_determine_physical_ram_size (void); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /headers/mono/mini/mini-windows.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_MINI_WINDOWS_H__ 6 | #define __MONO_MINI_WINDOWS_H__ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef HOST_WIN32 12 | #include "windows.h" 13 | #include "mini.h" 14 | #include "mono/utils/mono-context.h" 15 | 16 | gboolean 17 | mono_setup_thread_context(DWORD thread_id, MonoContext *mono_context); 18 | 19 | typedef enum { 20 | MONO_WIN32_TLS_CALLBACK_TYPE_NONE, 21 | MONO_WIN32_TLS_CALLBACK_TYPE_DLL, 22 | MONO_WIN32_TLS_CALLBACK_TYPE_LIB 23 | } MonoWin32TLSCallbackType; 24 | 25 | gboolean 26 | mono_win32_handle_tls_callback_type (MonoWin32TLSCallbackType); 27 | 28 | BOOL 29 | mono_win32_runtime_tls_callback (HMODULE module_handle, DWORD reason, LPVOID reserved, MonoWin32TLSCallbackType callback_type); 30 | 31 | #endif /* HOST_WIN32 */ 32 | #endif /* __MONO_MINI_WINDOWS_H__ */ 33 | -------------------------------------------------------------------------------- /headers/mono/mini/tasklets.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_TASKLETS_H__ 6 | #define __MONO_TASKLETS_H__ 7 | 8 | #include "mini.h" 9 | 10 | typedef struct { 11 | MonoLMF *lmf; 12 | gpointer top_sp; 13 | MonoNativeThreadId thread_id; 14 | MonoDomain *domain; 15 | 16 | /* the instruction pointer and stack to return to on Restore */ 17 | gpointer return_ip; 18 | gpointer return_sp; 19 | 20 | /* the saved stack information */ 21 | int stack_alloc_size; 22 | int stack_used_size; 23 | /* pointer to GC memory */ 24 | gpointer saved_stack; 25 | } MonoContinuation; 26 | 27 | typedef void (*MonoContinuationRestore) (MonoContinuation *cont, int state, MonoLMF **lmf_addr); 28 | 29 | void mono_tasklets_init (void); 30 | void mono_tasklets_cleanup (void); 31 | 32 | MonoContinuationRestore mono_tasklets_arch_restore (void); 33 | 34 | #endif /* __MONO_TASKLETS_H__ */ 35 | 36 | -------------------------------------------------------------------------------- /headers/mono/metadata/number-ms.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_NUMBER_MS_H__ 6 | #define __MONO_NUMBER_MS_H__ 7 | 8 | #include 9 | 10 | // Double floating point Bias 11 | #define MONO_DOUBLE_BIAS 1022 12 | 13 | // Structure to access an encoded double floating point 14 | typedef struct { 15 | #if G_BYTE_ORDER == G_BIG_ENDIAN 16 | guint sign : 1; 17 | guint exp : 11; 18 | guint mantHi : 20; 19 | guint mantLo : 32; 20 | 21 | #define MONO_INIT_DOUBLE(sign, exp, mantHi, mantLo) { sign, exp, mantHi, mantLo } 22 | 23 | #else // BIGENDIAN 24 | guint mantLo : 32; 25 | guint mantHi : 20; 26 | guint exp : 11; 27 | guint sign : 1; 28 | 29 | #define MONO_INIT_DOUBLE(sign, exp, mantHi, mantLo) { mantLo, mantHi, exp, sign } 30 | 31 | #endif 32 | } MonoDouble; 33 | 34 | typedef union { 35 | MonoDouble s; 36 | gdouble d; 37 | } MonoDouble_double; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /headers/mono/metadata/external-only.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Shorthand and markers for functions only used by embedders. 4 | * MONO_ENTER_GC_UNSAFE is also a good indication of external_only. 5 | * 6 | * Author: 7 | * Jay Krell (jaykrell@microsoft.com) 8 | * 9 | * Copyright 2018 Microsoft 10 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 11 | */ 12 | 13 | #ifndef MONO_EXTERNAL_ONLY 14 | 15 | #define MONO_EXTERNAL_ONLY_GC_UNSAFE(t, expr) \ 16 | t result; \ 17 | MONO_ENTER_GC_UNSAFE; \ 18 | result = expr; \ 19 | MONO_EXIT_GC_UNSAFE; \ 20 | return result; 21 | 22 | #define MONO_EXTERNAL_ONLY_GC_UNSAFE_VOID(expr) \ 23 | MONO_ENTER_GC_UNSAFE; \ 24 | expr; \ 25 | MONO_EXIT_GC_UNSAFE; \ 26 | 27 | #define MONO_EXTERNAL_ONLY(t, expr) return expr; 28 | #define MONO_EXTERNAL_ONLY_VOID(expr) expr; 29 | 30 | #endif /* MONO_EXTERNAL_ONLY */ 31 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-logger.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_LOGGER_H__ 6 | #define __MONO_LOGGER_H__ 7 | 8 | #include 9 | MONO_BEGIN_DECLS 10 | 11 | MONO_API void 12 | mono_trace_set_level_string (const char *value); 13 | 14 | MONO_API void 15 | mono_trace_set_mask_string (const char *value); 16 | 17 | typedef void (*MonoPrintCallback) (const char *string, mono_bool is_stdout); 18 | typedef void (*MonoLogCallback) (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data); 19 | 20 | MONO_API void 21 | mono_trace_set_log_handler (MonoLogCallback callback, void *user_data); 22 | 23 | MONO_API void 24 | mono_trace_set_print_handler (MonoPrintCallback callback); 25 | 26 | MONO_API void 27 | mono_trace_set_printerr_handler (MonoPrintCallback callback); 28 | 29 | MONO_END_DECLS 30 | 31 | #endif /* __MONO_LOGGER_H__ */ 32 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-networkinterfaces.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_NETWORK_INTERFACES_H__ 6 | #define __MONO_NETWORK_INTERFACES_H__ 7 | /* 8 | * Utility functions to access network information. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | /* never remove or reorder these enums values: they are used in corlib/System */ 15 | 16 | typedef enum { 17 | MONO_NETWORK_BYTESREC, 18 | MONO_NETWORK_BYTESSENT, 19 | MONO_NETWORK_BYTESTOTAL 20 | } MonoNetworkData; 21 | 22 | typedef enum { 23 | MONO_NETWORK_ERROR_NONE, /* no error happened */ 24 | MONO_NETWORK_ERROR_NOT_FOUND, /* adapter name invalid */ 25 | MONO_NETWORK_ERROR_OTHER 26 | } MonoNetworkError; 27 | 28 | gpointer *mono_networkinterface_list (int *size); 29 | gint64 mono_network_get_data (char* name, MonoNetworkData data, MonoNetworkError *error); 30 | 31 | #endif /* __MONO_NETWORK_INTERFACES_H__ */ 32 | 33 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-key.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-key.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 3/7/16. 6 | // Copyright © 2016 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_key__ 10 | #define __btls__btls_key__ 11 | 12 | #include 13 | #include "btls-ssl.h" 14 | #include "btls-x509.h" 15 | 16 | MONO_API EVP_PKEY * 17 | mono_btls_key_new (); 18 | 19 | MONO_API void 20 | mono_btls_key_free (EVP_PKEY *pkey); 21 | 22 | MONO_API EVP_PKEY * 23 | mono_btls_key_up_ref (EVP_PKEY *pkey); 24 | 25 | MONO_API int 26 | mono_btls_key_get_bits (EVP_PKEY *pkey); 27 | 28 | MONO_API int 29 | mono_btls_key_is_rsa (EVP_PKEY *pkey); 30 | 31 | MONO_API int 32 | mono_btls_key_assign_rsa_private_key (EVP_PKEY *pkey, uint8_t *der_data, int der_length); 33 | 34 | MONO_API int 35 | mono_btls_key_get_bytes (EVP_PKEY *pkey, uint8_t **buffer, int *size, int include_private_bits); 36 | 37 | #endif /* __btls__btls_key__ */ 38 | 39 | -------------------------------------------------------------------------------- /VML_Sample2/VML_Sample2.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;cc;s;asm 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | 19 | 20 | Source Files 21 | 22 | 23 | Source Files 24 | 25 | 26 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-error.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-util.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 3/23/16. 6 | // Copyright © 2016 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_error__ 10 | #define __btls__btls_error__ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include "btls-util.h" 17 | 18 | MONO_API int 19 | mono_btls_error_peek_error (void); 20 | 21 | MONO_API int 22 | mono_btls_error_get_error (void); 23 | 24 | MONO_API void 25 | mono_btls_error_clear_error (void); 26 | 27 | MONO_API int 28 | mono_btls_error_peek_error_line (const char **file, int *line); 29 | 30 | MONO_API int 31 | mono_btls_error_get_error_line (const char **file, int *line); 32 | 33 | MONO_API void 34 | mono_btls_error_get_error_string_n (int error, char *buf, int len); 35 | 36 | MONO_API int 37 | mono_btls_error_get_reason (int error); 38 | 39 | #endif /* __btls__btls_error__ */ 40 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-perfcounters.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_PERFCOUNTERS_H__ 6 | #define __MONO_PERFCOUNTERS_H__ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | typedef struct _MonoCounterSample MonoCounterSample; 14 | 15 | ICALL_EXPORT 16 | MonoBoolean mono_perfcounter_get_sample (void *impl, MonoBoolean only_value, MonoCounterSample *sample); 17 | 18 | ICALL_EXPORT 19 | gint64 mono_perfcounter_update_value (void *impl, MonoBoolean do_incr, gint64 value); 20 | 21 | ICALL_EXPORT 22 | void mono_perfcounter_free_data (void *impl); 23 | 24 | typedef gboolean (*PerfCounterEnumCallback) (char *category_name, char *name, unsigned char type, gint64 value, gpointer user_data); 25 | MONO_API void mono_perfcounter_foreach (PerfCounterEnumCallback cb, gpointer user_data); 26 | 27 | #endif /* __MONO_PERFCOUNTERS_H__ */ 28 | 29 | -------------------------------------------------------------------------------- /VML_Sample1/VML_Sample1.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;cc;s;asm 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | 22 | 23 | Source Files 24 | 25 | 26 | -------------------------------------------------------------------------------- /VitaMonoLoader/VitaMonoLoader.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;cc;s;asm 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | 19 | 20 | Header Files 21 | 22 | 23 | Header Files 24 | 25 | 26 | -------------------------------------------------------------------------------- /headers/mono/metadata/class-abi-details.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file Declarations of MonoClass field offset functions 3 | * Copyright 2018 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METADATA_CLASS_ABI_DETAILS_H__ 7 | #define __MONO_METADATA_CLASS_ABI_DETAILS_H__ 8 | 9 | #include 10 | #include 11 | 12 | #define MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) /*nothing*/ 13 | #ifdef MONO_CLASS_DEF_PRIVATE 14 | #define MONO_CLASS_OFFSET(funcname, argtype, fieldname) intptr_t funcname (void); 15 | #else 16 | #define MONO_CLASS_OFFSET(funcname, argtype, fieldname) static inline intptr_t funcname (void) { return MONO_STRUCT_OFFSET (argtype, fieldname); } 17 | #endif 18 | #include "class-getters.h" 19 | #undef MONO_CLASS_GETTER 20 | #undef MONO_CLASS_OFFSET 21 | 22 | #endif /* __MONO_METADATA_CLASS_ABI_DETAILS_H__ */ 23 | 24 | -------------------------------------------------------------------------------- /headers/mono/metadata/threadpool-worker.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_THREADPOOL_WORKER_H 6 | #define _MONO_METADATA_THREADPOOL_WORKER_H 7 | 8 | #include 9 | #include 10 | 11 | #ifndef ENABLE_NETCORE 12 | 13 | typedef void (*MonoThreadPoolWorkerCallback)(void); 14 | 15 | void 16 | mono_threadpool_worker_init (MonoThreadPoolWorkerCallback callback); 17 | 18 | void 19 | mono_threadpool_worker_cleanup (void); 20 | 21 | void 22 | mono_threadpool_worker_request (void); 23 | 24 | gboolean 25 | mono_threadpool_worker_notify_completed (void); 26 | 27 | gint32 28 | mono_threadpool_worker_get_min (void); 29 | gboolean 30 | mono_threadpool_worker_set_min (gint32 value); 31 | 32 | gint32 33 | mono_threadpool_worker_get_max (void); 34 | gboolean 35 | mono_threadpool_worker_set_max (gint32 value); 36 | 37 | void 38 | mono_threadpool_worker_set_suspended (gboolean suspended); 39 | 40 | #endif /* ENABLE_NETCORE */ 41 | 42 | #endif /* _MONO_METADATA_THREADPOOL_WORKER_H */ 43 | -------------------------------------------------------------------------------- /headers/mono/metadata/dynamic-stream-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METADATA_DYNAMIC_STREAM_INTERNALS_H__ 7 | #define __MONO_METADATA_DYNAMIC_STREAM_INTERNALS_H__ 8 | 9 | #include 10 | #include 11 | 12 | void 13 | mono_dynstream_init (MonoDynamicStream *stream); 14 | 15 | guint32 16 | mono_dynstream_insert_string (MonoDynamicStream *sh, const char *str); 17 | 18 | guint32 19 | mono_dynstream_insert_mstring (MonoDynamicStream *sh, MonoString *str, MonoError *error); 20 | 21 | guint32 22 | mono_dynstream_add_data (MonoDynamicStream *stream, gconstpointer data, guint32 len); 23 | 24 | guint32 25 | mono_dynstream_add_zero (MonoDynamicStream *stream, guint32 len); 26 | 27 | void 28 | mono_dynstream_data_align (MonoDynamicStream *stream); 29 | 30 | #endif /* __MONO_METADATA_DYNAMIC_STREAM_INTERNALS_H__ */ 31 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-x509-revoked.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-x509-revoked.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 3/23/16. 6 | // Copyright © 2016 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_x509_revoked__ 10 | #define __btls__btls_x509_revoked__ 11 | 12 | #include 13 | #include "btls-ssl.h" 14 | #include "btls-x509-crl.h" 15 | 16 | MONO_API MonoBtlsX509Revoked * 17 | mono_btls_x509_revoked_new (MonoBtlsX509Crl *owner, X509_REVOKED *revoked); 18 | 19 | MONO_API void 20 | mono_btls_x509_revoked_free (MonoBtlsX509Revoked *revoked); 21 | 22 | MONO_API int 23 | mono_btls_x509_revoked_get_serial_number (MonoBtlsX509Revoked *revoked, char *buffer, int size); 24 | 25 | MONO_API int64_t 26 | mono_btls_x509_revoked_get_revocation_date (MonoBtlsX509Revoked *revoked); 27 | 28 | MONO_API int 29 | mono_btls_x509_revoked_get_reason (MonoBtlsX509Revoked *revoked); 30 | 31 | MONO_API int 32 | mono_btls_x509_revoked_get_sequence (MonoBtlsX509Revoked *revoked); 33 | 34 | #endif /* __btls__btls_x509_revoked__ */ 35 | -------------------------------------------------------------------------------- /headers/mono/metadata/filewatcher.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * File System Watcher internal calls 4 | * 5 | * Authors: 6 | * Gonzalo Paniagua Javier (gonzalo@ximian.com) 7 | * 8 | * (C) 2004 Novell, Inc. (http://www.novell.com) 9 | */ 10 | 11 | #ifndef _MONO_METADATA_FILEWATCHER_H 12 | #define _MONO_METADATA_FILEWATCHER_H 13 | 14 | #include 15 | #include "mono/utils/mono-compiler.h" 16 | #include 17 | #include 18 | 19 | #ifdef HAVE_UNISTD_H 20 | #include 21 | #endif 22 | 23 | #if !ENABLE_NETCORE 24 | 25 | ICALL_EXPORT 26 | gint ves_icall_System_IO_FSW_SupportsFSW (void); 27 | 28 | ICALL_EXPORT 29 | int ves_icall_System_IO_KqueueMonitor_kevent_notimeout (int *kq, gpointer changelist, int nchanges, gpointer eventlist, int nevents); 30 | 31 | #endif 32 | 33 | #ifdef HOST_IOS // This will obsoleted by System.Native as soon as it's ported to iOS 34 | MONO_API char* SystemNative_RealPath(const char* path); 35 | MONO_API void SystemNative_Sync (void); 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /headers/mono/metadata/threadpool.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_THREADPOOL_H_ 6 | #define _MONO_METADATA_THREADPOOL_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | void 16 | mono_threadpool_cleanup (void); 17 | 18 | MonoAsyncResult * 19 | mono_threadpool_begin_invoke (MonoDomain *domain, MonoObject *target, MonoMethod *method, gpointer *params, MonoError *error); 20 | MonoObject * 21 | mono_threadpool_end_invoke (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc, MonoError *error); 22 | 23 | gboolean 24 | mono_threadpool_remove_domain_jobs (MonoDomain *domain, int timeout); 25 | 26 | void 27 | mono_threadpool_suspend (void); 28 | void 29 | mono_threadpool_resume (void); 30 | 31 | /* Internals */ 32 | 33 | gboolean 34 | mono_threadpool_enqueue_work_item (MonoDomain *domain, MonoObject *work_item, MonoError *error); 35 | 36 | #endif // _MONO_METADATA_THREADPOOL_H_ 37 | -------------------------------------------------------------------------------- /headers/mono/metadata/image-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2015 Xamarin Inc 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METADATA_IMAGE_INTERNALS_H__ 7 | #define __MONO_METADATA_IMAGE_INTERNALS_H__ 8 | 9 | #include 10 | #include 11 | 12 | MonoImage* 13 | mono_image_loaded_internal (MonoAssemblyLoadContext *alc, const char *name, mono_bool refonly); 14 | 15 | MonoImage* 16 | mono_image_load_file_for_image_checked (MonoImage *image, int fileidx, MonoError *error); 17 | 18 | MonoImage* 19 | mono_image_load_module_checked (MonoImage *image, int idx, MonoError *error); 20 | 21 | MonoImage * 22 | mono_image_open_a_lot (MonoAssemblyLoadContext *alc, const char *fname, MonoImageOpenStatus *status, gboolean refonly, gboolean load_from_context); 23 | 24 | gboolean 25 | mono_is_problematic_image (MonoImage *image); 26 | 27 | gboolean 28 | mono_is_problematic_file (const char *fname); 29 | 30 | #endif /* __MONO_METADATA_IMAGE_INTERNALS_H__ */ 31 | -------------------------------------------------------------------------------- /headers/mono/native/pal-icalls.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * System.Native PAL internal calls 4 | * Adapter code between the Mono runtime and the CoreFX Platform Abstraction Layer (PAL) 5 | * Copyright 2018 Microsoft 6 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 7 | */ 8 | 9 | #ifndef __MONO_METADATA_PAL_ICALLS_H__ 10 | #define __MONO_METADATA_PAL_ICALLS_H__ 11 | 12 | #include "mono/metadata/metadata.h" 13 | #include "mono/metadata/class-internals.h" 14 | 15 | MONO_API void mono_pal_init (void); 16 | 17 | extern void mono_marshal_set_last_error (void); 18 | extern int32_t SystemNative_Read(intptr_t fd, void* buffer, int32_t bufferSize); 19 | gint32 ves_icall_Interop_Sys_Read (intptr_t fd, gchar* buffer, gint32 count); 20 | 21 | #if defined(__APPLE__) 22 | extern void mono_thread_info_install_interrupt (void (*callback) (gpointer data), gpointer data, gboolean *interrupted); 23 | extern void mono_thread_info_uninstall_interrupt (gboolean *interrupted); 24 | void ves_icall_Interop_RunLoop_CFRunLoopRun (void); 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /VMLVita2D/VMLVita2D.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;cc;s;asm 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | 22 | 23 | Header Files 24 | 25 | 26 | 27 | 28 | Source Files 29 | 30 | 31 | -------------------------------------------------------------------------------- /headers/mono/mini/mini-gc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_MINI_GC_H__ 6 | #define __MONO_MINI_GC_H__ 7 | 8 | #include "mini.h" 9 | 10 | /* 11 | * The GC type of a stack slot or register. 12 | * This can change through the method as follows: 13 | * - a SLOT_REF can become SLOT_NOREF and vice-versa when it becomes live/dead. 14 | * - a SLOT_PIN can become SLOT_REF after it has been definitely assigned. 15 | */ 16 | typedef enum { 17 | /* Stack slot doesn't contain a reference */ 18 | SLOT_NOREF = 0, 19 | /* Stack slot contains a reference */ 20 | SLOT_REF = 1, 21 | /* No info or managed pointer, slot needs to be scanned conservatively */ 22 | SLOT_PIN = 2 23 | } GCSlotType; 24 | 25 | void mini_gc_init (void); 26 | 27 | void mini_gc_init_cfg (MonoCompile *cfg); 28 | 29 | void mini_gc_enable_gc_maps_for_aot (void); 30 | 31 | void mini_gc_create_gc_map (MonoCompile *cfg); 32 | 33 | void mini_gc_set_slot_type_from_fp (MonoCompile *cfg, int slot_offset, GCSlotType type); 34 | 35 | void mini_gc_set_slot_type_from_cfa (MonoCompile *cfg, int slot_offset, GCSlotType type); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /headers/mono/mini/tiered.h: -------------------------------------------------------------------------------- 1 | #ifdef ENABLE_EXPERIMENT_TIERED 2 | 3 | #ifndef __MONO_MINI_TIERED_H__ 4 | #define __MONO_MINI_TIERED_H__ 5 | 6 | #define TIERED_PATCH_KIND_INTERP 0 7 | #define TIERED_PATCH_KIND_JIT 1 8 | #define TIERED_PATCH_KIND_NUM 2 9 | 10 | typedef struct { 11 | int hotness; 12 | gboolean promoted; 13 | } MiniTieredCounter; 14 | 15 | typedef struct { 16 | gint64 methods_promoted; 17 | } MiniTieredStats; 18 | 19 | typedef struct { 20 | MonoDomain *domain; 21 | MonoMethod *target_method; 22 | int tier_level; 23 | } MiniTieredPatchPointContext; 24 | 25 | typedef gboolean (*CallsitePatcher)(MiniTieredPatchPointContext *context, gpointer patchsite); 26 | 27 | void 28 | mini_tiered_init (void); 29 | 30 | void 31 | mini_tiered_inc (MonoDomain *domain, MonoMethod *method, MiniTieredCounter *tcnt, int level); 32 | 33 | void 34 | mini_tiered_record_callsite (gpointer callsite, MonoMethod *target_method, int level); 35 | 36 | void 37 | mini_tiered_register_callsite_patcher (CallsitePatcher func, int level); 38 | 39 | #endif /* __MONO_MINI_TIERED_H__ */ 40 | #endif /* ENABLE_EXPERIMENT_TIERED */ 41 | -------------------------------------------------------------------------------- /headers/mono/metadata/method-builder-ilgen-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2018 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METHOD_BUILDER_ILGEN_INTERNALS_H__ 7 | #define __MONO_METHOD_BUILDER_ILGEN_INTERNALS_H__ 8 | 9 | #include "config.h" 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | /* ilgen version */ 18 | struct _MonoMethodBuilder { 19 | MonoMethod *method; 20 | gchar *name; 21 | gboolean no_dup_name; 22 | GList *locals_list; 23 | gint locals; 24 | gboolean dynamic; 25 | gboolean skip_visibility; 26 | gboolean init_locals; 27 | guint32 code_size; 28 | guint32 pos; 29 | guchar *code; 30 | gint num_clauses; 31 | MonoExceptionClause *clauses; 32 | const gchar **param_names; 33 | MonoBitSet *volatile_args; 34 | MonoBitSet *volatile_locals; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /headers/mono/mini/mini-arch.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_MINI_ARCH_H__ 6 | #define __MONO_MINI_ARCH_H__ 7 | 8 | #ifdef TARGET_X86 9 | #include "mini-x86.h" 10 | #elif defined(TARGET_AMD64) 11 | #include "mini-amd64.h" 12 | #elif defined(TARGET_POWERPC) 13 | #include "mini-ppc.h" 14 | #elif defined(__sparc__) || defined(sparc) 15 | #include "mini-sparc.h" 16 | #elif defined(TARGET_S390X) 17 | # if defined(__s390x__) 18 | # include "mini-s390x.h" 19 | # else 20 | #error "s390 is no longer supported." 21 | # endif 22 | #elif defined(TARGET_ARM) 23 | #include "mini-arm.h" 24 | #elif defined(TARGET_ARM64) 25 | #include "mini-arm64.h" 26 | #elif defined(__mips__) 27 | #include "mini-mips.h" 28 | #elif defined (TARGET_RISCV) 29 | #include "mini-riscv.h" 30 | #elif TARGET_WASM 31 | #include "mini-wasm.h" 32 | #else 33 | #error add arch specific include file in mini-arch.h 34 | #endif 35 | 36 | #if (MONO_ARCH_FRAME_ALIGNMENT == 4) 37 | #define MONO_ARCH_LOCALLOC_ALIGNMENT 8 38 | #else 39 | #define MONO_ARCH_LOCALLOC_ALIGNMENT MONO_ARCH_FRAME_ALIGNMENT 40 | #endif 41 | 42 | #endif /* __MONO_MINI_ARCH_H__ */ 43 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-conc-hash.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * GC-aware concurrent hashtable, based on utils/mono-conc-hashtable 4 | */ 5 | 6 | #ifndef __MONO_CONC_G_HASH_H__ 7 | #define __MONO_CONC_G_HASH_H__ 8 | 9 | #include 10 | 11 | 12 | typedef struct _MonoConcGHashTable MonoConcGHashTable; 13 | 14 | MonoConcGHashTable * mono_conc_g_hash_table_new_type (GHashFunc hash_func, GEqualFunc key_equal_func, MonoGHashGCType type, MonoGCRootSource source, void *key, const char *msg); 15 | gpointer mono_conc_g_hash_table_lookup (MonoConcGHashTable *hash, gconstpointer key); 16 | gboolean mono_conc_g_hash_table_lookup_extended (MonoConcGHashTable *hash, gconstpointer key, gpointer *orig_key, gpointer *value); 17 | void mono_conc_g_hash_table_foreach (MonoConcGHashTable *hash, GHFunc func, gpointer user_data); 18 | void mono_conc_g_hash_table_destroy (MonoConcGHashTable *hash); 19 | gpointer mono_conc_g_hash_table_insert (MonoConcGHashTable *h, gpointer k, gpointer v); 20 | gpointer mono_conc_g_hash_table_remove (MonoConcGHashTable *hash, gconstpointer key); 21 | 22 | #endif /* __MONO_CONC_G_HASH_H__ */ 23 | -------------------------------------------------------------------------------- /headers/mono/mini/seq-points.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2014 Xamarin Inc 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | 7 | #ifndef __MONO_SEQ_POINTS_H__ 8 | #define __MONO_SEQ_POINTS_H__ 9 | 10 | #include 11 | 12 | void 13 | mono_save_seq_point_info (MonoCompile *cfg, MonoJitInfo *jinfo); 14 | 15 | MonoSeqPointInfo* 16 | mono_get_seq_points (MonoDomain *domain, MonoMethod *method); 17 | 18 | gboolean 19 | mono_find_next_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point); 20 | 21 | gboolean 22 | mono_find_prev_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point); 23 | 24 | gboolean 25 | mono_find_seq_point (MonoDomain *domain, MonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point); 26 | 27 | void 28 | mono_bb_deduplicate_op_il_seq_points (MonoCompile *cfg, MonoBasicBlock *bb); 29 | 30 | #endif /* __MONO_SEQ_POINTS_H__ */ 31 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-basic-block.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_METADATA_BASIC_BLOCK_H__ 6 | #define __MONO_METADATA_BASIC_BLOCK_H__ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | typedef struct _MonoSimpleBasicBlock MonoSimpleBasicBlock; 15 | 16 | struct _MonoSimpleBasicBlock { 17 | MonoSimpleBasicBlock *next, *left, *right, *parent; 18 | GSList *out_bb; 19 | int start, end; 20 | unsigned colour : 1; 21 | unsigned dead : 1; 22 | }; 23 | 24 | MonoSimpleBasicBlock* 25 | mono_basic_block_split (MonoMethod *method, MonoError *error, MonoMethodHeader *header); 26 | 27 | void 28 | mono_basic_block_free (MonoSimpleBasicBlock *bb); 29 | 30 | /*This function is here because opcodes.h is a public header*/ 31 | int 32 | mono_opcode_value_and_size (const unsigned char **ip, const unsigned char *end, MonoOpcodeEnum *value); 33 | 34 | int 35 | mono_opcode_size (const unsigned char *ip, const unsigned char *end); 36 | 37 | #endif /* __MONO_METADATA_BASIC_BLOCK_H__ */ 38 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-x509-lookup-mono.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-x509-lookup-mono.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 3/3/16. 6 | // Copyright © 2016 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_x509_lookup_mono__ 10 | #define __btls__btls_x509_lookup_mono__ 11 | 12 | #include 13 | #include "btls-ssl.h" 14 | #include "btls-x509.h" 15 | #include "btls-x509-store.h" 16 | 17 | typedef int (* MonoBtlsX509LookupMono_BySubject) (const void *instance, MonoBtlsX509Name *name, X509 **ret); 18 | 19 | MONO_API MonoBtlsX509LookupMono * 20 | mono_btls_x509_lookup_mono_new (void); 21 | 22 | MONO_API int 23 | mono_btls_x509_lookup_mono_free (MonoBtlsX509LookupMono *mono); 24 | 25 | MONO_API void 26 | mono_btls_x509_lookup_mono_init (MonoBtlsX509LookupMono *mono, const void *instance, 27 | MonoBtlsX509LookupMono_BySubject by_subject_func); 28 | 29 | MONO_API int 30 | mono_btls_x509_lookup_add_mono (MonoBtlsX509Lookup *lookup, MonoBtlsX509LookupMono *mono); 31 | 32 | MONO_API X509_LOOKUP_METHOD * 33 | mono_btls_x509_lookup_mono_method (void); 34 | 35 | #endif /* defined(__btls__btls_x509_lookup_mono__) */ 36 | 37 | -------------------------------------------------------------------------------- /headers/mono/native/mono-native-platform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "mono/utils/mono-publib.h" 4 | 5 | // Keep in sync with mcs/class/corlib/Test/Mono/MonoNativePlatformType.cs 6 | 7 | typedef enum { 8 | MONO_NATIVE_PLATFORM_TYPE_UNKNOWN = 0, 9 | MONO_NATIVE_PLATFORM_TYPE_MACOS = 1, 10 | MONO_NATIVE_PLATFORM_TYPE_IOS = 2, 11 | MONO_NATIVE_PLATFORM_TYPE_LINUX = 3, 12 | MONO_NATIVE_PLATFORM_TYPE_AIX = 4, 13 | MONO_NATIVE_PLATFORM_TYPE_ANDROID = 5, 14 | MONO_NATIVE_PLATFORM_TYPE_FREEBSD = 6, 15 | MONO_NATIVE_PLATFORM_TYPE_HAIKU = 7, 16 | MONO_NATIVE_PLATFORM_TYPE_NETBSD = 8, 17 | 18 | MONO_NATIVE_PLATFORM_TYPE_IPHONE = 0x100, 19 | MONO_NATIVE_PLATFORM_TYPE_TV = 0x200, 20 | MONO_NATIVE_PLATFORM_TYPE_WATCH = 0x400, 21 | 22 | MONO_NATIVE_PLATFORM_TYPE_COMPAT = 0x1000, 23 | MONO_NATIVE_PLATFORM_TYPE_UNIFIED = 0x2000, 24 | 25 | MONO_NATIVE_PLATFORM_TYPE_SIMULATOR = 0x4000, 26 | MONO_NATIVE_PLATFORM_TYPE_DEVICE = 0x8000 27 | } MonoNativePlatformType; 28 | 29 | MONO_API int32_t 30 | mono_native_get_platform_type (void); 31 | 32 | MONO_API int32_t 33 | mono_native_is_initialized (void); 34 | 35 | MONO_API void 36 | mono_native_initialize (void); 37 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-jemalloc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Header for jemalloc registration code 5 | */ 6 | 7 | #ifndef __MONO_JEMALLOC_H__ 8 | #define __MONO_JEMALLOC_H__ 9 | 10 | #if defined(MONO_JEMALLOC_ENABLED) 11 | 12 | #include 13 | 14 | /* Jemalloc can be configured in three ways. 15 | * 1. You can use it with library loading hacks at run-time 16 | * 2. You can use it as a global malloc replacement 17 | * 3. You can use it with a prefix. If you use it with a prefix, you have to explicitly name the malloc function. 18 | * 19 | * In order to make this feature able to be toggled at run-time, I chose to use a prefix of mono_je. 20 | * This mapping is captured below in the header, in the spirit of "no magic constants". 21 | * 22 | * The place that configures jemalloc and sets this prefix is in the Makefile in 23 | * mono/jemalloc/Makefile.am 24 | * 25 | */ 26 | #define MONO_JEMALLOC_MALLOC mono_jemalloc 27 | #define MONO_JEMALLOC_REALLOC mono_jerealloc 28 | #define MONO_JEMALLOC_FREE mono_jefree 29 | #define MONO_JEMALLOC_CALLOC mono_jecalloc 30 | 31 | void mono_init_jemalloc (void); 32 | 33 | #endif 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /headers/mono/metadata/w32event.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_W32EVENT_H_ 6 | #define _MONO_METADATA_W32EVENT_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include "object.h" 12 | #include "object-internals.h" 13 | #include "w32handle-namespace.h" 14 | #include 15 | 16 | void 17 | mono_w32event_init (void); 18 | 19 | gpointer 20 | mono_w32event_create (gboolean manual, gboolean initial); 21 | 22 | gboolean 23 | mono_w32event_close (gpointer handle); 24 | 25 | void 26 | mono_w32event_set (gpointer handle); 27 | 28 | void 29 | mono_w32event_reset (gpointer handle); 30 | 31 | ICALL_EXPORT 32 | gboolean 33 | ves_icall_System_Threading_Events_SetEvent_internal (gpointer handle); 34 | 35 | ICALL_EXPORT 36 | gboolean 37 | ves_icall_System_Threading_Events_ResetEvent_internal (gpointer handle); 38 | 39 | ICALL_EXPORT 40 | void 41 | ves_icall_System_Threading_Events_CloseEvent_internal (gpointer handle); 42 | 43 | typedef struct MonoW32HandleNamedEvent MonoW32HandleNamedEvent; 44 | 45 | MonoW32HandleNamespace* 46 | mono_w32event_get_namespace (MonoW32HandleNamedEvent *event); 47 | 48 | #endif /* _MONO_METADATA_W32EVENT_H_ */ 49 | -------------------------------------------------------------------------------- /headers/mono/mini/interp/interp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_MINI_INTERPRETER_H__ 6 | #define __MONO_MINI_INTERPRETER_H__ 7 | #include 8 | 9 | #ifdef TARGET_WASM 10 | #define INTERP_ICALL_TRAMP_IARGS 12 11 | #define INTERP_ICALL_TRAMP_FARGS 12 12 | #else 13 | #define INTERP_ICALL_TRAMP_IARGS 12 14 | #define INTERP_ICALL_TRAMP_FARGS 4 15 | #endif 16 | 17 | struct _InterpMethodArguments { 18 | size_t ilen; 19 | gpointer *iargs; 20 | size_t flen; 21 | double *fargs; 22 | gpointer *retval; 23 | size_t is_float_ret; 24 | #ifdef TARGET_WASM 25 | MonoMethodSignature *sig; 26 | #endif 27 | }; 28 | 29 | enum { 30 | INTERP_OPT_NONE = 0, 31 | INTERP_OPT_INLINE = 1, 32 | INTERP_OPT_CPROP = 2, 33 | INTERP_OPT_SUPER_INSTRUCTIONS = 4, 34 | INTERP_OPT_DEFAULT = INTERP_OPT_INLINE | INTERP_OPT_CPROP | INTERP_OPT_SUPER_INSTRUCTIONS 35 | }; 36 | 37 | typedef struct _InterpMethodArguments InterpMethodArguments; 38 | 39 | /* must be called either 40 | * - by mini_init () 41 | * - xor, before mini_init () is called (embedding scenario). 42 | */ 43 | MONO_API void mono_ee_interp_init (const char *); 44 | 45 | #endif /* __MONO_MINI_INTERPRETER_H__ */ 46 | -------------------------------------------------------------------------------- /headers/mono/metadata/fdhandle.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __MONO_METADATA_FDHANDLE_H__ 3 | #define __MONO_METADATA_FDHANDLE_H__ 4 | 5 | #include 6 | #include 7 | 8 | #include "utils/refcount.h" 9 | 10 | typedef enum { 11 | MONO_FDTYPE_FILE, 12 | MONO_FDTYPE_CONSOLE, 13 | MONO_FDTYPE_PIPE, 14 | MONO_FDTYPE_SOCKET, 15 | MONO_FDTYPE_COUNT 16 | } MonoFDType; 17 | 18 | typedef struct { 19 | MonoRefCount ref; 20 | MonoFDType type; 21 | gint fd; 22 | } MonoFDHandle; 23 | 24 | typedef struct { 25 | void (*close) (MonoFDHandle *fdhandle); 26 | void (*destroy) (MonoFDHandle *fdhandle); 27 | } MonoFDHandleCallback; 28 | 29 | void 30 | mono_fdhandle_register (MonoFDType type, MonoFDHandleCallback *callback); 31 | 32 | void 33 | mono_fdhandle_init (MonoFDHandle *fdhandle, MonoFDType type, gint fd); 34 | 35 | void 36 | mono_fdhandle_insert (MonoFDHandle *fdhandle); 37 | 38 | gboolean 39 | mono_fdhandle_try_insert (MonoFDHandle *fdhandle); 40 | 41 | gboolean 42 | mono_fdhandle_lookup_and_ref (gint fd, MonoFDHandle **fdhandle); 43 | 44 | void 45 | mono_fdhandle_unref (MonoFDHandle *fdhandle); 46 | 47 | gboolean 48 | mono_fdhandle_close (gint fd); 49 | 50 | #endif /* __MONO_METADATA_FDHANDLE_H__ */ 51 | -------------------------------------------------------------------------------- /headers/mono/metadata/marshal-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METADATA_MARSHAL_INTERNALS_H__ 7 | #define __MONO_METADATA_MARSHAL_INTERNALS_H__ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | MonoObjectHandle 14 | mono_marshal_xdomain_copy_value_handle (MonoObjectHandle val, MonoError *error); 15 | 16 | void* 17 | mono_marshal_alloc_co_task_mem (size_t size); 18 | 19 | void 20 | mono_marshal_free_co_task_mem (void *ptr); 21 | 22 | gpointer 23 | mono_marshal_realloc_co_task_mem (gpointer ptr, size_t size); 24 | 25 | void 26 | mono_marshal_free_hglobal (void *ptr); 27 | 28 | gpointer 29 | mono_marshal_realloc_hglobal (gpointer ptr, size_t size); 30 | 31 | void* 32 | mono_marshal_alloc_hglobal (size_t size); 33 | 34 | void* 35 | mono_marshal_alloc_hglobal_error (gsize size, MonoError*); 36 | 37 | typedef enum { 38 | TYPECHECK_OBJECT_ARG_POS = 0, 39 | TYPECHECK_CLASS_ARG_POS = 1, 40 | TYPECHECK_CACHE_ARG_POS = 2 41 | } MarshalTypeCheckPositions; 42 | 43 | #endif /* __MONO_METADATA_MARSHAL_INTERNALS_H__ */ 44 | -------------------------------------------------------------------------------- /headers/mono/metadata/callspec.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_CALLSPEC_H__ 6 | #define __MONO_CALLSPEC_H__ 7 | #include 8 | #include 9 | 10 | typedef enum { 11 | MONO_TRACEOP_ALL, 12 | MONO_TRACEOP_PROGRAM, 13 | MONO_TRACEOP_METHOD, 14 | MONO_TRACEOP_ASSEMBLY, 15 | MONO_TRACEOP_CLASS, 16 | MONO_TRACEOP_NAMESPACE, 17 | MONO_TRACEOP_EXCEPTION, 18 | MONO_TRACEOP_WRAPPER, 19 | } MonoTraceOpcode; 20 | 21 | typedef struct { 22 | MonoTraceOpcode op; 23 | int exclude; 24 | void *data, *data2; 25 | } MonoTraceOperation; 26 | 27 | typedef struct { 28 | int len; 29 | gboolean enabled; 30 | MonoTraceOperation *ops; 31 | } MonoCallSpec; 32 | 33 | MONO_PROFILER_API gboolean mono_callspec_parse (const char *options, 34 | MonoCallSpec *spec, 35 | char **errstr); 36 | MONO_PROFILER_API void mono_callspec_cleanup (MonoCallSpec *spec); 37 | MONO_PROFILER_API gboolean mono_callspec_eval_exception (MonoClass *klass, 38 | MonoCallSpec *spec); 39 | MONO_PROFILER_API gboolean mono_callspec_eval (MonoMethod *method, 40 | const MonoCallSpec *spec); 41 | void mono_callspec_set_assembly (MonoAssembly *assembly); 42 | 43 | #endif /* __MONO_CALLSPEC_H__ */ 44 | -------------------------------------------------------------------------------- /headers/mono/metadata/remoting.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Remoting support 4 | * 5 | * (C) 2014 Xamarin, Inc. http://www.xamarin.com 6 | * 7 | */ 8 | 9 | #ifndef __MONO_REMOTING_H__ 10 | #define __MONO_REMOTING_H__ 11 | 12 | #include "config.h" 13 | #include 14 | #include 15 | #include 16 | 17 | void mono_remoting_init (void); 18 | 19 | #ifndef DISABLE_REMOTING 20 | 21 | MonoMethod * 22 | mono_marshal_get_remoting_invoke (MonoMethod *method, MonoError *error); 23 | 24 | MonoMethod * 25 | mono_marshal_get_xappdomain_invoke (MonoMethod *method, MonoError *error); 26 | 27 | MonoMethod * 28 | mono_marshal_get_remoting_invoke_for_target (MonoMethod *method, MonoRemotingTarget target_type, MonoError *error); 29 | 30 | MonoMethod * 31 | mono_marshal_get_remoting_invoke_with_check (MonoMethod *method, MonoError *error); 32 | 33 | MonoMethod * 34 | mono_marshal_get_stfld_wrapper (MonoType *type); 35 | 36 | MonoMethod * 37 | mono_marshal_get_ldfld_wrapper (MonoType *type); 38 | 39 | MonoMethod * 40 | mono_marshal_get_ldflda_wrapper (MonoType *type); 41 | 42 | MonoMethod * 43 | mono_marshal_get_proxy_cancast (MonoClass *klass); 44 | 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-x509-chain.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-x509-chain.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 3/3/16. 6 | // Copyright © 2016 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_x509_chain__ 10 | #define __btls__btls_x509_chain__ 11 | 12 | #include 13 | #include "btls-ssl.h" 14 | #include "btls-x509.h" 15 | 16 | MONO_API MonoBtlsX509Chain * 17 | mono_btls_x509_chain_new (void); 18 | 19 | MONO_API MonoBtlsX509Chain * 20 | mono_btls_x509_chain_from_certs (STACK_OF(X509) *certs); 21 | 22 | MONO_API STACK_OF(X509) * 23 | mono_btls_x509_chain_peek_certs (MonoBtlsX509Chain *chain); 24 | 25 | MONO_API int 26 | mono_btls_x509_chain_get_count (MonoBtlsX509Chain *chain); 27 | 28 | MONO_API X509 * 29 | mono_btls_x509_chain_get_cert (MonoBtlsX509Chain *chain, int index); 30 | 31 | MONO_API STACK_OF(X509) * 32 | mono_btls_x509_chain_get_certs (MonoBtlsX509Chain *chain); 33 | 34 | MONO_API MonoBtlsX509Chain * 35 | mono_btls_x509_chain_up_ref (MonoBtlsX509Chain *chain); 36 | 37 | MONO_API int 38 | mono_btls_x509_chain_free (MonoBtlsX509Chain *chain); 39 | 40 | MONO_API void 41 | mono_btls_x509_chain_add_cert (MonoBtlsX509Chain *chain, X509 *x509); 42 | 43 | #endif /* defined(__btls__btls_x509_chain__) */ 44 | 45 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-security-windows-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METADATA_MONO_SECURITY_WINDOWS_INTERNALS_H__ 7 | #define __MONO_METADATA_MONO_SECURITY_WINDOWS_INTERNALS_H__ 8 | 9 | #include 10 | #include 11 | 12 | #ifdef HOST_WIN32 13 | #include "mono/metadata/security.h" 14 | #include "mono/metadata/object.h" 15 | #include "mono/metadata/object-internals.h" 16 | #include "mono/metadata/metadata.h" 17 | #include "mono/metadata/metadata-internals.h" 18 | 19 | gint32 20 | mono_security_win_get_token_name (gpointer token, gunichar2 ** uniname, MonoError *error); 21 | 22 | gboolean 23 | mono_security_win_is_machine_protected (const gunichar2 *path, MonoError *error); 24 | 25 | gboolean 26 | mono_security_win_is_user_protected (const gunichar2 *path, MonoError *error); 27 | 28 | gboolean 29 | mono_security_win_protect_machine (const gunichar2 *path, MonoError *error); 30 | 31 | gboolean 32 | mono_security_win_protect_user (const gunichar2 *path, MonoError *error); 33 | 34 | #endif /* HOST_WIN32 */ 35 | 36 | #endif /* __MONO_METADATA_MONO_SECURITY_WINDOWS_INTERNALS_H__ */ 37 | -------------------------------------------------------------------------------- /headers/mono/metadata/mempool.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_MEMPOOL_H_ 6 | #define _MONO_MEMPOOL_H_ 7 | 8 | #include 9 | 10 | typedef struct _MonoMemPool MonoMemPool; 11 | 12 | MONO_API MonoMemPool * 13 | mono_mempool_new (void); 14 | 15 | MONO_API MonoMemPool * 16 | mono_mempool_new_size (int initial_size); 17 | 18 | MONO_API void 19 | mono_mempool_destroy (MonoMemPool *pool); 20 | 21 | MONO_API void 22 | mono_mempool_invalidate (MonoMemPool *pool); 23 | 24 | MONO_API void 25 | mono_mempool_stats (MonoMemPool *pool); 26 | 27 | MONO_API void* 28 | mono_mempool_alloc (MonoMemPool *pool, unsigned int size); 29 | 30 | #define mono_mempool_alloc(pool, size) (g_cast (mono_mempool_alloc ((pool), (size)))) 31 | 32 | MONO_API void* 33 | mono_mempool_alloc0 (MonoMemPool *pool, unsigned int size); 34 | 35 | #define mono_mempool_alloc0(pool, size) (g_cast (mono_mempool_alloc0 ((pool), (size)))) 36 | 37 | MONO_API mono_bool 38 | mono_mempool_contains_addr (MonoMemPool *pool, void* addr); 39 | 40 | MONO_API char* 41 | mono_mempool_strdup (MonoMemPool *pool, const char *s); 42 | 43 | MONO_API uint32_t 44 | mono_mempool_get_allocated (MonoMemPool *pool); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /headers/mono/metadata/coree-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_COREE_INTERNALS_H__ 7 | #define __MONO_COREE_INTERNALS_H__ 8 | 9 | #include 10 | #include 11 | 12 | #ifdef HOST_WIN32 13 | #include 14 | 15 | BOOL STDMETHODCALLTYPE 16 | _CorDllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved); 17 | 18 | __int32 STDMETHODCALLTYPE 19 | _CorExeMain (void); 20 | 21 | void STDMETHODCALLTYPE 22 | CorExitProcess (int exitCode); 23 | 24 | STDAPI 25 | _CorValidateImage (PVOID *ImageBase, LPCWSTR FileName); 26 | 27 | STDAPI_(VOID) 28 | _CorImageUnloading (PVOID ImageBase); 29 | 30 | STDAPI 31 | CorBindToRuntimeEx (LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, 32 | DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv); 33 | 34 | STDAPI 35 | CorBindToRuntime (LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, 36 | REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv); 37 | 38 | HMODULE WINAPI 39 | MonoLoadImage (LPCWSTR FileName); 40 | 41 | void mono_coree_set_act_ctx (const char *file_name); 42 | #endif /* HOST_WIN32 */ 43 | 44 | #endif /* __MONO_COREE_INTERNALS_H__ */ 45 | 46 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Author: Paolo Molaro (lupus@ximian.com) 5 | * 6 | * (C) 2002 Ximian, Inc. 7 | */ 8 | #ifndef __MONO_METADATA_CONFIG_H__ 9 | #define __MONO_METADATA_CONFIG_H__ 10 | 11 | #include 12 | #include 13 | 14 | MONO_BEGIN_DECLS 15 | 16 | MONO_API const char *mono_config_get_os (void); 17 | MONO_API const char *mono_config_get_cpu (void); 18 | MONO_API const char *mono_config_get_wordsize (void); 19 | 20 | MONO_API const char* mono_get_config_dir (void); 21 | MONO_API void mono_set_config_dir (const char *dir); 22 | 23 | MONO_API const char* mono_get_machine_config (void); 24 | 25 | MONO_API void mono_config_cleanup (void); 26 | MONO_API void mono_config_parse (const char *filename); 27 | MONO_API MONO_RT_EXTERNAL_ONLY void mono_config_for_assembly (MonoImage *assembly); 28 | MONO_API void mono_config_parse_memory (const char *buffer); 29 | 30 | MONO_API const char* mono_config_string_for_assembly_file (const char *filename); 31 | 32 | MONO_API void mono_config_set_server_mode (mono_bool server_mode); 33 | MONO_API mono_bool mono_config_is_server_mode (void); 34 | 35 | MONO_END_DECLS 36 | 37 | #endif /* __MONO_METADATA_CONFIG_H__ */ 38 | 39 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-property-hash.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Hash table for (object, property) pairs 4 | * 5 | * Author: 6 | * Zoltan Varga (vargaz@gmail.com) 7 | * 8 | * (C) 2008 Novell, Inc 9 | */ 10 | 11 | /* 12 | * This is similar to the GLib hash table, but stores (object, property) pairs. It can 13 | * be used to store rarely used fields of runtime structures, decreasing memory usage. 14 | * The memory required to store one property is the size of one hash node, about 3 15 | * pointers. 16 | */ 17 | 18 | #ifndef _MONO_PROPERTY_HASH_H_ 19 | #define _MONO_PROPERTY_HASH_H_ 20 | 21 | #include 22 | #include 23 | 24 | typedef struct _MonoPropertyHash MonoPropertyHash; 25 | 26 | MONO_API MonoPropertyHash* mono_property_hash_new (void); 27 | 28 | MONO_API void mono_property_hash_destroy (MonoPropertyHash *hash); 29 | 30 | MONO_API void mono_property_hash_insert (MonoPropertyHash *hash, gpointer object, guint32 property, 31 | gpointer value); 32 | 33 | /* Remove all properties of OBJECT */ 34 | MONO_API void mono_property_hash_remove_object (MonoPropertyHash *hash, gpointer object); 35 | 36 | MONO_API gpointer mono_property_hash_lookup (MonoPropertyHash *hash, gpointer object, guint32 property); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-pkcs12.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-pkcs12.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 3/8/16. 6 | // Copyright © 2016 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_pkcs12__ 10 | #define __btls__btls_pkcs12__ 11 | 12 | #include 13 | #include "btls-ssl.h" 14 | #include "btls-x509.h" 15 | 16 | MONO_API MonoBtlsPkcs12 * 17 | mono_btls_pkcs12_new (void); 18 | 19 | MONO_API int 20 | mono_btls_pkcs12_get_count (MonoBtlsPkcs12 *pkcs12); 21 | 22 | MONO_API X509 * 23 | mono_btls_pkcs12_get_cert (MonoBtlsPkcs12 *pkcs12, int index); 24 | 25 | MONO_API STACK_OF(X509) * 26 | mono_btls_pkcs12_get_certs (MonoBtlsPkcs12 *pkcs12); 27 | 28 | MONO_API int 29 | mono_btls_pkcs12_free (MonoBtlsPkcs12 *pkcs12); 30 | 31 | MONO_API MonoBtlsPkcs12 * 32 | mono_btls_pkcs12_up_ref (MonoBtlsPkcs12 *pkcs12); 33 | 34 | MONO_API void 35 | mono_btls_pkcs12_add_cert (MonoBtlsPkcs12 *pkcs12, X509 *x509); 36 | 37 | MONO_API int 38 | mono_btls_pkcs12_import (MonoBtlsPkcs12 *pkcs12, const void *data, int len, const void *password); 39 | 40 | MONO_API int 41 | mono_btls_pkcs12_has_private_key (MonoBtlsPkcs12 *pkcs12); 42 | 43 | MONO_API EVP_PKEY * 44 | mono_btls_pkcs12_get_private_key (MonoBtlsPkcs12 *pkcs12); 45 | 46 | #endif /* __btls__btls_pkcs12__ */ 47 | -------------------------------------------------------------------------------- /headers/mono/mini/regalloc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | typedef size_t regmask_t; 6 | 7 | enum { 8 | MONO_REG_INT, 9 | MONO_REG_DOUBLE, 10 | /* This is used only for allocating spill slots with GC tracking */ 11 | MONO_REG_INT_REF, 12 | /* Ditto for managed pointers */ 13 | MONO_REG_INT_MP, 14 | MONO_REG_SIMD 15 | }; 16 | 17 | 18 | #ifdef MONO_ARCH_NEED_SIMD_BANK 19 | #define MONO_NUM_REGBANKS 5 20 | #else 21 | #define MONO_NUM_REGBANKS 4 22 | #endif 23 | 24 | typedef struct { 25 | /* symbolic registers */ 26 | int next_vreg; 27 | 28 | regmask_t ifree_mask; 29 | regmask_t free_mask [MONO_NUM_REGBANKS]; 30 | 31 | /* symbolic -> hard register assignment */ 32 | /* 33 | * If the register is spilled, then this contains -spill - 1, where 'spill' 34 | * is the index of the spill variable. 35 | */ 36 | gint32 *vassign; 37 | 38 | /* hard -> symbolic */ 39 | int isymbolic [MONO_MAX_IREGS]; 40 | int fsymbolic [MONO_MAX_FREGS]; 41 | #ifdef MONO_ARCH_NEED_SIMD_BANK 42 | int xsymbolic [MONO_MAX_XREGS]; 43 | #endif 44 | /* Points to the arrays above */ 45 | int *symbolic [MONO_NUM_REGBANKS]; 46 | 47 | int vassign_size; 48 | } MonoRegState; 49 | 50 | MonoRegState* mono_regstate_new (void); 51 | 52 | void mono_regstate_free (MonoRegState *rs); 53 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-threads-debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_UTILS_MONO_THREADS_DEBUG_H__ 6 | #define __MONO_UTILS_MONO_THREADS_DEBUG_H__ 7 | 8 | #include 9 | #include 10 | 11 | /* Logging - enable them below if you need specific logging for the category you need */ 12 | #define MOSTLY_ASYNC_SAFE_FPRINTF(handle, ...) do { \ 13 | g_async_safe_fprintf (handle, __VA_ARGS__); \ 14 | } while (0) 15 | 16 | #define MOSTLY_ASYNC_SAFE_PRINTF(...) MOSTLY_ASYNC_SAFE_FPRINTF(1, __VA_ARGS__); 17 | 18 | #if 1 19 | #define THREADS_DEBUG(...) 20 | #else 21 | #define THREADS_DEBUG MOSTLY_ASYNC_SAFE_PRINTF 22 | #endif 23 | 24 | #if 1 25 | #define THREADS_STW_DEBUG(...) 26 | #else 27 | #define THREADS_STW_DEBUG MOSTLY_ASYNC_SAFE_PRINTF 28 | #endif 29 | 30 | #if 1 31 | #define THREADS_SUSPEND_DEBUG(...) 32 | #else 33 | #define THREADS_SUSPEND_DEBUG MOSTLY_ASYNC_SAFE_PRINTF 34 | #endif 35 | 36 | #if 1 37 | #define THREADS_STATE_MACHINE_DEBUG(...) 38 | #else 39 | #define THREADS_STATE_MACHINE_DEBUG_ENABLED 40 | #define THREADS_STATE_MACHINE_DEBUG MOSTLY_ASYNC_SAFE_PRINTF 41 | #endif 42 | 43 | #if 1 44 | #define THREADS_INTERRUPT_DEBUG(...) 45 | #else 46 | #define THREADS_INTERRUPT_DEBUG MOSTLY_ASYNC_SAFE_PRINTF 47 | #endif 48 | 49 | #endif /* __MONO_UTILS_MONO_THREADS_DEBUG_H__ */ 50 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-poll.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef MONO_POLL_H 6 | #define MONO_POLL_H 7 | 8 | #include 9 | 10 | #include 11 | #ifdef HAVE_SYS_TIME_H 12 | #include 13 | #endif 14 | #include 15 | #ifdef HAVE_UNISTD_H 16 | #include 17 | #endif 18 | 19 | #ifdef HAVE_POLL 20 | #ifdef HAVE_POLL_H 21 | #include 22 | #elif defined(HAVE_SYS_POLL_H) 23 | #include 24 | #endif 25 | 26 | #define MONO_POLLIN POLLIN 27 | #define MONO_POLLPRI POLLPRI 28 | #define MONO_POLLOUT POLLOUT 29 | #define MONO_POLLERR POLLERR 30 | #define MONO_POLLHUP POLLHUP 31 | #define MONO_POLLNVAL POLLNVAL 32 | 33 | typedef struct pollfd mono_pollfd; 34 | 35 | #else 36 | 37 | #ifdef HOST_WIN32 38 | #include 39 | #endif 40 | #define MONO_POLLIN 1 41 | #define MONO_POLLPRI 2 42 | #define MONO_POLLOUT 4 43 | #define MONO_POLLERR 8 44 | #define MONO_POLLHUP 0x10 45 | #define MONO_POLLNVAL 0x20 46 | 47 | typedef struct { 48 | int fd; 49 | short events; 50 | short revents; 51 | } mono_pollfd; 52 | 53 | #endif 54 | 55 | int 56 | mono_poll_can_add (mono_pollfd *ufds, unsigned int nfds, int fd); 57 | 58 | MONO_API int mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout); 59 | 60 | #endif /* MONO_POLL_H */ 61 | 62 | -------------------------------------------------------------------------------- /headers/mono/utils/json.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * JSON writer 4 | * 5 | * Author: 6 | * Joao Matos (joao.matos@xamarin.com) 7 | * 8 | * Copyright 2015 Xamarin Inc (http://www.xamarin.com) 9 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 10 | */ 11 | 12 | #ifndef __MONO_UTILS_JSON_H__ 13 | #define __MONO_UTILS_JSON_H__ 14 | 15 | #include 16 | 17 | #define JSON_INDENT_VALUE 2 18 | 19 | typedef struct JsonWriter { 20 | GString* text; 21 | int indent; 22 | } JsonWriter; 23 | 24 | void mono_json_writer_init (JsonWriter* writer); 25 | void mono_json_writer_destroy (JsonWriter* writer); 26 | void mono_json_writer_indent(JsonWriter* writer); 27 | void mono_json_writer_indent_push(JsonWriter* writer); 28 | void mono_json_writer_indent_pop(JsonWriter* writer); 29 | void mono_json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args); 30 | void mono_json_writer_printf(JsonWriter* writer, const gchar *format, ...); 31 | void mono_json_writer_array_begin(JsonWriter* writer); 32 | void mono_json_writer_array_end(JsonWriter* writer); 33 | void mono_json_writer_object_begin(JsonWriter* writer); 34 | void mono_json_writer_object_end(JsonWriter* writer); 35 | void mono_json_writer_object_key(JsonWriter* writer, const gchar* format, ...); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /headers/mono/sgen/sgen-pointer-queue.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * A pointer queue that can be sorted. 4 | * 5 | * Copyright (C) 2014 Xamarin Inc 6 | * 7 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 8 | */ 9 | 10 | #ifndef __MONO_SGEN_POINTER_QUEUE_H__ 11 | #define __MONO_SGEN_POINTER_QUEUE_H__ 12 | 13 | #include 14 | 15 | typedef struct { 16 | void **data; 17 | size_t size; 18 | size_t next_slot; 19 | int mem_type; 20 | } SgenPointerQueue; 21 | 22 | #define SGEN_POINTER_QUEUE_INIT(mem_type) { NULL, 0, 0, (mem_type) } 23 | 24 | void sgen_pointer_queue_add (SgenPointerQueue *queue, void *ptr); 25 | void sgen_pointer_queue_clear (SgenPointerQueue *queue); 26 | void sgen_pointer_queue_remove_nulls (SgenPointerQueue *queue); 27 | void sgen_pointer_queue_sort_uniq (SgenPointerQueue *queue); 28 | size_t sgen_pointer_queue_search (SgenPointerQueue *queue, void *addr); 29 | size_t sgen_pointer_queue_find (SgenPointerQueue *queue, void *ptr); 30 | void sgen_pointer_queue_init (SgenPointerQueue *queue, int mem_type); 31 | void* sgen_pointer_queue_pop (SgenPointerQueue *queue); 32 | gboolean sgen_pointer_queue_is_empty (SgenPointerQueue *queue); 33 | void sgen_pointer_queue_free (SgenPointerQueue *queue); 34 | gboolean sgen_pointer_queue_will_grow (SgenPointerQueue *queue); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /headers/mono/eglib/gmodule.h: -------------------------------------------------------------------------------- 1 | #ifndef __GLIB_GMODULE_H 2 | #define __GLIB_GMODULE_H 3 | 4 | #include 5 | 6 | #define G_MODULE_IMPORT extern 7 | #ifdef G_OS_WIN32 8 | #define G_MODULE_EXPORT __declspec(dllexport) 9 | #else 10 | #define G_MODULE_EXPORT 11 | #endif 12 | 13 | G_BEGIN_DECLS 14 | 15 | /* 16 | * Modules 17 | */ 18 | typedef enum { 19 | G_MODULE_BIND_LAZY = 0x01, 20 | G_MODULE_BIND_LOCAL = 0x02, 21 | G_MODULE_BIND_MASK = 0x03 22 | } GModuleFlags; 23 | 24 | G_ENUM_FUNCTIONS (GModuleFlags) 25 | 26 | typedef struct _GModule GModule; 27 | 28 | G_EXTERN_C // Used by libtest, at least. 29 | GModule *g_module_open (const gchar *file, GModuleFlags flags); 30 | G_EXTERN_C // Used by libtest, at least. 31 | gboolean g_module_symbol (GModule *module, const gchar *symbol_name, 32 | gpointer *symbol); 33 | /* Caller must provide a suitable buffer. */ 34 | gboolean g_module_address (void *addr, char *file_name, size_t file_name_len, 35 | void **file_base, char *sym_name, 36 | size_t sym_name_len, void **sym_addr); 37 | const gchar *g_module_error (void); 38 | gboolean g_module_close (GModule *module); 39 | gchar * g_module_build_path (const gchar *directory, const gchar *module_name); 40 | 41 | extern char *gmodule_libprefix; 42 | extern char *gmodule_libsuffix; 43 | 44 | G_END_DECLS 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /headers/mono/metadata/wrapper-types.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * NOTE NOTE NOTE 4 | * No additional wrapper types should be added. 5 | * If a new wrapper is asolutely necessary, an existing one needs 6 | * to be removed first (with all the change that implies). 7 | */ 8 | WRAPPER(NONE, "none") 9 | WRAPPER(DELEGATE_INVOKE, "delegate-invoke") 10 | WRAPPER(DELEGATE_BEGIN_INVOKE, "delegate-begin-invoke") 11 | WRAPPER(DELEGATE_END_INVOKE, "delegate-end-invoke") 12 | WRAPPER(RUNTIME_INVOKE, "runtime-invoke") 13 | WRAPPER(NATIVE_TO_MANAGED, "native-to-managed") 14 | WRAPPER(MANAGED_TO_NATIVE, "managed-to-native") 15 | WRAPPER(MANAGED_TO_MANAGED, "managed-to-managed") 16 | WRAPPER(REMOTING_INVOKE, "remoting-invoke") 17 | WRAPPER(REMOTING_INVOKE_WITH_CHECK, "remoting-invoke-with-check") 18 | WRAPPER(XDOMAIN_INVOKE, "xdomain-invoke") 19 | WRAPPER(XDOMAIN_DISPATCH, "xdomain-dispatch") 20 | WRAPPER(LDFLD, "ldfld") 21 | WRAPPER(STFLD, "stfld") 22 | WRAPPER(SYNCHRONIZED, "synchronized") 23 | WRAPPER(DYNAMIC_METHOD, "dynamic-method") 24 | WRAPPER(CASTCLASS, "castclass") 25 | WRAPPER(PROXY_ISINST, "proxy_isinst") 26 | WRAPPER(STELEMREF, "stelemref") 27 | WRAPPER(UNBOX, "unbox") 28 | WRAPPER(LDFLDA, "ldflda") 29 | WRAPPER(WRITE_BARRIER, "write-barrier") 30 | WRAPPER(OTHER, "other") 31 | WRAPPER(COMINTEROP_INVOKE, "cominterop-invoke") 32 | WRAPPER(COMINTEROP, "cominterop") 33 | WRAPPER(ALLOC, "alloc") 34 | 35 | 36 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-mlist.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_METADATA_MONO_MLIST_H__ 6 | #define __MONO_METADATA_MONO_MLIST_H__ 7 | 8 | /* 9 | * mono-mlist.h: Managed object list implementation 10 | */ 11 | 12 | #include 13 | 14 | typedef struct _MonoMList MonoMList; 15 | MONO_API MONO_RT_EXTERNAL_ONLY 16 | MonoMList* mono_mlist_alloc (MonoObject *data); 17 | MONO_API MonoObject* mono_mlist_get_data (MonoMList* list); 18 | MONO_API void mono_mlist_set_data (MonoMList* list, MonoObject *data); 19 | MONO_API MonoMList* mono_mlist_set_next (MonoMList* list, MonoMList *next); 20 | MONO_API int mono_mlist_length (MonoMList* list); 21 | MONO_API MonoMList* mono_mlist_next (MonoMList* list); 22 | MONO_API MonoMList* mono_mlist_last (MonoMList* list); 23 | MONO_API MONO_RT_EXTERNAL_ONLY 24 | MonoMList* mono_mlist_prepend (MonoMList* list, MonoObject *data); 25 | MONO_API MONO_RT_EXTERNAL_ONLY 26 | MonoMList* mono_mlist_append (MonoMList* list, MonoObject *data); 27 | 28 | MonoMList* mono_mlist_prepend_checked (MonoMList* list, MonoObject *data, MonoError *error); 29 | MonoMList* mono_mlist_append_checked (MonoMList* list, MonoObject *data, MonoError *error); 30 | 31 | MONO_API MonoMList* mono_mlist_remove_item (MonoMList* list, MonoMList *item); 32 | 33 | #endif /* __MONO_METADATA_MONO_MLIST_H__ */ 34 | 35 | -------------------------------------------------------------------------------- /headers/mono/sgen/sgen-tagged-pointer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Macros for tagging and untagging pointers. 4 | * 5 | * Copyright (C) 2014 Xamarin Inc 6 | * 7 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 8 | */ 9 | 10 | #ifndef __MONO_SGEN_TAGGED_POINTER_H__ 11 | #define __MONO_SGEN_TAGGED_POINTER_H__ 12 | 13 | #define SGEN_TAGGED_POINTER_MASK 7 14 | 15 | #define SGEN_POINTER_IS_TAGGED_1(p) ((mword)(p) & 1) 16 | #define SGEN_POINTER_TAG_1(p) ((void*)((mword)(p) | 1)) 17 | #define SGEN_POINTER_UNTAG_1(p) ((void*)((mword)(p) & ~1)) 18 | 19 | #define SGEN_POINTER_IS_TAGGED_2(p) ((mword)(p) & 2) 20 | #define SGEN_POINTER_TAG_2(p) ((void*)((mword)(p) | 2)) 21 | #define SGEN_POINTER_UNTAG_2(p) ((void*)((mword)(p) & ~2)) 22 | 23 | #define SGEN_POINTER_TAG_12(p) ((mword)(p) & 3) 24 | #define SGEN_POINTER_SET_TAG_12(p,t) ((void*)(((mword)(p) & ~3) | (t))) 25 | 26 | #define SGEN_POINTER_IS_TAGGED_4(p) ((mword)(p) & 4) 27 | #define SGEN_POINTER_TAG_4(p) ((void*)((mword)(p) | 4)) 28 | #define SGEN_POINTER_UNTAG_4(p) ((void*)((mword)(p) & ~4)) 29 | 30 | #define SGEN_POINTER_UNTAG_12(p) ((void*)((mword)(p) & ~3)) 31 | #define SGEN_POINTER_UNTAG_24(p) ((void*)((mword)(p) & ~6)) 32 | 33 | #define SGEN_POINTER_IS_TAGGED_ANY(p) ((mword)(p) & SGEN_TAGGED_POINTER_MASK) 34 | #define SGEN_POINTER_UNTAG_ALL(p) ((void*)((mword)(p) & ~SGEN_TAGGED_POINTER_MASK)) 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-io-portability.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_IO_PORTABILITY_H 6 | #define __MONO_IO_PORTABILITY_H 7 | 8 | #include 9 | #include 10 | #include "config.h" 11 | 12 | enum { 13 | PORTABILITY_NONE = 0x00, 14 | PORTABILITY_UNKNOWN = 0x01, 15 | PORTABILITY_DRIVE = 0x02, 16 | PORTABILITY_CASE = 0x04 17 | }; 18 | 19 | #ifdef DISABLE_PORTABILITY 20 | 21 | #define mono_portability_helpers_init() 22 | #define mono_portability_find_file(pathname,last_exists) NULL 23 | 24 | #define IS_PORTABILITY_NONE FALSE 25 | #define IS_PORTABILITY_UNKNOWN FALSE 26 | #define IS_PORTABILITY_DRIVE FALSE 27 | #define IS_PORTABILITY_CASE FALSE 28 | #define IS_PORTABILITY_SET FALSE 29 | 30 | #else 31 | 32 | void mono_portability_helpers_init (void); 33 | gchar *mono_portability_find_file (const gchar *pathname, gboolean last_exists); 34 | 35 | extern int mono_io_portability_helpers; 36 | 37 | #define IS_PORTABILITY_NONE (mono_io_portability_helpers & PORTABILITY_NONE) 38 | #define IS_PORTABILITY_UNKNOWN (mono_io_portability_helpers & PORTABILITY_UNKNOWN) 39 | #define IS_PORTABILITY_DRIVE (mono_io_portability_helpers & PORTABILITY_DRIVE) 40 | #define IS_PORTABILITY_CASE (mono_io_portability_helpers & PORTABILITY_CASE) 41 | #define IS_PORTABILITY_SET (mono_io_portability_helpers > 0) 42 | 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-x509-store.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-x509-store.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 3/3/16. 6 | // Copyright © 2016 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_x509_store__ 10 | #define __btls__btls_x509_store__ 11 | 12 | #include 13 | #include "btls-ssl.h" 14 | 15 | MONO_API MonoBtlsX509Store * 16 | mono_btls_x509_store_new (void); 17 | 18 | MONO_API MonoBtlsX509Store * 19 | mono_btls_x509_store_from_store (X509_STORE *ctx); 20 | 21 | MONO_API MonoBtlsX509Store * 22 | mono_btls_x509_store_from_ctx (X509_STORE_CTX *ctx); 23 | 24 | MONO_API MonoBtlsX509Store * 25 | mono_btls_x509_store_from_ssl_ctx (MonoBtlsSslCtx *ctx); 26 | 27 | MONO_API MonoBtlsX509Store * 28 | mono_btls_x509_store_up_ref (MonoBtlsX509Store *store); 29 | 30 | MONO_API int 31 | mono_btls_x509_store_free (MonoBtlsX509Store *store); 32 | 33 | MONO_API X509_STORE * 34 | mono_btls_x509_store_peek_store (MonoBtlsX509Store *store); 35 | 36 | MONO_API int 37 | mono_btls_x509_store_add_cert (MonoBtlsX509Store *store, X509 *cert); 38 | 39 | MONO_API int 40 | mono_btls_x509_store_load_locations (MonoBtlsX509Store *store, const char *file, const char *path); 41 | 42 | MONO_API int 43 | mono_btls_x509_store_set_default_paths (MonoBtlsX509Store *store); 44 | 45 | MONO_API int 46 | mono_btls_x509_store_get_count (MonoBtlsX509Store *store); 47 | 48 | #endif /* defined(__btls__btls_x509_store__) */ 49 | 50 | -------------------------------------------------------------------------------- /headers/mono/utils/os-event.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_UTILS_OS_EVENT_H_ 6 | #define _MONO_UTILS_OS_EVENT_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | #include "mono-os-mutex.h" 13 | 14 | #define MONO_INFINITE_WAIT ((guint32) 0xFFFFFFFF) 15 | 16 | #define MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS 64 17 | 18 | typedef enum { 19 | MONO_OS_EVENT_WAIT_RET_SUCCESS_0 = 0, 20 | MONO_OS_EVENT_WAIT_RET_ALERTED = -1, 21 | MONO_OS_EVENT_WAIT_RET_TIMEOUT = -2, 22 | } MonoOSEventWaitRet; 23 | 24 | typedef struct _MonoOSEvent MonoOSEvent; 25 | 26 | typedef void (*MonoOSEventFreeCb) (MonoOSEvent*); 27 | 28 | struct _MonoOSEvent { 29 | #ifdef HOST_WIN32 30 | gpointer handle; 31 | #else 32 | GPtrArray *conds; 33 | gboolean signalled; 34 | #endif 35 | }; 36 | 37 | MONO_API void 38 | mono_os_event_init (MonoOSEvent *event, gboolean initial); 39 | 40 | MONO_API void 41 | mono_os_event_destroy (MonoOSEvent *event); 42 | 43 | MONO_API void 44 | mono_os_event_set (MonoOSEvent *event); 45 | 46 | MONO_API void 47 | mono_os_event_reset (MonoOSEvent *event); 48 | 49 | MONO_API MonoOSEventWaitRet 50 | mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout, gboolean alertable); 51 | 52 | MONO_API MonoOSEventWaitRet 53 | mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout, gboolean alertable); 54 | 55 | #endif /* _MONO_UTILS_OS_EVENT_H_ */ 56 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-conc-hashtable.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * A mostly concurrent hashtable 4 | * 5 | * Author: 6 | * Rodrigo Kumpera (kumpera@gmail.com) 7 | * 8 | * (C) 2014 Xamarin 9 | */ 10 | 11 | #ifndef __MONO_CONCURRENT_HASHTABLE_H__ 12 | #define __MONO_CONCURRENT_HASHTABLE_H__ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | typedef struct _MonoConcurrentHashTable MonoConcurrentHashTable; 20 | 21 | MONO_API MonoConcurrentHashTable* mono_conc_hashtable_new (GHashFunc hash_func, GEqualFunc key_equal_func); 22 | MONO_API MonoConcurrentHashTable* mono_conc_hashtable_new_full (GHashFunc hash_func, GEqualFunc key_equal_func, GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func); 23 | MONO_API void mono_conc_hashtable_destroy (MonoConcurrentHashTable *hash_table); 24 | MONO_API gpointer mono_conc_hashtable_lookup (MonoConcurrentHashTable *hash_table, gpointer key); 25 | MONO_API gpointer mono_conc_hashtable_insert (MonoConcurrentHashTable *hash_table, gpointer key, gpointer value); 26 | MONO_API gpointer mono_conc_hashtable_remove (MonoConcurrentHashTable *hash_table, gpointer key); 27 | MONO_API void mono_conc_hashtable_foreach (MonoConcurrentHashTable *hashtable, GHFunc func, gpointer userdata); 28 | MONO_API void mono_conc_hashtable_foreach_steal (MonoConcurrentHashTable *hashtable, GHRFunc func, gpointer userdata); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-x509-crl.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-x509-crl.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 3/23/16. 6 | // Copyright © 2016 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_x509_crl__ 10 | #define __btls__btls_x509_crl__ 11 | 12 | #include 13 | #include "btls-ssl.h" 14 | #include "btls-x509.h" 15 | 16 | MONO_API MonoBtlsX509Crl * 17 | mono_btls_x509_crl_from_data (const void *buf, int len, MonoBtlsX509Format format); 18 | 19 | MONO_API MonoBtlsX509Crl * 20 | mono_btls_x509_crl_ref (MonoBtlsX509Crl *crl); 21 | 22 | MONO_API int 23 | mono_btls_x509_crl_free (MonoBtlsX509Crl *crl); 24 | 25 | MONO_API MonoBtlsX509Revoked * 26 | mono_btls_x509_crl_get_by_cert (MonoBtlsX509Crl *crl, X509 *x509); 27 | 28 | MONO_API MonoBtlsX509Revoked * 29 | mono_btls_x509_crl_get_by_serial (MonoBtlsX509Crl *crl, void *serial, int len); 30 | 31 | MONO_API int 32 | mono_btls_x509_crl_get_revoked_count (MonoBtlsX509Crl *crl); 33 | 34 | MONO_API MonoBtlsX509Revoked * 35 | mono_btls_x509_crl_get_revoked (MonoBtlsX509Crl *crl, int index); 36 | 37 | MONO_API int64_t 38 | mono_btls_x509_crl_get_last_update (MonoBtlsX509Crl *crl); 39 | 40 | MONO_API int64_t 41 | mono_btls_x509_crl_get_next_update (MonoBtlsX509Crl *crl); 42 | 43 | MONO_API int64_t 44 | mono_btls_x509_crl_get_version (MonoBtlsX509Crl *crl); 45 | 46 | MONO_API MonoBtlsX509Name * 47 | mono_btls_x509_crl_get_issuer (MonoBtlsX509Crl *crl); 48 | 49 | #endif /* __btls__btls_x509_crl__ */ 50 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-dl-fallback.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_UTILS_DL_FALLBACK_H__ 6 | #define __MONO_UTILS_DL_FALLBACK_H__ 7 | 8 | #include 9 | 10 | MONO_BEGIN_DECLS 11 | 12 | enum { 13 | MONO_DL_EAGER = 0, 14 | MONO_DL_LAZY = 1, 15 | // If MONO_DL_LOCAL is set, it will trump MONO_DL_GLOBAL. 16 | MONO_DL_LOCAL = 2, 17 | // MONO_DL_MASK is unused internally and no longer a full mask on netcore, given the introduction of MONO_DL_GLOBAL. Avoid. 18 | MONO_DL_MASK = 3, 19 | // Only applicable when building Mono in netcore mode. 20 | MONO_DL_GLOBAL = 4 21 | }; 22 | 23 | /* 24 | * This is the dynamic loader fallback API 25 | */ 26 | typedef struct MonoDlFallbackHandler MonoDlFallbackHandler; 27 | 28 | /* 29 | * The "err" variable contents must be allocated using g_malloc or g_strdup 30 | */ 31 | typedef void* (*MonoDlFallbackLoad) (const char *name, int flags, char **err, void *user_data); 32 | typedef void* (*MonoDlFallbackSymbol) (void *handle, const char *name, char **err, void *user_data); 33 | typedef void* (*MonoDlFallbackClose) (void *handle, void *user_data); 34 | 35 | MONO_API MonoDlFallbackHandler *mono_dl_fallback_register (MonoDlFallbackLoad load_func, MonoDlFallbackSymbol symbol_func, 36 | MonoDlFallbackClose close_func, void *user_data); 37 | 38 | MONO_API void mono_dl_fallback_unregister (MonoDlFallbackHandler *handler); 39 | 40 | MONO_END_DECLS 41 | 42 | #endif /* __MONO_UTILS_DL_FALLBACK_H__ */ 43 | 44 | -------------------------------------------------------------------------------- /headers/mono/metadata/debug-mono-ppdb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Support for the portable PDB symbol file format 4 | * 5 | * 6 | * Author: 7 | * Mono Project (http://www.mono-project.com) 8 | * 9 | * Copyright 2015 Xamarin Inc (http://www.xamarin.com) 10 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 11 | */ 12 | 13 | #ifndef __MONO_METADATA_DEBUG_MONO_PPDB_H__ 14 | #define __MONO_METADATA_DEBUG_MONO_PPDB_H__ 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | MonoPPDBFile* 21 | mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size); 22 | 23 | void 24 | mono_ppdb_close (MonoDebugHandle *handle); 25 | 26 | MonoDebugMethodInfo * 27 | mono_ppdb_lookup_method (MonoDebugHandle *handle, MonoMethod *method); 28 | 29 | MonoDebugSourceLocation * 30 | mono_ppdb_lookup_location (MonoDebugMethodInfo *minfo, uint32_t offset); 31 | 32 | void 33 | mono_ppdb_get_seq_points (MonoDebugMethodInfo *minfo, char **source_file, GPtrArray **source_file_list, int **source_files, MonoSymSeqPoint **seq_points, int *n_seq_points); 34 | 35 | MonoDebugLocalsInfo* 36 | mono_ppdb_lookup_locals (MonoDebugMethodInfo *minfo); 37 | 38 | MonoDebugMethodAsyncInfo* 39 | mono_ppdb_lookup_method_async_debug_info (MonoDebugMethodInfo *minfo); 40 | 41 | MonoImage * 42 | mono_ppdb_get_image (MonoPPDBFile *ppdb); 43 | 44 | char * 45 | mono_ppdb_get_sourcelink (MonoDebugHandle *handle); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /headers/mono/mini/dwarfwriter.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Creation of DWARF debug information 4 | * 5 | * Author: 6 | * Zoltan Varga (vargaz@gmail.com) 7 | * 8 | * (C) 2008-2009 Novell, Inc. 9 | */ 10 | 11 | #ifndef __MONO_DWARF_WRITER_H__ 12 | #define __MONO_DWARF_WRITER_H__ 13 | 14 | #include "config.h" 15 | #include "image-writer.h" 16 | #include "mini.h" 17 | 18 | #include 19 | 20 | #include 21 | 22 | typedef struct _MonoDwarfWriter MonoDwarfWriter; 23 | 24 | MonoDwarfWriter* mono_dwarf_writer_create (MonoImageWriter *writer, FILE *il_file, int il_file_start_line, gboolean emit_line_numbers); 25 | 26 | void mono_dwarf_writer_destroy (MonoDwarfWriter *w); 27 | 28 | void mono_dwarf_writer_emit_base_info (MonoDwarfWriter *w, const char *cu_name, GSList *base_unwind_program); 29 | 30 | void mono_dwarf_writer_close (MonoDwarfWriter *w); 31 | 32 | int mono_dwarf_writer_get_il_file_line_index (MonoDwarfWriter *w); 33 | 34 | void mono_dwarf_writer_emit_trampoline (MonoDwarfWriter *w, const char *tramp_name, char *start_symbol, char *end_symbol, guint8 *code, guint32 code_size, GSList *unwind_info); 35 | 36 | void 37 | mono_dwarf_writer_emit_method (MonoDwarfWriter *w, MonoCompile *cfg, MonoMethod *method, char *start_symbol, char *end_symbol, char *linkage_name, 38 | guint8 *code, guint32 code_size, MonoInst **args, MonoInst **locals, GSList *unwind_info, MonoDebugMethodJitInfo *debug_info); 39 | 40 | char * 41 | mono_dwarf_escape_path (const char *name); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /headers/mono/mini/llvm-jit.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * LLVM backend 4 | * 5 | * Authors: 6 | * Zoltan Varga (vargaz@gmail.com) 7 | * 8 | * (C) 2009 Novell, Inc. 9 | */ 10 | 11 | #ifndef __MONO_LLVM_JIT_H__ 12 | #define __MONO_LLVM_JIT_H__ 13 | 14 | #include 15 | 16 | #include "llvm-c/Core.h" 17 | #include "llvm-c/ExecutionEngine.h" 18 | 19 | #include "mini.h" 20 | 21 | #ifdef HAVE_UNWIND_H 22 | #include 23 | #endif 24 | 25 | /* These can't go into mini-.h since thats not included into llvm-jit.cpp */ 26 | #if defined(TARGET_OSX) || defined(__linux__) 27 | #if defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_X86) 28 | #define MONO_ARCH_LLVM_JIT_SUPPORTED 1 29 | #endif 30 | #endif 31 | 32 | G_BEGIN_DECLS 33 | 34 | typedef unsigned char * (AllocCodeMemoryCb) (LLVMValueRef function, int size); 35 | typedef void (FunctionEmittedCb) (LLVMValueRef function, void *start, void *end); 36 | typedef void (ExceptionTableCb) (void *data); 37 | 38 | typedef void* MonoEERef; 39 | 40 | MonoEERef 41 | mono_llvm_create_ee (AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, LLVMExecutionEngineRef *ee); 42 | 43 | void 44 | mono_llvm_dispose_ee (MonoEERef *mono_ee); 45 | 46 | gpointer 47 | mono_llvm_compile_method (MonoEERef mono_ee, LLVMValueRef method, int nvars, LLVMValueRef *callee_vars, gpointer *callee_addrs, gpointer *eh_frame); 48 | 49 | void 50 | mono_llvm_set_unhandled_exception_handler (void); 51 | 52 | G_END_DECLS 53 | 54 | #endif /* __MONO_LLVM_JIT_H__ */ 55 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-coop-semaphore.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_COOP_SEMAPHORE_H__ 6 | #define __MONO_COOP_SEMAPHORE_H__ 7 | 8 | #include 9 | #include 10 | 11 | #include "mono-os-semaphore.h" 12 | #include "mono-threads-api.h" 13 | 14 | /* We put the OS sync primitives in struct, so the compiler will warn us if 15 | * we use mono_os_(mutex|cond|sem)_... on MonoCoop(Mutex|Cond|Sem) structures */ 16 | 17 | typedef struct _MonoCoopSem MonoCoopSem; 18 | struct _MonoCoopSem { 19 | MonoSemType s; 20 | }; 21 | 22 | static inline void 23 | mono_coop_sem_init (MonoCoopSem *sem, int value) 24 | { 25 | mono_os_sem_init (&sem->s, value); 26 | } 27 | 28 | static inline void 29 | mono_coop_sem_destroy (MonoCoopSem *sem) 30 | { 31 | mono_os_sem_destroy (&sem->s); 32 | } 33 | 34 | static inline gint 35 | mono_coop_sem_wait (MonoCoopSem *sem, MonoSemFlags flags) 36 | { 37 | gint res; 38 | 39 | MONO_ENTER_GC_SAFE; 40 | 41 | res = mono_os_sem_wait (&sem->s, flags); 42 | 43 | MONO_EXIT_GC_SAFE; 44 | 45 | return res; 46 | } 47 | 48 | static inline MonoSemTimedwaitRet 49 | mono_coop_sem_timedwait (MonoCoopSem *sem, guint timeout_ms, MonoSemFlags flags) 50 | { 51 | MonoSemTimedwaitRet res; 52 | 53 | MONO_ENTER_GC_SAFE; 54 | 55 | res = mono_os_sem_timedwait (&sem->s, timeout_ms, flags); 56 | 57 | MONO_EXIT_GC_SAFE; 58 | 59 | return res; 60 | } 61 | 62 | static inline void 63 | mono_coop_sem_post (MonoCoopSem *sem) 64 | { 65 | mono_os_sem_post (&sem->s); 66 | } 67 | 68 | #endif /* __MONO_COOP_SEMAPHORE_H__ */ 69 | -------------------------------------------------------------------------------- /VMLVita2D/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | extern void** mono_aot_module_Vita2D_info; 9 | 10 | int _vita2d_init() 11 | { 12 | vita2d_init_param iparam; 13 | 14 | memset(&iparam, 0, sizeof(vita2d_init_param)); 15 | 16 | return vita2d_init(&iparam); 17 | } 18 | 19 | int _vita2d_pgf_draw_text(vita2d_pgf *font, int x, int y, unsigned int color, float scale, MonoString *text) 20 | { 21 | return vita2d_pgf_draw_text(font, x, y, color, scale, mono_string_to_utf8(text)); 22 | } 23 | 24 | __declspec (dllexport) void VMLVita2DRegister() 25 | { 26 | mono_aot_register_module(mono_aot_module_Vita2D_info); 27 | 28 | //General 29 | mono_add_internal_call("Vita2D::Init", _vita2d_init); 30 | mono_add_internal_call("Vita2D::SetClearColor", vita2d_set_clear_color); 31 | 32 | //PGF 33 | mono_add_internal_call("Vita2D::LoadDefaultPGF", vita2d_load_default_pgf); 34 | 35 | //Draw 36 | mono_add_internal_call("Vita2D::StartDrawing", vita2d_start_drawing); 37 | mono_add_internal_call("Vita2D::EndDrawing", vita2d_end_drawing); 38 | mono_add_internal_call("Vita2D::SwapBuffers", vita2d_end_shfb); 39 | mono_add_internal_call("Vita2D::ClearScreen", vita2d_clear_screen); 40 | mono_add_internal_call("Vita2D::DrawRectangle", vita2d_draw_rectangle); 41 | mono_add_internal_call("Vita2D::DrawLine", vita2d_draw_line); 42 | mono_add_internal_call("Vita2D::FillCircle", vita2d_draw_fill_circle); 43 | mono_add_internal_call("Vita2D::PGFDrawText", _vita2d_pgf_draw_text); 44 | } 45 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-endian.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_ENDIAN_H_ 6 | #define _MONO_METADATA_ENDIAN_H_ 1 7 | 8 | #include 9 | 10 | typedef union { 11 | guint32 ival; 12 | float fval; 13 | } mono_rfloat; 14 | 15 | typedef union { 16 | guint64 ival; 17 | double fval; 18 | unsigned char cval [8]; 19 | } mono_rdouble; 20 | 21 | #if defined(__s390x__) 22 | 23 | #define read16(x) __builtin_bswap16(*((guint16 *)(x))) 24 | #define read32(x) __builtin_bswap32(*((guint32 *)(x))) 25 | #define read64(x) __builtin_bswap64(*((guint64 *)(x))) 26 | 27 | #else 28 | 29 | # if NO_UNALIGNED_ACCESS 30 | 31 | guint16 mono_read16 (const unsigned char *x); 32 | guint32 mono_read32 (const unsigned char *x); 33 | guint64 mono_read64 (const unsigned char *x); 34 | 35 | #define read16(x) (mono_read16 ((const unsigned char *)(x))) 36 | #define read32(x) (mono_read32 ((const unsigned char *)(x))) 37 | #define read64(x) (mono_read64 ((const unsigned char *)(x))) 38 | 39 | # else 40 | 41 | #define read16(x) GUINT16_FROM_LE (*((const guint16 *) (x))) 42 | #define read32(x) GUINT32_FROM_LE (*((const guint32 *) (x))) 43 | #define read64(x) GUINT64_FROM_LE (*((const guint64 *) (x))) 44 | 45 | # endif 46 | 47 | #endif 48 | 49 | #define readr4(x,dest) \ 50 | do { \ 51 | mono_rfloat mf; \ 52 | mf.ival = read32 ((x)); \ 53 | *(dest) = mf.fval; \ 54 | } while (0) 55 | 56 | #define readr8(x,dest) \ 57 | do { \ 58 | mono_rdouble mf; \ 59 | mf.ival = read64 ((x)); \ 60 | *(dest) = mf.fval; \ 61 | } while (0) 62 | 63 | #endif /* _MONO_METADATA_ENDIAN_H_ */ 64 | -------------------------------------------------------------------------------- /headers/mono/metadata/coree.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * mscoree.dll functions 4 | * 5 | * Author: 6 | * Kornel Pal 7 | * 8 | * Copyright (C) 2008 Kornel Pal 9 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 10 | */ 11 | 12 | #ifndef __MONO_COREE_H__ 13 | #define __MONO_COREE_H__ 14 | 15 | #include 16 | #include 17 | 18 | #ifdef HOST_WIN32 19 | 20 | #include 21 | #include 22 | #include "image.h" 23 | #include "image-internals.h" 24 | 25 | #define STATUS_SUCCESS 0x00000000L 26 | #define STATUS_INVALID_IMAGE_FORMAT 0xC000007BL 27 | 28 | MONO_API HRESULT STDAPICALLTYPE MonoFixupCorEE(HMODULE ModuleHandle); 29 | 30 | /* Defined by the linker. */ 31 | #ifndef _MSC_VER 32 | #ifdef __MINGW64_VERSION_MAJOR 33 | #define __ImageBase __MINGW_LSYMBOL(_image_base__) 34 | #else 35 | #define __ImageBase _image_base__ 36 | #endif 37 | #endif 38 | G_BEGIN_DECLS extern IMAGE_DOS_HEADER __ImageBase; G_END_DECLS 39 | extern HMODULE coree_module_handle; 40 | 41 | HMODULE WINAPI MonoLoadImage(LPCWSTR FileName); 42 | STDAPI MonoFixupExe(HMODULE ModuleHandle); 43 | 44 | gchar* mono_get_module_file_name (HMODULE module_handle); 45 | void mono_load_coree (const char* file_name); 46 | void mono_fixup_exe_image (MonoImage* image); 47 | 48 | /* Declared in image.c. */ 49 | MonoImage* mono_image_open_from_module_handle (MonoAssemblyLoadContext *alc, HMODULE module_handle, char* fname, gboolean has_entry_point, MonoImageOpenStatus* status); 50 | 51 | #endif /* HOST_WIN32 */ 52 | 53 | #endif /* __MONO_COREE_H__ */ 54 | -------------------------------------------------------------------------------- /headers/mono/metadata/tokentype.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_TOKENTYPE_H_ 6 | #define _MONO_METADATA_TOKENTYPE_H_ 7 | 8 | /* 9 | * These tokens match the table ID except for the last 10 | * three (string, name and base type which are special) 11 | */ 12 | 13 | typedef enum { 14 | MONO_TOKEN_MODULE = 0x00000000, 15 | MONO_TOKEN_TYPE_REF = 0x01000000, 16 | MONO_TOKEN_TYPE_DEF = 0x02000000, 17 | MONO_TOKEN_FIELD_DEF = 0x04000000, 18 | MONO_TOKEN_METHOD_DEF = 0x06000000, 19 | MONO_TOKEN_PARAM_DEF = 0x08000000, 20 | MONO_TOKEN_INTERFACE_IMPL = 0x09000000, 21 | MONO_TOKEN_MEMBER_REF = 0x0a000000, 22 | MONO_TOKEN_CUSTOM_ATTRIBUTE = 0x0c000000, 23 | MONO_TOKEN_PERMISSION = 0x0e000000, 24 | MONO_TOKEN_SIGNATURE = 0x11000000, 25 | MONO_TOKEN_EVENT = 0x14000000, 26 | MONO_TOKEN_PROPERTY = 0x17000000, 27 | MONO_TOKEN_MODULE_REF = 0x1a000000, 28 | MONO_TOKEN_TYPE_SPEC = 0x1b000000, 29 | MONO_TOKEN_ASSEMBLY = 0x20000000, 30 | MONO_TOKEN_ASSEMBLY_REF = 0x23000000, 31 | MONO_TOKEN_FILE = 0x26000000, 32 | MONO_TOKEN_EXPORTED_TYPE = 0x27000000, 33 | MONO_TOKEN_MANIFEST_RESOURCE = 0x28000000, 34 | MONO_TOKEN_GENERIC_PARAM = 0x2a000000, 35 | MONO_TOKEN_METHOD_SPEC = 0x2b000000, 36 | 37 | /* 38 | * These do not match metadata tables directly 39 | */ 40 | MONO_TOKEN_STRING = 0x70000000, 41 | MONO_TOKEN_NAME = 0x71000000, 42 | MONO_TOKEN_BASE_TYPE = 0x72000000 43 | } MonoTokenType; 44 | 45 | #endif /* _MONO_METADATA_TOKENTYPE_H_ */ 46 | -------------------------------------------------------------------------------- /headers/mono/metadata/cominterop-win32-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METADATA_COMINTEROP_WIN32_INTERNALS_H__ 7 | #define __MONO_METADATA_COMINTEROP_WIN32_INTERNALS_H__ 8 | 9 | #include 10 | #include 11 | 12 | // On some Windows platforms the implementation of below methods are hosted 13 | // in separate source files like cominterop-win32-*.c. On other platforms, 14 | // the implementation is kept in cominterop.c and declared as static and in some 15 | // cases even inline. 16 | #if defined(HOST_WIN32) && !G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) 17 | 18 | guint32 19 | mono_marshal_win_safearray_get_dim (gpointer safearray); 20 | 21 | int 22 | mono_marshal_win_safe_array_get_lbound (gpointer psa, guint nDim, glong* plLbound); 23 | 24 | int 25 | mono_marshal_win_safe_array_get_ubound (gpointer psa, guint nDim, glong* plUbound); 26 | 27 | int 28 | mono_marshal_win_safearray_get_value (gpointer safearray, gpointer indices, gpointer *result); 29 | 30 | void 31 | mono_marshal_win_safearray_end (gpointer safearray, gpointer indices); 32 | 33 | gboolean 34 | mono_marshal_win_safearray_create_internal (UINT cDims, SAFEARRAYBOUND *rgsabound, gpointer *newsafearray); 35 | 36 | int 37 | mono_marshal_win_safearray_set_value (gpointer safearray, gpointer indices, gpointer value); 38 | 39 | #endif /* HOST_WIN32 && !G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */ 40 | 41 | #endif /* __MONO_METADATA_COMINTEROP_WIN32_INTERNALS_H__ */ 42 | -------------------------------------------------------------------------------- /headers/mono/utils/mach-support.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_MACH_SUPPORT_H__ 6 | #define __MONO_MACH_SUPPORT_H__ 7 | 8 | #include "config.h" 9 | #if defined(__MACH__) 10 | #include 11 | #include 12 | #include "mono/utils/mono-compiler.h" 13 | #include "mono/utils/mono-context.h" 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #define MONO_MACH_ARCH_SUPPORTED 1 21 | #if defined(__arm__) 22 | typedef _STRUCT_MCONTEXT *mcontext_t; 23 | #elif defined(__aarch64__) 24 | typedef _STRUCT_MCONTEXT64 *mcontext_t; 25 | #endif 26 | 27 | int mono_mach_arch_get_mcontext_size (void); 28 | void mono_mach_arch_thread_states_to_mcontext (thread_state_t state, thread_state_t fpstate, void *context); 29 | void mono_mach_arch_mcontext_to_thread_states (void *context, thread_state_t state, thread_state_t fpstate); 30 | void mono_mach_arch_thread_states_to_mono_context (thread_state_t state, thread_state_t fpstate, MonoContext *context); 31 | 32 | /* FIXME: Should return size_t, not int. */ 33 | int mono_mach_arch_get_thread_state_size (void); 34 | int mono_mach_arch_get_thread_fpstate_size (void); 35 | kern_return_t mono_mach_arch_get_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count, thread_state_t fpstate, mach_msg_type_number_t *fpcount); 36 | kern_return_t mono_mach_arch_set_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count, thread_state_t fpstate, mach_msg_type_number_t fpcount); 37 | 38 | #endif 39 | #endif /* __MONO_MACH_SUPPORT_H__ */ 40 | -------------------------------------------------------------------------------- /headers/mono/mini/mini-amd64-gsharedvt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * libcorkscrew-based native unwinder 4 | * 5 | * Authors: 6 | * Zoltan Varga 7 | * Rodrigo Kumpera 8 | * Andi McClure 9 | * Johan Lorensson 10 | * 11 | * Copyright 2015 Xamarin, Inc (http://www.xamarin.com) 12 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 13 | */ 14 | #ifndef MINI_AMD64_GSHAREDVT_H 15 | #define MINI_AMD64_GSHAREDVT_H 16 | 17 | typedef enum { 18 | GSHAREDVT_ARG_NONE = 0, 19 | GSHAREDVT_ARG_BYVAL_TO_BYREF, 20 | GSHAREDVT_ARG_BYREF_TO_BYVAL, 21 | GSHAREDVT_ARG_BYREF_TO_BYVAL_I1, 22 | GSHAREDVT_ARG_BYREF_TO_BYVAL_U1, 23 | GSHAREDVT_ARG_BYREF_TO_BYVAL_I2, 24 | GSHAREDVT_ARG_BYREF_TO_BYVAL_U2, 25 | GSHAREDVT_ARG_BYREF_TO_BYVAL_I4, 26 | GSHAREDVT_ARG_BYREF_TO_BYVAL_U4 27 | } GSharedVtArgMarshal; 28 | 29 | typedef enum { 30 | GSHAREDVT_RET_NONE = 0, 31 | GSHAREDVT_RET_I1, // 1 byte integer 32 | GSHAREDVT_RET_U1, // 1 byte unsigned 33 | GSHAREDVT_RET_I2, // 2 byte integer 34 | GSHAREDVT_RET_U2, // 2 byte unsigned 35 | GSHAREDVT_RET_I4, // 4 byte integer 36 | GSHAREDVT_RET_U4, // 4 byte unsigned 37 | GSHAREDVT_RET_I8, // 8 byte integer 38 | GSHAREDVT_RET_IREGS_1, // Load in first return register 39 | GSHAREDVT_RET_R8, // Double 40 | GSHAREDVT_RET_NUM, 41 | } GSharedVtRetMarshal; 42 | 43 | #ifdef DEBUG_AMD64_GSHAREDVT 44 | #define DEBUG_AMD64_GSHAREDVT_PRINT printf 45 | #else 46 | #define DEBUG_AMD64_GSHAREDVT_PRINT(...) 47 | #endif 48 | 49 | #endif /* MINI_AMD64_GSHAREDVT_H */ 50 | -------------------------------------------------------------------------------- /headers/mono/sgen/sgen-archdep.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Architecture dependent parts of SGen. 4 | * 5 | * Copyright 2001-2003 Ximian, Inc 6 | * Copyright 2003-2010 Novell, Inc. 7 | * Copyright (C) 2012 Xamarin Inc 8 | * 9 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 10 | */ 11 | #ifndef __MONO_SGENARCHDEP_H__ 12 | #define __MONO_SGENARCHDEP_H__ 13 | 14 | #include 15 | 16 | #if defined(MONO_CROSS_COMPILE) 17 | 18 | #define REDZONE_SIZE 0 19 | 20 | #elif defined(TARGET_X86) 21 | 22 | #define REDZONE_SIZE 0 23 | 24 | #ifndef MONO_ARCH_HAS_MONO_CONTEXT 25 | #error 0 26 | #endif 27 | 28 | #elif defined(TARGET_AMD64) 29 | 30 | #ifdef HOST_WIN32 31 | /* The Windows x64 ABI defines no "red zone". The ABI states: 32 | "All memory beyond the current address of RSP is considered volatile" */ 33 | #define REDZONE_SIZE 0 34 | #else 35 | #define REDZONE_SIZE 128 36 | #endif 37 | 38 | #elif defined(TARGET_POWERPC) 39 | 40 | #define REDZONE_SIZE 224 41 | 42 | #elif defined(TARGET_ARM) 43 | 44 | #define REDZONE_SIZE 0 45 | 46 | #elif defined(TARGET_ARM64) 47 | 48 | #if defined(__APPLE__) 49 | #define REDZONE_SIZE 128 50 | #else 51 | #define REDZONE_SIZE 0 52 | #endif 53 | 54 | #elif defined(__mips__) 55 | 56 | #define REDZONE_SIZE 0 57 | 58 | #elif defined(__s390x__) 59 | 60 | #define REDZONE_SIZE 0 61 | 62 | #elif defined(__sparc__) 63 | 64 | #define REDZONE_SIZE 0 65 | 66 | #elif defined (TARGET_RISCV) 67 | 68 | #define REDZONE_SIZE (0) 69 | 70 | #elif defined (TARGET_WASM) 71 | 72 | #define REDZONE_SIZE 0 73 | 74 | #endif 75 | 76 | #endif /* __MONO_SGENARCHDEP_H__ */ 77 | -------------------------------------------------------------------------------- /headers/mono/metadata/method-builder.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Functions for creating IL methods at runtime. 4 | * 5 | * Author: 6 | * Paolo Molaro (lupus@ximian.com) 7 | * 8 | * (C) 2002 Ximian, Inc. http://www.ximian.com 9 | * 10 | */ 11 | 12 | #ifndef __MONO_METHOD_BUILDER_H__ 13 | #define __MONO_METHOD_BUILDER_H__ 14 | 15 | #include "config.h" 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | typedef struct _MonoMethodBuilder MonoMethodBuilder; 23 | 24 | #define MONO_METHOD_BUILDER_CALLBACKS_VERSION 1 25 | 26 | typedef struct { 27 | int version; 28 | MonoMethodBuilder* (*new_base) (MonoClass *klass, MonoWrapperType type); 29 | void (*free) (MonoMethodBuilder *mb); 30 | MonoMethod* (*create_method) (MonoMethodBuilder *mb, MonoMethodSignature *signature, int max_stack); 31 | } MonoMethodBuilderCallbacks; 32 | 33 | MonoMethodBuilder * 34 | mono_mb_new (MonoClass *klass, const char *name, MonoWrapperType type); 35 | 36 | MonoMethodBuilder * 37 | mono_mb_new_no_dup_name (MonoClass *klass, const char *name, MonoWrapperType type); 38 | 39 | void 40 | mono_mb_free (MonoMethodBuilder *mb); 41 | 42 | MonoMethod * 43 | mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, int max_stack); 44 | 45 | guint32 46 | mono_mb_add_data (MonoMethodBuilder *mb, gpointer data); 47 | 48 | char* 49 | mono_mb_strdup (MonoMethodBuilder *mb, const char *s); 50 | 51 | void 52 | mono_install_method_builder_callbacks (MonoMethodBuilderCallbacks *cb); 53 | 54 | #endif /* __MONO_METHOD_BUILDER_H__ */ 55 | -------------------------------------------------------------------------------- /headers/mono/mini/cfgdump.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright (C) 2016 Xamarin Inc 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | 7 | #ifndef __MINI_CFGDUMP_H__ 8 | #define __MINI_CFGDUMP_H__ 9 | #include 10 | 11 | #define CONSTANT_POOL_MAX_SIZE 8000 12 | 13 | #define BEGIN_GROUP 0x00 14 | #define BEGIN_GRAPH 0x01 15 | #define CLOSE_GROUP 0x02 16 | 17 | #define POOL_NEW 0x00 18 | #define POOL_STRING 0x01 19 | #define POOL_ENUM 0x02 20 | #define POOL_KLASS 0x03 21 | #define POOL_METHOD 0x04 22 | #define POOL_NULL 0x05 23 | #define POOL_NODE_CLASS 0x06 24 | #define POOL_FIELD 0x07 25 | #define POOL_SIGNATURE 0x08 26 | 27 | #define PROPERTY_POOL 0x00 28 | #define PROPERTY_INT 0x01 29 | #define PROPERTY_LONG 0x02 30 | #define PROPERTY_DOUBLE 0x03 31 | #define PROPERTY_FLOAT 0x04 32 | #define PROPERTY_TRUE 0x05 33 | #define PROPERTY_FALSE 0x06 34 | #define PROPERTY_ARRAY 0x07 35 | #define PROPERTY_SUBGRAPH 0x08 36 | 37 | #define KLASS 0x00 38 | #define ENUM_KLASS 0x01 39 | 40 | 41 | #define DEFAULT_PORT 4445 42 | #define DEFAULT_HOST "127.0.0.1" 43 | 44 | typedef enum { 45 | PT_STRING, 46 | PT_METHOD, 47 | PT_KLASS, 48 | PT_OPTYPE, 49 | PT_INPUTTYPE, 50 | PT_ENUMKLASS, 51 | PT_SIGNATURE 52 | } pool_type; 53 | 54 | struct _MonoGraphDumper { 55 | int fd; 56 | GHashTable *constant_pool; 57 | short next_cp_id; 58 | GHashTable *insn2id; 59 | int next_insn_id; 60 | }; 61 | 62 | typedef struct _MonoGraphDumper MonoGraphDumper; 63 | 64 | struct _ConstantPoolEntry { 65 | pool_type pt; 66 | void *data; 67 | }; 68 | 69 | typedef struct _ConstantPoolEntry ConstantPoolEntry; 70 | #endif /* __MINI_CFGDUMP_H__ */ 71 | -------------------------------------------------------------------------------- /headers/mono/metadata/file-mmap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Managed mmap wrappers. 4 | * 5 | * Authors: 6 | * Rodrigo Kumpera 7 | * 8 | * Copyright 2014 Xamarin Inc (http://www.xamarin.com) 9 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 10 | */ 11 | 12 | #ifndef _MONO_METADATA_FILE_MMAP_H_ 13 | #define _MONO_METADATA_FILE_MMAP_H_ 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | ICALL_EXPORT 23 | void 24 | mono_mmap_close (void *mmap_handle, MonoError *error); 25 | 26 | // inheritability is an enum with the values 0 and 1. 27 | ICALL_EXPORT 28 | void 29 | mono_mmap_configure_inheritability (void *mmap_handle, gint32 inheritability, MonoError *error); 30 | 31 | ICALL_EXPORT 32 | void 33 | mono_mmap_flush (void *mmap_handle, MonoError *error); 34 | 35 | ICALL_EXPORT 36 | void* 37 | mono_mmap_open_file (const gunichar2 *path, gint path_length, int mode, const gunichar2 *mapName, gint mapName_length, gint64 *capacity, int access, int options, int *win32error, MonoError *error); 38 | 39 | ICALL_EXPORT 40 | void* 41 | mono_mmap_open_handle (void *handle, const gunichar2 *mapName, gint mapName_length, gint64 *capacity, int access, int options, int *win32error, MonoError *error); 42 | 43 | ICALL_EXPORT 44 | int 45 | mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void **mmap_handle, void **base_address, MonoError *error); 46 | 47 | ICALL_EXPORT 48 | MonoBoolean 49 | mono_mmap_unmap (void *base_address, MonoError *error); 50 | 51 | #endif /* _MONO_METADATA_FILE_MMAP_H_ */ 52 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-bio.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-bio.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 14/11/15. 6 | // Copyright (c) 2015 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_bio__ 10 | #define __btls__btls_bio__ 11 | 12 | #include 13 | #include "btls-ssl.h" 14 | 15 | typedef enum { 16 | MONO_BTLS_CONTROL_COMMAND_FLUSH = 1 17 | } MonoBtlsControlCommand; 18 | 19 | typedef int (* MonoBtlsReadFunc) (const void *instance, const void *buf, int size, int *wantMore); 20 | typedef int (* MonoBtlsWriteFunc) (const void *instance, const void *buf, int size); 21 | typedef int64_t (* MonoBtlsControlFunc) (const void *instance, MonoBtlsControlCommand command, int64_t arg); 22 | 23 | MONO_API BIO * 24 | mono_btls_bio_mono_new (void); 25 | 26 | MONO_API void 27 | mono_btls_bio_mono_initialize (BIO *bio, const void *instance, 28 | MonoBtlsReadFunc read_func, MonoBtlsWriteFunc write_func, 29 | MonoBtlsControlFunc control_func); 30 | 31 | MONO_API int 32 | mono_btls_bio_read (BIO *bio, void *data, int len); 33 | 34 | MONO_API int 35 | mono_btls_bio_write (BIO *bio, const void *data, int len); 36 | 37 | MONO_API int 38 | mono_btls_bio_flush (BIO *bio); 39 | 40 | MONO_API int 41 | mono_btls_bio_indent (BIO *bio, unsigned indent, unsigned max_indent); 42 | 43 | MONO_API int 44 | mono_btls_bio_hexdump (BIO *bio, const uint8_t *data, int len, unsigned indent); 45 | 46 | MONO_API void 47 | mono_btls_bio_print_errors (BIO *bio); 48 | 49 | MONO_API void 50 | mono_btls_bio_free (BIO *bio); 51 | 52 | MONO_API BIO * 53 | mono_btls_bio_mem_new (void); 54 | 55 | MONO_API int 56 | mono_btls_bio_mem_get_data (BIO *bio, void **data); 57 | 58 | #endif /* defined(__btls__btls_bio__) */ 59 | -------------------------------------------------------------------------------- /headers/mono/mini/aot-compiler.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_AOT_COMPILER_H__ 6 | #define __MONO_AOT_COMPILER_H__ 7 | 8 | #include "mini.h" 9 | 10 | int mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options, gpointer **aot_state); 11 | int mono_compile_deferred_assemblies (guint32 opts, const char *aot_options, gpointer **aot_state); 12 | void* mono_aot_readonly_field_override (MonoClassField *field); 13 | gboolean mono_aot_direct_icalls_enabled_for_method (MonoCompile *cfg, MonoMethod *method); 14 | MONO_LLVM_INTERNAL gboolean mono_aot_is_shared_got_offset (int offset); 15 | 16 | MONO_LLVM_INTERNAL guint32 mono_aot_get_got_offset (MonoJumpInfo *ji); 17 | MONO_LLVM_INTERNAL char* mono_aot_get_method_name (MonoCompile *cfg); 18 | MONO_LLVM_INTERNAL char* mono_aot_get_mangled_method_name (MonoMethod *method); 19 | MONO_LLVM_INTERNAL gboolean mono_aot_is_direct_callable (MonoJumpInfo *patch_info); 20 | MONO_LLVM_INTERNAL gboolean mono_aot_is_externally_callable (MonoMethod *cmethod); 21 | MONO_LLVM_INTERNAL void mono_aot_mark_unused_llvm_plt_entry(MonoJumpInfo *patch_info); 22 | MONO_LLVM_INTERNAL char* mono_aot_get_plt_symbol (MonoJumpInfoType type, gconstpointer data); 23 | MONO_LLVM_INTERNAL char* mono_aot_get_direct_call_symbol (MonoJumpInfoType type, gconstpointer data); 24 | MONO_LLVM_INTERNAL int mono_aot_get_method_index (MonoMethod *method); 25 | MONO_LLVM_INTERNAL MonoJumpInfo* mono_aot_patch_info_dup (MonoJumpInfo* ji); 26 | MONO_LLVM_INTERNAL gboolean mono_aot_can_specialize (MonoMethod *method); 27 | MONO_LLVM_INTERNAL gboolean mono_aot_can_enter_interp (MonoMethod *method); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /headers/mono/metadata/custom-attrs-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_METADATA_CUSTOM_ATTRS_INTERNALS_H__ 6 | #define __MONO_METADATA_CUSTOM_ATTRS_INTERNALS_H__ 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | MonoCustomAttrInfo* 13 | mono_custom_attrs_from_builders (MonoImage *alloc_img, MonoImage *image, MonoArray *cattrs); 14 | 15 | typedef gboolean (*MonoAssemblyMetadataCustomAttrIterFunc) (MonoImage *image, guint32 typeref_scope_token, const gchar* nspace, const gchar* name, guint32 method_token, gpointer user_data); 16 | 17 | void 18 | mono_assembly_metadata_foreach_custom_attr (MonoAssembly *assembly, MonoAssemblyMetadataCustomAttrIterFunc func, gpointer user_data); 19 | 20 | void 21 | mono_class_metadata_foreach_custom_attr (MonoClass *klass, MonoAssemblyMetadataCustomAttrIterFunc func, gpointer user_data); 22 | 23 | gboolean 24 | mono_assembly_is_weak_field (MonoImage *image, guint32 field_idx); 25 | 26 | void 27 | mono_assembly_init_weak_fields (MonoImage *image); 28 | 29 | void 30 | mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArrayHandleOut typed_args_out, MonoArrayHandleOut named_args_out, CattrNamedArg **named_arg_info, MonoError *error); 31 | 32 | void 33 | mono_reflection_create_custom_attr_data_args_noalloc (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, 34 | gpointer **typed_args_out, gpointer **named_args_out, int *num_named_args, 35 | CattrNamedArg **named_arg_info, MonoError *error); 36 | 37 | #endif /* __MONO_METADATA_REFLECTION_CUSTOM_ATTRS_INTERNALS_H__ */ 38 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-util.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-util.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 3/23/16. 6 | // Copyright © 2016 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_util__ 10 | #define __btls__btls_util__ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #ifndef MONO_API 18 | 19 | #if !defined(MONO_DLL_IMPORT) && !defined(MONO_DLL_EXPORT) 20 | #define MONO_DLL_EXPORT 21 | #endif 22 | 23 | #if defined(_MSC_VER) 24 | 25 | #define MONO_API_EXPORT __declspec(dllexport) 26 | #define MONO_API_IMPORT __declspec(dllimport) 27 | 28 | #else 29 | 30 | #if defined (__clang__) || defined (__GNUC__) 31 | #define MONO_API_EXPORT __attribute__ ((__visibility__ ("default"))) 32 | #else 33 | #define MONO_API_EXPORT 34 | #endif 35 | #define MONO_API_IMPORT 36 | 37 | #endif 38 | 39 | #ifdef __cplusplus 40 | #define MONO_EXTERN_C extern "C" 41 | #else 42 | #define MONO_EXTERN_C /* nothing */ 43 | #endif 44 | 45 | #if defined(MONO_DLL_EXPORT) 46 | #define MONO_API_NO_EXTERN_C MONO_API_EXPORT 47 | #elif defined(MONO_DLL_IMPORT) 48 | #define MONO_API_NO_EXTERN_C MONO_API_IMPORT 49 | #else 50 | #define MONO_API_NO_EXTERN_C /* nothing */ 51 | #endif 52 | 53 | #define MONO_API MONO_EXTERN_C MONO_API_NO_EXTERN_C 54 | #endif 55 | 56 | MONO_API void 57 | mono_btls_free (void *data); 58 | 59 | int64_t 60 | mono_btls_util_asn1_time_to_ticks (ASN1_TIME *time); 61 | 62 | int 63 | mono_btls_debug_printf (BIO *bio, const char *format, va_list args); 64 | 65 | OPENSSL_EXPORT void CRYPTO_refcount_inc(CRYPTO_refcount_t *count); 66 | OPENSSL_EXPORT int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *count); 67 | 68 | #endif /* __btls__btls_util__ */ 69 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-utility-thread.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * A lightweight worker thread with lockless messaging 4 | * 5 | * Author: 6 | * Alexander Kyte (alkyte@microsoft.com) 7 | * 8 | * (C) 2018 Microsoft, Inc. 9 | * 10 | */ 11 | #ifndef __MONO_UTILITY_THREAD_H__ 12 | #define __MONO_UTILITY_THREAD_H__ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #define MONO_PRINT_DROPPED_MESSAGES 0 21 | 22 | typedef struct { 23 | void (*early_init) (gpointer *state_ptr); 24 | void (*init) (gpointer *state_ptr); 25 | void (*command) (gpointer state_ptr, gpointer message_ptr, gboolean at_shutdown); 26 | void (*cleanup) (gpointer state_ptr); 27 | } MonoUtilityThreadCallbacks; 28 | 29 | typedef struct { 30 | MonoNativeThreadId thread_id; 31 | 32 | MonoLockFreeQueue work_queue; 33 | MonoSemType work_queue_sem; 34 | gboolean run_thread; 35 | 36 | MonoLockFreeAllocator message_allocator; 37 | MonoLockFreeAllocSizeClass message_size_class; 38 | 39 | size_t message_block_size; 40 | size_t payload_size; 41 | 42 | gpointer state_ptr; 43 | MonoUtilityThreadCallbacks callbacks; 44 | } MonoUtilityThread; 45 | 46 | MonoUtilityThread * 47 | mono_utility_thread_launch (size_t payload_size, MonoUtilityThreadCallbacks *callbacks, MonoMemAccountType accountType); 48 | 49 | void 50 | mono_utility_thread_send (MonoUtilityThread *thread, gpointer message); 51 | 52 | gboolean 53 | mono_utility_thread_send_sync (MonoUtilityThread *thread, gpointer message); 54 | 55 | void 56 | mono_utility_thread_stop (MonoUtilityThread *thread); 57 | 58 | #endif /* __MONO_UTILITY_THREAD_H__ */ 59 | -------------------------------------------------------------------------------- /headers/mono/metadata/w32process-unix-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_ 6 | #define _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_ 7 | 8 | #include 9 | #include 10 | 11 | /* 12 | * FOR EXCLUSIVE USE BY w32process-unix.c 13 | */ 14 | 15 | #if defined(HOST_DARWIN) 16 | #define USE_OSX_BACKEND 17 | #elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(HAVE_LINK_H) 18 | #define USE_BSD_BACKEND 19 | #elif defined(__HAIKU__) 20 | #define USE_HAIKU_BACKEND 21 | /* Define header for team_info */ 22 | #include 23 | #else 24 | #define USE_DEFAULT_BACKEND 25 | #endif 26 | 27 | typedef struct { 28 | gpointer address_start; 29 | gpointer address_end; 30 | gchar *perms; 31 | gpointer address_offset; 32 | guint64 device; 33 | guint64 inode; 34 | gchar *filename; 35 | } MonoW32ProcessModule; 36 | 37 | gchar* 38 | mono_w32process_get_name (pid_t pid); 39 | 40 | GSList* 41 | mono_w32process_get_modules (pid_t pid); 42 | 43 | void 44 | mono_w32process_platform_init_once (void); 45 | 46 | static void G_GNUC_UNUSED 47 | mono_w32process_module_free (MonoW32ProcessModule *module) 48 | { 49 | g_free (module->perms); 50 | g_free (module->filename); 51 | g_free (module); 52 | } 53 | 54 | /* 55 | * Used to look through the GSList* returned by mono_w32process_get_modules 56 | */ 57 | static gint G_GNUC_UNUSED 58 | mono_w32process_module_equals (gconstpointer a, gconstpointer b) 59 | { 60 | MonoW32ProcessModule *want = (MonoW32ProcessModule *)a; 61 | MonoW32ProcessModule *compare = (MonoW32ProcessModule *)b; 62 | return (want->device == compare->device && want->inode == compare->inode) ? 0 : 1; 63 | } 64 | 65 | #endif /* _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_ */ 66 | -------------------------------------------------------------------------------- /headers/mono/utils/gc_wrapper.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2004-2011 Novell, Inc (http://www.novell.com) 4 | * Copyright 2011 Xamarin, Inc (http://www.xamarin.com) 5 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 6 | */ 7 | #ifndef __MONO_OS_GC_WRAPPER_H__ 8 | #define __MONO_OS_GC_WRAPPER_H__ 9 | 10 | #include 11 | #include 12 | 13 | #ifdef HAVE_BOEHM_GC 14 | 15 | # ifdef _MSC_VER 16 | # include 17 | # else 18 | /* libgc specifies this on the command line, 19 | * so we must define it ourselfs 20 | */ 21 | # define GC_GCJ_SUPPORT 22 | # endif 23 | 24 | /* 25 | * Local allocation is only beneficial if we have __thread 26 | * We had to fix a bug with include order in libgc, so only do 27 | * it if it is the included one. 28 | */ 29 | #ifndef HOST_WIN32 // FIXME? 30 | # if defined(MONO_KEYWORD_THREAD) && !defined(__powerpc__) 31 | 32 | /* The local alloc stuff is in pthread_support.c, but solaris uses solaris_threads.c */ 33 | /* It is also disabled on solaris/x86 by libgc/configure.ac */ 34 | /* 35 | * ARM has no definition for some atomic functions in gc_locks.h and 36 | * support is also disabled in libgc/configure.ac. 37 | */ 38 | # if !defined(__sparc__) && !defined(__sun) && !defined(__arm__) && !defined(__mips__) 39 | # define GC_REDIRECT_TO_LOCAL 40 | # endif 41 | # endif 42 | #endif // HOST_WIN32 43 | 44 | # include 45 | # include 46 | # include 47 | # include 48 | 49 | #if defined(HOST_WIN32) 50 | #define CreateThread GC_CreateThread 51 | #endif 52 | 53 | #elif defined(HAVE_SGEN_GC) 54 | 55 | #else /* not Boehm and not sgen GC */ 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /headers/mono/utils/lock-free-array-queue.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * A lock-free somewhat-queue that doesn't 4 | * require hazard pointers. 5 | * 6 | * (C) Copyright 2011 Xamarin Inc. 7 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 8 | */ 9 | #ifndef __MONO_LOCK_FREE_ARRAY_QUEUE_H__ 10 | #define __MONO_LOCK_FREE_ARRAY_QUEUE_H__ 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | typedef struct _MonoLockFreeArrayChunk MonoLockFreeArrayChunk; 17 | 18 | typedef struct { 19 | size_t entry_size; 20 | MonoLockFreeArrayChunk *chunk_list; 21 | MonoMemAccountType account_type; 22 | } MonoLockFreeArray; 23 | 24 | typedef struct { 25 | MonoLockFreeArray array; 26 | gint32 num_used_entries; 27 | } MonoLockFreeArrayQueue; 28 | 29 | #define MONO_LOCK_FREE_ARRAY_INIT(entry_size, account_type) { (entry_size), NULL, (account_type) } 30 | #define MONO_LOCK_FREE_ARRAY_QUEUE_INIT(entry_size, account_type) { MONO_LOCK_FREE_ARRAY_INIT ((entry_size) + sizeof (gpointer), (account_type)), 0 } 31 | 32 | gpointer mono_lock_free_array_nth (MonoLockFreeArray *arr, int index); 33 | 34 | typedef gpointer (*MonoLockFreeArrayIterateFunc) (int index, gpointer entry_ptr, gpointer user_data); 35 | gpointer mono_lock_free_array_iterate (MonoLockFreeArray *arr, MonoLockFreeArrayIterateFunc func, gpointer user_data); 36 | 37 | void mono_lock_free_array_cleanup (MonoLockFreeArray *arr); 38 | 39 | void mono_lock_free_array_queue_push (MonoLockFreeArrayQueue *q, gpointer entry_data_ptr); 40 | gboolean mono_lock_free_array_queue_pop (MonoLockFreeArrayQueue *q, gpointer entry_data_ptr); 41 | 42 | void mono_lock_free_array_queue_cleanup (MonoLockFreeArrayQueue *q); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /VMLVita2D/Vita2D.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | 4 | public class Vita2D 5 | { 6 | public static uint RGBA8(uint r, uint g, uint b, uint a) 7 | { 8 | return ((((a) & 0xFF) << 24) | (((b) & 0xFF) << 16) | (((g) & 0xFF) << 8) | (((r) & 0xFF) << 0)); 9 | } 10 | 11 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 12 | public extern static int Init(); 13 | 14 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 15 | public extern static void SetClearColor(uint color); 16 | 17 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 18 | public extern static int LoadDefaultPGF(); 19 | 20 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 21 | public extern static void StartDrawing(); 22 | 23 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 24 | public extern static void EndDrawing(); 25 | 26 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 27 | public extern static void SwapBuffers(); 28 | 29 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 30 | public extern static void ClearScreen(); 31 | 32 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 33 | public extern static void DrawRectangle(float x, float y, float w, float h, uint color); 34 | 35 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 36 | public extern static void DrawLine(float x0, float y0, float x1, float y1, uint color); 37 | 38 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 39 | public extern static void FillCircle(float x, float y, float radius, uint color); 40 | 41 | [MethodImplAttribute(MethodImplOptions.InternalCall)] 42 | public extern static void PGFDrawText(int font, int x, int y, uint color, float scale, string text); 43 | } -------------------------------------------------------------------------------- /headers/mono/utils/mono-experiments.def: -------------------------------------------------------------------------------- 1 | /* 2 | * Mono Experiments. 3 | * 4 | * Experiments are UNSUPPORTED. Do not rely on experiments in production. 5 | * Experiments are not guaranteed to be stable, backward compatible or 6 | * available in future versions of Mono. 7 | * 8 | */ 9 | 10 | /* Defining experiments: 11 | * use the EXPERIMENT(id,"GH link") format. 12 | * 13 | * id: a unique identifier for the experiment. Will be used in the 14 | * MONO_EXPERIMENT=id1,id2,... environment variable to enable an experiment at 15 | * runtime and a MONO_EXPERIMENT_id enumeration value that can be used to check 16 | * for whether an experiment is enabled. 17 | * 18 | * GH Link: a URL of a GitHub tracking issue for the experiment. The issue is 19 | * closed when the experiment is removed from Mono. 20 | * 21 | * To add a compile-time check for an experiment, see configure.ac macro AC_ARG_ENABLE(experiment,...) 22 | * To add a new compile-time constant ENABLE_EXPERIMENT_myfeaturename: 23 | * 1. Add eval "mono_experiment_test_enable_myfeaturename='yes'" to the mono_experiment_test_enable_all block 24 | * 2. Add a block like 25 | * if test "x$mono_experiment_test_enable_myfeaturename" = "xyes"; then 26 | * AC_DEFINE(ENABLE_EXPERIMENT_myfeaturename, 1, [Enable experiment 'myfeaturename']) 27 | * fi 28 | * 3. use both `#if defined (ENABLE_EXPERIMENT_myfeaturename)` and 29 | * `if (mono_experiment_enabled (MONO_EXPERIMENT_myfeaturename))` to check that the experiment 30 | * is compiled in and also enabled at runtime. 31 | * It is optional to add the compile-time check, but if you add it, add the runtime check too. 32 | */ 33 | #if defined(ENABLE_EXPERIMENT_null) 34 | EXPERIMENT(null,"https://github.com/mono/mono/issues/10877") 35 | #endif 36 | -------------------------------------------------------------------------------- /headers/mono/mini/debugger-agent.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_DEBUGGER_AGENT_H__ 6 | #define __MONO_DEBUGGER_AGENT_H__ 7 | 8 | #include "mini.h" 9 | #include 10 | 11 | #define MONO_DBG_CALLBACKS_VERSION (3) 12 | // 2. debug_log parameters changed from MonoString* to MonoStringHandle 13 | // 3. debug_log parameters changed from MonoStringHandle back to MonoString* 14 | 15 | struct _MonoDebuggerCallbacks { 16 | int version; 17 | void (*parse_options) (char *options); 18 | void (*init) (void); 19 | void (*breakpoint_hit) (void *sigctx); 20 | void (*single_step_event) (void *sigctx); 21 | void (*single_step_from_context) (MonoContext *ctx); 22 | void (*breakpoint_from_context) (MonoContext *ctx); 23 | void (*free_domain_info) (MonoDomain *domain); 24 | void (*unhandled_exception) (MonoException *exc); 25 | void (*handle_exception) (MonoException *exc, MonoContext *throw_ctx, 26 | MonoContext *catch_ctx, StackFrameInfo *catch_frame); 27 | void (*begin_exception_filter) (MonoException *exc, MonoContext *ctx, MonoContext *orig_ctx); 28 | void (*end_exception_filter) (MonoException *exc, MonoContext *ctx, MonoContext *orig_ctx); 29 | void (*user_break) (void); 30 | void (*debug_log) (int level, MonoString *category, MonoString *message); 31 | gboolean (*debug_log_is_enabled) (void); 32 | void (*send_crash) (char *json_dump, MonoStackHash *hashes, int pause); 33 | }; 34 | 35 | typedef struct _DebuggerTlsData DebuggerTlsData; 36 | 37 | MONO_API void 38 | mono_debugger_agent_init (void); 39 | 40 | MONO_API void 41 | mono_debugger_agent_parse_options (char *options); 42 | 43 | void 44 | mono_debugger_agent_stub_init (void); 45 | 46 | MONO_API gboolean 47 | mono_debugger_agent_transport_handshake (void); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /headers/mono/utils/w32api.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_UTILS_W32API_H__ 6 | #define __MONO_UTILS_W32API_H__ 7 | 8 | #include 9 | 10 | #define WAIT_TOO_MANY_POSTS ((gint) 0x0000012A) 11 | #define WAIT_NOT_OWNED_BY_CALLER ((gint) 0x0000012B) 12 | 13 | #ifndef HOST_WIN32 14 | 15 | #define WAIT_FAILED ((gint) 0xFFFFFFFF) 16 | #define WAIT_OBJECT_0 ((gint) 0x00000000) 17 | #define WAIT_ABANDONED_0 ((gint) 0x00000080) 18 | #define WAIT_TIMEOUT ((gint) 0x00000102) 19 | #define WAIT_IO_COMPLETION ((gint) 0x000000C0) 20 | 21 | #define WINAPI 22 | 23 | typedef guint32 DWORD; 24 | typedef gboolean BOOL; 25 | typedef gint32 LONG; 26 | typedef guint32 ULONG; 27 | typedef guint UINT; 28 | 29 | typedef gpointer HANDLE; 30 | typedef gpointer HMODULE; 31 | 32 | #else 33 | 34 | #define __USE_W32_SOCKETS 35 | #include 36 | #include 37 | #include 38 | /* The mingw version says: /usr/i686-pc-mingw32/sys-root/mingw/include/ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead." */ 39 | #ifdef _MSC_VER 40 | #include 41 | #endif 42 | #include 43 | 44 | /* Workaround for missing WSAPOLLFD typedef in mingw's winsock2.h 45 | * that is required for mswsock.h below. Remove once 46 | * http://sourceforge.net/p/mingw/bugs/1980/ is fixed. */ 47 | #if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4 48 | typedef struct pollfd { 49 | SOCKET fd; 50 | short events; 51 | short revents; 52 | } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD; 53 | #endif 54 | 55 | #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) 56 | #include 57 | #endif 58 | 59 | #endif /* HOST_WIN32 */ 60 | 61 | #endif /* __MONO_UTILS_W32API_H__ */ 62 | -------------------------------------------------------------------------------- /headers/mono/metadata/lock-tracer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_METADATA_LOCK_TRACER_H__ 6 | #define __MONO_METADATA_LOCK_TRACER_H__ 7 | 8 | /*This is a private header*/ 9 | #include 10 | 11 | #include "mono/utils/mono-os-mutex.h" 12 | #include "mono/utils/mono-coop-mutex.h" 13 | 14 | typedef enum { 15 | InvalidLock = 0, 16 | LoaderLock, 17 | ImageDataLock, 18 | DomainLock, 19 | DomainAssembliesLock, 20 | DomainJitCodeHashLock, 21 | IcallLock, 22 | AssemblyBindingLock, 23 | MarshalLock, 24 | ClassesLock, 25 | LoaderGlobalDataLock, 26 | ThreadsLock, 27 | } RuntimeLocks; 28 | 29 | #ifdef LOCK_TRACER 30 | 31 | void mono_locks_tracer_init (void); 32 | 33 | void mono_locks_lock_acquired (RuntimeLocks kind, gpointer lock); 34 | void mono_locks_lock_released (RuntimeLocks kind, gpointer lock); 35 | 36 | #else 37 | 38 | #define mono_locks_tracer_init() do {} while (0) 39 | 40 | #define mono_locks_lock_acquired(__UNUSED0, __UNUSED1) do {} while (0) 41 | #define mono_locks_lock_released(__UNUSED0, __UNUSED1) do {} while (0) 42 | 43 | #endif 44 | 45 | #define mono_locks_os_acquire(LOCK,NAME) \ 46 | do { \ 47 | mono_os_mutex_lock (LOCK); \ 48 | mono_locks_lock_acquired (NAME, LOCK); \ 49 | } while (0) 50 | 51 | #define mono_locks_os_release(LOCK,NAME) \ 52 | do { \ 53 | mono_locks_lock_released (NAME, LOCK); \ 54 | mono_os_mutex_unlock (LOCK); \ 55 | } while (0) 56 | 57 | #define mono_locks_coop_acquire(LOCK,NAME) \ 58 | do { \ 59 | mono_coop_mutex_lock (LOCK); \ 60 | mono_locks_lock_acquired (NAME, LOCK); \ 61 | } while (0) 62 | 63 | #define mono_locks_coop_release(LOCK,NAME) \ 64 | do { \ 65 | mono_locks_lock_released (NAME, LOCK); \ 66 | mono_coop_mutex_unlock (LOCK); \ 67 | } while (0) 68 | 69 | #endif /* __MONO_METADATA_LOCK_TRACER_H__ */ 70 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-os-wait.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_UTILS_OS_WAIT_H_ 6 | #define _MONO_UTILS_OS_WAIT_H_ 7 | 8 | #include 9 | #ifdef HOST_WIN32 10 | 11 | #include 12 | #include 13 | #include "mono-error.h" 14 | 15 | DWORD 16 | mono_win32_sleep_ex (DWORD timeout, BOOL alertable); 17 | 18 | DWORD 19 | mono_coop_win32_sleep_ex (DWORD timeout, BOOL alertable); 20 | 21 | DWORD 22 | mono_win32_wait_for_single_object_ex (HANDLE handle, DWORD timeout, BOOL alertable); 23 | 24 | DWORD 25 | mono_coop_win32_wait_for_single_object_ex (HANDLE handle, DWORD timeout, BOOL alertable); 26 | 27 | DWORD 28 | mono_win32_wait_for_multiple_objects_ex (DWORD count, CONST HANDLE *handles, BOOL waitAll, DWORD timeout, BOOL alertable, MonoError *error); 29 | 30 | DWORD 31 | mono_coop_win32_wait_for_multiple_objects_ex (DWORD count, CONST HANDLE *handles, BOOL waitAll, DWORD timeout, BOOL alertable, MonoError *error); 32 | 33 | DWORD 34 | mono_win32_signal_object_and_wait (HANDLE toSignal, HANDLE toWait, DWORD timeout, BOOL alertable); 35 | 36 | DWORD 37 | mono_coop_win32_signal_object_and_wait (HANDLE toSignal, HANDLE toWait, DWORD timeout, BOOL alertable); 38 | 39 | DWORD 40 | mono_win32_msg_wait_for_multiple_objects_ex (DWORD count, CONST HANDLE *handles, DWORD timeout, DWORD wakeMask, DWORD flags); 41 | 42 | DWORD 43 | mono_coop_win32_msg_wait_for_multiple_objects_ex (DWORD count, CONST HANDLE *handles, DWORD timeout, DWORD wakeMask, DWORD flags); 44 | 45 | DWORD 46 | mono_win32_wsa_wait_for_multiple_events (DWORD count, const WSAEVENT FAR *handles, BOOL waitAll, DWORD timeout, BOOL alertable); 47 | 48 | DWORD 49 | mono_coop_win32_wsa_wait_for_multiple_events (DWORD count, const WSAEVENT FAR *handles, BOOL waitAll, DWORD timeout, BOOL alertable); 50 | 51 | #endif 52 | 53 | #endif /* _MONO_UTILS_OS_WAIT_H_ */ 54 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-merp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Support for interop with the Microsoft Error Reporting tool (header) 4 | * 5 | * Author: 6 | * Alexander Kyte (alkyte@microsoft.com) 7 | * 8 | * (C) 2018 Microsoft, Inc. 9 | * 10 | */ 11 | #ifndef __MONO_UTILS_MERP__ 12 | #define __MONO_UTILS_MERP__ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef TARGET_OSX 19 | 20 | /** 21 | * Unregister the MERP-based handler 22 | */ 23 | void mono_merp_disable (void); 24 | 25 | /** 26 | * 27 | * Enable the MERP-based handler and set application-specific information 28 | * 29 | * See MERP documentation for information on the bundle ID, signature, and version fields 30 | */ 31 | void 32 | mono_merp_enable (const char *appBundleID, const char *appSignature, const char *appVersion, const char *merpGUIPath, const char *appPath, const char *configDir); 33 | 34 | /** 35 | * Whether the MERP-based handler is registered 36 | */ 37 | gboolean mono_merp_enabled (void); 38 | 39 | /** 40 | * Create the MERP config file and invoke the merp agent 41 | * 42 | * \arg crashed_pid the PID of the thread that encountered the native fault 43 | * \arg thread_pointer the address of the stack pointer when the native fault occurred 44 | * 45 | * returns: Success of sending message 46 | * 47 | * This either returns after the MERP handler has successfully uploaded crashed_pid's 48 | * crash dump (leaving the caller to call exit), or terminates the runtime 49 | * when the registered telemetry application does not respond. 50 | */ 51 | gboolean 52 | mono_merp_invoke (const intptr_t crashed_pid, const char *signal, const char *dump_file, MonoStackHash *hashes); 53 | 54 | void 55 | mono_merp_add_annotation (const char *key, const char *value); 56 | 57 | #endif // TARGET_OSX 58 | 59 | #endif // MONO_UTILS_MERP 60 | -------------------------------------------------------------------------------- /headers/mono/btls/btls-x509-lookup.h: -------------------------------------------------------------------------------- 1 | // 2 | // btls-x509-lookup.h 3 | // MonoBtls 4 | // 5 | // Created by Martin Baulig on 3/3/16. 6 | // Copyright © 2016 Xamarin. All rights reserved. 7 | // 8 | 9 | #ifndef __btls__btls_x509_lookup__ 10 | #define __btls__btls_x509_lookup__ 11 | 12 | #include 13 | #include "btls-ssl.h" 14 | #include "btls-x509.h" 15 | #include "btls-x509-store.h" 16 | 17 | typedef enum { 18 | MONO_BTLS_X509_LOOKUP_TYPE_UNKNOWN = 0, 19 | MONO_BTLS_X509_LOOKUP_TYPE_FILE, 20 | MONO_BTLS_X509_LOOKUP_TYPE_HASH_DIR, 21 | MONO_BTLS_X509_LOOKUP_TYPE_MONO 22 | } MonoBtlsX509LookupType; 23 | 24 | MONO_API MonoBtlsX509Lookup * 25 | mono_btls_x509_lookup_new (MonoBtlsX509Store *store, MonoBtlsX509LookupType type); 26 | 27 | MONO_API int 28 | mono_btls_x509_lookup_load_file (MonoBtlsX509Lookup *lookup, const char *file, MonoBtlsX509FileType type); 29 | 30 | MONO_API int 31 | mono_btls_x509_lookup_add_dir (MonoBtlsX509Lookup *lookup, const char *dir, MonoBtlsX509FileType type); 32 | 33 | MONO_API MonoBtlsX509Lookup * 34 | mono_btls_x509_lookup_up_ref (MonoBtlsX509Lookup *lookup); 35 | 36 | MONO_API int 37 | mono_btls_x509_lookup_free (MonoBtlsX509Lookup *lookup); 38 | 39 | MONO_API int 40 | mono_btls_x509_lookup_init (MonoBtlsX509Lookup *lookup); 41 | 42 | MONO_API MonoBtlsX509LookupType 43 | mono_btls_x509_lookup_get_type (MonoBtlsX509Lookup *lookup); 44 | 45 | MONO_API X509_LOOKUP * 46 | mono_btls_x509_lookup_peek_lookup (MonoBtlsX509Lookup *lookup); 47 | 48 | MONO_API int 49 | mono_btls_x509_lookup_shutdown (MonoBtlsX509Lookup *lookup); 50 | 51 | MONO_API X509 * 52 | mono_btls_x509_lookup_by_subject (MonoBtlsX509Lookup *lookup, MonoBtlsX509Name *name); 53 | 54 | MONO_API X509 * 55 | mono_btls_x509_lookup_by_fingerprint (MonoBtlsX509Lookup *lookup, unsigned char *bytes, int len); 56 | 57 | #endif /* defined(__btls__btls_x509_lookup__) */ 58 | 59 | -------------------------------------------------------------------------------- /headers/mono/metadata/dynamic-image-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright 2016 Microsoft 4 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | */ 6 | #ifndef __MONO_METADATA_DYNAMIC_IMAGE_INTERNALS_H__ 7 | #define __MONO_METADATA_DYNAMIC_IMAGE_INTERNALS_H__ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | typedef struct { 14 | guint32 import_lookup_table; 15 | guint32 timestamp; 16 | guint32 forwarder; 17 | guint32 name_rva; 18 | guint32 import_address_table_rva; 19 | } MonoIDT; 20 | 21 | typedef struct { 22 | guint32 name_rva; 23 | guint32 flags; 24 | } MonoILT; 25 | 26 | 27 | typedef enum { 28 | MONO_DYN_IMAGE_TOK_NEW, /* assert if same token is registered already */ 29 | MONO_DYN_IMAGE_TOK_SAME_OK, /* allow collision only with the same object */ 30 | MONO_DYN_IMAGE_TOK_REPLACE, /* keep the new object, always */ 31 | } MonoDynamicImageTokCollision; 32 | 33 | void 34 | mono_dynamic_images_init (void); 35 | 36 | void 37 | mono_dynamic_image_register_token (MonoDynamicImage *assembly, guint32 token, MonoObjectHandle obj, int tok_collision); 38 | 39 | gboolean 40 | mono_dynamic_image_is_valid_token (MonoDynamicImage *image, guint32 token); 41 | 42 | MonoObjectHandle 43 | mono_dynamic_image_get_registered_token (MonoDynamicImage *dynimage, guint32 token, MonoError *error); 44 | 45 | MonoDynamicImage* 46 | mono_dynamic_image_create (MonoDynamicAssembly *assembly, char *assembly_name, char *module_name); 47 | 48 | guint32 49 | mono_dynamic_image_add_to_blob_cached (MonoDynamicImage *assembly, gconstpointer b1, int s1, gconstpointer b2, int s2); 50 | 51 | void 52 | mono_dynimage_alloc_table (MonoDynamicTable *table, guint nrows); 53 | 54 | #endif /* __MONO_METADATA_DYNAMIC_IMAGE_INTERNALS_H__ */ 55 | -------------------------------------------------------------------------------- /headers/mono/mini/debugger-state-machine.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Types for the debugger state machine and wire protocol 4 | * 5 | * Author: 6 | * Alexander Kyte (alkyte@microsoft.com) 7 | * 8 | * (C) 2018 Microsoft, Inc. 9 | * 10 | */ 11 | #ifndef __MONO_DEBUGGER_STATE_MACHINE__ 12 | #define __MONO_DEBUGGER_STATE_MACHINE__ 13 | 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include "debugger-agent.h" 20 | 21 | typedef enum { 22 | MONO_DEBUGGER_STARTED = 0, 23 | MONO_DEBUGGER_RESUMED = 1, 24 | MONO_DEBUGGER_SUSPENDED = 2, 25 | MONO_DEBUGGER_TERMINATED = 3, 26 | } MonoDebuggerThreadState; 27 | 28 | void 29 | mono_debugger_log_init (void); 30 | 31 | void 32 | mono_debugger_log_free (void); 33 | 34 | void 35 | mono_debugger_log_exit (int exit_code); 36 | 37 | void 38 | mono_debugger_log_add_bp (gpointer key, MonoMethod *method, long il_offset); 39 | 40 | void 41 | mono_debugger_log_remove_bp (gpointer key, MonoMethod *method, long il_offset); 42 | 43 | void 44 | mono_debugger_log_command (const char *command_set, const char *command, guint8 *buf, int len); 45 | 46 | void 47 | mono_debugger_log_event (DebuggerTlsData *tls, const char *event, guint8 *buf, int len); 48 | 49 | void 50 | mono_debugger_log_bp_hit (DebuggerTlsData *tls, MonoMethod *method, long il_offset); 51 | 52 | void 53 | mono_debugger_log_resume (DebuggerTlsData *tls); 54 | 55 | void 56 | mono_debugger_log_suspend (DebuggerTlsData *tls); 57 | 58 | #if 0 59 | #define DEBUGGER_STATE_MACHINE_DEBUG(level, ...) 60 | #else 61 | #define DEBUGGER_STATE_MACHINE_DEBUG(level, ...) g_async_safe_printf(__VA_ARGS__) 62 | #endif 63 | 64 | void 65 | mono_debugger_state (JsonWriter *writer); 66 | 67 | char * 68 | mono_debugger_state_str (void); 69 | 70 | #endif // __MONO_DEBUGGER_STATE_MACHINE__ 71 | -------------------------------------------------------------------------------- /headers/mono/metadata/verify.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_METADATA_VERIFY_H__ 6 | #define __MONO_METADATA_VERIFY_H__ 7 | 8 | #include 9 | #include 10 | #include 11 | #include /* GSList dep */ 12 | 13 | MONO_BEGIN_DECLS 14 | 15 | typedef enum { 16 | MONO_VERIFY_OK, 17 | MONO_VERIFY_ERROR, 18 | MONO_VERIFY_WARNING, 19 | MONO_VERIFY_CLS = 4, 20 | MONO_VERIFY_ALL = 7, 21 | 22 | /* Status signaling code that is not verifiable.*/ 23 | MONO_VERIFY_NOT_VERIFIABLE = 8, 24 | 25 | /*OR it with other flags*/ 26 | 27 | /* Abort the verification if the code is not verifiable. 28 | * The standard behavior is to abort if the code is not valid. 29 | * */ 30 | MONO_VERIFY_FAIL_FAST = 16, 31 | 32 | 33 | /* Perform less verification of the code. This flag should be used 34 | * if one wants the verifier to be more compatible to the MS runtime. 35 | * Mind that this is not to be more compatible with MS peverify, but 36 | * with the runtime itself, that has a less strict verifier. 37 | */ 38 | MONO_VERIFY_NON_STRICT = 32, 39 | 40 | /*Skip all visibility related checks*/ 41 | MONO_VERIFY_SKIP_VISIBILITY = 64, 42 | 43 | /*Skip all visibility related checks*/ 44 | MONO_VERIFY_REPORT_ALL_ERRORS = 128 45 | 46 | } MonoVerifyStatus; 47 | 48 | typedef struct { 49 | char *message; 50 | MonoVerifyStatus status; 51 | } MonoVerifyInfo; 52 | 53 | typedef struct { 54 | MonoVerifyInfo info; 55 | int8_t exception_type; /*should be one of MONO_EXCEPTION_* */ 56 | } MonoVerifyInfoExtended; 57 | 58 | 59 | MONO_API GSList* mono_method_verify (MonoMethod *method, int level); 60 | MONO_API void mono_free_verify_list (GSList *list); 61 | MONO_API char* mono_verify_corlib (void); 62 | 63 | MONO_END_DECLS 64 | 65 | #endif /* __MONO_METADATA_VERIFY_H__ */ 66 | 67 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-time.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __UTILS_MONO_TIME_H__ 6 | #define __UTILS_MONO_TIME_H__ 7 | 8 | #include 9 | #include 10 | #ifdef HAVE_SYS_TIME_H 11 | #include 12 | #endif 13 | 14 | /* Returns the number of milliseconds from boot time: this should be monotonic 15 | * 16 | * Prefer to use mono_msec_ticks for elapsed time calculation. */ 17 | gint64 mono_msec_boottime (void); 18 | 19 | /* Returns the number of milliseconds ticks from unspecified time: this should be monotonic */ 20 | gint64 mono_msec_ticks (void); 21 | 22 | /* Returns the number of 100ns ticks from unspecified time: this should be monotonic */ 23 | gint64 mono_100ns_ticks (void); 24 | 25 | /* Returns the number of 100ns ticks since 1/1/1601, UTC timezone */ 26 | gint64 mono_100ns_datetime (void); 27 | 28 | #ifndef HOST_WIN32 29 | gint64 mono_100ns_datetime_from_timeval (struct timeval tv); 30 | #endif 31 | 32 | /* Stopwatch class for internal runtime use */ 33 | typedef struct { 34 | gint64 start, stop; 35 | } MonoStopwatch; 36 | 37 | static inline void 38 | mono_stopwatch_start (MonoStopwatch *w) 39 | { 40 | w->start = mono_100ns_ticks (); 41 | w->stop = 0; 42 | } 43 | 44 | static inline void 45 | mono_stopwatch_stop (MonoStopwatch *w) 46 | { 47 | w->stop = mono_100ns_ticks (); 48 | } 49 | 50 | static inline guint64 51 | mono_stopwatch_elapsed (MonoStopwatch *w) 52 | { 53 | return (w->stop - w->start) / 10; 54 | } 55 | 56 | static inline guint64 57 | mono_stopwatch_elapsed_ms (MonoStopwatch *w) 58 | { 59 | return (mono_stopwatch_elapsed (w) + 500) / 1000; 60 | } 61 | 62 | // Expand non-portable strftime shorthands. 63 | #define MONO_STRFTIME_F "%Y-%m-%d" // %F in some systems, but this works on all. 64 | #define MONO_STRFTIME_T "%H:%M:%S" // %T in some systems, but this works on all. 65 | 66 | #endif /* __UTILS_MONO_TIME_H__ */ 67 | -------------------------------------------------------------------------------- /headers/mono/metadata/opcodes.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_METADATA_OPCODES_H__ 6 | #define __MONO_METADATA_OPCODES_H__ 7 | 8 | /* 9 | * opcodes.h: CIL instruction information 10 | * 11 | * Author: 12 | * Paolo Molaro (lupus@ximian.com) 13 | * 14 | * (C) 2002 Ximian, Inc. 15 | */ 16 | 17 | #include 18 | 19 | MONO_BEGIN_DECLS 20 | 21 | #define MONO_CUSTOM_PREFIX 0xf0 22 | 23 | #define OPDEF(a,b,c,d,e,f,g,h,i,j) \ 24 | MONO_ ## a, 25 | 26 | typedef enum MonoOpcodeEnum { 27 | MonoOpcodeEnum_Invalid = -1, 28 | #include "mono/cil/opcode.def" 29 | MONO_CEE_LAST 30 | } MonoOpcodeEnum; 31 | 32 | #undef OPDEF 33 | 34 | enum { 35 | MONO_FLOW_NEXT, 36 | MONO_FLOW_BRANCH, 37 | MONO_FLOW_COND_BRANCH, 38 | MONO_FLOW_ERROR, 39 | MONO_FLOW_CALL, 40 | MONO_FLOW_RETURN, 41 | MONO_FLOW_META 42 | }; 43 | 44 | enum { 45 | MonoInlineNone = 0, 46 | MonoInlineType = 1, 47 | MonoInlineField = 2, 48 | MonoInlineMethod = 3, 49 | MonoInlineTok = 4, 50 | MonoInlineString = 5, 51 | MonoInlineSig = 6, 52 | MonoInlineVar = 7, 53 | MonoShortInlineVar = 8, 54 | MonoInlineBrTarget = 9, 55 | MonoShortInlineBrTarget = 10, 56 | MonoInlineSwitch = 11, 57 | MonoInlineR = 12, 58 | MonoShortInlineR = 13, 59 | MonoInlineI = 14, 60 | MonoShortInlineI = 15, 61 | MonoInlineI8 = 16, 62 | }; 63 | 64 | typedef struct { 65 | unsigned char argument; 66 | unsigned char flow_type; 67 | unsigned short opval; 68 | } MonoOpcode; 69 | 70 | MONO_API_DATA const MonoOpcode mono_opcodes []; 71 | 72 | MONO_API const char* 73 | mono_opcode_name (int opcode); 74 | 75 | MONO_API MonoOpcodeEnum 76 | mono_opcode_value (const mono_byte **ip, const mono_byte *end); 77 | 78 | MONO_END_DECLS 79 | 80 | #endif /* __MONO_METADATA_OPCODES_H__ */ 81 | 82 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-machine.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * machine definitions 4 | * 5 | * Authors: 6 | * Rodrigo Kumpera (kumpera@gmail.com) 7 | * 8 | * Copyright (c) 2011 Novell, Inc (http://www.novell.com) 9 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 10 | */ 11 | 12 | #ifndef __MONO_MONO_MACHINE_H__ 13 | #define __MONO_MONO_MACHINE_H__ 14 | 15 | /* C type matching the size of a machine register. Not always the same as 'int' */ 16 | /* Note that member 'p' of MonoInst must be the same type, as OP_PCONST is defined 17 | * as one of the OP_ICONST types, so inst_c0 must be the same as inst_p0 18 | */ 19 | 20 | #include "config.h" 21 | #include 22 | 23 | // __ILP32__ means integer, long, and pointers are 32bits, and nothing about registers. 24 | // MONO_ARCH_ILP32 means integer, long, and pointers are 32bits, and 64bit registers. 25 | // This is for example x32, arm6432, mipsn32, Alpha/NT. 26 | #ifdef MONO_ARCH_ILP32 27 | typedef gint64 host_mgreg_t; 28 | typedef guint64 host_umgreg_t; 29 | #else 30 | typedef gssize host_mgreg_t; 31 | typedef gsize host_umgreg_t; 32 | #endif 33 | 34 | /* SIZEOF_REGISTER ... machine register size of target machine 35 | * TARGET_SIZEOF_VOID_P ... pointer size of target machine 36 | * 37 | * SIZEOF_REGISTER is usually the same as TARGET_SIZEOF_VOID_P, except when MONO_ARCH_ILP32 is defined 38 | */ 39 | #if SIZEOF_REGISTER == 4 40 | typedef gint32 target_mgreg_t; 41 | #else 42 | typedef gint64 target_mgreg_t; 43 | #endif 44 | 45 | /* Alignment for MonoArray.vector */ 46 | #if defined(_AIX) 47 | /* 48 | * HACK: doubles in structs always align to 4 on AIX... even on 64-bit, 49 | * which is bad for aligned usage like what System.Array.FastCopy does 50 | */ 51 | typedef guint64 mono_64bitaligned_t; 52 | #else 53 | typedef double mono_64bitaligned_t; 54 | #endif 55 | 56 | #endif /* __MONO_MONO_MACHINE_H__ */ 57 | -------------------------------------------------------------------------------- /headers/mono/mini/mini-llvm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_MINI_LLVM_H__ 6 | #define __MONO_MINI_LLVM_H__ 7 | 8 | #include "mini.h" 9 | #include "aot-runtime.h" 10 | 11 | /* LLVM backend */ 12 | 13 | typedef enum { 14 | LLVM_MODULE_FLAG_STATIC = (1 << 0), 15 | LLVM_MODULE_FLAG_LLVM_ONLY = (1 << 1), 16 | LLVM_MODULE_FLAG_DWARF = (1 << 2), 17 | LLVM_MODULE_FLAG_CODEVIEW = (1 << 3), 18 | LLVM_MODULE_FLAG_INTERP = (1 << 4) 19 | } LLVMModuleFlags; 20 | 21 | /* KEEP THIS IN SYNCH WITH mini-llvm-loaded.c */ 22 | MONO_LLVM_INTERNAL void mono_llvm_init (void); 23 | MONO_LLVM_INTERNAL void mono_llvm_cleanup (void); 24 | MONO_LLVM_INTERNAL void mono_llvm_emit_method (MonoCompile *cfg); 25 | MONO_LLVM_INTERNAL void mono_llvm_emit_call (MonoCompile *cfg, MonoCallInst *call); 26 | MONO_LLVM_INTERNAL void mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix, int initial_got_size, LLVMModuleFlags flags); 27 | MONO_LLVM_INTERNAL void mono_llvm_emit_aot_module (const char *filename, const char *cu_name); 28 | MONO_LLVM_INTERNAL void mono_llvm_emit_aot_file_info (MonoAotFileInfo *info, gboolean has_jitted_code); 29 | MONO_LLVM_INTERNAL void mono_llvm_emit_aot_data (const char *symbol, guint8 *data, int data_len); 30 | MONO_LLVM_INTERNAL void mono_llvm_check_method_supported (MonoCompile *cfg); 31 | MONO_LLVM_INTERNAL void mono_llvm_free_domain_info (MonoDomain *domain); 32 | MONO_API void mono_personality (void); 33 | int mono_llvm_load (const char* bpath); 34 | MONO_LLVM_INTERNAL void mono_llvm_create_vars (MonoCompile *cfg); 35 | MONO_LLVM_INTERNAL void mono_llvm_fixup_aot_module (void); 36 | 37 | gboolean mini_llvm_init (void); 38 | MONO_LLVM_INTERNAL MonoCPUFeatures mono_llvm_get_cpu_features (void); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /headers/mono/metadata/loaded-images-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_IMAGE_HASHES_H_ 6 | #define _MONO_METADATA_IMAGE_HASHES_H_ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | /* 15 | * The "loaded images" hashes keep track of the various assemblies and netmodules loaded 16 | * There are four, for all combinations of [look up by path or assembly name?] 17 | * and [normal or reflection-only load?, as in Assembly.ReflectionOnlyLoad] 18 | */ 19 | enum { 20 | MONO_LOADED_IMAGES_HASH_PATH = 0, 21 | MONO_LOADED_IMAGES_HASH_PATH_REFONLY = 1, 22 | MONO_LOADED_IMAGES_HASH_NAME = 2, 23 | MONO_LOADED_IMAGES_HASH_NAME_REFONLY = 3, 24 | MONO_LOADED_IMAGES_HASH_COUNT = 4 25 | }; 26 | 27 | struct _MonoLoadedImages { 28 | MonoAssemblyLoadContext *owner; /* NULL if global */ 29 | GHashTable *loaded_images_hashes [MONO_LOADED_IMAGES_HASH_COUNT]; 30 | }; 31 | 32 | void 33 | mono_loaded_images_init (MonoLoadedImages *li, MonoAssemblyLoadContext *owner); 34 | 35 | void 36 | mono_loaded_images_cleanup (MonoLoadedImages *li, gboolean shutdown); 37 | 38 | void 39 | mono_loaded_images_free (MonoLoadedImages *li); 40 | 41 | GHashTable * 42 | mono_loaded_images_get_hash (MonoLoadedImages *li, gboolean refonly); 43 | 44 | GHashTable * 45 | mono_loaded_images_get_by_name_hash (MonoLoadedImages *li, gboolean refonly); 46 | 47 | gboolean 48 | mono_loaded_images_remove_image (MonoImage *image); 49 | 50 | MonoLoadedImages* 51 | mono_image_get_loaded_images_for_modules (MonoImage *image); 52 | 53 | #ifndef ENABLE_NETCORE 54 | MonoLoadedImages* 55 | mono_get_global_loaded_images (void); 56 | #endif 57 | 58 | MonoImage * 59 | mono_find_image_owner (void *ptr); 60 | 61 | void 62 | mono_images_lock (void); 63 | 64 | void 65 | mono_images_unlock (void); 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /headers/mono/sgen/sgen-layout-stats.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Copyright Xamarin Inc (http://www.xamarin.com) 4 | * 5 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 6 | */ 7 | #ifndef __MONO_SGEN_LAYOUT_STATS_H__ 8 | #define __MONO_SGEN_LAYOUT_STATS_H__ 9 | 10 | #ifdef SGEN_OBJECT_LAYOUT_STATISTICS 11 | 12 | #define SGEN_OBJECT_LAYOUT_BITMAP_BITS 16 13 | 14 | void sgen_object_layout_scanned_bitmap (unsigned int bitmap); 15 | void sgen_object_layout_scanned_bitmap_overflow (void); 16 | void sgen_object_layout_scanned_ref_array (void); 17 | void sgen_object_layout_scanned_vtype_array (void); 18 | 19 | void sgen_object_layout_dump (FILE *out); 20 | 21 | #define SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP unsigned int __object_layout_bitmap = 0 22 | #define SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP(o,p) do { \ 23 | int __index = ((void**)(p)) - ((void**)(((char*)(o)) + SGEN_CLIENT_OBJECT_HEADER_SIZE)); \ 24 | if (__index >= SGEN_OBJECT_LAYOUT_BITMAP_BITS) \ 25 | __object_layout_bitmap = (unsigned int)-1; \ 26 | else if (__object_layout_bitmap != (unsigned int)-1) \ 27 | __object_layout_bitmap |= (1 << __index); \ 28 | } while (0) 29 | #define SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP do { \ 30 | if (__object_layout_bitmap == (unsigned int)-1) \ 31 | sgen_object_layout_scanned_bitmap_overflow (); \ 32 | else \ 33 | sgen_object_layout_scanned_bitmap (__object_layout_bitmap); \ 34 | } while (0) 35 | 36 | #else 37 | 38 | #define sgen_object_layout_scanned_bitmap(bitmap) 39 | #define sgen_object_layout_scanned_bitmap_overflow() 40 | #define sgen_object_layout_scanned_ref_array() 41 | #define sgen_object_layout_scanned_vtype_array() 42 | 43 | #define sgen_object_layout_dump(out) 44 | 45 | #define SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP 46 | #define SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP(o,p) 47 | #define SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP 48 | 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-value-hash.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * A hash table which only stores values in the hash nodes. 4 | * 5 | * Author: 6 | * Mark Probst (mark.probst@gmail.com) 7 | * Zoltan Varga (vargaz@gmail.com) 8 | * 9 | * (C) 2008 Novell, Inc. 10 | * 11 | */ 12 | #ifndef __MONO_UTILS_MONO_VALUE_HASH__ 13 | #define __MONO_UTILS_MONO_VALUE_HASH__ 14 | 15 | #include 16 | #include "mono-compiler.h" 17 | 18 | /* 19 | * This is a hash table with the following features/restrictions: 20 | * - Keys are not stored in the table, instead a function must be supplied which 21 | * computes them from the value. 22 | * - Values are assumed to be normal pointers, i.e. their lowest 2-3 bits should be 23 | * zero. 24 | * - NULL values are not allowed. 25 | * - It uses internal probing instead of chaining. 26 | * - The above restrictions mean that this hash table will be somewhat slower than 27 | * hash tables which store the key (or even the key hash) in the hash nodes. But 28 | * it also means that each hash node has a size of one machine word, instead of 29 | * 4 in GHashTable. 30 | * - Removal of entries is not supported, as it is not needed by the runtime right 31 | * now. 32 | */ 33 | 34 | typedef struct _MonoValueHashTable MonoValueHashTable; 35 | 36 | typedef gpointer (*MonoValueHashKeyExtractFunc) (gpointer value); 37 | 38 | MonoValueHashTable* mono_value_hash_table_new (GHashFunc hash_func, 39 | GEqualFunc key_equal_func, 40 | MonoValueHashKeyExtractFunc key_extract); 41 | 42 | void 43 | mono_value_hash_table_destroy (MonoValueHashTable *table); 44 | 45 | gpointer 46 | mono_value_hash_table_lookup (MonoValueHashTable *table, gconstpointer key); 47 | 48 | /* The key pointer is actually only passed here to check a debugging 49 | assertion and to make the API look more familiar. */ 50 | void 51 | mono_value_hash_table_insert (MonoValueHashTable *table, 52 | gpointer key, gpointer value); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-dl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_UTILS_DL_H__ 6 | #define __MONO_UTILS_DL_H__ 7 | 8 | #include "mono/utils/mono-compiler.h" 9 | #include "mono/utils/mono-dl-fallback.h" 10 | #include "mono/utils/refcount.h" 11 | 12 | #ifdef TARGET_WIN32 13 | #define MONO_SOLIB_EXT ".dll" 14 | #elif defined(TARGET_MACH) 15 | #define MONO_SOLIB_EXT ".dylib" 16 | #else 17 | #define MONO_SOLIB_EXT ".so" 18 | #endif 19 | 20 | typedef struct { 21 | // Only used in native-library.c, native library lock should be held when modifying 22 | // Incremented on NativeLibrary.Load calls, decremented on NativeLibrary.Free 23 | MonoRefCount ref; 24 | void *handle; 25 | int main_module; 26 | char *full_name; 27 | /* If not NULL, use the methods in MonoDlFallbackHandler instead of the LL_* methods */ 28 | MonoDlFallbackHandler *dl_fallback; 29 | } MonoDl; 30 | 31 | MONO_EXTERN_C 32 | MonoDl* mono_dl_open (const char *name, int flags, char **error_msg) MONO_LLVM_INTERNAL_NO_EXTERN_C; 33 | MONO_EXTERN_C 34 | char* mono_dl_symbol (MonoDl *module, const char *name, void **symbol) MONO_LLVM_INTERNAL_NO_EXTERN_C; 35 | MONO_EXTERN_C 36 | void mono_dl_close (MonoDl *module) MONO_LLVM_INTERNAL_NO_EXTERN_C; 37 | 38 | char* mono_dl_build_path (const char *directory, const char *name, void **iter); 39 | 40 | MonoDl* mono_dl_open_runtime_lib (const char *lib_name, int flags, char **error_msg); 41 | 42 | 43 | //Platform API for mono_dl 44 | const char* mono_dl_get_so_prefix (void); 45 | const char** mono_dl_get_so_suffixes (void); 46 | void* mono_dl_open_file (const char *file, int flags); 47 | void mono_dl_close_handle (MonoDl *module); 48 | void* mono_dl_lookup_symbol (MonoDl *module, const char *name); 49 | int mono_dl_convert_flags (int flags); 50 | char* mono_dl_current_error_string (void); 51 | int mono_dl_get_executable_path (char *buf, int buflen); 52 | const char* mono_dl_get_system_dir (void); 53 | 54 | #endif /* __MONO_UTILS_DL_H__ */ 55 | 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VitaMonoLoader 2 | Standalone mono loader for PS Vita 3 | 4 | WIP 5 | 6 | # Usage 7 | Only Windows is supported for host. VDS (SCE SDK) and vitasdk are supported for PSP2. 8 | ### Installation (host side) 9 | 1. Download and install latest [Mono for Windows](https://www.mono-project.com/download/stable/) 10 | 2. Download ```UnitySetup-Playstation-Vita-Support-for-Editor-2018.3.0a2.exe```, open it as archive and extract ```$INSTDIR$_59_``` folder 11 | 3. Add following to your PATH enviroment variable: 12 | - ```/bin``` (where mono.exe is located) 13 | - ```/Tools``` (where mono-xcompiler.exe is located) 14 | 4. Add Mono ```headers``` from this repository to your SDK installation 15 | ### Installation (PSP2 side) 16 | 1. Download and install [CapUnlocker](https://github.com/GrapheneCt/CapUnlocker) plugin 17 | 1. Copy ```Media``` folder from extracted Unity support installer to ```app0:``` 18 | 2. Copy ```machine.config``` from extracted Unity support installer to ```app0:Media/Managed/mono/2.0``` 19 | 3. Copy modules from current release to ```app0:Media/Modules``` 20 | ### Compiling C# code 21 | 1. Compile your C# code to managed .dll by executing: ```mcs -sdk:2 -target:library -out:.dll .cs``` 22 | 2. Compile your managed .dll to AOT assembly .s by executing: ```mono-xcompiler.exe --aot=full,asmonly,nodebug,static .dll``` 23 | 3. Add AOT assembly .s files as compile targets in your Vita app project 24 | 4. __Your PSP2 application must be compiled in ARM mode:__ 25 | - For VDS (SCE SDK): use -Xthumb=0 (can also be set in project settings) 26 | - For vitasdk: compile with -marm 27 | ### Using AOT assembly on PSP2 28 | 1. Copy managed .dll file to ```app0:Media/Managed``` 29 | 2. Add AOT assembly .s file as compilation target in your PSP2 self project 30 | 3. To load AOT assembly on PSP2, call: 31 | ``` 32 | extern void** mono_aot_module__info; 33 | 34 | VMLRegisterAssembly(mono_aot_module__info); 35 | ``` 36 | -------------------------------------------------------------------------------- /headers/mono/dis/dump.h: -------------------------------------------------------------------------------- 1 | extern FILE *output; 2 | 3 | void dump_table_assembly (MonoImage *m); 4 | void dump_table_assemblyref (MonoImage *m); 5 | void dump_table_class_layout (MonoImage *m); 6 | void dump_table_constant (MonoImage *m); 7 | void dump_table_customattr (MonoImage *m); 8 | void dump_table_declsec (MonoImage *m); 9 | void dump_table_property (MonoImage *m); 10 | void dump_table_property_map (MonoImage *m); 11 | void dump_table_event (MonoImage *m); 12 | void dump_table_file (MonoImage *m); 13 | void dump_table_moduleref (MonoImage *m); 14 | void dump_table_module (MonoImage *m); 15 | void dump_table_method (MonoImage *m); 16 | void dump_table_methodimpl (MonoImage *m); 17 | void dump_table_methodsem (MonoImage *m); 18 | void dump_table_field (MonoImage *m); 19 | void dump_table_manifest (MonoImage *m); 20 | void dump_table_memberref (MonoImage *m); 21 | void dump_table_param (MonoImage *m); 22 | void dump_table_typedef (MonoImage *m); 23 | void dump_table_typeref (MonoImage *m); 24 | void dump_table_typespec (MonoImage *m); 25 | void dump_table_exported (MonoImage *m); 26 | void dump_table_nestedclass (MonoImage *m); 27 | void dump_table_interfaceimpl (MonoImage *m); 28 | void dump_table_field_marshal (MonoImage *m); 29 | void dump_table_genericpar (MonoImage *m); 30 | void dump_table_methodspec (MonoImage *m); 31 | void dump_table_parconstraint(MonoImage *m); 32 | void dump_table_implmap (MonoImage *m); 33 | void dump_table_fieldrva (MonoImage *m); 34 | void dump_table_standalonesig (MonoImage *m); 35 | void dump_table_methodptr (MonoImage *m); 36 | void dump_table_fieldptr (MonoImage *m); 37 | void dump_table_paramptr (MonoImage *m); 38 | void dump_table_eventptr (MonoImage *m); 39 | void dump_table_propertyptr (MonoImage *m); 40 | void dump_stream_blob (MonoImage *m); 41 | void dump_stream_strings (MonoImage *m); 42 | void dump_stream_us (MonoImage *m); 43 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-codeman.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_CODEMAN_H__ 6 | #define __MONO_CODEMAN_H__ 7 | 8 | #include 9 | 10 | typedef struct _MonoCodeManager MonoCodeManager; 11 | 12 | #define MONO_CODE_MANAGER_CALLBACKS \ 13 | MONO_CODE_MANAGER_CALLBACK (void, chunk_new, (void *chunk, int size)) \ 14 | MONO_CODE_MANAGER_CALLBACK (void, chunk_destroy, (void *chunk)) \ 15 | 16 | typedef struct { 17 | 18 | #undef MONO_CODE_MANAGER_CALLBACK 19 | #define MONO_CODE_MANAGER_CALLBACK(ret, name, sig) ret (*name) sig; 20 | 21 | MONO_CODE_MANAGER_CALLBACKS 22 | 23 | } MonoCodeManagerCallbacks; 24 | 25 | MonoCodeManager* mono_code_manager_new (void); 26 | MonoCodeManager* mono_code_manager_new_dynamic (void); 27 | void mono_code_manager_destroy (MonoCodeManager *cman); 28 | void mono_code_manager_invalidate (MonoCodeManager *cman); 29 | void mono_code_manager_set_read_only (MonoCodeManager *cman); 30 | 31 | void* mono_code_manager_reserve_align (MonoCodeManager *cman, int size, int alignment); 32 | 33 | void* mono_code_manager_reserve (MonoCodeManager *cman, int size); 34 | void mono_code_manager_commit (MonoCodeManager *cman, void *data, int size, int newsize); 35 | int mono_code_manager_size (MonoCodeManager *cman, int *used_size); 36 | void mono_code_manager_init (void); 37 | void mono_code_manager_cleanup (void); 38 | void mono_code_manager_install_callbacks (const MonoCodeManagerCallbacks* callbacks); 39 | 40 | /* find the extra block allocated to resolve branches close to code */ 41 | typedef int (*MonoCodeManagerFunc) (void *data, int csize, int size, void *user_data); 42 | void mono_code_manager_foreach (MonoCodeManager *cman, MonoCodeManagerFunc func, void *user_data); 43 | 44 | void mono_codeman_enable_write (void); 45 | void mono_codeman_disable_write (void); 46 | 47 | #endif /* __MONO_CODEMAN_H__ */ 48 | 49 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-complex.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * C99 Complex math cross-platform support code 4 | * 5 | * Author: 6 | * Joao Matos (joao.matos@xamarin.com) 7 | * 8 | * Copyright 2015 Xamarin, Inc (http://www.xamarin.com) 9 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 10 | */ 11 | 12 | #include 13 | #include 14 | #define _USE_MATH_DEFINES // needed by MSVC to define math constants 15 | #include 16 | 17 | #ifndef ENABLE_NETCORE 18 | 19 | typedef struct double_complex { 20 | double real; 21 | double imag; 22 | } double_complex; 23 | 24 | #define mono_creal(c) ((c).real) 25 | #define mono_cimag(c) ((c).imag) 26 | 27 | static inline 28 | double_complex mono_double_complex_make(gdouble re, gdouble im) 29 | { 30 | double_complex const a = { re, im }; 31 | return a; 32 | } 33 | 34 | static inline 35 | double_complex mono_double_complex_scalar_div(double_complex c, gdouble s) 36 | { 37 | return mono_double_complex_make (mono_creal (c) / s, mono_cimag (c) / s); 38 | } 39 | 40 | static inline 41 | double_complex mono_double_complex_scalar_mul(double_complex c, gdouble s) 42 | { 43 | return mono_double_complex_make (mono_creal (c) * s, mono_cimag (c) * s); 44 | } 45 | 46 | static inline 47 | double_complex mono_double_complex_div(double_complex left, double_complex right) 48 | { 49 | double denom = mono_creal (right) * mono_creal (right) + mono_cimag (right) * mono_cimag (right); 50 | 51 | return mono_double_complex_make( 52 | (mono_creal (left) * mono_creal (right) + mono_cimag (left) * mono_cimag (right)) / denom, 53 | (-mono_creal (left) * mono_cimag (right) + mono_cimag (left) * mono_creal (right)) / denom); 54 | } 55 | 56 | static inline 57 | double_complex mono_double_complex_sub(double_complex left, double_complex right) 58 | { 59 | return mono_double_complex_make (mono_creal (left) - mono_creal (right), mono_cimag (left) 60 | - mono_cimag (right)); 61 | } 62 | 63 | #include "../../support/libm/complex.c" 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /headers/mono/metadata/locales.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * Culture-sensitive handling 4 | * 5 | * Authors: 6 | * Dick Porter (dick@ximian.com) 7 | * 8 | * (C) 2003 Ximian, Inc. 9 | */ 10 | 11 | #ifndef _MONO_METADATA_LOCALES_H_ 12 | #define _MONO_METADATA_LOCALES_H_ 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | 19 | #if !ENABLE_NETCORE 20 | 21 | /* This is a copy of System.Globalization.CompareOptions */ 22 | typedef enum { 23 | CompareOptions_None=0x00, 24 | CompareOptions_IgnoreCase=0x01, 25 | CompareOptions_IgnoreNonSpace=0x02, 26 | CompareOptions_IgnoreSymbols=0x04, 27 | CompareOptions_IgnoreKanaType=0x08, 28 | CompareOptions_IgnoreWidth=0x10, 29 | CompareOptions_StringSort=0x20000000, 30 | CompareOptions_Ordinal=0x40000000 31 | } MonoCompareOptions; 32 | 33 | typedef struct NumberFormatEntryManaged NumberFormatEntryManaged; 34 | 35 | ICALL_EXPORT 36 | gconstpointer 37 | ves_icall_System_Globalization_CultureData_fill_number_data (gint32 number_index, NumberFormatEntryManaged *managed); 38 | 39 | ICALL_EXPORT 40 | void ves_icall_System_Globalization_CultureInfo_construct_internal_locale (MonoCultureInfo *this_obj, MonoString *locale); 41 | 42 | ICALL_EXPORT 43 | void ves_icall_System_Globalization_CompareInfo_construct_compareinfo (MonoCompareInfo *comp, MonoString *locale); 44 | 45 | ICALL_EXPORT gint32 46 | ves_icall_System_Globalization_CompareInfo_internal_compare (const gunichar2 *str1, gint32 len1, 47 | const gunichar2 *str2, gint32 len2, gint32 options); 48 | 49 | ICALL_EXPORT 50 | void ves_icall_System_Globalization_CompareInfo_free_internal_collator (MonoCompareInfo *this_obj); 51 | 52 | ICALL_EXPORT gint32 53 | ves_icall_System_Globalization_CompareInfo_internal_index (const gunichar2 *source, gint32 sindex, 54 | gint32 count, const gunichar2 *value, gint32 value_length, MonoBoolean first); 55 | 56 | #endif /* !ENABLE_NETCORE */ 57 | 58 | #define MONO_LOCALE_INVARIANT (0x007F) 59 | 60 | #endif /* _MONO_METADATA_FILEIO_H_ */ 61 | -------------------------------------------------------------------------------- /headers/mono/utils/mono-hwcap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef __MONO_UTILS_HWCAP_H__ 6 | #define __MONO_UTILS_HWCAP_H__ 7 | 8 | #include 9 | #include 10 | 11 | #include "config.h" 12 | 13 | #include "mono/utils/mono-compiler.h" 14 | 15 | #define MONO_HWCAP_VAR(NAME) extern gboolean mono_hwcap_ ## NAME; 16 | #include "mono/utils/mono-hwcap-vars.h" 17 | #undef MONO_HWCAP_VAR 18 | 19 | /* Call this function to perform hardware feature detection. Until 20 | * this function has been called, all feature variables will be 21 | * FALSE as a default. 22 | * 23 | * While this function can be called multiple times, doing so from 24 | * several threads at the same time is not supported as it will 25 | * result in an inconsistent state of the variables. Further, 26 | * feature variables should not be read *while* this function is 27 | * executing. 28 | */ 29 | void mono_hwcap_init (void); 30 | 31 | /* Implemented in mono-hwcap-$TARGET.c. Do not call. */ 32 | void mono_hwcap_arch_init (void); 33 | 34 | /* Print detected features to stdout. */ 35 | void mono_hwcap_print (void); 36 | 37 | /* Please note: If you're going to use the Linux auxiliary vector 38 | * to detect CPU features, don't use any of the constant names in 39 | * the hwcap.h header. This ties us to a particular version of the 40 | * header, and since the values are guaranteed to be stable, hard- 41 | * coding them is not that terrible. 42 | * 43 | * Also, please do not add assumptions to mono-hwcap. The code here 44 | * is meant to *discover* facts about the hardware, not assume that 45 | * some feature exists because of $arbitrary_preprocessor_define. 46 | * If you have to make assumptions, do so elsewhere, e.g. in the 47 | * Mini back end you're modifying. 48 | * 49 | * Finally, be conservative. If you can't determine precisely if a 50 | * feature is present, assume that it isn't. In the rare cases where 51 | * the hardware or operating system are lying, work around that in 52 | * a different place, as with the rule above. 53 | */ 54 | 55 | #endif /* __MONO_UTILS_HWCAP_H__ */ 56 | -------------------------------------------------------------------------------- /headers/mono/metadata/w32process-internals.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | */ 4 | 5 | #ifndef _MONO_METADATA_W32PROCESS_INTERNALS_H_ 6 | #define _MONO_METADATA_W32PROCESS_INTERNALS_H_ 7 | 8 | #include 9 | #include 10 | 11 | #ifndef HOST_WIN32 12 | 13 | typedef struct { 14 | guint32 dwSignature; /* Should contain 0xFEEF04BD on le machines */ 15 | guint32 dwStrucVersion; 16 | guint32 dwFileVersionMS; 17 | guint32 dwFileVersionLS; 18 | guint32 dwProductVersionMS; 19 | guint32 dwProductVersionLS; 20 | guint32 dwFileFlagsMask; 21 | guint32 dwFileFlags; 22 | guint32 dwFileOS; 23 | guint32 dwFileType; 24 | guint32 dwFileSubtype; 25 | guint32 dwFileDateMS; 26 | guint32 dwFileDateLS; 27 | } VS_FIXEDFILEINFO; 28 | 29 | typedef struct { 30 | gpointer lpBaseOfDll; 31 | guint32 SizeOfImage; 32 | gpointer EntryPoint; 33 | } MODULEINFO; 34 | 35 | #define VS_FF_DEBUG 0x0001 36 | #define VS_FF_PRERELEASE 0x0002 37 | #define VS_FF_PATCHED 0x0004 38 | #define VS_FF_PRIVATEBUILD 0x0008 39 | #define VS_FF_INFOINFERRED 0x0010 40 | #define VS_FF_SPECIALBUILD 0x0020 41 | 42 | guint32 43 | mono_w32process_get_pid (gpointer handle); 44 | 45 | gboolean 46 | mono_w32process_try_get_modules (gpointer process, gpointer *modules, guint32 size, guint32 *needed); 47 | 48 | gboolean 49 | mono_w32process_module_get_name (gpointer process, gpointer module, gunichar2 **str, guint32 *len); 50 | 51 | gboolean 52 | mono_w32process_module_get_filename (gpointer process, gpointer module, gunichar2 **str, guint32 *len); 53 | 54 | gboolean 55 | mono_w32process_module_get_information (gpointer process, gpointer module, MODULEINFO *modinfo, guint32 size); 56 | 57 | gboolean 58 | mono_w32process_get_fileversion_info (const gunichar2 *filename, gpointer *data); 59 | 60 | gboolean 61 | mono_w32process_ver_query_value (gconstpointer datablock, const gunichar2 *subblock, gpointer *buffer, guint32 *len); 62 | 63 | guint32 64 | mono_w32process_ver_language_name (guint32 lang, gunichar2 *lang_out, guint32 lang_len); 65 | 66 | #endif /* HOST_WIN32 */ 67 | 68 | #endif /* _MONO_METADATA_W32PROCESS_INTERNALS_H_ */ 69 | -------------------------------------------------------------------------------- /headers/mono/profiler/aot.h: -------------------------------------------------------------------------------- 1 | #ifndef __MONO_PROFILER_AOT_H__ 2 | #define __MONO_PROFILER_AOT_H__ 3 | 4 | #include 5 | 6 | /* 7 | * File format: 8 | * - magic (AOT_PROFILER_MAGIC) 9 | * - int: major/minor version, e.g. 0x00010000 (AOT_PROFILER_MAJOR_VERSION, AOT_PROFILER_MINOR_VERSION) 10 | * - sequence of records terminated by an AOTPROF_RECORD_NONE record 11 | * 12 | * Record format: 13 | * - byte: record type (AotProfRecordType) 14 | * - int: record id (unique across all record types in the file) 15 | * - followed by record specific data (see below) 16 | * 17 | * Encoding rules: 18 | * - int: 4 bytes little endian 19 | * - string: int length followed by UTF-8 data (no null terminator) 20 | */ 21 | 22 | typedef enum { 23 | /* 24 | * Indicates EOF. No additional record data. 25 | */ 26 | AOTPROF_RECORD_NONE, 27 | /* 28 | * Contains info about a loaded image. 29 | * - string: assembly name 30 | * - string: module mvid 31 | */ 32 | AOTPROF_RECORD_IMAGE, 33 | /* 34 | * Contains info about a type referenced by other records. 35 | * - byte: MONO_TYPE_CLASS 36 | * - int: record id for the containing image (AOTPROF_RECORD_IMAGE) 37 | * - int: record id for the generic instance or -1 if N/A (AOTPROF_RECORD_GINST) 38 | * - string: type name 39 | */ 40 | AOTPROF_RECORD_TYPE, 41 | /* 42 | * Contains info about a generic instantiation of a type or method. 43 | * - int: type argument count 44 | * - for 0 .. type argument count: 45 | * -- int: record id for the type argument (AOTPROF_RECORD_TYPE) 46 | */ 47 | AOTPROF_RECORD_GINST, 48 | /* 49 | * Contains info about a JITed method. 50 | * - int: record id for the containing class (AOTPROF_RECORD_TYPE) 51 | * - int: record id for the generic instance or -1 if N/A (AOTPROF_RECORD_GINST) 52 | * - int: parameter count 53 | * - string: method name 54 | * - string: method signature 55 | */ 56 | AOTPROF_RECORD_METHOD 57 | } AotProfRecordType; 58 | 59 | #define AOT_PROFILER_MAGIC "AOTPROFILE" 60 | 61 | #define AOT_PROFILER_MAJOR_VERSION 1 62 | #define AOT_PROFILER_MINOR_VERSION 0 63 | 64 | #endif /* __MONO_PROFILER_AOT_H__ */ 65 | -------------------------------------------------------------------------------- /headers/mono/utils/jemalloc/Makefile.am: -------------------------------------------------------------------------------- 1 | MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules 2 | 3 | # 4 | # Conditional submodule for jemalloc 5 | # 6 | # make reset-jemalloc will checkout a version of jemalloc which is suitable for this version of mono 7 | # into $top_srcdir/jemalloc/jemalloc. 8 | # 9 | 10 | JEMALLOC_PATH=jemalloc 11 | 12 | SUBMODULES_CONFIG_FILE = $(top_srcdir)/mono/utils/jemalloc/SUBMODULES.json 13 | include $(top_srcdir)/scripts/submodules/versions.mk 14 | 15 | $(eval $(call ValidateVersionTemplate,jemalloc,JEMALLOC)) 16 | 17 | # Bump the given submodule to the revision given by the REV make variable 18 | # If COMMIT is 1, commit the change 19 | bump-jemalloc: __bump-version-jemalloc 20 | 21 | # Bump the given submodule to the branch given by the BRANCH/REMOTE_BRANCH make variables 22 | # If COMMIT is 1, commit the change 23 | bump-branch-jemalloc: __bump-branch-jemalloc 24 | 25 | # Bump the given submodule to its current GIT version 26 | # If COMMIT is 1, commit the change 27 | bump-current-jemalloc: __bump-current-version-jemalloc 28 | 29 | clean-local: 30 | $(RM) -r $(JEMALLOC_PATH) 31 | 32 | EXTRA_DIST=SUBMODULES.json 33 | 34 | if MONO_JEMALLOC_ASSERT 35 | ASSERT_OPT=--enable-debug 36 | endif 37 | 38 | jemalloc: 39 | $(MAKE) reset-jemalloc 40 | 41 | # Set a prefix to enable access to allocation functions with a prefix, ie so mono_jemalloc isn't named malloc by default 42 | # Disable zone allocator, otherwise malloc uses jemalloc for things it's not set for 43 | # We call autoconf ourselves so we can call configure and not autogen. Autogen script is broken, minor bash issues around quote escaping 44 | jemalloc/lib/libjemalloc.a: jemalloc Makefile 45 | cd jemalloc && autoconf && ./configure --with-jemalloc-prefix=mono_je --prefix=`pwd` --enable-debug $(JEMALLOC_AUTOCONF_FLAGS) --disable-zone-allocator EXTRA_CFLAGS="-I $(top_srcdir) $(GLIB_CFLAGS) $(CFLAGS) $(PLATFORM_CFLAGS) $(ARCH_CFLAGS) $(SHARED_CFLAGS) -Wno-error" CC="$(CC)" CXX="$(CXX)" CPPFLAGS="$(CPPFLAGS) $(JEMALLOC_CPPFLAGS) " CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" 46 | 47 | cd jemalloc && $(MAKE) build_lib_static 48 | 49 | all-local: jemalloc/lib/libjemalloc.a 50 | 51 | 52 | -------------------------------------------------------------------------------- /headers/mono/metadata/mono-hash.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * GC-aware hashtable, based on Eglib's Hashtable 4 | * 5 | * Authors: 6 | * Paolo Molaro (lupus@xamarin.com) 7 | * 8 | * Copyright 2013 Xamarin Inc (http://www.xamarin.com) 9 | * Licensed under the MIT license. See LICENSE file in the project root for full license information. 10 | */ 11 | 12 | #ifndef __MONO_G_HASH_H__ 13 | #define __MONO_G_HASH_H__ 14 | 15 | #include 16 | 17 | /* do not change the values of this enum */ 18 | typedef enum { 19 | MONO_HASH_KEY_GC = 1, 20 | MONO_HASH_VALUE_GC = 2, 21 | MONO_HASH_KEY_VALUE_GC = MONO_HASH_KEY_GC | MONO_HASH_VALUE_GC, 22 | } MonoGHashGCType; 23 | 24 | extern gint32 mono_g_hash_table_max_chain_length; 25 | 26 | typedef struct _MonoGHashTable MonoGHashTable; 27 | 28 | MONO_API MONO_RT_EXTERNAL_ONLY MonoGHashTable * 29 | mono_g_hash_table_new_type (GHashFunc hash_func, GEqualFunc key_equal_func, MonoGHashGCType type, MonoGCRootSource source, void *key, const char *msg); 30 | MONO_API guint mono_g_hash_table_size (MonoGHashTable *hash); 31 | MONO_API gpointer mono_g_hash_table_lookup (MonoGHashTable *hash, gconstpointer key); 32 | MONO_API gboolean mono_g_hash_table_lookup_extended (MonoGHashTable *hash, gconstpointer key, gpointer *orig_key, gpointer *value); 33 | MONO_API void mono_g_hash_table_foreach (MonoGHashTable *hash, GHFunc func, gpointer user_data); 34 | MONO_API gpointer mono_g_hash_table_find (MonoGHashTable *hash, GHRFunc predicate, gpointer user_data); 35 | MONO_API gboolean mono_g_hash_table_remove (MonoGHashTable *hash, gconstpointer key); 36 | MONO_API guint mono_g_hash_table_foreach_remove (MonoGHashTable *hash, GHRFunc func, gpointer user_data); 37 | MONO_API void mono_g_hash_table_destroy (MonoGHashTable *hash); 38 | MONO_API MONO_RT_EXTERNAL_ONLY void mono_g_hash_table_insert (MonoGHashTable *h, gpointer k, gpointer v); 39 | MONO_API void mono_g_hash_table_replace (MonoGHashTable *h, gpointer k, gpointer v); 40 | MONO_API void mono_g_hash_table_print_stats (MonoGHashTable *table); 41 | 42 | #endif /* __MONO_G_HASH_H__ */ 43 | -------------------------------------------------------------------------------- /headers/mono/mini/optflags-def.h: -------------------------------------------------------------------------------- 1 | // This file must be sorted based on the second column. 2 | // i.e. so that designated initializers are not required. 3 | OPTFLAG(PEEPHOLE ,0, "peephole", "Peephole postpass") 4 | OPTFLAG(BRANCH ,1, "branch", "Branch optimizations") 5 | OPTFLAG(INLINE ,2, "inline", "Inline method calls") 6 | OPTFLAG(CFOLD ,3, "cfold", "Constant folding") 7 | OPTFLAG(CONSPROP ,4, "consprop", "Constant propagation") 8 | OPTFLAG(COPYPROP ,5, "copyprop", "Copy propagation") 9 | OPTFLAG(DEADCE ,6, "deadce", "Dead code elimination") 10 | OPTFLAG(LINEARS ,7, "linears", "Linear scan global reg allocation") 11 | OPTFLAG(CMOV ,8, "cmov", "Conditional moves") 12 | OPTFLAG(SHARED ,9, "shared", "Emit per-domain code") 13 | OPTFLAG(SCHED ,10, "sched", "Instruction scheduling") 14 | OPTFLAG(INTRINS ,11, "intrins", "Intrinsic method implementations") 15 | OPTFLAG(TAILCALL ,12, "tailc", "Tail recursion and tailcalls") 16 | OPTFLAG(LOOP ,13, "loop", "Loop related optimizations") 17 | OPTFLAG(FCMOV ,14, "fcmov", "Fast x86 FP compares") 18 | OPTFLAG(LEAF ,15, "leaf", "Leaf procedures optimizations") 19 | OPTFLAG(AOT ,16, "aot", "Usage of Ahead Of Time compiled code") 20 | OPTFLAG(PRECOMP ,17, "precomp", "Precompile all methods before executing Main") 21 | OPTFLAG(ABCREM ,18, "abcrem", "Array bound checks removal") 22 | OPTFLAG(SSAPRE ,19, "ssapre", "SSA based Partial Redundancy Elimination (obsolete)") 23 | OPTFLAG(EXCEPTION,20, "exception", "Optimize exception catch blocks") 24 | OPTFLAG(SSA ,21, "ssa", "Use plain SSA form") 25 | OPTFLAG(FLOAT32 ,22, "float32", "Use 32 bit float arithmetic if possible") 26 | OPTFLAG(SSE2 ,23, "sse2", "SSE2 instructions on x86") 27 | OPTFLAG(GSHAREDVT,24, "gsharedvt", "Generic sharing for valuetypes") 28 | OPTFLAG (GSHARED, 25, "gshared", "Generic Sharing") 29 | OPTFLAG(SIMD ,26, "simd", "Simd intrinsics") 30 | OPTFLAG(UNSAFE ,27, "unsafe", "Remove bound checks and perform other dangerous changes") 31 | OPTFLAG(ALIAS_ANALYSIS ,28, "alias-analysis", "Alias analysis of locals") 32 | --------------------------------------------------------------------------------